@progress/kendo-vue-inputs 3.5.0 → 3.5.1-dev.202208150613
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/dist/cdn/js/kendo-vue-inputs.js +1 -1
- package/dist/es/checkbox/Checkbox.js +1 -1
- package/dist/es/checkbox/interfaces/CheckboxChangeEvent.js +1 -0
- package/dist/es/checkbox/interfaces/CheckboxFocusEvent.js +1 -0
- package/dist/es/checkbox/interfaces/CheckboxProps.js +1 -0
- package/dist/es/colors/ColorContrastLabels.js +3 -3
- package/dist/es/colors/ColorContrastSvg.js +2 -2
- package/dist/es/colors/ColorGradient.js +7 -7
- package/dist/es/colors/ColorPalette.js +1 -1
- package/dist/es/colors/ColorPicker.js +4 -4
- package/dist/es/colors/interfaces/ColorGradientChangeEvent.js +1 -0
- package/dist/es/colors/interfaces/ColorGradientProps.js +1 -0
- package/dist/es/colors/interfaces/ColorPaletteChangeEvent.js +1 -0
- package/dist/es/colors/interfaces/ColorPaletteProps.js +1 -0
- package/dist/es/colors/interfaces/ColorPickerActiveColorClick.js +1 -0
- package/dist/es/colors/interfaces/ColorPickerBlurEvent.js +1 -0
- package/dist/es/colors/interfaces/ColorPickerChangeEvent.js +1 -0
- package/dist/es/colors/interfaces/ColorPickerFocusEvent.js +1 -0
- package/dist/es/colors/interfaces/ColorPickerPaletteSettings.js +1 -0
- package/dist/es/colors/interfaces/ColorPickerPopupSettings.js +1 -0
- package/dist/es/colors/interfaces/ColorPickerProps.js +1 -0
- package/dist/es/colors/interfaces/ColorPickerView.js +1 -0
- package/dist/es/colors/interfaces/FlatColorPickerViewChangeEvent.js +1 -0
- package/dist/es/colors/interfaces/PickerPopupSettings.js +1 -0
- package/dist/es/colors/interfaces/PickerProps.js +1 -0
- package/dist/es/colors/models/hsva.js +1 -0
- package/dist/es/colors/models/output-format.js +1 -0
- package/dist/es/colors/models/rgb.js +1 -0
- package/dist/es/colors/models/rgba.js +1 -0
- package/dist/es/colors/models/table-cell.js +1 -0
- package/dist/es/colors/models/tile-size.js +1 -0
- package/dist/es/colors/utils/color-parser.js +1 -1
- package/dist/es/colors/utils/svg-calc.js +4 -4
- package/dist/es/input/Input.js +2 -2
- package/dist/es/interfaces/Direction.js +1 -0
- package/dist/es/interfaces/ToggleBaseProps.js +1 -0
- package/dist/es/maskedtextbox/MaskedTextBox.js +3 -3
- package/dist/es/maskedtextbox/MaskedTextBoxProps.js +1 -0
- package/dist/es/maskedtextbox/parsing/result.js +1 -1
- package/dist/es/numerictextbox/NumericTextBox.js +2 -2
- package/dist/es/numerictextbox/interfaces/NumericTextBoxData.js +1 -0
- package/dist/es/numerictextbox/interfaces/NumericTextBoxProps.js +1 -0
- package/dist/es/numerictextbox/utils/index.js +4 -4
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/radiobutton/RadioButton.js +1 -1
- package/dist/es/radiobutton/interfaces/RadioButtonBlurEvent.js +1 -0
- package/dist/es/radiobutton/interfaces/RadioButtonChangeEvent.js +1 -0
- package/dist/es/radiobutton/interfaces/RadioButtonFocusEvent.js +1 -0
- package/dist/es/radiobutton/interfaces/RadioButtonProps.js +1 -0
- package/dist/es/radiobutton/interfaces/RadioGroupChangeEvent.js +1 -0
- package/dist/es/radiobutton/interfaces/RadioGroupFocusEvent.js +1 -0
- package/dist/es/radiobutton/interfaces/RadioGroupProps.js +1 -0
- package/dist/es/range-slider/RangeSlider.js +4 -4
- package/dist/es/slider/SliderLabel.js +2 -2
- package/dist/es/switch/Switch.js +3 -3
- package/dist/es/textarea/TextArea.js +3 -3
- package/dist/es/textarea/interfaces/TextAreaBlurEvent.js +1 -0
- package/dist/es/textarea/interfaces/TextAreaChangeEvent.js +1 -0
- package/dist/es/textarea/interfaces/TextAreaFlow.js +1 -0
- package/dist/es/textarea/interfaces/TextAreaFocusEvent.js +1 -0
- package/dist/es/textarea/interfaces/TextAreaProps.js +1 -0
- package/dist/es/textarea/interfaces/TextAreaResize.js +1 -0
- package/dist/esm/additionalTypes.ts +21 -0
- package/dist/esm/checkbox/Checkbox.d.ts +79 -0
- package/dist/esm/checkbox/Checkbox.js +373 -0
- package/dist/esm/checkbox/interfaces/CheckboxChangeEvent.d.ts +9 -0
- package/dist/esm/checkbox/interfaces/CheckboxChangeEvent.js +1 -0
- package/dist/esm/checkbox/interfaces/CheckboxFocusEvent.d.ts +5 -0
- package/dist/esm/checkbox/interfaces/CheckboxFocusEvent.js +1 -0
- package/dist/esm/checkbox/interfaces/CheckboxProps.d.ts +110 -0
- package/dist/esm/checkbox/interfaces/CheckboxProps.js +1 -0
- package/dist/esm/colors/ColorContrastLabels.d.ts +49 -0
- package/dist/esm/colors/ColorContrastLabels.js +84 -0
- package/dist/esm/colors/ColorContrastSvg.d.ts +50 -0
- package/dist/esm/colors/ColorContrastSvg.js +130 -0
- package/dist/esm/colors/ColorGradient.d.ts +54 -0
- package/dist/esm/colors/ColorGradient.js +515 -0
- package/dist/esm/colors/ColorInput.d.ts +57 -0
- package/dist/esm/colors/ColorInput.js +343 -0
- package/dist/esm/colors/ColorPalette.d.ts +60 -0
- package/dist/esm/colors/ColorPalette.js +343 -0
- package/dist/esm/colors/ColorPicker.d.ts +57 -0
- package/dist/esm/colors/ColorPicker.js +505 -0
- package/dist/esm/colors/FlatColorPicker.d.ts +139 -0
- package/dist/esm/colors/FlatColorPicker.js +539 -0
- package/dist/esm/colors/HexInput.d.ts +52 -0
- package/dist/esm/colors/HexInput.js +110 -0
- package/dist/esm/colors/Picker.d.ts +46 -0
- package/dist/esm/colors/Picker.js +110 -0
- package/dist/esm/colors/interfaces/ColorGradientChangeEvent.d.ts +13 -0
- package/dist/esm/colors/interfaces/ColorGradientChangeEvent.js +1 -0
- package/dist/esm/colors/interfaces/ColorGradientProps.d.ts +68 -0
- package/dist/esm/colors/interfaces/ColorGradientProps.js +1 -0
- package/dist/esm/colors/interfaces/ColorPaletteChangeEvent.d.ts +13 -0
- package/dist/esm/colors/interfaces/ColorPaletteChangeEvent.js +1 -0
- package/dist/esm/colors/interfaces/ColorPaletteProps.d.ts +71 -0
- package/dist/esm/colors/interfaces/ColorPaletteProps.js +1 -0
- package/dist/esm/colors/interfaces/ColorPickerActiveColorClick.d.ts +13 -0
- package/dist/esm/colors/interfaces/ColorPickerActiveColorClick.js +1 -0
- package/dist/esm/colors/interfaces/ColorPickerBlurEvent.d.ts +9 -0
- package/dist/esm/colors/interfaces/ColorPickerBlurEvent.js +1 -0
- package/dist/esm/colors/interfaces/ColorPickerChangeEvent.d.ts +17 -0
- package/dist/esm/colors/interfaces/ColorPickerChangeEvent.js +1 -0
- package/dist/esm/colors/interfaces/ColorPickerFocusEvent.d.ts +9 -0
- package/dist/esm/colors/interfaces/ColorPickerFocusEvent.js +1 -0
- package/dist/esm/colors/interfaces/ColorPickerPaletteSettings.d.ts +32 -0
- package/dist/esm/colors/interfaces/ColorPickerPaletteSettings.js +1 -0
- package/dist/esm/colors/interfaces/ColorPickerPopupSettings.d.ts +14 -0
- package/dist/esm/colors/interfaces/ColorPickerPopupSettings.js +1 -0
- package/dist/esm/colors/interfaces/ColorPickerProps.d.ts +176 -0
- package/dist/esm/colors/interfaces/ColorPickerProps.js +1 -0
- package/dist/esm/colors/interfaces/ColorPickerView.d.ts +10 -0
- package/dist/esm/colors/interfaces/ColorPickerView.js +1 -0
- package/dist/esm/colors/interfaces/FlatColorPickerViewChangeEvent.d.ts +13 -0
- package/dist/esm/colors/interfaces/FlatColorPickerViewChangeEvent.js +1 -0
- package/dist/esm/colors/interfaces/PickerPopupSettings.d.ts +14 -0
- package/dist/esm/colors/interfaces/PickerPopupSettings.js +1 -0
- package/dist/esm/colors/interfaces/PickerProps.d.ts +46 -0
- package/dist/esm/colors/interfaces/PickerProps.js +1 -0
- package/dist/esm/colors/models/hsva.d.ts +9 -0
- package/dist/esm/colors/models/hsva.js +1 -0
- package/dist/esm/colors/models/output-format.d.ts +4 -0
- package/dist/esm/colors/models/output-format.js +1 -0
- package/dist/esm/colors/models/palette-presets.d.ts +53 -0
- package/dist/esm/colors/models/palette-presets.js +54 -0
- package/dist/esm/colors/models/rgb.d.ts +8 -0
- package/dist/esm/colors/models/rgb.js +1 -0
- package/dist/esm/colors/models/rgba.d.ts +9 -0
- package/dist/esm/colors/models/rgba.js +1 -0
- package/dist/esm/colors/models/table-cell.d.ts +7 -0
- package/dist/esm/colors/models/table-cell.js +1 -0
- package/dist/esm/colors/models/tile-size.d.ts +11 -0
- package/dist/esm/colors/models/tile-size.js +1 -0
- package/dist/esm/colors/utils/color-cache.d.ts +43 -0
- package/dist/esm/colors/utils/color-cache.js +75 -0
- package/dist/esm/colors/utils/color-palette.service.d.ts +13 -0
- package/dist/esm/colors/utils/color-palette.service.js +67 -0
- package/dist/esm/colors/utils/color-parser.d.ts +71 -0
- package/dist/esm/colors/utils/color-parser.js +145 -0
- package/dist/esm/colors/utils/misc.d.ts +15 -0
- package/dist/esm/colors/utils/misc.js +20 -0
- package/dist/esm/colors/utils/svg-calc.d.ts +62 -0
- package/dist/esm/colors/utils/svg-calc.js +103 -0
- package/dist/esm/input/Input.d.ts +189 -0
- package/dist/esm/input/Input.js +426 -0
- package/dist/esm/input-separator/InputSeparator.d.ts +26 -0
- package/dist/esm/input-separator/InputSeparator.js +43 -0
- package/dist/esm/interfaces/Direction.d.ts +1 -0
- package/dist/esm/interfaces/Direction.js +1 -0
- package/dist/esm/interfaces/ToggleBaseProps.d.ts +8 -0
- package/dist/esm/interfaces/ToggleBaseProps.js +1 -0
- package/dist/esm/main.d.ts +39 -0
- package/dist/esm/main.js +37 -0
- package/dist/esm/maskedtextbox/MaskedTextBox.d.ts +76 -0
- package/dist/esm/maskedtextbox/MaskedTextBox.js +511 -0
- package/dist/esm/maskedtextbox/MaskedTextBoxProps.d.ts +219 -0
- package/dist/esm/maskedtextbox/MaskedTextBoxProps.js +2 -0
- package/dist/esm/maskedtextbox/masking.service.d.ts +41 -0
- package/dist/esm/maskedtextbox/masking.service.js +206 -0
- package/dist/esm/maskedtextbox/parsing/combinators.d.ts +9 -0
- package/dist/esm/maskedtextbox/parsing/combinators.js +24 -0
- package/dist/esm/maskedtextbox/parsing/parsers.d.ts +47 -0
- package/dist/esm/maskedtextbox/parsing/parsers.js +154 -0
- package/dist/esm/maskedtextbox/parsing/result.d.ts +23 -0
- package/dist/esm/maskedtextbox/parsing/result.js +39 -0
- package/dist/esm/maskedtextbox/parsing/stream.d.ts +22 -0
- package/dist/esm/maskedtextbox/parsing/stream.js +41 -0
- package/dist/esm/maskedtextbox/utils.d.ts +16 -0
- package/dist/esm/maskedtextbox/utils.js +56 -0
- package/dist/esm/messages/index.d.ts +160 -0
- package/dist/esm/messages/index.js +162 -0
- package/dist/esm/numerictextbox/NumericTextBox.d.ts +87 -0
- package/dist/esm/numerictextbox/NumericTextBox.js +684 -0
- package/dist/esm/numerictextbox/interfaces/NumericTextBoxData.d.ts +15 -0
- package/dist/esm/numerictextbox/interfaces/NumericTextBoxData.js +1 -0
- package/dist/esm/numerictextbox/interfaces/NumericTextBoxProps.d.ts +178 -0
- package/dist/esm/numerictextbox/interfaces/NumericTextBoxProps.js +1 -0
- package/dist/esm/numerictextbox/utils/index.d.ts +119 -0
- package/dist/esm/numerictextbox/utils/index.js +646 -0
- package/dist/esm/package-metadata.d.ts +5 -0
- package/dist/esm/package-metadata.js +11 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/radiobutton/RadioButton.d.ts +55 -0
- package/dist/esm/radiobutton/RadioButton.js +195 -0
- package/dist/esm/radiobutton/RadioGroup.d.ts +57 -0
- package/dist/esm/radiobutton/RadioGroup.js +218 -0
- package/dist/esm/radiobutton/interfaces/RadioButtonBlurEvent.d.ts +5 -0
- package/dist/esm/radiobutton/interfaces/RadioButtonBlurEvent.js +1 -0
- package/dist/esm/radiobutton/interfaces/RadioButtonChangeEvent.d.ts +9 -0
- package/dist/esm/radiobutton/interfaces/RadioButtonChangeEvent.js +1 -0
- package/dist/esm/radiobutton/interfaces/RadioButtonFocusEvent.d.ts +5 -0
- package/dist/esm/radiobutton/interfaces/RadioButtonFocusEvent.js +1 -0
- package/dist/esm/radiobutton/interfaces/RadioButtonProps.d.ts +107 -0
- package/dist/esm/radiobutton/interfaces/RadioButtonProps.js +1 -0
- package/dist/esm/radiobutton/interfaces/RadioGroupChangeEvent.d.ts +9 -0
- package/dist/esm/radiobutton/interfaces/RadioGroupChangeEvent.js +1 -0
- package/dist/esm/radiobutton/interfaces/RadioGroupFocusEvent.d.ts +5 -0
- package/dist/esm/radiobutton/interfaces/RadioGroupFocusEvent.js +1 -0
- package/dist/esm/radiobutton/interfaces/RadioGroupProps.d.ts +81 -0
- package/dist/esm/radiobutton/interfaces/RadioGroupProps.js +1 -0
- package/dist/esm/range-slider/RangeSlider.d.ts +176 -0
- package/dist/esm/range-slider/RangeSlider.js +617 -0
- package/dist/esm/range-slider/range-raducer.d.ts +35 -0
- package/dist/esm/range-slider/range-raducer.js +157 -0
- package/dist/esm/slider/Slider.d.ts +140 -0
- package/dist/esm/slider/Slider.js +395 -0
- package/dist/esm/slider/SliderLabel.d.ts +65 -0
- package/dist/esm/slider/SliderLabel.js +121 -0
- package/dist/esm/switch/Switch.d.ts +182 -0
- package/dist/esm/switch/Switch.js +342 -0
- package/dist/esm/switch/util.d.ts +8 -0
- package/dist/esm/switch/util.js +46 -0
- package/dist/esm/textarea/TextArea.d.ts +81 -0
- package/dist/esm/textarea/TextArea.js +422 -0
- package/dist/esm/textarea/interfaces/TextAreaBlurEvent.d.ts +5 -0
- package/dist/esm/textarea/interfaces/TextAreaBlurEvent.js +1 -0
- package/dist/esm/textarea/interfaces/TextAreaChangeEvent.d.ts +9 -0
- package/dist/esm/textarea/interfaces/TextAreaChangeEvent.js +1 -0
- package/dist/esm/textarea/interfaces/TextAreaFlow.d.ts +8 -0
- package/dist/esm/textarea/interfaces/TextAreaFlow.js +1 -0
- package/dist/esm/textarea/interfaces/TextAreaFocusEvent.d.ts +5 -0
- package/dist/esm/textarea/interfaces/TextAreaFocusEvent.js +1 -0
- package/dist/esm/textarea/interfaces/TextAreaProps.d.ts +170 -0
- package/dist/esm/textarea/interfaces/TextAreaProps.js +1 -0
- package/dist/esm/textarea/interfaces/TextAreaResize.d.ts +10 -0
- package/dist/esm/textarea/interfaces/TextAreaResize.js +1 -0
- package/dist/npm/checkbox/Checkbox.js +12 -12
- package/dist/npm/colors/ColorContrastLabels.js +5 -5
- package/dist/npm/colors/ColorContrastSvg.js +4 -4
- package/dist/npm/colors/ColorGradient.js +42 -42
- package/dist/npm/colors/ColorInput.js +2 -2
- package/dist/npm/colors/ColorPalette.js +12 -12
- package/dist/npm/colors/ColorPicker.js +15 -15
- package/dist/npm/colors/FlatColorPicker.js +10 -10
- package/dist/npm/colors/HexInput.js +4 -4
- package/dist/npm/colors/Picker.js +2 -2
- package/dist/npm/colors/utils/color-palette.service.js +6 -6
- package/dist/npm/colors/utils/color-parser.js +48 -37
- package/dist/npm/colors/utils/misc.js +5 -3
- package/dist/npm/colors/utils/svg-calc.js +12 -8
- package/dist/npm/input/Input.js +4 -4
- package/dist/npm/input-separator/InputSeparator.js +1 -1
- package/dist/npm/main.js +7 -2
- package/dist/npm/maskedtextbox/MaskedTextBox.js +8 -8
- package/dist/npm/maskedtextbox/masking.service.js +19 -19
- package/dist/npm/maskedtextbox/parsing/combinators.js +4 -2
- package/dist/npm/maskedtextbox/parsing/parsers.js +14 -7
- package/dist/npm/maskedtextbox/parsing/result.js +1 -1
- package/dist/npm/numerictextbox/NumericTextBox.js +22 -22
- package/dist/npm/numerictextbox/utils/index.js +145 -116
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/radiobutton/RadioButton.js +8 -8
- package/dist/npm/radiobutton/RadioGroup.js +5 -5
- package/dist/npm/range-slider/RangeSlider.js +17 -17
- package/dist/npm/range-slider/range-raducer.js +4 -2
- package/dist/npm/slider/Slider.js +7 -7
- package/dist/npm/slider/SliderLabel.js +3 -3
- package/dist/npm/switch/Switch.js +13 -13
- package/dist/npm/switch/util.js +2 -1
- package/dist/npm/textarea/TextArea.js +7 -7
- package/package.json +17 -11
|
@@ -0,0 +1,684 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import * as Vue from 'vue';
|
|
3
|
+
var allVue = Vue;
|
|
4
|
+
var gh = allVue.h;
|
|
5
|
+
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
6
|
+
var ref = allVue.ref;
|
|
7
|
+
var inject = allVue.inject;
|
|
8
|
+
import { canUseDOM, getDefaultSlots, getListeners, getRef, getTemplate, kendoThemeMaps, setRef, templateDefinition, templateRendering } from '@progress/kendo-vue-common';
|
|
9
|
+
import { provideIntlService, provideLocalizationService } from '@progress/kendo-vue-intl';
|
|
10
|
+
import { guid, validatePackage } from '@progress/kendo-vue-common';
|
|
11
|
+
import { Button as KButton } from '@progress/kendo-vue-buttons';
|
|
12
|
+
import { messages, numericIncreaseValue, numericDecreaseValue } from './../messages.js';
|
|
13
|
+
import { formatValue, sanitizeNumber, rangeValue, increaseValue, decreaseValue, getStateOrPropsValue } from './utils.js';
|
|
14
|
+
import { packageMetadata } from '../package-metadata.js';
|
|
15
|
+
var VALIDATION_MESSAGE = 'Please enter a valid value!';
|
|
16
|
+
/**
|
|
17
|
+
* @hidden
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
var NumericTextBoxVue2 = {
|
|
21
|
+
model: {
|
|
22
|
+
event: 'changemodel'
|
|
23
|
+
},
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
emits: {
|
|
26
|
+
'change': null,
|
|
27
|
+
'changemodel': null,
|
|
28
|
+
'update:modelValue': null,
|
|
29
|
+
'focus': null,
|
|
30
|
+
'blur': null
|
|
31
|
+
},
|
|
32
|
+
props: {
|
|
33
|
+
modelValue: Number,
|
|
34
|
+
value: Number,
|
|
35
|
+
defaultValue: Number,
|
|
36
|
+
step: {
|
|
37
|
+
type: Number,
|
|
38
|
+
default: 1
|
|
39
|
+
},
|
|
40
|
+
format: [String, Object],
|
|
41
|
+
tabIndex: Number,
|
|
42
|
+
accessKey: String,
|
|
43
|
+
title: String,
|
|
44
|
+
placeholder: String,
|
|
45
|
+
min: Number,
|
|
46
|
+
max: Number,
|
|
47
|
+
spinners: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: true
|
|
50
|
+
},
|
|
51
|
+
disabled: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: false
|
|
54
|
+
},
|
|
55
|
+
dir: String,
|
|
56
|
+
name: String,
|
|
57
|
+
label: String,
|
|
58
|
+
validationMessage: String,
|
|
59
|
+
validityStyles: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: true
|
|
62
|
+
},
|
|
63
|
+
valid: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: undefined
|
|
66
|
+
},
|
|
67
|
+
size: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: 'medium',
|
|
70
|
+
validator: function validator(value) {
|
|
71
|
+
return [null, 'small', 'medium', 'large'].includes(value);
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
rounded: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: 'medium',
|
|
77
|
+
validator: function validator(value) {
|
|
78
|
+
return [null, 'small', 'medium', 'large', 'full'].includes(value);
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
fillMode: {
|
|
82
|
+
type: String,
|
|
83
|
+
default: 'solid',
|
|
84
|
+
validator: function validator(value) {
|
|
85
|
+
return [null, 'solid', 'flat', 'outline'].includes(value);
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
required: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
default: false
|
|
91
|
+
},
|
|
92
|
+
id: String,
|
|
93
|
+
ariaLabel: String,
|
|
94
|
+
iconName: String,
|
|
95
|
+
inputPrefix: templateDefinition,
|
|
96
|
+
inputSuffix: templateDefinition,
|
|
97
|
+
showValidationIcon: Boolean,
|
|
98
|
+
showLoadingIcon: Boolean,
|
|
99
|
+
showClearButton: Boolean,
|
|
100
|
+
inputClass: String,
|
|
101
|
+
wrapperClass: String
|
|
102
|
+
},
|
|
103
|
+
inject: {
|
|
104
|
+
kendoIntlService: {
|
|
105
|
+
default: null
|
|
106
|
+
},
|
|
107
|
+
kendoLocalizationService: {
|
|
108
|
+
default: null
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
data: function data() {
|
|
112
|
+
return {
|
|
113
|
+
hasMounted: false,
|
|
114
|
+
isInvalid: false,
|
|
115
|
+
isEmpty: false,
|
|
116
|
+
currentValue: 0,
|
|
117
|
+
valueDuringOnChange: 0,
|
|
118
|
+
currentLooseValue: '',
|
|
119
|
+
selectionStart: 0,
|
|
120
|
+
selectionEnd: 0,
|
|
121
|
+
decimalSelect: false,
|
|
122
|
+
focused: false,
|
|
123
|
+
forceUpdate: false
|
|
124
|
+
};
|
|
125
|
+
},
|
|
126
|
+
created: function created() {
|
|
127
|
+
validatePackage(packageMetadata);
|
|
128
|
+
this._textBeforeInput = '';
|
|
129
|
+
this._inputId = guid();
|
|
130
|
+
this.$data.currentLooseValue = null;
|
|
131
|
+
this.$data.valueDuringOnChange = undefined;
|
|
132
|
+
this._intl = provideIntlService(this);
|
|
133
|
+
this._symbols = this._intl.numberSymbols();
|
|
134
|
+
|
|
135
|
+
if (this.$props.value !== undefined) {
|
|
136
|
+
this.$data.currentValue = this.$props.value;
|
|
137
|
+
} else if (this.$props.modelValue !== undefined) {
|
|
138
|
+
this.$data.currentValue = this.$props.modelValue;
|
|
139
|
+
} else if (this.$props.defaultValue !== undefined) {
|
|
140
|
+
this.$data.currentValue = this.$props.defaultValue;
|
|
141
|
+
} else {
|
|
142
|
+
this.$data.currentValue = null;
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
mounted: function mounted() {
|
|
146
|
+
this._input = getRef(this, 'input');
|
|
147
|
+
this._elementWrapper = this.v3 ? this.elementWrapperRef : this.$refs.elementWrapper;
|
|
148
|
+
this.$data.hasMounted = true;
|
|
149
|
+
|
|
150
|
+
if (this._input) {
|
|
151
|
+
this._textBeforeInput = this._input.value;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
this.setValidity();
|
|
155
|
+
},
|
|
156
|
+
updated: function updated() {
|
|
157
|
+
if (!(canUseDOM && document.activeElement !== this._input || !this._input) && this.$data.currentLooseValue !== null) {
|
|
158
|
+
if (this.$data.forceUpdate) {
|
|
159
|
+
this._input.selectionStart = this.$data.selectionStart;
|
|
160
|
+
this._input.selectionEnd = this.$data.selectionEnd;
|
|
161
|
+
this.$data.forceUpdate = false;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if (this._input) {
|
|
166
|
+
this._textBeforeInput = this._input.value;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
this.setValidity();
|
|
170
|
+
},
|
|
171
|
+
computed: {
|
|
172
|
+
computedValue: {
|
|
173
|
+
get: function get() {
|
|
174
|
+
if (this.$data.valueDuringOnChange !== undefined) {
|
|
175
|
+
return this.$data.valueDuringOnChange;
|
|
176
|
+
} else {
|
|
177
|
+
return this.$data.currentValue;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
looseValue: {
|
|
182
|
+
get: function get() {
|
|
183
|
+
return formatValue(this.$data.focused ? this.$data.currentLooseValue : getStateOrPropsValue(this.$props.value, this.$data.currentValue), this.$props.format, this._intl);
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
spanClassNames: {
|
|
187
|
+
get: function get() {
|
|
188
|
+
var _a;
|
|
189
|
+
|
|
190
|
+
var isValid = !this.$data.hasMounted || !this.$props.validityStyles || this.validity().valid;
|
|
191
|
+
var compValue = this.computedValue;
|
|
192
|
+
return _a = {
|
|
193
|
+
'k-floating-label-container': true,
|
|
194
|
+
'k-focus': this.$data.focused,
|
|
195
|
+
'k-empty': !(compValue === 0 ? true : compValue || this.$props.placeholder),
|
|
196
|
+
'k-invalid': !isValid && isValid !== undefined,
|
|
197
|
+
'k-rtl': this.$props.dir === 'rtl'
|
|
198
|
+
}, _a[this.inputClass] = this.inputClass, _a;
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
wrapperClassNames: function wrapperClassNames() {
|
|
202
|
+
var _a;
|
|
203
|
+
|
|
204
|
+
var _b = this.$props,
|
|
205
|
+
size = _b.size,
|
|
206
|
+
fillMode = _b.fillMode,
|
|
207
|
+
rounded = _b.rounded,
|
|
208
|
+
required = _b.required,
|
|
209
|
+
disabled = _b.disabled;
|
|
210
|
+
var isValid = !this.$props.validityStyles || this.validity().valid;
|
|
211
|
+
return _a = {
|
|
212
|
+
'k-input': true,
|
|
213
|
+
'k-numerictextbox': true
|
|
214
|
+
}, _a["k-input-".concat(kendoThemeMaps.sizeMap[size] || size)] = size, _a["k-input-".concat(fillMode)] = fillMode, _a["k-rounded-".concat(kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded, _a['k-invalid'] = !isValid, _a['k-required'] = required, _a['k-disabled'] = disabled, _a['k-loading'] = this.showLoadingIcon, _a[this.wrapperClass] = this.wrapperClass, _a;
|
|
215
|
+
},
|
|
216
|
+
inputInnerClass: function inputInnerClass() {
|
|
217
|
+
var _a;
|
|
218
|
+
|
|
219
|
+
return _a = {
|
|
220
|
+
'k-input-inner': true
|
|
221
|
+
}, _a[this.inputClass] = this.inputClass, _a;
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
methods: {
|
|
225
|
+
validity: function validity() {
|
|
226
|
+
// The NumericTextBox currently autocorrect its' value,
|
|
227
|
+
// so the only invalid state is if it's required and
|
|
228
|
+
// the value is null!
|
|
229
|
+
var customError = this.$props.validationMessage !== undefined;
|
|
230
|
+
var isValid = !this.$data.valueIsOutOfRange && (!this.$props.required || this.computedValue !== null);
|
|
231
|
+
var valid = this.$props.valid !== undefined ? this.$props.valid : isValid;
|
|
232
|
+
return {
|
|
233
|
+
customError: customError,
|
|
234
|
+
valid: valid,
|
|
235
|
+
valueMissing: this.computedValue === null
|
|
236
|
+
};
|
|
237
|
+
},
|
|
238
|
+
clearClick: function clearClick(event) {
|
|
239
|
+
if (this.$props.value !== undefined) {
|
|
240
|
+
// controlled
|
|
241
|
+
this.$data.currentValue = this.$props.value;
|
|
242
|
+
} else if (this.$props.modelValue !== undefined) {
|
|
243
|
+
this.$data.currentValue = this.$props.modelValue;
|
|
244
|
+
} else {
|
|
245
|
+
// uncontrolled
|
|
246
|
+
this.$data.currentValue = null;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
this.$emit('changemodel', null);
|
|
250
|
+
this.$emit('update:modelValue', null);
|
|
251
|
+
this.$emit('change', {
|
|
252
|
+
event: event,
|
|
253
|
+
value: null,
|
|
254
|
+
component: this,
|
|
255
|
+
target: {
|
|
256
|
+
name: this.$props.name,
|
|
257
|
+
value: null
|
|
258
|
+
},
|
|
259
|
+
validity: this.validity()
|
|
260
|
+
});
|
|
261
|
+
},
|
|
262
|
+
focus: function focus() {
|
|
263
|
+
if (this._input) {
|
|
264
|
+
this._input.focus();
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
emitFocus: function emitFocus(e) {
|
|
268
|
+
this.$data.currentLooseValue = this._prevLooseValue;
|
|
269
|
+
this.$data.focused = true;
|
|
270
|
+
this.$emit('focus', e);
|
|
271
|
+
this.$data.forceUpdate = true;
|
|
272
|
+
},
|
|
273
|
+
emitBlur: function emitBlur(e) {
|
|
274
|
+
this.$data.eventValue = null;
|
|
275
|
+
this.$data.prevLooseValue = '';
|
|
276
|
+
this.$data.currentLooseValue = '';
|
|
277
|
+
this.$data.focused = false;
|
|
278
|
+
this.$data.selectionStart = undefined;
|
|
279
|
+
this.$data.selectionEnd = undefined;
|
|
280
|
+
this.$data.decimalSelect = false;
|
|
281
|
+
this.$data.valueIsCorrected = false;
|
|
282
|
+
this.$data.valueIsOutOfRange = false;
|
|
283
|
+
this.$emit('blur', e);
|
|
284
|
+
this.$data.forceUpdate = true;
|
|
285
|
+
},
|
|
286
|
+
handleFocus: function handleFocus(_) {
|
|
287
|
+
this.$data.focused = true;
|
|
288
|
+
},
|
|
289
|
+
handleBlur: function handleBlur(_) {
|
|
290
|
+
this.$data.focused = false;
|
|
291
|
+
},
|
|
292
|
+
setValidity: function setValidity() {
|
|
293
|
+
if (this._input && this._input.setCustomValidity) {
|
|
294
|
+
this._input.setCustomValidity(this.validity().valid ? '' : this.$props.validationMessage || VALIDATION_MESSAGE);
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
getCurrentState: function getCurrentState() {
|
|
298
|
+
return {
|
|
299
|
+
eventValue: getStateOrPropsValue(this.$props.value, this.$data.currentValue),
|
|
300
|
+
prevLooseValue: this._prevLooseValue,
|
|
301
|
+
currentLooseValue: this._input.value,
|
|
302
|
+
selectionStart: this._input.selectionStart,
|
|
303
|
+
selectionEnd: this._input.selectionEnd,
|
|
304
|
+
decimalSelect: false,
|
|
305
|
+
valueIsCorrected: false,
|
|
306
|
+
valueIsOutOfRange: false,
|
|
307
|
+
isPaste: this._isPaste,
|
|
308
|
+
focused: this.$data.focused
|
|
309
|
+
};
|
|
310
|
+
},
|
|
311
|
+
parseNumber: function parseNumber(text) {
|
|
312
|
+
return this._intl.parseNumber(text, this.$props.format);
|
|
313
|
+
},
|
|
314
|
+
elementChange: function elementChange(event) {
|
|
315
|
+
var newState = this.getCurrentState();
|
|
316
|
+
this._isPaste = false;
|
|
317
|
+
this.triggerChange(event, sanitizeNumber(newState, this.$props.format, this._intl));
|
|
318
|
+
},
|
|
319
|
+
triggerChange: function triggerChange(event, newState) {
|
|
320
|
+
var _this = this;
|
|
321
|
+
|
|
322
|
+
if (this.$props.disabled) {
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
this.$data.valueDuringOnChange = newState.eventValue;
|
|
327
|
+
this.$data.currentValue = newState.eventValue;
|
|
328
|
+
var formattedValue = formatValue(rangeValue(newState.eventValue, this.$props.min, this.$props.max), this.$props.format, this._intl);
|
|
329
|
+
var rangedValue = rangeValue(this.parseNumber(formattedValue), this.$props.min, this.$props.max);
|
|
330
|
+
|
|
331
|
+
if (rangedValue !== newState.eventValue) {
|
|
332
|
+
newState.valueIsOutOfRange = true;
|
|
333
|
+
newState.eventValue = rangedValue;
|
|
334
|
+
this.$data.valueDuringOnChange = rangedValue;
|
|
335
|
+
this.$data.currentValue = rangedValue;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
if (newState.valueIsCorrected) {
|
|
339
|
+
var wrapper = this._elementWrapper;
|
|
340
|
+
|
|
341
|
+
if (wrapper && wrapper.className.indexOf("k-invalid") === -1) {
|
|
342
|
+
this.$data.isInvalid = true;
|
|
343
|
+
setTimeout(function () {
|
|
344
|
+
_this.$data.isInvalid = false;
|
|
345
|
+
}, 50);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
var shouldFireEvent = this.$props.value !== newState.eventValue;
|
|
350
|
+
|
|
351
|
+
if (this.$props.value !== undefined) {
|
|
352
|
+
// controlled
|
|
353
|
+
this.$data.currentValue = this.$props.value;
|
|
354
|
+
} else if (this.$props.modelValue !== undefined) {
|
|
355
|
+
this.$data.currentValue = this.$props.modelValue;
|
|
356
|
+
} else {
|
|
357
|
+
// uncontrolled
|
|
358
|
+
this.$data.currentValue = this.$data.valueDuringOnChange;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
this.$data.prevLooseValue = newState.prevLooseValue;
|
|
362
|
+
this.$data.currentLooseValue = newState.currentLooseValue;
|
|
363
|
+
this.$data.selectionStart = newState.selectionStart;
|
|
364
|
+
this.$data.selectionEnd = newState.selectionEnd;
|
|
365
|
+
this.$data.decimalSelect = newState.decimalSelect;
|
|
366
|
+
this.$data.valueIsCorrected = newState.valueIsCorrected;
|
|
367
|
+
this.$data.valueIsOutOfRange = newState.valueIsOutOfRange;
|
|
368
|
+
this.$data.focused = newState.focused;
|
|
369
|
+
this.$data.isPaste = newState.isPaste;
|
|
370
|
+
this.$data.forceUpdate = !this.$data.forceUpdate;
|
|
371
|
+
|
|
372
|
+
if (shouldFireEvent) {
|
|
373
|
+
this.$emit('changemodel', this.$data.valueDuringOnChange);
|
|
374
|
+
this.$emit('update:modelValue', this.$data.valueDuringOnChange);
|
|
375
|
+
this.$emit('change', {
|
|
376
|
+
event: event,
|
|
377
|
+
value: this.$data.valueDuringOnChange,
|
|
378
|
+
component: this,
|
|
379
|
+
target: {
|
|
380
|
+
name: this.$props.name,
|
|
381
|
+
value: this.$data.valueDuringOnChange
|
|
382
|
+
},
|
|
383
|
+
validity: this.validity()
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
this.$data.valueDuringOnChange = undefined;
|
|
388
|
+
},
|
|
389
|
+
onPasteHandler: function onPasteHandler(_event) {
|
|
390
|
+
this._isPaste = true;
|
|
391
|
+
},
|
|
392
|
+
increase: function increase(event) {
|
|
393
|
+
var newState = this.getCurrentState();
|
|
394
|
+
increaseValue(this.parseNumber(String(newState.currentLooseValue)), newState, this.$props.step, this.$props.min, this.$props.max, this.$props.format, this._intl);
|
|
395
|
+
this.triggerChange(event, newState);
|
|
396
|
+
},
|
|
397
|
+
decrease: function decrease(event) {
|
|
398
|
+
var newState = this.getCurrentState();
|
|
399
|
+
decreaseValue(this.parseNumber(String(newState.currentLooseValue)), newState, this.$props.step, this.$props.min, this.$props.max, this.$props.format, this._intl);
|
|
400
|
+
this.triggerChange(event, newState);
|
|
401
|
+
},
|
|
402
|
+
wheel: function wheel(event) {
|
|
403
|
+
if (!canUseDOM || document.activeElement !== this._input || !this._input) {
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
if (event.deltaY < 0) {
|
|
408
|
+
event.preventDefault();
|
|
409
|
+
this.increase(event);
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
if (event.deltaY > 0) {
|
|
413
|
+
event.preventDefault();
|
|
414
|
+
this.decrease(event);
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
keyDown: function keyDown(event) {
|
|
418
|
+
var newState = this.getCurrentState();
|
|
419
|
+
var currentValue = this.parseNumber(String(newState.currentLooseValue)); // Select All
|
|
420
|
+
|
|
421
|
+
if (newState.selectionEnd > newState.selectionStart && newState.selectionEnd - newState.selectionStart === String(newState.currentLooseValue).length) {
|
|
422
|
+
return;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
switch (event.keyCode) {
|
|
426
|
+
case 38:
|
|
427
|
+
// Arrow up
|
|
428
|
+
increaseValue(currentValue, newState, this.$props.step, this.$props.min, this.$props.max, this.$props.format, this._intl);
|
|
429
|
+
break;
|
|
430
|
+
|
|
431
|
+
case 40:
|
|
432
|
+
// Arrow down
|
|
433
|
+
decreaseValue(currentValue, newState, this.$props.step, this.$props.min, this.$props.max, this.$props.format, this._intl);
|
|
434
|
+
break;
|
|
435
|
+
|
|
436
|
+
case 13:
|
|
437
|
+
// Enter - range values
|
|
438
|
+
var formattedValue = formatValue(rangeValue(currentValue, this.$props.min, this.$props.max), this.$props.format, this._intl);
|
|
439
|
+
var rangedValue = rangeValue(this.parseNumber(formattedValue), this.$props.min, this.$props.max);
|
|
440
|
+
newState.eventValue = rangedValue;
|
|
441
|
+
newState.currentLooseValue = formatValue(rangedValue, this.$props.format, this._intl);
|
|
442
|
+
newState.selectionStart = newState.selectionEnd = newState.currentLooseValue.length;
|
|
443
|
+
break;
|
|
444
|
+
|
|
445
|
+
case 110:
|
|
446
|
+
// Numpad decimal key
|
|
447
|
+
var element = this._input;
|
|
448
|
+
|
|
449
|
+
var symbols = this._intl.numberSymbols();
|
|
450
|
+
|
|
451
|
+
if (element) {
|
|
452
|
+
newState.currentLooseValue = newState.currentLooseValue.slice(0, newState.selectionStart) + symbols.decimal + newState.currentLooseValue.slice(newState.selectionEnd);
|
|
453
|
+
newState.selectionStart = newState.selectionEnd = newState.selectionStart + 1;
|
|
454
|
+
newState = sanitizeNumber(newState, this.$props.format, this._intl);
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
break;
|
|
458
|
+
|
|
459
|
+
default:
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
event.preventDefault();
|
|
464
|
+
this.triggerChange(event, newState);
|
|
465
|
+
},
|
|
466
|
+
spinnersWrapperMouseDown: function spinnersWrapperMouseDown(e) {
|
|
467
|
+
if (canUseDOM && this._input) {
|
|
468
|
+
e.preventDefault();
|
|
469
|
+
|
|
470
|
+
if (document.activeElement !== this._input) {
|
|
471
|
+
this._input.focus();
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
},
|
|
476
|
+
// @ts-ignore
|
|
477
|
+
setup: !isV3 ? undefined : function () {
|
|
478
|
+
var v3 = !!isV3;
|
|
479
|
+
var inputRef = ref(null);
|
|
480
|
+
var elementWrapperRef = ref(null);
|
|
481
|
+
var kendoLocalizationService = inject('kendoLocalizationService', {});
|
|
482
|
+
var kendoIntlService = inject('kendoIntlService', {});
|
|
483
|
+
return {
|
|
484
|
+
v3: v3,
|
|
485
|
+
inputRef: inputRef,
|
|
486
|
+
elementWrapperRef: elementWrapperRef,
|
|
487
|
+
kendoLocalizationService: kendoLocalizationService,
|
|
488
|
+
kendoIntlService: kendoIntlService
|
|
489
|
+
};
|
|
490
|
+
},
|
|
491
|
+
// @ts-ignore
|
|
492
|
+
render: function render(createElement) {
|
|
493
|
+
var h = gh || createElement;
|
|
494
|
+
var _a = this.$props,
|
|
495
|
+
iconName = _a.iconName,
|
|
496
|
+
showValidationIcon = _a.showValidationIcon,
|
|
497
|
+
showLoadingIcon = _a.showLoadingIcon,
|
|
498
|
+
showClearButton = _a.showClearButton;
|
|
499
|
+
var inputId = this.$props.id || this._inputId;
|
|
500
|
+
var defaultSlot = getDefaultSlots(this);
|
|
501
|
+
var localizationService = provideLocalizationService(this);
|
|
502
|
+
var isValid = this.validity().valid;
|
|
503
|
+
|
|
504
|
+
if (this.$props.value !== undefined && this.$props.value !== this.$data.currentValue) {
|
|
505
|
+
this.$data.currentValue = this.$props.value;
|
|
506
|
+
} else if (this.$props.modelValue !== undefined && this.$props.modelValue !== this.$data.currentValue) {
|
|
507
|
+
this.$data.currentValue = this.$props.modelValue;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
this._prevLooseValue = this.looseValue;
|
|
511
|
+
var inputPrefixTemplate = templateRendering.call(this, this.$props.inputPrefix, getListeners.call(this));
|
|
512
|
+
var inputSuffixTemplate = templateRendering.call(this, this.$props.inputSuffix, getListeners.call(this));
|
|
513
|
+
var inputPrefix = getTemplate.call(this, {
|
|
514
|
+
h: h,
|
|
515
|
+
template: inputPrefixTemplate,
|
|
516
|
+
additionalProps: {
|
|
517
|
+
value: this.computedValue,
|
|
518
|
+
valid: isValid
|
|
519
|
+
}
|
|
520
|
+
});
|
|
521
|
+
var inputSuffix = getTemplate.call(this, {
|
|
522
|
+
h: h,
|
|
523
|
+
template: inputSuffixTemplate,
|
|
524
|
+
additionalProps: {
|
|
525
|
+
value: this.computedValue,
|
|
526
|
+
valid: isValid
|
|
527
|
+
}
|
|
528
|
+
});
|
|
529
|
+
var numerictextbox = h("span", {
|
|
530
|
+
dir: this.$props.dir,
|
|
531
|
+
attrs: this.v3 ? undefined : {
|
|
532
|
+
dir: this.$props.dir,
|
|
533
|
+
"aria-disabled": this.$props.disabled ? 'true' : undefined
|
|
534
|
+
},
|
|
535
|
+
"class": this.wrapperClassNames,
|
|
536
|
+
"aria-disabled": this.$props.disabled ? 'true' : undefined,
|
|
537
|
+
style: this.$attrs.style
|
|
538
|
+
}, [iconName && h("span", {
|
|
539
|
+
"class": "k-input-icon k-icon k-i-".concat(iconName)
|
|
540
|
+
}), this.$props.inputPrefix && h("span", {
|
|
541
|
+
"class": "k-input-prefix"
|
|
542
|
+
}, [inputPrefix]), h("input", {
|
|
543
|
+
tabindex: this.$props.tabIndex,
|
|
544
|
+
attrs: this.v3 ? undefined : {
|
|
545
|
+
tabindex: this.$props.tabIndex,
|
|
546
|
+
accesskey: this.$props.accessKey,
|
|
547
|
+
disabled: this.$props.disabled,
|
|
548
|
+
title: this.$props.title,
|
|
549
|
+
"aria-label": this.$props.ariaLabel,
|
|
550
|
+
"aria-valuemin": this.$props.min,
|
|
551
|
+
"aria-valuemax": this.$props.max,
|
|
552
|
+
placeholder: this.$props.placeholder,
|
|
553
|
+
type: this.$props.inputType || 'tel',
|
|
554
|
+
spellcheck: false,
|
|
555
|
+
autocomplete: "off",
|
|
556
|
+
autocorrect: "off",
|
|
557
|
+
id: inputId,
|
|
558
|
+
"aria-valuenow": this.$data.currentValue !== null ? this.$data.currentValue : undefined,
|
|
559
|
+
name: this.$props.name
|
|
560
|
+
},
|
|
561
|
+
accesskey: this.$props.accessKey,
|
|
562
|
+
disabled: this.$props.disabled,
|
|
563
|
+
title: this.$props.title,
|
|
564
|
+
"aria-label": this.$props.ariaLabel,
|
|
565
|
+
"aria-valuemin": this.$props.min,
|
|
566
|
+
"aria-valuemax": this.$props.max,
|
|
567
|
+
placeholder: this.$props.placeholder,
|
|
568
|
+
type: this.$props.inputType || 'tel',
|
|
569
|
+
spellcheck: false,
|
|
570
|
+
autocomplete: "off",
|
|
571
|
+
autocorrect: "off",
|
|
572
|
+
"class": this.inputInnerClass,
|
|
573
|
+
id: inputId,
|
|
574
|
+
value: this.v3 ? this.looseValue : null,
|
|
575
|
+
domProps: this.v3 ? undefined : {
|
|
576
|
+
"value": this.looseValue
|
|
577
|
+
},
|
|
578
|
+
"aria-valuenow": this.$data.currentValue !== null ? this.$data.currentValue : undefined,
|
|
579
|
+
name: this.$props.name,
|
|
580
|
+
onWheel: this.wheel,
|
|
581
|
+
on: this.v3 ? undefined : {
|
|
582
|
+
"wheel": this.wheel,
|
|
583
|
+
"keydown": this.keyDown,
|
|
584
|
+
"input": this.elementChange,
|
|
585
|
+
"focus": this.emitFocus,
|
|
586
|
+
"blur": this.emitBlur,
|
|
587
|
+
"paste": this.onPasteHandler
|
|
588
|
+
},
|
|
589
|
+
onKeydown: this.keyDown,
|
|
590
|
+
onInput: this.elementChange,
|
|
591
|
+
onFocus: this.emitFocus,
|
|
592
|
+
onBlur: this.emitBlur,
|
|
593
|
+
onPaste: this.onPasteHandler,
|
|
594
|
+
ref: setRef(this, 'input')
|
|
595
|
+
}), this.$props.inputSuffix && h("span", {
|
|
596
|
+
"class": "k-input-suffix"
|
|
597
|
+
}, [inputSuffix]), showValidationIcon && isValid && h("span", {
|
|
598
|
+
"class": "k-input-validation-icon k-icon k-i-check"
|
|
599
|
+
}), showValidationIcon && !isValid && h("span", {
|
|
600
|
+
"class": "k-input-validation-icon k-icon k-i-warning"
|
|
601
|
+
}), showLoadingIcon && h("span", {
|
|
602
|
+
"class": "k-input-loading-icon k-icon k-i-loading"
|
|
603
|
+
}), showClearButton && this.computedValue !== undefined && this.computedValue !== null && h("span", {
|
|
604
|
+
onClick: this.clearClick,
|
|
605
|
+
on: this.v3 ? undefined : {
|
|
606
|
+
"click": this.clearClick
|
|
607
|
+
},
|
|
608
|
+
"class": "k-clear-value"
|
|
609
|
+
}, [h("span", {
|
|
610
|
+
"class": "k-icon k-i-x"
|
|
611
|
+
})]), defaultSlot, this.$props.spinners && h("span", {
|
|
612
|
+
"class": "k-input-spinner k-spin-button",
|
|
613
|
+
onMousedown: this.spinnersWrapperMouseDown,
|
|
614
|
+
on: this.v3 ? undefined : {
|
|
615
|
+
"mousedown": this.spinnersWrapperMouseDown
|
|
616
|
+
}
|
|
617
|
+
}, [// @ts-ignore
|
|
618
|
+
h(KButton, {
|
|
619
|
+
type: "button",
|
|
620
|
+
attrs: this.v3 ? undefined : {
|
|
621
|
+
type: "button",
|
|
622
|
+
tabIndex: -1,
|
|
623
|
+
icon: 'arrow-n',
|
|
624
|
+
"aria-label": localizationService.toLanguageString(numericIncreaseValue, messages[numericIncreaseValue]),
|
|
625
|
+
title: localizationService.toLanguageString(numericIncreaseValue, messages[numericIncreaseValue])
|
|
626
|
+
},
|
|
627
|
+
tabIndex: -1,
|
|
628
|
+
icon: 'arrow-n',
|
|
629
|
+
"class": "k-spinner-increase",
|
|
630
|
+
"aria-label": localizationService.toLanguageString(numericIncreaseValue, messages[numericIncreaseValue]),
|
|
631
|
+
title: localizationService.toLanguageString(numericIncreaseValue, messages[numericIncreaseValue]),
|
|
632
|
+
onClick: this.increase,
|
|
633
|
+
on: this.v3 ? undefined : {
|
|
634
|
+
"click": this.increase
|
|
635
|
+
}
|
|
636
|
+
}), // @ts-ignore
|
|
637
|
+
h(KButton, {
|
|
638
|
+
type: "button",
|
|
639
|
+
attrs: this.v3 ? undefined : {
|
|
640
|
+
type: "button",
|
|
641
|
+
tabIndex: -1,
|
|
642
|
+
icon: 'arrow-s',
|
|
643
|
+
"aria-label": localizationService.toLanguageString(numericDecreaseValue, messages[numericDecreaseValue]),
|
|
644
|
+
title: localizationService.toLanguageString(numericDecreaseValue, messages[numericDecreaseValue])
|
|
645
|
+
},
|
|
646
|
+
tabIndex: -1,
|
|
647
|
+
"class": "k-spinner-decrease",
|
|
648
|
+
icon: 'arrow-s',
|
|
649
|
+
"aria-label": localizationService.toLanguageString(numericDecreaseValue, messages[numericDecreaseValue]),
|
|
650
|
+
title: localizationService.toLanguageString(numericDecreaseValue, messages[numericDecreaseValue]),
|
|
651
|
+
onClick: this.decrease,
|
|
652
|
+
on: this.v3 ? undefined : {
|
|
653
|
+
"click": this.decrease
|
|
654
|
+
}
|
|
655
|
+
})])]);
|
|
656
|
+
return this.$props.label ? h("span", {
|
|
657
|
+
"class": this.spanClassNames,
|
|
658
|
+
onFocusin: this.handleFocus,
|
|
659
|
+
on: this.v3 ? undefined : {
|
|
660
|
+
"focusin": this.handleFocus,
|
|
661
|
+
"focusout": this.handleBlur
|
|
662
|
+
},
|
|
663
|
+
onFocusout: this.handleBlur,
|
|
664
|
+
dir: this.$props.dir,
|
|
665
|
+
attrs: this.v3 ? undefined : {
|
|
666
|
+
dir: this.$props.dir
|
|
667
|
+
}
|
|
668
|
+
}, [numerictextbox, this.$props.label ? inputId ? h("label", {
|
|
669
|
+
"for": inputId,
|
|
670
|
+
attrs: this.v3 ? undefined : {
|
|
671
|
+
"for": inputId
|
|
672
|
+
},
|
|
673
|
+
"class": "k-label"
|
|
674
|
+
}, [this.$props.label]) : h("span", {
|
|
675
|
+
"class": "k-label"
|
|
676
|
+
}, [this.$props.label]) : null]) : numerictextbox;
|
|
677
|
+
}
|
|
678
|
+
};
|
|
679
|
+
/**
|
|
680
|
+
* @hidden
|
|
681
|
+
*/
|
|
682
|
+
|
|
683
|
+
var NumericTextBox = NumericTextBoxVue2;
|
|
684
|
+
export { NumericTextBox, NumericTextBoxVue2 };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @hidden
|
|
3
|
+
*/
|
|
4
|
+
export interface NumericTextBoxData {
|
|
5
|
+
eventValue: number | null | undefined;
|
|
6
|
+
prevLooseValue: string | undefined;
|
|
7
|
+
currentLooseValue: string | undefined;
|
|
8
|
+
selectionStart: number | undefined;
|
|
9
|
+
selectionEnd: number | undefined;
|
|
10
|
+
decimalSelect: boolean;
|
|
11
|
+
valueIsCorrected: boolean;
|
|
12
|
+
valueIsOutOfRange: boolean;
|
|
13
|
+
focused: boolean;
|
|
14
|
+
isPaste: boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|