@progress/kendo-vue-inputs 7.0.1-develop.2 → 7.0.1-develop.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/checkbox/Checkbox.js +1 -1
- package/checkbox/Checkbox.mjs +23 -19
- package/colors/ColorGradient.js +2 -2
- package/colors/ColorGradient.mjs +10 -10
- package/colors/ColorPalette.js +1 -1
- package/colors/ColorPalette.mjs +16 -16
- package/colors/ColorPicker.js +1 -1
- package/colors/ColorPicker.mjs +16 -16
- package/colors/FlatColorPicker.js +1 -1
- package/colors/FlatColorPicker.mjs +35 -35
- package/colors/HexInput.js +1 -1
- package/colors/HexInput.mjs +15 -11
- package/dist/cdn/js/kendo-vue-inputs.js +1 -1
- package/index.d.mts +559 -226
- package/index.d.ts +559 -226
- package/input/Input.js +1 -1
- package/input/Input.mjs +39 -35
- package/maskedtextbox/MaskedTextBox.js +1 -1
- package/maskedtextbox/MaskedTextBox.mjs +12 -5
- package/numerictextbox/NumericTextBox.js +1 -1
- package/numerictextbox/NumericTextBox.mjs +11 -7
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +9 -9
- package/radiobutton/RadioButton.js +1 -1
- package/radiobutton/RadioButton.mjs +30 -24
- package/radiobutton/RadioGroup.js +1 -1
- package/radiobutton/RadioGroup.mjs +30 -30
- package/rating/Rating.js +1 -1
- package/rating/Rating.mjs +34 -30
- package/rating/RatingItem.js +1 -1
- package/rating/RatingItem.mjs +4 -4
- package/signature/Signature.js +1 -1
- package/signature/Signature.mjs +11 -11
- package/slider/Slider.js +1 -1
- package/slider/Slider.mjs +18 -14
- package/switch/Switch.js +1 -1
- package/switch/Switch.mjs +15 -11
- package/textarea/TextArea.js +1 -1
- package/textarea/TextArea.mjs +18 -18
- package/textbox/TextBox.js +1 -1
- package/textbox/TextBox.mjs +25 -21
package/input/Input.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),n=require("@progress/kendo-vue-common"),c=require("../package-metadata.js"),f=require("@progress/kendo-vue-labels");function m(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!a.isVNode(t)}const y=a.defineComponent({model:{event:"changemodel"},emits:{input:t=>!0,change:t=>!0,changemodel:t=>!0,"update:modelValue":t=>!0,focus:t=>!0,blur:t=>!0,keyup:t=>!0,keydown:t=>!0,keypress:t=>!0},props:{modelValue:{type:[String,Number],default:void 0},disabled:{type:Boolean,default:void 0},defaultValue:{type:[String,Number],default:""},value:{type:[String,Number]},label:{type:String},placeholder:{type:String},required:{type:Boolean,default:!1},size:{type:String,default:"medium",validator:function(t){return[null,"small","medium","large"].includes(t)}},rounded:{type:String,default:"medium",validator:function(t){return[null,"small","medium","large","full"].includes(t)}},fillMode:{type:String,default:"solid",validator:function(t){return[null,"solid","flat","outline"].includes(t)}},dir:{type:String},id:String,valid:{type:Boolean,default:void 0},validate:{type:Boolean},validationMessage:{type:String},validityStyles:{type:Boolean,default:!0},inputClass:String,tabIndex:Number,ariaLabel:String,ariaLabelledBy:String,ariaDescribedBy:String},data:function(){return{hasMounted:!1,autofill:!1,currentValue:"",valueDuringOnChange:"",focused:!1}},created(){n.validatePackage(c.packageMetadata),this._input=void 0,this._inputId=n.guid(),this.$data.valueDuringOnChange=void 0,this.$data.currentValue=this.$props.defaultValue},mounted(){this._input=this.inputRef,this.$data.hasMounted=!0,this.setValidity()},updated(){this.setValidity(),this.updateValidClass()},setup(){return{inputRef:a.ref(null)}},render(){const t=!this.$props.validityStyles||this.validity().valid,{label:e,id:i,required:l,tabIndex:u,ariaLabel:r,ariaLabelledBy:o,ariaDescribedBy:p}=this.$props,d=i||this._inputId,s=a.h("input",{...this.$attrs,placeholder:this.$props.placeholder,id:d,tabindex:u,required:l,ariaLabel:r,ariaLabelledby:o,ariaDescribedby:p,ariaDisabled:this.$props.disabled,disabled:this.$props.disabled,value:this.computedValue,class:this.inputInnerClass,ref:h=>{this.inputRef=h},onKeydown:this.handleKeydown,onKeyup:this.handleKeyup,onKeypress:this.handleKeypress,onChange:this.handleChange,onFocus:this.emitFocus,onBlur:this.emitBlur,onInput:this.handleInput,onAnimationstart:this.handleAutoFill,onAnimationend:this.handleAutoFillEnd});return e?a.createVNode(f.FloatingLabel,{label:e,editorId:d,editorValue:this.computedValue,editorValid:t,editorDisabled:this.$props.disabled,editorPlaceholder:this.$data.focused?this.$props.placeholder:"",dir:this.$props.dir},m(s)?s:{default:()=>[s]}):s},methods:{updateValidClass(){this._input.classList.toggle("k-invalid",!this.validity().valid)},emitFocus(t){this.$emit("focus",{event:t}),this.$data.focused=!0},emitBlur(t){this.$emit("blur",{event:t}),this.$data.focused=!1},handleKeydown(t){this.$emit("keydown",t)},handleKeyup(t){this.$emit("keyup",t)},handleKeypress(t){this.$emit("keypress",t)},clearClick(t){this.emitUpdate(t,"change","")},focus(){this._input&&this._input.focus()},validity(){const t={badInput:this._input?this._input.validity.badInput:!1,patternMismatch:this._input?this._input.validity.patternMismatch:!1,rangeOverflow:this._input?this._input.validity.rangeOverflow:!1,rangeUnderflow:this._input?this._input.validity.rangeUnderflow:!1,stepMismatch:this._input?this._input.validity.stepMismatch:!1,tooLong:this._input?this._input.validity.tooLong:!1,tooShort:this._input?this._input.validity.tooShort:!1,typeMismatch:this._input?this._input.validity.typeMismatch:!1,valueMissing:this._input?this._input.validity.valueMissing:!1};return{...t,customError:this.$props.validationMessage!==void 0,valid:this.$props.valid!==void 0?this.$props.valid:this._input?!this.isInvalid(t):!0}},isInvalid(t){let e=!1;for(let i in t)t.hasOwnProperty(i)&&(e=e||t[i]);return e},setValidity(){this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity().valid?"":this.$props.validationMessage||"")},handleInput(t){this.emitUpdate(t,"input",t.target.value)},handleChange(t){this.emitUpdate(t,"change",t.target.value)},emitUpdate(t,e,i){this.disabled||(this.$data.currentValue=i,this.$data.valueDuringOnChange=i,this.$nextTick(()=>{this.$emit("changemodel",i),this.$emit("update:modelValue",i),this.$emit(e,{event:t,value:i,component:this,target:t.target,validity:this.validity()}),this.$data.valueDuringOnChange=void 0}))},handleAutoFill(t){if(t.animationName==="autoFillStart"){let e=t.target.parentNode;e&&e.classList.contains("k-empty")&&(this.$data.autofill=!0,e.classList.remove("k-empty"))}},handleAutoFillEnd(t){t.animationName==="autoFillEnd"&&t.target.parentNode&&(this.$data.autofill=!1)},name:function(){return this.$props.name}},computed:{spanClassNames(){const t=!this.$data.hasMounted||!this.$props.validityStyles||this.validity().valid;return{"k-floating-label-container":!0,"k-focus":this.$data.focused,"k-empty":!(this.computedValue===0||this.computedValue||this.$props.placeholder||this.$data.autofill),"k-autofill":this.$data.autofill,"k-invalid":!t&&t!==void 0,"k-rtl":this.$props.dir==="rtl"}},inputInnerClass(){const{size:t,fillMode:e,rounded:i}=this.$props,l=!this.$data.hasMounted||!this.$props.validityStyles||this.validity().valid;return{"k-input":!0,[`k-input-${n.kendoThemeMaps.sizeMap[t]||t}`]:t,[`k-input-${e}`]:e,[`k-rounded-${n.kendoThemeMaps.roundedMap[i]||i}`]:i,"k-invalid":!l,"k-required":this.required,"k-disabled":this.$props.disabled,[this.inputClass]:this.inputClass}},computedValue(){return this.$data.valueDuringOnChange!==void 0?this.$data.valueDuringOnChange:this.$props.value!==void 0?this.$props.value:this.$props.modelValue!==void 0?this.$props.modelValue:this.$data.currentValue}}});exports.Input=y;
|
package/input/Input.mjs
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import { defineComponent as h, h as f, createVNode as c, ref as m, isVNode as y } from "vue";
|
|
9
|
-
import { kendoThemeMaps as
|
|
9
|
+
import { kendoThemeMaps as l, validatePackage as v, guid as g } from "@progress/kendo-vue-common";
|
|
10
10
|
import { packageMetadata as $ } from "../package-metadata.mjs";
|
|
11
11
|
import { FloatingLabel as b } from "@progress/kendo-vue-labels";
|
|
12
12
|
function V(t) {
|
|
@@ -17,15 +17,15 @@ const M = /* @__PURE__ */ h({
|
|
|
17
17
|
event: "changemodel"
|
|
18
18
|
},
|
|
19
19
|
emits: {
|
|
20
|
-
input:
|
|
21
|
-
change:
|
|
22
|
-
changemodel:
|
|
23
|
-
"update:modelValue":
|
|
24
|
-
focus:
|
|
25
|
-
blur:
|
|
26
|
-
keyup:
|
|
27
|
-
keydown:
|
|
28
|
-
keypress:
|
|
20
|
+
input: (t) => !0,
|
|
21
|
+
change: (t) => !0,
|
|
22
|
+
changemodel: (t) => !0,
|
|
23
|
+
"update:modelValue": (t) => !0,
|
|
24
|
+
focus: (t) => !0,
|
|
25
|
+
blur: (t) => !0,
|
|
26
|
+
keyup: (t) => !0,
|
|
27
|
+
keydown: (t) => !0,
|
|
28
|
+
keypress: (t) => !0
|
|
29
29
|
},
|
|
30
30
|
props: {
|
|
31
31
|
modelValue: {
|
|
@@ -108,7 +108,7 @@ const M = /* @__PURE__ */ h({
|
|
|
108
108
|
};
|
|
109
109
|
},
|
|
110
110
|
created() {
|
|
111
|
-
|
|
111
|
+
v($), this._input = void 0, this._inputId = g(), this.$data.valueDuringOnChange = void 0, this.$data.currentValue = this.$props.defaultValue;
|
|
112
112
|
},
|
|
113
113
|
mounted() {
|
|
114
114
|
this._input = this.inputRef, this.$data.hasMounted = !0, this.setValidity();
|
|
@@ -123,17 +123,17 @@ const M = /* @__PURE__ */ h({
|
|
|
123
123
|
},
|
|
124
124
|
render() {
|
|
125
125
|
const t = !this.$props.validityStyles || this.validity().valid, {
|
|
126
|
-
label:
|
|
127
|
-
id:
|
|
126
|
+
label: e,
|
|
127
|
+
id: i,
|
|
128
128
|
required: s,
|
|
129
129
|
tabIndex: d,
|
|
130
130
|
ariaLabel: u,
|
|
131
131
|
ariaLabelledBy: r,
|
|
132
132
|
ariaDescribedBy: o
|
|
133
|
-
} = this.$props,
|
|
133
|
+
} = this.$props, n = i || this._inputId, a = f("input", {
|
|
134
134
|
...this.$attrs,
|
|
135
135
|
placeholder: this.$props.placeholder,
|
|
136
|
-
id:
|
|
136
|
+
id: n,
|
|
137
137
|
tabindex: d,
|
|
138
138
|
required: s,
|
|
139
139
|
ariaLabel: u,
|
|
@@ -156,9 +156,9 @@ const M = /* @__PURE__ */ h({
|
|
|
156
156
|
onAnimationstart: this.handleAutoFill,
|
|
157
157
|
onAnimationend: this.handleAutoFillEnd
|
|
158
158
|
});
|
|
159
|
-
return
|
|
160
|
-
label:
|
|
161
|
-
editorId:
|
|
159
|
+
return e ? c(b, {
|
|
160
|
+
label: e,
|
|
161
|
+
editorId: n,
|
|
162
162
|
editorValue: this.computedValue,
|
|
163
163
|
editorValid: t,
|
|
164
164
|
editorDisabled: this.$props.disabled,
|
|
@@ -173,10 +173,14 @@ const M = /* @__PURE__ */ h({
|
|
|
173
173
|
this._input.classList.toggle("k-invalid", !this.validity().valid);
|
|
174
174
|
},
|
|
175
175
|
emitFocus(t) {
|
|
176
|
-
this.$emit("focus",
|
|
176
|
+
this.$emit("focus", {
|
|
177
|
+
event: t
|
|
178
|
+
}), this.$data.focused = !0;
|
|
177
179
|
},
|
|
178
180
|
emitBlur(t) {
|
|
179
|
-
this.$emit("blur",
|
|
181
|
+
this.$emit("blur", {
|
|
182
|
+
event: t
|
|
183
|
+
}), this.$data.focused = !1;
|
|
180
184
|
},
|
|
181
185
|
handleKeydown(t) {
|
|
182
186
|
this.$emit("keydown", t);
|
|
@@ -212,10 +216,10 @@ const M = /* @__PURE__ */ h({
|
|
|
212
216
|
};
|
|
213
217
|
},
|
|
214
218
|
isInvalid(t) {
|
|
215
|
-
let
|
|
216
|
-
for (let
|
|
217
|
-
t.hasOwnProperty(
|
|
218
|
-
return
|
|
219
|
+
let e = !1;
|
|
220
|
+
for (let i in t)
|
|
221
|
+
t.hasOwnProperty(i) && (e = e || t[i]);
|
|
222
|
+
return e;
|
|
219
223
|
},
|
|
220
224
|
setValidity() {
|
|
221
225
|
this._input && this._input.setCustomValidity && this._input.setCustomValidity(this.validity().valid ? "" : this.$props.validationMessage || "");
|
|
@@ -226,11 +230,11 @@ const M = /* @__PURE__ */ h({
|
|
|
226
230
|
handleChange(t) {
|
|
227
231
|
this.emitUpdate(t, "change", t.target.value);
|
|
228
232
|
},
|
|
229
|
-
emitUpdate(t,
|
|
230
|
-
this.disabled || (this.$data.currentValue =
|
|
231
|
-
this.$emit("changemodel",
|
|
233
|
+
emitUpdate(t, e, i) {
|
|
234
|
+
this.disabled || (this.$data.currentValue = i, this.$data.valueDuringOnChange = i, this.$nextTick(() => {
|
|
235
|
+
this.$emit("changemodel", i), this.$emit("update:modelValue", i), this.$emit(e, {
|
|
232
236
|
event: t,
|
|
233
|
-
value:
|
|
237
|
+
value: i,
|
|
234
238
|
component: this,
|
|
235
239
|
target: t.target,
|
|
236
240
|
validity: this.validity()
|
|
@@ -239,8 +243,8 @@ const M = /* @__PURE__ */ h({
|
|
|
239
243
|
},
|
|
240
244
|
handleAutoFill(t) {
|
|
241
245
|
if (t.animationName === "autoFillStart") {
|
|
242
|
-
let
|
|
243
|
-
|
|
246
|
+
let e = t.target.parentNode;
|
|
247
|
+
e && e.classList.contains("k-empty") && (this.$data.autofill = !0, e.classList.remove("k-empty"));
|
|
244
248
|
}
|
|
245
249
|
},
|
|
246
250
|
handleAutoFillEnd(t) {
|
|
@@ -265,14 +269,14 @@ const M = /* @__PURE__ */ h({
|
|
|
265
269
|
inputInnerClass() {
|
|
266
270
|
const {
|
|
267
271
|
size: t,
|
|
268
|
-
fillMode:
|
|
269
|
-
rounded:
|
|
272
|
+
fillMode: e,
|
|
273
|
+
rounded: i
|
|
270
274
|
} = this.$props, s = !this.$data.hasMounted || !this.$props.validityStyles || this.validity().valid;
|
|
271
275
|
return {
|
|
272
276
|
"k-input": !0,
|
|
273
|
-
[`k-input-${
|
|
274
|
-
[`k-input-${
|
|
275
|
-
[`k-rounded-${
|
|
277
|
+
[`k-input-${l.sizeMap[t] || t}`]: t,
|
|
278
|
+
[`k-input-${e}`]: e,
|
|
279
|
+
[`k-rounded-${l.roundedMap[i] || i}`]: i,
|
|
276
280
|
"k-invalid": !s,
|
|
277
281
|
"k-required": this.required,
|
|
278
282
|
"k-disabled": this.$props.disabled,
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),v=require("./masking.service.js"),p=require("./utils.js"),s=require("@progress/kendo-vue-common"),$=require("../package-metadata.js"),c=require("@progress/kendo-svg-icons"),V=n.defineComponent({model:{event:"changemodel"},emits:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),v=require("./masking.service.js"),p=require("./utils.js"),s=require("@progress/kendo-vue-common"),$=require("../package-metadata.js"),c=require("@progress/kendo-svg-icons"),V=n.defineComponent({model:{event:"changemodel"},emits:{change:e=>!0,focus:e=>!0,blur:e=>!0,"update:modelValue":e=>!0,"update:modelRawValue":e=>!0,changemodel:e=>!0},props:{type:{type:String,default:"text"},modelValue:String,modelRawValue:String,value:String,defaultValue:String,placeholder:String,title:String,dir:String,id:String,ariaLabelledBy:String,ariaDescribedBy:String,tabIndex:Number,accessKey:String,disabled:Boolean,readonly:Boolean,size:{type:String,default:"medium",validator:function(e){return[null,"small","medium","large"].includes(e)}},rounded:{type:String,default:"medium",validator:function(e){return[null,"small","medium","large","full"].includes(e)}},fillMode:{type:String,default:"solid",validator:function(e){return[null,"solid","flat","outline"].includes(e)}},prompt:{type:String,default:"_"},promptPlaceholder:{type:String,default:" "},includeLiterals:{type:Boolean,default:!1},maskValidation:{type:Boolean,default:!0},mask:String,rules:{type:Object,default:function(){return p.defaultRules}},selection:Object,name:String,label:String,validationMessage:String,required:{type:Boolean,default:!1},valid:{type:Boolean,default:void 0},validityStyles:{type:Boolean,default:!0},iconName:String,inputPrefix:s.templateDefinition,inputSuffix:s.templateDefinition,showValidationIcon:Boolean,showLoadingIcon:Boolean,showClearButton:Boolean,inputClass:String,wrapperClass:String,inputAttributes:Object},data(){return{currentValue:void 0,currentFocused:!1,inputValue:void 0,currentSelection:[null,null]}},created(){s.validatePackage($.packageMetadata),this.hasMounted=!1,this.valueDuringOnChange=void 0,this.inputId=`k-${s.guid()}`,this.service=new v.MaskingService,this.isPasted=!1},setup(){return{inputRef:n.ref(null)}},mounted(){this.hasMounted=!0,this.element=this.input=this.inputRef,this.updateService(),this.setValidity()},watch:{currentFocused:function(e,t){this.prevCurrentFocused=t},selection:function(e,t){this.prevSelection=t},includeLiterals:function(e,t){this.prevIncludeLiterals=t},mask:function(e,t){this.prevMask=t},prompt:function(e,t){this.prevPrompt=t},promptPlaceholder:function(e,t){this.prevPromptPlaceholder=t},rules:function(e,t){this.prevRules=t}},updated(){if(this.element&&this.currentFocused){let[t,i]=this.currentSelection;const a=this.prevSelection,l=this.$props.selection;(!a&&l||a&&l&&(a.start!==l.start||a.end!==l.end))&&(t=l.start,i=l.end),t!==null&&i!==null&&this.element.setSelectionRange(t,i)}const e={includeLiterals:this.prevIncludeLiterals,mask:this.prevMask,prompt:this.prevPrompt,promptPlaceholder:this.prevPromptPlaceholder,rules:this.prevRules};p.maskingChanged(e,this.$props)&&this.updateService(),this.setValidity()},computed:{computedRules(){return Object.assign({},p.defaultRules,this.$props.rules)},spanClassNames(){const e=!this.hasMounted||!this.$props.validityStyles||this.validity().valid;return{"k-floating-label-container":!0,"k-focus":this.currentFocused,"k-empty":!this.computedValue(),"k-invalid":!e&&e!==void 0,"k-rtl":this.$props.dir==="rtl","k-loading":this.showLoadingIcon,[this.wrapperClass]:this.wrapperClass}},wrapperSpanClass(){const{size:e,fillMode:t,rounded:i}=this.$props,a=!this.$props.validityStyles||this.validity().valid;return{"k-maskedtextbox":!0,"k-input":!0,[`k-input-${s.kendoThemeMaps.sizeMap[e]||e}`]:e,[`k-input-${t}`]:t,[`k-rounded-${s.kendoThemeMaps.roundedMap[i]||i}`]:i,"k-invalid":!a,"k-required":this.required,"k-disabled":this.$props.disabled,"k-loading":this.showLoadingIcon,[this.wrapperClass]:this.wrapperClass}},inputInnerClass(){return{"k-input-inner":!0,[this.inputClass]:this.inputClass}}},methods:{focus(){this.input&&this.input.focus()},computedValue(){let e;return this.valueDuringOnChange!==void 0?e=this.valueDuringOnChange:this.$props.value!==void 0?e=this.$props.value:this.$props.modelValue!==void 0?e=this.$props.modelValue:this.currentValue!==void 0?e=this.currentValue:this.$props.defaultValue!==void 0&&(e=this.$props.defaultValue),e||""},rawValue(){return this.service.rawValue(this.computedValue())},validity(){const e=this.computedValue(),t=this.service.validationValue(e),i=this.$props.validationMessage!==void 0,a=this.$props.valid!==void 0?this.$props.valid:(!this.$props.required||!!t)&&(!this.$props.maskValidation||!this.$props.prompt||e.indexOf(this.$props.prompt)===-1);return{customError:i,valid:a,valueMissing:!t}},pasteHandler(e){const{selectionStart:t,selectionEnd:i}=e.target;i!==t&&(this.isPasted=!0,this.currentSelection=[t||0,i||0])},clearClick(e){this.triggerOnChange("",e)},onChangeHandler(e){const t=e.currentTarget,i=this.inputValue=t.value,a=this.currentSelection[0]||0,l=this.currentSelection[1]||0;if(!this.$props.mask){this.isPasted=!1,this.currentSelection=[null,null],this.triggerOnChange(i,e);return}const u=this.computedValue();let r;if(this.isPasted){this.isPasted=!1;const o=u.length-l,d=i.length-o;r=this.service.maskInRange(i.slice(a,d),u,a,l)}else r=this.service.maskInput(i,u,t.selectionStart||0);this.currentSelection=[r.selection,r.selection],this.triggerOnChange(r.value,e),this.inputValue=void 0},focusHandler(e){this.currentFocused||(this.currentFocused=!0,this.$emit("focus",{event:e,target:this}))},blurHandler(e){this.currentFocused&&(this.currentFocused=!1,this.$emit("blur",{event:e,target:this}))},triggerOnChange(e,t){this.currentValue=e,this.valueDuringOnChange=e,this.$emit("change",{event:t,selectionStart:this.currentSelection[0],selectionEnd:this.currentSelection[1],value:this.computedValue(),component:this,target:{name:this.$props.name,value:this.computedValue(),rawValue:this.rawValue()},validity:this.validity()}),this.$emit("update:modelValue",this.computedValue()),this.$emit("update:modelRawValue",this.rawValue()),this.$emit("changemodel",this.computedValue()),this.valueDuringOnChange=void 0},updateService(e){const t=Object.assign({includeLiterals:this.$props.includeLiterals,mask:this.$props.mask,prompt:this.$props.prompt,promptPlaceholder:this.$props.promptPlaceholder,rules:this.$props.rules},e);this.service.update(t)},setValidity(){this.element&&this.element.setCustomValidity(this.validity().valid?"":this.$props.validationMessage||"")}},render(){const e=this.$props.id||this.inputId,{iconName:t,showValidationIcon:i,showLoadingIcon:a,showClearButton:l,inputAttributes:u}=this.$props,r=!this.$props.validityStyles||this.validity().valid,o=this.computedValue();this.inputValue;const d=s.templateRendering.call(this,this.$props.inputPrefix,s.getListeners.call(this)),f=s.templateRendering.call(this,this.$props.inputSuffix,s.getListeners.call(this)),m=s.getTemplate.call(this,{h:n.h,template:d,additionalProps:{value:o,valid:r}}),g=s.getTemplate.call(this,{h:n.h,template:f,additionalProps:{value:o,valid:r}}),h=n.createVNode("span",{dir:this.$props.dir,class:this.wrapperSpanClass,style:this.$props.label?void 0:{width:this.$props.width}},[t&&n.createVNode(s.Icon,{name:t,class:"k-input-icon"},null),this.$props.inputPrefix&&n.createVNode("span",{class:"k-input-prefix"},[m]),n.createVNode("input",n.mergeProps({type:this.$props.type,autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:!1,class:this.inputInnerClass,value:o,id:e,"aria-labelledby":this.$props.ariaLabelledBy,"aria-describedby":this.$props.ariaDescribedBy,"aria-disabled":this.$props.disabled,name:this.$props.name,tabindex:s.getTabIndex(this.$props.tabIndex,this.$props.disabled,!0),accesskey:this.$props.accessKey,title:this.$props.title,disabled:this.$props.disabled||void 0,readonly:this.$props.readonly||void 0,placeholder:this.$props.placeholder,"aria-placeholder":this.$props.placeholder,required:this.$props.required,ref:s.setRef(this,"input")},u,{onInput:this.onChangeHandler,onPaste:this.pasteHandler,onFocus:this.focusHandler,onBlur:this.blurHandler,onDragstart:p.returnFalse,onDrop:p.returnFalse}),null),this.$props.inputSuffix&&n.createVNode("span",{class:"k-input-suffix"},[g]),i&&r&&n.createVNode(s.Icon,{name:"check",icon:c.checkIcon,class:"k-input-validation-icon"},null),i&&!r&&n.createVNode(s.Icon,{name:"exclamation-circle",icon:c.exclamationCircleIcon,class:"k-input-validation-icon"},null),a&&n.createVNode(s.Icon,{name:"loading",class:"k-input-loading-icon"},null),l&&o&&n.createVNode("span",{onClick:this.clearClick,class:"k-clear-value"},[n.createVNode(s.Icon,{name:"x",icon:c.xIcon},null)])]);return this.$props.label?n.createVNode("span",{class:this.spanClassNames,dir:this.$props.dir},[h,this.$props.label?e?n.createVNode("label",{for:e,class:"k-floating-label"},[this.$props.label]):n.createVNode("span",{class:"k-label"},[this.$props.label]):null]):h}});exports.MaskedTextBox=V;
|
|
@@ -15,7 +15,14 @@ const z = /* @__PURE__ */ b({
|
|
|
15
15
|
model: {
|
|
16
16
|
event: "changemodel"
|
|
17
17
|
},
|
|
18
|
-
emits:
|
|
18
|
+
emits: {
|
|
19
|
+
change: (e) => !0,
|
|
20
|
+
focus: (e) => !0,
|
|
21
|
+
blur: (e) => !0,
|
|
22
|
+
"update:modelValue": (e) => !0,
|
|
23
|
+
"update:modelRawValue": (e) => !0,
|
|
24
|
+
changemodel: (e) => !0
|
|
25
|
+
},
|
|
19
26
|
props: {
|
|
20
27
|
type: {
|
|
21
28
|
type: String,
|
|
@@ -251,14 +258,14 @@ const z = /* @__PURE__ */ b({
|
|
|
251
258
|
},
|
|
252
259
|
focusHandler(e) {
|
|
253
260
|
this.currentFocused || (this.currentFocused = !0, this.$emit("focus", {
|
|
254
|
-
|
|
255
|
-
|
|
261
|
+
event: e,
|
|
262
|
+
target: this
|
|
256
263
|
}));
|
|
257
264
|
},
|
|
258
265
|
blurHandler(e) {
|
|
259
266
|
this.currentFocused && (this.currentFocused = !1, this.$emit("blur", {
|
|
260
|
-
|
|
261
|
-
|
|
267
|
+
event: e,
|
|
268
|
+
target: this
|
|
262
269
|
}));
|
|
263
270
|
},
|
|
264
271
|
triggerOnChange(e, t) {
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("vue"),a=require("@progress/kendo-vue-common"),$=require("@progress/kendo-vue-intl"),g=require("@progress/kendo-vue-buttons"),r=require("../messages/main.js"),i=require("./utils/main.js"),S=require("../package-metadata.js"),h=require("@progress/kendo-svg-icons"),k="Please enter a valid value!",y=s.defineComponent({model:{event:"changemodel"},emits:{change:null,changemodel:null,"update:modelValue":null,focus:null,blur:null},props:{modelValue:Number,value:Number,defaultValue:Number,step:{type:Number,default:1},format:[String,Object],tabIndex:Number,accessKey:String,title:String,placeholder:String,min:Number,max:Number,spinners:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},dir:String,name:String,label:String,validationMessage:String,validityStyles:{type:Boolean,default:!0},valid:{type:Boolean,default:void 0},size:{type:String,default:"medium",validator:function(t){return[null,"small","medium","large"].includes(t)}},rounded:{type:String,default:"medium",validator:function(t){return[null,"small","medium","large","full"].includes(t)}},fillMode:{type:String,default:"solid",validator:function(t){return[null,"solid","flat","outline"].includes(t)}},required:{type:Boolean,default:!1},id:String,ariaLabel:String,iconName:String,inputPrefix:[String,Function],inputSuffix:[String,Function],showValidationIcon:Boolean,showLoadingIcon:Boolean,showClearButton:Boolean,inputClass:String,inputType:{type:String,default:"tel"},wrapperClass:String,inputAttributes:Object},inject:{kendoIntlService:{default:null},kendoLocalizationService:{default:null}},data(){return{hasMounted:!1,isInvalid:!1,isEmpty:!1,currentValue:0,valueDuringOnChange:0,currentLooseValue:"",selectionStart:0,selectionEnd:0,decimalSelect:!1,focused:!1,forceUpdate:!1}},created(){a.validatePackage(S.packageMetadata),this._textBeforeInput="",this._inputId=a.guid(),this.$data.currentLooseValue=null,this.$data.valueDuringOnChange=void 0,this._intl=$.provideIntlService(this),this._symbols=this._intl.numberSymbols(),this.$props.value!==void 0?this.$data.currentValue=this.$props.value:this.$props.modelValue!==void 0?this.$data.currentValue=this.$props.modelValue:this.$props.defaultValue!==void 0?this.$data.currentValue=this.$props.defaultValue:this.$data.currentValue=null},mounted(){this._input=a.getRef(this,"input"),this._elementWrapper=this.elementWrapperRef,this.$data.hasMounted=!0,this._input&&(this._textBeforeInput=this._input.value),this.setValidity()},updated(){!(a.canUseDOM&&document.activeElement!==this._input||!this._input)&&this.$data.currentLooseValue!==null&&this.$data.forceUpdate&&this._input.type!=="number"&&(this._input.selectionStart=this.$data.selectionStart,this._input.selectionEnd=this.$data.selectionEnd,this.$data.forceUpdate=!1),this._input&&(this._textBeforeInput=this._input.value),this.setValidity()},computed:{computedValue(){return this.$data.valueDuringOnChange!==void 0?this.$data.valueDuringOnChange:this.$data.currentValue},looseValue(){return i.formatValue(this.$data.focused?this.$data.currentLooseValue:i.getStateOrPropsValue(this.$props.value,this.$data.currentValue),this.$props.format,this._intl)},spanClassNames(){const t=!this.$data.hasMounted||!this.$props.validityStyles||this.validity().valid,e=this.computedValue;return{"k-floating-label-container":!0,"k-focus":this.$data.focused,"k-empty":!(e===0||e||this.$props.placeholder),"k-invalid":!t&&t!==void 0,"k-rtl":this.$props.dir==="rtl",[this.inputClass]:this.inputClass}},wrapperClassNames(){const{size:t,fillMode:e,rounded:n,required:l,disabled:d}=this.$props,u=!this.$props.validityStyles||this.validity().valid;return{"k-input":!0,"k-numerictextbox":!0,[`k-input-${a.kendoThemeMaps.sizeMap[t]||t}`]:t,[`k-input-${e}`]:e,[`k-rounded-${a.kendoThemeMaps.roundedMap[n]||n}`]:n,"k-invalid":!u,"k-required":l,"k-disabled":d,"k-loading":this.showLoadingIcon,[this.wrapperClass]:this.wrapperClass}},inputInnerClass(){return{"k-input-inner":!0,[this.inputClass]:this.inputClass}}},methods:{validity(){const t=this.$props.validationMessage!==void 0,e=!this.$data.valueIsOutOfRange&&(!this.$props.required||this.computedValue!==null),n=this.$props.valid!==void 0?this.$props.valid:e;return{customError:t,valid:n,valueMissing:this.computedValue===null}},clearClick(t){this.$props.value!==void 0?this.$data.currentValue=this.$props.value:this.$props.modelValue!==void 0?this.$data.currentValue=this.$props.modelValue:this.$data.currentValue=null,this.$emit("changemodel",null),this.$emit("update:modelValue",null),this.$emit("change",{event:t,value:null,component:this,target:{name:this.$props.name,value:null},validity:this.validity()})},focus(){this._input&&this._input.focus()},emitFocus(t){this.$data.currentLooseValue=this._prevLooseValue,this.$data.focused=!0,this.$emit("focus",t)},emitBlur(t){this.$data.eventValue=null,this.$data.prevLooseValue="",this.$data.currentLooseValue="",this.$data.focused=!1,this.$data.selectionStart=void 0,this.$data.selectionEnd=void 0,this.$data.decimalSelect=!1,this.$data.valueIsCorrected=!1,this.$data.valueIsOutOfRange=!1,this.$emit("blur",t)},handleFocus(t){this.$data.focused=!0},handleBlur(t){this.$data.focused=!1},setValidity(){this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity().valid?"":this.$props.validationMessage||k)},getCurrentState(){return{eventValue:i.getStateOrPropsValue(this.$props.value,this.$data.currentValue),prevLooseValue:this._prevLooseValue,currentLooseValue:this._input.value,selectionStart:this._input.selectionStart,selectionEnd:this._input.selectionEnd,decimalSelect:!1,valueIsCorrected:!1,valueIsOutOfRange:!1,isPaste:this._isPaste,focused:this.$data.focused}},parseNumber(t){return this._intl.parseNumber(t,this.$props.format)},elementChange(t){const e=this.getCurrentState();this._isPaste=!1,this.triggerChange(t,i.sanitizeNumber(e,this.$props.format,this._intl))},triggerChange(t,e){if(this.$props.disabled)return;this.$data.valueDuringOnChange=e.eventValue,this.$data.currentValue=e.eventValue;const n=i.formatValue(i.rangeValue(e.eventValue,this.$props.min,this.$props.max),this.$props.format,this._intl),l=i.rangeValue(this.parseNumber(n),this.$props.min,this.$props.max);if(l!==e.eventValue&&(e.valueIsOutOfRange=!0,e.eventValue=l,this.$data.valueDuringOnChange=l,this.$data.currentValue=l),e.valueIsCorrected){const u=this._elementWrapper;u&&u.className.indexOf("k-invalid")===-1&&(this.$data.isInvalid=!0,setTimeout(()=>{this.$data.isInvalid=!1},50))}const d=this.$props.value!==e.eventValue;this.$props.value!==void 0?this.$data.currentValue=this.$props.value:this.$props.modelValue!==void 0?this.$data.currentValue=this.$props.modelValue:this.$data.currentValue=this.$data.valueDuringOnChange,this.$data.prevLooseValue=e.prevLooseValue,this.$data.currentLooseValue=void 0,this.$data.currentLooseValue=e.currentLooseValue,this.$data.selectionStart=e.selectionStart,this.$data.selectionEnd=e.selectionEnd,this.$data.decimalSelect=e.decimalSelect,this.$data.valueIsCorrected=e.valueIsCorrected,this.$data.valueIsOutOfRange=e.valueIsOutOfRange,this.$data.focused=e.focused,this.$data.isPaste=e.isPaste,this.$data.forceUpdate=!this.$data.forceUpdate,d&&(this.$emit("changemodel",this.$data.valueDuringOnChange),this.$emit("update:modelValue",this.$data.valueDuringOnChange),this.$emit("change",{event:t,value:this.$data.valueDuringOnChange,component:this,target:{name:this.$props.name,value:this.$data.valueDuringOnChange},validity:this.validity()})),this.$data.valueDuringOnChange=void 0},onPasteHandler(t){this._isPaste=!0},increase(t){const e=this.getCurrentState();i.increaseValue(this.parseNumber(String(e.currentLooseValue)),e,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl),this.triggerChange(t,e)},decrease(t){const e=this.getCurrentState();i.decreaseValue(this.parseNumber(String(e.currentLooseValue)),e,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl),this.triggerChange(t,e)},wheel(t){!a.canUseDOM||document.activeElement!==this._input||!this._input||(t.deltaY<0&&(t.preventDefault(),this.increase(t)),t.deltaY>0&&(t.preventDefault(),this.decrease(t)))},keyDown(t){let e=this.getCurrentState(),n,l,d,u;const c=this.parseNumber(String(e.currentLooseValue));if(e.selectionEnd>e.selectionStart&&e.selectionEnd-e.selectionStart===String(e.currentLooseValue).length){const o=this._intl.numberSymbols(),p=o&&t.key===o.minusSign,m=o&&t.key===o.decimal;this.$data.isPaste=!p&&!m;return}switch(t.keyCode){case 38:i.increaseValue(c,e,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl);break;case 40:i.decreaseValue(c,e,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl);break;case 13:n=i.formatValue(i.rangeValue(c,this.$props.min,this.$props.max),this.$props.format,this._intl),l=i.rangeValue(this.parseNumber(n),this.$props.min,this.$props.max),e.eventValue=l,e.currentLooseValue=i.formatValue(l,this.$props.format,this._intl),e.selectionStart=e.selectionEnd=e.currentLooseValue.length;break;case 110:d=this._input,u=this._intl.numberSymbols(),d&&(e.currentLooseValue=e.currentLooseValue.slice(0,e.selectionStart)+u.decimal+e.currentLooseValue.slice(e.selectionEnd),e.selectionStart=e.selectionEnd=e.selectionStart+1,e=i.sanitizeNumber(e,this.$props.format,this._intl));break;default:return}t.preventDefault(),this.triggerChange(t,e)},spinnersWrapperMouseDown(t){a.canUseDOM&&this._input&&(t.preventDefault(),document.activeElement!==this._input&&this._input.focus())}},setup(){const t=s.ref(null),e=s.ref(null),n=s.inject("kendoLocalizationService",{}),l=s.inject("kendoIntlService",{});return{inputRef:t,elementWrapperRef:e,kendoLocalizationService:n,kendoIntlService:l}},render(){const{iconName:t,showValidationIcon:e,showLoadingIcon:n,showClearButton:l,inputAttributes:d}=this.$props,u=this.$props.id||this._inputId,c=a.getDefaultSlots(this),o=$.provideLocalizationService(this),p=this.validity().valid;this.$props.value!==void 0&&this.$props.value!==this.$data.currentValue?this.$data.currentValue=this.$props.value:this.$props.modelValue!==void 0&&this.$props.modelValue!==this.$data.currentValue&&(this.$data.currentValue=this.$props.modelValue),this._prevLooseValue=this.$data.currentLooseValue?this.looseValue:this.looseValue;const m=a.templateRendering.call(this,this.$props.inputPrefix,a.getListeners.call(this)),V=a.templateRendering.call(this,this.$props.inputSuffix,a.getListeners.call(this)),v=a.getTemplate.call(this,{h:s.h,template:m,additionalProps:{value:this.computedValue,valid:p}}),b=a.getTemplate.call(this,{h:s.h,template:V,additionalProps:{value:this.computedValue,valid:p}}),f=s.createVNode("span",{dir:this.$props.dir,class:this.wrapperClassNames,style:this.$attrs.style},[t&&s.createVNode(a.Icon,{name:t,class:"k-input-icon"},null),this.$props.inputPrefix&&s.createVNode("span",{class:"k-input-prefix"},[v]),s.createVNode("input",s.mergeProps({tabindex:this.$props.tabIndex,accesskey:this.$props.accessKey,disabled:this.$props.disabled,title:this.$props.title,"aria-label":this.$props.ariaLabel,"aria-valuemin":this.$props.min,"aria-valuemax":this.$props.max,"aria-disabled":this.$props.disabled?"true":void 0,placeholder:this.$props.placeholder,type:this.$props.inputType,spellcheck:!1,autocomplete:"off",autocorrect:"off",class:this.inputInnerClass,id:u,role:"spinbutton",value:this.looseValue,name:this.$props.name,onWheel:this.wheel,onKeydown:this.keyDown,onInput:this.elementChange,onFocus:this.emitFocus,onBlur:this.emitBlur,onPaste:this.onPasteHandler,ref:a.setRef(this,"input")},d),null),this.$props.inputSuffix&&s.createVNode("span",{class:"k-input-suffix"},[b]),e&&p&&s.createVNode(a.Icon,{name:"check",icon:h.checkIcon,class:"k-input-validation-icon"},null),e&&!p&&s.createVNode(a.Icon,{name:"exclamation-circle",icon:h.exclamationCircleIcon,class:"k-input-validation-icon"},null),n&&s.createVNode(a.Icon,{name:"loading",class:"k-input-loading-icon"},null),l&&this.computedValue!==void 0&&this.computedValue!==null&&s.createVNode("span",{onClick:this.clearClick,class:"k-clear-value"},[s.createVNode(a.Icon,{name:"x",icon:h.xIcon},null)]),c,this.$props.spinners&&s.createVNode("span",{class:"k-input-spinner k-spin-button",onMousedown:this.spinnersWrapperMouseDown},[s.createVNode(g.Button,{type:"button",tabIndex:-1,icon:"caret-alt-up",svgIcon:h.caretAltUpIcon,class:"k-spinner-increase",rounded:null,"aria-label":o.toLanguageString(r.numericIncreaseValue,r.messages[r.numericIncreaseValue]),title:o.toLanguageString(r.numericIncreaseValue,r.messages[r.numericIncreaseValue]),onClick:this.increase},null),s.createVNode(g.Button,{type:"button",tabIndex:-1,class:"k-spinner-decrease",icon:"caret-alt-down",svgIcon:h.caretAltDownIcon,rounded:null,"aria-label":o.toLanguageString(r.numericDecreaseValue,r.messages[r.numericDecreaseValue]),title:o.toLanguageString(r.numericDecreaseValue,r.messages[r.numericDecreaseValue]),onClick:this.decrease},null)])]);return this.$props.label?s.createVNode("span",{class:this.spanClassNames,onFocusin:this.handleFocus,onFocusout:this.handleBlur,dir:this.$props.dir},[f,this.$props.label?u?s.createVNode("label",{for:u,class:"k-floating-label"},[this.$props.label]):s.createVNode("span",{class:"k-label"},[this.$props.label]):null]):f}});exports.NumericTextBox=y;
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("vue"),a=require("@progress/kendo-vue-common"),$=require("@progress/kendo-vue-intl"),g=require("@progress/kendo-vue-buttons"),r=require("../messages/main.js"),i=require("./utils/main.js"),S=require("../package-metadata.js"),h=require("@progress/kendo-svg-icons"),k="Please enter a valid value!",y=s.defineComponent({model:{event:"changemodel"},emits:{change:t=>!0,changemodel:t=>!0,"update:modelValue":t=>!0,focus:t=>!0,blur:t=>!0},props:{modelValue:Number,value:Number,defaultValue:Number,step:{type:Number,default:1},format:[String,Object],tabIndex:Number,accessKey:String,title:String,placeholder:String,min:Number,max:Number,spinners:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},dir:String,name:String,label:String,validationMessage:String,validityStyles:{type:Boolean,default:!0},valid:{type:Boolean,default:void 0},size:{type:String,default:"medium",validator:function(t){return[null,"small","medium","large"].includes(t)}},rounded:{type:String,default:"medium",validator:function(t){return[null,"small","medium","large","full"].includes(t)}},fillMode:{type:String,default:"solid",validator:function(t){return[null,"solid","flat","outline"].includes(t)}},required:{type:Boolean,default:!1},id:String,ariaLabel:String,iconName:String,inputPrefix:[String,Function],inputSuffix:[String,Function],showValidationIcon:Boolean,showLoadingIcon:Boolean,showClearButton:Boolean,inputClass:String,inputType:{type:String,default:"tel"},wrapperClass:String,inputAttributes:Object},inject:{kendoIntlService:{default:null},kendoLocalizationService:{default:null}},data(){return{hasMounted:!1,isInvalid:!1,isEmpty:!1,currentValue:0,valueDuringOnChange:0,currentLooseValue:"",selectionStart:0,selectionEnd:0,decimalSelect:!1,focused:!1,forceUpdate:!1}},created(){a.validatePackage(S.packageMetadata),this._textBeforeInput="",this._inputId=a.guid(),this.$data.currentLooseValue=null,this.$data.valueDuringOnChange=void 0,this._intl=$.provideIntlService(this),this._symbols=this._intl.numberSymbols(),this.$props.value!==void 0?this.$data.currentValue=this.$props.value:this.$props.modelValue!==void 0?this.$data.currentValue=this.$props.modelValue:this.$props.defaultValue!==void 0?this.$data.currentValue=this.$props.defaultValue:this.$data.currentValue=null},mounted(){this._input=a.getRef(this,"input"),this._elementWrapper=this.elementWrapperRef,this.$data.hasMounted=!0,this._input&&(this._textBeforeInput=this._input.value),this.setValidity()},updated(){!(a.canUseDOM&&document.activeElement!==this._input||!this._input)&&this.$data.currentLooseValue!==null&&this.$data.forceUpdate&&this._input.type!=="number"&&(this._input.selectionStart=this.$data.selectionStart,this._input.selectionEnd=this.$data.selectionEnd,this.$data.forceUpdate=!1),this._input&&(this._textBeforeInput=this._input.value),this.setValidity()},computed:{computedValue(){return this.$data.valueDuringOnChange!==void 0?this.$data.valueDuringOnChange:this.$data.currentValue},looseValue(){return i.formatValue(this.$data.focused?this.$data.currentLooseValue:i.getStateOrPropsValue(this.$props.value,this.$data.currentValue),this.$props.format,this._intl)},spanClassNames(){const t=!this.$data.hasMounted||!this.$props.validityStyles||this.validity().valid,e=this.computedValue;return{"k-floating-label-container":!0,"k-focus":this.$data.focused,"k-empty":!(e===0||e||this.$props.placeholder),"k-invalid":!t&&t!==void 0,"k-rtl":this.$props.dir==="rtl",[this.inputClass]:this.inputClass}},wrapperClassNames(){const{size:t,fillMode:e,rounded:n,required:l,disabled:d}=this.$props,u=!this.$props.validityStyles||this.validity().valid;return{"k-input":!0,"k-numerictextbox":!0,[`k-input-${a.kendoThemeMaps.sizeMap[t]||t}`]:t,[`k-input-${e}`]:e,[`k-rounded-${a.kendoThemeMaps.roundedMap[n]||n}`]:n,"k-invalid":!u,"k-required":l,"k-disabled":d,"k-loading":this.showLoadingIcon,[this.wrapperClass]:this.wrapperClass}},inputInnerClass(){return{"k-input-inner":!0,[this.inputClass]:this.inputClass}}},methods:{validity(){const t=this.$props.validationMessage!==void 0,e=!this.$data.valueIsOutOfRange&&(!this.$props.required||this.computedValue!==null),n=this.$props.valid!==void 0?this.$props.valid:e;return{customError:t,valid:n,valueMissing:this.computedValue===null}},clearClick(t){this.$props.value!==void 0?this.$data.currentValue=this.$props.value:this.$props.modelValue!==void 0?this.$data.currentValue=this.$props.modelValue:this.$data.currentValue=null,this.$emit("changemodel",null),this.$emit("update:modelValue",null),this.$emit("change",{event:t,value:null,component:this,target:{name:this.$props.name,value:null},validity:this.validity()})},focus(){this._input&&this._input.focus()},emitFocus(t){this.$data.currentLooseValue=this._prevLooseValue,this.$data.focused=!0,this.$emit("focus",{event:t})},emitBlur(t){this.$data.eventValue=null,this.$data.prevLooseValue="",this.$data.currentLooseValue="",this.$data.focused=!1,this.$data.selectionStart=void 0,this.$data.selectionEnd=void 0,this.$data.decimalSelect=!1,this.$data.valueIsCorrected=!1,this.$data.valueIsOutOfRange=!1,this.$emit("blur",{event:t})},handleFocus(t){this.$data.focused=!0},handleBlur(t){this.$data.focused=!1},setValidity(){this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity().valid?"":this.$props.validationMessage||k)},getCurrentState(){return{eventValue:i.getStateOrPropsValue(this.$props.value,this.$data.currentValue),prevLooseValue:this._prevLooseValue,currentLooseValue:this._input.value,selectionStart:this._input.selectionStart,selectionEnd:this._input.selectionEnd,decimalSelect:!1,valueIsCorrected:!1,valueIsOutOfRange:!1,isPaste:this._isPaste,focused:this.$data.focused}},parseNumber(t){return this._intl.parseNumber(t,this.$props.format)},elementChange(t){const e=this.getCurrentState();this._isPaste=!1,this.triggerChange(t,i.sanitizeNumber(e,this.$props.format,this._intl))},triggerChange(t,e){if(this.$props.disabled)return;this.$data.valueDuringOnChange=e.eventValue,this.$data.currentValue=e.eventValue;const n=i.formatValue(i.rangeValue(e.eventValue,this.$props.min,this.$props.max),this.$props.format,this._intl),l=i.rangeValue(this.parseNumber(n),this.$props.min,this.$props.max);if(l!==e.eventValue&&(e.valueIsOutOfRange=!0,e.eventValue=l,this.$data.valueDuringOnChange=l,this.$data.currentValue=l),e.valueIsCorrected){const u=this._elementWrapper;u&&u.className.indexOf("k-invalid")===-1&&(this.$data.isInvalid=!0,setTimeout(()=>{this.$data.isInvalid=!1},50))}const d=this.$props.value!==e.eventValue;this.$props.value!==void 0?this.$data.currentValue=this.$props.value:this.$props.modelValue!==void 0?this.$data.currentValue=this.$props.modelValue:this.$data.currentValue=this.$data.valueDuringOnChange,this.$data.prevLooseValue=e.prevLooseValue,this.$data.currentLooseValue=void 0,this.$data.currentLooseValue=e.currentLooseValue,this.$data.selectionStart=e.selectionStart,this.$data.selectionEnd=e.selectionEnd,this.$data.decimalSelect=e.decimalSelect,this.$data.valueIsCorrected=e.valueIsCorrected,this.$data.valueIsOutOfRange=e.valueIsOutOfRange,this.$data.focused=e.focused,this.$data.isPaste=e.isPaste,this.$data.forceUpdate=!this.$data.forceUpdate,d&&(this.$emit("changemodel",this.$data.valueDuringOnChange),this.$emit("update:modelValue",this.$data.valueDuringOnChange),this.$emit("change",{event:t,value:this.$data.valueDuringOnChange,component:this,target:{name:this.$props.name,value:this.$data.valueDuringOnChange},validity:this.validity()})),this.$data.valueDuringOnChange=void 0},onPasteHandler(t){this._isPaste=!0},increase(t){const e=this.getCurrentState();i.increaseValue(this.parseNumber(String(e.currentLooseValue)),e,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl),this.triggerChange(t,e)},decrease(t){const e=this.getCurrentState();i.decreaseValue(this.parseNumber(String(e.currentLooseValue)),e,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl),this.triggerChange(t,e)},wheel(t){!a.canUseDOM||document.activeElement!==this._input||!this._input||(t.deltaY<0&&(t.preventDefault(),this.increase(t)),t.deltaY>0&&(t.preventDefault(),this.decrease(t)))},keyDown(t){let e=this.getCurrentState(),n,l,d,u;const c=this.parseNumber(String(e.currentLooseValue));if(e.selectionEnd>e.selectionStart&&e.selectionEnd-e.selectionStart===String(e.currentLooseValue).length){const o=this._intl.numberSymbols(),p=o&&t.key===o.minusSign,m=o&&t.key===o.decimal;this.$data.isPaste=!p&&!m;return}switch(t.keyCode){case 38:i.increaseValue(c,e,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl);break;case 40:i.decreaseValue(c,e,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl);break;case 13:n=i.formatValue(i.rangeValue(c,this.$props.min,this.$props.max),this.$props.format,this._intl),l=i.rangeValue(this.parseNumber(n),this.$props.min,this.$props.max),e.eventValue=l,e.currentLooseValue=i.formatValue(l,this.$props.format,this._intl),e.selectionStart=e.selectionEnd=e.currentLooseValue.length;break;case 110:d=this._input,u=this._intl.numberSymbols(),d&&(e.currentLooseValue=e.currentLooseValue.slice(0,e.selectionStart)+u.decimal+e.currentLooseValue.slice(e.selectionEnd),e.selectionStart=e.selectionEnd=e.selectionStart+1,e=i.sanitizeNumber(e,this.$props.format,this._intl));break;default:return}t.preventDefault(),this.triggerChange(t,e)},spinnersWrapperMouseDown(t){a.canUseDOM&&this._input&&(t.preventDefault(),document.activeElement!==this._input&&this._input.focus())}},setup(){const t=s.ref(null),e=s.ref(null),n=s.inject("kendoLocalizationService",{}),l=s.inject("kendoIntlService",{});return{inputRef:t,elementWrapperRef:e,kendoLocalizationService:n,kendoIntlService:l}},render(){const{iconName:t,showValidationIcon:e,showLoadingIcon:n,showClearButton:l,inputAttributes:d}=this.$props,u=this.$props.id||this._inputId,c=a.getDefaultSlots(this),o=$.provideLocalizationService(this),p=this.validity().valid;this.$props.value!==void 0&&this.$props.value!==this.$data.currentValue?this.$data.currentValue=this.$props.value:this.$props.modelValue!==void 0&&this.$props.modelValue!==this.$data.currentValue&&(this.$data.currentValue=this.$props.modelValue),this._prevLooseValue=this.$data.currentLooseValue?this.looseValue:this.looseValue;const m=a.templateRendering.call(this,this.$props.inputPrefix,a.getListeners.call(this)),V=a.templateRendering.call(this,this.$props.inputSuffix,a.getListeners.call(this)),v=a.getTemplate.call(this,{h:s.h,template:m,additionalProps:{value:this.computedValue,valid:p}}),b=a.getTemplate.call(this,{h:s.h,template:V,additionalProps:{value:this.computedValue,valid:p}}),f=s.createVNode("span",{dir:this.$props.dir,class:this.wrapperClassNames,style:this.$attrs.style},[t&&s.createVNode(a.Icon,{name:t,class:"k-input-icon"},null),this.$props.inputPrefix&&s.createVNode("span",{class:"k-input-prefix"},[v]),s.createVNode("input",s.mergeProps({tabindex:this.$props.tabIndex,accesskey:this.$props.accessKey,disabled:this.$props.disabled,title:this.$props.title,"aria-label":this.$props.ariaLabel,"aria-valuemin":this.$props.min,"aria-valuemax":this.$props.max,"aria-disabled":this.$props.disabled?"true":void 0,placeholder:this.$props.placeholder,type:this.$props.inputType,spellcheck:!1,autocomplete:"off",autocorrect:"off",class:this.inputInnerClass,id:u,role:"spinbutton",value:this.looseValue,name:this.$props.name,onWheel:this.wheel,onKeydown:this.keyDown,onInput:this.elementChange,onFocus:this.emitFocus,onBlur:this.emitBlur,onPaste:this.onPasteHandler,ref:a.setRef(this,"input")},d),null),this.$props.inputSuffix&&s.createVNode("span",{class:"k-input-suffix"},[b]),e&&p&&s.createVNode(a.Icon,{name:"check",icon:h.checkIcon,class:"k-input-validation-icon"},null),e&&!p&&s.createVNode(a.Icon,{name:"exclamation-circle",icon:h.exclamationCircleIcon,class:"k-input-validation-icon"},null),n&&s.createVNode(a.Icon,{name:"loading",class:"k-input-loading-icon"},null),l&&this.computedValue!==void 0&&this.computedValue!==null&&s.createVNode("span",{onClick:this.clearClick,class:"k-clear-value"},[s.createVNode(a.Icon,{name:"x",icon:h.xIcon},null)]),c,this.$props.spinners&&s.createVNode("span",{class:"k-input-spinner k-spin-button",onMousedown:this.spinnersWrapperMouseDown},[s.createVNode(g.Button,{type:"button",tabIndex:-1,icon:"caret-alt-up",svgIcon:h.caretAltUpIcon,class:"k-spinner-increase",rounded:null,"aria-label":o.toLanguageString(r.numericIncreaseValue,r.messages[r.numericIncreaseValue]),title:o.toLanguageString(r.numericIncreaseValue,r.messages[r.numericIncreaseValue]),onClick:this.increase},null),s.createVNode(g.Button,{type:"button",tabIndex:-1,class:"k-spinner-decrease",icon:"caret-alt-down",svgIcon:h.caretAltDownIcon,rounded:null,"aria-label":o.toLanguageString(r.numericDecreaseValue,r.messages[r.numericDecreaseValue]),title:o.toLanguageString(r.numericDecreaseValue,r.messages[r.numericDecreaseValue]),onClick:this.decrease},null)])]);return this.$props.label?s.createVNode("span",{class:this.spanClassNames,onFocusin:this.handleFocus,onFocusout:this.handleBlur,dir:this.$props.dir},[f,this.$props.label?u?s.createVNode("label",{for:u,class:"k-floating-label"},[this.$props.label]):s.createVNode("span",{class:"k-label"},[this.$props.label]):null]):f}});exports.NumericTextBox=y;
|
|
@@ -18,11 +18,11 @@ const G = "Please enter a valid value!", ae = /* @__PURE__ */ B({
|
|
|
18
18
|
event: "changemodel"
|
|
19
19
|
},
|
|
20
20
|
emits: {
|
|
21
|
-
change:
|
|
22
|
-
changemodel:
|
|
23
|
-
"update:modelValue":
|
|
24
|
-
focus:
|
|
25
|
-
blur:
|
|
21
|
+
change: (t) => !0,
|
|
22
|
+
changemodel: (t) => !0,
|
|
23
|
+
"update:modelValue": (t) => !0,
|
|
24
|
+
focus: (t) => !0,
|
|
25
|
+
blur: (t) => !0
|
|
26
26
|
},
|
|
27
27
|
props: {
|
|
28
28
|
modelValue: Number,
|
|
@@ -203,10 +203,14 @@ const G = "Please enter a valid value!", ae = /* @__PURE__ */ B({
|
|
|
203
203
|
this._input && this._input.focus();
|
|
204
204
|
},
|
|
205
205
|
emitFocus(t) {
|
|
206
|
-
this.$data.currentLooseValue = this._prevLooseValue, this.$data.focused = !0, this.$emit("focus",
|
|
206
|
+
this.$data.currentLooseValue = this._prevLooseValue, this.$data.focused = !0, this.$emit("focus", {
|
|
207
|
+
event: t
|
|
208
|
+
});
|
|
207
209
|
},
|
|
208
210
|
emitBlur(t) {
|
|
209
|
-
this.$data.eventValue = null, this.$data.prevLooseValue = "", this.$data.currentLooseValue = "", this.$data.focused = !1, this.$data.selectionStart = void 0, this.$data.selectionEnd = void 0, this.$data.decimalSelect = !1, this.$data.valueIsCorrected = !1, this.$data.valueIsOutOfRange = !1, this.$emit("blur",
|
|
211
|
+
this.$data.eventValue = null, this.$data.prevLooseValue = "", this.$data.currentLooseValue = "", this.$data.focused = !1, this.$data.selectionStart = void 0, this.$data.selectionEnd = void 0, this.$data.decimalSelect = !1, this.$data.valueIsCorrected = !1, this.$data.valueIsOutOfRange = !1, this.$emit("blur", {
|
|
212
|
+
event: t
|
|
213
|
+
});
|
|
210
214
|
},
|
|
211
215
|
handleFocus(t) {
|
|
212
216
|
this.$data.focused = !0;
|
package/package-metadata.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-vue-inputs",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-vue-inputs",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate: 1762528600,version:"7.0.1-develop.3",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"};exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -10,8 +10,8 @@ const e = {
|
|
|
10
10
|
productName: "Kendo UI for Vue",
|
|
11
11
|
productCode: "KENDOUIVUE",
|
|
12
12
|
productCodes: ["KENDOUIVUE"],
|
|
13
|
-
publishDate:
|
|
14
|
-
version: "7.0.1-develop.
|
|
13
|
+
publishDate: 1762528600,
|
|
14
|
+
version: "7.0.1-develop.3",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"
|
|
16
16
|
};
|
|
17
17
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-vue-inputs",
|
|
3
|
-
"version": "7.0.1-develop.
|
|
3
|
+
"version": "7.0.1-develop.3",
|
|
4
4
|
"description": "TODO",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"@progress/kendo-drawing": "^1.21.1",
|
|
22
22
|
"@progress/kendo-licensing": "^1.7.0",
|
|
23
|
-
"@progress/kendo-vue-animation": "7.0.1-develop.
|
|
24
|
-
"@progress/kendo-vue-buttons": "7.0.1-develop.
|
|
25
|
-
"@progress/kendo-vue-common": "7.0.1-develop.
|
|
26
|
-
"@progress/kendo-vue-dialogs": "7.0.1-develop.
|
|
27
|
-
"@progress/kendo-vue-intl": "7.0.1-develop.
|
|
28
|
-
"@progress/kendo-vue-labels": "7.0.1-develop.
|
|
29
|
-
"@progress/kendo-vue-popup": "7.0.1-develop.
|
|
23
|
+
"@progress/kendo-vue-animation": "7.0.1-develop.3",
|
|
24
|
+
"@progress/kendo-vue-buttons": "7.0.1-develop.3",
|
|
25
|
+
"@progress/kendo-vue-common": "7.0.1-develop.3",
|
|
26
|
+
"@progress/kendo-vue-dialogs": "7.0.1-develop.3",
|
|
27
|
+
"@progress/kendo-vue-intl": "7.0.1-develop.3",
|
|
28
|
+
"@progress/kendo-vue-labels": "7.0.1-develop.3",
|
|
29
|
+
"@progress/kendo-vue-popup": "7.0.1-develop.3",
|
|
30
30
|
"@progress/kendo-svg-icons": "^4.4.0",
|
|
31
31
|
"vue": "^3.0.2"
|
|
32
32
|
},
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"package": {
|
|
50
50
|
"productName": "Kendo UI for Vue",
|
|
51
51
|
"productCode": "KENDOUIVUE",
|
|
52
|
-
"publishDate":
|
|
52
|
+
"publishDate": 1762528600,
|
|
53
53
|
"licensingDocsUrl": "https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"
|
|
54
54
|
}
|
|
55
55
|
},
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),t=require("@progress/kendo-vue-common"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),t=require("@progress/kendo-vue-common"),B=require("../package-metadata.js"),N=a.defineComponent({name:"KendoRadioButton",props:{ariaDescribedBy:String,checked:Boolean,disabled:Boolean,className:String,content:[String,Number,Boolean,Object],dataItem:Object,id:String,label:String,labelRender:[String,Number,Boolean,Object],item:[String,Number,Boolean,Object],labelPlacement:String,name:String,index:Number,tag:{type:String,default:"div"},size:{type:String,default:"medium",validator:function(e){return[null,"small","medium","large"].includes(e)}},tabIndex:Number,value:[String,Number,Object],valid:{type:Boolean,default:void 0},role:String},emits:{change:e=>!0,focus:e=>!0,blur:e=>!0},created(){this.calculatedId=t.guid(),t.validatePackage(B.packageMetadata)},mounted(){this.input=t.getRef(this,"input")},computed:{inputClassName(){return{"k-radio":!0,[`k-radio-${t.kendoThemeMaps.sizeMap[this.$props.size]}`]:this.$props.size,"k-invalid":this.$props.valid===!1,[this.$props.className]:this.$props.className}}},methods:{focusElement(){this.input&&this.input.focus()},handleChange(e){this.$emit("change",{event:e,value:this.$props.value})},handleFocus(e){this.$props.disabled||this.$emit("focus",{event:e,target:this})},handleBlur(e){this.$props.disabled||this.$emit("blur",{event:e,target:this})}},setup(){return{inputRef:a.ref(null)}},render(){const e=t.getDefaultSlots(this),{ariaDescribedBy:h,checked:p,disabled:n,id:s,label:r,labelRender:i,labelPlacement:m,name:b,tabIndex:g,value:f,tag:d,role:S}=this.$props;let l=r;if(i){const v=i?t.templateRendering.call(this,i,t.getListeners.call(this)):null;l=t.getTemplate.call(this,{h:a.h,template:v})}const o=t.getTemplate.call(this,{h:a.h,template:this.$props.content}),u=l!==void 0?a.createVNode("label",{class:"k-radio-label",for:s||this.calculatedId,style:{userSelect:"none"},"aria-label":r},[l]):null,c=a.createVNode("input",{role:S,type:"radio",id:s||this.calculatedId,name:b,class:this.inputClassName,ref:t.setRef(this,"input"),disabled:n,tabindex:t.getTabIndex(g,n),checked:p,style:this.$attrs.style,"aria-describedby":h,value:f,onChange:this.handleChange,onFocus:this.handleFocus,onBlur:this.handleBlur},null),$=m==="before"?a.h(d,[u,c,o,e]):a.h(d,[c,u,o,e]);return t.getTemplate.call(this,{h:a.h,template:this.$props.item,defaultRendering:$,defaultSlots:e,additionalListeners:{change:this.handleChange,focus:this.handleFocus,blur:this.handleBlur},additionalProps:{dataItem:this.$props.dataItem}})}});exports.RadioButton=N;
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { defineComponent as
|
|
9
|
-
import { getDefaultSlots as k, templateRendering as y, getListeners as I, getTemplate as
|
|
8
|
+
import { defineComponent as N, h as t, createVNode as h, ref as R } from "vue";
|
|
9
|
+
import { getDefaultSlots as k, templateRendering as y, getListeners as I, getTemplate as l, getTabIndex as C, setRef as x, kendoThemeMaps as j, getRef as O, guid as z, validatePackage as F } from "@progress/kendo-vue-common";
|
|
10
10
|
import { packageMetadata as L } from "../package-metadata.mjs";
|
|
11
|
-
const M = /* @__PURE__ */
|
|
11
|
+
const M = /* @__PURE__ */ N({
|
|
12
12
|
name: "KendoRadioButton",
|
|
13
13
|
props: {
|
|
14
14
|
ariaDescribedBy: String,
|
|
@@ -44,9 +44,9 @@ const M = /* @__PURE__ */ v({
|
|
|
44
44
|
role: String
|
|
45
45
|
},
|
|
46
46
|
emits: {
|
|
47
|
-
change:
|
|
48
|
-
focus:
|
|
49
|
-
blur:
|
|
47
|
+
change: (e) => !0,
|
|
48
|
+
focus: (e) => !0,
|
|
49
|
+
blur: (e) => !0
|
|
50
50
|
},
|
|
51
51
|
created() {
|
|
52
52
|
this.calculatedId = z(), F(L);
|
|
@@ -75,10 +75,16 @@ const M = /* @__PURE__ */ v({
|
|
|
75
75
|
});
|
|
76
76
|
},
|
|
77
77
|
handleFocus(e) {
|
|
78
|
-
this.$props.disabled || this.$emit("focus",
|
|
78
|
+
this.$props.disabled || this.$emit("focus", {
|
|
79
|
+
event: e,
|
|
80
|
+
target: this
|
|
81
|
+
});
|
|
79
82
|
},
|
|
80
83
|
handleBlur(e) {
|
|
81
|
-
this.$props.disabled || this.$emit("blur",
|
|
84
|
+
this.$props.disabled || this.$emit("blur", {
|
|
85
|
+
event: e,
|
|
86
|
+
target: this
|
|
87
|
+
});
|
|
82
88
|
}
|
|
83
89
|
},
|
|
84
90
|
setup() {
|
|
@@ -92,42 +98,42 @@ const M = /* @__PURE__ */ v({
|
|
|
92
98
|
checked: m,
|
|
93
99
|
disabled: n,
|
|
94
100
|
id: s,
|
|
95
|
-
label:
|
|
101
|
+
label: r,
|
|
96
102
|
labelRender: a,
|
|
97
103
|
labelPlacement: b,
|
|
98
|
-
name:
|
|
99
|
-
tabIndex:
|
|
104
|
+
name: g,
|
|
105
|
+
tabIndex: f,
|
|
100
106
|
value: S,
|
|
101
|
-
tag:
|
|
107
|
+
tag: d,
|
|
102
108
|
role: $
|
|
103
109
|
} = this.$props;
|
|
104
|
-
let
|
|
110
|
+
let i = r;
|
|
105
111
|
if (a) {
|
|
106
|
-
const
|
|
107
|
-
|
|
112
|
+
const v = a ? y.call(this, a, I.call(this)) : null;
|
|
113
|
+
i = l.call(this, {
|
|
108
114
|
h: t,
|
|
109
|
-
template:
|
|
115
|
+
template: v
|
|
110
116
|
});
|
|
111
117
|
}
|
|
112
|
-
const o =
|
|
118
|
+
const o = l.call(this, {
|
|
113
119
|
h: t,
|
|
114
120
|
template: this.$props.content
|
|
115
|
-
}), u =
|
|
121
|
+
}), u = i !== void 0 ? h("label", {
|
|
116
122
|
class: "k-radio-label",
|
|
117
123
|
for: s || this.calculatedId,
|
|
118
124
|
style: {
|
|
119
125
|
userSelect: "none"
|
|
120
126
|
},
|
|
121
|
-
"aria-label":
|
|
122
|
-
}, [
|
|
127
|
+
"aria-label": r
|
|
128
|
+
}, [i]) : null, c = h("input", {
|
|
123
129
|
role: $,
|
|
124
130
|
type: "radio",
|
|
125
131
|
id: s || this.calculatedId,
|
|
126
|
-
name:
|
|
132
|
+
name: g,
|
|
127
133
|
class: this.inputClassName,
|
|
128
134
|
ref: x(this, "input"),
|
|
129
135
|
disabled: n,
|
|
130
|
-
tabindex: C(
|
|
136
|
+
tabindex: C(f, n),
|
|
131
137
|
checked: m,
|
|
132
138
|
style: this.$attrs.style,
|
|
133
139
|
"aria-describedby": p,
|
|
@@ -135,8 +141,8 @@ const M = /* @__PURE__ */ v({
|
|
|
135
141
|
onChange: this.handleChange,
|
|
136
142
|
onFocus: this.handleFocus,
|
|
137
143
|
onBlur: this.handleBlur
|
|
138
|
-
}, null), B = b === "before" ? t(
|
|
139
|
-
return
|
|
144
|
+
}, null), B = b === "before" ? t(d, [u, c, o, e]) : t(d, [c, u, o, e]);
|
|
145
|
+
return l.call(this, {
|
|
140
146
|
h: t,
|
|
141
147
|
template: this.$props.item,
|
|
142
148
|
defaultRendering: B,
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),b=require("./RadioButton.js"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),b=require("./RadioButton.js"),a=require("@progress/kendo-vue-common"),f=require("../package-metadata.js"),g=i.defineComponent({name:"KendoRadioGroup",props:{ariaLabelledBy:String,ariaDescribedBy:String,dataItems:Array,defaultValue:[String,Number,Object],dir:String,disabled:Boolean,labelPlacement:String,item:{type:String,default:void 0},layout:{type:String,default:"vertical",validator:function(e){return["horizontal","vertical"].includes(e)}},name:String,modelValue:[String,Number,Object],value:[String,Number,Object],valid:{type:Boolean,default:void 0}},emits:{changemodel:e=>!0,"update:modelValue":e=>!0,change:e=>!0,focus:e=>!0,blur:e=>!0},model:{event:"changemodel"},created(){this.radioGroupName=a.guid(),a.validatePackage(f.packageMetadata),this.stateChecked=this.$props.defaultValue},watch:{value(e){e===void 0&&(this.stateChecked=this.$props.defaultValue)}},mounted(){this.rtl=a.isRtl(this.$el)},computed:{radioGroupClasses(){const e=this.$props.layout;return{"k-radio-list":!0,"k-list-horizontal":e==="horizontal","k-list-vertical":e==="vertical"||e===void 0}},checkedRadioValue(){const e=this.$props.value;return e!==void 0?e:this.$props.modelValue!==void 0?this.$props.modelValue:this.stateChecked},currentDir(){const e=this.$props.dir;return e||(this.rtl?"rtl":void 0)}},data(){return{rtl:!1,stateChecked:void 0}},methods:{focusElement(){this.$el&&a.focusFirstFocusableChild(this.$el)},handleChange(e){let l=e.value;this.$props.value===void 0&&!this.$props.disabled&&(this.stateChecked=l),this.$props.disabled||(this.$emit("changemodel",l),this.$emit("update:modelValue",l),this.$emit("change",{event:e,value:l}))},handleFocus(e){this.$props.disabled||this.$emit("focus",e)},handleBlur(e){this.$props.disabled||this.$emit("blur",e)}},setup(){return{inputRef:i.ref(null)}},render(){const{ariaLabelledBy:e,ariaDescribedBy:l,dataItems:d,disabled:r,name:n,labelPlacement:o,valid:c}=this.$props,h=d&&d.map(function(t,s){const u=this.checkedRadioValue===t.value,m=this.checkedRadioValue===null||this.checkedRadioValue===void 0,p=a.templateRendering.call(this,this.$props.item||t.item,a.getListeners.call(this));return i.createVNode(b.RadioButton,{class:a.classNames("k-radio-item",{"k-disabled":t.disabled||r}),style:t.style,key:s,item:p,role:"none",tag:"li",valid:c,className:t.className,label:t.label,value:t.value,dataItem:t,checked:u,disabled:!!(t.disabled||r),labelPlacement:t.labelPlacement?t.labelPlacement:o,tabIndex:t.tabIndex?t.tabIndex:m&&s===0||u?0:-1,index:s,name:n||t.name||this.radioGroupName,onChange:this.handleChange,onFocus:this.handleFocus,onBlur:this.handleBlur},{default:()=>[t.content]})},this);return i.createVNode("ul",{role:"radiogroup",class:this.radioGroupClasses,dir:this.currentDir,"aria-labelledby":e,"aria-describedby":l},[h])}});exports.RadioGroup=g;
|