@progress/kendo-vue-inputs 3.9.1 → 3.9.2-dev.202304050903
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/main.d.ts +1 -0
- package/dist/es/main.js +1 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/textbox/TextBox.d.ts +208 -0
- package/dist/es/textbox/TextBox.js +449 -0
- package/dist/esm/main.d.ts +1 -0
- package/dist/esm/main.js +1 -0
- package/dist/esm/package-metadata.js +1 -1
- package/dist/esm/textbox/TextBox.d.ts +208 -0
- package/dist/esm/textbox/TextBox.js +449 -0
- package/dist/npm/main.d.ts +1 -0
- package/dist/npm/main.js +1 -0
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/textbox/TextBox.d.ts +208 -0
- package/dist/npm/textbox/TextBox.js +456 -0
- package/package.json +13 -13
|
@@ -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: 1680684691,
|
|
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
|
};
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type } from '../additionalTypes';
|
|
2
|
+
import { FormComponentProps } from '@progress/kendo-vue-common';
|
|
3
|
+
declare type DefaultData<V> = object | ((this: V) => TextBoxData);
|
|
4
|
+
declare type DefaultMethods<V> = {
|
|
5
|
+
[key: string]: (this: V, ...args: any[]) => any;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Represents the props of the [Kendo UI for Vue TextBox component]({% slug overview_textbox %}).
|
|
9
|
+
* Extends the [native input props](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextBoxElement).
|
|
10
|
+
*/
|
|
11
|
+
export interface TextBoxProps extends FormComponentProps {
|
|
12
|
+
/**
|
|
13
|
+
* Renders a floating label for the TextBox component.
|
|
14
|
+
*/
|
|
15
|
+
id?: string;
|
|
16
|
+
label?: string;
|
|
17
|
+
value?: string | string[] | number;
|
|
18
|
+
modelValue?: string | number;
|
|
19
|
+
defaultValue?: string | string[] | number | undefined;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
validate?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Configures the `size` of the TextBox.
|
|
24
|
+
*
|
|
25
|
+
* The available options are:
|
|
26
|
+
* - small
|
|
27
|
+
* - medium
|
|
28
|
+
* - large
|
|
29
|
+
* - null—Does not set a size `class`.
|
|
30
|
+
*
|
|
31
|
+
* @default `medium`
|
|
32
|
+
*/
|
|
33
|
+
size?: null | 'small' | 'medium' | 'large' | string;
|
|
34
|
+
/**
|
|
35
|
+
* Configures the `roundness` of the TextBox.
|
|
36
|
+
*
|
|
37
|
+
* The available options are:
|
|
38
|
+
* - small
|
|
39
|
+
* - medium
|
|
40
|
+
* - large
|
|
41
|
+
* - full
|
|
42
|
+
* - null—Does not set a rounded `class`.
|
|
43
|
+
*
|
|
44
|
+
* @default `medium`
|
|
45
|
+
*/
|
|
46
|
+
rounded?: null | 'small' | 'medium' | 'large' | 'full' | string;
|
|
47
|
+
/**
|
|
48
|
+
* Configures the `fillMode` of the TextBox.
|
|
49
|
+
*
|
|
50
|
+
* The available options are:
|
|
51
|
+
* - solid
|
|
52
|
+
* - outline
|
|
53
|
+
* - flat
|
|
54
|
+
* - null—Does not set a fillMode `class`.
|
|
55
|
+
*
|
|
56
|
+
* @default `solid`
|
|
57
|
+
*/
|
|
58
|
+
fillMode?: null | 'solid' | 'flat' | 'outline' | string;
|
|
59
|
+
dir?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Fires when the `change` event of the input is triggered.
|
|
62
|
+
*/
|
|
63
|
+
onChange?: (event: any) => void;
|
|
64
|
+
/**
|
|
65
|
+
* Fires when the `input` event of the input is triggered.
|
|
66
|
+
*/
|
|
67
|
+
onTextBox?: (event: any) => void;
|
|
68
|
+
/**
|
|
69
|
+
* Fires when the input is focused.
|
|
70
|
+
*/
|
|
71
|
+
onFocus?: (event: any) => void;
|
|
72
|
+
/**
|
|
73
|
+
* Fires when the input is blurred.
|
|
74
|
+
*/
|
|
75
|
+
onBlur?: (event: any) => void;
|
|
76
|
+
/**
|
|
77
|
+
* Fires when the 'keyup' input event is triggered.
|
|
78
|
+
*/
|
|
79
|
+
onKeyup?: (event: any) => void;
|
|
80
|
+
/**
|
|
81
|
+
* Fires when the 'keydown' input event is triggered.
|
|
82
|
+
*/
|
|
83
|
+
onKeydown?: (event: any) => void;
|
|
84
|
+
/**
|
|
85
|
+
* Fires when the 'keypress' input event is triggered.
|
|
86
|
+
*/
|
|
87
|
+
onKeypress?: (event: any) => void;
|
|
88
|
+
/**
|
|
89
|
+
* Specifies the placeholder of an `input` element. Used to define if the input is empty.
|
|
90
|
+
*/
|
|
91
|
+
placeholder?: string;
|
|
92
|
+
/**
|
|
93
|
+
* Defines a string prop that controls the input icon.
|
|
94
|
+
*/
|
|
95
|
+
iconName?: String;
|
|
96
|
+
/**
|
|
97
|
+
* Defines if the inputPrefix will be shown. Accepts a slot name, a `render` function, or a Vue component.
|
|
98
|
+
*/
|
|
99
|
+
inputPrefix?: Boolean | String | Object | Function;
|
|
100
|
+
/**
|
|
101
|
+
* Defines if the inputSuffix will be shown. Accepts a slot name, a `render` function, or a Vue component.
|
|
102
|
+
*/
|
|
103
|
+
inputSuffix?: Boolean | String | Object | Function;
|
|
104
|
+
/**
|
|
105
|
+
* Defines a boolean prop that controls whether to show the validation icon. Defaults to 'false'.
|
|
106
|
+
*/
|
|
107
|
+
showValidationIcon?: Boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Defines a boolean prop that controls whether to show the loading icon. Defaults to 'false'.
|
|
110
|
+
*/
|
|
111
|
+
showLoadingIcon?: Boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Defines a boolean prop that controls whether to show the clear icon. Defaults to 'false'.
|
|
114
|
+
*/
|
|
115
|
+
showClearButton?: Boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Defines additional class to the wrapper element.
|
|
118
|
+
*/
|
|
119
|
+
wrapperClass?: String;
|
|
120
|
+
/**
|
|
121
|
+
* Defines tabindex to the input element.
|
|
122
|
+
*/
|
|
123
|
+
tabIndex?: Number;
|
|
124
|
+
/**
|
|
125
|
+
* Defines additional class to the input element.
|
|
126
|
+
*/
|
|
127
|
+
inputClass?: String;
|
|
128
|
+
/**
|
|
129
|
+
* Identifies the element(s) which will label the component.
|
|
130
|
+
*/
|
|
131
|
+
ariaDescribedBy?: string;
|
|
132
|
+
/**
|
|
133
|
+
* Defines a string value that labels an interactive element.
|
|
134
|
+
*/
|
|
135
|
+
ariaLabelledBy?: string;
|
|
136
|
+
/**
|
|
137
|
+
* Defines the built-in [minlength](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/minlength) property of the text inputs.
|
|
138
|
+
* * As the property is directly passed to the internal [input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input) element, when defining it, it should be written as it is - `minlength`. Camel-case and kebap-case won't work in this scenario.
|
|
139
|
+
*/
|
|
140
|
+
minlength?: string;
|
|
141
|
+
/**
|
|
142
|
+
* Defines the built-in [maxlength](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/maxlength) property of the text inputs.
|
|
143
|
+
* * As the property is directly passed to the internal [input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input) element, when defining it, it should be written as it is - `maxlength`. Camel-case and kebap-case won't work in this scenario.
|
|
144
|
+
*/
|
|
145
|
+
maxlength?: string;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* @hidden
|
|
149
|
+
*/
|
|
150
|
+
export interface TextBoxData {
|
|
151
|
+
hasMounted?: boolean;
|
|
152
|
+
autofill?: boolean;
|
|
153
|
+
currentValue?: string | string[] | number;
|
|
154
|
+
valueDuringOnChange?: string;
|
|
155
|
+
focused?: boolean;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* @hidden
|
|
159
|
+
*/
|
|
160
|
+
export interface TextBoxState {
|
|
161
|
+
inputRef: any;
|
|
162
|
+
_input: any;
|
|
163
|
+
wrapper: any;
|
|
164
|
+
_inputId?: string;
|
|
165
|
+
v3: boolean;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* @hidden
|
|
169
|
+
*/
|
|
170
|
+
export interface TextBoxMethods {
|
|
171
|
+
[key: string]: any;
|
|
172
|
+
emitBlur?: (_: any) => void;
|
|
173
|
+
emitFocus?: (_: any) => void;
|
|
174
|
+
focus?: () => void;
|
|
175
|
+
validity: () => any;
|
|
176
|
+
isInvalid: (state: any) => any;
|
|
177
|
+
setValidity: () => void;
|
|
178
|
+
handleTextBox?: () => void;
|
|
179
|
+
handleChange: (event: any) => void;
|
|
180
|
+
handleKeyup?: (event: any) => void;
|
|
181
|
+
handleKeydown?: (event: any) => void;
|
|
182
|
+
handleKeypress?: (event: any) => void;
|
|
183
|
+
handleAutoFill?: (e: any) => void;
|
|
184
|
+
handleAutoFillEnd?: (e: any) => void;
|
|
185
|
+
inputWrapperClass: () => any;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* @hidden
|
|
189
|
+
*/
|
|
190
|
+
export interface TextBoxComputed {
|
|
191
|
+
[key: string]: any;
|
|
192
|
+
computedValue?: any;
|
|
193
|
+
spanClassNames?: any;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* @hidden
|
|
197
|
+
*/
|
|
198
|
+
export interface TextBoxAllMethods extends Vue2type, TextBoxMethods, TextBoxComputed, TextBoxState {
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* @hidden
|
|
202
|
+
*/
|
|
203
|
+
declare let TextBoxVue2: ComponentOptions<TextBoxAllMethods, DefaultData<TextBoxData>, DefaultMethods<TextBoxAllMethods>, TextBoxComputed, RecordPropsDefinition<TextBoxProps>>;
|
|
204
|
+
/**
|
|
205
|
+
* @hidden
|
|
206
|
+
*/
|
|
207
|
+
declare const TextBox: DefineComponent<TextBoxProps, any, TextBoxData, TextBoxComputed, TextBoxMethods, {}, {}, {}, string, TextBoxProps, TextBoxProps, {}>;
|
|
208
|
+
export { TextBox, TextBoxVue2 };
|
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
var __assign = this && this.__assign || function () {
|
|
2
|
+
__assign = Object.assign || function (t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) {
|
|
6
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
import * as Vue from 'vue';
|
|
15
|
+
var allVue = Vue;
|
|
16
|
+
var gh = allVue.h;
|
|
17
|
+
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
18
|
+
var ref = allVue.ref;
|
|
19
|
+
import { guid, templateDefinition, validatePackage, kendoThemeMaps, templateRendering, getListeners, getTemplate, Icon } from '@progress/kendo-vue-common';
|
|
20
|
+
import { packageMetadata } from '../package-metadata.js';
|
|
21
|
+
import { FloatingLabel } from '@progress/kendo-vue-labels';
|
|
22
|
+
import { checkIcon, exclamationCircleIcon, xIcon } from '@progress/kendo-svg-icons';
|
|
23
|
+
/**
|
|
24
|
+
* @hidden
|
|
25
|
+
*/
|
|
26
|
+
var TextBoxVue2 = {
|
|
27
|
+
model: {
|
|
28
|
+
event: 'changemodel'
|
|
29
|
+
},
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
emits: {
|
|
32
|
+
'input': null,
|
|
33
|
+
'change': null,
|
|
34
|
+
'changemodel': null,
|
|
35
|
+
'update:modelValue': null,
|
|
36
|
+
'focus': null,
|
|
37
|
+
'blur': null,
|
|
38
|
+
'keyup': null,
|
|
39
|
+
'keydown': null,
|
|
40
|
+
'keypress': null
|
|
41
|
+
},
|
|
42
|
+
props: {
|
|
43
|
+
modelValue: {
|
|
44
|
+
type: [String, Number],
|
|
45
|
+
default: undefined
|
|
46
|
+
},
|
|
47
|
+
disabled: Boolean,
|
|
48
|
+
defaultValue: {
|
|
49
|
+
type: [String, Number],
|
|
50
|
+
default: ''
|
|
51
|
+
},
|
|
52
|
+
value: {
|
|
53
|
+
type: [String, Number]
|
|
54
|
+
},
|
|
55
|
+
label: {
|
|
56
|
+
type: String
|
|
57
|
+
},
|
|
58
|
+
placeholder: {
|
|
59
|
+
type: String
|
|
60
|
+
},
|
|
61
|
+
required: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: false
|
|
64
|
+
},
|
|
65
|
+
size: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: 'medium',
|
|
68
|
+
validator: function validator(value) {
|
|
69
|
+
return [null, 'small', 'medium', 'large'].includes(value);
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
rounded: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: 'medium',
|
|
75
|
+
validator: function validator(value) {
|
|
76
|
+
return [null, 'small', 'medium', 'large', 'full'].includes(value);
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
fillMode: {
|
|
80
|
+
type: String,
|
|
81
|
+
default: 'solid',
|
|
82
|
+
validator: function validator(value) {
|
|
83
|
+
return [null, 'solid', 'flat', 'outline'].includes(value);
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
dir: {
|
|
87
|
+
type: String
|
|
88
|
+
},
|
|
89
|
+
id: String,
|
|
90
|
+
valid: {
|
|
91
|
+
type: Boolean,
|
|
92
|
+
default: undefined
|
|
93
|
+
},
|
|
94
|
+
validate: {
|
|
95
|
+
type: Boolean
|
|
96
|
+
},
|
|
97
|
+
validationMessage: {
|
|
98
|
+
type: String
|
|
99
|
+
},
|
|
100
|
+
validityStyles: {
|
|
101
|
+
type: Boolean,
|
|
102
|
+
default: true
|
|
103
|
+
},
|
|
104
|
+
iconName: String,
|
|
105
|
+
inputPrefix: templateDefinition,
|
|
106
|
+
inputSuffix: templateDefinition,
|
|
107
|
+
showValidationIcon: Boolean,
|
|
108
|
+
showLoadingIcon: Boolean,
|
|
109
|
+
showClearButton: Boolean,
|
|
110
|
+
inputClass: String,
|
|
111
|
+
wrapperClass: String,
|
|
112
|
+
tabIndex: Number,
|
|
113
|
+
ariaLabelledBy: String,
|
|
114
|
+
ariaDescribedBy: String
|
|
115
|
+
},
|
|
116
|
+
data: function data() {
|
|
117
|
+
return {
|
|
118
|
+
hasMounted: false,
|
|
119
|
+
autofill: false,
|
|
120
|
+
currentValue: '',
|
|
121
|
+
valueDuringOnChange: '',
|
|
122
|
+
focused: false
|
|
123
|
+
};
|
|
124
|
+
},
|
|
125
|
+
created: function created() {
|
|
126
|
+
validatePackage(packageMetadata);
|
|
127
|
+
this._input = undefined;
|
|
128
|
+
this._inputId = guid();
|
|
129
|
+
this.$data.valueDuringOnChange = undefined;
|
|
130
|
+
this.$data.currentValue = this.$props.defaultValue;
|
|
131
|
+
},
|
|
132
|
+
mounted: function mounted() {
|
|
133
|
+
this._input = this.v3 ? this.inputRef : this.$refs.input;
|
|
134
|
+
this.wrapper = this.v3 ? this.wrapperRef : this.$refs.wrapper;
|
|
135
|
+
this.$data.hasMounted = true;
|
|
136
|
+
this.setValidity();
|
|
137
|
+
},
|
|
138
|
+
updated: function updated() {
|
|
139
|
+
this.setValidity();
|
|
140
|
+
this.updateValidClass();
|
|
141
|
+
},
|
|
142
|
+
// @ts-ignore
|
|
143
|
+
setup: !isV3 ? undefined : function () {
|
|
144
|
+
var v3 = !!isV3;
|
|
145
|
+
var inputRef = ref(null);
|
|
146
|
+
return {
|
|
147
|
+
v3: v3,
|
|
148
|
+
inputRef: inputRef
|
|
149
|
+
};
|
|
150
|
+
},
|
|
151
|
+
render: function render(createElement) {
|
|
152
|
+
var _this = this;
|
|
153
|
+
var h = gh || createElement;
|
|
154
|
+
var isValid = !this.$props.validityStyles || this.validity().valid;
|
|
155
|
+
var _a = this.$props,
|
|
156
|
+
label = _a.label,
|
|
157
|
+
id = _a.id,
|
|
158
|
+
required = _a.required,
|
|
159
|
+
iconName = _a.iconName,
|
|
160
|
+
showValidationIcon = _a.showValidationIcon,
|
|
161
|
+
showLoadingIcon = _a.showLoadingIcon,
|
|
162
|
+
showClearButton = _a.showClearButton,
|
|
163
|
+
tabIndex = _a.tabIndex,
|
|
164
|
+
ariaLabelledBy = _a.ariaLabelledBy,
|
|
165
|
+
ariaDescribedBy = _a.ariaDescribedBy;
|
|
166
|
+
var inputId = id || this._inputId;
|
|
167
|
+
var textbox = h('input', __assign(__assign({
|
|
168
|
+
domProps: this.v3 ? null : __assign(__assign({}, this.$attrs), {
|
|
169
|
+
placeholder: this.$props.placeholder,
|
|
170
|
+
id: inputId,
|
|
171
|
+
required: required,
|
|
172
|
+
value: this.computedValue
|
|
173
|
+
}),
|
|
174
|
+
attrs: this.v3 ? undefined : __assign(__assign({}, this.$attrs), {
|
|
175
|
+
tabindex: tabIndex
|
|
176
|
+
})
|
|
177
|
+
}, this.$attrs), {
|
|
178
|
+
placeholder: this.$props.placeholder,
|
|
179
|
+
id: inputId,
|
|
180
|
+
tabindex: tabIndex,
|
|
181
|
+
required: required,
|
|
182
|
+
ariaLabelledby: ariaLabelledBy,
|
|
183
|
+
ariaDescribedby: ariaDescribedBy,
|
|
184
|
+
ariaDisabled: this.$props.disabled,
|
|
185
|
+
value: this.computedValue,
|
|
186
|
+
class: this.inputInnerClass,
|
|
187
|
+
ref: this.v3 ? function (el) {
|
|
188
|
+
_this.inputRef = el;
|
|
189
|
+
} : 'input',
|
|
190
|
+
on: this.v3 ? null : {
|
|
191
|
+
change: this.handleChange,
|
|
192
|
+
focus: this.emitFocus,
|
|
193
|
+
blur: this.emitBlur,
|
|
194
|
+
keydown: this.handleKeydown,
|
|
195
|
+
keyup: this.handleKeyup,
|
|
196
|
+
keypress: this.handleKeypress,
|
|
197
|
+
input: this.handleTextBox,
|
|
198
|
+
animationstart: this.handleAutoFill,
|
|
199
|
+
animationend: this.handleAutoFillEnd
|
|
200
|
+
},
|
|
201
|
+
onKeydown: this.handleKeydown,
|
|
202
|
+
onKeyup: this.handleKeyup,
|
|
203
|
+
onKeypress: this.handleKeypress,
|
|
204
|
+
onChange: this.handleChange,
|
|
205
|
+
onFocus: this.emitFocus,
|
|
206
|
+
onBlur: this.emitBlur,
|
|
207
|
+
onTextBox: this.handleTextBox,
|
|
208
|
+
onAnimationstart: this.handleAutoFill,
|
|
209
|
+
onAnimationend: this.handleAutoFillEnd
|
|
210
|
+
}));
|
|
211
|
+
var inputPrefixTemplate = templateRendering.call(this, this.$props.inputPrefix, getListeners.call(this));
|
|
212
|
+
var inputSuffixTemplate = templateRendering.call(this, this.$props.inputSuffix, getListeners.call(this));
|
|
213
|
+
var inputPrefix = getTemplate.call(this, {
|
|
214
|
+
h: h,
|
|
215
|
+
template: inputPrefixTemplate,
|
|
216
|
+
additionalProps: {
|
|
217
|
+
value: this.computedValue,
|
|
218
|
+
valid: isValid
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
var inputSuffix = getTemplate.call(this, {
|
|
222
|
+
h: h,
|
|
223
|
+
template: inputSuffixTemplate,
|
|
224
|
+
additionalProps: {
|
|
225
|
+
value: this.computedValue,
|
|
226
|
+
valid: isValid
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
var inputWrapper = h("span", {
|
|
230
|
+
"class": this.inputWrapperClass(),
|
|
231
|
+
ref: this.v3 ? function (el) {
|
|
232
|
+
_this.wrapperRef = el;
|
|
233
|
+
} : 'wrapper'
|
|
234
|
+
}, [iconName && h(Icon, {
|
|
235
|
+
name: iconName,
|
|
236
|
+
attrs: this.v3 ? undefined : {
|
|
237
|
+
name: iconName
|
|
238
|
+
},
|
|
239
|
+
"class": "k-input-icon"
|
|
240
|
+
}), this.$props.inputPrefix && h("span", {
|
|
241
|
+
"class": "k-input-prefix"
|
|
242
|
+
}, [inputPrefix]), textbox, this.$props.inputSuffix && h("span", {
|
|
243
|
+
"class": "k-input-suffix"
|
|
244
|
+
}, [inputSuffix]), showValidationIcon && isValid && h(Icon, {
|
|
245
|
+
name: 'check',
|
|
246
|
+
attrs: this.v3 ? undefined : {
|
|
247
|
+
name: 'check',
|
|
248
|
+
icon: checkIcon
|
|
249
|
+
},
|
|
250
|
+
icon: checkIcon,
|
|
251
|
+
"class": "k-input-validation-icon"
|
|
252
|
+
}), showValidationIcon && !isValid && h(Icon, {
|
|
253
|
+
name: 'exclamation-circle',
|
|
254
|
+
attrs: this.v3 ? undefined : {
|
|
255
|
+
name: 'exclamation-circle',
|
|
256
|
+
icon: exclamationCircleIcon
|
|
257
|
+
},
|
|
258
|
+
icon: exclamationCircleIcon,
|
|
259
|
+
"class": "k-input-validation-icon"
|
|
260
|
+
}), showLoadingIcon && h("span", {
|
|
261
|
+
"class": "k-input-loading-icon k-icon k-i-loading"
|
|
262
|
+
}), showClearButton && this.computedValue && h("span", {
|
|
263
|
+
onClick: this.clearClick,
|
|
264
|
+
on: this.v3 ? undefined : {
|
|
265
|
+
"click": this.clearClick
|
|
266
|
+
},
|
|
267
|
+
"class": "k-clear-value"
|
|
268
|
+
}, [h(Icon, {
|
|
269
|
+
name: 'x',
|
|
270
|
+
attrs: this.v3 ? undefined : {
|
|
271
|
+
name: 'x',
|
|
272
|
+
icon: xIcon
|
|
273
|
+
},
|
|
274
|
+
icon: xIcon
|
|
275
|
+
})])]);
|
|
276
|
+
return label ?
|
|
277
|
+
// @ts-ignore function children
|
|
278
|
+
h(FloatingLabel, {
|
|
279
|
+
label: label,
|
|
280
|
+
attrs: this.v3 ? undefined : {
|
|
281
|
+
label: label,
|
|
282
|
+
editorId: inputId,
|
|
283
|
+
editorValue: this.computedValue,
|
|
284
|
+
editorValid: isValid,
|
|
285
|
+
editorDisabled: this.$props.disabled,
|
|
286
|
+
editorPlaceholder: this.$data.focused ? this.$props.placeholder : '',
|
|
287
|
+
dir: this.$props.dir
|
|
288
|
+
},
|
|
289
|
+
editorId: inputId,
|
|
290
|
+
editorValue: this.computedValue,
|
|
291
|
+
editorValid: isValid,
|
|
292
|
+
editorDisabled: this.$props.disabled,
|
|
293
|
+
editorPlaceholder: this.$data.focused ? this.$props.placeholder : '',
|
|
294
|
+
dir: this.$props.dir
|
|
295
|
+
}, this.v3 ? function () {
|
|
296
|
+
return [inputWrapper];
|
|
297
|
+
} : [inputWrapper]) : inputWrapper;
|
|
298
|
+
},
|
|
299
|
+
methods: {
|
|
300
|
+
updateValidClass: function updateValidClass() {
|
|
301
|
+
this.wrapper.classList.toggle('k-invalid', !this.validity().valid);
|
|
302
|
+
},
|
|
303
|
+
emitFocus: function emitFocus(e) {
|
|
304
|
+
this.$emit('focus', e);
|
|
305
|
+
this.$data.focused = true;
|
|
306
|
+
},
|
|
307
|
+
emitBlur: function emitBlur(e) {
|
|
308
|
+
this.$emit('blur', e);
|
|
309
|
+
this.$data.focused = false;
|
|
310
|
+
},
|
|
311
|
+
handleKeydown: function handleKeydown(e) {
|
|
312
|
+
this.$emit('keydown', e);
|
|
313
|
+
},
|
|
314
|
+
handleKeyup: function handleKeyup(e) {
|
|
315
|
+
this.$emit('keyup', e);
|
|
316
|
+
},
|
|
317
|
+
handleKeypress: function handleKeypress(e) {
|
|
318
|
+
this.$emit('keypress', e);
|
|
319
|
+
},
|
|
320
|
+
clearClick: function clearClick(event) {
|
|
321
|
+
this.emitUpdate(event, 'change', '');
|
|
322
|
+
},
|
|
323
|
+
focus: function focus() {
|
|
324
|
+
if (this._input) {
|
|
325
|
+
this._input.focus();
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
validity: function validity() {
|
|
329
|
+
var result = {
|
|
330
|
+
badTextBox: this._input ? this._input.validity.badTextBox : false,
|
|
331
|
+
patternMismatch: this._input ? this._input.validity.patternMismatch : false,
|
|
332
|
+
rangeOverflow: this._input ? this._input.validity.rangeOverflow : false,
|
|
333
|
+
rangeUnderflow: this._input ? this._input.validity.rangeUnderflow : false,
|
|
334
|
+
stepMismatch: this._input ? this._input.validity.stepMismatch : false,
|
|
335
|
+
tooLong: this._input ? this._input.validity.tooLong : false,
|
|
336
|
+
tooShort: this._input ? this._input.validity.tooShort : false,
|
|
337
|
+
typeMismatch: this._input ? this._input.validity.typeMismatch : false,
|
|
338
|
+
valueMissing: this._input ? this._input.validity.valueMissing : false
|
|
339
|
+
};
|
|
340
|
+
return __assign(__assign({}, result), {
|
|
341
|
+
customError: this.$props.validationMessage !== undefined,
|
|
342
|
+
valid: this.$props.valid !== undefined ? this.$props.valid : this._input ? !this.isInvalid(result) : true
|
|
343
|
+
});
|
|
344
|
+
},
|
|
345
|
+
isInvalid: function isInvalid(state) {
|
|
346
|
+
var result = false;
|
|
347
|
+
for (var prop in state) {
|
|
348
|
+
if (state.hasOwnProperty(prop)) {
|
|
349
|
+
result = result || state[prop];
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
return result;
|
|
353
|
+
},
|
|
354
|
+
setValidity: function setValidity() {
|
|
355
|
+
if (this._input && this._input.setCustomValidity) {
|
|
356
|
+
this._input.setCustomValidity(this.validity().valid ? '' : this.$props.validationMessage || '');
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
handleTextBox: function handleTextBox(event) {
|
|
360
|
+
this.emitUpdate(event, 'input', event.target.value);
|
|
361
|
+
},
|
|
362
|
+
handleChange: function handleChange(event) {
|
|
363
|
+
this.emitUpdate(event, 'change', event.target.value);
|
|
364
|
+
},
|
|
365
|
+
emitUpdate: function emitUpdate(event, eventName, value) {
|
|
366
|
+
var that = this;
|
|
367
|
+
if (this.disabled) {
|
|
368
|
+
return;
|
|
369
|
+
}
|
|
370
|
+
this.$data.currentValue = value;
|
|
371
|
+
this.$data.valueDuringOnChange = value;
|
|
372
|
+
this.$nextTick(function () {
|
|
373
|
+
that.$emit('changemodel', value);
|
|
374
|
+
that.$emit('update:modelValue', value);
|
|
375
|
+
that.$emit(eventName, {
|
|
376
|
+
event: event,
|
|
377
|
+
value: value,
|
|
378
|
+
component: that,
|
|
379
|
+
target: event.target,
|
|
380
|
+
validity: that.validity()
|
|
381
|
+
});
|
|
382
|
+
that.$data.valueDuringOnChange = undefined;
|
|
383
|
+
});
|
|
384
|
+
},
|
|
385
|
+
handleAutoFill: function handleAutoFill(e) {
|
|
386
|
+
if (e.animationName === 'autoFillStart') {
|
|
387
|
+
var parent_1 = e.target.parentNode;
|
|
388
|
+
if (parent_1 && parent_1.classList.contains('k-empty')) {
|
|
389
|
+
this.$data.autofill = true;
|
|
390
|
+
parent_1.classList.remove('k-empty');
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
handleAutoFillEnd: function handleAutoFillEnd(e) {
|
|
395
|
+
if (e.animationName === 'autoFillEnd') {
|
|
396
|
+
var parent_2 = e.target.parentNode;
|
|
397
|
+
if (parent_2) {
|
|
398
|
+
this.$data.autofill = false;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
},
|
|
402
|
+
name: function name() {
|
|
403
|
+
return this.$props.name;
|
|
404
|
+
},
|
|
405
|
+
inputWrapperClass: function inputWrapperClass() {
|
|
406
|
+
var _a;
|
|
407
|
+
var _b = this.$props,
|
|
408
|
+
size = _b.size,
|
|
409
|
+
fillMode = _b.fillMode,
|
|
410
|
+
rounded = _b.rounded;
|
|
411
|
+
var isValid = !this.$data.hasMounted || !this.$props.validityStyles || this.validity().valid;
|
|
412
|
+
return _a = {
|
|
413
|
+
'k-textbox': true,
|
|
414
|
+
'k-input': true
|
|
415
|
+
}, _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'] = this.required, _a['k-disabled'] = this.$props.disabled, _a[this.wrapperClass] = this.wrapperClass, _a;
|
|
416
|
+
}
|
|
417
|
+
},
|
|
418
|
+
computed: {
|
|
419
|
+
spanClassNames: {
|
|
420
|
+
get: function get() {
|
|
421
|
+
var isValid = !this.$data.hasMounted || !this.$props.validityStyles || this.validity().valid;
|
|
422
|
+
return {
|
|
423
|
+
'k-floating-label-container': true,
|
|
424
|
+
'k-focus': this.$data.focused,
|
|
425
|
+
'k-empty': !((this.computedValue === 0 ? true : this.computedValue) || this.$props.placeholder || this.$data.autofill),
|
|
426
|
+
'k-autofill': this.$data.autofill,
|
|
427
|
+
'k-invalid': !isValid && isValid !== undefined,
|
|
428
|
+
'k-rtl': this.$props.dir === 'rtl'
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
},
|
|
432
|
+
inputInnerClass: function inputInnerClass() {
|
|
433
|
+
var _a;
|
|
434
|
+
return _a = {
|
|
435
|
+
'k-input-inner': true
|
|
436
|
+
}, _a[this.inputClass] = this.inputClass, _a;
|
|
437
|
+
},
|
|
438
|
+
computedValue: {
|
|
439
|
+
get: function get() {
|
|
440
|
+
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;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
};
|
|
445
|
+
/**
|
|
446
|
+
* @hidden
|
|
447
|
+
*/
|
|
448
|
+
var TextBox = TextBoxVue2;
|
|
449
|
+
export { TextBox, TextBoxVue2 };
|
package/dist/npm/main.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from './colors/FlatColorPicker';
|
|
|
15
15
|
export { Switch, SwitchVue2, SwitchProps, SwitchState, SwitchChangeEvent } from './switch/Switch';
|
|
16
16
|
export * from './input-separator/InputSeparator';
|
|
17
17
|
export * from './input/Input';
|
|
18
|
+
export * from './textbox/TextBox';
|
|
18
19
|
export * from './numerictextbox/NumericTextBox';
|
|
19
20
|
export * from './maskedtextbox/MaskedTextBox';
|
|
20
21
|
export * from './maskedtextbox/MaskedTextBoxProps';
|
package/dist/npm/main.js
CHANGED
|
@@ -34,6 +34,7 @@ Object.defineProperty(exports, "Switch", { enumerable: true, get: function () {
|
|
|
34
34
|
Object.defineProperty(exports, "SwitchVue2", { enumerable: true, get: function () { return Switch_1.SwitchVue2; } });
|
|
35
35
|
__exportStar(require("./input-separator/InputSeparator"), exports);
|
|
36
36
|
__exportStar(require("./input/Input"), exports);
|
|
37
|
+
__exportStar(require("./textbox/TextBox"), exports);
|
|
37
38
|
__exportStar(require("./numerictextbox/NumericTextBox"), exports);
|
|
38
39
|
__exportStar(require("./maskedtextbox/MaskedTextBox"), exports);
|
|
39
40
|
__exportStar(require("./maskedtextbox/MaskedTextBoxProps"), exports);
|
|
@@ -8,7 +8,7 @@ exports.packageMetadata = {
|
|
|
8
8
|
name: '@progress/kendo-vue-inputs',
|
|
9
9
|
productName: 'Kendo UI for Vue',
|
|
10
10
|
productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
|
|
11
|
-
publishDate:
|
|
11
|
+
publishDate: 1680684691,
|
|
12
12
|
version: '',
|
|
13
13
|
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'
|
|
14
14
|
};
|