@progress/kendo-vue-inputs 2.7.0 → 2.7.1-dev.202112201049
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 +5 -0
- package/dist/es/main.js +5 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/switch/Switch.d.ts +131 -0
- package/dist/es/switch/Switch.js +304 -0
- package/dist/es/switch/util.d.ts +8 -0
- package/dist/es/switch/util.js +46 -0
- package/dist/es/textarea/TextArea.d.ts +46 -0
- package/dist/es/textarea/TextArea.js +251 -0
- package/dist/es/textarea/interfaces/TextAreaBlurEvent.d.ts +5 -0
- package/dist/es/textarea/interfaces/TextAreaBlurEvent.js +0 -0
- package/dist/es/textarea/interfaces/TextAreaChangeEvent.d.ts +9 -0
- package/dist/es/textarea/interfaces/TextAreaChangeEvent.js +0 -0
- package/dist/es/textarea/interfaces/TextAreaFocusEvent.d.ts +5 -0
- package/dist/es/textarea/interfaces/TextAreaFocusEvent.js +0 -0
- package/dist/es/textarea/interfaces/TextAreaProps.d.ts +84 -0
- package/dist/es/textarea/interfaces/TextAreaProps.js +0 -0
- package/dist/npm/main.d.ts +5 -0
- package/dist/npm/main.js +6 -0
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/switch/Switch.d.ts +131 -0
- package/dist/npm/switch/Switch.js +317 -0
- package/dist/npm/switch/util.d.ts +8 -0
- package/dist/npm/switch/util.js +49 -0
- package/dist/npm/textarea/TextArea.d.ts +46 -0
- package/dist/npm/textarea/TextArea.js +261 -0
- package/dist/npm/textarea/interfaces/TextAreaBlurEvent.d.ts +5 -0
- package/dist/npm/textarea/interfaces/TextAreaBlurEvent.js +2 -0
- package/dist/npm/textarea/interfaces/TextAreaChangeEvent.d.ts +9 -0
- package/dist/npm/textarea/interfaces/TextAreaChangeEvent.js +2 -0
- package/dist/npm/textarea/interfaces/TextAreaFocusEvent.d.ts +5 -0
- package/dist/npm/textarea/interfaces/TextAreaFocusEvent.js +2 -0
- package/dist/npm/textarea/interfaces/TextAreaProps.d.ts +84 -0
- package/dist/npm/textarea/interfaces/TextAreaProps.js +5 -0
- package/package.json +7 -7
|
@@ -0,0 +1,251 @@
|
|
|
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
|
+
|
|
6
|
+
for (var p in s) {
|
|
7
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
}; // @ts-ignore
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
import * as Vue from 'vue';
|
|
19
|
+
var allVue = Vue;
|
|
20
|
+
var gh = allVue.h;
|
|
21
|
+
import { guid, isRtl, getTabIndex, validatePackage // useDir,
|
|
22
|
+
} from '@progress/kendo-vue-common';
|
|
23
|
+
import { packageMetadata } from '../package-metadata'; // tslint:enable:max-line-length
|
|
24
|
+
|
|
25
|
+
var TextArea = {
|
|
26
|
+
name: 'KendoTextArea',
|
|
27
|
+
inheritAttrs: false,
|
|
28
|
+
model: {
|
|
29
|
+
event: 'changemodel'
|
|
30
|
+
},
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
emits: {
|
|
33
|
+
'input': null,
|
|
34
|
+
'change': null,
|
|
35
|
+
'changemodel': null,
|
|
36
|
+
'update:modelValue': null,
|
|
37
|
+
'focus': null,
|
|
38
|
+
'blur': null
|
|
39
|
+
},
|
|
40
|
+
props: {
|
|
41
|
+
ariaDescribedBy: String,
|
|
42
|
+
ariaLabelledBy: String,
|
|
43
|
+
autoSize: Boolean,
|
|
44
|
+
modelValue: {
|
|
45
|
+
type: [String, Array, Number],
|
|
46
|
+
default: undefined
|
|
47
|
+
},
|
|
48
|
+
defaultValue: [String, Number],
|
|
49
|
+
dir: String,
|
|
50
|
+
disabled: Boolean,
|
|
51
|
+
readOnly: Boolean,
|
|
52
|
+
rows: Number,
|
|
53
|
+
id: String,
|
|
54
|
+
name: String,
|
|
55
|
+
required: Boolean,
|
|
56
|
+
placeholder: String,
|
|
57
|
+
tabIndex: Number,
|
|
58
|
+
valid: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: undefined
|
|
61
|
+
},
|
|
62
|
+
value: [String, Array, Number],
|
|
63
|
+
validityStyles: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: true
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
created: function created() {
|
|
69
|
+
validatePackage(packageMetadata);
|
|
70
|
+
this.calculatedId = guid();
|
|
71
|
+
},
|
|
72
|
+
computed: {
|
|
73
|
+
rootClassName: function rootClassName() {
|
|
74
|
+
return {
|
|
75
|
+
'k-textarea': true,
|
|
76
|
+
'k-state-invalid': this.validityStyles === true ? !this.isValid : false,
|
|
77
|
+
'k-state-disabled': this.$props.disabled
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
computedValue: function computedValue() {
|
|
81
|
+
return this.$props.value !== undefined ? this.$props.value : this.$props.modelValue !== undefined ? this.$props.modelValue : this.currentValue;
|
|
82
|
+
},
|
|
83
|
+
isValid: function isValid() {
|
|
84
|
+
return this.valid !== undefined ? this.valid : !this.required ? true : this.computedValue ? true : false;
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
data: function data() {
|
|
88
|
+
return {
|
|
89
|
+
currentValue: this.$props.defaultValue,
|
|
90
|
+
textAreaHeight: 'auto',
|
|
91
|
+
currentDir: 'ltr'
|
|
92
|
+
};
|
|
93
|
+
},
|
|
94
|
+
mounted: function mounted() {
|
|
95
|
+
this.element = this.v3 ? this.elementRef : this.$refs.element;
|
|
96
|
+
this.currentDir = this.$props.dir !== undefined ? this.$props.dir : isRtl(this.$el) ? 'rtl' : 'ltr';
|
|
97
|
+
this.setValidity();
|
|
98
|
+
},
|
|
99
|
+
updated: function updated() {
|
|
100
|
+
this.element = this.v3 ? this.elementRef : this.$refs.element;
|
|
101
|
+
this.setValidity();
|
|
102
|
+
},
|
|
103
|
+
// @ts-ignore
|
|
104
|
+
setup: !gh ? undefined : function () {
|
|
105
|
+
var v3 = !!gh;
|
|
106
|
+
return {
|
|
107
|
+
v3: v3
|
|
108
|
+
};
|
|
109
|
+
},
|
|
110
|
+
// @ts-ignore
|
|
111
|
+
render: function render(createElement) {
|
|
112
|
+
var _this = this;
|
|
113
|
+
|
|
114
|
+
var h = gh || createElement;
|
|
115
|
+
var _a = this.$props,
|
|
116
|
+
ariaDescribedBy = _a.ariaDescribedBy,
|
|
117
|
+
ariaLabelledBy = _a.ariaLabelledBy,
|
|
118
|
+
autoSize = _a.autoSize,
|
|
119
|
+
disabled = _a.disabled,
|
|
120
|
+
readOnly = _a.readOnly,
|
|
121
|
+
required = _a.required,
|
|
122
|
+
rows = _a.rows,
|
|
123
|
+
id = _a.id,
|
|
124
|
+
name = _a.name,
|
|
125
|
+
placeholder = _a.placeholder,
|
|
126
|
+
tabIndex = _a.tabIndex;
|
|
127
|
+
|
|
128
|
+
var textAreaAttrs = __assign({
|
|
129
|
+
id: id || this.calculatedId,
|
|
130
|
+
name: name,
|
|
131
|
+
disabled: disabled,
|
|
132
|
+
rows: rows,
|
|
133
|
+
placeholder: placeholder,
|
|
134
|
+
readOnly: readOnly,
|
|
135
|
+
required: required,
|
|
136
|
+
tabIndex: getTabIndex(tabIndex, disabled),
|
|
137
|
+
'aria-labelledby': ariaLabelledBy,
|
|
138
|
+
'aria-describedby': ariaDescribedBy,
|
|
139
|
+
'aria-multiline': true,
|
|
140
|
+
'aria-disabled': disabled || undefined
|
|
141
|
+
}, this.$attrs);
|
|
142
|
+
|
|
143
|
+
var textarea = h('textarea', __assign(__assign({}, textAreaAttrs), {
|
|
144
|
+
attrs: this.v3 ? undefined : textAreaAttrs,
|
|
145
|
+
'class': 'k-input',
|
|
146
|
+
ref: this.v3 ? function (el) {
|
|
147
|
+
_this.elementRef = el;
|
|
148
|
+
} : 'element',
|
|
149
|
+
style: autoSize ? {
|
|
150
|
+
resize: 'none',
|
|
151
|
+
overflow: 'hidden',
|
|
152
|
+
height: this.textAreaHeight
|
|
153
|
+
} : {},
|
|
154
|
+
value: this.v3 ? this.computedValue : null,
|
|
155
|
+
domProps: this.v3 ? undefined : {
|
|
156
|
+
'value': this.computedValue
|
|
157
|
+
},
|
|
158
|
+
onChange: this.handleChange,
|
|
159
|
+
onInput: this.handleInput,
|
|
160
|
+
on: this.v3 ? undefined : {
|
|
161
|
+
'change': this.handleChange,
|
|
162
|
+
'focus': this.handleFocus,
|
|
163
|
+
'blur': this.handleBlur,
|
|
164
|
+
input: this.handleInput
|
|
165
|
+
},
|
|
166
|
+
onFocus: this.handleFocus,
|
|
167
|
+
onBlur: this.handleBlur
|
|
168
|
+
}));
|
|
169
|
+
return h("span", {
|
|
170
|
+
"class": this.rootClassName,
|
|
171
|
+
dir: this.currentDir,
|
|
172
|
+
attrs: this.v3 ? undefined : {
|
|
173
|
+
dir: this.currentDir
|
|
174
|
+
}
|
|
175
|
+
}, [textarea]);
|
|
176
|
+
},
|
|
177
|
+
methods: {
|
|
178
|
+
setValidity: function setValidity() {
|
|
179
|
+
if (this.element && this.element.setCustomValidity) {
|
|
180
|
+
this.element.setCustomValidity(this.isValid ? '' : this.validationMessage || '');
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
if (this.element) {
|
|
184
|
+
this.textAreaHeight = this.element.scrollHeight + "px";
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
focus: function focus() {
|
|
188
|
+
if (this.element) {
|
|
189
|
+
this.element.focus();
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
handleChange: function handleChange(event) {
|
|
193
|
+
var newValue = event.target.value;
|
|
194
|
+
|
|
195
|
+
if (!this.$props.disabled) {
|
|
196
|
+
this.textAreaHeight = 'auto';
|
|
197
|
+
this.currentValue = newValue;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
if (!this.$props.disabled) {
|
|
201
|
+
this.$emit('change', {
|
|
202
|
+
event: event,
|
|
203
|
+
component: this,
|
|
204
|
+
name: this.element.name,
|
|
205
|
+
value: newValue
|
|
206
|
+
});
|
|
207
|
+
this.$emit('changemodel', newValue);
|
|
208
|
+
this.$emit('update:modelValue', newValue);
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
handleInput: function handleInput(event) {
|
|
212
|
+
var newValue = event.target.value;
|
|
213
|
+
|
|
214
|
+
if (!this.$props.disabled) {
|
|
215
|
+
this.textAreaHeight = 'auto';
|
|
216
|
+
this.currentValue = newValue;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
if (!this.$props.disabled) {
|
|
220
|
+
this.$emit('input', {
|
|
221
|
+
event: event,
|
|
222
|
+
component: this,
|
|
223
|
+
name: this.element.name,
|
|
224
|
+
value: newValue
|
|
225
|
+
});
|
|
226
|
+
this.$emit('changemodel', newValue);
|
|
227
|
+
this.$emit('update:modelValue', newValue);
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
handleFocus: function handleFocus(event) {
|
|
231
|
+
if (!this.$props.disabled) {
|
|
232
|
+
this.$emit('focus', {
|
|
233
|
+
event: event,
|
|
234
|
+
component: this,
|
|
235
|
+
name: this.element.name
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
handleBlur: function handleBlur(event) {
|
|
240
|
+
if (!this.$props.disabled) {
|
|
241
|
+
this.$emit('blur', {
|
|
242
|
+
event: event,
|
|
243
|
+
component: this,
|
|
244
|
+
name: this.element.name
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
var TextAreaVue3 = TextArea;
|
|
251
|
+
export { TextArea, TextAreaVue3 };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { FormComponentProps } from '@progress/kendo-vue-common';
|
|
2
|
+
import { TextAreaBlurEvent } from './TextAreaBlurEvent';
|
|
3
|
+
import { TextAreaChangeEvent } from './TextAreaChangeEvent';
|
|
4
|
+
import { TextAreaFocusEvent } from './TextAreaFocusEvent';
|
|
5
|
+
/**
|
|
6
|
+
* Represents the props of the [Kendo UI for Vue TextArea component]({% slug overview_textarea %}).
|
|
7
|
+
*/
|
|
8
|
+
export interface TextAreaProps extends FormComponentProps {
|
|
9
|
+
/**
|
|
10
|
+
* Identifies the element(s) which will describe the component, similar to [HTML aria-describedby attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-describedby_attribute).
|
|
11
|
+
* For example these elements could contain error or hint message.
|
|
12
|
+
*/
|
|
13
|
+
ariaDescribedBy?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Identifies the element(s) which will label the component.
|
|
16
|
+
*/
|
|
17
|
+
ariaLabelledBy?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Specifies if the textarea element will resize its height automatically ([see example]({% slug sizing_textarea %})).
|
|
20
|
+
* Defaults to `false`.
|
|
21
|
+
*/
|
|
22
|
+
autoSize?: boolean;
|
|
23
|
+
modelValue?: string | string[] | number;
|
|
24
|
+
/**
|
|
25
|
+
* Specifies a list of CSS classes that will be added to the TextArea.
|
|
26
|
+
*/
|
|
27
|
+
className?: string;
|
|
28
|
+
/**
|
|
29
|
+
* The default value of the TextArea ([see example]({% slug default_textarea %})).
|
|
30
|
+
*/
|
|
31
|
+
defaultValue?: string | string[] | number;
|
|
32
|
+
/**
|
|
33
|
+
* Represents the `dir` HTML attribute.
|
|
34
|
+
*/
|
|
35
|
+
dir?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Specifies if the TextArea is disabled ([see example]({% slug disabled_textarea %})).
|
|
38
|
+
*/
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Sets the read-only state of the TextArea.
|
|
42
|
+
*/
|
|
43
|
+
readOnly?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Specifies an exact height size for the TextArea to take ([see example]({% slug sizing_textarea %})).
|
|
46
|
+
*/
|
|
47
|
+
rows?: number;
|
|
48
|
+
/**
|
|
49
|
+
* Sets the `id` of the TextArea.
|
|
50
|
+
*/
|
|
51
|
+
id?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Specifies the `name` property of the `textarea` DOM element.
|
|
54
|
+
*
|
|
55
|
+
* This property is part of the [FormComponentProps]({% slug api_common_formcomponentprops %}) interface.
|
|
56
|
+
*/
|
|
57
|
+
name?: string;
|
|
58
|
+
/**
|
|
59
|
+
* The hint that is displayed when the TextArea is empty.
|
|
60
|
+
*/
|
|
61
|
+
placeholder?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Sets the `tabIndex` property of the TextArea.
|
|
64
|
+
* Defaults to `0`.
|
|
65
|
+
*/
|
|
66
|
+
tabIndex?: number;
|
|
67
|
+
/**
|
|
68
|
+
* Sets the value to be submitted ([see example]({% slug controlled_textarea %})).
|
|
69
|
+
*/
|
|
70
|
+
value?: string | string[] | number;
|
|
71
|
+
validityStyles?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* The event handler that will be fired when the changes the selected value.
|
|
74
|
+
*/
|
|
75
|
+
onChange?: (event: TextAreaChangeEvent) => void;
|
|
76
|
+
/**
|
|
77
|
+
* The event handler that will be fired when TextArea is focused.
|
|
78
|
+
*/
|
|
79
|
+
onFocus?: (event: TextAreaFocusEvent) => void;
|
|
80
|
+
/**
|
|
81
|
+
* The event handler that will be fired when TextArea is blurred.
|
|
82
|
+
*/
|
|
83
|
+
onBlur?: (event: TextAreaBlurEvent) => void;
|
|
84
|
+
}
|
|
File without changes
|
package/dist/npm/main.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FormComponentValidity } from '@progress/kendo-vue-common';
|
|
2
2
|
export { FormComponentValidity };
|
|
3
|
+
export { Switch, SwitchProps, SwitchState, SwitchChangeEvent } from './switch/Switch';
|
|
3
4
|
export * from './input/Input';
|
|
4
5
|
export * from './numerictextbox/NumericTextBox';
|
|
5
6
|
export * from './maskedtextbox/MaskedTextBox';
|
|
@@ -18,3 +19,7 @@ export * from './radiobutton/RadioButton';
|
|
|
18
19
|
export * from './radiobutton/interfaces/RadioButtonProps';
|
|
19
20
|
export * from './radiobutton/interfaces/RadioButtonChangeEvent';
|
|
20
21
|
export * from './radiobutton/interfaces/RadioButtonFocusEvent';
|
|
22
|
+
export * from './textarea/TextArea';
|
|
23
|
+
export * from './textarea/interfaces/TextAreaProps';
|
|
24
|
+
export * from './textarea/interfaces/TextAreaChangeEvent';
|
|
25
|
+
export * from './textarea/interfaces/TextAreaFocusEvent';
|
package/dist/npm/main.js
CHANGED
|
@@ -10,6 +10,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
10
|
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
var Switch_1 = require("./switch/Switch");
|
|
14
|
+
Object.defineProperty(exports, "Switch", { enumerable: true, get: function () { return Switch_1.Switch; } });
|
|
13
15
|
__exportStar(require("./input/Input"), exports);
|
|
14
16
|
__exportStar(require("./numerictextbox/NumericTextBox"), exports);
|
|
15
17
|
__exportStar(require("./maskedtextbox/MaskedTextBox"), exports);
|
|
@@ -28,3 +30,7 @@ __exportStar(require("./radiobutton/RadioButton"), exports);
|
|
|
28
30
|
__exportStar(require("./radiobutton/interfaces/RadioButtonProps"), exports);
|
|
29
31
|
__exportStar(require("./radiobutton/interfaces/RadioButtonChangeEvent"), exports);
|
|
30
32
|
__exportStar(require("./radiobutton/interfaces/RadioButtonFocusEvent"), exports);
|
|
33
|
+
__exportStar(require("./textarea/TextArea"), exports);
|
|
34
|
+
__exportStar(require("./textarea/interfaces/TextAreaProps"), exports);
|
|
35
|
+
__exportStar(require("./textarea/interfaces/TextAreaChangeEvent"), exports);
|
|
36
|
+
__exportStar(require("./textarea/interfaces/TextAreaFocusEvent"), 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: 1639996959,
|
|
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
|
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { DefineComponent } from '../additionalTypes';
|
|
2
|
+
import { RecordPropsDefinition, ComponentOptions } from 'vue/types/options';
|
|
3
|
+
declare type DefaultData<V> = object | ((this: V) => {});
|
|
4
|
+
declare type DefaultMethods<V> = {
|
|
5
|
+
[key: string]: (this: V, ...args: any[]) => any;
|
|
6
|
+
};
|
|
7
|
+
import { FormComponentProps } from '@progress/kendo-vue-common';
|
|
8
|
+
import { ToggleBaseProps } from '../interfaces/ToggleBaseProps';
|
|
9
|
+
import { LocalizationService } from '@progress/kendo-vue-intl';
|
|
10
|
+
/**
|
|
11
|
+
* The arguments for the `onChange` Switch event.
|
|
12
|
+
*/
|
|
13
|
+
export interface SwitchChangeEvent {
|
|
14
|
+
/**
|
|
15
|
+
* The new value of the Switch.
|
|
16
|
+
*/
|
|
17
|
+
value: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Represents the props of the [Kendo UI for Vue Switch component]({% slug overview_switch %}).
|
|
21
|
+
*/
|
|
22
|
+
export interface SwitchProps extends ToggleBaseProps, FormComponentProps {
|
|
23
|
+
/**
|
|
24
|
+
* Specifies the `accessKey` of the Switch.
|
|
25
|
+
*/
|
|
26
|
+
accessKey?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Sets the current value of the Switch ([see example]({% slug controlled_switch %})).
|
|
29
|
+
*/
|
|
30
|
+
checked?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Sets the `className` of the wrapping element of the Switch.
|
|
33
|
+
*/
|
|
34
|
+
className?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Sets the value of the Switch when it is initially displayed ([see example]({% slug default_state %})).
|
|
37
|
+
*/
|
|
38
|
+
defaultChecked?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Sets the default value of the Switch.
|
|
41
|
+
*/
|
|
42
|
+
defaultValue?: any;
|
|
43
|
+
/**
|
|
44
|
+
* Disables the Switch when set to `true` ([see example]({% slug disabled_switch %})).
|
|
45
|
+
*/
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Sets the `dir` property of the wrapping element of the Switch.
|
|
49
|
+
*/
|
|
50
|
+
dir?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Sets the `id` of the Switch.
|
|
53
|
+
*/
|
|
54
|
+
id?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Identifies the element(s) which will describe the component, similar to [HTML aria-describedby attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-describedby_attribute).
|
|
57
|
+
* For example these elements could contain error or hint message.
|
|
58
|
+
*/
|
|
59
|
+
ariaDescribedBy?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Identifies the element(s) which will label the component.
|
|
62
|
+
*/
|
|
63
|
+
ariaLabelledBy?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Changes the **Off** label([see example]({% slug labels_switch %})).
|
|
66
|
+
*/
|
|
67
|
+
offLabel?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Fires each time the Switch gets blurred.
|
|
70
|
+
*/
|
|
71
|
+
onBlur?: (event: any) => void;
|
|
72
|
+
/**
|
|
73
|
+
* Fires each time the user selects a new value ([see example]({% slug controlled_switch %})).
|
|
74
|
+
*/
|
|
75
|
+
onChange?: (event: SwitchChangeEvent) => void;
|
|
76
|
+
/**
|
|
77
|
+
* Fires each time the Switch component gets focused.
|
|
78
|
+
*/
|
|
79
|
+
onFocus?: (event: any) => void;
|
|
80
|
+
/**
|
|
81
|
+
* Changes the **On** label ([see example]({% slug labels_switch %})).
|
|
82
|
+
*/
|
|
83
|
+
onLabel?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Specifies the [`tabIndex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
|
|
86
|
+
*/
|
|
87
|
+
tabIndex?: number;
|
|
88
|
+
/**
|
|
89
|
+
* Sets the value of the Switch. It can either be of the primitive (string, number, boolean) or of the complex (array) type.
|
|
90
|
+
*/
|
|
91
|
+
value?: string | number | string[] | boolean | null;
|
|
92
|
+
modelValue?: string | number | string[] | boolean | null;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* @hidden
|
|
96
|
+
*/
|
|
97
|
+
export interface SwitchState {
|
|
98
|
+
_element: HTMLSpanElement | null;
|
|
99
|
+
_input: HTMLInputElement | null;
|
|
100
|
+
_id: string;
|
|
101
|
+
dir?: string;
|
|
102
|
+
defaultValidationMessage: LocalizationService;
|
|
103
|
+
eventTimeStamp?: number;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* @hidden
|
|
107
|
+
*/
|
|
108
|
+
export interface SwitchComputed {
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* @hidden
|
|
112
|
+
*/
|
|
113
|
+
export interface SwitchMethods {
|
|
114
|
+
[key: string]: any;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* @hidden
|
|
118
|
+
*/
|
|
119
|
+
export interface SwitchData {
|
|
120
|
+
valueDuringOnChange?: boolean;
|
|
121
|
+
currentChecked: boolean;
|
|
122
|
+
focused: boolean;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* @hidden
|
|
126
|
+
*/
|
|
127
|
+
export interface SwitchAll extends Vue, SwitchMethods, SwitchData, SwitchComputed, SwitchState {
|
|
128
|
+
}
|
|
129
|
+
declare let Switch: ComponentOptions<SwitchAll, DefaultData<SwitchData>, DefaultMethods<SwitchAll>, SwitchComputed, RecordPropsDefinition<SwitchProps>>;
|
|
130
|
+
declare const SwitchVue3: DefineComponent<SwitchProps, any, SwitchData, SwitchComputed, SwitchMethods, {}, {}, {}, string, SwitchProps, SwitchProps, {}>;
|
|
131
|
+
export { Switch, SwitchVue3 };
|