@progress/kendo-vue-inputs 2.7.0 → 2.7.2-dev.202201020746

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 (144) hide show
  1. package/dist/cdn/js/kendo-vue-inputs.js +1 -1
  2. package/dist/es/colors/ColorPalette.d.ts +55 -0
  3. package/dist/es/colors/ColorPalette.js +340 -0
  4. package/dist/es/colors/ColorPicker.d.ts +52 -0
  5. package/dist/es/colors/ColorPicker.js +382 -0
  6. package/dist/es/colors/Picker.d.ts +41 -0
  7. package/dist/es/colors/Picker.js +94 -0
  8. package/dist/es/colors/interfaces/ColorPaletteChangeEvent.d.ts +13 -0
  9. package/dist/es/colors/interfaces/ColorPaletteChangeEvent.js +0 -0
  10. package/dist/es/colors/interfaces/ColorPaletteProps.d.ts +75 -0
  11. package/dist/es/colors/interfaces/ColorPaletteProps.js +0 -0
  12. package/dist/es/colors/interfaces/ColorPickerActiveColorClick.d.ts +13 -0
  13. package/dist/es/colors/interfaces/ColorPickerActiveColorClick.js +0 -0
  14. package/dist/es/colors/interfaces/ColorPickerBlurEvent.d.ts +9 -0
  15. package/dist/es/colors/interfaces/ColorPickerBlurEvent.js +0 -0
  16. package/dist/es/colors/interfaces/ColorPickerChangeEvent.d.ts +13 -0
  17. package/dist/es/colors/interfaces/ColorPickerChangeEvent.js +0 -0
  18. package/dist/es/colors/interfaces/ColorPickerFocusEvent.d.ts +9 -0
  19. package/dist/es/colors/interfaces/ColorPickerFocusEvent.js +0 -0
  20. package/dist/es/colors/interfaces/ColorPickerPaletteSettings.d.ts +32 -0
  21. package/dist/es/colors/interfaces/ColorPickerPaletteSettings.js +0 -0
  22. package/dist/es/colors/interfaces/ColorPickerPopupSettings.d.ts +14 -0
  23. package/dist/es/colors/interfaces/ColorPickerPopupSettings.js +0 -0
  24. package/dist/es/colors/interfaces/ColorPickerProps.d.ts +142 -0
  25. package/dist/es/colors/interfaces/ColorPickerProps.js +0 -0
  26. package/dist/es/colors/interfaces/ColorPickerView.d.ts +10 -0
  27. package/dist/es/colors/interfaces/ColorPickerView.js +0 -0
  28. package/dist/es/colors/interfaces/PickerPopupSettings.d.ts +14 -0
  29. package/dist/es/colors/interfaces/PickerPopupSettings.js +0 -0
  30. package/dist/es/colors/interfaces/PickerProps.d.ts +42 -0
  31. package/dist/es/colors/interfaces/PickerProps.js +0 -0
  32. package/dist/es/colors/models/hsva.d.ts +9 -0
  33. package/dist/es/colors/models/hsva.js +0 -0
  34. package/dist/es/colors/models/output-format.d.ts +4 -0
  35. package/dist/es/colors/models/output-format.js +0 -0
  36. package/dist/es/colors/models/palette-presets.d.ts +53 -0
  37. package/dist/es/colors/models/palette-presets.js +54 -0
  38. package/dist/es/colors/models/rgb.d.ts +8 -0
  39. package/dist/es/colors/models/rgb.js +0 -0
  40. package/dist/es/colors/models/rgba.d.ts +9 -0
  41. package/dist/es/colors/models/rgba.js +0 -0
  42. package/dist/es/colors/models/table-cell.d.ts +7 -0
  43. package/dist/es/colors/models/table-cell.js +0 -0
  44. package/dist/es/colors/models/tile-size.d.ts +11 -0
  45. package/dist/es/colors/models/tile-size.js +0 -0
  46. package/dist/es/colors/utils/color-cache.d.ts +30 -0
  47. package/dist/es/colors/utils/color-cache.js +61 -0
  48. package/dist/es/colors/utils/color-palette.service.d.ts +12 -0
  49. package/dist/es/colors/utils/color-palette.service.js +76 -0
  50. package/dist/es/colors/utils/color-parser.d.ts +65 -0
  51. package/dist/es/colors/utils/color-parser.js +136 -0
  52. package/dist/es/colors/utils/misc.d.ts +15 -0
  53. package/dist/es/colors/utils/misc.js +20 -0
  54. package/dist/es/colors/utils/svg-calc.d.ts +62 -0
  55. package/dist/es/colors/utils/svg-calc.js +103 -0
  56. package/dist/es/main.d.ts +15 -0
  57. package/dist/es/main.js +15 -0
  58. package/dist/es/package-metadata.js +1 -1
  59. package/dist/es/switch/Switch.d.ts +131 -0
  60. package/dist/es/switch/Switch.js +307 -0
  61. package/dist/es/switch/util.d.ts +8 -0
  62. package/dist/es/switch/util.js +46 -0
  63. package/dist/es/textarea/TextArea.d.ts +46 -0
  64. package/dist/es/textarea/TextArea.js +251 -0
  65. package/dist/es/textarea/interfaces/TextAreaBlurEvent.d.ts +5 -0
  66. package/dist/es/textarea/interfaces/TextAreaBlurEvent.js +0 -0
  67. package/dist/es/textarea/interfaces/TextAreaChangeEvent.d.ts +9 -0
  68. package/dist/es/textarea/interfaces/TextAreaChangeEvent.js +0 -0
  69. package/dist/es/textarea/interfaces/TextAreaFocusEvent.d.ts +5 -0
  70. package/dist/es/textarea/interfaces/TextAreaFocusEvent.js +0 -0
  71. package/dist/es/textarea/interfaces/TextAreaProps.d.ts +84 -0
  72. package/dist/es/textarea/interfaces/TextAreaProps.js +0 -0
  73. package/dist/npm/colors/ColorPalette.d.ts +55 -0
  74. package/dist/npm/colors/ColorPalette.js +355 -0
  75. package/dist/npm/colors/ColorPicker.d.ts +52 -0
  76. package/dist/npm/colors/ColorPicker.js +395 -0
  77. package/dist/npm/colors/Picker.d.ts +41 -0
  78. package/dist/npm/colors/Picker.js +105 -0
  79. package/dist/npm/colors/interfaces/ColorPaletteChangeEvent.d.ts +13 -0
  80. package/dist/npm/colors/interfaces/ColorPaletteChangeEvent.js +2 -0
  81. package/dist/npm/colors/interfaces/ColorPaletteProps.d.ts +75 -0
  82. package/dist/npm/colors/interfaces/ColorPaletteProps.js +2 -0
  83. package/dist/npm/colors/interfaces/ColorPickerActiveColorClick.d.ts +13 -0
  84. package/dist/npm/colors/interfaces/ColorPickerActiveColorClick.js +2 -0
  85. package/dist/npm/colors/interfaces/ColorPickerBlurEvent.d.ts +9 -0
  86. package/dist/npm/colors/interfaces/ColorPickerBlurEvent.js +2 -0
  87. package/dist/npm/colors/interfaces/ColorPickerChangeEvent.d.ts +13 -0
  88. package/dist/npm/colors/interfaces/ColorPickerChangeEvent.js +2 -0
  89. package/dist/npm/colors/interfaces/ColorPickerFocusEvent.d.ts +9 -0
  90. package/dist/npm/colors/interfaces/ColorPickerFocusEvent.js +2 -0
  91. package/dist/npm/colors/interfaces/ColorPickerPaletteSettings.d.ts +32 -0
  92. package/dist/npm/colors/interfaces/ColorPickerPaletteSettings.js +2 -0
  93. package/dist/npm/colors/interfaces/ColorPickerPopupSettings.d.ts +14 -0
  94. package/dist/npm/colors/interfaces/ColorPickerPopupSettings.js +2 -0
  95. package/dist/npm/colors/interfaces/ColorPickerProps.d.ts +142 -0
  96. package/dist/npm/colors/interfaces/ColorPickerProps.js +2 -0
  97. package/dist/npm/colors/interfaces/ColorPickerView.d.ts +10 -0
  98. package/dist/npm/colors/interfaces/ColorPickerView.js +2 -0
  99. package/dist/npm/colors/interfaces/PickerPopupSettings.d.ts +14 -0
  100. package/dist/npm/colors/interfaces/PickerPopupSettings.js +2 -0
  101. package/dist/npm/colors/interfaces/PickerProps.d.ts +42 -0
  102. package/dist/npm/colors/interfaces/PickerProps.js +2 -0
  103. package/dist/npm/colors/models/hsva.d.ts +9 -0
  104. package/dist/npm/colors/models/hsva.js +2 -0
  105. package/dist/npm/colors/models/output-format.d.ts +4 -0
  106. package/dist/npm/colors/models/output-format.js +2 -0
  107. package/dist/npm/colors/models/palette-presets.d.ts +53 -0
  108. package/dist/npm/colors/models/palette-presets.js +57 -0
  109. package/dist/npm/colors/models/rgb.d.ts +8 -0
  110. package/dist/npm/colors/models/rgb.js +2 -0
  111. package/dist/npm/colors/models/rgba.d.ts +9 -0
  112. package/dist/npm/colors/models/rgba.js +2 -0
  113. package/dist/npm/colors/models/table-cell.d.ts +7 -0
  114. package/dist/npm/colors/models/table-cell.js +2 -0
  115. package/dist/npm/colors/models/tile-size.d.ts +11 -0
  116. package/dist/npm/colors/models/tile-size.js +2 -0
  117. package/dist/npm/colors/utils/color-cache.d.ts +30 -0
  118. package/dist/npm/colors/utils/color-cache.js +71 -0
  119. package/dist/npm/colors/utils/color-palette.service.d.ts +12 -0
  120. package/dist/npm/colors/utils/color-palette.service.js +79 -0
  121. package/dist/npm/colors/utils/color-parser.d.ts +65 -0
  122. package/dist/npm/colors/utils/color-parser.js +139 -0
  123. package/dist/npm/colors/utils/misc.d.ts +15 -0
  124. package/dist/npm/colors/utils/misc.js +23 -0
  125. package/dist/npm/colors/utils/svg-calc.d.ts +62 -0
  126. package/dist/npm/colors/utils/svg-calc.js +106 -0
  127. package/dist/npm/main.d.ts +15 -0
  128. package/dist/npm/main.js +17 -0
  129. package/dist/npm/package-metadata.js +1 -1
  130. package/dist/npm/switch/Switch.d.ts +131 -0
  131. package/dist/npm/switch/Switch.js +320 -0
  132. package/dist/npm/switch/util.d.ts +8 -0
  133. package/dist/npm/switch/util.js +49 -0
  134. package/dist/npm/textarea/TextArea.d.ts +46 -0
  135. package/dist/npm/textarea/TextArea.js +261 -0
  136. package/dist/npm/textarea/interfaces/TextAreaBlurEvent.d.ts +5 -0
  137. package/dist/npm/textarea/interfaces/TextAreaBlurEvent.js +2 -0
  138. package/dist/npm/textarea/interfaces/TextAreaChangeEvent.d.ts +9 -0
  139. package/dist/npm/textarea/interfaces/TextAreaChangeEvent.js +2 -0
  140. package/dist/npm/textarea/interfaces/TextAreaFocusEvent.d.ts +5 -0
  141. package/dist/npm/textarea/interfaces/TextAreaFocusEvent.js +2 -0
  142. package/dist/npm/textarea/interfaces/TextAreaProps.d.ts +84 -0
  143. package/dist/npm/textarea/interfaces/TextAreaProps.js +5 -0
  144. package/package.json +13 -7
@@ -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 };
@@ -0,0 +1,320 @@
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: {
82
+ type: [String, Number, Boolean],
83
+ default: undefined
84
+ },
85
+ modelValue: {
86
+ type: Boolean,
87
+ default: undefined
88
+ }
89
+ },
90
+ created: function created() {
91
+ kendo_vue_common_1.validatePackage(package_metadata_1.packageMetadata);
92
+ this._id = kendo_vue_common_1.guid();
93
+ this.defaultValidationMessage = kendo_vue_intl_1.provideLocalizationService(this);
94
+ },
95
+ data: function data() {
96
+ return {
97
+ currentChecked: this.$props.defaultChecked,
98
+ valueDuringOnChange: undefined,
99
+ focused: false,
100
+ currentDir: undefined
101
+ };
102
+ },
103
+ computed: {
104
+ computedValue: function computedValue() {
105
+ 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;
106
+ },
107
+ switchClassName: function switchClassName() {
108
+ var isValid = !this.validityStyles || this.validity().valid;
109
+ return {
110
+ 'k-widget': true,
111
+ 'k-switch': true,
112
+ 'k-switch-on': this.computedValue,
113
+ 'k-switch-off': !this.computedValue,
114
+ 'k-state-focused': this.focused,
115
+ 'k-state-disabled': this.$props.disabled,
116
+ 'k-state-invalid': !isValid
117
+ };
118
+ }
119
+ },
120
+ mounted: function mounted() {
121
+ this._element = this.v3 ? this.elementRef : this.$refs.element;
122
+ this.input = this.v3 ? this.inputRef : this.$refs.input;
123
+ this.currentDir = this.$props.dir !== undefined ? this.$props.dir : kendo_vue_common_1.isRtl(this.$el) ? 'rtl' : 'ltr';
124
+ this.setValidity();
125
+ },
126
+ updated: function updated() {
127
+ this.setValidity();
128
+ },
129
+ // @ts-ignore
130
+ setup: !gh ? undefined : function () {
131
+ var v3 = !!gh;
132
+ return {
133
+ v3: v3
134
+ };
135
+ },
136
+ // @ts-ignore
137
+ render: function render(createElement) {
138
+ var _this = this;
139
+
140
+ var h = gh || createElement;
141
+ var _a = this.$props,
142
+ disabled = _a.disabled,
143
+ id = _a.id,
144
+ offLabel = _a.offLabel,
145
+ onLabel = _a.onLabel,
146
+ tabIndex = _a.tabIndex;
147
+ return h("span", {
148
+ "class": this.switchClassName,
149
+ dir: this.currentDir,
150
+ attrs: this.v3 ? undefined : {
151
+ dir: this.currentDir
152
+ },
153
+ onKeydown: this.handleKeyDown,
154
+ on: this.v3 ? undefined : {
155
+ "keydown": this.handleKeyDown,
156
+ "click": this.handleClick,
157
+ "focusout": this.handleWrapperBlur,
158
+ "focusin": this.handleWrapperFocus
159
+ },
160
+ onClick: this.handleClick,
161
+ onFocusout: this.handleWrapperBlur,
162
+ onFocusin: this.handleWrapperFocus
163
+ }, [h("span", {
164
+ "class": SWITCH_CONTAINER,
165
+ id: id || this._id,
166
+ attrs: this.v3 ? undefined : {
167
+ id: id || this._id,
168
+ role: 'switch',
169
+ "aria-checked": this.computedValue,
170
+ "aria-disabled": disabled || undefined,
171
+ "aria-labelledby": this.$props.ariaLabelledBy,
172
+ "aria-describedby": this.$props.ariaDescribedBy,
173
+ tabIndex: kendo_vue_common_1.getTabIndex(tabIndex, disabled, undefined),
174
+ accessKey: this.$props.accessKey
175
+ },
176
+ role: 'switch',
177
+ "aria-checked": this.computedValue,
178
+ "aria-disabled": disabled || undefined,
179
+ "aria-labelledby": this.$props.ariaLabelledBy,
180
+ "aria-describedby": this.$props.ariaDescribedBy,
181
+ ref: this.v3 ? function (el) {
182
+ _this.elementRef = el;
183
+ } : 'element',
184
+ tabIndex: kendo_vue_common_1.getTabIndex(tabIndex, disabled, undefined),
185
+ accessKey: this.$props.accessKey
186
+ }, [h("input", {
187
+ type: "checkbox",
188
+ attrs: this.v3 ? undefined : {
189
+ type: "checkbox",
190
+ tabIndex: -1,
191
+ "aria-hidden": true
192
+ },
193
+ checked: this.v3 ? this.$props.checked : null,
194
+ domProps: this.v3 ? undefined : {
195
+ "checked": this.$props.checked,
196
+ "value": this.computedValue
197
+ },
198
+ ref: this.v3 ? function (el) {
199
+ _this.inputRef = el;
200
+ } : 'input',
201
+ tabIndex: -1,
202
+ "aria-hidden": true,
203
+ value: this.v3 ? this.computedValue : null,
204
+ style: {
205
+ opacity: 0,
206
+ width: 1,
207
+ border: 0,
208
+ zIndex: -1,
209
+ position: 'absolute',
210
+ left: '50%'
211
+ },
212
+ onChange: kendo_vue_common_1.noop,
213
+ on: this.v3 ? undefined : {
214
+ "change": kendo_vue_common_1.noop
215
+ }
216
+ }), h("span", {
217
+ "class": SWITCH_LABEL_ON
218
+ }, [onLabel]), h("span", {
219
+ "class": SWITCH_LABEL_OFF
220
+ }, [offLabel]), h("span", {
221
+ "class": SWITCH_HANDLE
222
+ })])]);
223
+ },
224
+ methods: {
225
+ focus: function focus() {
226
+ if (this._element) {
227
+ this._element.focus();
228
+ }
229
+ },
230
+ element: function element() {
231
+ return this._element;
232
+ },
233
+ name: function name() {
234
+ return this.$props.name;
235
+ },
236
+ validity: function validity() {
237
+ var customError = this.$props.validationMessage !== undefined;
238
+ var isValid = this.$props.valid !== undefined ? this.$props.valid : !this.$props.required ? true : this.computedValue ? true : false;
239
+ var valid = this.$props.valid !== undefined ? this.$props.valid : isValid;
240
+ return {
241
+ customError: customError,
242
+ valid: valid,
243
+ valueMissing: this.computedValue === null
244
+ };
245
+ },
246
+ setValidity: function setValidity() {
247
+ if (this.input && this.input.setCustomValidity) {
248
+ this.input.setCustomValidity(this.validity().valid ? '' : this.$props.validationMessage || this.defaultValidationMessage.toLanguageString(messages_1.switchValidation, messages_1.messages[messages_1.switchValidation]));
249
+ }
250
+ },
251
+ limit: function limit(offset, drag, wrapper) {
252
+ var wrapperWidth = wrapper.offsetWidth;
253
+ var margin = drag.offsetWidth;
254
+
255
+ if (offset < 0) {
256
+ return 0;
257
+ } else if (offset > wrapperWidth - margin) {
258
+ return wrapperWidth - margin;
259
+ }
260
+
261
+ return offset;
262
+ },
263
+ toggle: function toggle(value, event) {
264
+ this.currentChecked = value;
265
+ this.valueDuringOnChange = value;
266
+ this.$emit('change', {
267
+ event: event,
268
+ component: this,
269
+ target: {
270
+ value: value
271
+ },
272
+ name: this.$props.name,
273
+ value: value,
274
+ validity: this.validity()
275
+ });
276
+ this.$emit('changemodel', value);
277
+ this.$emit('update:modelValue', value);
278
+ this.valueDuringOnChange = undefined;
279
+ },
280
+ handleClick: function handleClick(event) {
281
+ if (this.eventTimeStamp === event.timeStamp) {
282
+ // This is guard against the case when wrapped in label, click event is emmited twice
283
+ return;
284
+ }
285
+
286
+ this.eventTimeStamp = event.timeStamp;
287
+ this.toggle(!this.computedValue, event);
288
+ },
289
+ handleKeyDown: function handleKeyDown(event) {
290
+ if (this.$props.disabled) {
291
+ return;
292
+ }
293
+
294
+ var keyCode = event.keyCode;
295
+
296
+ if (keyCode === kendo_vue_common_1.Keys.space || keyCode === kendo_vue_common_1.Keys.enter) {
297
+ this.toggle(!this.computedValue, event);
298
+ }
299
+ },
300
+ handleWrapperFocus: function handleWrapperFocus(event) {
301
+ if (this.$props.disabled) {
302
+ return;
303
+ }
304
+
305
+ this.focused = true;
306
+ this.$emit('focus', event);
307
+ },
308
+ handleWrapperBlur: function handleWrapperBlur(event) {
309
+ if (this.$props.disabled) {
310
+ return;
311
+ }
312
+
313
+ this.focused = false;
314
+ this.$emit('blur', event);
315
+ }
316
+ }
317
+ };
318
+ exports.Switch = Switch;
319
+ var SwitchVue3 = Switch;
320
+ 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 };