@progress/kendo-vue-inputs 6.0.2-develop.1 → 6.1.0-develop.2
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/README.md +1 -1
- package/checkbox/Checkbox.js +1 -1
- package/checkbox/Checkbox.mjs +1 -1
- package/colors/ColorContrastLabels.js +1 -1
- package/colors/ColorContrastLabels.mjs +1 -1
- package/colors/ColorContrastSvg.js +1 -1
- package/colors/ColorContrastSvg.mjs +1 -1
- package/colors/ColorGradient.js +1 -1
- package/colors/ColorGradient.mjs +1 -1
- package/colors/ColorInput.js +1 -1
- package/colors/ColorInput.mjs +1 -1
- package/colors/ColorPalette.js +1 -1
- package/colors/ColorPalette.mjs +1 -1
- package/colors/ColorPicker.js +1 -1
- package/colors/ColorPicker.mjs +1 -1
- package/colors/FlatColorPicker.js +1 -1
- package/colors/FlatColorPicker.mjs +1 -1
- package/colors/HexInput.js +1 -1
- package/colors/HexInput.mjs +1 -1
- package/colors/Picker.js +1 -1
- package/colors/Picker.mjs +1 -1
- package/colors/models/palette-presets.js +1 -1
- package/colors/models/palette-presets.mjs +1 -1
- package/colors/utils/color-cache.js +1 -1
- package/colors/utils/color-cache.mjs +1 -1
- package/colors/utils/color-palette.service.js +1 -1
- package/colors/utils/color-palette.service.mjs +1 -1
- package/colors/utils/color-parser.js +1 -1
- package/colors/utils/color-parser.mjs +1 -1
- package/colors/utils/misc.js +1 -1
- package/colors/utils/misc.mjs +1 -1
- package/colors/utils/svg-calc.js +1 -1
- package/colors/utils/svg-calc.mjs +1 -1
- package/dist/cdn/js/kendo-vue-inputs.js +2 -2
- package/index.d.mts +111 -81
- package/index.d.ts +111 -81
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/input/Input.js +1 -1
- package/input/Input.mjs +1 -1
- package/input-separator/InputSeparator.js +1 -1
- package/input-separator/InputSeparator.mjs +1 -1
- package/maskedtextbox/MaskedTextBox.js +2 -2
- package/maskedtextbox/MaskedTextBox.mjs +44 -41
- package/maskedtextbox/masking.service.js +1 -1
- package/maskedtextbox/masking.service.mjs +1 -1
- package/maskedtextbox/parsing/combinators.js +1 -1
- package/maskedtextbox/parsing/combinators.mjs +1 -1
- package/maskedtextbox/parsing/parsers.js +1 -1
- package/maskedtextbox/parsing/parsers.mjs +1 -1
- package/maskedtextbox/parsing/result.js +1 -1
- package/maskedtextbox/parsing/result.mjs +1 -1
- package/maskedtextbox/parsing/stream.js +1 -1
- package/maskedtextbox/parsing/stream.mjs +1 -1
- package/maskedtextbox/utils.js +1 -1
- package/maskedtextbox/utils.mjs +1 -1
- package/messages/main.js +1 -1
- package/messages/main.mjs +1 -1
- package/numerictextbox/NumericTextBox.js +2 -2
- package/numerictextbox/NumericTextBox.mjs +70 -68
- package/numerictextbox/utils/main.js +1 -1
- package/numerictextbox/utils/main.mjs +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +8 -8
- package/radiobutton/RadioButton.js +1 -1
- package/radiobutton/RadioButton.mjs +1 -1
- package/radiobutton/RadioGroup.js +1 -1
- package/radiobutton/RadioGroup.mjs +1 -1
- package/range-slider/RangeSlider.js +1 -1
- package/range-slider/RangeSlider.mjs +1 -1
- package/range-slider/range-raducer.js +1 -1
- package/range-slider/range-raducer.mjs +1 -1
- package/rating/Rating.js +1 -1
- package/rating/Rating.mjs +1 -1
- package/rating/RatingItem.js +1 -1
- package/rating/RatingItem.mjs +1 -1
- package/rating/utils/main.js +1 -1
- package/rating/utils/main.mjs +1 -1
- package/rating/utils/rating-reducer.js +1 -1
- package/rating/utils/rating-reducer.mjs +1 -1
- package/signature/Signature.js +1 -1
- package/signature/Signature.mjs +1 -1
- package/signature/SignatureBottomActions.js +1 -1
- package/signature/SignatureBottomActions.mjs +1 -1
- package/signature/SignatureCanvas.js +1 -1
- package/signature/SignatureCanvas.mjs +1 -1
- package/signature/SignatureDialog.js +1 -1
- package/signature/SignatureDialog.mjs +1 -1
- package/signature/SignatureLine.js +1 -1
- package/signature/SignatureLine.mjs +1 -1
- package/signature/utils/main.js +1 -1
- package/signature/utils/main.mjs +1 -1
- package/slider/Slider.js +1 -1
- package/slider/Slider.mjs +1 -1
- package/slider/SliderLabel.js +1 -1
- package/slider/SliderLabel.mjs +1 -1
- package/switch/Switch.js +1 -1
- package/switch/Switch.mjs +1 -1
- package/textarea/TextArea.js +2 -2
- package/textarea/TextArea.mjs +32 -29
- package/textarea/interfaces/TextAreaResize.js +1 -1
- package/textarea/interfaces/TextAreaResize.mjs +1 -1
- package/textbox/TextBox.js +2 -2
- package/textbox/TextBox.mjs +25 -22
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
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 { MaskingService as
|
|
10
|
-
import { defaultRules as h, maskingChanged as
|
|
11
|
-
import { templateDefinition as m, validatePackage as
|
|
12
|
-
import { packageMetadata as
|
|
13
|
-
import { checkIcon as
|
|
14
|
-
const
|
|
8
|
+
import { defineComponent as b, ref as C, h as c, createVNode as n, mergeProps as w } from "vue";
|
|
9
|
+
import { MaskingService as x } from "./masking.service.mjs";
|
|
10
|
+
import { defaultRules as h, maskingChanged as P, returnFalse as f } from "./utils.mjs";
|
|
11
|
+
import { templateDefinition as m, validatePackage as I, guid as B, kendoThemeMaps as g, templateRendering as v, getListeners as $, getTemplate as S, Icon as u, getTabIndex as M, setRef as O } from "@progress/kendo-vue-common";
|
|
12
|
+
import { packageMetadata as L } from "../package-metadata.mjs";
|
|
13
|
+
import { checkIcon as R, exclamationCircleIcon as F, xIcon as D } from "@progress/kendo-svg-icons";
|
|
14
|
+
const z = /* @__PURE__ */ b({
|
|
15
15
|
model: {
|
|
16
16
|
event: "changemodel"
|
|
17
17
|
},
|
|
@@ -102,7 +102,8 @@ const N = /* @__PURE__ */ y({
|
|
|
102
102
|
showLoadingIcon: Boolean,
|
|
103
103
|
showClearButton: Boolean,
|
|
104
104
|
inputClass: String,
|
|
105
|
-
wrapperClass: String
|
|
105
|
+
wrapperClass: String,
|
|
106
|
+
inputAttributes: Object
|
|
106
107
|
},
|
|
107
108
|
data() {
|
|
108
109
|
return {
|
|
@@ -113,11 +114,11 @@ const N = /* @__PURE__ */ y({
|
|
|
113
114
|
};
|
|
114
115
|
},
|
|
115
116
|
created() {
|
|
116
|
-
|
|
117
|
+
I(L), this.hasMounted = !1, this.valueDuringOnChange = void 0, this.inputId = `k-${B()}`, this.service = new x(), this.isPasted = !1;
|
|
117
118
|
},
|
|
118
119
|
setup() {
|
|
119
120
|
return {
|
|
120
|
-
inputRef:
|
|
121
|
+
inputRef: C(null)
|
|
121
122
|
};
|
|
122
123
|
},
|
|
123
124
|
mounted() {
|
|
@@ -159,7 +160,7 @@ const N = /* @__PURE__ */ y({
|
|
|
159
160
|
promptPlaceholder: this.prevPromptPlaceholder,
|
|
160
161
|
rules: this.prevRules
|
|
161
162
|
};
|
|
162
|
-
|
|
163
|
+
P(e, this.$props) && this.updateService(), this.setValidity();
|
|
163
164
|
},
|
|
164
165
|
computed: {
|
|
165
166
|
computedRules() {
|
|
@@ -238,14 +239,14 @@ const N = /* @__PURE__ */ y({
|
|
|
238
239
|
this.isPasted = !1, this.currentSelection = [null, null], this.triggerOnChange(i, e);
|
|
239
240
|
return;
|
|
240
241
|
}
|
|
241
|
-
const
|
|
242
|
+
const o = this.computedValue();
|
|
242
243
|
let l;
|
|
243
244
|
if (this.isPasted) {
|
|
244
245
|
this.isPasted = !1;
|
|
245
|
-
const
|
|
246
|
-
l = this.service.maskInRange(i.slice(s, p),
|
|
246
|
+
const r = o.length - a, p = i.length - r;
|
|
247
|
+
l = this.service.maskInRange(i.slice(s, p), o, s, a);
|
|
247
248
|
} else
|
|
248
|
-
l = this.service.maskInput(i,
|
|
249
|
+
l = this.service.maskInput(i, o, t.selectionStart || 0);
|
|
249
250
|
this.currentSelection = [l.selection, l.selection], this.triggerOnChange(l.value, e), this.inputValue = void 0;
|
|
250
251
|
},
|
|
251
252
|
focusHandler(e) {
|
|
@@ -294,22 +295,23 @@ const N = /* @__PURE__ */ y({
|
|
|
294
295
|
iconName: t,
|
|
295
296
|
showValidationIcon: i,
|
|
296
297
|
showLoadingIcon: s,
|
|
297
|
-
showClearButton: a
|
|
298
|
-
|
|
298
|
+
showClearButton: a,
|
|
299
|
+
inputAttributes: o
|
|
300
|
+
} = this.$props, l = !this.$props.validityStyles || this.validity().valid, r = this.computedValue();
|
|
299
301
|
this.inputValue;
|
|
300
|
-
const
|
|
302
|
+
const p = v.call(this, this.$props.inputPrefix, $.call(this)), k = v.call(this, this.$props.inputSuffix, $.call(this)), V = S.call(this, {
|
|
301
303
|
h: c,
|
|
302
|
-
template:
|
|
304
|
+
template: p,
|
|
303
305
|
additionalProps: {
|
|
304
|
-
value:
|
|
305
|
-
valid:
|
|
306
|
+
value: r,
|
|
307
|
+
valid: l
|
|
306
308
|
}
|
|
307
|
-
}),
|
|
309
|
+
}), y = S.call(this, {
|
|
308
310
|
h: c,
|
|
309
|
-
template:
|
|
311
|
+
template: k,
|
|
310
312
|
additionalProps: {
|
|
311
|
-
value:
|
|
312
|
-
valid:
|
|
313
|
+
value: r,
|
|
314
|
+
valid: l
|
|
313
315
|
}
|
|
314
316
|
}), d = n("span", {
|
|
315
317
|
dir: this.$props.dir,
|
|
@@ -317,25 +319,25 @@ const N = /* @__PURE__ */ y({
|
|
|
317
319
|
style: this.$props.label ? void 0 : {
|
|
318
320
|
width: this.$props.width
|
|
319
321
|
}
|
|
320
|
-
}, [t && n(
|
|
322
|
+
}, [t && n(u, {
|
|
321
323
|
name: t,
|
|
322
324
|
class: "k-input-icon"
|
|
323
325
|
}, null), this.$props.inputPrefix && n("span", {
|
|
324
326
|
class: "k-input-prefix"
|
|
325
|
-
}, [
|
|
327
|
+
}, [V]), n("input", w({
|
|
326
328
|
type: this.$props.type,
|
|
327
329
|
autocomplete: "off",
|
|
328
330
|
autocorrect: "off",
|
|
329
331
|
autocapitalize: "off",
|
|
330
332
|
spellcheck: !1,
|
|
331
333
|
class: this.inputInnerClass,
|
|
332
|
-
value:
|
|
334
|
+
value: r,
|
|
333
335
|
id: e,
|
|
334
336
|
"aria-labelledby": this.$props.ariaLabelledBy,
|
|
335
337
|
"aria-describedby": this.$props.ariaDescribedBy,
|
|
336
338
|
"aria-disabled": this.$props.disabled,
|
|
337
339
|
name: this.$props.name,
|
|
338
|
-
tabindex:
|
|
340
|
+
tabindex: M(this.$props.tabIndex, this.$props.disabled, !0),
|
|
339
341
|
accesskey: this.$props.accessKey,
|
|
340
342
|
title: this.$props.title,
|
|
341
343
|
disabled: this.$props.disabled || void 0,
|
|
@@ -343,32 +345,33 @@ const N = /* @__PURE__ */ y({
|
|
|
343
345
|
placeholder: this.$props.placeholder,
|
|
344
346
|
"aria-placeholder": this.$props.placeholder,
|
|
345
347
|
required: this.$props.required,
|
|
346
|
-
ref:
|
|
348
|
+
ref: O(this, "input")
|
|
349
|
+
}, o, {
|
|
347
350
|
onInput: this.onChangeHandler,
|
|
348
351
|
onPaste: this.pasteHandler,
|
|
349
352
|
onFocus: this.focusHandler,
|
|
350
353
|
onBlur: this.blurHandler,
|
|
351
354
|
onDragstart: f,
|
|
352
355
|
onDrop: f
|
|
353
|
-
}, null), this.$props.inputSuffix && n("span", {
|
|
356
|
+
}), null), this.$props.inputSuffix && n("span", {
|
|
354
357
|
class: "k-input-suffix"
|
|
355
|
-
}, [
|
|
358
|
+
}, [y]), i && l && n(u, {
|
|
356
359
|
name: "check",
|
|
357
|
-
icon:
|
|
360
|
+
icon: R,
|
|
358
361
|
class: "k-input-validation-icon"
|
|
359
|
-
}, null), i && !
|
|
362
|
+
}, null), i && !l && n(u, {
|
|
360
363
|
name: "exclamation-circle",
|
|
361
|
-
icon:
|
|
364
|
+
icon: F,
|
|
362
365
|
class: "k-input-validation-icon"
|
|
363
|
-
}, null), s && n(
|
|
366
|
+
}, null), s && n(u, {
|
|
364
367
|
name: "loading",
|
|
365
368
|
class: "k-input-loading-icon"
|
|
366
|
-
}, null), a &&
|
|
369
|
+
}, null), a && r && n("span", {
|
|
367
370
|
onClick: this.clearClick,
|
|
368
371
|
class: "k-clear-value"
|
|
369
|
-
}, [n(
|
|
372
|
+
}, [n(u, {
|
|
370
373
|
name: "x",
|
|
371
|
-
icon:
|
|
374
|
+
icon: D
|
|
372
375
|
}, null)])]);
|
|
373
376
|
return this.$props.label ? n("span", {
|
|
374
377
|
class: this.spanClassNames,
|
|
@@ -382,5 +385,5 @@ const N = /* @__PURE__ */ y({
|
|
|
382
385
|
}
|
|
383
386
|
});
|
|
384
387
|
export {
|
|
385
|
-
|
|
388
|
+
z as MaskedTextBox
|
|
386
389
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
package/maskedtextbox/utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
package/maskedtextbox/utils.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
package/messages/main.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
package/messages/main.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),s=require("@progress/kendo-vue-common"),m=require("@progress/kendo-vue-intl"),f=require("@progress/kendo-vue-buttons"),r=require("../messages/main.js"),i=require("./utils/main.js"),S=require("../package-metadata.js"),p=require("@progress/kendo-svg-icons"),b="Please enter a valid value!",k=a.defineComponent({model:{event:"changemodel"},emits:{change:null,changemodel:null,"update:modelValue":null,focus:null,blur:null},props:{modelValue:Number,value:Number,defaultValue:Number,step:{type:Number,default:1},format:[String,Object],tabIndex:Number,accessKey:String,title:String,placeholder:String,min:Number,max:Number,spinners:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},dir:String,name:String,label:String,validationMessage:String,validityStyles:{type:Boolean,default:!0},valid:{type:Boolean,default:void 0},size:{type:String,default:"medium",validator:function(t){return[null,"small","medium","large"].includes(t)}},rounded:{type:String,default:"medium",validator:function(t){return[null,"small","medium","large","full"].includes(t)}},fillMode:{type:String,default:"solid",validator:function(t){return[null,"solid","flat","outline"].includes(t)}},required:{type:Boolean,default:!1},id:String,ariaLabel:String,iconName:String,inputPrefix:[String,Function],inputSuffix:[String,Function],showValidationIcon:Boolean,showLoadingIcon:Boolean,showClearButton:Boolean,inputClass:String,inputType:{type:String,default:"tel"},wrapperClass:String},inject:{kendoIntlService:{default:null},kendoLocalizationService:{default:null}},data(){return{hasMounted:!1,isInvalid:!1,isEmpty:!1,currentValue:0,valueDuringOnChange:0,currentLooseValue:"",selectionStart:0,selectionEnd:0,decimalSelect:!1,focused:!1,forceUpdate:!1}},created(){s.validatePackage(S.packageMetadata),this._textBeforeInput="",this._inputId=s.guid(),this.$data.currentLooseValue=null,this.$data.valueDuringOnChange=void 0,this._intl=m.provideIntlService(this),this._symbols=this._intl.numberSymbols(),this.$props.value!==void 0?this.$data.currentValue=this.$props.value:this.$props.modelValue!==void 0?this.$data.currentValue=this.$props.modelValue:this.$props.defaultValue!==void 0?this.$data.currentValue=this.$props.defaultValue:this.$data.currentValue=null},mounted(){this._input=s.getRef(this,"input"),this._elementWrapper=this.elementWrapperRef,this.$data.hasMounted=!0,this._input&&(this._textBeforeInput=this._input.value),this.setValidity()},updated(){!(s.canUseDOM&&document.activeElement!==this._input||!this._input)&&this.$data.currentLooseValue!==null&&this.$data.forceUpdate&&this._input.type!=="number"&&(this._input.selectionStart=this.$data.selectionStart,this._input.selectionEnd=this.$data.selectionEnd,this.$data.forceUpdate=!1),this._input&&(this._textBeforeInput=this._input.value),this.setValidity()},computed:{computedValue(){return this.$data.valueDuringOnChange!==void 0?this.$data.valueDuringOnChange:this.$data.currentValue},looseValue(){return i.formatValue(this.$data.focused?this.$data.currentLooseValue:i.getStateOrPropsValue(this.$props.value,this.$data.currentValue),this.$props.format,this._intl)},spanClassNames(){const t=!this.$data.hasMounted||!this.$props.validityStyles||this.validity().valid,e=this.computedValue;return{"k-floating-label-container":!0,"k-focus":this.$data.focused,"k-empty":!(e===0||e||this.$props.placeholder),"k-invalid":!t&&t!==void 0,"k-rtl":this.$props.dir==="rtl",[this.inputClass]:this.inputClass}},wrapperClassNames(){const{size:t,fillMode:e,rounded:n,required:l,disabled:u}=this.$props,o=!this.$props.validityStyles||this.validity().valid;return{"k-input":!0,"k-numerictextbox":!0,[`k-input-${s.kendoThemeMaps.sizeMap[t]||t}`]:t,[`k-input-${e}`]:e,[`k-rounded-${s.kendoThemeMaps.roundedMap[n]||n}`]:n,"k-invalid":!o,"k-required":l,"k-disabled":u,"k-loading":this.showLoadingIcon,[this.wrapperClass]:this.wrapperClass}},inputInnerClass(){return{"k-input-inner":!0,[this.inputClass]:this.inputClass}}},methods:{validity(){const t=this.$props.validationMessage!==void 0,e=!this.$data.valueIsOutOfRange&&(!this.$props.required||this.computedValue!==null),n=this.$props.valid!==void 0?this.$props.valid:e;return{customError:t,valid:n,valueMissing:this.computedValue===null}},clearClick(t){this.$props.value!==void 0?this.$data.currentValue=this.$props.value:this.$props.modelValue!==void 0?this.$data.currentValue=this.$props.modelValue:this.$data.currentValue=null,this.$emit("changemodel",null),this.$emit("update:modelValue",null),this.$emit("change",{event:t,value:null,component:this,target:{name:this.$props.name,value:null},validity:this.validity()})},focus(){this._input&&this._input.focus()},emitFocus(t){this.$data.currentLooseValue=this._prevLooseValue,this.$data.focused=!0,this.$emit("focus",t),this.$data.forceUpdate=!0},emitBlur(t){this.$data.eventValue=null,this.$data.prevLooseValue="",this.$data.currentLooseValue="",this.$data.focused=!1,this.$data.selectionStart=void 0,this.$data.selectionEnd=void 0,this.$data.decimalSelect=!1,this.$data.valueIsCorrected=!1,this.$data.valueIsOutOfRange=!1,this.$emit("blur",t),this.$data.forceUpdate=!0},handleFocus(t){this.$data.focused=!0},handleBlur(t){this.$data.focused=!1},setValidity(){this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity().valid?"":this.$props.validationMessage||b)},getCurrentState(){return{eventValue:i.getStateOrPropsValue(this.$props.value,this.$data.currentValue),prevLooseValue:this._prevLooseValue,currentLooseValue:this._input.value,selectionStart:this._input.selectionStart,selectionEnd:this._input.selectionEnd,decimalSelect:!1,valueIsCorrected:!1,valueIsOutOfRange:!1,isPaste:this._isPaste,focused:this.$data.focused}},parseNumber(t){return this._intl.parseNumber(t,this.$props.format)},elementChange(t){const e=this.getCurrentState();this._isPaste=!1,this.triggerChange(t,i.sanitizeNumber(e,this.$props.format,this._intl))},triggerChange(t,e){if(this.$props.disabled)return;this.$data.valueDuringOnChange=e.eventValue,this.$data.currentValue=e.eventValue;const n=i.formatValue(i.rangeValue(e.eventValue,this.$props.min,this.$props.max),this.$props.format,this._intl),l=i.rangeValue(this.parseNumber(n),this.$props.min,this.$props.max);if(l!==e.eventValue&&(e.valueIsOutOfRange=!0,e.eventValue=l,this.$data.valueDuringOnChange=l,this.$data.currentValue=l),e.valueIsCorrected){const o=this._elementWrapper;o&&o.className.indexOf("k-invalid")===-1&&(this.$data.isInvalid=!0,setTimeout(()=>{this.$data.isInvalid=!1},50))}const u=this.$props.value!==e.eventValue;this.$props.value!==void 0?this.$data.currentValue=this.$props.value:this.$props.modelValue!==void 0?this.$data.currentValue=this.$props.modelValue:this.$data.currentValue=this.$data.valueDuringOnChange,this.$data.prevLooseValue=e.prevLooseValue,this.$data.currentLooseValue=void 0,this.$data.currentLooseValue=e.currentLooseValue,this.$data.selectionStart=e.selectionStart,this.$data.selectionEnd=e.selectionEnd,this.$data.decimalSelect=e.decimalSelect,this.$data.valueIsCorrected=e.valueIsCorrected,this.$data.valueIsOutOfRange=e.valueIsOutOfRange,this.$data.focused=e.focused,this.$data.isPaste=e.isPaste,this.$data.forceUpdate=!this.$data.forceUpdate,u&&(this.$emit("changemodel",this.$data.valueDuringOnChange),this.$emit("update:modelValue",this.$data.valueDuringOnChange),this.$emit("change",{event:t,value:this.$data.valueDuringOnChange,component:this,target:{name:this.$props.name,value:this.$data.valueDuringOnChange},validity:this.validity()})),this.$data.valueDuringOnChange=void 0},onPasteHandler(t){this._isPaste=!0},increase(t){const e=this.getCurrentState();i.increaseValue(this.parseNumber(String(e.currentLooseValue)),e,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl),this.triggerChange(t,e)},decrease(t){const e=this.getCurrentState();i.decreaseValue(this.parseNumber(String(e.currentLooseValue)),e,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl),this.triggerChange(t,e)},wheel(t){!s.canUseDOM||document.activeElement!==this._input||!this._input||(t.deltaY<0&&(t.preventDefault(),this.increase(t)),t.deltaY>0&&(t.preventDefault(),this.decrease(t)))},keyDown(t){let e=this.getCurrentState(),n,l,u,o;const d=this.parseNumber(String(e.currentLooseValue));if(!(e.selectionEnd>e.selectionStart&&e.selectionEnd-e.selectionStart===String(e.currentLooseValue).length)){switch(t.keyCode){case 38:i.increaseValue(d,e,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl);break;case 40:i.decreaseValue(d,e,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl);break;case 13:n=i.formatValue(i.rangeValue(d,this.$props.min,this.$props.max),this.$props.format,this._intl),l=i.rangeValue(this.parseNumber(n),this.$props.min,this.$props.max),e.eventValue=l,e.currentLooseValue=i.formatValue(l,this.$props.format,this._intl),e.selectionStart=e.selectionEnd=e.currentLooseValue.length;break;case 110:u=this._input,o=this._intl.numberSymbols(),u&&(e.currentLooseValue=e.currentLooseValue.slice(0,e.selectionStart)+o.decimal+e.currentLooseValue.slice(e.selectionEnd),e.selectionStart=e.selectionEnd=e.selectionStart+1,e=i.sanitizeNumber(e,this.$props.format,this._intl));break;default:return}t.preventDefault(),this.triggerChange(t,e)}},spinnersWrapperMouseDown(t){s.canUseDOM&&this._input&&(t.preventDefault(),document.activeElement!==this._input&&this._input.focus())}},setup(){const t=a.ref(null),e=a.ref(null),n=a.inject("kendoLocalizationService",{}),l=a.inject("kendoIntlService",{});return{inputRef:t,elementWrapperRef:e,kendoLocalizationService:n,kendoIntlService:l}},render(){const{iconName:t,showValidationIcon:e,showLoadingIcon:n,showClearButton:l}=this.$props,u=this.$props.id||this._inputId,o=s.getDefaultSlots(this),d=m.provideLocalizationService(this),c=this.validity().valid;this.$props.value!==void 0&&this.$props.value!==this.$data.currentValue?this.$data.currentValue=this.$props.value:this.$props.modelValue!==void 0&&this.$props.modelValue!==this.$data.currentValue&&(this.$data.currentValue=this.$props.modelValue),this._prevLooseValue=this.$data.currentLooseValue?this.looseValue:this.looseValue;const $=s.templateRendering.call(this,this.$props.inputPrefix,s.getListeners.call(this)),V=s.templateRendering.call(this,this.$props.inputSuffix,s.getListeners.call(this)),g=s.getTemplate.call(this,{h:a.h,template:$,additionalProps:{value:this.computedValue,valid:c}}),v=s.getTemplate.call(this,{h:a.h,template:V,additionalProps:{value:this.computedValue,valid:c}}),h=a.createVNode("span",{dir:this.$props.dir,class:this.wrapperClassNames,style:this.$attrs.style},[t&&a.createVNode(s.Icon,{name:t,class:"k-input-icon"},null),this.$props.inputPrefix&&a.createVNode("span",{class:"k-input-prefix"},[g]),a.createVNode("input",{tabindex:this.$props.tabIndex,accesskey:this.$props.accessKey,disabled:this.$props.disabled,title:this.$props.title,"aria-label":this.$props.ariaLabel,"aria-valuemin":this.$props.min,"aria-valuemax":this.$props.max,"aria-disabled":this.$props.disabled?"true":void 0,placeholder:this.$props.placeholder,type:this.$props.inputType,spellcheck:!1,autocomplete:"off",autocorrect:"off",class:this.inputInnerClass,id:u,role:"spinbutton",value:this.looseValue,name:this.$props.name,onWheel:this.wheel,onKeydown:this.keyDown,onInput:this.elementChange,onFocus:this.emitFocus,onBlur:this.emitBlur,onPaste:this.onPasteHandler,ref:s.setRef(this,"input")},null),this.$props.inputSuffix&&a.createVNode("span",{class:"k-input-suffix"},[v]),e&&c&&a.createVNode(s.Icon,{name:"check",icon:p.checkIcon,class:"k-input-validation-icon"},null),e&&!c&&a.createVNode(s.Icon,{name:"exclamation-circle",icon:p.exclamationCircleIcon,class:"k-input-validation-icon"},null),n&&a.createVNode(s.Icon,{name:"loading",class:"k-input-loading-icon"},null),l&&this.computedValue!==void 0&&this.computedValue!==null&&a.createVNode("span",{onClick:this.clearClick,class:"k-clear-value"},[a.createVNode(s.Icon,{name:"x",icon:p.xIcon},null)]),o,this.$props.spinners&&a.createVNode("span",{class:"k-input-spinner k-spin-button",onMousedown:this.spinnersWrapperMouseDown},[a.createVNode(f.Button,{type:"button",tabIndex:-1,icon:"caret-alt-up",svgIcon:p.caretAltUpIcon,class:"k-spinner-increase",rounded:null,"aria-label":d.toLanguageString(r.numericIncreaseValue,r.messages[r.numericIncreaseValue]),title:d.toLanguageString(r.numericIncreaseValue,r.messages[r.numericIncreaseValue]),onClick:this.increase},null),a.createVNode(f.Button,{type:"button",tabIndex:-1,class:"k-spinner-decrease",icon:"caret-alt-down",svgIcon:p.caretAltDownIcon,rounded:null,"aria-label":d.toLanguageString(r.numericDecreaseValue,r.messages[r.numericDecreaseValue]),title:d.toLanguageString(r.numericDecreaseValue,r.messages[r.numericDecreaseValue]),onClick:this.decrease},null)])]);return this.$props.label?a.createVNode("span",{class:this.spanClassNames,onFocusin:this.handleFocus,onFocusout:this.handleBlur,dir:this.$props.dir},[h,this.$props.label?u?a.createVNode("label",{for:u,class:"k-floating-label"},[this.$props.label]):a.createVNode("span",{class:"k-label"},[this.$props.label]):null]):h}});exports.NumericTextBox=k;
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),s=require("@progress/kendo-vue-common"),f=require("@progress/kendo-vue-intl"),$=require("@progress/kendo-vue-buttons"),r=require("../messages/main.js"),i=require("./utils/main.js"),S=require("../package-metadata.js"),p=require("@progress/kendo-svg-icons"),k="Please enter a valid value!",C=a.defineComponent({model:{event:"changemodel"},emits:{change:null,changemodel:null,"update:modelValue":null,focus:null,blur:null},props:{modelValue:Number,value:Number,defaultValue:Number,step:{type:Number,default:1},format:[String,Object],tabIndex:Number,accessKey:String,title:String,placeholder:String,min:Number,max:Number,spinners:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},dir:String,name:String,label:String,validationMessage:String,validityStyles:{type:Boolean,default:!0},valid:{type:Boolean,default:void 0},size:{type:String,default:"medium",validator:function(t){return[null,"small","medium","large"].includes(t)}},rounded:{type:String,default:"medium",validator:function(t){return[null,"small","medium","large","full"].includes(t)}},fillMode:{type:String,default:"solid",validator:function(t){return[null,"solid","flat","outline"].includes(t)}},required:{type:Boolean,default:!1},id:String,ariaLabel:String,iconName:String,inputPrefix:[String,Function],inputSuffix:[String,Function],showValidationIcon:Boolean,showLoadingIcon:Boolean,showClearButton:Boolean,inputClass:String,inputType:{type:String,default:"tel"},wrapperClass:String,inputAttributes:Object},inject:{kendoIntlService:{default:null},kendoLocalizationService:{default:null}},data(){return{hasMounted:!1,isInvalid:!1,isEmpty:!1,currentValue:0,valueDuringOnChange:0,currentLooseValue:"",selectionStart:0,selectionEnd:0,decimalSelect:!1,focused:!1,forceUpdate:!1}},created(){s.validatePackage(S.packageMetadata),this._textBeforeInput="",this._inputId=s.guid(),this.$data.currentLooseValue=null,this.$data.valueDuringOnChange=void 0,this._intl=f.provideIntlService(this),this._symbols=this._intl.numberSymbols(),this.$props.value!==void 0?this.$data.currentValue=this.$props.value:this.$props.modelValue!==void 0?this.$data.currentValue=this.$props.modelValue:this.$props.defaultValue!==void 0?this.$data.currentValue=this.$props.defaultValue:this.$data.currentValue=null},mounted(){this._input=s.getRef(this,"input"),this._elementWrapper=this.elementWrapperRef,this.$data.hasMounted=!0,this._input&&(this._textBeforeInput=this._input.value),this.setValidity()},updated(){!(s.canUseDOM&&document.activeElement!==this._input||!this._input)&&this.$data.currentLooseValue!==null&&this.$data.forceUpdate&&this._input.type!=="number"&&(this._input.selectionStart=this.$data.selectionStart,this._input.selectionEnd=this.$data.selectionEnd,this.$data.forceUpdate=!1),this._input&&(this._textBeforeInput=this._input.value),this.setValidity()},computed:{computedValue(){return this.$data.valueDuringOnChange!==void 0?this.$data.valueDuringOnChange:this.$data.currentValue},looseValue(){return i.formatValue(this.$data.focused?this.$data.currentLooseValue:i.getStateOrPropsValue(this.$props.value,this.$data.currentValue),this.$props.format,this._intl)},spanClassNames(){const t=!this.$data.hasMounted||!this.$props.validityStyles||this.validity().valid,e=this.computedValue;return{"k-floating-label-container":!0,"k-focus":this.$data.focused,"k-empty":!(e===0||e||this.$props.placeholder),"k-invalid":!t&&t!==void 0,"k-rtl":this.$props.dir==="rtl",[this.inputClass]:this.inputClass}},wrapperClassNames(){const{size:t,fillMode:e,rounded:n,required:l,disabled:o}=this.$props,u=!this.$props.validityStyles||this.validity().valid;return{"k-input":!0,"k-numerictextbox":!0,[`k-input-${s.kendoThemeMaps.sizeMap[t]||t}`]:t,[`k-input-${e}`]:e,[`k-rounded-${s.kendoThemeMaps.roundedMap[n]||n}`]:n,"k-invalid":!u,"k-required":l,"k-disabled":o,"k-loading":this.showLoadingIcon,[this.wrapperClass]:this.wrapperClass}},inputInnerClass(){return{"k-input-inner":!0,[this.inputClass]:this.inputClass}}},methods:{validity(){const t=this.$props.validationMessage!==void 0,e=!this.$data.valueIsOutOfRange&&(!this.$props.required||this.computedValue!==null),n=this.$props.valid!==void 0?this.$props.valid:e;return{customError:t,valid:n,valueMissing:this.computedValue===null}},clearClick(t){this.$props.value!==void 0?this.$data.currentValue=this.$props.value:this.$props.modelValue!==void 0?this.$data.currentValue=this.$props.modelValue:this.$data.currentValue=null,this.$emit("changemodel",null),this.$emit("update:modelValue",null),this.$emit("change",{event:t,value:null,component:this,target:{name:this.$props.name,value:null},validity:this.validity()})},focus(){this._input&&this._input.focus()},emitFocus(t){this.$data.currentLooseValue=this._prevLooseValue,this.$data.focused=!0,this.$emit("focus",t),this.$data.forceUpdate=!0},emitBlur(t){this.$data.eventValue=null,this.$data.prevLooseValue="",this.$data.currentLooseValue="",this.$data.focused=!1,this.$data.selectionStart=void 0,this.$data.selectionEnd=void 0,this.$data.decimalSelect=!1,this.$data.valueIsCorrected=!1,this.$data.valueIsOutOfRange=!1,this.$emit("blur",t),this.$data.forceUpdate=!0},handleFocus(t){this.$data.focused=!0},handleBlur(t){this.$data.focused=!1},setValidity(){this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity().valid?"":this.$props.validationMessage||k)},getCurrentState(){return{eventValue:i.getStateOrPropsValue(this.$props.value,this.$data.currentValue),prevLooseValue:this._prevLooseValue,currentLooseValue:this._input.value,selectionStart:this._input.selectionStart,selectionEnd:this._input.selectionEnd,decimalSelect:!1,valueIsCorrected:!1,valueIsOutOfRange:!1,isPaste:this._isPaste,focused:this.$data.focused}},parseNumber(t){return this._intl.parseNumber(t,this.$props.format)},elementChange(t){const e=this.getCurrentState();this._isPaste=!1,this.triggerChange(t,i.sanitizeNumber(e,this.$props.format,this._intl))},triggerChange(t,e){if(this.$props.disabled)return;this.$data.valueDuringOnChange=e.eventValue,this.$data.currentValue=e.eventValue;const n=i.formatValue(i.rangeValue(e.eventValue,this.$props.min,this.$props.max),this.$props.format,this._intl),l=i.rangeValue(this.parseNumber(n),this.$props.min,this.$props.max);if(l!==e.eventValue&&(e.valueIsOutOfRange=!0,e.eventValue=l,this.$data.valueDuringOnChange=l,this.$data.currentValue=l),e.valueIsCorrected){const u=this._elementWrapper;u&&u.className.indexOf("k-invalid")===-1&&(this.$data.isInvalid=!0,setTimeout(()=>{this.$data.isInvalid=!1},50))}const o=this.$props.value!==e.eventValue;this.$props.value!==void 0?this.$data.currentValue=this.$props.value:this.$props.modelValue!==void 0?this.$data.currentValue=this.$props.modelValue:this.$data.currentValue=this.$data.valueDuringOnChange,this.$data.prevLooseValue=e.prevLooseValue,this.$data.currentLooseValue=void 0,this.$data.currentLooseValue=e.currentLooseValue,this.$data.selectionStart=e.selectionStart,this.$data.selectionEnd=e.selectionEnd,this.$data.decimalSelect=e.decimalSelect,this.$data.valueIsCorrected=e.valueIsCorrected,this.$data.valueIsOutOfRange=e.valueIsOutOfRange,this.$data.focused=e.focused,this.$data.isPaste=e.isPaste,this.$data.forceUpdate=!this.$data.forceUpdate,o&&(this.$emit("changemodel",this.$data.valueDuringOnChange),this.$emit("update:modelValue",this.$data.valueDuringOnChange),this.$emit("change",{event:t,value:this.$data.valueDuringOnChange,component:this,target:{name:this.$props.name,value:this.$data.valueDuringOnChange},validity:this.validity()})),this.$data.valueDuringOnChange=void 0},onPasteHandler(t){this._isPaste=!0},increase(t){const e=this.getCurrentState();i.increaseValue(this.parseNumber(String(e.currentLooseValue)),e,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl),this.triggerChange(t,e)},decrease(t){const e=this.getCurrentState();i.decreaseValue(this.parseNumber(String(e.currentLooseValue)),e,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl),this.triggerChange(t,e)},wheel(t){!s.canUseDOM||document.activeElement!==this._input||!this._input||(t.deltaY<0&&(t.preventDefault(),this.increase(t)),t.deltaY>0&&(t.preventDefault(),this.decrease(t)))},keyDown(t){let e=this.getCurrentState(),n,l,o,u;const d=this.parseNumber(String(e.currentLooseValue));if(!(e.selectionEnd>e.selectionStart&&e.selectionEnd-e.selectionStart===String(e.currentLooseValue).length)){switch(t.keyCode){case 38:i.increaseValue(d,e,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl);break;case 40:i.decreaseValue(d,e,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl);break;case 13:n=i.formatValue(i.rangeValue(d,this.$props.min,this.$props.max),this.$props.format,this._intl),l=i.rangeValue(this.parseNumber(n),this.$props.min,this.$props.max),e.eventValue=l,e.currentLooseValue=i.formatValue(l,this.$props.format,this._intl),e.selectionStart=e.selectionEnd=e.currentLooseValue.length;break;case 110:o=this._input,u=this._intl.numberSymbols(),o&&(e.currentLooseValue=e.currentLooseValue.slice(0,e.selectionStart)+u.decimal+e.currentLooseValue.slice(e.selectionEnd),e.selectionStart=e.selectionEnd=e.selectionStart+1,e=i.sanitizeNumber(e,this.$props.format,this._intl));break;default:return}t.preventDefault(),this.triggerChange(t,e)}},spinnersWrapperMouseDown(t){s.canUseDOM&&this._input&&(t.preventDefault(),document.activeElement!==this._input&&this._input.focus())}},setup(){const t=a.ref(null),e=a.ref(null),n=a.inject("kendoLocalizationService",{}),l=a.inject("kendoIntlService",{});return{inputRef:t,elementWrapperRef:e,kendoLocalizationService:n,kendoIntlService:l}},render(){const{iconName:t,showValidationIcon:e,showLoadingIcon:n,showClearButton:l,inputAttributes:o}=this.$props,u=this.$props.id||this._inputId,d=s.getDefaultSlots(this),c=f.provideLocalizationService(this),h=this.validity().valid;this.$props.value!==void 0&&this.$props.value!==this.$data.currentValue?this.$data.currentValue=this.$props.value:this.$props.modelValue!==void 0&&this.$props.modelValue!==this.$data.currentValue&&(this.$data.currentValue=this.$props.modelValue),this._prevLooseValue=this.$data.currentLooseValue?this.looseValue:this.looseValue;const V=s.templateRendering.call(this,this.$props.inputPrefix,s.getListeners.call(this)),g=s.templateRendering.call(this,this.$props.inputSuffix,s.getListeners.call(this)),v=s.getTemplate.call(this,{h:a.h,template:V,additionalProps:{value:this.computedValue,valid:h}}),b=s.getTemplate.call(this,{h:a.h,template:g,additionalProps:{value:this.computedValue,valid:h}}),m=a.createVNode("span",{dir:this.$props.dir,class:this.wrapperClassNames,style:this.$attrs.style},[t&&a.createVNode(s.Icon,{name:t,class:"k-input-icon"},null),this.$props.inputPrefix&&a.createVNode("span",{class:"k-input-prefix"},[v]),a.createVNode("input",a.mergeProps({tabindex:this.$props.tabIndex,accesskey:this.$props.accessKey,disabled:this.$props.disabled,title:this.$props.title,"aria-label":this.$props.ariaLabel,"aria-valuemin":this.$props.min,"aria-valuemax":this.$props.max,"aria-disabled":this.$props.disabled?"true":void 0,placeholder:this.$props.placeholder,type:this.$props.inputType,spellcheck:!1,autocomplete:"off",autocorrect:"off",class:this.inputInnerClass,id:u,role:"spinbutton",value:this.looseValue,name:this.$props.name,onWheel:this.wheel,onKeydown:this.keyDown,onInput:this.elementChange,onFocus:this.emitFocus,onBlur:this.emitBlur,onPaste:this.onPasteHandler,ref:s.setRef(this,"input")},o),null),this.$props.inputSuffix&&a.createVNode("span",{class:"k-input-suffix"},[b]),e&&h&&a.createVNode(s.Icon,{name:"check",icon:p.checkIcon,class:"k-input-validation-icon"},null),e&&!h&&a.createVNode(s.Icon,{name:"exclamation-circle",icon:p.exclamationCircleIcon,class:"k-input-validation-icon"},null),n&&a.createVNode(s.Icon,{name:"loading",class:"k-input-loading-icon"},null),l&&this.computedValue!==void 0&&this.computedValue!==null&&a.createVNode("span",{onClick:this.clearClick,class:"k-clear-value"},[a.createVNode(s.Icon,{name:"x",icon:p.xIcon},null)]),d,this.$props.spinners&&a.createVNode("span",{class:"k-input-spinner k-spin-button",onMousedown:this.spinnersWrapperMouseDown},[a.createVNode($.Button,{type:"button",tabIndex:-1,icon:"caret-alt-up",svgIcon:p.caretAltUpIcon,class:"k-spinner-increase",rounded:null,"aria-label":c.toLanguageString(r.numericIncreaseValue,r.messages[r.numericIncreaseValue]),title:c.toLanguageString(r.numericIncreaseValue,r.messages[r.numericIncreaseValue]),onClick:this.increase},null),a.createVNode($.Button,{type:"button",tabIndex:-1,class:"k-spinner-decrease",icon:"caret-alt-down",svgIcon:p.caretAltDownIcon,rounded:null,"aria-label":c.toLanguageString(r.numericDecreaseValue,r.messages[r.numericDecreaseValue]),title:c.toLanguageString(r.numericDecreaseValue,r.messages[r.numericDecreaseValue]),onClick:this.decrease},null)])]);return this.$props.label?a.createVNode("span",{class:this.spanClassNames,onFocusin:this.handleFocus,onFocusout:this.handleBlur,dir:this.$props.dir},[m,this.$props.label?u?a.createVNode("label",{for:u,class:"k-floating-label"},[this.$props.label]):a.createVNode("span",{class:"k-label"},[this.$props.label]):null]):m}});exports.NumericTextBox=C;
|