@progress/kendo-vue-inputs 3.4.2 → 3.4.3
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.
- package/dist/cdn/js/kendo-vue-inputs.js +1 -1
- package/dist/es/colors/ColorContrastSvg.d.ts +1 -1
- package/dist/es/colors/ColorGradient.d.ts +1 -0
- package/dist/es/colors/ColorGradient.js +77 -55
- package/dist/es/colors/ColorInput.js +58 -13
- package/dist/es/colors/ColorPalette.d.ts +0 -1
- package/dist/es/colors/ColorPalette.js +5 -28
- package/dist/es/colors/ColorPicker.d.ts +0 -1
- package/dist/es/colors/ColorPicker.js +170 -87
- package/dist/es/colors/FlatColorPicker.js +56 -18
- package/dist/es/colors/HexInput.js +25 -7
- package/dist/es/colors/interfaces/ColorPickerProps.d.ts +6 -1
- package/dist/es/colors/utils/color-palette.service.d.ts +1 -0
- package/dist/es/colors/utils/color-palette.service.js +7 -16
- package/dist/es/main.d.ts +1 -0
- package/dist/es/main.js +1 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/slider/Slider.js +12 -2
- package/dist/npm/colors/ColorContrastSvg.d.ts +1 -1
- package/dist/npm/colors/ColorGradient.d.ts +1 -0
- package/dist/npm/colors/ColorGradient.js +76 -54
- package/dist/npm/colors/ColorInput.js +58 -13
- package/dist/npm/colors/ColorPalette.d.ts +0 -1
- package/dist/npm/colors/ColorPalette.js +5 -28
- package/dist/npm/colors/ColorPicker.d.ts +0 -1
- package/dist/npm/colors/ColorPicker.js +169 -85
- package/dist/npm/colors/FlatColorPicker.js +56 -18
- package/dist/npm/colors/HexInput.js +25 -7
- package/dist/npm/colors/interfaces/ColorPickerProps.d.ts +6 -1
- package/dist/npm/colors/utils/color-palette.service.d.ts +1 -0
- package/dist/npm/colors/utils/color-palette.service.js +7 -16
- package/dist/npm/main.d.ts +1 -0
- package/dist/npm/main.js +2 -0
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/slider/Slider.js +12 -2
- package/package.json +14 -14
|
@@ -18,8 +18,10 @@ var ColorPaletteService = /** @class */ (function () {
|
|
|
18
18
|
this.colorRows.push(row);
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
|
+
ColorPaletteService.prototype.isInColors = function (colors, current) {
|
|
22
|
+
return colors.some(function (c) { return c === current; });
|
|
23
|
+
};
|
|
21
24
|
ColorPaletteService.prototype.getCellCoordsFor = function (color) {
|
|
22
|
-
var _this = this;
|
|
23
25
|
if (!isPresent(color)) {
|
|
24
26
|
return;
|
|
25
27
|
}
|
|
@@ -28,23 +30,12 @@ var ColorPaletteService = /** @class */ (function () {
|
|
|
28
30
|
if (isPresent(parsedColor)) {
|
|
29
31
|
colors.push(parsedColor.toCss(), parsedColor.toCssRgba());
|
|
30
32
|
}
|
|
31
|
-
var
|
|
32
|
-
var
|
|
33
|
-
if (
|
|
34
|
-
return {
|
|
33
|
+
for (var row = 0; row < this.colorRows.length; row++) {
|
|
34
|
+
for (var col = 0; col < this.colorRows[row].length; col++) {
|
|
35
|
+
if (this.isInColors(colors, this.colorRows[row][col])) {
|
|
36
|
+
return { row: row, col: col };
|
|
35
37
|
}
|
|
36
|
-
};
|
|
37
|
-
for (var col = 0; col < this_1.colorRows[row].length; col++) {
|
|
38
|
-
var state_2 = _loop_2(col);
|
|
39
|
-
if (typeof state_2 === "object")
|
|
40
|
-
return state_2;
|
|
41
38
|
}
|
|
42
|
-
};
|
|
43
|
-
var this_1 = this;
|
|
44
|
-
for (var row = 0; row < this.colorRows.length; row++) {
|
|
45
|
-
var state_1 = _loop_1(row);
|
|
46
|
-
if (typeof state_1 === "object")
|
|
47
|
-
return state_1.value;
|
|
48
39
|
}
|
|
49
40
|
};
|
|
50
41
|
ColorPaletteService.prototype.getColorAt = function (cellCoords) {
|
package/dist/es/main.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FormComponentValidity } from '@progress/kendo-vue-common';
|
|
2
2
|
export { FormComponentValidity };
|
|
3
|
+
export { ColorGradient, ColorGradientState } from './colors/ColorGradient';
|
|
3
4
|
export { ColorPalette, ColorPaletteState } from './colors/ColorPalette';
|
|
4
5
|
export * from './colors/ColorPicker';
|
|
5
6
|
export * from './colors/interfaces/ColorPaletteChangeEvent';
|
package/dist/es/main.js
CHANGED
|
@@ -5,7 +5,7 @@ export var packageMetadata = {
|
|
|
5
5
|
name: '@progress/kendo-vue-inputs',
|
|
6
6
|
productName: 'Kendo UI for Vue',
|
|
7
7
|
productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
|
|
8
|
-
publishDate:
|
|
8
|
+
publishDate: 1657627749,
|
|
9
9
|
version: '',
|
|
10
10
|
licensingDocsUrl: 'https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning'
|
|
11
11
|
};
|
package/dist/es/slider/Slider.js
CHANGED
|
@@ -20,6 +20,14 @@ var SliderVue2 = {
|
|
|
20
20
|
model: {
|
|
21
21
|
event: 'changemodel'
|
|
22
22
|
},
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
emits: {
|
|
25
|
+
'changemodel': null,
|
|
26
|
+
'update:modelValue': null,
|
|
27
|
+
'change': null,
|
|
28
|
+
'blur': null,
|
|
29
|
+
'focus': null
|
|
30
|
+
},
|
|
23
31
|
props: {
|
|
24
32
|
modelValue: {
|
|
25
33
|
type: Number,
|
|
@@ -308,11 +316,13 @@ var SliderVue2 = {
|
|
|
308
316
|
|
|
309
317
|
return false;
|
|
310
318
|
},
|
|
311
|
-
onFocus: function onFocus() {
|
|
319
|
+
onFocus: function onFocus(event) {
|
|
312
320
|
this.currentFocused = true;
|
|
321
|
+
this.$emit('focus', event);
|
|
313
322
|
},
|
|
314
|
-
onBlur: function onBlur() {
|
|
323
|
+
onBlur: function onBlur(event) {
|
|
315
324
|
this.currentFocused = false;
|
|
325
|
+
this.$emit('blur', event);
|
|
316
326
|
},
|
|
317
327
|
onKeyDown: function onKeyDown(e) {
|
|
318
328
|
var newValue = undefined;
|
|
@@ -1,21 +1,5 @@
|
|
|
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
|
-
|
|
19
3
|
Object.defineProperty(exports, "__esModule", {
|
|
20
4
|
value: true
|
|
21
5
|
});
|
|
@@ -58,7 +42,9 @@ var ColorGradientVue2 = {
|
|
|
58
42
|
// @ts-ignore
|
|
59
43
|
emits: {
|
|
60
44
|
'change': null,
|
|
61
|
-
'focus': null
|
|
45
|
+
'focus': null,
|
|
46
|
+
'blur': null,
|
|
47
|
+
'keydown': null
|
|
62
48
|
},
|
|
63
49
|
props: {
|
|
64
50
|
defaultValue: String,
|
|
@@ -82,9 +68,9 @@ var ColorGradientVue2 = {
|
|
|
82
68
|
return this.$props.value === undefined;
|
|
83
69
|
},
|
|
84
70
|
computedValue: function computedValue() {
|
|
85
|
-
var value = this.value || this.defaultValue || color_parser_1.parseColor(DEFAULT_SELECTED_COLOR, FORMAT);
|
|
71
|
+
var value = this.value || this.defaultValue || this.currentValue || color_parser_1.parseColor(DEFAULT_SELECTED_COLOR, FORMAT);
|
|
86
72
|
|
|
87
|
-
if (!misc_1.isPresent(color_parser_1.parseColor(
|
|
73
|
+
if (!misc_1.isPresent(color_parser_1.parseColor(value, 'hex'))) {
|
|
88
74
|
// Validate/sanitize the input.
|
|
89
75
|
value = DEFAULT_SELECTED_COLOR;
|
|
90
76
|
}
|
|
@@ -92,13 +78,13 @@ var ColorGradientVue2 = {
|
|
|
92
78
|
return value;
|
|
93
79
|
},
|
|
94
80
|
hsva: function hsva() {
|
|
95
|
-
return color_cache_1.getCachedHsva(this.guid, this.computedValue) || color_parser_1.getHSV(this.computedValue);
|
|
81
|
+
return this.currentHsva || color_cache_1.getCachedHsva(this.guid, this.computedValue) || color_parser_1.getHSV(this.computedValue);
|
|
96
82
|
},
|
|
97
83
|
rgba: function rgba() {
|
|
98
|
-
return color_cache_1.getCachedRgba(this.guid, this.computedValue) || color_parser_1.getRGBA(this.computedValue);
|
|
84
|
+
return this.currentRgba || color_cache_1.getCachedRgba(this.guid, this.computedValue) || color_parser_1.getRGBA(this.computedValue);
|
|
99
85
|
},
|
|
100
86
|
hex: function hex() {
|
|
101
|
-
return color_cache_1.getCachedHex(this.guid, this.computedValue) || color_parser_1.parseColor(this.computedValue, 'hex');
|
|
87
|
+
return this.currentHex || color_cache_1.getCachedHex(this.guid, this.computedValue) || color_parser_1.parseColor(this.computedValue, 'hex');
|
|
102
88
|
},
|
|
103
89
|
computedBgColor: function computedBgColor() {
|
|
104
90
|
return this.backgroundColor !== undefined ? this.backgroundColor : this.currentBgColor || color_parser_1.getColorFromHue(this.hsva.h);
|
|
@@ -106,8 +92,12 @@ var ColorGradientVue2 = {
|
|
|
106
92
|
},
|
|
107
93
|
data: function data() {
|
|
108
94
|
return {
|
|
95
|
+
currentValue: undefined,
|
|
109
96
|
currentBgColor: undefined,
|
|
110
|
-
isFirstRender: true
|
|
97
|
+
isFirstRender: true,
|
|
98
|
+
currentHsva: undefined,
|
|
99
|
+
currentRgba: undefined,
|
|
100
|
+
currentHex: undefined
|
|
111
101
|
};
|
|
112
102
|
},
|
|
113
103
|
mounted: function mounted() {
|
|
@@ -127,11 +117,10 @@ var ColorGradientVue2 = {
|
|
|
127
117
|
destroyed: function destroyed() {
|
|
128
118
|
color_cache_1.removeCachedColor(this.guid);
|
|
129
119
|
},
|
|
130
|
-
updated: function updated() {
|
|
131
|
-
//
|
|
132
|
-
// }
|
|
120
|
+
updated: function updated() {
|
|
121
|
+
// if (prevState.backgroundColor !== this.backgroundColor) {
|
|
122
|
+
this.setAlphaSliderBackground(this.computedBgColor); // }
|
|
133
123
|
},
|
|
134
|
-
// private alphaSlider: any;
|
|
135
124
|
// @ts-ignore
|
|
136
125
|
setup: !isV3 ? undefined : function () {
|
|
137
126
|
var v3 = !!isV3;
|
|
@@ -183,8 +172,12 @@ var ColorGradientVue2 = {
|
|
|
183
172
|
"aria-describedby": this.$props.ariaDescribedBy,
|
|
184
173
|
onFocus: this.onFocus,
|
|
185
174
|
on: this.v3 ? undefined : {
|
|
186
|
-
"focus": this.onFocus
|
|
187
|
-
|
|
175
|
+
"focus": this.onFocus,
|
|
176
|
+
"blur": this.onBlur,
|
|
177
|
+
"keydown": this.onKeyDownHandler
|
|
178
|
+
},
|
|
179
|
+
onBlur: this.onBlur,
|
|
180
|
+
onKeydown: this.onKeyDownHandler
|
|
188
181
|
}, [h("div", {
|
|
189
182
|
"class": "k-colorgradient-canvas k-hstack"
|
|
190
183
|
}, [h("div", {
|
|
@@ -250,8 +243,12 @@ var ColorGradientVue2 = {
|
|
|
250
243
|
step: 5,
|
|
251
244
|
onChange: this.onHueSliderChange,
|
|
252
245
|
on: this.v3 ? undefined : {
|
|
253
|
-
"change": this.onHueSliderChange
|
|
246
|
+
"change": this.onHueSliderChange,
|
|
247
|
+
"focus": this.onFocus,
|
|
248
|
+
"blur": this.onBlur
|
|
254
249
|
},
|
|
250
|
+
onFocus: this.onFocus,
|
|
251
|
+
onBlur: this.onBlur,
|
|
255
252
|
"class": "k-hue-slider k-colorgradient-slider",
|
|
256
253
|
disabled: this.$props.disabled
|
|
257
254
|
}), this.$props.opacity && h(main_1.Slider, {
|
|
@@ -272,8 +269,12 @@ var ColorGradientVue2 = {
|
|
|
272
269
|
step: 1,
|
|
273
270
|
onChange: this.onAlphaSliderChange,
|
|
274
271
|
on: this.v3 ? undefined : {
|
|
275
|
-
"change": this.onAlphaSliderChange
|
|
272
|
+
"change": this.onAlphaSliderChange,
|
|
273
|
+
"focus": this.onFocus,
|
|
274
|
+
"blur": this.onBlur
|
|
276
275
|
},
|
|
276
|
+
onFocus: this.onFocus,
|
|
277
|
+
onBlur: this.onBlur,
|
|
277
278
|
"class": "k-alpha-slider k-colorgradient-slider",
|
|
278
279
|
disabled: this.$props.disabled,
|
|
279
280
|
ref: this.v3 ? function (el) {
|
|
@@ -287,13 +288,17 @@ var ColorGradientVue2 = {
|
|
|
287
288
|
opacity: this.$props.opacity,
|
|
288
289
|
disabled: this.$props.disabled
|
|
289
290
|
},
|
|
290
|
-
|
|
291
|
+
onRgbachange: this.onRgbaChange,
|
|
291
292
|
on: this.v3 ? undefined : {
|
|
292
|
-
"
|
|
293
|
-
"
|
|
293
|
+
"rgbachange": this.onRgbaChange,
|
|
294
|
+
"focus": this.onFocus,
|
|
295
|
+
"blur": this.onBlur,
|
|
296
|
+
"hexchange": this.onHexChange
|
|
294
297
|
},
|
|
295
298
|
hex: this.hex,
|
|
296
|
-
|
|
299
|
+
onFocus: this.onFocus,
|
|
300
|
+
onBlur: this.onBlur,
|
|
301
|
+
onHexchange: this.onHexChange,
|
|
297
302
|
opacity: this.$props.opacity,
|
|
298
303
|
disabled: this.$props.disabled
|
|
299
304
|
}), this.computedBgColor && h(ColorContrastLabels_1.ColorContrastLabels, {
|
|
@@ -313,13 +318,16 @@ var ColorGradientVue2 = {
|
|
|
313
318
|
// }
|
|
314
319
|
// return null;
|
|
315
320
|
// },
|
|
321
|
+
onKeyDownHandler: function onKeyDownHandler(e) {
|
|
322
|
+
this.$emit('keydown', e);
|
|
323
|
+
},
|
|
316
324
|
onHexChange: function onHexChange(hex, value, event) {
|
|
317
325
|
if (this.isUncontrolled) {
|
|
318
326
|
var hsva = color_parser_1.getHSV(value);
|
|
319
|
-
this.
|
|
320
|
-
this.
|
|
321
|
-
this.
|
|
322
|
-
this.
|
|
327
|
+
this.currentHsva = hsva;
|
|
328
|
+
this.currentBgColor = color_parser_1.getColorFromHue(hsva.h);
|
|
329
|
+
this.currentRgba = color_parser_1.getRGBA(value);
|
|
330
|
+
this.currentHex = hex;
|
|
323
331
|
} else {
|
|
324
332
|
color_cache_1.cacheHex(this.guid, value, hex);
|
|
325
333
|
}
|
|
@@ -332,10 +340,10 @@ var ColorGradientVue2 = {
|
|
|
332
340
|
if (this.isUncontrolled) {
|
|
333
341
|
var hsva = color_parser_1.getHSV(value);
|
|
334
342
|
var hex = color_parser_1.parseColor(value, 'hex');
|
|
335
|
-
this.
|
|
343
|
+
this.currentHsva = hsva;
|
|
336
344
|
this.currentBgColor = color_parser_1.getColorFromHue(hsva.h);
|
|
337
|
-
this.
|
|
338
|
-
this.
|
|
345
|
+
this.currentRgba = rgba;
|
|
346
|
+
this.currentHex = hex;
|
|
339
347
|
} else {
|
|
340
348
|
color_cache_1.cacheRgba(this.guid, value, rgba);
|
|
341
349
|
}
|
|
@@ -379,10 +387,10 @@ var ColorGradientVue2 = {
|
|
|
379
387
|
|
|
380
388
|
if (this.isUncontrolled) {
|
|
381
389
|
var hex = color_parser_1.parseColor(value, 'hex');
|
|
382
|
-
this.
|
|
390
|
+
this.currentHsva = hsva;
|
|
383
391
|
this.currentBgColor = color_parser_1.getColorFromHue(hsva.h);
|
|
384
|
-
this.
|
|
385
|
-
this.
|
|
392
|
+
this.currentRgba = color_parser_1.getRGBA(value);
|
|
393
|
+
this.currentHex = hex;
|
|
386
394
|
} else {
|
|
387
395
|
color_cache_1.cacheHsva(this.guid, value, hsva);
|
|
388
396
|
}
|
|
@@ -390,19 +398,24 @@ var ColorGradientVue2 = {
|
|
|
390
398
|
this.dispatchChangeEvent(value, event);
|
|
391
399
|
},
|
|
392
400
|
dispatchChangeEvent: function dispatchChangeEvent(value, event) {
|
|
401
|
+
this.currentValue = value;
|
|
393
402
|
this.$emit('change', {
|
|
394
403
|
event: event,
|
|
395
404
|
target: this,
|
|
396
405
|
value: value
|
|
397
406
|
});
|
|
398
407
|
},
|
|
399
|
-
onFocus: function onFocus(
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
408
|
+
onFocus: function onFocus(event) {
|
|
409
|
+
this.$emit('focus', {
|
|
410
|
+
event: event,
|
|
411
|
+
target: this
|
|
412
|
+
});
|
|
413
|
+
},
|
|
414
|
+
onBlur: function onBlur(event) {
|
|
415
|
+
this.$emit('blur', {
|
|
416
|
+
event: event,
|
|
417
|
+
target: this
|
|
418
|
+
});
|
|
406
419
|
},
|
|
407
420
|
setAlphaSliderBackground: function setAlphaSliderBackground(backgroundColor) {
|
|
408
421
|
if (this.$props.opacity && this.alphaSlider && this.alphaSlider.sliderTrack) {
|
|
@@ -410,8 +423,17 @@ var ColorGradientVue2 = {
|
|
|
410
423
|
}
|
|
411
424
|
},
|
|
412
425
|
getGradientRectMetrics: function getGradientRectMetrics() {
|
|
413
|
-
var
|
|
414
|
-
return
|
|
426
|
+
var rect = this.gradientWrapper.getBoundingClientRect();
|
|
427
|
+
return {
|
|
428
|
+
top: rect.top,
|
|
429
|
+
right: rect.right,
|
|
430
|
+
bottom: rect.bottom,
|
|
431
|
+
left: rect.left,
|
|
432
|
+
width: rect.width,
|
|
433
|
+
height: rect.height,
|
|
434
|
+
x: rect.x,
|
|
435
|
+
y: rect.y
|
|
436
|
+
};
|
|
415
437
|
},
|
|
416
438
|
focus: function focus() {
|
|
417
439
|
kendo_vue_common_1.focusFirstFocusableChild(this.$el);
|
|
@@ -50,12 +50,24 @@ var modes = ['rgba', 'rgb', 'hex'];
|
|
|
50
50
|
|
|
51
51
|
var ColorInputVue2 = {
|
|
52
52
|
name: 'KendoColorInput',
|
|
53
|
+
// @ts-ignore
|
|
54
|
+
emits: {
|
|
55
|
+
'focus': null,
|
|
56
|
+
'blur': null,
|
|
57
|
+
'hexchange': null,
|
|
58
|
+
'rgbachange': null
|
|
59
|
+
},
|
|
53
60
|
props: {
|
|
54
61
|
rgba: Object,
|
|
55
62
|
hex: String,
|
|
56
63
|
opacity: Boolean,
|
|
57
64
|
disabled: Boolean
|
|
58
65
|
},
|
|
66
|
+
inject: {
|
|
67
|
+
kendoLocalizationService: {
|
|
68
|
+
default: null
|
|
69
|
+
}
|
|
70
|
+
},
|
|
59
71
|
data: function data() {
|
|
60
72
|
return {
|
|
61
73
|
inputMode: modes[1]
|
|
@@ -88,11 +100,15 @@ var ColorInputVue2 = {
|
|
|
88
100
|
icon: 'arrows-kpi'
|
|
89
101
|
},
|
|
90
102
|
icon: 'arrows-kpi',
|
|
91
|
-
|
|
92
|
-
onClick: this.onToggleModeChange.bind(this),
|
|
103
|
+
onFocus: this.onFocus,
|
|
93
104
|
on: this.v3 ? undefined : {
|
|
94
|
-
"
|
|
95
|
-
|
|
105
|
+
"focus": this.onFocus,
|
|
106
|
+
"blur": this.onBlur,
|
|
107
|
+
"click": this.onToggleModeChange
|
|
108
|
+
},
|
|
109
|
+
onBlur: this.onBlur,
|
|
110
|
+
"class": "k-colorgradient-toggle-mode k-icon-button",
|
|
111
|
+
onClick: this.onToggleModeChange
|
|
96
112
|
})]), this.inputMode === 'hex' && h("div", {
|
|
97
113
|
"class": "k-vstack k-flex-1"
|
|
98
114
|
}, [h("span", {
|
|
@@ -103,10 +119,14 @@ var ColorInputVue2 = {
|
|
|
103
119
|
hex: this.$props.hex,
|
|
104
120
|
disabled: this.$props.disabled
|
|
105
121
|
},
|
|
106
|
-
|
|
122
|
+
onFocus: this.onFocus,
|
|
107
123
|
on: this.v3 ? undefined : {
|
|
108
|
-
"
|
|
124
|
+
"focus": this.onFocus,
|
|
125
|
+
"blur": this.onBlur,
|
|
126
|
+
"hexchange": this.onHexChange
|
|
109
127
|
},
|
|
128
|
+
onBlur: this.onBlur,
|
|
129
|
+
onHexchange: this.onHexChange,
|
|
110
130
|
disabled: this.$props.disabled
|
|
111
131
|
})]), // @ts-ignore function children
|
|
112
132
|
h(kendo_vue_labels_1.Label, {
|
|
@@ -129,10 +149,14 @@ var ColorInputVue2 = {
|
|
|
129
149
|
max: 255,
|
|
130
150
|
spinners: false,
|
|
131
151
|
format: "n",
|
|
132
|
-
|
|
152
|
+
onFocus: this.onFocus,
|
|
133
153
|
on: this.v3 ? undefined : {
|
|
154
|
+
"focus": this.onFocus,
|
|
155
|
+
"blur": this.onBlur,
|
|
134
156
|
"change": this.onRgbaRChange
|
|
135
157
|
},
|
|
158
|
+
onBlur: this.onBlur,
|
|
159
|
+
onChange: this.onRgbaRChange,
|
|
136
160
|
disabled: this.$props.disabled
|
|
137
161
|
}), // @ts-ignore function children
|
|
138
162
|
h(kendo_vue_labels_1.Label, {
|
|
@@ -155,10 +179,14 @@ var ColorInputVue2 = {
|
|
|
155
179
|
max: 255,
|
|
156
180
|
spinners: false,
|
|
157
181
|
format: "n",
|
|
158
|
-
|
|
182
|
+
onFocus: this.onFocus,
|
|
159
183
|
on: this.v3 ? undefined : {
|
|
184
|
+
"focus": this.onFocus,
|
|
185
|
+
"blur": this.onBlur,
|
|
160
186
|
"change": this.onRgbaGChange
|
|
161
187
|
},
|
|
188
|
+
onBlur: this.onBlur,
|
|
189
|
+
onChange: this.onRgbaGChange,
|
|
162
190
|
disabled: this.$props.disabled
|
|
163
191
|
}), // @ts-ignore function children
|
|
164
192
|
h(kendo_vue_labels_1.Label, {
|
|
@@ -181,10 +209,14 @@ var ColorInputVue2 = {
|
|
|
181
209
|
max: 255,
|
|
182
210
|
spinners: false,
|
|
183
211
|
format: "n",
|
|
184
|
-
|
|
212
|
+
onFocus: this.onFocus,
|
|
185
213
|
on: this.v3 ? undefined : {
|
|
214
|
+
"focus": this.onFocus,
|
|
215
|
+
"blur": this.onBlur,
|
|
186
216
|
"change": this.onRgbaBChange
|
|
187
217
|
},
|
|
218
|
+
onBlur: this.onBlur,
|
|
219
|
+
onChange: this.onRgbaBChange,
|
|
188
220
|
disabled: this.$props.disabled
|
|
189
221
|
}), // @ts-ignore function children
|
|
190
222
|
h(kendo_vue_labels_1.Label, {
|
|
@@ -209,19 +241,32 @@ var ColorInputVue2 = {
|
|
|
209
241
|
step: 0.01,
|
|
210
242
|
spinners: false,
|
|
211
243
|
format: "n2",
|
|
212
|
-
|
|
244
|
+
onFocus: this.onFocus,
|
|
213
245
|
on: this.v3 ? undefined : {
|
|
246
|
+
"focus": this.onFocus,
|
|
247
|
+
"blur": this.onBlur,
|
|
214
248
|
"change": this.onRgbaAChange
|
|
215
249
|
},
|
|
250
|
+
onBlur: this.onBlur,
|
|
251
|
+
onChange: this.onRgbaAChange,
|
|
216
252
|
disabled: this.$props.disabled
|
|
217
|
-
}),
|
|
253
|
+
}), this.$props.opacity && // @ts-ignore function children
|
|
218
254
|
h(kendo_vue_labels_1.Label, {
|
|
219
255
|
"class": "k-colorgradient-input-label"
|
|
220
256
|
}, this.v3 ? function () {
|
|
221
257
|
return [aMessage];
|
|
222
|
-
} : [aMessage])
|
|
258
|
+
} : [aMessage])])]);
|
|
223
259
|
},
|
|
224
260
|
methods: {
|
|
261
|
+
onFocus: function onFocus(event) {
|
|
262
|
+
this.$emit('focus', event);
|
|
263
|
+
},
|
|
264
|
+
onBlur: function onBlur(event) {
|
|
265
|
+
this.$emit('blur', event);
|
|
266
|
+
},
|
|
267
|
+
onHexChange: function onHexChange(event) {
|
|
268
|
+
this.$emit('hexchange', event);
|
|
269
|
+
},
|
|
225
270
|
onRgbaRChange: function onRgbaRChange(event) {
|
|
226
271
|
this.dispatchRgbaChange({
|
|
227
272
|
r: event.value
|
|
@@ -261,7 +306,7 @@ var ColorInputVue2 = {
|
|
|
261
306
|
rgba.a = newValue.a;
|
|
262
307
|
}
|
|
263
308
|
|
|
264
|
-
this.$
|
|
309
|
+
this.$emit('rgbachange', rgba, event);
|
|
265
310
|
},
|
|
266
311
|
onToggleModeChange: function onToggleModeChange() {
|
|
267
312
|
var index = modes.length - 1 === modes.indexOf(this.inputMode) ? 0 : modes.indexOf(this.inputMode) + 1;
|
|
@@ -92,9 +92,8 @@ var ColorPaletteVue2 = {
|
|
|
92
92
|
},
|
|
93
93
|
data: function data() {
|
|
94
94
|
return {
|
|
95
|
-
focusedColor:
|
|
96
|
-
currentValue: undefined
|
|
97
|
-
isFirstRender: true
|
|
95
|
+
focusedColor: this.$props.value,
|
|
96
|
+
currentValue: undefined
|
|
98
97
|
};
|
|
99
98
|
},
|
|
100
99
|
// @ts-ignore
|
|
@@ -113,7 +112,7 @@ var ColorPaletteVue2 = {
|
|
|
113
112
|
var selectedCellCoords = svc.getCellCoordsFor(this.selectedColor);
|
|
114
113
|
var focusedCellCoords = svc.getCellCoordsFor(this.focusedColor);
|
|
115
114
|
var className = kendo_vue_common_1.classNames('k-colorpalette', {
|
|
116
|
-
'k-
|
|
115
|
+
'k-disabled': this.$props.disabled
|
|
117
116
|
});
|
|
118
117
|
|
|
119
118
|
var renderColumns = function renderColumns(columns, rowIndex, cSelectedCellCoords, cFocusedCellCoords) {
|
|
@@ -132,8 +131,8 @@ var ColorPaletteVue2 = {
|
|
|
132
131
|
|
|
133
132
|
var isSelected = rowIsSelected && selectedColumn === i;
|
|
134
133
|
var tdClassName = kendo_vue_common_1.classNames('k-colorpalette-tile', {
|
|
135
|
-
'k-
|
|
136
|
-
'k-
|
|
134
|
+
'k-selected': isSelected,
|
|
135
|
+
'k-focus': rowIsFocused && focusedColumn === i
|
|
137
136
|
});
|
|
138
137
|
return h("td", {
|
|
139
138
|
"class": tdClassName,
|
|
@@ -233,27 +232,6 @@ var ColorPaletteVue2 = {
|
|
|
233
232
|
this.wrapper.focus();
|
|
234
233
|
}
|
|
235
234
|
},
|
|
236
|
-
getDerivedStateFromProps: function getDerivedStateFromProps(props, state) {
|
|
237
|
-
if (!state.isFirstRender && props.value !== undefined) {
|
|
238
|
-
// The component is in controlled mode.
|
|
239
|
-
if (props.value === '' && state.selectedColor !== undefined) {
|
|
240
|
-
// The selection has to be removed.
|
|
241
|
-
return {
|
|
242
|
-
selectedColor: undefined
|
|
243
|
-
};
|
|
244
|
-
} else if (props.value !== '' && props.value !== state.selectedColor) {
|
|
245
|
-
return {
|
|
246
|
-
selectedColor: props.value
|
|
247
|
-
};
|
|
248
|
-
}
|
|
249
|
-
} else if (state.isFirstRender) {
|
|
250
|
-
return {
|
|
251
|
-
isFirstRender: false
|
|
252
|
-
};
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
return null;
|
|
256
|
-
},
|
|
257
235
|
onKeyDown: function onKeyDown(event) {
|
|
258
236
|
switch (event.keyCode) {
|
|
259
237
|
case kendo_vue_common_1.Keys.down:
|
|
@@ -281,7 +259,6 @@ var ColorPaletteVue2 = {
|
|
|
281
259
|
return;
|
|
282
260
|
}
|
|
283
261
|
|
|
284
|
-
event.preventDefault();
|
|
285
262
|
this.$emit('keydown', event);
|
|
286
263
|
},
|
|
287
264
|
onColorClick: function onColorClick(color, event) {
|