@progress/kendo-vue-inputs 3.6.4 → 3.7.0-dev.202210250731

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
@@ -3,35 +3,25 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.NumericTextBoxVue2 = exports.NumericTextBox = void 0; // @ts-ignore
7
-
6
+ exports.NumericTextBoxVue2 = exports.NumericTextBox = void 0;
7
+ // @ts-ignore
8
8
  var Vue = require("vue");
9
-
10
9
  var allVue = Vue;
11
10
  var gh = allVue.h;
12
11
  var isV3 = allVue.version && allVue.version[0] === '3';
13
12
  var ref = allVue.ref;
14
13
  var inject = allVue.inject;
15
-
16
14
  var kendo_vue_common_1 = require("@progress/kendo-vue-common");
17
-
18
15
  var kendo_vue_intl_1 = require("@progress/kendo-vue-intl");
19
-
20
16
  var kendo_vue_common_2 = require("@progress/kendo-vue-common");
21
-
22
17
  var kendo_vue_buttons_1 = require("@progress/kendo-vue-buttons");
23
-
24
18
  var main_1 = require("../messages/main");
25
-
26
19
  var main_2 = require("./utils/main");
27
-
28
20
  var package_metadata_1 = require("../package-metadata");
29
-
30
21
  var VALIDATION_MESSAGE = 'Please enter a valid value!';
31
22
  /**
32
23
  * @hidden
33
24
  */
34
-
35
25
  var NumericTextBoxVue2 = {
36
26
  model: {
37
27
  event: 'changemodel'
@@ -150,7 +140,6 @@ var NumericTextBoxVue2 = {
150
140
  this.$data.valueDuringOnChange = undefined;
151
141
  this._intl = (0, kendo_vue_intl_1.provideIntlService)(this);
152
142
  this._symbols = this._intl.numberSymbols();
153
-
154
143
  if (this.$props.value !== undefined) {
155
144
  this.$data.currentValue = this.$props.value;
156
145
  } else if (this.$props.modelValue !== undefined) {
@@ -165,11 +154,9 @@ var NumericTextBoxVue2 = {
165
154
  this._input = (0, kendo_vue_common_1.getRef)(this, 'input');
166
155
  this._elementWrapper = this.v3 ? this.elementWrapperRef : this.$refs.elementWrapper;
167
156
  this.$data.hasMounted = true;
168
-
169
157
  if (this._input) {
170
158
  this._textBeforeInput = this._input.value;
171
159
  }
172
-
173
160
  this.setValidity();
174
161
  },
175
162
  updated: function updated() {
@@ -180,11 +167,9 @@ var NumericTextBoxVue2 = {
180
167
  this.$data.forceUpdate = false;
181
168
  }
182
169
  }
183
-
184
170
  if (this._input) {
185
171
  this._textBeforeInput = this._input.value;
186
172
  }
187
-
188
173
  this.setValidity();
189
174
  },
190
175
  computed: {
@@ -205,7 +190,6 @@ var NumericTextBoxVue2 = {
205
190
  spanClassNames: {
206
191
  get: function get() {
207
192
  var _a;
208
-
209
193
  var isValid = !this.$data.hasMounted || !this.$props.validityStyles || this.validity().valid;
210
194
  var compValue = this.computedValue;
211
195
  return _a = {
@@ -219,13 +203,12 @@ var NumericTextBoxVue2 = {
219
203
  },
220
204
  wrapperClassNames: function wrapperClassNames() {
221
205
  var _a;
222
-
223
206
  var _b = this.$props,
224
- size = _b.size,
225
- fillMode = _b.fillMode,
226
- rounded = _b.rounded,
227
- required = _b.required,
228
- disabled = _b.disabled;
207
+ size = _b.size,
208
+ fillMode = _b.fillMode,
209
+ rounded = _b.rounded,
210
+ required = _b.required,
211
+ disabled = _b.disabled;
229
212
  var isValid = !this.$props.validityStyles || this.validity().valid;
230
213
  return _a = {
231
214
  'k-input': true,
@@ -234,7 +217,6 @@ var NumericTextBoxVue2 = {
234
217
  },
235
218
  inputInnerClass: function inputInnerClass() {
236
219
  var _a;
237
-
238
220
  return _a = {
239
221
  'k-input-inner': true
240
222
  }, _a[this.inputClass] = this.inputClass, _a;
@@ -264,7 +246,6 @@ var NumericTextBoxVue2 = {
264
246
  // uncontrolled
265
247
  this.$data.currentValue = null;
266
248
  }
267
-
268
249
  this.$emit('changemodel', null);
269
250
  this.$emit('update:modelValue', null);
270
251
  this.$emit('change', {
@@ -337,26 +318,21 @@ var NumericTextBoxVue2 = {
337
318
  },
338
319
  triggerChange: function triggerChange(event, newState) {
339
320
  var _this = this;
340
-
341
321
  if (this.$props.disabled) {
342
322
  return;
343
323
  }
344
-
345
324
  this.$data.valueDuringOnChange = newState.eventValue;
346
325
  this.$data.currentValue = newState.eventValue;
347
326
  var formattedValue = (0, main_2.formatValue)((0, main_2.rangeValue)(newState.eventValue, this.$props.min, this.$props.max), this.$props.format, this._intl);
348
327
  var rangedValue = (0, main_2.rangeValue)(this.parseNumber(formattedValue), this.$props.min, this.$props.max);
349
-
350
328
  if (rangedValue !== newState.eventValue) {
351
329
  newState.valueIsOutOfRange = true;
352
330
  newState.eventValue = rangedValue;
353
331
  this.$data.valueDuringOnChange = rangedValue;
354
332
  this.$data.currentValue = rangedValue;
355
333
  }
356
-
357
334
  if (newState.valueIsCorrected) {
358
335
  var wrapper = this._elementWrapper;
359
-
360
336
  if (wrapper && wrapper.className.indexOf("k-invalid") === -1) {
361
337
  this.$data.isInvalid = true;
362
338
  setTimeout(function () {
@@ -364,9 +340,7 @@ var NumericTextBoxVue2 = {
364
340
  }, 50);
365
341
  }
366
342
  }
367
-
368
343
  var shouldFireEvent = this.$props.value !== newState.eventValue;
369
-
370
344
  if (this.$props.value !== undefined) {
371
345
  // controlled
372
346
  this.$data.currentValue = this.$props.value;
@@ -376,7 +350,6 @@ var NumericTextBoxVue2 = {
376
350
  // uncontrolled
377
351
  this.$data.currentValue = this.$data.valueDuringOnChange;
378
352
  }
379
-
380
353
  this.$data.prevLooseValue = newState.prevLooseValue;
381
354
  this.$data.currentLooseValue = newState.currentLooseValue;
382
355
  this.$data.selectionStart = newState.selectionStart;
@@ -387,7 +360,6 @@ var NumericTextBoxVue2 = {
387
360
  this.$data.focused = newState.focused;
388
361
  this.$data.isPaste = newState.isPaste;
389
362
  this.$data.forceUpdate = !this.$data.forceUpdate;
390
-
391
363
  if (shouldFireEvent) {
392
364
  this.$emit('changemodel', this.$data.valueDuringOnChange);
393
365
  this.$emit('update:modelValue', this.$data.valueDuringOnChange);
@@ -402,7 +374,6 @@ var NumericTextBoxVue2 = {
402
374
  validity: this.validity()
403
375
  });
404
376
  }
405
-
406
377
  this.$data.valueDuringOnChange = undefined;
407
378
  },
408
379
  onPasteHandler: function onPasteHandler(_event) {
@@ -422,12 +393,10 @@ var NumericTextBoxVue2 = {
422
393
  if (!kendo_vue_common_1.canUseDOM || document.activeElement !== this._input || !this._input) {
423
394
  return;
424
395
  }
425
-
426
396
  if (event.deltaY < 0) {
427
397
  event.preventDefault();
428
398
  this.increase(event);
429
399
  }
430
-
431
400
  if (event.deltaY > 0) {
432
401
  event.preventDefault();
433
402
  this.decrease(event);
@@ -435,23 +404,20 @@ var NumericTextBoxVue2 = {
435
404
  },
436
405
  keyDown: function keyDown(event) {
437
406
  var newState = this.getCurrentState();
438
- var currentValue = this.parseNumber(String(newState.currentLooseValue)); // Select All
439
-
407
+ var currentValue = this.parseNumber(String(newState.currentLooseValue));
408
+ // Select All
440
409
  if (newState.selectionEnd > newState.selectionStart && newState.selectionEnd - newState.selectionStart === String(newState.currentLooseValue).length) {
441
410
  return;
442
411
  }
443
-
444
412
  switch (event.keyCode) {
445
413
  case 38:
446
414
  // Arrow up
447
415
  (0, main_2.increaseValue)(currentValue, newState, this.$props.step, this.$props.min, this.$props.max, this.$props.format, this._intl);
448
416
  break;
449
-
450
417
  case 40:
451
418
  // Arrow down
452
419
  (0, main_2.decreaseValue)(currentValue, newState, this.$props.step, this.$props.min, this.$props.max, this.$props.format, this._intl);
453
420
  break;
454
-
455
421
  case 13:
456
422
  // Enter - range values
457
423
  var formattedValue = (0, main_2.formatValue)((0, main_2.rangeValue)(currentValue, this.$props.min, this.$props.max), this.$props.format, this._intl);
@@ -460,32 +426,25 @@ var NumericTextBoxVue2 = {
460
426
  newState.currentLooseValue = (0, main_2.formatValue)(rangedValue, this.$props.format, this._intl);
461
427
  newState.selectionStart = newState.selectionEnd = newState.currentLooseValue.length;
462
428
  break;
463
-
464
429
  case 110:
465
430
  // Numpad decimal key
466
431
  var element = this._input;
467
-
468
432
  var symbols = this._intl.numberSymbols();
469
-
470
433
  if (element) {
471
434
  newState.currentLooseValue = newState.currentLooseValue.slice(0, newState.selectionStart) + symbols.decimal + newState.currentLooseValue.slice(newState.selectionEnd);
472
435
  newState.selectionStart = newState.selectionEnd = newState.selectionStart + 1;
473
436
  newState = (0, main_2.sanitizeNumber)(newState, this.$props.format, this._intl);
474
437
  }
475
-
476
438
  break;
477
-
478
439
  default:
479
440
  return;
480
441
  }
481
-
482
442
  event.preventDefault();
483
443
  this.triggerChange(event, newState);
484
444
  },
485
445
  spinnersWrapperMouseDown: function spinnersWrapperMouseDown(e) {
486
446
  if (kendo_vue_common_1.canUseDOM && this._input) {
487
447
  e.preventDefault();
488
-
489
448
  if (document.activeElement !== this._input) {
490
449
  this._input.focus();
491
450
  }
@@ -511,21 +470,19 @@ var NumericTextBoxVue2 = {
511
470
  render: function render(createElement) {
512
471
  var h = gh || createElement;
513
472
  var _a = this.$props,
514
- iconName = _a.iconName,
515
- showValidationIcon = _a.showValidationIcon,
516
- showLoadingIcon = _a.showLoadingIcon,
517
- showClearButton = _a.showClearButton;
473
+ iconName = _a.iconName,
474
+ showValidationIcon = _a.showValidationIcon,
475
+ showLoadingIcon = _a.showLoadingIcon,
476
+ showClearButton = _a.showClearButton;
518
477
  var inputId = this.$props.id || this._inputId;
519
478
  var defaultSlot = (0, kendo_vue_common_1.getDefaultSlots)(this);
520
479
  var localizationService = (0, kendo_vue_intl_1.provideLocalizationService)(this);
521
480
  var isValid = this.validity().valid;
522
-
523
481
  if (this.$props.value !== undefined && this.$props.value !== this.$data.currentValue) {
524
482
  this.$data.currentValue = this.$props.value;
525
483
  } else if (this.$props.modelValue !== undefined && this.$props.modelValue !== this.$data.currentValue) {
526
484
  this.$data.currentValue = this.$props.modelValue;
527
485
  }
528
-
529
486
  this._prevLooseValue = this.looseValue;
530
487
  var inputPrefixTemplate = kendo_vue_common_1.templateRendering.call(this, this.$props.inputPrefix, kendo_vue_common_1.getListeners.call(this));
531
488
  var inputSuffixTemplate = kendo_vue_common_1.templateRendering.call(this, this.$props.inputSuffix, kendo_vue_common_1.getListeners.call(this));
@@ -631,7 +588,8 @@ var NumericTextBoxVue2 = {
631
588
  on: this.v3 ? undefined : {
632
589
  "mousedown": this.spinnersWrapperMouseDown
633
590
  }
634
- }, [// @ts-ignore
591
+ }, [
592
+ // @ts-ignore
635
593
  h(kendo_vue_buttons_1.Button, {
636
594
  type: "button",
637
595
  attrs: this.v3 ? undefined : {
@@ -652,7 +610,8 @@ var NumericTextBoxVue2 = {
652
610
  on: this.v3 ? undefined : {
653
611
  "click": this.increase
654
612
  }
655
- }), // @ts-ignore
613
+ }),
614
+ // @ts-ignore
656
615
  h(kendo_vue_buttons_1.Button, {
657
616
  type: "button",
658
617
  attrs: this.v3 ? undefined : {
@@ -701,6 +660,5 @@ exports.NumericTextBoxVue2 = NumericTextBoxVue2;
701
660
  /**
702
661
  * @hidden
703
662
  */
704
-
705
663
  var NumericTextBox = NumericTextBoxVue2;
706
664
  exports.NumericTextBox = NumericTextBox;