@progress/kendo-vue-inputs 8.4.0-develop.3 → 8.4.0-develop.4
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/colors/ColorInput.js +1 -1
- package/colors/ColorInput.mjs +18 -18
- package/colors/ColorPicker.js +1 -1
- package/colors/ColorPicker.mjs +12 -12
- package/dist/cdn/js/kendo-vue-inputs.js +1 -1
- package/maskedtextbox/MaskedTextBox.js +1 -1
- package/maskedtextbox/MaskedTextBox.mjs +36 -40
- package/numerictextbox/NumericTextBox.js +1 -1
- package/numerictextbox/NumericTextBox.mjs +15 -19
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +15 -10
- package/rating/RatingItem.js +1 -1
- package/rating/RatingItem.mjs +29 -29
- package/slider/Slider.js +1 -1
- package/slider/Slider.mjs +38 -37
- package/textbox/TextBox.js +1 -1
- package/textbox/TextBox.mjs +20 -24
package/rating/RatingItem.mjs
CHANGED
|
@@ -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 { getTemplate as
|
|
10
|
-
import {
|
|
11
|
-
const
|
|
8
|
+
import { defineComponent as k, h as f, createVNode as n, ref as M } from "vue";
|
|
9
|
+
import { getTemplate as x, Icon as i, getIconName as c, classNames as y } from "@progress/kendo-vue-common";
|
|
10
|
+
import { starIcon as h } from "@progress/kendo-svg-icons";
|
|
11
|
+
const F = /* @__PURE__ */ k({
|
|
12
12
|
name: "KendoVueRatingItem",
|
|
13
13
|
emits: {
|
|
14
14
|
click: (e) => !0,
|
|
@@ -51,12 +51,12 @@ const B = /* @__PURE__ */ f({
|
|
|
51
51
|
},
|
|
52
52
|
setup() {
|
|
53
53
|
return {
|
|
54
|
-
inputRef:
|
|
54
|
+
inputRef: M(null)
|
|
55
55
|
};
|
|
56
56
|
},
|
|
57
57
|
computed: {
|
|
58
58
|
wrapperClass() {
|
|
59
|
-
return
|
|
59
|
+
return y(`k-rating-item${this.$props.dir === "rtl" ? " k-rtl" : ""}${this.$props.haveSelectedValue || this.$props.selected ? " k-selected" : ""}${this.$props.hovered ? " k-hover" : ""}`);
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
62
|
render() {
|
|
@@ -64,29 +64,29 @@ const B = /* @__PURE__ */ f({
|
|
|
64
64
|
id: e,
|
|
65
65
|
dir: r,
|
|
66
66
|
half: s,
|
|
67
|
-
tabIndex:
|
|
68
|
-
title:
|
|
67
|
+
tabIndex: m,
|
|
68
|
+
title: d,
|
|
69
69
|
icon: t,
|
|
70
70
|
svgIcon: l,
|
|
71
71
|
svgIconOutline: a,
|
|
72
72
|
hovered: o,
|
|
73
73
|
selected: u,
|
|
74
|
-
haveSelectedValue:
|
|
75
|
-
item:
|
|
76
|
-
itemTemplate:
|
|
77
|
-
} = this.$props,
|
|
78
|
-
h:
|
|
79
|
-
template:
|
|
74
|
+
haveSelectedValue: p,
|
|
75
|
+
item: v,
|
|
76
|
+
itemTemplate: g
|
|
77
|
+
} = this.$props, $ = x.call(this, {
|
|
78
|
+
h: f,
|
|
79
|
+
template: g,
|
|
80
80
|
additionalProps: {
|
|
81
81
|
dir: r,
|
|
82
82
|
half: s,
|
|
83
|
-
title:
|
|
83
|
+
title: d,
|
|
84
84
|
icon: t,
|
|
85
85
|
svgIcon: l,
|
|
86
86
|
svgIconOutline: a,
|
|
87
87
|
hovered: o,
|
|
88
88
|
selected: u,
|
|
89
|
-
haveSelectedValue:
|
|
89
|
+
haveSelectedValue: p
|
|
90
90
|
},
|
|
91
91
|
additionalListeners: {
|
|
92
92
|
onclick: this.handleClick,
|
|
@@ -102,8 +102,8 @@ const B = /* @__PURE__ */ f({
|
|
|
102
102
|
id: e,
|
|
103
103
|
dir: r,
|
|
104
104
|
"data-half": s,
|
|
105
|
-
tabindex:
|
|
106
|
-
title:
|
|
105
|
+
tabindex: m,
|
|
106
|
+
title: d,
|
|
107
107
|
class: this.wrapperClass,
|
|
108
108
|
onClick: this.handleClick,
|
|
109
109
|
onKeydown: this.handleKeyDown,
|
|
@@ -112,11 +112,11 @@ const B = /* @__PURE__ */ f({
|
|
|
112
112
|
onMouseenter: this.handleMouseEnter,
|
|
113
113
|
onMouseleave: this.handleMouseLeave,
|
|
114
114
|
onMousemove: this.handleMouseMove
|
|
115
|
-
}, [
|
|
115
|
+
}, [v ? $ : [s && n("span", {
|
|
116
116
|
class: "k-rating-precision-complement"
|
|
117
117
|
}, [!(t || a) && n(i, {
|
|
118
|
-
name: "star
|
|
119
|
-
icon:
|
|
118
|
+
name: "star",
|
|
119
|
+
icon: h,
|
|
120
120
|
style: r === "rtl" ? {
|
|
121
121
|
clipPath: "inset(0 50% 0 0)"
|
|
122
122
|
} : {
|
|
@@ -124,14 +124,14 @@ const B = /* @__PURE__ */ f({
|
|
|
124
124
|
},
|
|
125
125
|
size: "xlarge"
|
|
126
126
|
}, null), (t || a) && n(i, {
|
|
127
|
-
name:
|
|
127
|
+
name: c(`${t}-outline`),
|
|
128
128
|
icon: a,
|
|
129
129
|
size: "xlarge"
|
|
130
130
|
}, null)]), s && n("span", {
|
|
131
131
|
class: "k-rating-precision-part"
|
|
132
132
|
}, [!(t || l) && n(i, {
|
|
133
133
|
name: "star",
|
|
134
|
-
icon:
|
|
134
|
+
icon: h,
|
|
135
135
|
style: r === "rtl" ? {
|
|
136
136
|
clipPath: "inset(0 0 0 50%)"
|
|
137
137
|
} : {
|
|
@@ -139,7 +139,7 @@ const B = /* @__PURE__ */ f({
|
|
|
139
139
|
},
|
|
140
140
|
size: "xlarge"
|
|
141
141
|
}, null), (t || l) && n(i, {
|
|
142
|
-
name: t ?
|
|
142
|
+
name: t ? c(t) : void 0,
|
|
143
143
|
icon: l,
|
|
144
144
|
size: "xlarge"
|
|
145
145
|
}, null)]), s && n("span", {
|
|
@@ -150,18 +150,18 @@ const B = /* @__PURE__ */ f({
|
|
|
150
150
|
}
|
|
151
151
|
}, null), !s && (!(t || l) && (o || u && !o) && n(i, {
|
|
152
152
|
name: "star",
|
|
153
|
-
icon:
|
|
153
|
+
icon: h,
|
|
154
154
|
size: "xlarge"
|
|
155
155
|
}, null) || !(t || l) && !o && !u && n(i, {
|
|
156
|
-
name: "star
|
|
157
|
-
icon:
|
|
156
|
+
name: "star",
|
|
157
|
+
icon: h,
|
|
158
158
|
size: "xlarge"
|
|
159
159
|
}, null) || (t || l) && (o || u && !o) && n(i, {
|
|
160
160
|
name: t,
|
|
161
161
|
icon: l,
|
|
162
162
|
size: "xlarge"
|
|
163
163
|
}, null) || (t || l) && !o && n(i, {
|
|
164
|
-
name:
|
|
164
|
+
name: c(`${t}-outline`),
|
|
165
165
|
icon: a,
|
|
166
166
|
size: "xlarge"
|
|
167
167
|
}, null))]]);
|
|
@@ -205,5 +205,5 @@ const B = /* @__PURE__ */ f({
|
|
|
205
205
|
}
|
|
206
206
|
});
|
|
207
207
|
export {
|
|
208
|
-
|
|
208
|
+
F as RatingItem
|
|
209
209
|
};
|
package/slider/Slider.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 r=require("vue"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),p=require("@progress/kendo-vue-buttons"),i=require("@progress/kendo-vue-common"),g=require("@progress/kendo-vue-intl"),s=require("../messages/main.js"),m=require("./SliderLabel.js"),f=require("../package-metadata.js"),a=require("@progress/kendo-svg-icons"),v=r.defineComponent({name:"KendoSlider",model:{event:"changemodel"},emits:{changemodel:e=>!0,"update:modelValue":e=>!0,change:e=>!0,blur:e=>!0,focus:e=>!0},props:{modelValue:{type:Number,default:void 0},defaultValue:{type:Number,default:void 0},name:String,buttons:Boolean,tabIndex:Number,disabled:Boolean,dir:String,step:Number,min:{type:Number,required:!0},max:{type:Number,required:!0},value:Number,vertical:Boolean,id:String,ariaLabelledBy:String,ariaDescribedBy:String,ariaLabel:String},provide(){return{kendoMin:this.$props.min,kendoMax:this.$props.max,kendoVertical:this.$props.vertical}},inject:{kendoLocalizationService:{default:null}},data(){return{currentValue:void 0,currentFocused:!1,currentDir:"ltr"}},computed:{computedValue(){const e=this.$props.value!==void 0?this.$props.value:this.currentValue,{min:t,max:n}=this.$props;return e===void 0?e:Math.min(Math.max(e,t),n)},sliderTrack(){return this._sliderTrack}},created(){i.validatePackage(f.packageMetadata),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=this.$props.min,this.currentFocused=!1,this.currentDir=this.$props.dir},mounted(){if(this._sliderTrack=this.$refs.sliderTrack,this.$el&&(this.draggable=this.$refs.draggable),!this.currentDir&&window&&this.$el){const e=window.getComputedStyle(this.$el).direction;e&&(this.currentDir=e)}},updated(){this.$el&&(this.draggable=this.$refs.draggable)},setup(){const e=r.ref(null),t=r.inject("kendoLocalizationService",{});return{inputRef:e,kendoLocalizationService:t}},render(){const e=g.provideLocalizationService(this),t=(this.computedValue-this.$props.min)/(this.$props.max-this.$props.min)*100,n=i.getDefaultSlots(this),{vertical:c}=this.$props,h=this.currentDir==="rtl";let o,l,u,d;return c?(o=a.chevronUpIcon,l=a.chevronDownIcon,u="chevron-up",d="chevron-down"):h?(o=a.chevronLeftIcon,l=a.chevronRightIcon,u="chevron-left",d="chevron-right"):(o=a.chevronRightIcon,l=a.chevronLeftIcon,u="chevron-right",d="chevron-left"),r.createVNode("div",{dir:this.currentDir,id:this.$props.id,style:this.$props.style,onFocus:this.onFocus,onBlur:this.onBlur,onKeydown:this.onKeyDown,"aria-label":this.$props.ariaLabel,class:i.classNames("k-slider",{"k-focus":this.currentFocused,"k-disabled":this.$props.disabled,"k-slider-horizontal":!this.$props.vertical,"k-slider-vertical":this.$props.vertical},this.$props.className)},[this.$props.buttons&&r.createVNode(p.Button,{type:"button",tabIndex:-1,icon:d,svgIcon:l,style:{position:"relative"},rounded:"full",class:"k-button-decrease",title:e.toLanguageString(s.sliderDecreaseValue,s.messages[s.sliderDecreaseValue]),onClick:this.decrement},null),r.createVNode(i.Draggable,{onDrag:this.dragOver,onPress:this.dragStart,ref:"draggable"},{default:()=>[r.createVNode("div",{class:"k-slider-track-wrap",style:{touchAction:"none"}},[n&&r.createVNode("ul",{class:"k-reset k-slider-items"},[n]),r.createVNode("div",{class:"k-slider-track",ref:"sliderTrack"},[r.createVNode("div",{class:"k-slider-selection",style:this.$props.vertical?{height:t+"%"}:{width:t+"%"}},null),r.createVNode("span",{class:"k-draghandle",role:"slider",tabindex:"0","aria-valuenow":this.computedValue,"aria-valuemin":this.$props.min,"aria-valuemax":this.$props.max,"aria-valuetext":this.computedValue.toString(),"aria-disabled":this.$props.disabled?"true":void 0,title:e.toLanguageString(s.sliderDragTitle,s.messages[s.sliderDragTitle]),style:this.$props.vertical?{bottom:t+"%",zIndex:1}:{[this.currentDir==="rtl"?"right":"left"]:t+"%",zIndex:1}},null)])])]}),this.$props.buttons&&r.createVNode(p.Button,{type:"button",tabIndex:-1,icon:u,svgIcon:o,rounded:"full",style:{position:"relative"},class:"k-button-increase",title:e.toLanguageString(s.sliderIncreaseValue,s.messages[s.sliderIncreaseValue]),onClick:this.increment},null)])},methods:{focus(){this.$el&&this.$el.focus()},isLabel(e){let t=e;for(;t;){if(t.getAttribute(m.SLIDER_LABEL_ATTRIBUTE))return!0;t=t.parentElement}return!1},onFocus(e){this.currentFocused=!0,this.$emit("focus",{event:e})},onBlur(e){this.currentFocused=!1,this.$emit("blur",{event:e})},onKeyDown(e){let t;e.keyCode===i.Keys.left||e.keyCode===i.Keys.down?t=this.currentValue-(this.$props.step||0):e.keyCode===i.Keys.right||e.keyCode===i.Keys.up?t=this.currentValue+(this.$props.step||0):e.keyCode===i.Keys.home?t=this.$props.min:e.keyCode===i.Keys.end&&(t=this.$props.max),t!==void 0&&(e.preventDefault(),this.change(e,t))},decrement(e){e.preventDefault(),this.change(e,this.currentValue-(this.$props.step||0))},increment(e){e.preventDefault(),this.change(e,this.currentValue+(this.$props.step||0))},dragStart(e){this.isLabel(e.originalEvent.target)||(e.isTouch&&e.originalEvent.preventDefault(),this.drag(e))},dragOver(e){e.originalEvent.preventDefault(),this.drag(e)},drag(e){const t=this.draggable.element.getBoundingClientRect(),n=this.$props.vertical?t.bottom-e.clientY:this.currentDir==="rtl"?t.right-e.clientX:e.clientX-t.left,c=this.$props.vertical?t.height:t.width,h=n/c;this.change(e,this.$props.min+h*(this.$props.max-this.$props.min))},change(e,t){t=Math.min(Math.max(t,this.$props.min),this.$props.max),this.currentValue=t,this.$emit("changemodel",t),this.$emit("update:modelValue",t),this.$emit("change",{event:e,value:t,component:this,target:{name:this.$props.name,value:t}})}}});exports.Slider=v;
|
package/slider/Slider.mjs
CHANGED
|
@@ -5,15 +5,15 @@
|
|
|
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 { Button as
|
|
10
|
-
import { Keys as
|
|
11
|
-
import { provideLocalizationService as
|
|
12
|
-
import { sliderDecreaseValue as
|
|
13
|
-
import { SLIDER_LABEL_ATTRIBUTE as
|
|
14
|
-
import { packageMetadata as
|
|
15
|
-
import {
|
|
16
|
-
const
|
|
8
|
+
import { defineComponent as v, createVNode as r, ref as b, inject as k } from "vue";
|
|
9
|
+
import { Button as h } from "@progress/kendo-vue-buttons";
|
|
10
|
+
import { Keys as s, getDefaultSlots as V, classNames as y, Draggable as S, validatePackage as D } from "@progress/kendo-vue-common";
|
|
11
|
+
import { provideLocalizationService as w } from "@progress/kendo-vue-intl";
|
|
12
|
+
import { sliderDecreaseValue as p, messages as c, sliderDragTitle as m, sliderIncreaseValue as g } from "../messages/main.mjs";
|
|
13
|
+
import { SLIDER_LABEL_ATTRIBUTE as x } from "./SliderLabel.mjs";
|
|
14
|
+
import { packageMetadata as L } from "../package-metadata.mjs";
|
|
15
|
+
import { chevronUpIcon as I, chevronDownIcon as B, chevronLeftIcon as f, chevronRightIcon as $ } from "@progress/kendo-svg-icons";
|
|
16
|
+
const R = /* @__PURE__ */ v({
|
|
17
17
|
name: "KendoSlider",
|
|
18
18
|
model: {
|
|
19
19
|
event: "changemodel"
|
|
@@ -78,16 +78,16 @@ const M = /* @__PURE__ */ b({
|
|
|
78
78
|
computedValue() {
|
|
79
79
|
const e = this.$props.value !== void 0 ? this.$props.value : this.currentValue, {
|
|
80
80
|
min: t,
|
|
81
|
-
max:
|
|
81
|
+
max: i
|
|
82
82
|
} = this.$props;
|
|
83
|
-
return e === void 0 ? e : Math.min(Math.max(e, t),
|
|
83
|
+
return e === void 0 ? e : Math.min(Math.max(e, t), i);
|
|
84
84
|
},
|
|
85
85
|
sliderTrack() {
|
|
86
86
|
return this._sliderTrack;
|
|
87
87
|
}
|
|
88
88
|
},
|
|
89
89
|
created() {
|
|
90
|
-
|
|
90
|
+
D(L), 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 = this.$props.min, this.currentFocused = !1, this.currentDir = this.$props.dir;
|
|
91
91
|
},
|
|
92
92
|
mounted() {
|
|
93
93
|
if (this._sliderTrack = this.$refs.sliderTrack, this.$el && (this.draggable = this.$refs.draggable), !this.currentDir && window && this.$el) {
|
|
@@ -99,17 +99,18 @@ const M = /* @__PURE__ */ b({
|
|
|
99
99
|
this.$el && (this.draggable = this.$refs.draggable);
|
|
100
100
|
},
|
|
101
101
|
setup() {
|
|
102
|
-
const e =
|
|
102
|
+
const e = b(null), t = k("kendoLocalizationService", {});
|
|
103
103
|
return {
|
|
104
104
|
inputRef: e,
|
|
105
105
|
kendoLocalizationService: t
|
|
106
106
|
};
|
|
107
107
|
},
|
|
108
108
|
render() {
|
|
109
|
-
const e =
|
|
110
|
-
vertical:
|
|
111
|
-
} = this.$props,
|
|
112
|
-
|
|
109
|
+
const e = w(this), t = (this.computedValue - this.$props.min) / (this.$props.max - this.$props.min) * 100, i = V(this), {
|
|
110
|
+
vertical: u
|
|
111
|
+
} = this.$props, d = this.currentDir === "rtl";
|
|
112
|
+
let n, a, o, l;
|
|
113
|
+
return u ? (n = I, a = B, o = "chevron-up", l = "chevron-down") : d ? (n = f, a = $, o = "chevron-left", l = "chevron-right") : (n = $, a = f, o = "chevron-right", l = "chevron-left"), r("div", {
|
|
113
114
|
dir: this.currentDir,
|
|
114
115
|
id: this.$props.id,
|
|
115
116
|
style: this.$props.style,
|
|
@@ -117,47 +118,47 @@ const M = /* @__PURE__ */ b({
|
|
|
117
118
|
onBlur: this.onBlur,
|
|
118
119
|
onKeydown: this.onKeyDown,
|
|
119
120
|
"aria-label": this.$props.ariaLabel,
|
|
120
|
-
class:
|
|
121
|
+
class: y("k-slider", {
|
|
121
122
|
"k-focus": this.currentFocused,
|
|
122
123
|
"k-disabled": this.$props.disabled,
|
|
123
124
|
"k-slider-horizontal": !this.$props.vertical,
|
|
124
125
|
"k-slider-vertical": this.$props.vertical
|
|
125
126
|
}, this.$props.className)
|
|
126
|
-
}, [this.$props.buttons &&
|
|
127
|
+
}, [this.$props.buttons && r(h, {
|
|
127
128
|
type: "button",
|
|
128
129
|
tabIndex: -1,
|
|
129
|
-
icon:
|
|
130
|
-
svgIcon:
|
|
130
|
+
icon: l,
|
|
131
|
+
svgIcon: a,
|
|
131
132
|
style: {
|
|
132
133
|
position: "relative"
|
|
133
134
|
},
|
|
134
135
|
rounded: "full",
|
|
135
136
|
class: "k-button-decrease",
|
|
136
|
-
title: e.toLanguageString(
|
|
137
|
+
title: e.toLanguageString(p, c[p]),
|
|
137
138
|
onClick: this.decrement
|
|
138
|
-
}, null),
|
|
139
|
+
}, null), r(S, {
|
|
139
140
|
onDrag: this.dragOver,
|
|
140
141
|
onPress: this.dragStart,
|
|
141
142
|
ref: "draggable"
|
|
142
143
|
}, {
|
|
143
|
-
default: () => [
|
|
144
|
+
default: () => [r("div", {
|
|
144
145
|
class: "k-slider-track-wrap",
|
|
145
146
|
style: {
|
|
146
147
|
touchAction: "none"
|
|
147
148
|
}
|
|
148
|
-
}, [
|
|
149
|
+
}, [i && r("ul", {
|
|
149
150
|
class: "k-reset k-slider-items"
|
|
150
|
-
}, [
|
|
151
|
+
}, [i]), r("div", {
|
|
151
152
|
class: "k-slider-track",
|
|
152
153
|
ref: "sliderTrack"
|
|
153
|
-
}, [
|
|
154
|
+
}, [r("div", {
|
|
154
155
|
class: "k-slider-selection",
|
|
155
156
|
style: this.$props.vertical ? {
|
|
156
157
|
height: t + "%"
|
|
157
158
|
} : {
|
|
158
159
|
width: t + "%"
|
|
159
160
|
}
|
|
160
|
-
}, null),
|
|
161
|
+
}, null), r("span", {
|
|
161
162
|
class: "k-draghandle",
|
|
162
163
|
role: "slider",
|
|
163
164
|
tabindex: "0",
|
|
@@ -166,7 +167,7 @@ const M = /* @__PURE__ */ b({
|
|
|
166
167
|
"aria-valuemax": this.$props.max,
|
|
167
168
|
"aria-valuetext": this.computedValue.toString(),
|
|
168
169
|
"aria-disabled": this.$props.disabled ? "true" : void 0,
|
|
169
|
-
title: e.toLanguageString(
|
|
170
|
+
title: e.toLanguageString(m, c[m]),
|
|
170
171
|
style: this.$props.vertical ? {
|
|
171
172
|
bottom: t + "%",
|
|
172
173
|
zIndex: 1
|
|
@@ -175,17 +176,17 @@ const M = /* @__PURE__ */ b({
|
|
|
175
176
|
zIndex: 1
|
|
176
177
|
}
|
|
177
178
|
}, null)])])]
|
|
178
|
-
}), this.$props.buttons &&
|
|
179
|
+
}), this.$props.buttons && r(h, {
|
|
179
180
|
type: "button",
|
|
180
181
|
tabIndex: -1,
|
|
181
|
-
icon:
|
|
182
|
+
icon: o,
|
|
182
183
|
svgIcon: n,
|
|
183
184
|
rounded: "full",
|
|
184
185
|
style: {
|
|
185
186
|
position: "relative"
|
|
186
187
|
},
|
|
187
188
|
class: "k-button-increase",
|
|
188
|
-
title: e.toLanguageString(
|
|
189
|
+
title: e.toLanguageString(g, c[g]),
|
|
189
190
|
onClick: this.increment
|
|
190
191
|
}, null)]);
|
|
191
192
|
},
|
|
@@ -196,7 +197,7 @@ const M = /* @__PURE__ */ b({
|
|
|
196
197
|
isLabel(e) {
|
|
197
198
|
let t = e;
|
|
198
199
|
for (; t; ) {
|
|
199
|
-
if (t.getAttribute(
|
|
200
|
+
if (t.getAttribute(x))
|
|
200
201
|
return !0;
|
|
201
202
|
t = t.parentElement;
|
|
202
203
|
}
|
|
@@ -214,7 +215,7 @@ const M = /* @__PURE__ */ b({
|
|
|
214
215
|
},
|
|
215
216
|
onKeyDown(e) {
|
|
216
217
|
let t;
|
|
217
|
-
e.keyCode ===
|
|
218
|
+
e.keyCode === s.left || e.keyCode === s.down ? t = this.currentValue - (this.$props.step || 0) : e.keyCode === s.right || e.keyCode === s.up ? t = this.currentValue + (this.$props.step || 0) : e.keyCode === s.home ? t = this.$props.min : e.keyCode === s.end && (t = this.$props.max), t !== void 0 && (e.preventDefault(), this.change(e, t));
|
|
218
219
|
},
|
|
219
220
|
decrement(e) {
|
|
220
221
|
e.preventDefault(), this.change(e, this.currentValue - (this.$props.step || 0));
|
|
@@ -229,8 +230,8 @@ const M = /* @__PURE__ */ b({
|
|
|
229
230
|
e.originalEvent.preventDefault(), this.drag(e);
|
|
230
231
|
},
|
|
231
232
|
drag(e) {
|
|
232
|
-
const t = this.draggable.element.getBoundingClientRect(),
|
|
233
|
-
this.change(e, this.$props.min +
|
|
233
|
+
const t = this.draggable.element.getBoundingClientRect(), i = this.$props.vertical ? t.bottom - e.clientY : this.currentDir === "rtl" ? t.right - e.clientX : e.clientX - t.left, u = this.$props.vertical ? t.height : t.width, d = i / u;
|
|
234
|
+
this.change(e, this.$props.min + d * (this.$props.max - this.$props.min));
|
|
234
235
|
},
|
|
235
236
|
change(e, t) {
|
|
236
237
|
t = Math.min(Math.max(t, this.$props.min), this.$props.max), this.currentValue = t, this.$emit("changemodel", t), this.$emit("update:modelValue", t), this.$emit("change", {
|
|
@@ -246,5 +247,5 @@ const M = /* @__PURE__ */ b({
|
|
|
246
247
|
}
|
|
247
248
|
});
|
|
248
249
|
export {
|
|
249
|
-
|
|
250
|
+
R as Slider
|
|
250
251
|
};
|
package/textbox/TextBox.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),a=require("@progress/kendo-vue-common"),V=require("../package-metadata.js"),k=require("@progress/kendo-vue-labels"),r=require("@progress/kendo-svg-icons");function b(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!i.isVNode(t)}const x=i.defineComponent({model:{event:"changemodel"},inheritAttrs:!1,emits:{input:t=>!0,change:t=>!0,changemodel:t=>!0,"update:modelValue":t=>!0,focus:t=>!0,blur:t=>!0,keyup:t=>!0,keydown:t=>!0,keypress:t=>!0},props:{modelValue:{type:[String,Number],default:void 0},disabled:{type:Boolean,default:void 0},defaultValue:{type:[String,Number],default:""},value:{type:[String,Number]},label:{type:String},placeholder:{type:String},required:{type:Boolean,default:!1},size:{type:String,validator:function(t){return["small","medium","large"].includes(t)}},rounded:{type:String,validator:function(t){return["none","small","medium","large","full"].includes(t)}},fillMode:{type:String,validator:function(t){return["solid","flat","outline"].includes(t)}},dir:{type:String},id:String,valid:{type:Boolean,default:void 0},validate:{type:Boolean},validationMessage:{type:String},validityStyles:{type:Boolean,default:!0},iconName:String,inputPrefix:[String,Function],prefix:[String,Function],inputSuffix:[String,Function],suffix:[String,Function],showValidationIcon:Boolean,showLoadingIcon:Boolean,showClearButton:Boolean,inputClass:String,wrapperClass:String,tabIndex:Number,role:String,title:String,ariaLabel:String,inputAttributes:Object},data:function(){return{hasMounted:!1,autofill:!1,currentValue:"",valueDuringOnChange:"",focused:!1}},created(){a.validatePackage(V.packageMetadata),this._input=void 0,this._inputId=a.guid(),this.$data.valueDuringOnChange=void 0,this.$data.currentValue=this.$props.defaultValue},mounted(){this._input=this.inputRef,this.wrapper=this.wrapperRef,this.$data.hasMounted=!0,this.setValidity()},updated(){this.setValidity(),this.updateValidClass()},setup(){return{inputRef:i.ref(null)}},render(){const t=!this.$props.validityStyles||this.validity().valid,{label:e,id:n,required:l,iconName:u,showValidationIcon:d,showLoadingIcon:h,showClearButton:c,inputAttributes:f}=this.$props,p=n||this._inputId,m=i.h("input",{...this.$attrs,...f,"aria-label":this.$props.ariaLabel,role:this.$props.role,title:this.$props.title,tabindex:this.$props.tabIndex,placeholder:this.$props.placeholder,id:p,required:l,disabled:this.$props.disabled,value:this.computedValue,class:this.inputInnerClass,ref:o=>{this.inputRef=o},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}),g=a.templateRendering.call(this,this.$props.prefix||this.$props.inputPrefix,a.getListeners.call(this)),v=a.templateRendering.call(this,this.$props.suffix||this.$props.inputSuffix,a.getListeners.call(this)),y=a.getTemplate.call(this,{h:i.h,template:g,additionalProps:{value:this.computedValue,valid:t}}),$=a.getTemplate.call(this,{h:i.h,template:v,additionalProps:{value:this.computedValue,valid:t}}),s=i.createVNode("span",{class:this.inputWrapperClass(),ref:o=>{this.wrapperRef=o}},[u&&i.createVNode(a.Icon,{name:u,class:"k-input-icon"},null),(this.$props.prefix||this.$props.inputPrefix)&&i.createVNode("span",{class:"k-input-prefix"},[y]),m,(this.$props.suffix||this.$props.inputSuffix)&&i.createVNode("span",{class:"k-input-suffix"},[$]),d&&t&&i.createVNode(a.Icon,{name:"check",icon:r.checkIcon,class:"k-input-validation-icon"},null),d&&!t&&i.createVNode(a.Icon,{name:"exclamation-circle",icon:r.exclamationCircleIcon,class:"k-input-validation-icon"},null),h&&i.createVNode(a.Icon,{name:"loading",class:"k-input-loading-icon"},null),c&&this.computedValue&&i.createVNode("span",{onClick:this.clearClick,class:"k-clear-value"},[i.createVNode(a.Icon,{name:"x",icon:r.xIcon},null)])]);return e?i.createVNode(k.FloatingLabel,{label:e,editorId:p,editorValue:this.computedValue,editorValid:t,editorDisabled:this.$props.disabled,editorPlaceholder:this.$data.focused?this.$props.placeholder:"",dir:this.$props.dir},b(s)?s:{default:()=>[s]}):s},methods:{updateValidClass(){this.wrapper.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={badTextBox:this._input?this._input.validity.badTextBox:!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(const n in t)t.hasOwnProperty(n)&&(e=e||t[n]);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,n){this.disabled||(this.$data.currentValue=n,this.$data.valueDuringOnChange=n,this.$nextTick(()=>{this.$emit("changemodel",n),this.$emit("update:modelValue",n),this.$emit(e,{event:t,value:n,component:this,target:t.target,validity:this.validity()}),this.$data.valueDuringOnChange=void 0}))},handleAutoFill(t){if(t.animationName==="autoFillStart"){const 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},inputWrapperClass(){const{size:t,fillMode:e,rounded:n}=this.$props,l=!this.$data.hasMounted||!this.$props.validityStyles||this.validity().valid;return{"k-textbox":!0,"k-input":!0,[`k-input-${a.kendoThemeMaps.sizeMap[t]||t}`]:t,[`k-input-${e}`]:e,[`k-rounded-${a.kendoThemeMaps.roundedMap[n]||n}`]:n,"k-invalid":!l,"k-required":this.required,"k-disabled":this.$props.disabled,[this.wrapperClass]:this.wrapperClass}}},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(){return{"k-input-inner":!0,[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.TextBox=x;
|
package/textbox/TextBox.mjs
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { defineComponent as V, h as
|
|
8
|
+
import { defineComponent as V, h as r, createVNode as a, ref as C, isVNode as _ } from "vue";
|
|
9
9
|
import { kendoThemeMaps as h, templateRendering as c, getListeners as f, getTemplate as m, Icon as s, validatePackage as w, guid as I } from "@progress/kendo-vue-common";
|
|
10
10
|
import { packageMetadata as M } from "../package-metadata.mjs";
|
|
11
11
|
import { FloatingLabel as B } from "@progress/kendo-vue-labels";
|
|
@@ -136,25 +136,25 @@ const R = /* @__PURE__ */ V({
|
|
|
136
136
|
id: e,
|
|
137
137
|
required: l,
|
|
138
138
|
iconName: o,
|
|
139
|
-
showValidationIcon:
|
|
139
|
+
showValidationIcon: d,
|
|
140
140
|
showLoadingIcon: g,
|
|
141
141
|
showClearButton: v,
|
|
142
|
-
inputAttributes:
|
|
143
|
-
} = this.$props,
|
|
142
|
+
inputAttributes: y
|
|
143
|
+
} = this.$props, p = e || this._inputId, $ = r("input", {
|
|
144
144
|
...this.$attrs,
|
|
145
|
-
|
|
145
|
+
...y,
|
|
146
146
|
"aria-label": this.$props.ariaLabel,
|
|
147
147
|
role: this.$props.role,
|
|
148
148
|
title: this.$props.title,
|
|
149
149
|
tabindex: this.$props.tabIndex,
|
|
150
150
|
placeholder: this.$props.placeholder,
|
|
151
|
-
id:
|
|
151
|
+
id: p,
|
|
152
152
|
required: l,
|
|
153
153
|
disabled: this.$props.disabled,
|
|
154
154
|
value: this.computedValue,
|
|
155
155
|
class: this.inputInnerClass,
|
|
156
|
-
ref: (
|
|
157
|
-
this.inputRef =
|
|
156
|
+
ref: (u) => {
|
|
157
|
+
this.inputRef = u;
|
|
158
158
|
},
|
|
159
159
|
onKeydown: this.handleKeydown,
|
|
160
160
|
onKeyup: this.handleKeyup,
|
|
@@ -165,15 +165,15 @@ const R = /* @__PURE__ */ V({
|
|
|
165
165
|
onInput: this.handleInput,
|
|
166
166
|
onAnimationstart: this.handleAutoFill,
|
|
167
167
|
onAnimationend: this.handleAutoFillEnd
|
|
168
|
-
}), k = c.call(this, this.$props.prefix || this.$props.inputPrefix, f.call(this)), x = c.call(this, this.$props.suffix || this.$props.inputSuffix, f.call(this)),
|
|
169
|
-
h:
|
|
168
|
+
}), k = c.call(this, this.$props.prefix || this.$props.inputPrefix, f.call(this)), x = c.call(this, this.$props.suffix || this.$props.inputSuffix, f.call(this)), b = m.call(this, {
|
|
169
|
+
h: r,
|
|
170
170
|
template: k,
|
|
171
171
|
additionalProps: {
|
|
172
172
|
value: this.computedValue,
|
|
173
173
|
valid: t
|
|
174
174
|
}
|
|
175
|
-
}),
|
|
176
|
-
h:
|
|
175
|
+
}), S = m.call(this, {
|
|
176
|
+
h: r,
|
|
177
177
|
template: x,
|
|
178
178
|
additionalProps: {
|
|
179
179
|
value: this.computedValue,
|
|
@@ -181,25 +181,21 @@ const R = /* @__PURE__ */ V({
|
|
|
181
181
|
}
|
|
182
182
|
}), n = a("span", {
|
|
183
183
|
class: this.inputWrapperClass(),
|
|
184
|
-
ref: (
|
|
185
|
-
this.wrapperRef =
|
|
184
|
+
ref: (u) => {
|
|
185
|
+
this.wrapperRef = u;
|
|
186
186
|
}
|
|
187
187
|
}, [o && a(s, {
|
|
188
188
|
name: o,
|
|
189
189
|
class: "k-input-icon"
|
|
190
190
|
}, null), (this.$props.prefix || this.$props.inputPrefix) && a("span", {
|
|
191
|
-
class: "k-input-prefix
|
|
192
|
-
}, [
|
|
193
|
-
class: "k-input-
|
|
194
|
-
},
|
|
195
|
-
class: "k-input-separator k-input-separator-vertical"
|
|
196
|
-
}, null), (this.$props.suffix || this.$props.inputSuffix) && a("span", {
|
|
197
|
-
class: "k-input-suffix k-input-suffix-horizontal"
|
|
198
|
-
}, [b]), p && t && a(s, {
|
|
191
|
+
class: "k-input-prefix"
|
|
192
|
+
}, [b]), $, (this.$props.suffix || this.$props.inputSuffix) && a("span", {
|
|
193
|
+
class: "k-input-suffix"
|
|
194
|
+
}, [S]), d && t && a(s, {
|
|
199
195
|
name: "check",
|
|
200
196
|
icon: F,
|
|
201
197
|
class: "k-input-validation-icon"
|
|
202
|
-
}, null),
|
|
198
|
+
}, null), d && !t && a(s, {
|
|
203
199
|
name: "exclamation-circle",
|
|
204
200
|
icon: N,
|
|
205
201
|
class: "k-input-validation-icon"
|
|
@@ -215,7 +211,7 @@ const R = /* @__PURE__ */ V({
|
|
|
215
211
|
}, null)])]);
|
|
216
212
|
return i ? a(B, {
|
|
217
213
|
label: i,
|
|
218
|
-
editorId:
|
|
214
|
+
editorId: p,
|
|
219
215
|
editorValue: this.computedValue,
|
|
220
216
|
editorValid: t,
|
|
221
217
|
editorDisabled: this.$props.disabled,
|