@progress/kendo-vue-inputs 7.0.1-develop.2 → 7.0.1-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/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
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { defineComponent as p, createVNode as
|
|
8
|
+
import { defineComponent as p, createVNode as d, ref as f } from "vue";
|
|
9
9
|
import { RadioButton as b } from "./RadioButton.mjs";
|
|
10
|
-
import { templateRendering as g, getListeners as
|
|
10
|
+
import { templateRendering as g, getListeners as v, classNames as $, focusFirstFocusableChild as k, isRtl as y, guid as C, validatePackage as V } from "@progress/kendo-vue-common";
|
|
11
11
|
import { packageMetadata as R } from "../package-metadata.mjs";
|
|
12
12
|
const I = /* @__PURE__ */ p({
|
|
13
13
|
name: "KendoRadioGroup",
|
|
@@ -39,11 +39,11 @@ const I = /* @__PURE__ */ p({
|
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
emits: {
|
|
42
|
-
changemodel:
|
|
43
|
-
"update:modelValue":
|
|
44
|
-
change:
|
|
45
|
-
focus:
|
|
46
|
-
blur:
|
|
42
|
+
changemodel: (e) => !0,
|
|
43
|
+
"update:modelValue": (e) => !0,
|
|
44
|
+
change: (e) => !0,
|
|
45
|
+
focus: (e) => !0,
|
|
46
|
+
blur: (e) => !0
|
|
47
47
|
},
|
|
48
48
|
model: {
|
|
49
49
|
event: "changemodel"
|
|
@@ -85,13 +85,13 @@ const I = /* @__PURE__ */ p({
|
|
|
85
85
|
},
|
|
86
86
|
methods: {
|
|
87
87
|
focusElement() {
|
|
88
|
-
this.$el &&
|
|
88
|
+
this.$el && k(this.$el);
|
|
89
89
|
},
|
|
90
90
|
handleChange(e) {
|
|
91
|
-
let
|
|
92
|
-
this.$props.value === void 0 && !this.$props.disabled && (this.stateChecked =
|
|
91
|
+
let a = e.value;
|
|
92
|
+
this.$props.value === void 0 && !this.$props.disabled && (this.stateChecked = a), this.$props.disabled || (this.$emit("changemodel", a), this.$emit("update:modelValue", a), this.$emit("change", {
|
|
93
93
|
event: e,
|
|
94
|
-
value:
|
|
94
|
+
value: a
|
|
95
95
|
}));
|
|
96
96
|
},
|
|
97
97
|
handleFocus(e) {
|
|
@@ -109,47 +109,47 @@ const I = /* @__PURE__ */ p({
|
|
|
109
109
|
render() {
|
|
110
110
|
const {
|
|
111
111
|
ariaLabelledBy: e,
|
|
112
|
-
ariaDescribedBy:
|
|
112
|
+
ariaDescribedBy: a,
|
|
113
113
|
dataItems: i,
|
|
114
114
|
disabled: s,
|
|
115
115
|
name: n,
|
|
116
116
|
labelPlacement: u,
|
|
117
117
|
valid: o
|
|
118
|
-
} = this.$props, c = i && i.map(function(
|
|
119
|
-
const
|
|
120
|
-
return
|
|
121
|
-
class:
|
|
122
|
-
"k-disabled":
|
|
118
|
+
} = this.$props, c = i && i.map(function(t, l) {
|
|
119
|
+
const r = this.checkedRadioValue === t.value, h = this.checkedRadioValue === null || this.checkedRadioValue === void 0, m = g.call(this, this.$props.item || t.item, v.call(this));
|
|
120
|
+
return d(b, {
|
|
121
|
+
class: $("k-radio-item", {
|
|
122
|
+
"k-disabled": t.disabled || s
|
|
123
123
|
}),
|
|
124
|
-
style:
|
|
124
|
+
style: t.style,
|
|
125
125
|
key: l,
|
|
126
126
|
item: m,
|
|
127
127
|
role: "none",
|
|
128
128
|
tag: "li",
|
|
129
129
|
valid: o,
|
|
130
|
-
className:
|
|
131
|
-
label:
|
|
132
|
-
value:
|
|
133
|
-
dataItem:
|
|
134
|
-
checked:
|
|
135
|
-
disabled: !!(
|
|
136
|
-
labelPlacement:
|
|
137
|
-
tabIndex:
|
|
130
|
+
className: t.className,
|
|
131
|
+
label: t.label,
|
|
132
|
+
value: t.value,
|
|
133
|
+
dataItem: t,
|
|
134
|
+
checked: r,
|
|
135
|
+
disabled: !!(t.disabled || s),
|
|
136
|
+
labelPlacement: t.labelPlacement ? t.labelPlacement : u,
|
|
137
|
+
tabIndex: t.tabIndex ? t.tabIndex : h && l === 0 || r ? 0 : -1,
|
|
138
138
|
index: l,
|
|
139
|
-
name: n ||
|
|
139
|
+
name: n || t.name || this.radioGroupName,
|
|
140
140
|
onChange: this.handleChange,
|
|
141
141
|
onFocus: this.handleFocus,
|
|
142
142
|
onBlur: this.handleBlur
|
|
143
143
|
}, {
|
|
144
|
-
default: () => [
|
|
144
|
+
default: () => [t.content]
|
|
145
145
|
});
|
|
146
146
|
}, this);
|
|
147
|
-
return
|
|
147
|
+
return d("ul", {
|
|
148
148
|
role: "radiogroup",
|
|
149
149
|
class: this.radioGroupClasses,
|
|
150
150
|
dir: this.currentDir,
|
|
151
151
|
"aria-labelledby": e,
|
|
152
|
-
"aria-describedby":
|
|
152
|
+
"aria-describedby": a
|
|
153
153
|
}, [c]);
|
|
154
154
|
}
|
|
155
155
|
});
|
package/rating/Rating.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 c=require("vue"),l=require("@progress/kendo-vue-common"),M=require("../package-metadata.js"),B=require("./RatingItem.js"),n=require("./utils/main.js"),F=require("@progress/kendo-vue-intl"),g=require("../messages/main.js"),i=require("./utils/rating-reducer.js"),w=c.defineComponent({name:"Rating",emits:{change:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("vue"),l=require("@progress/kendo-vue-common"),M=require("../package-metadata.js"),B=require("./RatingItem.js"),n=require("./utils/main.js"),F=require("@progress/kendo-vue-intl"),g=require("../messages/main.js"),i=require("./utils/rating-reducer.js"),w=c.defineComponent({name:"Rating",emits:{change:e=>!0,keydown:e=>!0,focus:e=>!0,blur:e=>!0,click:e=>!0,mouseleave:e=>!0,mousemove:e=>!0},props:{min:{type:Number,default:1},max:{type:Number,default:5},step:{type:Number,default:1},item:{type:[String,Object,Function]},precision:{type:String,default:"item",validator:function(e){return["item","half"].includes(e)}},selection:{type:String,default:"continues",validator:function(e){return["continues","single"].includes(e)}},value:Number,icon:String,svgIconOutline:Object,svgIcon:Object,tabIndex:Number,disabled:Boolean,readonly:Boolean,id:String,half:Boolean,defaultValue:Number,label:String},created(){l.validatePackage(M.packageMetadata)},inject:{kendoLocalizationService:{default:null}},data:function(){return{focused:!1,currentValue:this.defaultValue||null,currentHovered:null}},setup(){return{inputRef:c.ref(null)}},computed:{base(){return this.$props.step/(this.$props.precision==="half"?2:1)},computedValue(){return this.$props.value!==void 0?this.$props.value:this.$data.currentValue}},render(){const e=F.provideLocalizationService(this),{min:t,max:a,step:s,id:o,dir:u,label:d,selection:f,precision:N,svgIcon:R,icon:T,item:v,value:b,tabIndex:A,disabled:h,readonly:I,ariaLabelledBy:k,ariaDescribedBy:V,svgIconOutline:C}=this.$props,O=Array.from({length:a-t+1},(y,r)=>t+r),S=n.getRemainder(n.toRound(a-t,this.base),s),m=this.computedValue,p=this.$data.currentHovered;return c.createVNode("span",{id:o,ref:"ratingRef",role:"slider",dir:u,tabindex:l.getTabIndex(A,h,void 0),class:l.classNames("k-rating",{"k-rtl":u==="rtl","k-readonly":I,"k-disabled":h}),onKeydown:this.handleKeyDown,onFocus:this.handleFocus,onBlur:this.handleBlur,onClick:()=>this.$data.focused=!0,"aria-valuemin":t,"aria-valuemax":a,"aria-valuenow":b!==null?b:void 0,"aria-disabled":h?"true":void 0,"aria-label":e.toLanguageString(g.ratingAriaLabel,g.messages[g.ratingAriaLabel]),"aria-labelledby":k,"aria-describedby":V},[c.createVNode("input",{id:"rating",class:"k-hidden",readonly:I,disabled:h},null),c.createVNode("span",{class:"k-rating-container"},[O.map(function(y){const r=n.toRound(y+S,this.base),$=N==="half"?n.isHalf(r,p!==null?p:m!==null?m:0,s):!1,H=n.isSelected(r,m,s,f),_=n.isSelected(r,p!==null?p:m,s,f),G=n.isSelected(r,p,s,f),x=l.templateRendering.call(this,v,l.getListeners.call(this));return c.createVNode(B.RatingItem,{key:r,value:r,dir:u,title:String($?n.toRound(r-s/2,this.base):r),icon:T,svgIcon:R,svgIconOutline:C,haveSelectedValue:H,half:$,selected:_,hovered:G,item:v,itemTemplate:x,onClick:this.handleItemClick,onMousemove:this.handleMouseMove,onMouseleave:this.handleMouseLeave},null)},this)]),d&&c.createVNode("span",{class:"k-rating-label"},[d])])},methods:{handleFocus(e){this.$emit("focus",{event:e})},handleBlur(e){this.$emit("blur",{event:e})},handleChange(e,t){this.$emit("change",{value:e,target:this.$refs.ratingRef,event:t})},handleKeyDown(e){if(!(this.$props.readonly||this.$props.disabled)){switch(e.keyCode){case l.Keys.right:e.preventDefault(),this.dispatchValue({type:this.$props.dir==="rtl"?i.RATING_ACTION.decrease:i.RATING_ACTION.increase,event:e});break;case l.Keys.left:e.preventDefault(),this.dispatchValue({type:this.$props.dir==="rtl"?i.RATING_ACTION.increase:i.RATING_ACTION.decrease,event:e});break;case l.Keys.home:e.preventDefault(),this.dispatchValue({type:this.$props.dir==="rtl"?i.RATING_ACTION.min:i.RATING_ACTION.max,event:e});break;case l.Keys.end:e.preventDefault(),this.dispatchValue({type:this.$props.dir==="rtl"?i.RATING_ACTION.max:i.RATING_ACTION.min,event:e});break;case l.Keys.esc:e.preventDefault(),this.dispatchValue({type:i.RATING_ACTION.deselect,event:e});break}this.$emit("keydown",{value:this.$data.currentValue,event:e})}},handleItemClick(e){const{event:t,value:a,target:s}=e;if(!(!s||!a||this.$props.readonly||this.$props.disabled)){if(this.$props.precision==="half"){const o=s.getBoundingClientRect(),d=n.calcIsFirstHalf(this.$props.dir?this.$props.dir:"ltr",o,e.event.clientX)?n.toRound(a-this.$props.step/2,this.base):a;this.dispatchValue({type:i.RATING_ACTION.select,payload:d,event:t})}else this.dispatchValue({type:i.RATING_ACTION.select,payload:a,event:t});this.$emit("click",t)}},handleMouseMove(e){const{event:t,value:a,target:s}=e;if(!(!s||!a))if(this.$props.precision==="half"){const o=s.getBoundingClientRect(),d=n.calcIsFirstHalf(this.$props.dir?this.$props.dir:"ltr",o,t.clientX)?a-this.$props.step/2:a;this.dispatchHover({type:i.RATING_ACTION.select,payload:d,event:t})}else this.dispatchHover({type:i.RATING_ACTION.select,payload:a,event:t})},handleMouseLeave(e){this.dispatchHover({type:i.RATING_ACTION.reset,event:e.event})},dispatchValue(e){const t={state:this.$props.value,min:this.$props.min,max:this.$props.max,step:this.base},a=t.state||this.$data.currentValue,s=i.ratingReducer(a,{...e,...t}),o=e.event;this.handleChange(s,o),this.$data.currentValue=s},dispatchHover(e){const t={state:this.$props.value,min:this.$props.min,max:this.$props.max,step:this.base,precision:this.$props.precision},a=t.state,s=i.ratingReducer(a,{...e,...t});this.$data.currentHovered=s}}});exports.Rating=w;
|
package/rating/Rating.mjs
CHANGED
|
@@ -9,20 +9,20 @@ import { defineComponent as j, createVNode as d, ref as A } from "vue";
|
|
|
9
9
|
import { Keys as u, classNames as K, getTabIndex as z, templateRendering as X, getListeners as _, validatePackage as G } from "@progress/kendo-vue-common";
|
|
10
10
|
import { packageMetadata as P } from "../package-metadata.mjs";
|
|
11
11
|
import { RatingItem as q } from "./RatingItem.mjs";
|
|
12
|
-
import { calcIsFirstHalf as V, toRound as m, getRemainder as E, isHalf as J, isSelected as
|
|
12
|
+
import { calcIsFirstHalf as V, toRound as m, getRemainder as E, isHalf as J, isSelected as v } from "./utils/main.mjs";
|
|
13
13
|
import { provideLocalizationService as Q } from "@progress/kendo-vue-intl";
|
|
14
14
|
import { ratingAriaLabel as I, messages as U } from "../messages/main.mjs";
|
|
15
15
|
import { ratingReducer as S, RATING_ACTION as i } from "./utils/rating-reducer.mjs";
|
|
16
|
-
const
|
|
16
|
+
const ne = /* @__PURE__ */ j({
|
|
17
17
|
name: "Rating",
|
|
18
18
|
emits: {
|
|
19
|
-
change:
|
|
20
|
-
keydown:
|
|
21
|
-
focus:
|
|
22
|
-
blur:
|
|
23
|
-
click:
|
|
24
|
-
mouseleave:
|
|
25
|
-
mousemove:
|
|
19
|
+
change: (e) => !0,
|
|
20
|
+
keydown: (e) => !0,
|
|
21
|
+
focus: (e) => !0,
|
|
22
|
+
blur: (e) => !0,
|
|
23
|
+
click: (e) => !0,
|
|
24
|
+
mouseleave: (e) => !0,
|
|
25
|
+
mousemove: (e) => !0
|
|
26
26
|
},
|
|
27
27
|
props: {
|
|
28
28
|
min: {
|
|
@@ -99,14 +99,14 @@ const le = /* @__PURE__ */ j({
|
|
|
99
99
|
min: t,
|
|
100
100
|
max: s,
|
|
101
101
|
step: a,
|
|
102
|
-
id:
|
|
102
|
+
id: n,
|
|
103
103
|
dir: o,
|
|
104
|
-
label:
|
|
104
|
+
label: l,
|
|
105
105
|
selection: f,
|
|
106
106
|
precision: x,
|
|
107
107
|
svgIcon: H,
|
|
108
108
|
icon: R,
|
|
109
|
-
item:
|
|
109
|
+
item: g,
|
|
110
110
|
value: b,
|
|
111
111
|
tabIndex: C,
|
|
112
112
|
disabled: p,
|
|
@@ -116,9 +116,9 @@ const le = /* @__PURE__ */ j({
|
|
|
116
116
|
svgIconOutline: w
|
|
117
117
|
} = this.$props, F = Array.from({
|
|
118
118
|
length: s - t + 1
|
|
119
|
-
}, (y,
|
|
119
|
+
}, (y, r) => t + r), M = E(m(s - t, this.base), a), h = this.computedValue, c = this.$data.currentHovered;
|
|
120
120
|
return d("span", {
|
|
121
|
-
id:
|
|
121
|
+
id: n,
|
|
122
122
|
ref: "ratingRef",
|
|
123
123
|
role: "slider",
|
|
124
124
|
dir: o,
|
|
@@ -147,12 +147,12 @@ const le = /* @__PURE__ */ j({
|
|
|
147
147
|
}, null), d("span", {
|
|
148
148
|
class: "k-rating-container"
|
|
149
149
|
}, [F.map(function(y) {
|
|
150
|
-
const
|
|
150
|
+
const r = m(y + M, this.base), k = x === "half" ? J(r, c !== null ? c : h !== null ? h : 0, a) : !1, L = v(r, h, a, f), D = v(r, c !== null ? c : h, a, f), O = v(r, c, a, f), T = X.call(this, g, _.call(this));
|
|
151
151
|
return d(q, {
|
|
152
|
-
key:
|
|
153
|
-
value:
|
|
152
|
+
key: r,
|
|
153
|
+
value: r,
|
|
154
154
|
dir: o,
|
|
155
|
-
title: String(k ? m(
|
|
155
|
+
title: String(k ? m(r - a / 2, this.base) : r),
|
|
156
156
|
icon: R,
|
|
157
157
|
svgIcon: H,
|
|
158
158
|
svgIconOutline: w,
|
|
@@ -160,22 +160,26 @@ const le = /* @__PURE__ */ j({
|
|
|
160
160
|
half: k,
|
|
161
161
|
selected: D,
|
|
162
162
|
hovered: O,
|
|
163
|
-
item:
|
|
163
|
+
item: g,
|
|
164
164
|
itemTemplate: T,
|
|
165
165
|
onClick: this.handleItemClick,
|
|
166
166
|
onMousemove: this.handleMouseMove,
|
|
167
167
|
onMouseleave: this.handleMouseLeave
|
|
168
168
|
}, null);
|
|
169
|
-
}, this)]),
|
|
169
|
+
}, this)]), l && d("span", {
|
|
170
170
|
class: "k-rating-label"
|
|
171
|
-
}, [
|
|
171
|
+
}, [l])]);
|
|
172
172
|
},
|
|
173
173
|
methods: {
|
|
174
174
|
handleFocus(e) {
|
|
175
|
-
this.$emit("focus",
|
|
175
|
+
this.$emit("focus", {
|
|
176
|
+
event: e
|
|
177
|
+
});
|
|
176
178
|
},
|
|
177
179
|
handleBlur(e) {
|
|
178
|
-
this.$emit("blur",
|
|
180
|
+
this.$emit("blur", {
|
|
181
|
+
event: e
|
|
182
|
+
});
|
|
179
183
|
},
|
|
180
184
|
handleChange(e, t) {
|
|
181
185
|
this.$emit("change", {
|
|
@@ -232,10 +236,10 @@ const le = /* @__PURE__ */ j({
|
|
|
232
236
|
} = e;
|
|
233
237
|
if (!(!a || !s || this.$props.readonly || this.$props.disabled)) {
|
|
234
238
|
if (this.$props.precision === "half") {
|
|
235
|
-
const
|
|
239
|
+
const n = a.getBoundingClientRect(), l = V(this.$props.dir ? this.$props.dir : "ltr", n, e.event.clientX) ? m(s - this.$props.step / 2, this.base) : s;
|
|
236
240
|
this.dispatchValue({
|
|
237
241
|
type: i.select,
|
|
238
|
-
payload:
|
|
242
|
+
payload: l,
|
|
239
243
|
event: t
|
|
240
244
|
});
|
|
241
245
|
} else
|
|
@@ -255,10 +259,10 @@ const le = /* @__PURE__ */ j({
|
|
|
255
259
|
} = e;
|
|
256
260
|
if (!(!a || !s))
|
|
257
261
|
if (this.$props.precision === "half") {
|
|
258
|
-
const
|
|
262
|
+
const n = a.getBoundingClientRect(), l = V(this.$props.dir ? this.$props.dir : "ltr", n, t.clientX) ? s - this.$props.step / 2 : s;
|
|
259
263
|
this.dispatchHover({
|
|
260
264
|
type: i.select,
|
|
261
|
-
payload:
|
|
265
|
+
payload: l,
|
|
262
266
|
event: t
|
|
263
267
|
});
|
|
264
268
|
} else
|
|
@@ -283,8 +287,8 @@ const le = /* @__PURE__ */ j({
|
|
|
283
287
|
}, s = t.state || this.$data.currentValue, a = S(s, {
|
|
284
288
|
...e,
|
|
285
289
|
...t
|
|
286
|
-
}),
|
|
287
|
-
this.handleChange(a,
|
|
290
|
+
}), n = e.event;
|
|
291
|
+
this.handleChange(a, n), this.$data.currentValue = a;
|
|
288
292
|
},
|
|
289
293
|
dispatchHover(e) {
|
|
290
294
|
const t = {
|
|
@@ -302,5 +306,5 @@ const le = /* @__PURE__ */ j({
|
|
|
302
306
|
}
|
|
303
307
|
});
|
|
304
308
|
export {
|
|
305
|
-
|
|
309
|
+
ne as Rating
|
|
306
310
|
};
|
package/rating/RatingItem.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 t=require("vue"),o=require("@progress/kendo-vue-common"),u=require("@progress/kendo-svg-icons"),I=t.defineComponent({name:"KendoVueRatingItem",emits:{click:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),o=require("@progress/kendo-vue-common"),u=require("@progress/kendo-svg-icons"),I=t.defineComponent({name:"KendoVueRatingItem",emits:{click:e=>!0,keydown:null,focus:null,blur:null,mouseenter:e=>!0,mouseleave:e=>!0,mousemove:e=>!0},props:{id:String,tabIndex:Number,half:Boolean,title:String,icon:Object,selected:Boolean,hovered:Boolean,onClick:Function,onKeyDown:Function,onFocus:Function,onBlur:Function,onMouseEnter:Function,svgIconOutline:Object,svgIcon:Object,haveSelectedValue:Boolean,item:String,itemTemplate:Object,dir:{type:String,default:"ltr",validator:function(e){return[null,"ltr","rtl"].includes(e)}},value:{type:Number,required:!0}},setup(){return{inputRef:t.ref(null)}},computed:{wrapperClass(){return o.classNames(`k-rating-item${this.$props.dir==="rtl"?" k-rtl":""}${this.$props.haveSelectedValue||this.$props.selected?" k-selected":""}${this.$props.hovered?" k-hover":""}`)}},render(){const{id:e,dir:r,half:s,tabIndex:h,title:d,icon:n,svgIcon:l,svgIconOutline:a,hovered:i,selected:c,haveSelectedValue:m,item:p,itemTemplate:v}=this.$props,g=o.getTemplate.call(this,{h:t.h,template:v,additionalProps:{dir:r,half:s,title:d,icon:n,svgIcon:l,svgIconOutline:a,hovered:i,selected:c,haveSelectedValue:m},additionalListeners:{onclick:this.handleClick,onkeydown:this.handleKeyDown,onfocus:this.handleFocus,onblur:this.handleBlur,onmouseenter:this.handleMouseEnter,onmouseleave:this.handleMouseLeave,onmousemove:this.handleMouseMove}});return t.createVNode("span",{id:e,dir:r,"data-half":s,tabindex:h,title:d,class:this.wrapperClass,onClick:this.handleClick,onKeydown:this.handleKeyDown,onFocus:this.handleFocus,onBlur:this.handleBlur,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onMousemove:this.handleMouseMove},[p?g:[s&&t.createVNode("span",{class:"k-rating-precision-complement"},[!(n||a)&&t.createVNode(o.Icon,{name:"star-outline",icon:u.starOutlineIcon,style:r==="rtl"?{clipPath:"inset(0 50% 0 0)"}:{clipPath:"inset(0 0 0 50%)"},size:"xlarge"},null),(n||a)&&t.createVNode(o.Icon,{name:o.getIconName(`${n}-outline`),icon:a,size:"xlarge"},null)]),s&&t.createVNode("span",{class:"k-rating-precision-part"},[!(n||l)&&t.createVNode(o.Icon,{name:"star",icon:u.starIcon,style:r==="rtl"?{clipPath:"inset(0 0 0 50%)"}:{clipPath:"inset(0 50% 0 0)"},size:"xlarge"},null),(n||l)&&t.createVNode(o.Icon,{name:n?o.getIconName(n):void 0,icon:l,size:"xlarge"},null)]),s&&t.createVNode("span",{style:{width:"24px",height:"24px",display:"block"}},null),!s&&(!(n||l)&&(i||c&&!i)&&t.createVNode(o.Icon,{name:"star",icon:u.starIcon,size:"xlarge"},null)||!(n||l)&&!i&&!c&&t.createVNode(o.Icon,{name:"star-outline",icon:u.starOutlineIcon,size:"xlarge"},null)||(n||l)&&(i||c&&!i)&&t.createVNode(o.Icon,{name:n,icon:l,size:"xlarge"},null)||(n||l)&&!i&&t.createVNode(o.Icon,{name:o.getIconName(`${n}-outline`),icon:a,size:"xlarge"},null))]])},methods:{handleClick(e){this.$emit("click",{value:this.$props.value,target:this.$el,event:e})},handleMouseLeave(e){this.$emit("mouseleave",{target:this.$el,event:e})},handleMouseMove(e){this.$emit("mousemove",{value:this.$props.value,target:this.$el,event:e})},handleMouseEnter(e){this.$emit("mouseenter",{target:this.$el,event:e})},handleKeyDown(e){this.$emit("keydown",e)},handleFocus(e){this.$emit("focus",e)},handleBlur(e){this.$emit("blur",e)}}});exports.RatingItem=I;
|
package/rating/RatingItem.mjs
CHANGED
|
@@ -11,13 +11,13 @@ import { starOutlineIcon as d, starIcon as m } from "@progress/kendo-svg-icons";
|
|
|
11
11
|
const B = /* @__PURE__ */ f({
|
|
12
12
|
name: "KendoVueRatingItem",
|
|
13
13
|
emits: {
|
|
14
|
-
click:
|
|
14
|
+
click: (e) => !0,
|
|
15
15
|
keydown: null,
|
|
16
16
|
focus: null,
|
|
17
17
|
blur: null,
|
|
18
|
-
mouseenter:
|
|
19
|
-
mouseleave:
|
|
20
|
-
mousemove:
|
|
18
|
+
mouseenter: (e) => !0,
|
|
19
|
+
mouseleave: (e) => !0,
|
|
20
|
+
mousemove: (e) => !0
|
|
21
21
|
},
|
|
22
22
|
props: {
|
|
23
23
|
id: String,
|
package/signature/Signature.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 s=require("vue"),p=require("@progress/kendo-vue-buttons"),i=require("@progress/kendo-vue-common"),c=require("./SignatureDialog.js"),m=require("./SignatureBottomActions.js"),g=require("./SignatureLine.js"),f=require("@progress/kendo-vue-intl"),a=require("../messages/main.js"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("vue"),p=require("@progress/kendo-vue-buttons"),i=require("@progress/kendo-vue-common"),c=require("./SignatureDialog.js"),m=require("./SignatureBottomActions.js"),g=require("./SignatureLine.js"),f=require("@progress/kendo-vue-intl"),a=require("../messages/main.js"),v=require("../package-metadata.js"),C=require("./SignatureCanvas.js"),S=require("./utils/main.js"),y=require("@progress/kendo-svg-icons"),$=250,k=84,b=3,z=2,O="#000000",V="#ffffff",B=s.defineComponent({name:"KendoSignature",model:{event:"changemodel"},emits:{change:e=>!0,focus:e=>!0,blur:e=>!0,open:e=>!0,close:e=>!0,changemodel:e=>!0,"update:modelValue":e=>!0},inject:{kendoLocalizationService:{default:null}},props:{strokeWidth:{type:Number,default:1},smooth:Boolean,popupScale:{type:Number,default:b},exportScale:{type:Number,default:z},modelValue:String,name:String,value:String,tabIndex:Number,dir:String,ariaDescribedBy:String,ariaLabelledBy:String,ariaLabel:String,hideLine:Boolean,open:{type:Boolean,default:void 0},readOnly:Boolean,disabled:Boolean,validationMessage:String,maximizable:{type:Boolean,default:!0},color:String,backgroundColor:String,validityStyles:{type:Boolean,default:!0},required:{type:Boolean,default:!1},valid:{type:Boolean,default:void 0},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)}}},created(){i.validatePackage(v.packageMetadata)},computed:{wrapperClass(){return{...this.openWrapperClass,"k-signature-maximized":!1}},openWrapperClass(){const e=!this.validityStyles||this.validityGetter().valid;return{"k-input":!0,"k-signature":!0,"k-signature-maximized":!0,[`k-signature-${i.kendoThemeMaps.sizeMap[this.$props.size]||this.$props.size}`]:this.$props.size,[`k-input-${this.$props.fillMode}`]:this.$props.fillMode,[`k-rounded-${i.kendoThemeMaps.roundedMap[this.$props.rounded]||this.$props.rounded}`]:this.$props.rounded,"k-invalid":!e,"k-required":this.$props.required,"k-disabled":this.$props.disabled,"k-focus":this.focused}},computedValue(){return this.value!==void 0?this.value:this.$props.modelValue!==void 0?this.$props.modelValue:this.currentValue},computedOpen(){return this.open!==void 0?this.open:this.currentOpen},computedColor(){let e=O;return!this.$props.color&&typeof document!="undefined"&&this.$el&&(e=getComputedStyle(this.$el).color),this.$props.color||e},computedBgColor(){let e=V;return!this.$props.backgroundColor&&typeof document!="undefined"&&this.$el&&(e=getComputedStyle(this.$el).backgroundColor),this.$props.backgroundColor||e}},watch:{computedValue(e){e!==this.currentValue&&this.loadImage(e)},computedOpen(){this.loadImage(this.computedValue)}},data(){return{focused:!1,isDrawing:!1,currentValue:void 0,popupValue:void 0,currentOpen:!1}},mounted(){this.setRefs()},updated(){this.setRefs()},setup(){return{inputRef:s.ref(null)}},render(){const e=f.provideLocalizationService(this),t=!(this.computedOpen||this.isDrawing||!this.$props.maximizable||this.$props.disabled),n=!(!this.computedValue||this.isDrawing||this.$props.readOnly||this.$props.disabled),r=e.toLanguageString(a.signatureMaximize,a.messages[a.signatureMaximize]),l=e.toLanguageString(a.signatureClear,a.messages[a.signatureClear]),u=s.createVNode("div",{class:"k-signature-actions k-signature-actions-top"},[t&&s.createVNode(p.Button,{class:"k-signature-action k-signature-maximize",ref:i.setRef(this,"maximizeButton"),icon:"hyperlink-open",svgIcon:y.hyperlinkOpenIcon,shape:null,fillMode:"flat",size:this.$props.size,onClick:this.onMaximizeClick,"aria-label":r,title:r},null)]),d=!this.$props.hideLine&&s.createVNode(g.SignatureLine,null,null),h=s.createVNode(m.SignatureBottomActions,{showClear:n,size:this.size,onClear:this.onClear,title:l},null);return s.createVNode("div",{dir:this.$props.dir,class:this.wrapperClass,onFocus:this.onFocus,onBlur:this.onBlur},[s.createVNode(C.SignatureCanvas,{ref:i.setRef(this,"canvas"),name:this.name,value:this.computedValue,tabIndex:this.tabIndex,disabled:this.disabled,readOnly:this.readOnly,color:this.computedColor,backgroundColor:this.computedBgColor,strokeWidth:this.strokeWidth,smooth:this.smooth,popupScale:1,scale:this.exportScale,onChange:this.onValueChange,elementSize:this.elementSize,onDraw:this.onDraw,onDrawend:this.onDrawEnd},null),u,d,h,this.computedOpen&&s.createVNode(c.SignatureDialog,{ref:i.setRef(this,"dialog"),openWrapperClass:this.openWrapperClass,popupWidth:this.popupWidth,popupHeight:this.popupHeight,showClear:n,onClose:this.onMinimizeClick,onClear:this.onClear,onOverlayclick:this.onOverlayClick,onFocus:this.onFocus,onBlur:this.onBlur,value:this.computedValue,tabIndex:this.tabIndex,disabled:this.disabled,readOnly:this.readOnly,color:this.computedColor,backgroundColor:this.computedBgColor,strokeWidth:this.strokeWidth,smooth:this.smooth,popupScale:this.$props.popupScale,scale:1/this.popupScale*this.exportScale,onChange:this.onValueChange,elementSize:this.elementSize,onDraw:this.onDraw,onDrawend:this.onDrawEnd},null)])},methods:{setRefs(){this.canvas=i.getRef(this,"canvas"),this.minimizeButton=i.getRef(this,"minimizeButton"),this.maximizeButton=i.getRef(this,"maximizeButton"),this.dialog=i.getRef(this,"dialog"),this.popupWidth=this.popupSize().width,this.popupHeight=this.popupSize().height},onOverlayClick(){this.currentOpen=!1},onValueChange(e){this.currentValue=e,this.$emit("changemodel",e),this.$emit("update:modelValue",e),this.$emit("change",{value:e})},onDialogChange(e){this.onValueChange(e.value)},reset(){this.clear(),this.onValueChange()},clear(){this.canvas&&this.canvas.clear(),this.dialog&&this.dialog.openCanvas&&this.dialog.openCanvas.clear()},loadImage(e){this.canvas&&this.canvas.loadImage(e),this.dialog&&this.dialog.openCanvas&&this.dialog.openCanvas.loadImage(e)},onDialogClose(e){var t;this.onMinimizeClick(e),(t=this.maximizeButton||this.canvas.$el)==null||t.focus()},exportImage(e){var n;const{width:t,height:o}=e;return(n=this.canvas.instance)==null?void 0:n.exportImage({width:t*this.exportScale,height:o*this.exportScale})},validityGetter(){const e=this.$props.validationMessage!==void 0,o=!this.computedValue,n=this.$props.valid!==void 0?this.$props.valid:!this.required||!o;return{customError:e,valid:n,valueMissing:o}},focusElement(){this.canvas.$el.focus()},getImperativeHandle(){const e={element:this.$el,focus:this.focusElement()};return Object.defineProperty(e,"name",{get:()=>this.name}),Object.defineProperty(e,"value",{get:()=>this.computedValue}),Object.defineProperty(e,"validity",{get:()=>this.validityGetter()}),Object.defineProperty(e,"validityStyles",{get:()=>this.validityStyles}),Object.defineProperty(e,"required",{get:()=>this.required}),Object.defineProperty(e,"color",{get:()=>this.computedColor}),Object.defineProperty(e,"backgroundColor",{get:()=>this.computedBgColor}),e},onFocus(e){this.focused||this.computedOpen||(this.focused(!0),this.$emit("focus",{event:e,...this.getImperativeHandle()}))},onBlur(e){S.hasParent(e.relatedTarget,this.$el)||(this.focused=!1,this.$emit("blur",{event:e,...this.getImperativeHandle()}))},onMaximizeClick:async function(t){this.exportImage(this.popupSize()).then(o=>{this.currentValue=o}),this.currentOpen=!0,this.$emit("open",{event:t,...this.getImperativeHandle()})},onMinimizeClick(e){this.currentOpen=!1,this.$emit("close",{event:e,...this.getImperativeHandle()})},onClear(){this.reset(),this.focusElement()},elementSize(){const e=this.$props.width||this.$el&&this.$el.offsetWidth||$,t=this.$props.height||this.$el&&this.$el.offsetHeight||k;return{width:e,height:t}},popupSize(){const{width:e,height:t}=this.elementSize();return{width:e*this.popupScale,height:t*this.popupScale}},onDraw(){this.isDrawing=!0},onDrawEnd(){this.isDrawing=!1}}});exports.Signature=B;
|
package/signature/Signature.mjs
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { defineComponent as f, createVNode as s, ref as
|
|
9
|
-
import { Button as
|
|
8
|
+
import { defineComponent as f, createVNode as s, ref as v } from "vue";
|
|
9
|
+
import { Button as C } from "@progress/kendo-vue-buttons";
|
|
10
10
|
import { getRef as n, setRef as a, kendoThemeMaps as l, validatePackage as S } from "@progress/kendo-vue-common";
|
|
11
11
|
import { SignatureDialog as $ } from "./SignatureDialog.mjs";
|
|
12
12
|
import { SignatureBottomActions as y } from "./SignatureBottomActions.mjs";
|
|
@@ -23,13 +23,13 @@ const D = 250, x = 84, V = 3, I = 2, L = "#000000", E = "#ffffff", N = /* @__PUR
|
|
|
23
23
|
event: "changemodel"
|
|
24
24
|
},
|
|
25
25
|
emits: {
|
|
26
|
-
change:
|
|
27
|
-
focus:
|
|
28
|
-
blur:
|
|
29
|
-
open:
|
|
30
|
-
close:
|
|
31
|
-
changemodel:
|
|
32
|
-
"update:modelValue":
|
|
26
|
+
change: (e) => !0,
|
|
27
|
+
focus: (e) => !0,
|
|
28
|
+
blur: (e) => !0,
|
|
29
|
+
open: (e) => !0,
|
|
30
|
+
close: (e) => !0,
|
|
31
|
+
changemodel: (e) => !0,
|
|
32
|
+
"update:modelValue": (e) => !0
|
|
33
33
|
},
|
|
34
34
|
inject: {
|
|
35
35
|
kendoLocalizationService: {
|
|
@@ -171,13 +171,13 @@ const D = 250, x = 84, V = 3, I = 2, L = "#000000", E = "#ffffff", N = /* @__PUR
|
|
|
171
171
|
},
|
|
172
172
|
setup() {
|
|
173
173
|
return {
|
|
174
|
-
inputRef:
|
|
174
|
+
inputRef: v(null)
|
|
175
175
|
};
|
|
176
176
|
},
|
|
177
177
|
render() {
|
|
178
178
|
const e = b(this), t = !(this.computedOpen || this.isDrawing || !this.$props.maximizable || this.$props.disabled), o = !(!this.computedValue || this.isDrawing || this.$props.readOnly || this.$props.disabled), r = e.toLanguageString(u, p[u]), d = e.toLanguageString(h, p[h]), c = s("div", {
|
|
179
179
|
class: "k-signature-actions k-signature-actions-top"
|
|
180
|
-
}, [t && s(
|
|
180
|
+
}, [t && s(C, {
|
|
181
181
|
class: "k-signature-action k-signature-maximize",
|
|
182
182
|
ref: a(this, "maximizeButton"),
|
|
183
183
|
icon: "hyperlink-open",
|
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"),c=require("@progress/kendo-vue-buttons"),s=require("@progress/kendo-vue-common"),p=require("@progress/kendo-vue-intl"),a=require("../messages/main.js"),g=require("./SliderLabel.js"),m=require("../package-metadata.js"),n=require("@progress/kendo-svg-icons"),f=r.defineComponent({name:"KendoSlider",model:{event:"changemodel"},emits:{changemodel:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),c=require("@progress/kendo-vue-buttons"),s=require("@progress/kendo-vue-common"),p=require("@progress/kendo-vue-intl"),a=require("../messages/main.js"),g=require("./SliderLabel.js"),m=require("../package-metadata.js"),n=require("@progress/kendo-svg-icons"),f=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:o}=this.$props;return e===void 0?e:Math.min(Math.max(e,t),o)},sliderTrack(){return this._sliderTrack}},created(){s.validatePackage(m.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=p.provideLocalizationService(this),t=(this.computedValue-this.$props.min)/(this.$props.max-this.$props.min)*100,o=s.getDefaultSlots(this),{vertical:i}=this.$props,l=this.currentDir==="rtl"?i?n.caretAltUpIcon:n.caretAltLeftIcon:i?n.caretAltUpIcon:n.caretAltRightIcon,u=this.currentDir==="rtl"?i?n.caretAltDownIcon:n.caretAltRightIcon:i?n.caretAltDownIcon:n.caretAltLeftIcon,d=this.currentDir==="rtl"?i?"caret-alt-up":"caret-alt-left":i?"caret-alt-up":"caret-alt-right",h=this.currentDir==="rtl"?i?"caret-alt-down":"caret-alt-right":i?"caret-alt-down":"caret-alt-left";return 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:s.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(c.Button,{type:"button",tabIndex:-1,icon:h,svgIcon:u,style:{position:"relative"},rounded:"full",class:"k-button-decrease",title:e.toLanguageString(a.sliderDecreaseValue,a.messages[a.sliderDecreaseValue]),onClick:this.decrement},null),r.createVNode(s.Draggable,{onDrag:this.dragOver,onPress:this.dragStart,ref:"draggable"},{default:()=>[r.createVNode("div",{class:"k-slider-track-wrap",style:{touchAction:"none"}},[o&&r.createVNode("ul",{class:"k-reset k-slider-items"},[o]),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(a.sliderDragTitle,a.messages[a.sliderDragTitle]),style:this.$props.vertical?{bottom:t+"%",zIndex:1}:{[this.currentDir==="rtl"?"right":"left"]:t+"%",zIndex:1}},null)])])]}),this.$props.buttons&&r.createVNode(c.Button,{type:"button",tabIndex:-1,icon:d,svgIcon:l,rounded:"full",style:{position:"relative"},class:"k-button-increase",title:e.toLanguageString(a.sliderIncreaseValue,a.messages[a.sliderIncreaseValue]),onClick:this.increment},null)])},methods:{focus(){this.$el&&this.$el.focus()},isLabel(e){let t=e;for(;t;){if(t.getAttribute(g.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===s.Keys.left||e.keyCode===s.Keys.down?t=this.currentValue-(this.$props.step||0):e.keyCode===s.Keys.right||e.keyCode===s.Keys.up?t=this.currentValue+(this.$props.step||0):e.keyCode===s.Keys.home?t=this.$props.min:e.keyCode===s.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(),o=this.$props.vertical?t.bottom-e.clientY:this.currentDir==="rtl"?t.right-e.clientX:e.clientX-t.left,i=this.$props.vertical?t.height:t.width,l=o/i;this.change(e,this.$props.min+l*(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=f;
|
package/slider/Slider.mjs
CHANGED
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import { defineComponent as b, createVNode as i, ref as k, inject as V } from "vue";
|
|
9
|
-
import { Button as
|
|
9
|
+
import { Button as l } from "@progress/kendo-vue-buttons";
|
|
10
10
|
import { Keys as a, getDefaultSlots as y, classNames as D, Draggable as S, validatePackage as w } from "@progress/kendo-vue-common";
|
|
11
11
|
import { provideLocalizationService as x } from "@progress/kendo-vue-intl";
|
|
12
|
-
import { sliderDecreaseValue as u, messages as
|
|
12
|
+
import { sliderDecreaseValue as u, messages as o, sliderDragTitle as d, sliderIncreaseValue as c } from "../messages/main.mjs";
|
|
13
13
|
import { SLIDER_LABEL_ATTRIBUTE as L } from "./SliderLabel.mjs";
|
|
14
14
|
import { packageMetadata as I } from "../package-metadata.mjs";
|
|
15
15
|
import { caretAltUpIcon as p, caretAltLeftIcon as h, caretAltRightIcon as m, caretAltDownIcon as g } from "@progress/kendo-svg-icons";
|
|
@@ -19,11 +19,11 @@ const M = /* @__PURE__ */ b({
|
|
|
19
19
|
event: "changemodel"
|
|
20
20
|
},
|
|
21
21
|
emits: {
|
|
22
|
-
changemodel:
|
|
23
|
-
"update:modelValue":
|
|
24
|
-
change:
|
|
25
|
-
blur:
|
|
26
|
-
focus:
|
|
22
|
+
changemodel: (e) => !0,
|
|
23
|
+
"update:modelValue": (e) => !0,
|
|
24
|
+
change: (e) => !0,
|
|
25
|
+
blur: (e) => !0,
|
|
26
|
+
focus: (e) => !0
|
|
27
27
|
},
|
|
28
28
|
props: {
|
|
29
29
|
modelValue: {
|
|
@@ -123,7 +123,7 @@ const M = /* @__PURE__ */ b({
|
|
|
123
123
|
"k-slider-horizontal": !this.$props.vertical,
|
|
124
124
|
"k-slider-vertical": this.$props.vertical
|
|
125
125
|
}, this.$props.className)
|
|
126
|
-
}, [this.$props.buttons && i(
|
|
126
|
+
}, [this.$props.buttons && i(l, {
|
|
127
127
|
type: "button",
|
|
128
128
|
tabIndex: -1,
|
|
129
129
|
icon: v,
|
|
@@ -133,7 +133,7 @@ const M = /* @__PURE__ */ b({
|
|
|
133
133
|
},
|
|
134
134
|
rounded: "full",
|
|
135
135
|
class: "k-button-decrease",
|
|
136
|
-
title: e.toLanguageString(u,
|
|
136
|
+
title: e.toLanguageString(u, o[u]),
|
|
137
137
|
onClick: this.decrement
|
|
138
138
|
}, null), i(S, {
|
|
139
139
|
onDrag: this.dragOver,
|
|
@@ -166,7 +166,7 @@ const M = /* @__PURE__ */ b({
|
|
|
166
166
|
"aria-valuemax": this.$props.max,
|
|
167
167
|
"aria-valuetext": this.computedValue.toString(),
|
|
168
168
|
"aria-disabled": this.$props.disabled ? "true" : void 0,
|
|
169
|
-
title: e.toLanguageString(d,
|
|
169
|
+
title: e.toLanguageString(d, o[d]),
|
|
170
170
|
style: this.$props.vertical ? {
|
|
171
171
|
bottom: t + "%",
|
|
172
172
|
zIndex: 1
|
|
@@ -175,7 +175,7 @@ const M = /* @__PURE__ */ b({
|
|
|
175
175
|
zIndex: 1
|
|
176
176
|
}
|
|
177
177
|
}, null)])])]
|
|
178
|
-
}), this.$props.buttons && i(
|
|
178
|
+
}), this.$props.buttons && i(l, {
|
|
179
179
|
type: "button",
|
|
180
180
|
tabIndex: -1,
|
|
181
181
|
icon: $,
|
|
@@ -185,7 +185,7 @@ const M = /* @__PURE__ */ b({
|
|
|
185
185
|
position: "relative"
|
|
186
186
|
},
|
|
187
187
|
class: "k-button-increase",
|
|
188
|
-
title: e.toLanguageString(c,
|
|
188
|
+
title: e.toLanguageString(c, o[c]),
|
|
189
189
|
onClick: this.increment
|
|
190
190
|
}, null)]);
|
|
191
191
|
},
|
|
@@ -203,10 +203,14 @@ const M = /* @__PURE__ */ b({
|
|
|
203
203
|
return !1;
|
|
204
204
|
},
|
|
205
205
|
onFocus(e) {
|
|
206
|
-
this.currentFocused = !0, this.$emit("focus",
|
|
206
|
+
this.currentFocused = !0, this.$emit("focus", {
|
|
207
|
+
event: e
|
|
208
|
+
});
|
|
207
209
|
},
|
|
208
210
|
onBlur(e) {
|
|
209
|
-
this.currentFocused = !1, this.$emit("blur",
|
|
211
|
+
this.currentFocused = !1, this.$emit("blur", {
|
|
212
|
+
event: e
|
|
213
|
+
});
|
|
210
214
|
},
|
|
211
215
|
onKeyDown(e) {
|
|
212
216
|
let t;
|
package/switch/Switch.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 s=require("vue"),t=require("@progress/kendo-vue-common"),u=require("@progress/kendo-vue-intl"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("vue"),t=require("@progress/kendo-vue-common"),u=require("@progress/kendo-vue-intl"),r=require("../messages/main.js"),o=require("../package-metadata.js"),h=s.defineComponent({name:"KendoSwitch",model:{event:"changemodel"},emits:{change:e=>!0,changemodel:e=>!0,"update:modelValue":e=>!0,focus:e=>!0,blur:e=>!0},props:{name:String,accessKey:String,checked:{type:Boolean,default:void 0},className:String,disabled:{type:Boolean,default:!1},defaultChecked:{type:Boolean,default:!1},size:{type:String,default:"medium",validator:function(e){return[null,"small","medium","large"].includes(e)}},trackRounded:{type:String,default:"full",validator:function(e){return[null,"small","medium","large","full"].includes(e)}},thumbRounded:{type:String,default:"full",validator:function(e){return[null,"small","medium","large","full"].includes(e)}},dir:String,id:String,ariaLabelledBy:String,ariaDescribedBy:String,offLabel:{type:String,default:"OFF"},onLabel:{type:String,default:"ON"},required:{type:Boolean,default:!1},tabIndex:Number,valid:Boolean,validityStyles:{type:Boolean,default:!1},validationMessage:String,value:{type:[String,Number,Boolean],default:void 0},modelValue:{type:Boolean,default:void 0}},created(){t.validatePackage(o.packageMetadata),this._id=t.guid(),this.defaultValidationMessage=u.provideLocalizationService(this)},data(){return{currentChecked:this.$props.defaultChecked,valueDuringOnChange:void 0,focused:!1,currentDir:void 0}},computed:{computedValue(){return this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.$props.checked!==void 0?this.$props.checked:this.$props.value!==void 0?this.$props.value:this.$props.modelValue!==void 0?this.$props.modelValue:this.currentChecked},switchClassName(){const e=!this.validityStyles||this.validity().valid,i=this.$props.trackRounded;return{"k-switch":!0,[`k-switch-${t.kendoThemeMaps.sizeMap[this.$props.size]}`]:this.$props.size,[`k-rounded-${t.kendoThemeMaps.roundedMap[i]||i}`]:i,"k-switch-on":this.computedValue,"k-switch-off":!this.computedValue,"k-focus":this.focused,"k-disabled":this.$props.disabled,"k-invalid":!e}},switchTrackClass(){const e=this.$props.trackRounded;return{"k-switch-track":!0,[`k-rounded-${t.kendoThemeMaps.roundedMap[e]||e}`]:e}},switchThumbClass(){const e=this.$props.thumbRounded;return{"k-switch-thumb":!0,[`k-rounded-${t.kendoThemeMaps.roundedMap[e]||e}`]:e}}},mounted(){this._element=t.getRef(this,"element"),this.input=t.getRef(this,"input"),this.currentDir=this.$props.dir!==void 0?this.$props.dir:t.isRtl(this.$el)?"rtl":"ltr",this.setValidity()},updated(){this.setValidity()},render(){const{disabled:e,id:i,offLabel:a,onLabel:d,tabIndex:n,required:l}=this.$props;return s.createVNode("span",{class:this.switchClassName,role:"switch","aria-labelledby":this.$props.ariaLabelledBy,"aria-describedby":this.$props.ariaDescribedBy,"aria-checked":this.computedValue,"aria-disabled":e||void 0,dir:this.currentDir,onKeydown:this.handleKeyDown,onClick:this.handleClick,onFocusout:this.handleWrapperBlur,onFocusin:this.handleWrapperFocus,tabindex:t.getTabIndex(n,e,void 0),accesskey:this.$props.accessKey},[s.createVNode("span",{class:this.switchTrackClass,ref:t.setRef(this,"element")},[s.createVNode("input",{type:"checkbox",id:i||this._id,checked:this.$props.checked,ref:t.setRef(this,"input"),tabindex:-1,name:this.$props.name,required:l!==void 0?l:!1,"aria-hidden":!0,value:this.computedValue,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"},onChange:t.noop},null),s.createVNode("span",{class:"k-switch-label-on"},[d]),s.createVNode("span",{class:"k-switch-label-off"},[a])]),s.createVNode("span",{class:"k-switch-thumb-wrap"},[s.createVNode("span",{class:this.switchThumbClass},null)])])},methods:{focus(){this._element&&this._element.focus()},element(){return this._element},validity(){const e=this.$props.validationMessage!==void 0,i=this.$props.valid!==void 0?this.$props.valid:this.$props.required?!!this.computedValue:!0,a=this.$props.valid!==void 0?this.$props.valid:i;return{customError:e,valid:a,valueMissing:this.computedValue===null}},setValidity(){this.input&&this.input.setCustomValidity&&this.input.setCustomValidity(this.validity().valid?"":this.$props.validationMessage||this.defaultValidationMessage.toLanguageString(r.switchValidation,r.messages[r.switchValidation]))},limit(e,i,a){const d=a.offsetWidth,n=i.offsetWidth;return e<0?0:e>d-n?d-n:e},toggle(e,i){this.currentChecked=e,this.valueDuringOnChange=e,this.$emit("changemodel",e),this.$emit("update:modelValue",e),this.$emit("change",{event:i,component:this,target:{value:e},name:this.$props.name,value:e,validity:this.validity()}),this.valueDuringOnChange=void 0},handleClick(e){this.eventTimeStamp!==e.timeStamp&&(this.eventTimeStamp=e.timeStamp,this.toggle(!this.computedValue,e))},handleKeyDown(e){if(this.$props.disabled)return;const{keyCode:i}=e;(i===t.Keys.space||i===t.Keys.enter)&&this.toggle(!this.computedValue,e)},handleWrapperFocus(e){this.$props.disabled||(this.focused=!0,this.$emit("focus",{event:e}))},handleWrapperBlur(e){this.$props.disabled||(this.focused=!1,this.$emit("blur",{event:e}))}}});exports.Switch=h;
|