@progress/kendo-vue-inputs 2.7.3 → 3.0.0-dev.202201141128
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/additionalTypes.ts +7 -1
- package/dist/es/checkbox/Checkbox.d.ts +5 -6
- package/dist/es/checkbox/Checkbox.js +38 -22
- package/dist/es/checkbox/interfaces/CheckboxProps.d.ts +24 -0
- package/dist/es/colors/ColorPalette.d.ts +6 -6
- package/dist/es/colors/ColorPalette.js +12 -4
- package/dist/es/colors/ColorPicker.d.ts +5 -6
- package/dist/es/colors/ColorPicker.js +66 -58
- package/dist/es/colors/Picker.d.ts +5 -6
- package/dist/es/colors/Picker.js +3 -3
- package/dist/es/colors/interfaces/ColorPickerProps.d.ts +2 -2
- package/dist/es/input/Input.d.ts +43 -7
- package/dist/es/input/Input.js +46 -23
- package/dist/es/main.d.ts +1 -1
- package/dist/es/main.js +1 -1
- package/dist/es/maskedtextbox/MaskedTextBox.d.ts +5 -6
- package/dist/es/maskedtextbox/MaskedTextBox.js +37 -13
- package/dist/es/maskedtextbox/MaskedTextBoxProps.d.ts +37 -0
- package/dist/es/numerictextbox/NumericTextBox.d.ts +5 -6
- package/dist/es/numerictextbox/NumericTextBox.js +60 -36
- package/dist/es/numerictextbox/interfaces/NumericTextBoxProps.d.ts +37 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/radiobutton/RadioButton.d.ts +5 -6
- package/dist/es/radiobutton/RadioButton.js +13 -8
- package/dist/es/radiobutton/RadioGroup.d.ts +5 -6
- package/dist/es/radiobutton/RadioGroup.js +3 -3
- package/dist/es/radiobutton/interfaces/RadioButtonProps.d.ts +12 -0
- package/dist/es/slider/Slider.d.ts +5 -6
- package/dist/es/slider/Slider.js +30 -25
- package/dist/es/slider/SliderLabel.d.ts +5 -6
- package/dist/es/slider/SliderLabel.js +3 -3
- package/dist/es/switch/Switch.d.ts +49 -6
- package/dist/es/switch/Switch.js +59 -27
- package/dist/es/textarea/TextArea.d.ts +5 -6
- package/dist/es/textarea/TextArea.js +40 -11
- package/dist/es/textarea/interfaces/TextAreaProps.d.ts +37 -0
- package/dist/npm/additionalTypes.ts +7 -1
- package/dist/npm/checkbox/Checkbox.d.ts +5 -6
- package/dist/npm/checkbox/Checkbox.js +39 -23
- package/dist/npm/checkbox/interfaces/CheckboxProps.d.ts +24 -0
- package/dist/npm/colors/ColorPalette.d.ts +6 -6
- package/dist/npm/colors/ColorPalette.js +13 -5
- package/dist/npm/colors/ColorPicker.d.ts +5 -6
- package/dist/npm/colors/ColorPicker.js +68 -60
- package/dist/npm/colors/Picker.d.ts +5 -6
- package/dist/npm/colors/Picker.js +5 -5
- package/dist/npm/colors/interfaces/ColorPickerProps.d.ts +2 -2
- package/dist/npm/input/Input.d.ts +43 -7
- package/dist/npm/input/Input.js +47 -24
- package/dist/npm/main.d.ts +1 -1
- package/dist/npm/main.js +1 -0
- package/dist/npm/maskedtextbox/MaskedTextBox.d.ts +5 -6
- package/dist/npm/maskedtextbox/MaskedTextBox.js +38 -14
- package/dist/npm/maskedtextbox/MaskedTextBoxProps.d.ts +37 -0
- package/dist/npm/numerictextbox/NumericTextBox.d.ts +5 -6
- package/dist/npm/numerictextbox/NumericTextBox.js +62 -37
- package/dist/npm/numerictextbox/interfaces/NumericTextBoxProps.d.ts +37 -0
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/radiobutton/RadioButton.d.ts +5 -6
- package/dist/npm/radiobutton/RadioButton.js +14 -9
- package/dist/npm/radiobutton/RadioGroup.d.ts +5 -6
- package/dist/npm/radiobutton/RadioGroup.js +5 -5
- package/dist/npm/radiobutton/interfaces/RadioButtonProps.d.ts +12 -0
- package/dist/npm/slider/Slider.d.ts +5 -6
- package/dist/npm/slider/Slider.js +33 -27
- package/dist/npm/slider/SliderLabel.d.ts +5 -6
- package/dist/npm/slider/SliderLabel.js +5 -5
- package/dist/npm/switch/Switch.d.ts +49 -6
- package/dist/npm/switch/Switch.js +60 -28
- package/dist/npm/textarea/TextArea.d.ts +5 -6
- package/dist/npm/textarea/TextArea.js +41 -12
- package/dist/npm/textarea/interfaces/TextAreaProps.d.ts +37 -0
- package/package.json +10 -9
package/dist/es/input/Input.js
CHANGED
|
@@ -19,14 +19,13 @@ import * as Vue from 'vue';
|
|
|
19
19
|
var allVue = Vue;
|
|
20
20
|
var gh = allVue.h;
|
|
21
21
|
var ref = allVue.ref;
|
|
22
|
-
import { guid, noop, validatePackage } from '@progress/kendo-vue-common';
|
|
22
|
+
import { guid, noop, validatePackage, kendoThemeMaps } from '@progress/kendo-vue-common';
|
|
23
23
|
import { packageMetadata } from '../package-metadata';
|
|
24
24
|
import { FloatingLabel } from '@progress/kendo-vue-labels';
|
|
25
|
-
var
|
|
25
|
+
var InputVue2 = {
|
|
26
26
|
model: {
|
|
27
27
|
event: 'changemodel'
|
|
28
28
|
},
|
|
29
|
-
inheritAttrs: false,
|
|
30
29
|
// @ts-ignore
|
|
31
30
|
emits: {
|
|
32
31
|
'input': null,
|
|
@@ -58,6 +57,27 @@ var Input = {
|
|
|
58
57
|
type: Boolean,
|
|
59
58
|
default: false
|
|
60
59
|
},
|
|
60
|
+
size: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: 'medium',
|
|
63
|
+
validator: function validator(value) {
|
|
64
|
+
return [null, 'small', 'medium', 'large'].includes(value);
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
rounded: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: 'medium',
|
|
70
|
+
validator: function validator(value) {
|
|
71
|
+
return [null, 'small', 'medium', 'large'].includes(value);
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
fillMode: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: 'solid',
|
|
77
|
+
validator: function validator(value) {
|
|
78
|
+
return [null, 'solid', 'flat', 'outline'].includes(value);
|
|
79
|
+
}
|
|
80
|
+
},
|
|
61
81
|
dir: {
|
|
62
82
|
type: String
|
|
63
83
|
},
|
|
@@ -116,12 +136,6 @@ var Input = {
|
|
|
116
136
|
var h = gh || createElement;
|
|
117
137
|
var listeners = this.v3 ? this.$attrs : this.$listeners;
|
|
118
138
|
var isValid = !this.$props.validityStyles || this.validity().valid;
|
|
119
|
-
var hasInput = Object.keys(this.$attrs).some(function (attr) {
|
|
120
|
-
return attr === 'onInput';
|
|
121
|
-
});
|
|
122
|
-
var hasModel = Object.keys(this.$attrs).some(function (attr) {
|
|
123
|
-
return attr === 'onUpdate:modelValue';
|
|
124
|
-
});
|
|
125
139
|
var _a = this.$props,
|
|
126
140
|
label = _a.label,
|
|
127
141
|
id = _a.id,
|
|
@@ -139,7 +153,7 @@ var Input = {
|
|
|
139
153
|
id: inputId,
|
|
140
154
|
required: required,
|
|
141
155
|
value: this.computedValue,
|
|
142
|
-
class:
|
|
156
|
+
class: 'k-input-inner',
|
|
143
157
|
ref: this.v3 ? function (el) {
|
|
144
158
|
_this.inputRef = el;
|
|
145
159
|
} : 'input',
|
|
@@ -158,6 +172,9 @@ var Input = {
|
|
|
158
172
|
onAnimationstart: this.handleAutoFill,
|
|
159
173
|
onAnimationend: this.handleAutoFillEnd
|
|
160
174
|
}));
|
|
175
|
+
var inputWrapper = h("span", {
|
|
176
|
+
"class": this.inputWrapperClass
|
|
177
|
+
}, [textbox]);
|
|
161
178
|
return label ? // @ts-ignore function children
|
|
162
179
|
h(FloatingLabel, {
|
|
163
180
|
label: label,
|
|
@@ -177,8 +194,8 @@ var Input = {
|
|
|
177
194
|
editorPlaceholder: this.$data.focused ? this.$props.placeholder : '',
|
|
178
195
|
dir: this.$props.dir
|
|
179
196
|
}, this.v3 ? function () {
|
|
180
|
-
return [
|
|
181
|
-
} : [
|
|
197
|
+
return [inputWrapper];
|
|
198
|
+
} : [inputWrapper]) : inputWrapper;
|
|
182
199
|
},
|
|
183
200
|
methods: {
|
|
184
201
|
emitFocus: function emitFocus(e) {
|
|
@@ -194,13 +211,6 @@ var Input = {
|
|
|
194
211
|
this.$data.input.focus();
|
|
195
212
|
}
|
|
196
213
|
},
|
|
197
|
-
inputClassNames: function inputClassNames() {
|
|
198
|
-
var isValid = !this.$data.hasMounted || !this.$props.validityStyles || this.validity().valid;
|
|
199
|
-
return {
|
|
200
|
-
'k-textbox': true,
|
|
201
|
-
'k-state-invalid': !isValid && isValid !== undefined
|
|
202
|
-
};
|
|
203
|
-
},
|
|
204
214
|
validity: function validity() {
|
|
205
215
|
var result = {
|
|
206
216
|
badInput: this.$data.input ? this.$data.input.validity.badInput : false,
|
|
@@ -296,14 +306,27 @@ var Input = {
|
|
|
296
306
|
var isValid = !this.$data.hasMounted || !this.$props.validityStyles || this.validity().valid;
|
|
297
307
|
return {
|
|
298
308
|
'k-floating-label-container': true,
|
|
299
|
-
'k-
|
|
309
|
+
'k-focus': this.$data.focused,
|
|
300
310
|
'k-state-empty': !((this.computedValue === 0 ? true : this.computedValue) || this.$props.placeholder || this.$data.autofill),
|
|
301
311
|
'k-autofill': this.$data.autofill,
|
|
302
|
-
'k-
|
|
312
|
+
'k-invalid': !isValid && isValid !== undefined,
|
|
303
313
|
'k-rtl': this.$props.dir === 'rtl'
|
|
304
314
|
};
|
|
305
315
|
}
|
|
306
316
|
},
|
|
317
|
+
inputWrapperClass: function inputWrapperClass() {
|
|
318
|
+
var _a;
|
|
319
|
+
|
|
320
|
+
var _b = this.$props,
|
|
321
|
+
size = _b.size,
|
|
322
|
+
fillMode = _b.fillMode,
|
|
323
|
+
rounded = _b.rounded;
|
|
324
|
+
var isValid = !this.$data.hasMounted || !this.$props.validityStyles || this.validity().valid;
|
|
325
|
+
return _a = {
|
|
326
|
+
'k-textbox': true,
|
|
327
|
+
'k-input': true
|
|
328
|
+
}, _a["k-input-" + (kendoThemeMaps.sizeMap[size] || size)] = size, _a["k-input-" + fillMode] = fillMode, _a["k-rounded-" + (kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded, _a['k-valid'] = isValid, _a['k-invalid'] = !isValid, _a['k-required'] = this.required, _a['k-disabled'] = this.$props.disabled, _a;
|
|
329
|
+
},
|
|
307
330
|
computedValue: {
|
|
308
331
|
get: function get() {
|
|
309
332
|
return this.$data.valueDuringOnChange !== undefined ? this.$data.valueDuringOnChange : this.$props.value !== undefined ? this.$props.value : this.$props.modelValue !== undefined ? this.$props.modelValue : this.$data.currentValue;
|
|
@@ -311,5 +334,5 @@ var Input = {
|
|
|
311
334
|
}
|
|
312
335
|
}
|
|
313
336
|
};
|
|
314
|
-
var
|
|
315
|
-
export { Input,
|
|
337
|
+
var Input = InputVue2;
|
|
338
|
+
export { Input, InputVue2 };
|
package/dist/es/main.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export * from './colors/interfaces/ColorPickerFocusEvent';
|
|
|
10
10
|
export * from './colors/interfaces/ColorPickerPaletteSettings';
|
|
11
11
|
export * from './colors/interfaces/ColorPickerPopupSettings';
|
|
12
12
|
export * from './colors/interfaces/ColorPickerProps';
|
|
13
|
-
export { Switch, SwitchProps, SwitchState, SwitchChangeEvent } from './switch/Switch';
|
|
13
|
+
export { Switch, SwitchVue2, SwitchProps, SwitchState, SwitchChangeEvent } from './switch/Switch';
|
|
14
14
|
export * from './input/Input';
|
|
15
15
|
export * from './numerictextbox/NumericTextBox';
|
|
16
16
|
export * from './maskedtextbox/MaskedTextBox';
|
package/dist/es/main.js
CHANGED
|
@@ -8,7 +8,7 @@ export * from './colors/interfaces/ColorPickerFocusEvent';
|
|
|
8
8
|
export * from './colors/interfaces/ColorPickerPaletteSettings';
|
|
9
9
|
export * from './colors/interfaces/ColorPickerPopupSettings';
|
|
10
10
|
export * from './colors/interfaces/ColorPickerProps';
|
|
11
|
-
export { Switch } from './switch/Switch';
|
|
11
|
+
export { Switch, SwitchVue2 } from './switch/Switch';
|
|
12
12
|
export * from './input/Input';
|
|
13
13
|
export * from './numerictextbox/NumericTextBox';
|
|
14
14
|
export * from './maskedtextbox/MaskedTextBox';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { DefineComponent } from '../additionalTypes';
|
|
2
|
-
import { RecordPropsDefinition, ComponentOptions } from 'vue/types/options';
|
|
1
|
+
import { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type } from '../additionalTypes';
|
|
3
2
|
declare type DefaultData<V> = object | ((this: V) => MaskedTextBoxData);
|
|
4
3
|
declare type DefaultMethods<V> = {
|
|
5
4
|
[key: string]: (this: V, ...args: any[]) => any;
|
|
@@ -40,7 +39,7 @@ interface MaskedTextBoxState {
|
|
|
40
39
|
/**
|
|
41
40
|
* @hidden
|
|
42
41
|
*/
|
|
43
|
-
export interface MaskedTextBoxMethods extends
|
|
42
|
+
export interface MaskedTextBoxMethods extends Vue2type {
|
|
44
43
|
focus: (e: any) => void;
|
|
45
44
|
computedValue: () => any;
|
|
46
45
|
rawValue: () => string;
|
|
@@ -69,6 +68,6 @@ export interface MaskedTextBoxAll extends MaskedTextBoxMethods, MaskedTextBoxSta
|
|
|
69
68
|
/**
|
|
70
69
|
* Represents the default `MaskedTextBox` component.
|
|
71
70
|
*/
|
|
72
|
-
declare let
|
|
73
|
-
declare const
|
|
74
|
-
export { MaskedTextBox,
|
|
71
|
+
declare let MaskedTextBoxVue2: ComponentOptions<Vue2type, DefaultData<MaskedTextBoxData>, DefaultMethods<MaskedTextBoxAll>, MaskedTextBoxComputed, RecordPropsDefinition<MaskedTextBoxProps>>;
|
|
72
|
+
declare const MaskedTextBox: DefineComponent<MaskedTextBoxProps, any, MaskedTextBoxData, MaskedTextBoxComputed, MaskedTextBoxMethods, {}, {}, {}, string, MaskedTextBoxProps, MaskedTextBoxProps, {}>;
|
|
73
|
+
export { MaskedTextBox, MaskedTextBoxVue2 };
|
|
@@ -5,13 +5,13 @@ var gh = allVue.h;
|
|
|
5
5
|
var ref = allVue.ref;
|
|
6
6
|
import { MaskingService } from './masking.service';
|
|
7
7
|
import { defaultRules, maskingChanged, returnFalse } from './utils';
|
|
8
|
-
import { guid, classNames, getTabIndex, validatePackage } from '@progress/kendo-vue-common';
|
|
8
|
+
import { guid, classNames, getTabIndex, validatePackage, kendoThemeMaps } from '@progress/kendo-vue-common';
|
|
9
9
|
import { packageMetadata } from '../package-metadata';
|
|
10
10
|
/**
|
|
11
11
|
* Represents the default `MaskedTextBox` component.
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var MaskedTextBoxVue2 = {
|
|
15
15
|
model: {
|
|
16
16
|
event: 'changemodel'
|
|
17
17
|
},
|
|
@@ -30,6 +30,27 @@ var MaskedTextBox = {
|
|
|
30
30
|
accessKey: String,
|
|
31
31
|
disabled: Boolean,
|
|
32
32
|
readonly: Boolean,
|
|
33
|
+
size: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: 'medium',
|
|
36
|
+
validator: function validator(value) {
|
|
37
|
+
return [null, 'small', 'medium', 'large'].includes(value);
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
rounded: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: 'medium',
|
|
43
|
+
validator: function validator(value) {
|
|
44
|
+
return [null, 'small', 'medium', 'large', 'full'].includes(value);
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
fillMode: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: 'solid',
|
|
50
|
+
validator: function validator(value) {
|
|
51
|
+
return [null, 'solid', 'flat', 'outline'].includes(value);
|
|
52
|
+
}
|
|
53
|
+
},
|
|
33
54
|
prompt: {
|
|
34
55
|
type: String,
|
|
35
56
|
default: '_'
|
|
@@ -168,10 +189,10 @@ var MaskedTextBox = {
|
|
|
168
189
|
get: function get() {
|
|
169
190
|
var isValid = !this.hasMounted || !this.$props.validityStyles || this.validity().valid;
|
|
170
191
|
return {
|
|
171
|
-
'k-
|
|
172
|
-
'k-
|
|
192
|
+
'k-floating-label-container': true,
|
|
193
|
+
'k-focus': this.currentFocused,
|
|
173
194
|
'k-state-empty': !this.computedValue(),
|
|
174
|
-
'k-
|
|
195
|
+
'k-invalid': !isValid && isValid !== undefined,
|
|
175
196
|
'k-rtl': this.$props.dir === 'rtl'
|
|
176
197
|
};
|
|
177
198
|
}
|
|
@@ -311,11 +332,18 @@ var MaskedTextBox = {
|
|
|
311
332
|
}
|
|
312
333
|
}
|
|
313
334
|
},
|
|
335
|
+
// @ts-ignore
|
|
314
336
|
render: function render(createElement) {
|
|
337
|
+
var _a;
|
|
338
|
+
|
|
315
339
|
var _this = this;
|
|
316
340
|
|
|
317
341
|
var h = gh || createElement;
|
|
318
342
|
var inputId = this.$props.id || this.inputId;
|
|
343
|
+
var _b = this.$props,
|
|
344
|
+
size = _b.size,
|
|
345
|
+
fillMode = _b.fillMode,
|
|
346
|
+
rounded = _b.rounded;
|
|
319
347
|
var isValid = !this.hasMounted || !this.$props.validityStyles || this.validity().valid;
|
|
320
348
|
var newValue = this.computedValue();
|
|
321
349
|
var inputValue = this.inputValue;
|
|
@@ -324,11 +352,7 @@ var MaskedTextBox = {
|
|
|
324
352
|
attrs: this.v3 ? undefined : {
|
|
325
353
|
dir: this.$props.dir
|
|
326
354
|
},
|
|
327
|
-
"class": classNames('k-
|
|
328
|
-
'k-state-focused': this.currentFocused,
|
|
329
|
-
'k-state-disabled': this.$props.disabled,
|
|
330
|
-
'k-state-invalid': !isValid
|
|
331
|
-
}),
|
|
355
|
+
"class": classNames('k-maskedtextbox k-input', (_a = {}, _a["k-input-" + (kendoThemeMaps.sizeMap[size] || size)] = size, _a["k-input-" + fillMode] = fillMode, _a["k-rounded-" + (kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded, _a['k-valid'] = isValid, _a['k-invalid'] = !isValid, _a['k-required'] = this.required, _a['k-disabled'] = this.$props.disabled, _a)),
|
|
332
356
|
style: !this.$props.label ? {
|
|
333
357
|
width: this.$props.width
|
|
334
358
|
} : undefined
|
|
@@ -355,7 +379,7 @@ var MaskedTextBox = {
|
|
|
355
379
|
autoCorrect: "off",
|
|
356
380
|
autoCapitalize: "off",
|
|
357
381
|
spellCheck: false,
|
|
358
|
-
"class": "k-
|
|
382
|
+
"class": "k-input k-input-inner",
|
|
359
383
|
value: this.v3 ? newValue : null,
|
|
360
384
|
domProps: this.v3 ? undefined : {
|
|
361
385
|
"value": newValue
|
|
@@ -405,5 +429,5 @@ var MaskedTextBox = {
|
|
|
405
429
|
}, [this.$props.label]) : null]) : component;
|
|
406
430
|
}
|
|
407
431
|
};
|
|
408
|
-
var
|
|
409
|
-
export { MaskedTextBox,
|
|
432
|
+
var MaskedTextBox = MaskedTextBoxVue2;
|
|
433
|
+
export { MaskedTextBox, MaskedTextBoxVue2 };
|
|
@@ -53,6 +53,43 @@ export interface MaskedTextBoxProps extends FormComponentProps {
|
|
|
53
53
|
* Represents the `dir` HTML attribute.
|
|
54
54
|
*/
|
|
55
55
|
dir?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Configures the `size` of the MaskedTextBox.
|
|
58
|
+
*
|
|
59
|
+
* The available options are:
|
|
60
|
+
* - small
|
|
61
|
+
* - medium
|
|
62
|
+
* - large
|
|
63
|
+
* - null—Does not set a size `class`.
|
|
64
|
+
*
|
|
65
|
+
* @default `medium`
|
|
66
|
+
*/
|
|
67
|
+
size?: null | 'small' | 'medium' | 'large' | string;
|
|
68
|
+
/**
|
|
69
|
+
* Configures the `roundness` of the MaskedTextBox.
|
|
70
|
+
*
|
|
71
|
+
* The available options are:
|
|
72
|
+
* - small
|
|
73
|
+
* - medium
|
|
74
|
+
* - large
|
|
75
|
+
* - full
|
|
76
|
+
* - null—Does not set a rounded `class`.
|
|
77
|
+
*
|
|
78
|
+
* @default `medium`
|
|
79
|
+
*/
|
|
80
|
+
rounded?: null | 'small' | 'medium' | 'large' | 'full' | string;
|
|
81
|
+
/**
|
|
82
|
+
* Configures the `fillMode` of the MaskedTextBox.
|
|
83
|
+
*
|
|
84
|
+
* The available options are:
|
|
85
|
+
* - solid
|
|
86
|
+
* - outline
|
|
87
|
+
* - flat
|
|
88
|
+
* - null—Does not set a fillMode `class`.
|
|
89
|
+
*
|
|
90
|
+
* @default `solid`
|
|
91
|
+
*/
|
|
92
|
+
fillMode?: null | 'solid' | 'flat' | 'outline' | string;
|
|
56
93
|
/**
|
|
57
94
|
* Sets the `tabIndex` property of the MaskedTextBox.
|
|
58
95
|
*/
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { DefineComponent } from '../additionalTypes';
|
|
2
|
-
import { RecordPropsDefinition, ComponentOptions } from 'vue/types/options';
|
|
1
|
+
import { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type } from '../additionalTypes';
|
|
3
2
|
import { NumericTextBoxData } from './interfaces/NumericTextBoxData';
|
|
4
3
|
import { NumericTextBoxProps } from './interfaces/NumericTextBoxProps';
|
|
5
4
|
declare type DefaultData<V> = object | ((this: V) => NumericTextBoxData);
|
|
@@ -71,8 +70,8 @@ export interface NumericTextBoxComputed {
|
|
|
71
70
|
/**
|
|
72
71
|
* @hidden
|
|
73
72
|
*/
|
|
74
|
-
export interface NumericTextBoxAll extends
|
|
73
|
+
export interface NumericTextBoxAll extends Vue2type, NumericTextBoxMethods, NumericTextBoxComputed, NumericTextBoxState {
|
|
75
74
|
}
|
|
76
|
-
declare let
|
|
77
|
-
declare const
|
|
78
|
-
export { NumericTextBox,
|
|
75
|
+
declare let NumericTextBoxVue2: ComponentOptions<NumericTextBoxAll, DefaultData<NumericTextBoxData>, DefaultMethods<NumericTextBoxAll>, NumericTextBoxComputed, RecordPropsDefinition<NumericTextBoxProps>>;
|
|
76
|
+
declare const NumericTextBox: DefineComponent<NumericTextBoxProps, any, NumericTextBoxData, NumericTextBoxComputed, NumericTextBoxMethods, {}, {}, {}, string, NumericTextBoxProps, NumericTextBoxProps, {}>;
|
|
77
|
+
export { NumericTextBox, NumericTextBoxVue2 };
|
|
@@ -4,14 +4,15 @@ var allVue = Vue;
|
|
|
4
4
|
var gh = allVue.h;
|
|
5
5
|
var ref = allVue.ref;
|
|
6
6
|
var inject = allVue.inject;
|
|
7
|
-
import { canUseDOM, getDefaultSlots } from '@progress/kendo-vue-common';
|
|
7
|
+
import { canUseDOM, getDefaultSlots, kendoThemeMaps } from '@progress/kendo-vue-common';
|
|
8
8
|
import { provideIntlService, provideLocalizationService } from '@progress/kendo-vue-intl';
|
|
9
9
|
import { guid, validatePackage } from '@progress/kendo-vue-common';
|
|
10
|
+
import { Button as KButton } from '@progress/kendo-vue-buttons';
|
|
10
11
|
import { messages, numericIncreaseValue, numericDecreaseValue } from './../messages';
|
|
11
12
|
import { formatValue, sanitizeNumber, rangeValue, increaseValue, decreaseValue, getStateOrPropsValue } from './utils';
|
|
12
13
|
import { packageMetadata } from '../package-metadata';
|
|
13
14
|
var VALIDATION_MESSAGE = 'Please enter a valid value!';
|
|
14
|
-
var
|
|
15
|
+
var NumericTextBoxVue2 = {
|
|
15
16
|
model: {
|
|
16
17
|
event: 'changemodel'
|
|
17
18
|
},
|
|
@@ -59,6 +60,27 @@ var NumericTextBox = {
|
|
|
59
60
|
type: Boolean,
|
|
60
61
|
default: undefined
|
|
61
62
|
},
|
|
63
|
+
size: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: 'medium',
|
|
66
|
+
validator: function validator(value) {
|
|
67
|
+
return [null, 'small', 'medium', 'large'].includes(value);
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
rounded: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: 'medium',
|
|
73
|
+
validator: function validator(value) {
|
|
74
|
+
return [null, 'small', 'medium', 'large', 'full'].includes(value);
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
fillMode: {
|
|
78
|
+
type: String,
|
|
79
|
+
default: 'solid',
|
|
80
|
+
validator: function validator(value) {
|
|
81
|
+
return [null, 'solid', 'flat', 'outline'].includes(value);
|
|
82
|
+
}
|
|
83
|
+
},
|
|
62
84
|
required: {
|
|
63
85
|
type: Boolean,
|
|
64
86
|
default: false
|
|
@@ -154,23 +176,27 @@ var NumericTextBox = {
|
|
|
154
176
|
var compValue = this.computedValue;
|
|
155
177
|
return {
|
|
156
178
|
'k-floating-label-container': true,
|
|
157
|
-
'k-
|
|
179
|
+
'k-focus': this.$data.focused,
|
|
158
180
|
'k-state-empty': !(compValue === 0 ? true : compValue || this.$props.placeholder),
|
|
159
|
-
'k-
|
|
181
|
+
'k-invalid': !isValid && isValid !== undefined,
|
|
160
182
|
'k-rtl': this.$props.dir === 'rtl'
|
|
161
183
|
};
|
|
162
184
|
}
|
|
163
185
|
},
|
|
164
|
-
wrapperClassNames: {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
186
|
+
wrapperClassNames: function wrapperClassNames() {
|
|
187
|
+
var _a;
|
|
188
|
+
|
|
189
|
+
var _b = this.$props,
|
|
190
|
+
size = _b.size,
|
|
191
|
+
fillMode = _b.fillMode,
|
|
192
|
+
rounded = _b.rounded,
|
|
193
|
+
required = _b.required,
|
|
194
|
+
disabled = _b.disabled;
|
|
195
|
+
var isValid = !this.$props.validityStyles || this.validity().valid;
|
|
196
|
+
return _a = {
|
|
197
|
+
'k-input': true,
|
|
198
|
+
'k-numerictextbox': true
|
|
199
|
+
}, _a["k-input-" + (kendoThemeMaps.sizeMap[size] || size)] = size, _a["k-input-" + fillMode] = fillMode, _a["k-rounded-" + (kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded, _a['k-valid'] = isValid, _a['k-invalid'] = !isValid, _a['k-required'] = required, _a['k-disabled'] = disabled, _a;
|
|
174
200
|
}
|
|
175
201
|
},
|
|
176
202
|
methods: {
|
|
@@ -266,7 +292,7 @@ var NumericTextBox = {
|
|
|
266
292
|
if (newState.valueIsCorrected) {
|
|
267
293
|
var wrapper = this._elementWrapper;
|
|
268
294
|
|
|
269
|
-
if (wrapper && wrapper.className.indexOf("k-
|
|
295
|
+
if (wrapper && wrapper.className.indexOf("k-invalid") === -1) {
|
|
270
296
|
this.$data.isInvalid = true;
|
|
271
297
|
setTimeout(function () {
|
|
272
298
|
_this.$data.isInvalid = false;
|
|
@@ -438,13 +464,9 @@ var NumericTextBox = {
|
|
|
438
464
|
dir: this.$props.dir,
|
|
439
465
|
"aria-disabled": this.$props.disabled ? 'true' : undefined
|
|
440
466
|
},
|
|
441
|
-
"class": 'k-widget k-numerictextbox',
|
|
442
|
-
"aria-disabled": this.$props.disabled ? 'true' : undefined
|
|
443
|
-
}, [h("span", {
|
|
444
467
|
"class": this.wrapperClassNames,
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
} : 'elementWrapper'
|
|
468
|
+
"aria-disabled": this.$props.disabled ? 'true' : undefined,
|
|
469
|
+
style: this.$attrs.style
|
|
448
470
|
}, [h("input", {
|
|
449
471
|
tabIndex: this.$props.tabIndex,
|
|
450
472
|
attrs: this.v3 ? undefined : {
|
|
@@ -473,7 +495,7 @@ var NumericTextBox = {
|
|
|
473
495
|
spellCheck: false,
|
|
474
496
|
autoComplete: "off",
|
|
475
497
|
autoCorrect: "off",
|
|
476
|
-
"class": "k-input k-
|
|
498
|
+
"class": "k-input k-input-inner",
|
|
477
499
|
id: inputId,
|
|
478
500
|
value: this.v3 ? this.looseValue : null,
|
|
479
501
|
domProps: this.v3 ? undefined : {
|
|
@@ -499,40 +521,42 @@ var NumericTextBox = {
|
|
|
499
521
|
_this.inputRef = el;
|
|
500
522
|
} : 'input'
|
|
501
523
|
}), defaultSlot, this.$props.spinners && h("span", {
|
|
502
|
-
"class": "k-
|
|
524
|
+
"class": "k-input-spinner k-spin-button",
|
|
503
525
|
onMousedown: this.spinnersWrapperMouseDown,
|
|
504
526
|
on: this.v3 ? undefined : {
|
|
505
527
|
"mousedown": this.spinnersWrapperMouseDown
|
|
506
528
|
}
|
|
507
|
-
}, [
|
|
508
|
-
|
|
509
|
-
|
|
529
|
+
}, [// @ts-ignore
|
|
530
|
+
h(KButton, {
|
|
531
|
+
icon: 'arrow-n',
|
|
510
532
|
attrs: this.v3 ? undefined : {
|
|
533
|
+
icon: 'arrow-n',
|
|
511
534
|
"aria-label": localizationService.toLanguageString(numericIncreaseValue, messages[numericIncreaseValue]),
|
|
512
535
|
title: localizationService.toLanguageString(numericIncreaseValue, messages[numericIncreaseValue])
|
|
513
536
|
},
|
|
537
|
+
"class": "k-spinner-increase",
|
|
538
|
+
"aria-label": localizationService.toLanguageString(numericIncreaseValue, messages[numericIncreaseValue]),
|
|
514
539
|
title: localizationService.toLanguageString(numericIncreaseValue, messages[numericIncreaseValue]),
|
|
515
540
|
onClick: this.increase,
|
|
516
541
|
on: this.v3 ? undefined : {
|
|
517
542
|
"click": this.increase
|
|
518
543
|
}
|
|
519
|
-
},
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
"aria-label": localizationService.toLanguageString(numericDecreaseValue, messages[numericDecreaseValue]),
|
|
544
|
+
}), // @ts-ignore
|
|
545
|
+
h(KButton, {
|
|
546
|
+
"class": "k-spinner-decrease",
|
|
547
|
+
icon: 'arrow-s',
|
|
524
548
|
attrs: this.v3 ? undefined : {
|
|
549
|
+
icon: 'arrow-s',
|
|
525
550
|
"aria-label": localizationService.toLanguageString(numericDecreaseValue, messages[numericDecreaseValue]),
|
|
526
551
|
title: localizationService.toLanguageString(numericDecreaseValue, messages[numericDecreaseValue])
|
|
527
552
|
},
|
|
553
|
+
"aria-label": localizationService.toLanguageString(numericDecreaseValue, messages[numericDecreaseValue]),
|
|
528
554
|
title: localizationService.toLanguageString(numericDecreaseValue, messages[numericDecreaseValue]),
|
|
529
555
|
onClick: this.decrease,
|
|
530
556
|
on: this.v3 ? undefined : {
|
|
531
557
|
"click": this.decrease
|
|
532
558
|
}
|
|
533
|
-
}
|
|
534
|
-
"class": "k-icon k-i-arrow-s"
|
|
535
|
-
})])])])]);
|
|
559
|
+
})])]);
|
|
536
560
|
return this.$props.label ? h("span", {
|
|
537
561
|
"class": this.spanClassNames,
|
|
538
562
|
onFocusin: this.handleFocus,
|
|
@@ -556,5 +580,5 @@ var NumericTextBox = {
|
|
|
556
580
|
}, [this.$props.label]) : null]) : numerictextbox;
|
|
557
581
|
}
|
|
558
582
|
};
|
|
559
|
-
var
|
|
560
|
-
export { NumericTextBox,
|
|
583
|
+
var NumericTextBox = NumericTextBoxVue2;
|
|
584
|
+
export { NumericTextBox, NumericTextBoxVue2 };
|
|
@@ -29,6 +29,43 @@ export interface NumericTextBoxProps extends FormComponentProps {
|
|
|
29
29
|
* Sets the `tabIndex` property of the NumericTextBox.
|
|
30
30
|
*/
|
|
31
31
|
tabIndex?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Configures the `size` of the NumericTextBox.
|
|
34
|
+
*
|
|
35
|
+
* The available options are:
|
|
36
|
+
* - small
|
|
37
|
+
* - medium
|
|
38
|
+
* - large
|
|
39
|
+
* - null—Does not set a size `class`.
|
|
40
|
+
*
|
|
41
|
+
* @default `medium`
|
|
42
|
+
*/
|
|
43
|
+
size?: null | 'small' | 'medium' | 'large' | string;
|
|
44
|
+
/**
|
|
45
|
+
* Configures the `roundness` of the NumericTextBox.
|
|
46
|
+
*
|
|
47
|
+
* The available options are:
|
|
48
|
+
* - small
|
|
49
|
+
* - medium
|
|
50
|
+
* - large
|
|
51
|
+
* - full
|
|
52
|
+
* - null—Does not set a rounded `class`.
|
|
53
|
+
*
|
|
54
|
+
* @default `medium`
|
|
55
|
+
*/
|
|
56
|
+
rounded?: null | 'small' | 'medium' | 'large' | 'full' | string;
|
|
57
|
+
/**
|
|
58
|
+
* Configures the `fillMode` of the NumericTextBox.
|
|
59
|
+
*
|
|
60
|
+
* The available options are:
|
|
61
|
+
* - solid
|
|
62
|
+
* - outline
|
|
63
|
+
* - flat
|
|
64
|
+
* - null—Does not set a fillMode `class`.
|
|
65
|
+
*
|
|
66
|
+
* @default `solid`
|
|
67
|
+
*/
|
|
68
|
+
fillMode?: null | 'solid' | 'flat' | 'outline' | string;
|
|
32
69
|
/**
|
|
33
70
|
* Specifies the `accessKey` of the NumericTextBox.
|
|
34
71
|
*/
|
|
@@ -5,7 +5,7 @@ export var packageMetadata = {
|
|
|
5
5
|
name: '@progress/kendo-vue-inputs',
|
|
6
6
|
productName: 'Kendo UI for Vue',
|
|
7
7
|
productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
|
|
8
|
-
publishDate:
|
|
8
|
+
publishDate: 1642158965,
|
|
9
9
|
version: '',
|
|
10
10
|
licensingDocsUrl: 'https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning'
|
|
11
11
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { DefineComponent } from '../additionalTypes';
|
|
2
|
-
import { RecordPropsDefinition, ComponentOptions } from 'vue/types/options';
|
|
1
|
+
import { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type } from '../additionalTypes';
|
|
3
2
|
declare type DefaultData<V> = object | ((this: V) => {});
|
|
4
3
|
declare type DefaultMethods<V> = {
|
|
5
4
|
[key: string]: (this: V, ...args: any[]) => any;
|
|
@@ -43,8 +42,8 @@ export interface RadioButtonComputed {
|
|
|
43
42
|
/**
|
|
44
43
|
* @hidden
|
|
45
44
|
*/
|
|
46
|
-
export interface RadioButtonAll extends
|
|
45
|
+
export interface RadioButtonAll extends Vue2type, RadioButtonMethods, RadioButtonComputed, RadioButtonState, RadioButtonData {
|
|
47
46
|
}
|
|
48
|
-
declare let
|
|
49
|
-
declare let
|
|
50
|
-
export { RadioButton,
|
|
47
|
+
declare let RadioButtonVue2: ComponentOptions<RadioButtonAll, DefaultData<RadioButtonData>, DefaultMethods<RadioButtonAll>, RadioButtonComputed, RecordPropsDefinition<RadioButtonProps>>;
|
|
48
|
+
declare let RadioButton: DefineComponent<RadioButtonProps, any, RadioButtonData, RadioButtonComputed, RadioButtonMethods, {}, {}, {}, string, RadioButtonProps, RadioButtonProps, {}>;
|
|
49
|
+
export { RadioButton, RadioButtonVue2 };
|
|
@@ -4,10 +4,10 @@ var allVue = Vue;
|
|
|
4
4
|
var gh = allVue.h;
|
|
5
5
|
var ref = allVue.ref;
|
|
6
6
|
var inject = allVue.inject;
|
|
7
|
-
import { guid, getTabIndex, getDefaultSlots, templateRendering, getTemplate, getListeners } from '@progress/kendo-vue-common';
|
|
7
|
+
import { guid, getTabIndex, getDefaultSlots, templateRendering, getTemplate, getListeners, kendoThemeMaps } from '@progress/kendo-vue-common';
|
|
8
8
|
import { validatePackage } from '@progress/kendo-vue-common';
|
|
9
9
|
import { packageMetadata } from '../package-metadata';
|
|
10
|
-
var
|
|
10
|
+
var RadioButtonVue2 = {
|
|
11
11
|
name: 'KendoRadioButton',
|
|
12
12
|
props: {
|
|
13
13
|
ariaDescribedBy: String,
|
|
@@ -19,6 +19,13 @@ var RadioButton = {
|
|
|
19
19
|
labelRender: [String, Number, Boolean, Object],
|
|
20
20
|
labelPlacement: String,
|
|
21
21
|
name: String,
|
|
22
|
+
size: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: 'medium',
|
|
25
|
+
validator: function validator(value) {
|
|
26
|
+
return [null, 'small', 'medium', 'large'].includes(value);
|
|
27
|
+
}
|
|
28
|
+
},
|
|
22
29
|
tabIndex: Number,
|
|
23
30
|
value: [String, Number, Object],
|
|
24
31
|
valid: {
|
|
@@ -44,10 +51,8 @@ var RadioButton = {
|
|
|
44
51
|
var _a;
|
|
45
52
|
|
|
46
53
|
return _a = {
|
|
47
|
-
'k-radio': true
|
|
48
|
-
|
|
49
|
-
'k-invalid': this.$props.valid === false
|
|
50
|
-
}, _a[this.$props.className] = this.$props.className, _a;
|
|
54
|
+
'k-radio': true
|
|
55
|
+
}, _a["k-radio-" + kendoThemeMaps.sizeMap[this.$props.size]] = this.$props.size, _a['k-state-invalid'] = this.$props.valid === false, _a['k-invalid'] = this.$props.valid === false, _a[this.$props.className] = this.$props.className, _a;
|
|
51
56
|
}
|
|
52
57
|
},
|
|
53
58
|
methods: {
|
|
@@ -158,5 +163,5 @@ var RadioButton = {
|
|
|
158
163
|
return labelPlacement === 'before' ? h("div", [radioButtonLabel, radio, defaultSlot]) : h("div", [radio, radioButtonLabel, defaultSlot]);
|
|
159
164
|
}
|
|
160
165
|
};
|
|
161
|
-
var
|
|
162
|
-
export { RadioButton,
|
|
166
|
+
var RadioButton = RadioButtonVue2;
|
|
167
|
+
export { RadioButton, RadioButtonVue2 };
|