@progress/kendo-vue-inputs 3.4.4-dev.202207220925 → 3.4.5-dev.202208010452

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 (88) hide show
  1. package/dist/cdn/js/kendo-vue-inputs.js +1 -1
  2. package/dist/es/checkbox/Checkbox.js +2 -2
  3. package/dist/es/colors/ColorGradient.d.ts +2 -0
  4. package/dist/es/colors/ColorGradient.js +161 -77
  5. package/dist/es/colors/ColorInput.d.ts +3 -0
  6. package/dist/es/colors/ColorInput.js +80 -56
  7. package/dist/es/colors/ColorPalette.js +30 -16
  8. package/dist/es/colors/ColorPicker.d.ts +1 -0
  9. package/dist/es/colors/ColorPicker.js +91 -69
  10. package/dist/es/colors/FlatColorPicker.d.ts +41 -5
  11. package/dist/es/colors/FlatColorPicker.js +306 -109
  12. package/dist/es/colors/HexInput.d.ts +1 -0
  13. package/dist/es/colors/HexInput.js +16 -2
  14. package/dist/es/colors/Picker.js +19 -11
  15. package/dist/es/colors/interfaces/ColorGradientChangeEvent.d.ts +4 -0
  16. package/dist/es/colors/interfaces/ColorGradientProps.d.ts +12 -0
  17. package/dist/es/colors/interfaces/ColorPaletteChangeEvent.d.ts +0 -3
  18. package/dist/es/colors/interfaces/ColorPaletteProps.d.ts +8 -3
  19. package/dist/es/colors/interfaces/ColorPickerActiveColorClick.d.ts +0 -3
  20. package/dist/es/colors/interfaces/ColorPickerBlurEvent.d.ts +0 -3
  21. package/dist/es/colors/interfaces/ColorPickerChangeEvent.d.ts +4 -3
  22. package/dist/es/colors/interfaces/ColorPickerFocusEvent.d.ts +0 -3
  23. package/dist/es/colors/interfaces/ColorPickerPaletteSettings.d.ts +0 -3
  24. package/dist/es/colors/interfaces/ColorPickerPopupSettings.d.ts +0 -3
  25. package/dist/es/colors/interfaces/ColorPickerProps.d.ts +30 -4
  26. package/dist/es/colors/interfaces/ColorPickerView.d.ts +0 -3
  27. package/dist/es/colors/interfaces/FlatColorPickerViewChangeEvent.d.ts +13 -0
  28. package/dist/es/colors/interfaces/FlatColorPickerViewChangeEvent.js +0 -0
  29. package/dist/es/colors/interfaces/PickerProps.d.ts +4 -0
  30. package/dist/es/colors/utils/color-cache.d.ts +13 -0
  31. package/dist/es/colors/utils/color-cache.js +14 -0
  32. package/dist/es/colors/utils/color-parser.d.ts +7 -1
  33. package/dist/es/colors/utils/color-parser.js +11 -2
  34. package/dist/es/input/Input.d.ts +4 -0
  35. package/dist/es/input/Input.js +8 -3
  36. package/dist/es/messages/index.d.ts +45 -0
  37. package/dist/es/messages/index.js +46 -0
  38. package/dist/es/numerictextbox/NumericTextBox.js +3 -0
  39. package/dist/es/numerictextbox/interfaces/NumericTextBoxProps.d.ts +4 -0
  40. package/dist/es/package-metadata.js +1 -1
  41. package/dist/es/radiobutton/RadioButton.js +1 -1
  42. package/dist/es/radiobutton/RadioGroup.js +1 -1
  43. package/dist/es/range-slider/RangeSlider.js +1 -1
  44. package/dist/es/slider/Slider.js +2 -2
  45. package/dist/npm/checkbox/Checkbox.js +2 -2
  46. package/dist/npm/colors/ColorGradient.d.ts +2 -0
  47. package/dist/npm/colors/ColorGradient.js +161 -75
  48. package/dist/npm/colors/ColorInput.d.ts +3 -0
  49. package/dist/npm/colors/ColorInput.js +80 -55
  50. package/dist/npm/colors/ColorPalette.js +30 -16
  51. package/dist/npm/colors/ColorPicker.d.ts +1 -0
  52. package/dist/npm/colors/ColorPicker.js +92 -70
  53. package/dist/npm/colors/FlatColorPicker.d.ts +41 -5
  54. package/dist/npm/colors/FlatColorPicker.js +306 -106
  55. package/dist/npm/colors/HexInput.d.ts +1 -0
  56. package/dist/npm/colors/HexInput.js +16 -2
  57. package/dist/npm/colors/Picker.js +18 -10
  58. package/dist/npm/colors/interfaces/ColorGradientChangeEvent.d.ts +4 -0
  59. package/dist/npm/colors/interfaces/ColorGradientProps.d.ts +12 -0
  60. package/dist/npm/colors/interfaces/ColorPaletteChangeEvent.d.ts +0 -3
  61. package/dist/npm/colors/interfaces/ColorPaletteProps.d.ts +8 -3
  62. package/dist/npm/colors/interfaces/ColorPickerActiveColorClick.d.ts +0 -3
  63. package/dist/npm/colors/interfaces/ColorPickerBlurEvent.d.ts +0 -3
  64. package/dist/npm/colors/interfaces/ColorPickerChangeEvent.d.ts +4 -3
  65. package/dist/npm/colors/interfaces/ColorPickerFocusEvent.d.ts +0 -3
  66. package/dist/npm/colors/interfaces/ColorPickerPaletteSettings.d.ts +0 -3
  67. package/dist/npm/colors/interfaces/ColorPickerPopupSettings.d.ts +0 -3
  68. package/dist/npm/colors/interfaces/ColorPickerProps.d.ts +30 -4
  69. package/dist/npm/colors/interfaces/ColorPickerView.d.ts +0 -3
  70. package/dist/npm/colors/interfaces/FlatColorPickerViewChangeEvent.d.ts +13 -0
  71. package/dist/npm/colors/interfaces/FlatColorPickerViewChangeEvent.js +2 -0
  72. package/dist/npm/colors/interfaces/PickerProps.d.ts +4 -0
  73. package/dist/npm/colors/utils/color-cache.d.ts +13 -0
  74. package/dist/npm/colors/utils/color-cache.js +15 -1
  75. package/dist/npm/colors/utils/color-parser.d.ts +7 -1
  76. package/dist/npm/colors/utils/color-parser.js +12 -3
  77. package/dist/npm/input/Input.d.ts +4 -0
  78. package/dist/npm/input/Input.js +8 -3
  79. package/dist/npm/messages/index.d.ts +45 -0
  80. package/dist/npm/messages/index.js +47 -1
  81. package/dist/npm/numerictextbox/NumericTextBox.js +3 -0
  82. package/dist/npm/numerictextbox/interfaces/NumericTextBoxProps.d.ts +4 -0
  83. package/dist/npm/package-metadata.js +1 -1
  84. package/dist/npm/radiobutton/RadioButton.js +1 -1
  85. package/dist/npm/radiobutton/RadioGroup.js +1 -1
  86. package/dist/npm/range-slider/RangeSlider.js +1 -1
  87. package/dist/npm/slider/Slider.js +2 -2
  88. package/package.json +11 -11
@@ -35,29 +35,14 @@ var package_metadata_1 = require("../package-metadata");
35
35
 
36
36
  var Picker_1 = require("./Picker");
37
37
 
38
- var ColorPalette_1 = require("./ColorPalette");
38
+ var FlatColorPicker_1 = require("./FlatColorPicker");
39
39
 
40
- var ColorGradient_1 = require("./ColorGradient");
40
+ var color_cache_1 = require("./utils/color-cache");
41
41
  /**
42
42
  * @hidden
43
43
  */
44
44
 
45
45
 
46
- var DEFAULT_GRADIENT_SETTINGS = {
47
- opacity: true
48
- };
49
- /**
50
- * @hidden
51
- */
52
-
53
- var DEFAULT_PALETTE_SETTINGS = {
54
- palette: ColorPalette_1.DEFAULT_PRESET,
55
- tileSize: ColorPalette_1.DEFAULT_TILE_SIZE
56
- };
57
- /**
58
- * @hidden
59
- */
60
-
61
46
  var isControlled = function isControlled(prop) {
62
47
  return prop !== undefined;
63
48
  };
@@ -68,16 +53,25 @@ var isControlled = function isControlled(prop) {
68
53
 
69
54
  var ColorPickerVue2 = {
70
55
  name: 'KendoColorPicker',
56
+ model: {
57
+ event: 'changemodel'
58
+ },
71
59
  // @ts-ignore
72
60
  emits: {
73
61
  'open': null,
74
62
  'close': null,
63
+ 'changemodel': null,
64
+ 'update:modelValue': null,
65
+ 'update:modelRgbaValue': null,
75
66
  'activecolorclick': null,
76
67
  'focus': null,
77
68
  'blur': null,
78
- 'change': null
69
+ 'change': null,
70
+ 'viewchange': null
79
71
  },
80
72
  props: {
73
+ modelValue: String,
74
+ modelRgbaValue: String,
81
75
  value: {
82
76
  type: String,
83
77
  default: undefined
@@ -88,10 +82,22 @@ var ColorPickerVue2 = {
88
82
  id: String,
89
83
  ariaLabelledBy: String,
90
84
  ariaDescribedBy: String,
85
+ showClearButton: {
86
+ type: Boolean,
87
+ default: true
88
+ },
89
+ showPreview: {
90
+ type: Boolean,
91
+ default: true
92
+ },
93
+ showButtons: {
94
+ type: Boolean,
95
+ default: true
96
+ },
91
97
  paletteSettings: {
92
98
  type: Object,
93
99
  default: function _default() {
94
- return DEFAULT_PALETTE_SETTINGS;
100
+ return color_cache_1.DEFAULT_PALETTE_SETTINGS;
95
101
  }
96
102
  },
97
103
  valid: {
@@ -112,6 +118,12 @@ var ColorPickerVue2 = {
112
118
  }
113
119
  },
114
120
  gradientSettings: {
121
+ type: Object,
122
+ default: function _default() {
123
+ return color_cache_1.DEFAULT_GRADIENT_SETTINGS;
124
+ }
125
+ },
126
+ flatColorPickerSettings: {
115
127
  type: Object,
116
128
  default: function _default() {
117
129
  return {};
@@ -144,10 +156,14 @@ var ColorPickerVue2 = {
144
156
  },
145
157
  view: {
146
158
  type: String,
147
- default: 'palette',
159
+ default: 'combo',
148
160
  validator: function validator(value) {
149
161
  return ['gradient', 'palette', 'combo'].includes(value);
150
162
  }
163
+ },
164
+ selectedView: {
165
+ type: Number,
166
+ default: undefined
151
167
  }
152
168
  },
153
169
  data: function data() {
@@ -165,7 +181,7 @@ var ColorPickerVue2 = {
165
181
  return this.$props.open !== undefined;
166
182
  },
167
183
  computedValue: function computedValue() {
168
- return this.isValueControlled ? this.$props.value : this.currentValue;
184
+ return this.isValueControlled ? this.$props.value : this.$props.modelValue !== undefined ? this.$props.modelValue : this.$props.modelRgbaValue !== undefined ? this.$props.modelRgbaValue : this.currentValue !== undefined ? this.currentValue : this.defaultValue;
169
185
  },
170
186
  computedOpen: function computedOpen() {
171
187
  return this.isOpenControlled ? this.$props.open : this.currentOpen;
@@ -190,6 +206,7 @@ var ColorPickerVue2 = {
190
206
  },
191
207
  created: function created() {
192
208
  kendo_vue_common_1.validatePackage(package_metadata_1.packageMetadata);
209
+ this._popupId = 'popup' + kendo_vue_common_1.guid();
193
210
  this.focusableElementGuid = kendo_vue_common_1.guid();
194
211
  },
195
212
  mounted: function mounted() {
@@ -217,46 +234,45 @@ var ColorPickerVue2 = {
217
234
  disabled = _b.disabled,
218
235
  tabIndex = _b.tabIndex,
219
236
  dir = _b.dir,
220
- view = _b.view;
221
-
222
- var renderGradiente = function renderGradiente() {
223
- return h(ColorGradient_1.ColorGradient, __assign({
224
- tabIndex: 0,
225
- attrs: this.v3 ? undefined : __assign({
226
- tabIndex: 0,
227
- value: this.computedValue || undefined
228
- }, this.gradientSettings),
229
- ref: kendo_vue_common_1.setRef(this, 'gradient'),
230
- value: this.computedValue || undefined,
231
- onChange: this.onGradientChangeHandler,
232
- on: this.v3 ? undefined : {
233
- 'change': this.onGradientChangeHandler,
234
- 'focus': this.onFocusHandler,
235
- 'blur': this.onBlurHandler,
236
- 'keydown': this.onKeyDownHandler
237
- },
238
- onFocus: this.onFocusHandler,
239
- onBlur: this.onBlurHandler,
240
- onKeydown: this.onKeyDownHandler
241
- }, this.gradientSettings));
242
- };
243
-
244
- var renderPalette = function renderPalette() {
245
- return h(ColorPalette_1.ColorPalette, __assign({
237
+ view = _b.view,
238
+ selectedView = _b.selectedView,
239
+ showClearButton = _b.showClearButton,
240
+ showPreview = _b.showPreview,
241
+ showButtons = _b.showButtons,
242
+ popupSettings = _b.popupSettings;
243
+
244
+ var renderFlatColorPicker = function renderFlatColorPicker() {
245
+ return h(FlatColorPicker_1.FlatColorPicker, __assign({
246
246
  onKeydown: this.onKeyDownHandler,
247
247
  on: this.v3 ? undefined : {
248
248
  'keydown': this.onKeyDownHandler,
249
- 'change': this.onPaletteChangeHandler,
250
- 'blur': this.onBlurHandler
249
+ 'change': this.onFlatChangeHandler,
250
+ 'blur': this.onBlurHandler,
251
+ 'viewchange': this.onViewChange
251
252
  },
252
- ref: kendo_vue_common_1.setRef(this, 'palette'),
253
+ ref: kendo_vue_common_1.setRef(this, 'flatcolorpicker'),
254
+ view: view,
255
+ selectedView: selectedView,
256
+ showClearButton: showClearButton,
257
+ showPreview: showPreview,
258
+ showButtons: showButtons,
253
259
  value: this.computedValue || undefined,
254
260
  attrs: this.v3 ? undefined : __assign({
255
- value: this.computedValue || undefined
256
- }, this.paletteSettings),
257
- onChange: this.onPaletteChangeHandler,
258
- onBlur: this.onBlurHandler
259
- }, this.paletteSettings));
261
+ view: view,
262
+ selectedView: selectedView,
263
+ showClearButton: showClearButton,
264
+ showPreview: showPreview,
265
+ showButtons: showButtons,
266
+ value: this.computedValue || undefined,
267
+ paletteSettings: this.paletteSettings,
268
+ gradientSettings: this.gradientSettings
269
+ }, this.flatColorPickerSettings),
270
+ onChange: this.onFlatChangeHandler,
271
+ onBlur: this.onBlurHandler,
272
+ onViewchange: this.onViewChange,
273
+ paletteSettings: this.paletteSettings,
274
+ gradientSettings: this.gradientSettings
275
+ }, this.flatColorPickerSettings));
260
276
  }; // const dir = useDir(focusableElementGuid, props.dir);
261
277
 
262
278
 
@@ -328,18 +344,22 @@ var ColorPickerVue2 = {
328
344
  dir: dir,
329
345
  attrs: this.v3 ? undefined : {
330
346
  dir: dir,
347
+ id: this._popupId,
331
348
  open: this.computedOpen,
332
- popupAnchor: this.focusableElementGuid
349
+ popupAnchor: this.focusableElementGuid,
350
+ popupSettings: __assign({}, popupSettings)
333
351
  },
352
+ id: this._popupId,
334
353
  open: this.computedOpen,
335
354
  onOpen: this.onOpenHandler,
336
355
  on: this.v3 ? undefined : {
337
356
  "open": this.onOpenHandler
338
357
  },
339
- popupAnchor: this.focusableElementGuid
358
+ popupAnchor: this.focusableElementGuid,
359
+ popupSettings: __assign({}, popupSettings)
340
360
  }, this.v3 ? function () {
341
- return [(view === 'combo' || view === 'gradient') && renderGradiente.call(_this2), (view === 'combo' || view === 'palette') && renderPalette.call(_this2)];
342
- } : [(view === 'combo' || view === 'gradient') && renderGradiente.call(_this2), (view === 'combo' || view === 'palette') && renderPalette.call(_this2)])]);
361
+ return [renderFlatColorPicker.call(_this2)];
362
+ } : [renderFlatColorPicker.call(_this2)])]);
343
363
  },
344
364
  methods: {
345
365
  focusElement: function focusElement() {
@@ -406,10 +426,10 @@ var ColorPickerVue2 = {
406
426
  },
407
427
  onOpenHandler: function onOpenHandler() {
408
428
  // Skip content autofocus when in controlled mode
409
- var palette = kendo_vue_common_1.getRef(this, 'palette');
429
+ var flatcolorpicker = kendo_vue_common_1.getRef(this, 'flatcolorpicker');
410
430
 
411
- if (palette) {
412
- palette.focus();
431
+ if (flatcolorpicker) {
432
+ flatcolorpicker.focus();
413
433
  }
414
434
  },
415
435
  onClickHandler: function onClickHandler() {
@@ -422,9 +442,7 @@ var ColorPickerVue2 = {
422
442
  });
423
443
  },
424
444
  isViewFocused: function isViewFocused() {
425
- var _a, _b;
426
-
427
- return !!((_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.closest('.k-colorpalette')) || !!((_b = document.activeElement) === null || _b === void 0 ? void 0 : _b.closest('.k-colorgradient'));
445
+ return !!(document.activeElement && document.activeElement.closest("#" + this._popupId));
428
446
  },
429
447
  onButtonBlur: function onButtonBlur() {
430
448
  this.focused = this.isViewFocused();
@@ -464,8 +482,11 @@ var ColorPickerVue2 = {
464
482
  event: event
465
483
  });
466
484
  },
485
+ onViewChange: function onViewChange(event) {
486
+ this.$emit('viewchange', event);
487
+ },
467
488
  onChangeHandler: function onChangeHandler(event, isPalette) {
468
- var currentValue = isPalette ? event.rgbaValue : event.value;
489
+ var currentValue = event.value;
469
490
 
470
491
  if (!this.isValueControlled) {
471
492
  this.currentValue = currentValue;
@@ -475,15 +496,16 @@ var ColorPickerVue2 = {
475
496
  this.setOpen(false);
476
497
  }
477
498
 
499
+ this.$emit('changemodel', currentValue);
500
+ this.$emit('update:modelRgbaValue', event.rgbaValue);
501
+ this.$emit('update:modelValue', currentValue);
478
502
  this.$emit('change', {
479
503
  value: currentValue,
504
+ rgbaValue: event.rgbaValue,
480
505
  event: event
481
506
  });
482
507
  },
483
- onGradientChangeHandler: function onGradientChangeHandler(event) {
484
- this.onChangeHandler(event, false);
485
- },
486
- onPaletteChangeHandler: function onPaletteChangeHandler(event) {
508
+ onFlatChangeHandler: function onFlatChangeHandler(event) {
487
509
  this.onChangeHandler(event, true);
488
510
  }
489
511
  }
@@ -3,6 +3,10 @@ declare type DefaultData<V> = object | ((this: V) => {});
3
3
  declare type DefaultMethods<V> = {
4
4
  [key: string]: (this: V, ...args: any[]) => any;
5
5
  };
6
+ import { ColorPickerChangeEvent } from '../main';
7
+ import { FlatColorPickerViewChangeEvent } from './interfaces/FlatColorPickerViewChangeEvent';
8
+ import { ColorGradientProps } from './interfaces/ColorGradientProps';
9
+ import { ColorPickerPaletteSettings } from './interfaces/ColorPickerPaletteSettings';
6
10
  /**
7
11
  * Represents the properties of [FlatColorPicker](% slug api_inputs_flatcolorpicker %) component.
8
12
  */
@@ -12,13 +16,21 @@ export interface FlatColorPickerProps {
12
16
  */
13
17
  id?: string;
14
18
  /**
15
- * Sets additional classes to the FlatColorPicker.
19
+ * Sets the color model value.
16
20
  */
17
- className?: string;
21
+ modelValue?: string;
22
+ /**
23
+ * The model rgba value of the FlatColorPicker.
24
+ */
25
+ modelRgbaValue?: string;
18
26
  /**
19
27
  * Sets the color value.
20
28
  */
21
29
  value?: string;
30
+ /**
31
+ * Sets the previous color value.
32
+ */
33
+ prevValue?: string;
22
34
  /**
23
35
  * Sets the `tabIndex` property of the FlatColorPicker.
24
36
  */
@@ -28,13 +40,21 @@ export interface FlatColorPickerProps {
28
40
  */
29
41
  disabled?: boolean;
30
42
  /**
31
- * Sets the FlatColorPicker view. The default is `ColorGradient`.
43
+ * Sets the FlatColorPicker view. The default is `combo`.
32
44
  */
33
- view?: 'ColorGradient' | 'ColorPalette' | string;
45
+ view?: 'combo' | 'gradient' | 'palette' | string;
46
+ /**
47
+ * Sets the FlatColorPicker selected view index. The default is `0`.
48
+ */
49
+ selectedView?: number;
34
50
  /**
35
51
  * Sets custom header component.
36
52
  */
37
53
  header?: any;
54
+ /**
55
+ * Sets custom footer component.
56
+ */
57
+ footer?: any;
38
58
  /**
39
59
  * Specifies whether clear button will be rendered in the header.
40
60
  */
@@ -47,9 +67,25 @@ export interface FlatColorPickerProps {
47
67
  * Specifies whether action buttons will be rendered in the footer.
48
68
  */
49
69
  showButtons?: boolean;
70
+ /**
71
+ * Configures the ColorPalette that is displayed in the ColorPicker popup.
72
+ */
73
+ paletteSettings?: ColorPickerPaletteSettings;
74
+ /**
75
+ * Configures the ColorGradient that is displayed in the ColorPicker popup.
76
+ */
77
+ gradientSettings?: ColorGradientProps;
78
+ /**
79
+ * The event handler that will be fired when the view is changed.
80
+ */
81
+ onViewchange?: (event: FlatColorPickerViewChangeEvent) => void;
82
+ /**
83
+ * The event handler that will be fired when the user edits the value.
84
+ */
85
+ onChange?: (event: ColorPickerChangeEvent) => void;
50
86
  }
51
87
  /**
52
- * Represents the target (element and props) of the FlatColorPicker.
88
+ * @hidden
53
89
  */
54
90
  export interface FlatColorPickerHandle {
55
91
  /**