@progress/kendo-vue-inputs 8.4.0-develop.2 → 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/numerictextbox/NumericTextBox.js +1 -1
- package/numerictextbox/NumericTextBox.mjs +14 -14
- 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/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
|
};
|