@progress/kendo-vue-inputs 3.4.3 → 3.4.5-dev.202207300828

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 (102) hide show
  1. package/dist/cdn/js/kendo-vue-inputs.js +1 -1
  2. package/dist/es/checkbox/Checkbox.js +3 -3
  3. package/dist/es/colors/ColorContrastLabels.js +8 -4
  4. package/dist/es/colors/ColorContrastSvg.js +65 -44
  5. package/dist/es/colors/ColorGradient.d.ts +3 -1
  6. package/dist/es/colors/ColorGradient.js +160 -57
  7. package/dist/es/colors/ColorInput.d.ts +3 -0
  8. package/dist/es/colors/ColorInput.js +82 -58
  9. package/dist/es/colors/ColorPalette.js +31 -17
  10. package/dist/es/colors/ColorPicker.d.ts +1 -0
  11. package/dist/es/colors/ColorPicker.js +90 -70
  12. package/dist/es/colors/FlatColorPicker.d.ts +41 -5
  13. package/dist/es/colors/FlatColorPicker.js +307 -110
  14. package/dist/es/colors/HexInput.d.ts +1 -0
  15. package/dist/es/colors/HexInput.js +33 -13
  16. package/dist/es/colors/Picker.js +20 -12
  17. package/dist/es/colors/interfaces/ColorGradientChangeEvent.d.ts +4 -0
  18. package/dist/es/colors/interfaces/ColorGradientProps.d.ts +12 -0
  19. package/dist/es/colors/interfaces/ColorPaletteChangeEvent.d.ts +0 -3
  20. package/dist/es/colors/interfaces/ColorPaletteProps.d.ts +8 -3
  21. package/dist/es/colors/interfaces/ColorPickerActiveColorClick.d.ts +0 -3
  22. package/dist/es/colors/interfaces/ColorPickerBlurEvent.d.ts +0 -3
  23. package/dist/es/colors/interfaces/ColorPickerChangeEvent.d.ts +4 -3
  24. package/dist/es/colors/interfaces/ColorPickerFocusEvent.d.ts +0 -3
  25. package/dist/es/colors/interfaces/ColorPickerPaletteSettings.d.ts +0 -3
  26. package/dist/es/colors/interfaces/ColorPickerPopupSettings.d.ts +0 -3
  27. package/dist/es/colors/interfaces/ColorPickerProps.d.ts +30 -4
  28. package/dist/es/colors/interfaces/ColorPickerView.d.ts +0 -3
  29. package/dist/es/colors/interfaces/FlatColorPickerViewChangeEvent.d.ts +13 -0
  30. package/dist/es/colors/interfaces/FlatColorPickerViewChangeEvent.js +0 -0
  31. package/dist/es/colors/interfaces/PickerProps.d.ts +4 -0
  32. package/dist/es/colors/utils/color-cache.d.ts +13 -0
  33. package/dist/es/colors/utils/color-cache.js +14 -0
  34. package/dist/es/colors/utils/color-parser.d.ts +7 -1
  35. package/dist/es/colors/utils/color-parser.js +11 -2
  36. package/dist/es/input/Input.d.ts +4 -0
  37. package/dist/es/input/Input.js +9 -4
  38. package/dist/es/input-separator/InputSeparator.js +1 -1
  39. package/dist/es/maskedtextbox/MaskedTextBox.js +1 -1
  40. package/dist/es/messages/index.d.ts +45 -0
  41. package/dist/es/messages/index.js +46 -0
  42. package/dist/es/numerictextbox/NumericTextBox.js +4 -1
  43. package/dist/es/numerictextbox/interfaces/NumericTextBoxProps.d.ts +4 -0
  44. package/dist/es/package-metadata.js +1 -1
  45. package/dist/es/radiobutton/RadioButton.js +2 -2
  46. package/dist/es/radiobutton/RadioGroup.js +2 -2
  47. package/dist/es/range-slider/RangeSlider.js +2 -2
  48. package/dist/es/slider/Slider.js +3 -3
  49. package/dist/es/slider/SliderLabel.js +1 -1
  50. package/dist/es/switch/Switch.js +1 -1
  51. package/dist/es/textarea/TextArea.js +1 -1
  52. package/dist/npm/checkbox/Checkbox.js +3 -3
  53. package/dist/npm/colors/ColorContrastLabels.js +8 -4
  54. package/dist/npm/colors/ColorContrastSvg.js +65 -44
  55. package/dist/npm/colors/ColorGradient.d.ts +3 -1
  56. package/dist/npm/colors/ColorGradient.js +161 -56
  57. package/dist/npm/colors/ColorInput.d.ts +3 -0
  58. package/dist/npm/colors/ColorInput.js +82 -57
  59. package/dist/npm/colors/ColorPalette.js +31 -17
  60. package/dist/npm/colors/ColorPicker.d.ts +1 -0
  61. package/dist/npm/colors/ColorPicker.js +91 -71
  62. package/dist/npm/colors/FlatColorPicker.d.ts +41 -5
  63. package/dist/npm/colors/FlatColorPicker.js +307 -107
  64. package/dist/npm/colors/HexInput.d.ts +1 -0
  65. package/dist/npm/colors/HexInput.js +31 -11
  66. package/dist/npm/colors/Picker.js +19 -11
  67. package/dist/npm/colors/interfaces/ColorGradientChangeEvent.d.ts +4 -0
  68. package/dist/npm/colors/interfaces/ColorGradientProps.d.ts +12 -0
  69. package/dist/npm/colors/interfaces/ColorPaletteChangeEvent.d.ts +0 -3
  70. package/dist/npm/colors/interfaces/ColorPaletteProps.d.ts +8 -3
  71. package/dist/npm/colors/interfaces/ColorPickerActiveColorClick.d.ts +0 -3
  72. package/dist/npm/colors/interfaces/ColorPickerBlurEvent.d.ts +0 -3
  73. package/dist/npm/colors/interfaces/ColorPickerChangeEvent.d.ts +4 -3
  74. package/dist/npm/colors/interfaces/ColorPickerFocusEvent.d.ts +0 -3
  75. package/dist/npm/colors/interfaces/ColorPickerPaletteSettings.d.ts +0 -3
  76. package/dist/npm/colors/interfaces/ColorPickerPopupSettings.d.ts +0 -3
  77. package/dist/npm/colors/interfaces/ColorPickerProps.d.ts +30 -4
  78. package/dist/npm/colors/interfaces/ColorPickerView.d.ts +0 -3
  79. package/dist/npm/colors/interfaces/FlatColorPickerViewChangeEvent.d.ts +13 -0
  80. package/dist/npm/colors/interfaces/FlatColorPickerViewChangeEvent.js +2 -0
  81. package/dist/npm/colors/interfaces/PickerProps.d.ts +4 -0
  82. package/dist/npm/colors/utils/color-cache.d.ts +13 -0
  83. package/dist/npm/colors/utils/color-cache.js +15 -1
  84. package/dist/npm/colors/utils/color-parser.d.ts +7 -1
  85. package/dist/npm/colors/utils/color-parser.js +12 -3
  86. package/dist/npm/input/Input.d.ts +4 -0
  87. package/dist/npm/input/Input.js +9 -4
  88. package/dist/npm/input-separator/InputSeparator.js +1 -1
  89. package/dist/npm/maskedtextbox/MaskedTextBox.js +1 -1
  90. package/dist/npm/messages/index.d.ts +45 -0
  91. package/dist/npm/messages/index.js +47 -1
  92. package/dist/npm/numerictextbox/NumericTextBox.js +4 -1
  93. package/dist/npm/numerictextbox/interfaces/NumericTextBoxProps.d.ts +4 -0
  94. package/dist/npm/package-metadata.js +1 -1
  95. package/dist/npm/radiobutton/RadioButton.js +2 -2
  96. package/dist/npm/radiobutton/RadioGroup.js +2 -2
  97. package/dist/npm/range-slider/RangeSlider.js +2 -2
  98. package/dist/npm/slider/Slider.js +3 -3
  99. package/dist/npm/slider/SliderLabel.js +1 -1
  100. package/dist/npm/switch/Switch.js +1 -1
  101. package/dist/npm/textarea/TextArea.js +1 -1
  102. package/package.json +11 -11
@@ -1,5 +1,21 @@
1
1
  "use strict";
2
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
+
3
19
  Object.defineProperty(exports, "__esModule", {
4
20
  value: true
5
21
  });
@@ -9,7 +25,7 @@ var Vue = require("vue");
9
25
 
10
26
  var allVue = Vue;
11
27
  var gh = allVue.h;
12
- var isV3 = allVue.version[0] === '3';
28
+ var isV3 = allVue.version && allVue.version[0] === '3';
13
29
 
14
30
  var kendo_vue_common_1 = require("@progress/kendo-vue-common");
15
31
 
@@ -22,6 +38,12 @@ var ColorGradient_1 = require("./ColorGradient");
22
38
  var package_metadata_1 = require("../package-metadata");
23
39
 
24
40
  var messages_1 = require("../messages");
41
+
42
+ var color_parser_1 = require("./utils/color-parser");
43
+
44
+ var color_cache_1 = require("./utils/color-cache");
45
+
46
+ var kendo_vue_intl_1 = require("@progress/kendo-vue-intl");
25
47
  /**
26
48
  * @hidden
27
49
  */
@@ -29,20 +51,37 @@ var messages_1 = require("../messages");
29
51
 
30
52
  var FlatColorPickerVue2 = {
31
53
  name: 'KendoFlatColorPicker',
32
- created: function created() {
33
- kendo_vue_common_1.validatePackage(package_metadata_1.packageMetadata);
54
+ // @ts-ignore
55
+ emits: {
56
+ 'viewchange': null,
57
+ 'changemodel': null,
58
+ 'update:modelValue': null,
59
+ 'update:modelRgbaValue': null,
60
+ 'focus': null,
61
+ 'blur': null,
62
+ 'keydown': null,
63
+ 'change': null
34
64
  },
35
65
  props: {
66
+ modelValue: String,
67
+ modelRgbaValue: String,
36
68
  value: String,
69
+ prevValue: String,
37
70
  tabIndex: Number,
38
71
  disabled: Boolean,
39
72
  view: {
40
73
  type: String,
74
+ default: 'combo',
41
75
  validator: function validator(value) {
42
- return ['ColorGradient', 'ColorPalette'].includes(value);
76
+ return ['gradient', 'palette', 'combo'].includes(value);
43
77
  }
44
78
  },
45
- header: [String, Object, Function, Boolean],
79
+ selectedView: {
80
+ type: Number,
81
+ default: undefined
82
+ },
83
+ header: [String, Function, Object],
84
+ footer: [String, Function, Object],
46
85
  showClearButton: {
47
86
  type: Boolean,
48
87
  default: true
@@ -54,18 +93,63 @@ var FlatColorPickerVue2 = {
54
93
  showButtons: {
55
94
  type: Boolean,
56
95
  default: true
96
+ },
97
+ gradientSettings: {
98
+ type: Object,
99
+ default: function _default() {
100
+ return color_cache_1.DEFAULT_GRADIENT_SETTINGS;
101
+ }
102
+ },
103
+ paletteSettings: {
104
+ type: Object,
105
+ default: function _default() {
106
+ return color_cache_1.DEFAULT_PALETTE_SETTINGS;
107
+ }
108
+ }
109
+ },
110
+ inject: {
111
+ kendoLocalizationService: {
112
+ default: null
57
113
  }
58
114
  },
115
+ created: function created() {
116
+ kendo_vue_common_1.validatePackage(package_metadata_1.packageMetadata);
117
+ },
59
118
  computed: {
60
119
  isColorGradient: function isColorGradient() {
61
- return this.view ? this.view === 'ColorGradient' : this.currentView === 'ColorGradient';
120
+ return this.view !== 'combo' ? this.view === 'gradient' : this.selectedView !== undefined ? this.selectedView === 0 : this.currentView === 'gradient';
121
+ },
122
+ computedColor: function computedColor() {
123
+ return this.value !== undefined ? this.value : this.modelValue !== undefined ? this.modelValue : this.modelRgbaValue !== undefined ? this.modelRgbaValue : this.colorValue;
124
+ },
125
+ computedPrevColor: function computedPrevColor() {
126
+ return this.prevValue !== undefined ? this.prevValue : this.currentPrevColor;
127
+ },
128
+ previewClass: function previewClass() {
129
+ return {
130
+ 'k-coloreditor-preview-color': true,
131
+ 'k-color-preview': true,
132
+ 'k-no-color': !this.colorValue
133
+ };
134
+ },
135
+ currentClass: function currentClass() {
136
+ return {
137
+ 'k-coloreditor-current-color': true,
138
+ 'k-color-preview': true,
139
+ 'k-no-color': !this.computedPrevColor
140
+ };
141
+ },
142
+ computedTabIndex: function computedTabIndex() {
143
+ return this.focused ? 0 : -1;
62
144
  }
63
145
  },
64
146
  data: function data() {
147
+ var initialValue = this.value || this.defaultValue || this.modelValue || this.modelRgbaValue;
65
148
  return {
66
- currentView: 'ColorGradient',
67
- colorValue: 'rgba(255, 255, 255, 1)',
68
- prevColor: 'rgba(255, 255, 255, 1)'
149
+ currentView: 'gradient',
150
+ colorValue: initialValue,
151
+ currentPrevColor: initialValue,
152
+ focused: false
69
153
  };
70
154
  },
71
155
  // @ts-ignore
@@ -82,43 +166,110 @@ var FlatColorPickerVue2 = {
82
166
  var _this = this;
83
167
 
84
168
  var h = gh || createElement;
169
+ var localizationService = kendo_vue_intl_1.provideLocalizationService(this);
170
+ var gradientMessage = localizationService.toLanguageString(messages_1.flatColorPickerGradientBtn, messages_1.messages[messages_1.flatColorPickerGradientBtn]);
171
+ var paletteMessage = localizationService.toLanguageString(messages_1.flatColorPickerPaletteBtn, messages_1.messages[messages_1.flatColorPickerPaletteBtn]);
172
+ var clearMessage = localizationService.toLanguageString(messages_1.flatColorPickerClearBtn, messages_1.messages[messages_1.flatColorPickerClearBtn]);
173
+ var cancelMessage = localizationService.toLanguageString(messages_1.flatColorPickerCancelBtn, messages_1.messages[messages_1.flatColorPickerCancelBtn]);
174
+ var applyMessage = localizationService.toLanguageString(messages_1.flatColorPickerApplyBtn, messages_1.messages[messages_1.flatColorPickerApplyBtn]);
175
+ var headerTemplate = kendo_vue_common_1.templateRendering.call(this, this.$props.header, kendo_vue_common_1.getListeners.call(this));
176
+ var footerTemplate = kendo_vue_common_1.templateRendering.call(this, this.$props.footer, kendo_vue_common_1.getListeners.call(this));
177
+ var header = kendo_vue_common_1.getTemplate.call(this, {
178
+ h: h,
179
+ template: headerTemplate
180
+ });
181
+ var footer = kendo_vue_common_1.getTemplate.call(this, {
182
+ h: h,
183
+ template: footerTemplate
184
+ });
185
+
186
+ var renderGradiente = function renderGradiente() {
187
+ return h(ColorGradient_1.ColorGradient, __assign({
188
+ attrs: this.v3 ? undefined : __assign({
189
+ tabIndex: -1,
190
+ value: this.colorValue,
191
+ innerTabIndex: this.computedTabIndex
192
+ }, this.gradientSettings),
193
+ ref: kendo_vue_common_1.setRef(this, 'gradient'),
194
+ tabIndex: -1,
195
+ value: this.colorValue,
196
+ innerTabIndex: this.computedTabIndex,
197
+ onChange: this.handleColorChange,
198
+ onKeydown: this.innerKeyDown,
199
+ on: this.v3 ? undefined : {
200
+ 'change': this.handleColorChange,
201
+ 'keydown': this.innerKeyDown
202
+ }
203
+ }, this.gradientSettings));
204
+ };
205
+
206
+ var renderPalette = function renderPalette() {
207
+ return h(ColorPalette_1.ColorPalette, __assign({
208
+ on: this.v3 ? undefined : {
209
+ 'change': this.handlePaletteColorChange,
210
+ 'keydown': this.gradientKeyDown
211
+ },
212
+ ref: kendo_vue_common_1.setRef(this, 'palette'),
213
+ tabIndex: this.computedTabIndex,
214
+ value: this.colorValue,
215
+ attrs: this.v3 ? undefined : __assign({
216
+ tabIndex: this.computedTabIndex,
217
+ value: this.colorValue
218
+ }, this.paletteSettings),
219
+ onChange: this.handlePaletteColorChange,
220
+ onKeydown: this.gradientKeyDown
221
+ }, this.paletteSettings));
222
+ };
223
+
85
224
  return h("div", {
86
225
  tabindex: kendo_vue_common_1.getTabIndex(this.$props.tabIndex, this.$props.disabled),
87
226
  attrs: this.v3 ? undefined : {
88
- tabindex: kendo_vue_common_1.getTabIndex(this.$props.tabIndex, this.$props.disabled)
227
+ tabindex: kendo_vue_common_1.getTabIndex(this.$props.tabIndex, this.$props.disabled),
228
+ "aria-disabled": this.$props.disabled
89
229
  },
230
+ onFocusin: this.onFocus,
231
+ on: this.v3 ? undefined : {
232
+ "focusin": this.onFocus,
233
+ "focusout": this.onBlur,
234
+ "keydown": this.onKeyDownHandler
235
+ },
236
+ onFocusout: this.onBlur,
237
+ onKeydown: this.onKeyDownHandler,
90
238
  "class": kendo_vue_common_1.classNames('k-flatcolorpicker k-coloreditor', {
91
239
  'k-disabled': this.$props.disabled
92
240
  }),
93
- onBlur: this.handleFlatColorPickerBlur,
94
- on: this.v3 ? undefined : {
95
- "blur": this.handleFlatColorPickerBlur
96
- }
97
- }, [this.$props.header || h("div", {
241
+ "aria-disabled": this.$props.disabled
242
+ }, [header, this.$props.showClearButton && this.$props.showPreview && h("div", {
98
243
  "class": "k-coloreditor-header k-hstack"
99
- }, [h("div", {
244
+ }, [this.$props.view === 'combo' && h("div", {
100
245
  "class": "k-coloreditor-header-actions k-hstack"
101
246
  }, [// @ts-ignore function children
102
247
  h(kendo_vue_buttons_1.ButtonGroup, this.v3 ? function () {
103
248
  return [// @ts-ignore function children
104
249
  h(kendo_vue_buttons_1.Button, {
105
- type: "button",
250
+ tabIndex: _this2.computedTabIndex,
106
251
  attrs: _this2.v3 ? undefined : {
252
+ tabIndex: _this2.computedTabIndex,
107
253
  type: "button",
108
254
  togglable: true,
109
255
  fillMode: 'flat',
110
- selected: _this2.isColorGradient
256
+ selected: _this2.isColorGradient,
257
+ ariaLabel: gradientMessage
111
258
  },
259
+ type: "button",
112
260
  togglable: true,
113
261
  fillMode: 'flat',
114
262
  selected: _this2.isColorGradient,
115
- onClick: function onClick(e) {
116
- return _this.handleViewChange(e, 'ColorGradient');
117
- },
263
+ onKeydown: _this2.handleButtonKeydown,
118
264
  on: _this2.v3 ? undefined : {
119
- "click": function onClick(e) {
120
- return _this.handleViewChange(e, 'ColorGradient');
265
+ "keydown": _this2.handleButtonKeydown,
266
+ "click": function click(e) {
267
+ return _this.handleViewChange(e, 'gradient');
121
268
  }
269
+ },
270
+ ariaLabel: gradientMessage,
271
+ onClick: function click(e) {
272
+ return _this.handleViewChange(e, 'gradient');
122
273
  }
123
274
  }, _this2.v3 ? function () {
124
275
  return [h("span", {
@@ -128,23 +279,29 @@ var FlatColorPickerVue2 = {
128
279
  "class": "k-icon k-i-color-canvas"
129
280
  })]), // @ts-ignore function children
130
281
  h(kendo_vue_buttons_1.Button, {
131
- type: "button",
282
+ tabIndex: _this2.computedTabIndex,
132
283
  attrs: _this2.v3 ? undefined : {
284
+ tabIndex: _this2.computedTabIndex,
133
285
  type: "button",
134
286
  togglable: true,
135
287
  fillMode: 'flat',
136
- selected: !_this2.isColorGradient
288
+ selected: !_this2.isColorGradient,
289
+ ariaLabel: paletteMessage
137
290
  },
291
+ type: "button",
138
292
  togglable: true,
139
293
  fillMode: 'flat',
140
294
  selected: !_this2.isColorGradient,
141
- onClick: function onClick(e) {
142
- return _this.handleViewChange(e, 'ColorPalette');
143
- },
295
+ onKeydown: _this2.handleButtonKeydown,
144
296
  on: _this2.v3 ? undefined : {
145
- "click": function onClick(e) {
146
- return _this.handleViewChange(e, 'ColorPalette');
297
+ "keydown": _this2.handleButtonKeydown,
298
+ "click": function click(e) {
299
+ return _this.handleViewChange(e, 'palette');
147
300
  }
301
+ },
302
+ ariaLabel: paletteMessage,
303
+ onClick: function click(e) {
304
+ return _this.handleViewChange(e, 'palette');
148
305
  }
149
306
  }, _this2.v3 ? function () {
150
307
  return [h("span", {
@@ -154,23 +311,29 @@ var FlatColorPickerVue2 = {
154
311
  "class": "k-icon k-i-palette"
155
312
  })])];
156
313
  } : [h(kendo_vue_buttons_1.Button, {
157
- type: "button",
314
+ tabIndex: _this2.computedTabIndex,
158
315
  attrs: _this2.v3 ? undefined : {
316
+ tabIndex: _this2.computedTabIndex,
159
317
  type: "button",
160
318
  togglable: true,
161
319
  fillMode: 'flat',
162
- selected: _this2.isColorGradient
320
+ selected: _this2.isColorGradient,
321
+ ariaLabel: gradientMessage
163
322
  },
323
+ type: "button",
164
324
  togglable: true,
165
325
  fillMode: 'flat',
166
326
  selected: _this2.isColorGradient,
167
- onClick: function onClick(e) {
168
- return _this.handleViewChange(e, 'ColorGradient');
169
- },
327
+ onKeydown: _this2.handleButtonKeydown,
170
328
  on: _this2.v3 ? undefined : {
171
- "click": function onClick(e) {
172
- return _this.handleViewChange(e, 'ColorGradient');
329
+ "keydown": _this2.handleButtonKeydown,
330
+ "click": function click(e) {
331
+ return _this.handleViewChange(e, 'gradient');
173
332
  }
333
+ },
334
+ ariaLabel: gradientMessage,
335
+ onClick: function click(e) {
336
+ return _this.handleViewChange(e, 'gradient');
174
337
  }
175
338
  }, _this2.v3 ? function () {
176
339
  return [h("span", {
@@ -179,23 +342,29 @@ var FlatColorPickerVue2 = {
179
342
  } : [h("span", {
180
343
  "class": "k-icon k-i-color-canvas"
181
344
  })]), h(kendo_vue_buttons_1.Button, {
182
- type: "button",
345
+ tabIndex: _this2.computedTabIndex,
183
346
  attrs: _this2.v3 ? undefined : {
347
+ tabIndex: _this2.computedTabIndex,
184
348
  type: "button",
185
349
  togglable: true,
186
350
  fillMode: 'flat',
187
- selected: !_this2.isColorGradient
351
+ selected: !_this2.isColorGradient,
352
+ ariaLabel: paletteMessage
188
353
  },
354
+ type: "button",
189
355
  togglable: true,
190
356
  fillMode: 'flat',
191
357
  selected: !_this2.isColorGradient,
192
- onClick: function onClick(e) {
193
- return _this.handleViewChange(e, 'ColorPalette');
194
- },
358
+ onKeydown: _this2.handleButtonKeydown,
195
359
  on: _this2.v3 ? undefined : {
196
- "click": function onClick(e) {
197
- return _this.handleViewChange(e, 'ColorPalette');
360
+ "keydown": _this2.handleButtonKeydown,
361
+ "click": function click(e) {
362
+ return _this.handleViewChange(e, 'palette');
198
363
  }
364
+ },
365
+ ariaLabel: paletteMessage,
366
+ onClick: function click(e) {
367
+ return _this.handleViewChange(e, 'palette');
199
368
  }
200
369
  }, _this2.v3 ? function () {
201
370
  return [h("span", {
@@ -209,98 +378,101 @@ var FlatColorPickerVue2 = {
209
378
  "class": "k-coloreditor-header-actions k-hstack"
210
379
  }, [this.$props.showClearButton && // @ts-ignore function children
211
380
  h(kendo_vue_buttons_1.Button, {
212
- type: "button",
381
+ tabIndex: this.computedTabIndex,
213
382
  attrs: this.v3 ? undefined : {
383
+ tabIndex: this.computedTabIndex,
214
384
  type: "button",
215
- fillMode: 'flat'
385
+ fillMode: 'flat',
386
+ ariaLabel: clearMessage
216
387
  },
388
+ type: "button",
217
389
  fillMode: 'flat',
218
- onClick: this.handleResetColor,
390
+ ariaLabel: clearMessage,
391
+ onKeydown: this.handleButtonKeydown,
219
392
  on: this.v3 ? undefined : {
393
+ "keydown": this.handleButtonKeydown,
220
394
  "click": this.handleResetColor
221
- }
395
+ },
396
+ onClick: this.handleResetColor
222
397
  }, this.v3 ? function () {
223
398
  return [h("span", {
224
399
  "class": "k-icon k-i-reset-color"
225
400
  })];
226
401
  } : [h("span", {
227
402
  "class": "k-icon k-i-reset-color"
228
- })]), this.$props.showPreview && defaultProps.showPreview && h("div", {
403
+ })]), this.$props.showPreview && h("div", {
229
404
  "class": "k-coloreditor-preview k-vstack"
230
405
  }, [h("span", {
231
- "class": "k-coloreditor-preview-color k-color-preview",
406
+ "class": this.previewClass,
232
407
  style: {
233
408
  background: this.colorValue
234
409
  }
235
- }), h("span", {
236
- "class": "k-coloreditor-current-color k-color-preview",
410
+ }, [!this.colorValue && h("span", {
411
+ "class": "k-color-preview-mask"
412
+ })]), h("span", {
413
+ "class": this.currentClass,
237
414
  style: {
238
- background: this.prevColor
415
+ background: this.computedPrevColor
239
416
  },
240
417
  onClick: this.handlePrevColorClick,
241
418
  on: this.v3 ? undefined : {
242
419
  "click": this.handlePrevColorClick
243
420
  }
244
- })])])]), h("div", {
421
+ }, [!this.computedPrevColor && h("span", {
422
+ "class": "k-color-preview-mask"
423
+ })])])])]), h("div", {
245
424
  "class": "k-coloreditor-views k-vstack"
246
- }, [this.isColorGradient ? h(ColorGradient_1.ColorGradient, {
247
- // ref={colorGradientRef}
248
- value: this.colorValue,
249
- attrs: this.v3 ? undefined : {
250
- value: this.colorValue
251
- },
252
- onChange: this.handleColorChange,
253
- on: this.v3 ? undefined : {
254
- "change": this.handleColorChange,
255
- "focus": this.handleFocus
256
- },
257
- onFocus: this.handleFocus
258
- }) : h(ColorPalette_1.ColorPalette, {
259
- value: this.colorValue,
260
- attrs: this.v3 ? undefined : {
261
- value: this.colorValue
262
- },
263
- onChange: this.handleColorChange,
264
- on: this.v3 ? undefined : {
265
- "change": this.handleColorChange,
266
- "focus": this.handleFocus
267
- },
268
- onFocus: this.handleFocus
269
- })]), this.$props.showButtons && defaultProps.showButtons && h("div", {
425
+ }, [this.isColorGradient ? renderGradiente.call(this) : renderPalette.call(this)]), this.$props.showButtons && h("div", {
270
426
  "class": "k-coloreditor-footer k-actions k-actions-end"
271
427
  }, [// @ts-ignore function children
272
428
  h(kendo_vue_buttons_1.Button, {
273
- type: "button",
429
+ tabIndex: this.computedTabIndex,
274
430
  attrs: this.v3 ? undefined : {
431
+ tabIndex: this.computedTabIndex,
275
432
  type: "button"
276
433
  },
434
+ type: "button",
277
435
  "class": "k-coloreditor-cancel",
278
- onClick: this.handleCancelBtnClick,
436
+ onKeydown: this.handleButtonKeydown,
279
437
  on: this.v3 ? undefined : {
438
+ "keydown": this.handleButtonKeydown,
280
439
  "click": this.handleCancelBtnClick
281
- }
440
+ },
441
+ onClick: this.handleCancelBtnClick
282
442
  }, this.v3 ? function () {
283
- return [messages_1.messages[messages_1.flatColorPickerCancelBtn]];
284
- } : [messages_1.messages[messages_1.flatColorPickerCancelBtn]]), // @ts-ignore function children
443
+ return [cancelMessage];
444
+ } : [cancelMessage]), // @ts-ignore function children
285
445
  h(kendo_vue_buttons_1.Button, {
286
- type: "button",
446
+ tabIndex: this.computedTabIndex,
287
447
  attrs: this.v3 ? undefined : {
448
+ tabIndex: this.computedTabIndex,
288
449
  type: "button"
289
450
  },
451
+ type: "button",
290
452
  "class": "k-coloreditor-apply k-primary",
291
- onClick: this.handleApplyBtnClick,
453
+ onKeydown: this.handleButtonKeydown,
292
454
  on: this.v3 ? undefined : {
455
+ "keydown": this.handleButtonKeydown,
293
456
  "click": this.handleApplyBtnClick
294
- }
457
+ },
458
+ onClick: this.handleApplyBtnClick
295
459
  }, this.v3 ? function () {
296
- return [messages_1.messages[messages_1.flatColorPickerApplyBtn]];
297
- } : [messages_1.messages[messages_1.flatColorPickerApplyBtn]])])]);
460
+ return [applyMessage];
461
+ } : [applyMessage])]), footer]);
298
462
  },
299
463
  methods: {
300
464
  focus: function focus() {
301
- if (this.$el) {
302
- this.$el.focus();
303
- }
465
+ var _this = this;
466
+
467
+ this.focused = true;
468
+ setTimeout(function () {
469
+ kendo_vue_common_1.focusFirstFocusableChild(_this.$el);
470
+ }, 1);
471
+ },
472
+ onKeyDownHandler: function onKeyDownHandler(e) {
473
+ var element = this.$el;
474
+ this.focused = kendo_vue_common_1.focusContainer(e, element);
475
+ this.$emit('keydown', e);
304
476
  },
305
477
  handleViewChange: function handleViewChange(event, viewType) {
306
478
  this.currentView = viewType;
@@ -310,36 +482,64 @@ var FlatColorPickerVue2 = {
310
482
  });
311
483
  },
312
484
  handleResetColor: function handleResetColor() {
313
- this.colorValue = 'rgba(255, 255, 255, 1)';
485
+ this.colorValue = null;
314
486
  },
315
487
  handleColorChange: function handleColorChange(event) {
316
488
  this.colorValue = event.value;
317
489
  },
318
- handleApplyBtnClick: function handleApplyBtnClick() {
319
- this.prevColor = this.colorValue;
490
+ handlePaletteColorChange: function handlePaletteColorChange(event) {
491
+ this.colorValue = event.value;
492
+ },
493
+ handleApplyBtnClick: function handleApplyBtnClick(event) {
494
+ var rgbaValue = color_parser_1.parseColor(this.colorValue, 'rgba');
495
+ this.currentPrevColor = this.colorValue;
496
+ this.$emit('changemodel', this.colorValue);
497
+ this.$emit('update:modelValue', this.colorValue);
498
+ this.$emit('update:modelRgbaValue', rgbaValue);
499
+ this.$emit('change', {
500
+ event: event,
501
+ value: this.colorValue,
502
+ rgbaValue: rgbaValue
503
+ });
504
+ },
505
+ innerKeyDown: function innerKeyDown(event) {
506
+ if (event.keyCode === kendo_vue_common_1.Keys.enter) {
507
+ this.handleApplyBtnClick(event);
508
+ }
509
+ },
510
+ gradientKeyDown: function gradientKeyDown(event) {
511
+ event.stopPropagation();
512
+
513
+ if (!this.showButtons && event.keyCode === kendo_vue_common_1.Keys.enter) {
514
+ this.handleApplyBtnClick(event);
515
+ }
516
+ },
517
+ handleButtonKeydown: function handleButtonKeydown(e) {
518
+ if (e.keyCode === kendo_vue_common_1.Keys.enter) {
519
+ e.stopPropagation();
520
+ }
320
521
  },
321
522
  handleCancelBtnClick: function handleCancelBtnClick() {
322
- this.prevColor = 'rgba(255, 255, 255, 1)';
523
+ this.colorValue = this.computedPrevColor;
323
524
  },
324
525
  handlePrevColorClick: function handlePrevColorClick() {
325
- this.colorValue = this.prevColor;
526
+ this.colorValue = this.computedPrevColor;
326
527
  },
327
- handleFocus: function handleFocus() {
328
- if (this.$el) {
329
- this.$el.focus();
330
- }
528
+ onFocus: function onFocus(event) {
529
+ this.$emit('focus', {
530
+ event: event,
531
+ target: this
532
+ });
331
533
  },
332
- handleFlatColorPickerBlur: function handleFlatColorPickerBlur() {
333
- this.prevColor = this.colorValue;
534
+ onBlur: function onBlur(event) {
535
+ this.$emit('blur', {
536
+ event: event,
537
+ target: this
538
+ });
334
539
  }
335
540
  }
336
541
  };
337
542
  exports.FlatColorPickerVue2 = FlatColorPickerVue2;
338
- var defaultProps = {
339
- showClearButton: true,
340
- showPreview: true,
341
- showButtons: true
342
- };
343
543
  /**
344
544
  * @hidden
345
545
  */
@@ -7,6 +7,7 @@ declare type DefaultMethods<V> = {
7
7
  * @hidden
8
8
  */
9
9
  export interface HexInputProps {
10
+ tabIndex: number;
10
11
  hex: string;
11
12
  onHexChange?: any;
12
13
  disabled?: boolean;