@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.
Files changed (36) hide show
  1. package/dist/cdn/js/kendo-vue-inputs.js +1 -1
  2. package/dist/es/main.d.ts +5 -0
  3. package/dist/es/main.js +5 -0
  4. package/dist/es/package-metadata.js +1 -1
  5. package/dist/es/switch/Switch.d.ts +131 -0
  6. package/dist/es/switch/Switch.js +304 -0
  7. package/dist/es/switch/util.d.ts +8 -0
  8. package/dist/es/switch/util.js +46 -0
  9. package/dist/es/textarea/TextArea.d.ts +46 -0
  10. package/dist/es/textarea/TextArea.js +251 -0
  11. package/dist/es/textarea/interfaces/TextAreaBlurEvent.d.ts +5 -0
  12. package/dist/es/textarea/interfaces/TextAreaBlurEvent.js +0 -0
  13. package/dist/es/textarea/interfaces/TextAreaChangeEvent.d.ts +9 -0
  14. package/dist/es/textarea/interfaces/TextAreaChangeEvent.js +0 -0
  15. package/dist/es/textarea/interfaces/TextAreaFocusEvent.d.ts +5 -0
  16. package/dist/es/textarea/interfaces/TextAreaFocusEvent.js +0 -0
  17. package/dist/es/textarea/interfaces/TextAreaProps.d.ts +84 -0
  18. package/dist/es/textarea/interfaces/TextAreaProps.js +0 -0
  19. package/dist/npm/main.d.ts +5 -0
  20. package/dist/npm/main.js +6 -0
  21. package/dist/npm/package-metadata.js +1 -1
  22. package/dist/npm/switch/Switch.d.ts +131 -0
  23. package/dist/npm/switch/Switch.js +317 -0
  24. package/dist/npm/switch/util.d.ts +8 -0
  25. package/dist/npm/switch/util.js +49 -0
  26. package/dist/npm/textarea/TextArea.d.ts +46 -0
  27. package/dist/npm/textarea/TextArea.js +261 -0
  28. package/dist/npm/textarea/interfaces/TextAreaBlurEvent.d.ts +5 -0
  29. package/dist/npm/textarea/interfaces/TextAreaBlurEvent.js +2 -0
  30. package/dist/npm/textarea/interfaces/TextAreaChangeEvent.d.ts +9 -0
  31. package/dist/npm/textarea/interfaces/TextAreaChangeEvent.js +2 -0
  32. package/dist/npm/textarea/interfaces/TextAreaFocusEvent.d.ts +5 -0
  33. package/dist/npm/textarea/interfaces/TextAreaFocusEvent.js +2 -0
  34. package/dist/npm/textarea/interfaces/TextAreaProps.d.ts +84 -0
  35. package/dist/npm/textarea/interfaces/TextAreaProps.js +5 -0
  36. package/package.json +7 -7
@@ -0,0 +1,317 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SwitchVue3 = exports.Switch = void 0; // @ts-ignore
7
+
8
+ var Vue = require("vue");
9
+
10
+ var allVue = Vue;
11
+ var gh = allVue.h;
12
+
13
+ var kendo_vue_common_1 = require("@progress/kendo-vue-common");
14
+
15
+ var kendo_vue_intl_1 = require("@progress/kendo-vue-intl");
16
+
17
+ var messages_1 = require("./../messages");
18
+
19
+ var package_metadata_1 = require("../package-metadata");
20
+
21
+ var SWITCH_CONTAINER = 'k-switch-container';
22
+ var SWITCH_HANDLE = 'k-switch-handle';
23
+ var SWITCH_LABEL_ON = 'k-switch-label-on';
24
+ var SWITCH_LABEL_OFF = 'k-switch-label-off'; // tslint:enable:max-line-length
25
+
26
+ var Switch = {
27
+ name: 'KendoSwitch',
28
+ model: {
29
+ event: 'changemodel'
30
+ },
31
+ // @ts-ignore
32
+ emits: {
33
+ 'change': null,
34
+ 'changemodel': null,
35
+ 'update:modelValue': null,
36
+ 'focus': null,
37
+ 'blur': null
38
+ },
39
+ props: {
40
+ accessKey: String,
41
+ checked: {
42
+ type: Boolean,
43
+ default: undefined
44
+ },
45
+ className: String,
46
+ disabled: {
47
+ type: Boolean,
48
+ default: false
49
+ },
50
+ defaultChecked: {
51
+ type: Boolean,
52
+ default: false
53
+ },
54
+ dir: String,
55
+ id: String,
56
+ ariaLabelledBy: String,
57
+ ariaDescribedBy: String,
58
+ offLabel: {
59
+ type: String,
60
+ default: 'OFF'
61
+ },
62
+ onLabel: {
63
+ type: String,
64
+ default: 'ON'
65
+ },
66
+ required: {
67
+ type: Boolean,
68
+ default: false
69
+ },
70
+ tabIndex: Number,
71
+ valid: Boolean,
72
+ // validate: {
73
+ // type: Boolean,
74
+ // default: false
75
+ // },
76
+ validityStyles: {
77
+ type: Boolean,
78
+ default: false
79
+ },
80
+ validationMessage: String,
81
+ value: [String, Number, Boolean],
82
+ modelValue: {
83
+ type: Boolean,
84
+ default: undefined
85
+ }
86
+ },
87
+ created: function created() {
88
+ kendo_vue_common_1.validatePackage(package_metadata_1.packageMetadata);
89
+ this._id = kendo_vue_common_1.guid();
90
+ this.defaultValidationMessage = kendo_vue_intl_1.provideLocalizationService(this);
91
+ },
92
+ data: function data() {
93
+ return {
94
+ currentChecked: this.$props.defaultChecked,
95
+ valueDuringOnChange: undefined,
96
+ focused: false,
97
+ currentDir: undefined
98
+ };
99
+ },
100
+ computed: {
101
+ computedValue: function computedValue() {
102
+ return this.valueDuringOnChange !== undefined ? this.valueDuringOnChange : this.$props.checked !== undefined ? this.$props.checked : this.$props.value !== undefined ? this.$props.value : this.$props.modelValue !== undefined ? this.$props.modelValue : this.currentChecked;
103
+ },
104
+ switchClassName: function switchClassName() {
105
+ var isValid = !this.validityStyles || this.validity().valid;
106
+ return {
107
+ 'k-widget': true,
108
+ 'k-switch': true,
109
+ 'k-switch-on': this.computedValue,
110
+ 'k-switch-off': !this.computedValue,
111
+ 'k-state-focused': this.focused,
112
+ 'k-state-disabled': this.$props.disabled,
113
+ 'k-state-invalid': !isValid
114
+ };
115
+ }
116
+ },
117
+ mounted: function mounted() {
118
+ this._element = this.v3 ? this.elementRef : this.$refs.element;
119
+ this.input = this.v3 ? this.inputRef : this.$refs.input;
120
+ this.currentDir = this.$props.dir !== undefined ? this.$props.dir : kendo_vue_common_1.isRtl(this.$el) ? 'rtl' : 'ltr';
121
+ this.setValidity();
122
+ },
123
+ updated: function updated() {
124
+ this.setValidity();
125
+ },
126
+ // @ts-ignore
127
+ setup: !gh ? undefined : function () {
128
+ var v3 = !!gh;
129
+ return {
130
+ v3: v3
131
+ };
132
+ },
133
+ // @ts-ignore
134
+ render: function render(createElement) {
135
+ var _this = this;
136
+
137
+ var h = gh || createElement;
138
+ var _a = this.$props,
139
+ disabled = _a.disabled,
140
+ id = _a.id,
141
+ offLabel = _a.offLabel,
142
+ onLabel = _a.onLabel,
143
+ tabIndex = _a.tabIndex;
144
+ return h("span", {
145
+ "class": this.switchClassName,
146
+ dir: this.currentDir,
147
+ attrs: this.v3 ? undefined : {
148
+ dir: this.currentDir
149
+ },
150
+ onKeydown: this.handleKeyDown,
151
+ on: this.v3 ? undefined : {
152
+ "keydown": this.handleKeyDown,
153
+ "click": this.handleClick,
154
+ "focusout": this.handleWrapperBlur,
155
+ "focusin": this.handleWrapperFocus
156
+ },
157
+ onClick: this.handleClick,
158
+ onFocusout: this.handleWrapperBlur,
159
+ onFocusin: this.handleWrapperFocus
160
+ }, [h("span", {
161
+ "class": SWITCH_CONTAINER,
162
+ id: id || this._id,
163
+ attrs: this.v3 ? undefined : {
164
+ id: id || this._id,
165
+ role: 'switch',
166
+ "aria-checked": this.computedValue,
167
+ "aria-disabled": disabled || undefined,
168
+ "aria-labelledby": this.$props.ariaLabelledBy,
169
+ "aria-describedby": this.$props.ariaDescribedBy,
170
+ tabIndex: kendo_vue_common_1.getTabIndex(tabIndex, disabled, undefined),
171
+ accessKey: this.$props.accessKey
172
+ },
173
+ role: 'switch',
174
+ "aria-checked": this.computedValue,
175
+ "aria-disabled": disabled || undefined,
176
+ "aria-labelledby": this.$props.ariaLabelledBy,
177
+ "aria-describedby": this.$props.ariaDescribedBy,
178
+ ref: this.v3 ? function (el) {
179
+ _this.elementRef = el;
180
+ } : 'element',
181
+ tabIndex: kendo_vue_common_1.getTabIndex(tabIndex, disabled, undefined),
182
+ accessKey: this.$props.accessKey
183
+ }, [h("input", {
184
+ type: "checkbox",
185
+ attrs: this.v3 ? undefined : {
186
+ type: "checkbox",
187
+ tabIndex: -1,
188
+ "aria-hidden": true
189
+ },
190
+ checked: this.v3 ? this.$props.checked : null,
191
+ domProps: this.v3 ? undefined : {
192
+ "checked": this.$props.checked,
193
+ "value": this.computedValue
194
+ },
195
+ ref: this.v3 ? function (el) {
196
+ _this.inputRef = el;
197
+ } : 'input',
198
+ tabIndex: -1,
199
+ "aria-hidden": true,
200
+ value: this.v3 ? this.computedValue : null,
201
+ style: {
202
+ opacity: 0,
203
+ width: 1,
204
+ border: 0,
205
+ zIndex: -1,
206
+ position: 'absolute',
207
+ left: '50%'
208
+ },
209
+ onChange: kendo_vue_common_1.noop,
210
+ on: this.v3 ? undefined : {
211
+ "change": kendo_vue_common_1.noop
212
+ }
213
+ }), h("span", {
214
+ "class": SWITCH_LABEL_ON
215
+ }, [onLabel]), h("span", {
216
+ "class": SWITCH_LABEL_OFF
217
+ }, [offLabel]), h("span", {
218
+ "class": SWITCH_HANDLE
219
+ })])]);
220
+ },
221
+ methods: {
222
+ focus: function focus() {
223
+ if (this._element) {
224
+ this._element.focus();
225
+ }
226
+ },
227
+ element: function element() {
228
+ return this._element;
229
+ },
230
+ name: function name() {
231
+ return this.$props.name;
232
+ },
233
+ validity: function validity() {
234
+ var customError = this.$props.validationMessage !== undefined;
235
+ var isValid = this.$props.valid !== undefined ? this.$props.valid : !this.$props.required ? true : this.computedValue ? true : false;
236
+ var valid = this.$props.valid !== undefined ? this.$props.valid : isValid;
237
+ return {
238
+ customError: customError,
239
+ valid: valid,
240
+ valueMissing: this.computedValue === null
241
+ };
242
+ },
243
+ setValidity: function setValidity() {
244
+ if (this.input && this.input.setCustomValidity) {
245
+ this.input.setCustomValidity(this.validity().valid ? '' : this.$props.validationMessage || this.defaultValidationMessage.toLanguageString(messages_1.switchValidation, messages_1.messages[messages_1.switchValidation]));
246
+ }
247
+ },
248
+ limit: function limit(offset, drag, wrapper) {
249
+ var wrapperWidth = wrapper.offsetWidth;
250
+ var margin = drag.offsetWidth;
251
+
252
+ if (offset < 0) {
253
+ return 0;
254
+ } else if (offset > wrapperWidth - margin) {
255
+ return wrapperWidth - margin;
256
+ }
257
+
258
+ return offset;
259
+ },
260
+ toggle: function toggle(value, event) {
261
+ this.currentChecked = value;
262
+ this.valueDuringOnChange = value;
263
+ this.$emit('change', {
264
+ event: event,
265
+ component: this,
266
+ target: {
267
+ value: value
268
+ },
269
+ name: this.$props.name,
270
+ value: value,
271
+ validity: this.validity()
272
+ });
273
+ this.$emit('changemodel', value);
274
+ this.$emit('update:modelValue', value);
275
+ this.valueDuringOnChange = undefined;
276
+ },
277
+ handleClick: function handleClick(event) {
278
+ if (this.eventTimeStamp === event.timeStamp) {
279
+ // This is guard against the case when wrapped in label, click event is emmited twice
280
+ return;
281
+ }
282
+
283
+ this.eventTimeStamp = event.timeStamp;
284
+ this.toggle(!this.computedValue, event);
285
+ },
286
+ handleKeyDown: function handleKeyDown(event) {
287
+ if (this.$props.disabled) {
288
+ return;
289
+ }
290
+
291
+ var keyCode = event.keyCode;
292
+
293
+ if (keyCode === kendo_vue_common_1.Keys.space || keyCode === kendo_vue_common_1.Keys.enter) {
294
+ this.toggle(!this.computedValue, event);
295
+ }
296
+ },
297
+ handleWrapperFocus: function handleWrapperFocus(event) {
298
+ if (this.$props.disabled) {
299
+ return;
300
+ }
301
+
302
+ this.focused = true;
303
+ this.$emit('focus', event);
304
+ },
305
+ handleWrapperBlur: function handleWrapperBlur(event) {
306
+ if (this.$props.disabled) {
307
+ return;
308
+ }
309
+
310
+ this.focused = false;
311
+ this.$emit('blur', event);
312
+ }
313
+ }
314
+ };
315
+ exports.Switch = Switch;
316
+ var SwitchVue3 = Switch;
317
+ exports.SwitchVue3 = SwitchVue3;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @hidden
3
+ */
4
+ export declare const FRAME_DURATION: number;
5
+ /**
6
+ * @hidden
7
+ */
8
+ export declare const throttle: (func: Function, wait: number, options?: any) => (this: any) => any;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.throttle = exports.FRAME_DURATION = void 0;
4
+ /**
5
+ * @hidden
6
+ */
7
+ exports.FRAME_DURATION = 1000 / 60; // 1000ms divided by 60fps
8
+ /**
9
+ * @hidden
10
+ */
11
+ exports.throttle = function (func, wait, options) {
12
+ if (options === void 0) { options = {}; }
13
+ var timeout, context, args, result;
14
+ var previous = 0;
15
+ options = options || {};
16
+ var later = function () {
17
+ previous = options.leading === false ? 0 : new Date().getTime();
18
+ timeout = null;
19
+ result = func.apply(context, args);
20
+ if (!timeout) {
21
+ context = args = null;
22
+ }
23
+ };
24
+ var throttled = function () {
25
+ var now = new Date().getTime();
26
+ if (!previous && options.leading === false) {
27
+ previous = now;
28
+ }
29
+ var remaining = wait - (now - previous);
30
+ context = this;
31
+ args = arguments;
32
+ if (remaining <= 0 || remaining > wait) {
33
+ if (timeout) {
34
+ clearTimeout(timeout);
35
+ timeout = null;
36
+ }
37
+ previous = now;
38
+ result = func.apply(context, args);
39
+ if (!timeout) {
40
+ context = args = null;
41
+ }
42
+ }
43
+ else if (!timeout && options.trailing !== false) {
44
+ timeout = window.setTimeout(later, remaining);
45
+ }
46
+ return result;
47
+ };
48
+ return throttled;
49
+ };
@@ -0,0 +1,46 @@
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 { TextAreaProps } from './interfaces/TextAreaProps';
8
+ /**
9
+ * @hidden
10
+ */
11
+ export interface TextAreaHandle {
12
+ element: HTMLTextAreaElement | null;
13
+ focus: any;
14
+ name?: string | null;
15
+ }
16
+ /**
17
+ * @hidden
18
+ */
19
+ export interface TextAreaState {
20
+ }
21
+ /**
22
+ * @hidden
23
+ */
24
+ export interface TextAreaComputed {
25
+ [key: string]: any;
26
+ }
27
+ /**
28
+ * @hidden
29
+ */
30
+ export interface TextAreaMethods {
31
+ [key: string]: any;
32
+ }
33
+ /**
34
+ * @hidden
35
+ */
36
+ export interface TextAreaData {
37
+ currentActive: boolean;
38
+ }
39
+ /**
40
+ * @hidden
41
+ */
42
+ export interface TextAreaAll extends Vue, TextAreaMethods, TextAreaData, TextAreaComputed, TextAreaState {
43
+ }
44
+ declare let TextArea: ComponentOptions<TextAreaAll, DefaultData<TextAreaData>, DefaultMethods<TextAreaAll>, TextAreaComputed, RecordPropsDefinition<TextAreaProps>>;
45
+ declare const TextAreaVue3: DefineComponent<TextAreaProps, any, TextAreaData, TextAreaComputed, TextAreaMethods, {}, {}, {}, string, TextAreaProps, TextAreaProps, {}>;
46
+ export { TextArea, TextAreaVue3 };
@@ -0,0 +1,261 @@
1
+ "use strict";
2
+
3
+ var __assign = undefined && undefined.__assign || function () {
4
+ __assign = Object.assign || function (t) {
5
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
6
+ s = arguments[i];
7
+
8
+ for (var p in s) {
9
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
10
+ }
11
+ }
12
+
13
+ return t;
14
+ };
15
+
16
+ return __assign.apply(this, arguments);
17
+ };
18
+
19
+ Object.defineProperty(exports, "__esModule", {
20
+ value: true
21
+ });
22
+ exports.TextAreaVue3 = exports.TextArea = void 0; // @ts-ignore
23
+
24
+ var Vue = require("vue");
25
+
26
+ var allVue = Vue;
27
+ var gh = allVue.h;
28
+
29
+ var kendo_vue_common_1 = require("@progress/kendo-vue-common");
30
+
31
+ var package_metadata_1 = require("../package-metadata"); // tslint:enable:max-line-length
32
+
33
+
34
+ var TextArea = {
35
+ name: 'KendoTextArea',
36
+ inheritAttrs: false,
37
+ model: {
38
+ event: 'changemodel'
39
+ },
40
+ // @ts-ignore
41
+ emits: {
42
+ 'input': null,
43
+ 'change': null,
44
+ 'changemodel': null,
45
+ 'update:modelValue': null,
46
+ 'focus': null,
47
+ 'blur': null
48
+ },
49
+ props: {
50
+ ariaDescribedBy: String,
51
+ ariaLabelledBy: String,
52
+ autoSize: Boolean,
53
+ modelValue: {
54
+ type: [String, Array, Number],
55
+ default: undefined
56
+ },
57
+ defaultValue: [String, Number],
58
+ dir: String,
59
+ disabled: Boolean,
60
+ readOnly: Boolean,
61
+ rows: Number,
62
+ id: String,
63
+ name: String,
64
+ required: Boolean,
65
+ placeholder: String,
66
+ tabIndex: Number,
67
+ valid: {
68
+ type: Boolean,
69
+ default: undefined
70
+ },
71
+ value: [String, Array, Number],
72
+ validityStyles: {
73
+ type: Boolean,
74
+ default: true
75
+ }
76
+ },
77
+ created: function created() {
78
+ kendo_vue_common_1.validatePackage(package_metadata_1.packageMetadata);
79
+ this.calculatedId = kendo_vue_common_1.guid();
80
+ },
81
+ computed: {
82
+ rootClassName: function rootClassName() {
83
+ return {
84
+ 'k-textarea': true,
85
+ 'k-state-invalid': this.validityStyles === true ? !this.isValid : false,
86
+ 'k-state-disabled': this.$props.disabled
87
+ };
88
+ },
89
+ computedValue: function computedValue() {
90
+ return this.$props.value !== undefined ? this.$props.value : this.$props.modelValue !== undefined ? this.$props.modelValue : this.currentValue;
91
+ },
92
+ isValid: function isValid() {
93
+ return this.valid !== undefined ? this.valid : !this.required ? true : this.computedValue ? true : false;
94
+ }
95
+ },
96
+ data: function data() {
97
+ return {
98
+ currentValue: this.$props.defaultValue,
99
+ textAreaHeight: 'auto',
100
+ currentDir: 'ltr'
101
+ };
102
+ },
103
+ mounted: function mounted() {
104
+ this.element = this.v3 ? this.elementRef : this.$refs.element;
105
+ this.currentDir = this.$props.dir !== undefined ? this.$props.dir : kendo_vue_common_1.isRtl(this.$el) ? 'rtl' : 'ltr';
106
+ this.setValidity();
107
+ },
108
+ updated: function updated() {
109
+ this.element = this.v3 ? this.elementRef : this.$refs.element;
110
+ this.setValidity();
111
+ },
112
+ // @ts-ignore
113
+ setup: !gh ? undefined : function () {
114
+ var v3 = !!gh;
115
+ return {
116
+ v3: v3
117
+ };
118
+ },
119
+ // @ts-ignore
120
+ render: function render(createElement) {
121
+ var _this = this;
122
+
123
+ var h = gh || createElement;
124
+ var _a = this.$props,
125
+ ariaDescribedBy = _a.ariaDescribedBy,
126
+ ariaLabelledBy = _a.ariaLabelledBy,
127
+ autoSize = _a.autoSize,
128
+ disabled = _a.disabled,
129
+ readOnly = _a.readOnly,
130
+ required = _a.required,
131
+ rows = _a.rows,
132
+ id = _a.id,
133
+ name = _a.name,
134
+ placeholder = _a.placeholder,
135
+ tabIndex = _a.tabIndex;
136
+
137
+ var textAreaAttrs = __assign({
138
+ id: id || this.calculatedId,
139
+ name: name,
140
+ disabled: disabled,
141
+ rows: rows,
142
+ placeholder: placeholder,
143
+ readOnly: readOnly,
144
+ required: required,
145
+ tabIndex: kendo_vue_common_1.getTabIndex(tabIndex, disabled),
146
+ 'aria-labelledby': ariaLabelledBy,
147
+ 'aria-describedby': ariaDescribedBy,
148
+ 'aria-multiline': true,
149
+ 'aria-disabled': disabled || undefined
150
+ }, this.$attrs);
151
+
152
+ var textarea = h('textarea', __assign(__assign({}, textAreaAttrs), {
153
+ attrs: this.v3 ? undefined : textAreaAttrs,
154
+ 'class': 'k-input',
155
+ ref: this.v3 ? function (el) {
156
+ _this.elementRef = el;
157
+ } : 'element',
158
+ style: autoSize ? {
159
+ resize: 'none',
160
+ overflow: 'hidden',
161
+ height: this.textAreaHeight
162
+ } : {},
163
+ value: this.v3 ? this.computedValue : null,
164
+ domProps: this.v3 ? undefined : {
165
+ 'value': this.computedValue
166
+ },
167
+ onChange: this.handleChange,
168
+ onInput: this.handleInput,
169
+ on: this.v3 ? undefined : {
170
+ 'change': this.handleChange,
171
+ 'focus': this.handleFocus,
172
+ 'blur': this.handleBlur,
173
+ input: this.handleInput
174
+ },
175
+ onFocus: this.handleFocus,
176
+ onBlur: this.handleBlur
177
+ }));
178
+ return h("span", {
179
+ "class": this.rootClassName,
180
+ dir: this.currentDir,
181
+ attrs: this.v3 ? undefined : {
182
+ dir: this.currentDir
183
+ }
184
+ }, [textarea]);
185
+ },
186
+ methods: {
187
+ setValidity: function setValidity() {
188
+ if (this.element && this.element.setCustomValidity) {
189
+ this.element.setCustomValidity(this.isValid ? '' : this.validationMessage || '');
190
+ }
191
+
192
+ if (this.element) {
193
+ this.textAreaHeight = this.element.scrollHeight + "px";
194
+ }
195
+ },
196
+ focus: function focus() {
197
+ if (this.element) {
198
+ this.element.focus();
199
+ }
200
+ },
201
+ handleChange: function handleChange(event) {
202
+ var newValue = event.target.value;
203
+
204
+ if (!this.$props.disabled) {
205
+ this.textAreaHeight = 'auto';
206
+ this.currentValue = newValue;
207
+ }
208
+
209
+ if (!this.$props.disabled) {
210
+ this.$emit('change', {
211
+ event: event,
212
+ component: this,
213
+ name: this.element.name,
214
+ value: newValue
215
+ });
216
+ this.$emit('changemodel', newValue);
217
+ this.$emit('update:modelValue', newValue);
218
+ }
219
+ },
220
+ handleInput: function handleInput(event) {
221
+ var newValue = event.target.value;
222
+
223
+ if (!this.$props.disabled) {
224
+ this.textAreaHeight = 'auto';
225
+ this.currentValue = newValue;
226
+ }
227
+
228
+ if (!this.$props.disabled) {
229
+ this.$emit('input', {
230
+ event: event,
231
+ component: this,
232
+ name: this.element.name,
233
+ value: newValue
234
+ });
235
+ this.$emit('changemodel', newValue);
236
+ this.$emit('update:modelValue', newValue);
237
+ }
238
+ },
239
+ handleFocus: function handleFocus(event) {
240
+ if (!this.$props.disabled) {
241
+ this.$emit('focus', {
242
+ event: event,
243
+ component: this,
244
+ name: this.element.name
245
+ });
246
+ }
247
+ },
248
+ handleBlur: function handleBlur(event) {
249
+ if (!this.$props.disabled) {
250
+ this.$emit('blur', {
251
+ event: event,
252
+ component: this,
253
+ name: this.element.name
254
+ });
255
+ }
256
+ }
257
+ }
258
+ };
259
+ exports.TextArea = TextArea;
260
+ var TextAreaVue3 = TextArea;
261
+ exports.TextAreaVue3 = TextAreaVue3;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * The arguments for the `onBlur` TextArea event.
3
+ */
4
+ export interface TextAreaBlurEvent {
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The arguments for the `onChange` TextArea event.
3
+ */
4
+ export interface TextAreaChangeEvent {
5
+ /**
6
+ * The new value of the TextArea.
7
+ */
8
+ value: string;
9
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });