@progress/kendo-vue-inputs 3.4.2 → 3.4.3-dev.202207111225
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 +164 -89
- 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 +163 -87
- 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
|
@@ -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
|
});
|
|
@@ -20,6 +36,8 @@ var package_metadata_1 = require("../package-metadata");
|
|
|
20
36
|
var Picker_1 = require("./Picker");
|
|
21
37
|
|
|
22
38
|
var ColorPalette_1 = require("./ColorPalette");
|
|
39
|
+
|
|
40
|
+
var ColorGradient_1 = require("./ColorGradient");
|
|
23
41
|
/**
|
|
24
42
|
* @hidden
|
|
25
43
|
*/
|
|
@@ -50,6 +68,15 @@ var isControlled = function isControlled(prop) {
|
|
|
50
68
|
|
|
51
69
|
var ColorPickerVue2 = {
|
|
52
70
|
name: 'KendoColorPicker',
|
|
71
|
+
// @ts-ignore
|
|
72
|
+
emits: {
|
|
73
|
+
'open': null,
|
|
74
|
+
'close': null,
|
|
75
|
+
'activecolorclick': null,
|
|
76
|
+
'focus': null,
|
|
77
|
+
'blur': null,
|
|
78
|
+
'change': null
|
|
79
|
+
},
|
|
53
80
|
props: {
|
|
54
81
|
value: {
|
|
55
82
|
type: String,
|
|
@@ -78,7 +105,18 @@ var ColorPickerVue2 = {
|
|
|
78
105
|
title: String,
|
|
79
106
|
icon: String,
|
|
80
107
|
iconClassName: String,
|
|
81
|
-
popupSettings:
|
|
108
|
+
popupSettings: {
|
|
109
|
+
type: Object,
|
|
110
|
+
default: function _default() {
|
|
111
|
+
return {};
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
gradientSettings: {
|
|
115
|
+
type: Object,
|
|
116
|
+
default: function _default() {
|
|
117
|
+
return {};
|
|
118
|
+
}
|
|
119
|
+
},
|
|
82
120
|
open: {
|
|
83
121
|
type: Boolean,
|
|
84
122
|
default: undefined
|
|
@@ -103,27 +141,34 @@ var ColorPickerVue2 = {
|
|
|
103
141
|
validator: function validator(value) {
|
|
104
142
|
return [null, 'solid', 'flat', 'outline'].includes(value);
|
|
105
143
|
}
|
|
144
|
+
},
|
|
145
|
+
view: {
|
|
146
|
+
type: String,
|
|
147
|
+
default: 'palette',
|
|
148
|
+
validator: function validator(value) {
|
|
149
|
+
return ['gradient', 'palette', 'combo'].includes(value);
|
|
150
|
+
}
|
|
106
151
|
}
|
|
107
152
|
},
|
|
108
153
|
data: function data() {
|
|
109
154
|
return {
|
|
110
155
|
focused: false,
|
|
111
|
-
|
|
112
|
-
|
|
156
|
+
currentValue: this.$props.defaultValue,
|
|
157
|
+
currentOpen: false
|
|
113
158
|
};
|
|
114
159
|
},
|
|
115
160
|
computed: {
|
|
116
161
|
isValueControlled: function isValueControlled() {
|
|
117
|
-
return
|
|
162
|
+
return this.$props.value !== undefined;
|
|
118
163
|
},
|
|
119
164
|
isOpenControlled: function isOpenControlled() {
|
|
120
|
-
return
|
|
165
|
+
return this.$props.open !== undefined;
|
|
121
166
|
},
|
|
122
167
|
computedValue: function computedValue() {
|
|
123
|
-
return this.isValueControlled ? this.$props.value : this.
|
|
168
|
+
return this.isValueControlled ? this.$props.value : this.currentValue;
|
|
124
169
|
},
|
|
125
170
|
computedOpen: function computedOpen() {
|
|
126
|
-
return this.isOpenControlled ? this.$props.open : this.
|
|
171
|
+
return this.isOpenControlled ? this.$props.open : this.currentOpen;
|
|
127
172
|
},
|
|
128
173
|
computedIconClassName: function computedIconClassName() {
|
|
129
174
|
var icon = this.$props.icon;
|
|
@@ -138,7 +183,8 @@ var ColorPickerVue2 = {
|
|
|
138
183
|
rounded = _b.rounded;
|
|
139
184
|
return _a = {
|
|
140
185
|
'k-picker': true,
|
|
141
|
-
'k-colorpicker': true
|
|
186
|
+
'k-colorpicker': true,
|
|
187
|
+
'k-icon-picker': true
|
|
142
188
|
}, _a["k-picker-" + (kendo_vue_common_1.kendoThemeMaps.sizeMap[size] || size)] = size, _a["k-picker-" + fillMode] = fillMode, _a["k-rounded-" + (kendo_vue_common_1.kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded, _a['k-invalid'] = !this.valid, _a['k-disabled'] = this.disabled, _a['k-focus'] = this.focused, _a;
|
|
143
189
|
}
|
|
144
190
|
},
|
|
@@ -147,13 +193,9 @@ var ColorPickerVue2 = {
|
|
|
147
193
|
this.focusableElementGuid = kendo_vue_common_1.guid();
|
|
148
194
|
},
|
|
149
195
|
mounted: function mounted() {
|
|
150
|
-
this.
|
|
151
|
-
this.button = this.v3 ? this.buttonRef : this.$refs.button;
|
|
152
|
-
this.palette = this.v3 ? this.paletteRef : this.$refs.palette;
|
|
196
|
+
this.button = kendo_vue_common_1.getRef(this, 'button');
|
|
153
197
|
},
|
|
154
|
-
updated: function updated() {
|
|
155
|
-
this.button = this.v3 ? this.buttonRef : this.$refs.button;
|
|
156
|
-
this.palette = this.v3 ? this.paletteRef : this.$refs.palette;
|
|
198
|
+
updated: function updated() {// this.button = getRef(this, 'button');
|
|
157
199
|
},
|
|
158
200
|
// @ts-ignore
|
|
159
201
|
setup: !isV3 ? undefined : function () {
|
|
@@ -174,7 +216,49 @@ var ColorPickerVue2 = {
|
|
|
174
216
|
var _b = this.$props,
|
|
175
217
|
disabled = _b.disabled,
|
|
176
218
|
tabIndex = _b.tabIndex,
|
|
177
|
-
dir = _b.dir
|
|
219
|
+
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({
|
|
246
|
+
onKeydown: this.onKeyDownHandler,
|
|
247
|
+
on: this.v3 ? undefined : {
|
|
248
|
+
'keydown': this.onKeyDownHandler,
|
|
249
|
+
'change': this.onPaletteChangeHandler,
|
|
250
|
+
'blur': this.onBlurHandler
|
|
251
|
+
},
|
|
252
|
+
ref: kendo_vue_common_1.setRef(this, 'palette'),
|
|
253
|
+
value: this.computedValue || undefined,
|
|
254
|
+
attrs: this.v3 ? undefined : __assign({
|
|
255
|
+
value: this.computedValue || undefined
|
|
256
|
+
}, this.paletteSettings),
|
|
257
|
+
onChange: this.onPaletteChangeHandler,
|
|
258
|
+
onBlur: this.onBlurHandler
|
|
259
|
+
}, this.paletteSettings));
|
|
260
|
+
}; // const dir = useDir(focusableElementGuid, props.dir);
|
|
261
|
+
|
|
178
262
|
|
|
179
263
|
return h("span", {
|
|
180
264
|
"class": this.wrapperClassName,
|
|
@@ -193,14 +277,12 @@ var ColorPickerVue2 = {
|
|
|
193
277
|
ref: this.focusableElementGuid,
|
|
194
278
|
tabindex: kendo_vue_common_1.getTabIndex(tabIndex, disabled),
|
|
195
279
|
title: this.$props.title,
|
|
196
|
-
onKeydown: this.
|
|
280
|
+
onKeydown: this.onButtonKeyDown,
|
|
197
281
|
on: this.v3 ? undefined : {
|
|
198
|
-
"keydown": this.
|
|
199
|
-
"focusin": this.onFocusHandler
|
|
200
|
-
"focusout": this.onBlurHandler
|
|
282
|
+
"keydown": this.onButtonKeyDown,
|
|
283
|
+
"focusin": this.onFocusHandler
|
|
201
284
|
},
|
|
202
|
-
onFocusin: this.onFocusHandler
|
|
203
|
-
onFocusout: this.onBlurHandler
|
|
285
|
+
onFocusin: this.onFocusHandler
|
|
204
286
|
}, [h("span", {
|
|
205
287
|
onClick: this.onActiveColorClickHandler,
|
|
206
288
|
on: this.v3 ? undefined : {
|
|
@@ -224,9 +306,11 @@ var ColorPickerVue2 = {
|
|
|
224
306
|
type: "button",
|
|
225
307
|
attrs: this.v3 ? undefined : {
|
|
226
308
|
type: "button",
|
|
309
|
+
tabindex: -1,
|
|
227
310
|
rounded: null,
|
|
228
311
|
icon: 'arrow-s'
|
|
229
312
|
},
|
|
313
|
+
tabindex: -1,
|
|
230
314
|
ref: this.v3 ? function (el) {
|
|
231
315
|
_this.buttonRef = el;
|
|
232
316
|
} : 'button',
|
|
@@ -252,94 +336,78 @@ var ColorPickerVue2 = {
|
|
|
252
336
|
},
|
|
253
337
|
popupAnchor: this.focusableElementGuid
|
|
254
338
|
}, this.v3 ? function () {
|
|
255
|
-
return [
|
|
256
|
-
|
|
257
|
-
onKeydown: _this2.onKeyDownHandler // {...paletteSettings}
|
|
258
|
-
,
|
|
259
|
-
on: _this2.v3 ? undefined : {
|
|
260
|
-
"keydown": _this2.onKeyDownHandler,
|
|
261
|
-
"change": _this2.onPaletteChangeHandler,
|
|
262
|
-
"blur": _this2.onBlurHandler
|
|
263
|
-
},
|
|
264
|
-
ref: _this2.v3 ? function (el) {
|
|
265
|
-
_this.paletteRef = el;
|
|
266
|
-
} : 'palette',
|
|
267
|
-
value: _this2.computedValue || undefined,
|
|
268
|
-
attrs: _this2.v3 ? undefined : {
|
|
269
|
-
value: _this2.computedValue || undefined
|
|
270
|
-
},
|
|
271
|
-
onChange: _this2.onPaletteChangeHandler,
|
|
272
|
-
onBlur: _this2.onBlurHandler
|
|
273
|
-
})];
|
|
274
|
-
} : [h(ColorPalette_1.ColorPalette, {
|
|
275
|
-
onKeydown: _this2.onKeyDownHandler,
|
|
276
|
-
on: _this2.v3 ? undefined : {
|
|
277
|
-
"keydown": _this2.onKeyDownHandler,
|
|
278
|
-
"change": _this2.onPaletteChangeHandler,
|
|
279
|
-
"blur": _this2.onBlurHandler
|
|
280
|
-
},
|
|
281
|
-
ref: _this2.v3 ? function (el) {
|
|
282
|
-
_this.paletteRef = el;
|
|
283
|
-
} : 'palette',
|
|
284
|
-
value: _this2.computedValue || undefined,
|
|
285
|
-
attrs: _this2.v3 ? undefined : {
|
|
286
|
-
value: _this2.computedValue || undefined
|
|
287
|
-
},
|
|
288
|
-
onChange: _this2.onPaletteChangeHandler,
|
|
289
|
-
onBlur: _this2.onBlurHandler
|
|
290
|
-
})])]);
|
|
339
|
+
return [(view === 'combo' || view === 'gradient') && renderGradiente.call(_this2), (view === 'combo' || view === 'palette') && renderPalette.call(_this2)];
|
|
340
|
+
} : [(view === 'combo' || view === 'gradient') && renderGradiente.call(_this2), (view === 'combo' || view === 'palette') && renderPalette.call(_this2)])]);
|
|
291
341
|
},
|
|
292
342
|
methods: {
|
|
293
343
|
focusElement: function focusElement() {
|
|
294
|
-
if (this
|
|
295
|
-
this.
|
|
344
|
+
if (this.$el) {
|
|
345
|
+
this.$el.focus();
|
|
296
346
|
}
|
|
297
347
|
},
|
|
298
348
|
setOpen: function setOpen(nextOpen, isBlur) {
|
|
299
|
-
if (!this
|
|
300
|
-
|
|
301
|
-
this.focusableElement.focus();
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
this.stateOpen = nextOpen;
|
|
349
|
+
if (!nextOpen && !isBlur && this.$el) {
|
|
350
|
+
this.$el.focus();
|
|
305
351
|
}
|
|
352
|
+
|
|
353
|
+
this.currentOpen = nextOpen;
|
|
354
|
+
this.$emit(nextOpen ? 'open' : 'close');
|
|
306
355
|
},
|
|
307
|
-
|
|
356
|
+
onButtonKeyDown: function onButtonKeyDown(event) {
|
|
308
357
|
var altKey = event.altKey,
|
|
309
358
|
keyCode = event.keyCode;
|
|
310
359
|
|
|
311
360
|
if (keyCode === kendo_vue_common_1.Keys.esc) {
|
|
361
|
+
event.preventDefault();
|
|
362
|
+
event.stopPropagation();
|
|
312
363
|
this.setOpen(false);
|
|
313
364
|
return;
|
|
314
365
|
}
|
|
315
366
|
|
|
316
|
-
if (keyCode === kendo_vue_common_1.Keys.enter
|
|
367
|
+
if (keyCode === kendo_vue_common_1.Keys.enter) {
|
|
317
368
|
event.preventDefault();
|
|
318
369
|
event.stopPropagation();
|
|
319
370
|
this.setOpen(!this.computedOpen);
|
|
320
371
|
return;
|
|
321
372
|
}
|
|
322
373
|
|
|
323
|
-
if (altKey &&
|
|
374
|
+
if (altKey && keyCode === kendo_vue_common_1.Keys.down) {
|
|
324
375
|
event.preventDefault();
|
|
325
376
|
event.stopPropagation();
|
|
377
|
+
this.setOpen(true);
|
|
378
|
+
}
|
|
379
|
+
},
|
|
380
|
+
onKeyDownHandler: function onKeyDownHandler(event) {
|
|
381
|
+
var altKey = event.altKey,
|
|
382
|
+
keyCode = event.keyCode;
|
|
326
383
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
384
|
+
if (keyCode === kendo_vue_common_1.Keys.esc) {
|
|
385
|
+
event.preventDefault();
|
|
386
|
+
event.stopPropagation();
|
|
387
|
+
this.setOpen(false);
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
331
390
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
391
|
+
if (keyCode === kendo_vue_common_1.Keys.enter) {
|
|
392
|
+
event.preventDefault();
|
|
393
|
+
event.stopPropagation();
|
|
394
|
+
this.focusElement();
|
|
395
|
+
return;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
if (altKey && keyCode === kendo_vue_common_1.Keys.up) {
|
|
399
|
+
event.preventDefault();
|
|
400
|
+
event.stopPropagation();
|
|
401
|
+
this.setOpen(false);
|
|
402
|
+
this.focusElement();
|
|
335
403
|
}
|
|
336
404
|
},
|
|
337
405
|
onOpenHandler: function onOpenHandler() {
|
|
338
406
|
// Skip content autofocus when in controlled mode
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
407
|
+
var palette = kendo_vue_common_1.getRef(this, 'palette');
|
|
408
|
+
|
|
409
|
+
if (palette) {
|
|
410
|
+
palette.focus();
|
|
343
411
|
}
|
|
344
412
|
},
|
|
345
413
|
onClickHandler: function onClickHandler() {
|
|
@@ -355,9 +423,10 @@ var ColorPickerVue2 = {
|
|
|
355
423
|
if (this.blurTimeoutRef) {
|
|
356
424
|
clearTimeout(this.blurTimeoutRef);
|
|
357
425
|
this.blurTimeoutRef = undefined; // case where moving back to input from popup
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
426
|
+
|
|
427
|
+
if (event.target === this.$el) {
|
|
428
|
+
this.setOpen(false); // in this case we should focus input on keydown
|
|
429
|
+
}
|
|
361
430
|
} else {
|
|
362
431
|
this.focused = true;
|
|
363
432
|
}
|
|
@@ -367,18 +436,22 @@ var ColorPickerVue2 = {
|
|
|
367
436
|
});
|
|
368
437
|
},
|
|
369
438
|
onBlurTimeout: function onBlurTimeout() {
|
|
370
|
-
var
|
|
439
|
+
var _a, _b;
|
|
371
440
|
|
|
372
|
-
|
|
441
|
+
var viewIsFocused = !!((_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.closest('.k-palette')) || !!((_b = document.activeElement) === null || _b === void 0 ? void 0 : _b.closest('.k-colorgradient'));
|
|
442
|
+
|
|
443
|
+
if (!viewIsFocused) {
|
|
373
444
|
this.setOpen(false, true);
|
|
374
445
|
}
|
|
375
446
|
|
|
376
|
-
this.focused =
|
|
447
|
+
this.focused = viewIsFocused;
|
|
377
448
|
this.blurTimeoutRef = undefined;
|
|
378
449
|
},
|
|
379
450
|
onBlurHandler: function onBlurHandler(event) {
|
|
380
451
|
clearTimeout(this.blurTimeoutRef);
|
|
381
|
-
this.
|
|
452
|
+
this.palette = kendo_vue_common_1.getRef(this, 'palette');
|
|
453
|
+
this.gradient = kendo_vue_common_1.getRef(this, 'gradient');
|
|
454
|
+
this.blurTimeoutRef = setTimeout(this.onBlurTimeout, 200);
|
|
382
455
|
this.$emit('blur', {
|
|
383
456
|
event: event
|
|
384
457
|
});
|
|
@@ -387,7 +460,7 @@ var ColorPickerVue2 = {
|
|
|
387
460
|
var currentValue = isPalette ? event.rgbaValue : event.value;
|
|
388
461
|
|
|
389
462
|
if (!this.isValueControlled) {
|
|
390
|
-
this.
|
|
463
|
+
this.currentValue = currentValue;
|
|
391
464
|
}
|
|
392
465
|
|
|
393
466
|
if (isPalette) {
|
|
@@ -399,6 +472,9 @@ var ColorPickerVue2 = {
|
|
|
399
472
|
event: event
|
|
400
473
|
});
|
|
401
474
|
},
|
|
475
|
+
onGradientChangeHandler: function onGradientChangeHandler(event) {
|
|
476
|
+
this.onChangeHandler(event, false);
|
|
477
|
+
},
|
|
402
478
|
onPaletteChangeHandler: function onPaletteChangeHandler(event) {
|
|
403
479
|
this.onChangeHandler(event, true);
|
|
404
480
|
}
|
|
@@ -77,6 +77,8 @@ var FlatColorPickerVue2 = {
|
|
|
77
77
|
},
|
|
78
78
|
// @ts-ignore
|
|
79
79
|
render: function render(createElement) {
|
|
80
|
+
var _this2 = this;
|
|
81
|
+
|
|
80
82
|
var _this = this;
|
|
81
83
|
|
|
82
84
|
var h = gh || createElement;
|
|
@@ -101,16 +103,24 @@ var FlatColorPickerVue2 = {
|
|
|
101
103
|
return [// @ts-ignore function children
|
|
102
104
|
h(kendo_vue_buttons_1.Button, {
|
|
103
105
|
type: "button",
|
|
104
|
-
attrs:
|
|
106
|
+
attrs: _this2.v3 ? undefined : {
|
|
105
107
|
type: "button",
|
|
106
108
|
togglable: true,
|
|
107
109
|
fillMode: 'flat',
|
|
108
|
-
selected:
|
|
110
|
+
selected: _this2.isColorGradient
|
|
109
111
|
},
|
|
110
112
|
togglable: true,
|
|
111
113
|
fillMode: 'flat',
|
|
112
|
-
selected:
|
|
113
|
-
|
|
114
|
+
selected: _this2.isColorGradient,
|
|
115
|
+
onClick: function onClick(e) {
|
|
116
|
+
return _this.handleViewChange(e, 'ColorGradient');
|
|
117
|
+
},
|
|
118
|
+
on: _this2.v3 ? undefined : {
|
|
119
|
+
"click": function onClick(e) {
|
|
120
|
+
return _this.handleViewChange(e, 'ColorGradient');
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}, _this2.v3 ? function () {
|
|
114
124
|
return [h("span", {
|
|
115
125
|
"class": "k-icon k-i-color-canvas"
|
|
116
126
|
})];
|
|
@@ -119,16 +129,24 @@ var FlatColorPickerVue2 = {
|
|
|
119
129
|
})]), // @ts-ignore function children
|
|
120
130
|
h(kendo_vue_buttons_1.Button, {
|
|
121
131
|
type: "button",
|
|
122
|
-
attrs:
|
|
132
|
+
attrs: _this2.v3 ? undefined : {
|
|
123
133
|
type: "button",
|
|
124
134
|
togglable: true,
|
|
125
135
|
fillMode: 'flat',
|
|
126
|
-
selected: !
|
|
136
|
+
selected: !_this2.isColorGradient
|
|
127
137
|
},
|
|
128
138
|
togglable: true,
|
|
129
139
|
fillMode: 'flat',
|
|
130
|
-
selected: !
|
|
131
|
-
|
|
140
|
+
selected: !_this2.isColorGradient,
|
|
141
|
+
onClick: function onClick(e) {
|
|
142
|
+
return _this.handleViewChange(e, 'ColorPalette');
|
|
143
|
+
},
|
|
144
|
+
on: _this2.v3 ? undefined : {
|
|
145
|
+
"click": function onClick(e) {
|
|
146
|
+
return _this.handleViewChange(e, 'ColorPalette');
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}, _this2.v3 ? function () {
|
|
132
150
|
return [h("span", {
|
|
133
151
|
"class": "k-icon k-i-palette"
|
|
134
152
|
})];
|
|
@@ -137,16 +155,24 @@ var FlatColorPickerVue2 = {
|
|
|
137
155
|
})])];
|
|
138
156
|
} : [h(kendo_vue_buttons_1.Button, {
|
|
139
157
|
type: "button",
|
|
140
|
-
attrs:
|
|
158
|
+
attrs: _this2.v3 ? undefined : {
|
|
141
159
|
type: "button",
|
|
142
160
|
togglable: true,
|
|
143
161
|
fillMode: 'flat',
|
|
144
|
-
selected:
|
|
162
|
+
selected: _this2.isColorGradient
|
|
145
163
|
},
|
|
146
164
|
togglable: true,
|
|
147
165
|
fillMode: 'flat',
|
|
148
|
-
selected:
|
|
149
|
-
|
|
166
|
+
selected: _this2.isColorGradient,
|
|
167
|
+
onClick: function onClick(e) {
|
|
168
|
+
return _this.handleViewChange(e, 'ColorGradient');
|
|
169
|
+
},
|
|
170
|
+
on: _this2.v3 ? undefined : {
|
|
171
|
+
"click": function onClick(e) {
|
|
172
|
+
return _this.handleViewChange(e, 'ColorGradient');
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}, _this2.v3 ? function () {
|
|
150
176
|
return [h("span", {
|
|
151
177
|
"class": "k-icon k-i-color-canvas"
|
|
152
178
|
})];
|
|
@@ -154,16 +180,24 @@ var FlatColorPickerVue2 = {
|
|
|
154
180
|
"class": "k-icon k-i-color-canvas"
|
|
155
181
|
})]), h(kendo_vue_buttons_1.Button, {
|
|
156
182
|
type: "button",
|
|
157
|
-
attrs:
|
|
183
|
+
attrs: _this2.v3 ? undefined : {
|
|
158
184
|
type: "button",
|
|
159
185
|
togglable: true,
|
|
160
186
|
fillMode: 'flat',
|
|
161
|
-
selected: !
|
|
187
|
+
selected: !_this2.isColorGradient
|
|
162
188
|
},
|
|
163
189
|
togglable: true,
|
|
164
190
|
fillMode: 'flat',
|
|
165
|
-
selected: !
|
|
166
|
-
|
|
191
|
+
selected: !_this2.isColorGradient,
|
|
192
|
+
onClick: function onClick(e) {
|
|
193
|
+
return _this.handleViewChange(e, 'ColorPalette');
|
|
194
|
+
},
|
|
195
|
+
on: _this2.v3 ? undefined : {
|
|
196
|
+
"click": function onClick(e) {
|
|
197
|
+
return _this.handleViewChange(e, 'ColorPalette');
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}, _this2.v3 ? function () {
|
|
167
201
|
return [h("span", {
|
|
168
202
|
"class": "k-icon k-i-palette"
|
|
169
203
|
})];
|
|
@@ -268,8 +302,12 @@ var FlatColorPickerVue2 = {
|
|
|
268
302
|
this.$el.focus();
|
|
269
303
|
}
|
|
270
304
|
},
|
|
271
|
-
handleViewChange: function handleViewChange(viewType) {
|
|
305
|
+
handleViewChange: function handleViewChange(event, viewType) {
|
|
272
306
|
this.currentView = viewType;
|
|
307
|
+
this.$emit('viewchange', {
|
|
308
|
+
event: event,
|
|
309
|
+
viewType: viewType
|
|
310
|
+
});
|
|
273
311
|
},
|
|
274
312
|
handleResetColor: function handleResetColor() {
|
|
275
313
|
this.colorValue = 'rgba(255, 255, 255, 1)';
|
|
@@ -292,7 +330,7 @@ var FlatColorPickerVue2 = {
|
|
|
292
330
|
}
|
|
293
331
|
},
|
|
294
332
|
handleFlatColorPickerBlur: function handleFlatColorPickerBlur() {
|
|
295
|
-
this.prevColor
|
|
333
|
+
this.prevColor = this.colorValue;
|
|
296
334
|
}
|
|
297
335
|
}
|
|
298
336
|
};
|
|
@@ -23,16 +23,27 @@ var Input_1 = require("../input/Input");
|
|
|
23
23
|
|
|
24
24
|
var HexInputVue2 = {
|
|
25
25
|
name: 'KendoHexInput',
|
|
26
|
+
// @ts-ignore
|
|
27
|
+
emits: {
|
|
28
|
+
'hexchange': null,
|
|
29
|
+
'blur': null,
|
|
30
|
+
'focus': null
|
|
31
|
+
},
|
|
26
32
|
props: {
|
|
27
33
|
hex: String,
|
|
28
34
|
disabled: Boolean
|
|
29
35
|
},
|
|
30
36
|
data: function data() {
|
|
31
37
|
return {
|
|
32
|
-
|
|
38
|
+
currentHex: this.$props.hex,
|
|
33
39
|
originalHex: this.$props.hex
|
|
34
40
|
};
|
|
35
41
|
},
|
|
42
|
+
computed: {
|
|
43
|
+
computedHex: function computedHex() {
|
|
44
|
+
return this.hex !== undefined ? this.hex : this.currentHex;
|
|
45
|
+
}
|
|
46
|
+
},
|
|
36
47
|
// @ts-ignore
|
|
37
48
|
setup: !isV3 ? undefined : function () {
|
|
38
49
|
var v3 = !!isV3;
|
|
@@ -44,16 +55,18 @@ var HexInputVue2 = {
|
|
|
44
55
|
render: function render(createElement) {
|
|
45
56
|
var h = gh || createElement;
|
|
46
57
|
return h(Input_1.Input, {
|
|
47
|
-
value: this.
|
|
58
|
+
value: this.computedHex,
|
|
48
59
|
attrs: this.v3 ? undefined : {
|
|
49
|
-
value: this.
|
|
60
|
+
value: this.computedHex,
|
|
50
61
|
disabled: this.$props.disabled
|
|
51
62
|
},
|
|
52
63
|
onChange: this.onChange,
|
|
53
64
|
on: this.v3 ? undefined : {
|
|
54
65
|
"change": this.onChange,
|
|
66
|
+
"focus": this.onFocus,
|
|
55
67
|
"blur": this.onBlur
|
|
56
68
|
},
|
|
69
|
+
onFocus: this.onFocus,
|
|
57
70
|
onBlur: this.onBlur,
|
|
58
71
|
disabled: this.$props.disabled
|
|
59
72
|
});
|
|
@@ -62,16 +75,21 @@ var HexInputVue2 = {
|
|
|
62
75
|
onChange: function onChange(event) {
|
|
63
76
|
var hex = event.target.value;
|
|
64
77
|
var value = color_parser_1.parseColor(hex, 'rgba');
|
|
65
|
-
this.
|
|
78
|
+
this.currentHex = hex;
|
|
66
79
|
|
|
67
80
|
if (misc_1.isPresent(value)) {
|
|
68
|
-
this.$
|
|
81
|
+
this.$emit('hexchange', hex, value, event);
|
|
69
82
|
}
|
|
70
83
|
},
|
|
71
|
-
onBlur: function onBlur() {
|
|
84
|
+
onBlur: function onBlur(event) {
|
|
72
85
|
if (!misc_1.isPresent(color_parser_1.parseColor(this.hex, 'rgba'))) {
|
|
73
|
-
this.
|
|
86
|
+
this.currentHex = this.originalHex;
|
|
74
87
|
}
|
|
88
|
+
|
|
89
|
+
this.$emit('blur', event);
|
|
90
|
+
},
|
|
91
|
+
onFocus: function onFocus(event) {
|
|
92
|
+
this.$emit('focus', event);
|
|
75
93
|
}
|
|
76
94
|
}
|
|
77
95
|
};
|
|
@@ -5,6 +5,7 @@ import { ColorPickerActiveColorClick } from './ColorPickerActiveColorClick';
|
|
|
5
5
|
import { ColorPickerPopupSettings } from './ColorPickerPopupSettings';
|
|
6
6
|
import { ColorPickerPaletteSettings } from './ColorPickerPaletteSettings';
|
|
7
7
|
import { ColorPickerView } from './ColorPickerView';
|
|
8
|
+
import { ColorGradientProps } from './ColorGradientProps';
|
|
8
9
|
/**
|
|
9
10
|
* Represents the props of the [Kendo UI for Vue ColorPicker component]({% slug overview_colorpicker %}).
|
|
10
11
|
*/
|
|
@@ -46,7 +47,7 @@ export interface ColorPickerProps {
|
|
|
46
47
|
* Sets the view which the ColorPicker will render in the popup
|
|
47
48
|
* ([see example]({% slug combinedview_colorpicker %})).
|
|
48
49
|
*/
|
|
49
|
-
view?: ColorPickerView;
|
|
50
|
+
view?: ColorPickerView | string;
|
|
50
51
|
/**
|
|
51
52
|
* Represents the `dir` HTML attribute.
|
|
52
53
|
*/
|
|
@@ -68,6 +69,10 @@ export interface ColorPickerProps {
|
|
|
68
69
|
* ([see example]({% slug customizecolorpicker_colorpicker %}#toc-customizing-the-palette-popup)).
|
|
69
70
|
*/
|
|
70
71
|
paletteSettings?: ColorPickerPaletteSettings;
|
|
72
|
+
/**
|
|
73
|
+
* Configures the ColorGradient that is displayed in the ColorPicker popup.
|
|
74
|
+
*/
|
|
75
|
+
gradientSettings?: ColorGradientProps;
|
|
71
76
|
/**
|
|
72
77
|
* Configures the popup of the ColorPicker.
|
|
73
78
|
*/
|
|
@@ -5,6 +5,7 @@ import { TableCell } from '../models/table-cell';
|
|
|
5
5
|
export declare class ColorPaletteService {
|
|
6
6
|
colorRows: string[][];
|
|
7
7
|
setColorMatrix(palette: string[], columns: number): void;
|
|
8
|
+
isInColors(colors: any, current: any): boolean;
|
|
8
9
|
getCellCoordsFor(color?: string): TableCell | undefined;
|
|
9
10
|
getColorAt(cellCoords: TableCell): string | undefined;
|
|
10
11
|
getNextCell(current: TableCell, horizontalStep: number, verticalStep: number): TableCell;
|