@progress/kendo-vue-inputs 3.6.4 → 3.6.5-dev.202210181442

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 (74) hide show
  1. package/dist/cdn/js/kendo-vue-inputs.js +1 -1
  2. package/dist/es/checkbox/Checkbox.js +17 -35
  3. package/dist/es/colors/ColorContrastLabels.js +0 -2
  4. package/dist/es/colors/ColorContrastSvg.js +6 -20
  5. package/dist/es/colors/ColorGradient.js +2 -28
  6. package/dist/es/colors/ColorInput.js +12 -20
  7. package/dist/es/colors/ColorPalette.js +0 -19
  8. package/dist/es/colors/ColorPicker.js +28 -52
  9. package/dist/es/colors/FlatColorPicker.js +14 -24
  10. package/dist/es/colors/HexInput.js +0 -4
  11. package/dist/es/colors/Picker.js +6 -9
  12. package/dist/es/input/Input.js +15 -29
  13. package/dist/es/input-separator/InputSeparator.js +0 -2
  14. package/dist/es/maskedtextbox/MaskedTextBox.js +13 -32
  15. package/dist/es/numerictextbox/NumericTextBox.js +15 -48
  16. package/dist/es/numerictextbox/utils/main.js +33 -132
  17. package/dist/es/package-metadata.js +1 -1
  18. package/dist/es/radiobutton/RadioButton.js +11 -16
  19. package/dist/es/radiobutton/RadioGroup.js +9 -12
  20. package/dist/es/range-slider/RangeSlider.js +9 -32
  21. package/dist/es/range-slider/range-raducer.js +0 -26
  22. package/dist/es/slider/Slider.js +8 -20
  23. package/dist/es/slider/SliderLabel.js +2 -12
  24. package/dist/es/switch/Switch.js +6 -18
  25. package/dist/es/textarea/TextArea.js +27 -40
  26. package/dist/esm/checkbox/Checkbox.js +17 -35
  27. package/dist/esm/colors/ColorContrastLabels.js +0 -2
  28. package/dist/esm/colors/ColorContrastSvg.js +6 -20
  29. package/dist/esm/colors/ColorGradient.js +2 -28
  30. package/dist/esm/colors/ColorInput.js +12 -20
  31. package/dist/esm/colors/ColorPalette.js +0 -19
  32. package/dist/esm/colors/ColorPicker.js +28 -52
  33. package/dist/esm/colors/FlatColorPicker.js +14 -24
  34. package/dist/esm/colors/HexInput.js +0 -4
  35. package/dist/esm/colors/Picker.js +6 -9
  36. package/dist/esm/input/Input.js +15 -29
  37. package/dist/esm/input-separator/InputSeparator.js +0 -2
  38. package/dist/esm/maskedtextbox/MaskedTextBox.js +13 -32
  39. package/dist/esm/numerictextbox/NumericTextBox.js +15 -48
  40. package/dist/esm/numerictextbox/utils/main.js +33 -132
  41. package/dist/esm/package-metadata.js +1 -1
  42. package/dist/esm/radiobutton/RadioButton.js +11 -16
  43. package/dist/esm/radiobutton/RadioGroup.js +9 -12
  44. package/dist/esm/range-slider/RangeSlider.js +9 -32
  45. package/dist/esm/range-slider/range-raducer.js +0 -26
  46. package/dist/esm/slider/Slider.js +8 -20
  47. package/dist/esm/slider/SliderLabel.js +2 -12
  48. package/dist/esm/switch/Switch.js +6 -18
  49. package/dist/esm/textarea/TextArea.js +27 -40
  50. package/dist/npm/checkbox/Checkbox.js +19 -43
  51. package/dist/npm/colors/ColorContrastLabels.js +2 -9
  52. package/dist/npm/colors/ColorContrastSvg.js +8 -26
  53. package/dist/npm/colors/ColorGradient.js +4 -44
  54. package/dist/npm/colors/ColorInput.js +12 -29
  55. package/dist/npm/colors/ColorPalette.js +2 -29
  56. package/dist/npm/colors/ColorPicker.js +26 -59
  57. package/dist/npm/colors/FlatColorPicker.js +14 -35
  58. package/dist/npm/colors/HexInput.js +2 -11
  59. package/dist/npm/colors/Picker.js +8 -15
  60. package/dist/npm/input/Input.js +15 -34
  61. package/dist/npm/input-separator/InputSeparator.js +2 -8
  62. package/dist/npm/maskedtextbox/MaskedTextBox.js +15 -40
  63. package/dist/npm/numerictextbox/NumericTextBox.js +17 -59
  64. package/dist/npm/numerictextbox/utils/main.js +33 -160
  65. package/dist/npm/package-metadata.js +1 -1
  66. package/dist/npm/radiobutton/RadioButton.js +13 -23
  67. package/dist/npm/radiobutton/RadioGroup.js +11 -19
  68. package/dist/npm/range-slider/RangeSlider.js +7 -38
  69. package/dist/npm/range-slider/range-raducer.js +0 -27
  70. package/dist/npm/slider/Slider.js +10 -30
  71. package/dist/npm/slider/SliderLabel.js +2 -15
  72. package/dist/npm/switch/Switch.js +8 -26
  73. package/dist/npm/textarea/TextArea.js +25 -43
  74. package/package.json +11 -11
@@ -11,7 +11,6 @@ import { packageMetadata } from '../package-metadata';
11
11
  /**
12
12
  * @hidden
13
13
  */
14
-
15
14
  var MaskedTextBoxVue2 = {
16
15
  model: {
17
16
  event: 'changemodel'
@@ -130,8 +129,8 @@ var MaskedTextBoxVue2 = {
130
129
  };
131
130
  },
132
131
  mounted: function mounted() {
133
- this.hasMounted = true; // @ts-ignore
134
-
132
+ this.hasMounted = true;
133
+ // @ts-ignore
135
134
  this.element = this.input = this.v3 ? this.inputRef : this.$refs.input;
136
135
  this.updateService();
137
136
  this.setValidity();
@@ -163,21 +162,18 @@ var MaskedTextBoxVue2 = {
163
162
  if (this.element && this.currentFocused) {
164
163
  // && this.prevCurrentFocused
165
164
  var _a = this.currentSelection,
166
- start = _a[0],
167
- end = _a[1];
165
+ start = _a[0],
166
+ end = _a[1];
168
167
  var prevSelection = this.prevSelection;
169
168
  var nextSelection = this.$props.selection;
170
-
171
169
  if (!prevSelection && nextSelection || prevSelection && nextSelection && (prevSelection.start !== nextSelection.start || prevSelection.end !== nextSelection.end)) {
172
170
  start = nextSelection.start;
173
171
  end = nextSelection.end;
174
172
  }
175
-
176
173
  if (start !== null && end !== null) {
177
174
  this.element.setSelectionRange(start, end);
178
175
  }
179
176
  }
180
-
181
177
  var prevProps = {
182
178
  includeLiterals: this.prevIncludeLiterals,
183
179
  mask: this.prevMask,
@@ -185,11 +181,9 @@ var MaskedTextBoxVue2 = {
185
181
  promptPlaceholder: this.prevPromptPlaceholder,
186
182
  rules: this.prevRules
187
183
  };
188
-
189
184
  if (maskingChanged(prevProps, this.$props)) {
190
185
  this.updateService();
191
186
  }
192
-
193
187
  this.setValidity();
194
188
  },
195
189
  computed: {
@@ -201,7 +195,6 @@ var MaskedTextBoxVue2 = {
201
195
  spanClassNames: {
202
196
  get: function get() {
203
197
  var _a;
204
-
205
198
  var isValid = !this.hasMounted || !this.$props.validityStyles || this.validity().valid;
206
199
  return _a = {
207
200
  'k-floating-label-container': true,
@@ -215,11 +208,10 @@ var MaskedTextBoxVue2 = {
215
208
  },
216
209
  wrapperSpanClass: function wrapperSpanClass() {
217
210
  var _a;
218
-
219
211
  var _b = this.$props,
220
- size = _b.size,
221
- fillMode = _b.fillMode,
222
- rounded = _b.rounded;
212
+ size = _b.size,
213
+ fillMode = _b.fillMode,
214
+ rounded = _b.rounded;
223
215
  var isValid = !this.$props.validityStyles || this.validity().valid;
224
216
  return _a = {
225
217
  'k-maskedtextbox': true,
@@ -228,7 +220,6 @@ var MaskedTextBoxVue2 = {
228
220
  },
229
221
  inputInnerClass: function inputInnerClass() {
230
222
  var _a;
231
-
232
223
  return _a = {
233
224
  'k-input-inner': true
234
225
  }, _a[this.inputClass] = this.inputClass, _a;
@@ -242,7 +233,6 @@ var MaskedTextBoxVue2 = {
242
233
  },
243
234
  computedValue: function computedValue() {
244
235
  var value;
245
-
246
236
  if (this.valueDuringOnChange !== undefined) {
247
237
  value = this.valueDuringOnChange;
248
238
  } else if (this.$props.value !== undefined) {
@@ -254,7 +244,6 @@ var MaskedTextBoxVue2 = {
254
244
  } else if (this.$props.defaultValue !== undefined) {
255
245
  value = this.$props.defaultValue;
256
246
  }
257
-
258
247
  return value || '';
259
248
  },
260
249
  rawValue: function rawValue() {
@@ -273,13 +262,11 @@ var MaskedTextBoxVue2 = {
273
262
  },
274
263
  pasteHandler: function pasteHandler(event) {
275
264
  var _a = event.target,
276
- selectionStart = _a.selectionStart,
277
- selectionEnd = _a.selectionEnd;
278
-
265
+ selectionStart = _a.selectionStart,
266
+ selectionEnd = _a.selectionEnd;
279
267
  if (selectionEnd === selectionStart) {
280
268
  return;
281
269
  }
282
-
283
270
  this.isPasted = true;
284
271
  this.currentSelection = [selectionStart || 0, selectionEnd || 0];
285
272
  },
@@ -291,17 +278,14 @@ var MaskedTextBoxVue2 = {
291
278
  var value = this.inputValue = input.value;
292
279
  var start = this.currentSelection[0] || 0;
293
280
  var end = this.currentSelection[1] || 0;
294
-
295
281
  if (!this.$props.mask) {
296
282
  this.isPasted = false;
297
283
  this.currentSelection = [null, null];
298
284
  this.triggerOnChange(value, event);
299
285
  return;
300
286
  }
301
-
302
287
  var maskedValue = this.computedValue();
303
288
  var result;
304
-
305
289
  if (this.isPasted) {
306
290
  this.isPasted = false;
307
291
  var rightPart = maskedValue.length - end;
@@ -310,7 +294,6 @@ var MaskedTextBoxVue2 = {
310
294
  } else {
311
295
  result = this.service.maskInput(value, maskedValue, input.selectionStart || 0);
312
296
  }
313
-
314
297
  this.currentSelection = [result.selection, result.selection];
315
298
  this.triggerOnChange(result.value, event);
316
299
  this.inputValue = undefined;
@@ -362,7 +345,6 @@ var MaskedTextBoxVue2 = {
362
345
  promptPlaceholder: this.$props.promptPlaceholder,
363
346
  rules: this.$props.rules
364
347
  }, extra); // tslint:disable-line:align
365
-
366
348
  this.service.update(config);
367
349
  },
368
350
  setValidity: function setValidity() {
@@ -376,10 +358,10 @@ var MaskedTextBoxVue2 = {
376
358
  var h = gh || createElement;
377
359
  var inputId = this.$props.id || this.inputId;
378
360
  var _a = this.$props,
379
- iconName = _a.iconName,
380
- showValidationIcon = _a.showValidationIcon,
381
- showLoadingIcon = _a.showLoadingIcon,
382
- showClearButton = _a.showClearButton;
361
+ iconName = _a.iconName,
362
+ showValidationIcon = _a.showValidationIcon,
363
+ showLoadingIcon = _a.showLoadingIcon,
364
+ showClearButton = _a.showClearButton;
383
365
  var isValid = !this.$props.validityStyles || this.validity().valid;
384
366
  var newValue = this.computedValue();
385
367
  var inputValue = this.inputValue;
@@ -506,6 +488,5 @@ var MaskedTextBoxVue2 = {
506
488
  /**
507
489
  * @hidden
508
490
  */
509
-
510
491
  var MaskedTextBox = MaskedTextBoxVue2;
511
492
  export { MaskedTextBox, MaskedTextBoxVue2 };
@@ -16,7 +16,6 @@ var VALIDATION_MESSAGE = 'Please enter a valid value!';
16
16
  /**
17
17
  * @hidden
18
18
  */
19
-
20
19
  var NumericTextBoxVue2 = {
21
20
  model: {
22
21
  event: 'changemodel'
@@ -135,7 +134,6 @@ var NumericTextBoxVue2 = {
135
134
  this.$data.valueDuringOnChange = undefined;
136
135
  this._intl = provideIntlService(this);
137
136
  this._symbols = this._intl.numberSymbols();
138
-
139
137
  if (this.$props.value !== undefined) {
140
138
  this.$data.currentValue = this.$props.value;
141
139
  } else if (this.$props.modelValue !== undefined) {
@@ -150,11 +148,9 @@ var NumericTextBoxVue2 = {
150
148
  this._input = getRef(this, 'input');
151
149
  this._elementWrapper = this.v3 ? this.elementWrapperRef : this.$refs.elementWrapper;
152
150
  this.$data.hasMounted = true;
153
-
154
151
  if (this._input) {
155
152
  this._textBeforeInput = this._input.value;
156
153
  }
157
-
158
154
  this.setValidity();
159
155
  },
160
156
  updated: function updated() {
@@ -165,11 +161,9 @@ var NumericTextBoxVue2 = {
165
161
  this.$data.forceUpdate = false;
166
162
  }
167
163
  }
168
-
169
164
  if (this._input) {
170
165
  this._textBeforeInput = this._input.value;
171
166
  }
172
-
173
167
  this.setValidity();
174
168
  },
175
169
  computed: {
@@ -190,7 +184,6 @@ var NumericTextBoxVue2 = {
190
184
  spanClassNames: {
191
185
  get: function get() {
192
186
  var _a;
193
-
194
187
  var isValid = !this.$data.hasMounted || !this.$props.validityStyles || this.validity().valid;
195
188
  var compValue = this.computedValue;
196
189
  return _a = {
@@ -204,13 +197,12 @@ var NumericTextBoxVue2 = {
204
197
  },
205
198
  wrapperClassNames: function wrapperClassNames() {
206
199
  var _a;
207
-
208
200
  var _b = this.$props,
209
- size = _b.size,
210
- fillMode = _b.fillMode,
211
- rounded = _b.rounded,
212
- required = _b.required,
213
- disabled = _b.disabled;
201
+ size = _b.size,
202
+ fillMode = _b.fillMode,
203
+ rounded = _b.rounded,
204
+ required = _b.required,
205
+ disabled = _b.disabled;
214
206
  var isValid = !this.$props.validityStyles || this.validity().valid;
215
207
  return _a = {
216
208
  'k-input': true,
@@ -219,7 +211,6 @@ var NumericTextBoxVue2 = {
219
211
  },
220
212
  inputInnerClass: function inputInnerClass() {
221
213
  var _a;
222
-
223
214
  return _a = {
224
215
  'k-input-inner': true
225
216
  }, _a[this.inputClass] = this.inputClass, _a;
@@ -249,7 +240,6 @@ var NumericTextBoxVue2 = {
249
240
  // uncontrolled
250
241
  this.$data.currentValue = null;
251
242
  }
252
-
253
243
  this.$emit('changemodel', null);
254
244
  this.$emit('update:modelValue', null);
255
245
  this.$emit('change', {
@@ -322,26 +312,21 @@ var NumericTextBoxVue2 = {
322
312
  },
323
313
  triggerChange: function triggerChange(event, newState) {
324
314
  var _this = this;
325
-
326
315
  if (this.$props.disabled) {
327
316
  return;
328
317
  }
329
-
330
318
  this.$data.valueDuringOnChange = newState.eventValue;
331
319
  this.$data.currentValue = newState.eventValue;
332
320
  var formattedValue = formatValue(rangeValue(newState.eventValue, this.$props.min, this.$props.max), this.$props.format, this._intl);
333
321
  var rangedValue = rangeValue(this.parseNumber(formattedValue), this.$props.min, this.$props.max);
334
-
335
322
  if (rangedValue !== newState.eventValue) {
336
323
  newState.valueIsOutOfRange = true;
337
324
  newState.eventValue = rangedValue;
338
325
  this.$data.valueDuringOnChange = rangedValue;
339
326
  this.$data.currentValue = rangedValue;
340
327
  }
341
-
342
328
  if (newState.valueIsCorrected) {
343
329
  var wrapper = this._elementWrapper;
344
-
345
330
  if (wrapper && wrapper.className.indexOf("k-invalid") === -1) {
346
331
  this.$data.isInvalid = true;
347
332
  setTimeout(function () {
@@ -349,9 +334,7 @@ var NumericTextBoxVue2 = {
349
334
  }, 50);
350
335
  }
351
336
  }
352
-
353
337
  var shouldFireEvent = this.$props.value !== newState.eventValue;
354
-
355
338
  if (this.$props.value !== undefined) {
356
339
  // controlled
357
340
  this.$data.currentValue = this.$props.value;
@@ -361,7 +344,6 @@ var NumericTextBoxVue2 = {
361
344
  // uncontrolled
362
345
  this.$data.currentValue = this.$data.valueDuringOnChange;
363
346
  }
364
-
365
347
  this.$data.prevLooseValue = newState.prevLooseValue;
366
348
  this.$data.currentLooseValue = newState.currentLooseValue;
367
349
  this.$data.selectionStart = newState.selectionStart;
@@ -372,7 +354,6 @@ var NumericTextBoxVue2 = {
372
354
  this.$data.focused = newState.focused;
373
355
  this.$data.isPaste = newState.isPaste;
374
356
  this.$data.forceUpdate = !this.$data.forceUpdate;
375
-
376
357
  if (shouldFireEvent) {
377
358
  this.$emit('changemodel', this.$data.valueDuringOnChange);
378
359
  this.$emit('update:modelValue', this.$data.valueDuringOnChange);
@@ -387,7 +368,6 @@ var NumericTextBoxVue2 = {
387
368
  validity: this.validity()
388
369
  });
389
370
  }
390
-
391
371
  this.$data.valueDuringOnChange = undefined;
392
372
  },
393
373
  onPasteHandler: function onPasteHandler(_event) {
@@ -407,12 +387,10 @@ var NumericTextBoxVue2 = {
407
387
  if (!canUseDOM || document.activeElement !== this._input || !this._input) {
408
388
  return;
409
389
  }
410
-
411
390
  if (event.deltaY < 0) {
412
391
  event.preventDefault();
413
392
  this.increase(event);
414
393
  }
415
-
416
394
  if (event.deltaY > 0) {
417
395
  event.preventDefault();
418
396
  this.decrease(event);
@@ -420,23 +398,20 @@ var NumericTextBoxVue2 = {
420
398
  },
421
399
  keyDown: function keyDown(event) {
422
400
  var newState = this.getCurrentState();
423
- var currentValue = this.parseNumber(String(newState.currentLooseValue)); // Select All
424
-
401
+ var currentValue = this.parseNumber(String(newState.currentLooseValue));
402
+ // Select All
425
403
  if (newState.selectionEnd > newState.selectionStart && newState.selectionEnd - newState.selectionStart === String(newState.currentLooseValue).length) {
426
404
  return;
427
405
  }
428
-
429
406
  switch (event.keyCode) {
430
407
  case 38:
431
408
  // Arrow up
432
409
  increaseValue(currentValue, newState, this.$props.step, this.$props.min, this.$props.max, this.$props.format, this._intl);
433
410
  break;
434
-
435
411
  case 40:
436
412
  // Arrow down
437
413
  decreaseValue(currentValue, newState, this.$props.step, this.$props.min, this.$props.max, this.$props.format, this._intl);
438
414
  break;
439
-
440
415
  case 13:
441
416
  // Enter - range values
442
417
  var formattedValue = formatValue(rangeValue(currentValue, this.$props.min, this.$props.max), this.$props.format, this._intl);
@@ -445,32 +420,25 @@ var NumericTextBoxVue2 = {
445
420
  newState.currentLooseValue = formatValue(rangedValue, this.$props.format, this._intl);
446
421
  newState.selectionStart = newState.selectionEnd = newState.currentLooseValue.length;
447
422
  break;
448
-
449
423
  case 110:
450
424
  // Numpad decimal key
451
425
  var element = this._input;
452
-
453
426
  var symbols = this._intl.numberSymbols();
454
-
455
427
  if (element) {
456
428
  newState.currentLooseValue = newState.currentLooseValue.slice(0, newState.selectionStart) + symbols.decimal + newState.currentLooseValue.slice(newState.selectionEnd);
457
429
  newState.selectionStart = newState.selectionEnd = newState.selectionStart + 1;
458
430
  newState = sanitizeNumber(newState, this.$props.format, this._intl);
459
431
  }
460
-
461
432
  break;
462
-
463
433
  default:
464
434
  return;
465
435
  }
466
-
467
436
  event.preventDefault();
468
437
  this.triggerChange(event, newState);
469
438
  },
470
439
  spinnersWrapperMouseDown: function spinnersWrapperMouseDown(e) {
471
440
  if (canUseDOM && this._input) {
472
441
  e.preventDefault();
473
-
474
442
  if (document.activeElement !== this._input) {
475
443
  this._input.focus();
476
444
  }
@@ -496,21 +464,19 @@ var NumericTextBoxVue2 = {
496
464
  render: function render(createElement) {
497
465
  var h = gh || createElement;
498
466
  var _a = this.$props,
499
- iconName = _a.iconName,
500
- showValidationIcon = _a.showValidationIcon,
501
- showLoadingIcon = _a.showLoadingIcon,
502
- showClearButton = _a.showClearButton;
467
+ iconName = _a.iconName,
468
+ showValidationIcon = _a.showValidationIcon,
469
+ showLoadingIcon = _a.showLoadingIcon,
470
+ showClearButton = _a.showClearButton;
503
471
  var inputId = this.$props.id || this._inputId;
504
472
  var defaultSlot = getDefaultSlots(this);
505
473
  var localizationService = provideLocalizationService(this);
506
474
  var isValid = this.validity().valid;
507
-
508
475
  if (this.$props.value !== undefined && this.$props.value !== this.$data.currentValue) {
509
476
  this.$data.currentValue = this.$props.value;
510
477
  } else if (this.$props.modelValue !== undefined && this.$props.modelValue !== this.$data.currentValue) {
511
478
  this.$data.currentValue = this.$props.modelValue;
512
479
  }
513
-
514
480
  this._prevLooseValue = this.looseValue;
515
481
  var inputPrefixTemplate = templateRendering.call(this, this.$props.inputPrefix, getListeners.call(this));
516
482
  var inputSuffixTemplate = templateRendering.call(this, this.$props.inputSuffix, getListeners.call(this));
@@ -616,7 +582,8 @@ var NumericTextBoxVue2 = {
616
582
  on: this.v3 ? undefined : {
617
583
  "mousedown": this.spinnersWrapperMouseDown
618
584
  }
619
- }, [// @ts-ignore
585
+ }, [
586
+ // @ts-ignore
620
587
  h(KButton, {
621
588
  type: "button",
622
589
  attrs: this.v3 ? undefined : {
@@ -637,7 +604,8 @@ var NumericTextBoxVue2 = {
637
604
  on: this.v3 ? undefined : {
638
605
  "click": this.increase
639
606
  }
640
- }), // @ts-ignore
607
+ }),
608
+ // @ts-ignore
641
609
  h(KButton, {
642
610
  type: "button",
643
611
  attrs: this.v3 ? undefined : {
@@ -685,6 +653,5 @@ var NumericTextBoxVue2 = {
685
653
  /**
686
654
  * @hidden
687
655
  */
688
-
689
656
  var NumericTextBox = NumericTextBoxVue2;
690
657
  export { NumericTextBox, NumericTextBoxVue2 };