@progress/kendo-vue-inputs 3.4.4 → 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.
- package/dist/cdn/js/kendo-vue-inputs.js +1 -1
- package/dist/es/checkbox/Checkbox.js +2 -2
- package/dist/es/colors/ColorGradient.d.ts +2 -0
- package/dist/es/colors/ColorGradient.js +152 -47
- package/dist/es/colors/ColorInput.d.ts +3 -0
- package/dist/es/colors/ColorInput.js +80 -56
- package/dist/es/colors/ColorPalette.js +30 -16
- package/dist/es/colors/ColorPicker.d.ts +1 -0
- package/dist/es/colors/ColorPicker.js +89 -69
- package/dist/es/colors/FlatColorPicker.d.ts +41 -5
- package/dist/es/colors/FlatColorPicker.js +306 -109
- package/dist/es/colors/HexInput.d.ts +1 -0
- package/dist/es/colors/HexInput.js +16 -2
- package/dist/es/colors/Picker.js +19 -11
- package/dist/es/colors/interfaces/ColorGradientChangeEvent.d.ts +4 -0
- package/dist/es/colors/interfaces/ColorGradientProps.d.ts +12 -0
- package/dist/es/colors/interfaces/ColorPaletteChangeEvent.d.ts +0 -3
- package/dist/es/colors/interfaces/ColorPaletteProps.d.ts +8 -3
- package/dist/es/colors/interfaces/ColorPickerActiveColorClick.d.ts +0 -3
- package/dist/es/colors/interfaces/ColorPickerBlurEvent.d.ts +0 -3
- package/dist/es/colors/interfaces/ColorPickerChangeEvent.d.ts +4 -3
- package/dist/es/colors/interfaces/ColorPickerFocusEvent.d.ts +0 -3
- package/dist/es/colors/interfaces/ColorPickerPaletteSettings.d.ts +0 -3
- package/dist/es/colors/interfaces/ColorPickerPopupSettings.d.ts +0 -3
- package/dist/es/colors/interfaces/ColorPickerProps.d.ts +30 -4
- package/dist/es/colors/interfaces/ColorPickerView.d.ts +0 -3
- package/dist/es/colors/interfaces/FlatColorPickerViewChangeEvent.d.ts +13 -0
- package/dist/es/colors/interfaces/FlatColorPickerViewChangeEvent.js +0 -0
- package/dist/es/colors/interfaces/PickerProps.d.ts +4 -0
- package/dist/es/colors/utils/color-cache.d.ts +13 -0
- package/dist/es/colors/utils/color-cache.js +14 -0
- package/dist/es/colors/utils/color-parser.d.ts +7 -1
- package/dist/es/colors/utils/color-parser.js +11 -2
- package/dist/es/input/Input.d.ts +4 -0
- package/dist/es/input/Input.js +8 -3
- package/dist/es/messages/index.d.ts +45 -0
- package/dist/es/messages/index.js +46 -0
- package/dist/es/numerictextbox/NumericTextBox.js +3 -0
- package/dist/es/numerictextbox/interfaces/NumericTextBoxProps.d.ts +4 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/radiobutton/RadioButton.js +1 -1
- package/dist/es/radiobutton/RadioGroup.js +1 -1
- package/dist/es/range-slider/RangeSlider.js +1 -1
- package/dist/es/slider/Slider.js +2 -2
- package/dist/npm/checkbox/Checkbox.js +2 -2
- package/dist/npm/colors/ColorGradient.d.ts +2 -0
- package/dist/npm/colors/ColorGradient.js +153 -46
- package/dist/npm/colors/ColorInput.d.ts +3 -0
- package/dist/npm/colors/ColorInput.js +80 -55
- package/dist/npm/colors/ColorPalette.js +30 -16
- package/dist/npm/colors/ColorPicker.d.ts +1 -0
- package/dist/npm/colors/ColorPicker.js +90 -70
- package/dist/npm/colors/FlatColorPicker.d.ts +41 -5
- package/dist/npm/colors/FlatColorPicker.js +306 -106
- package/dist/npm/colors/HexInput.d.ts +1 -0
- package/dist/npm/colors/HexInput.js +16 -2
- package/dist/npm/colors/Picker.js +18 -10
- package/dist/npm/colors/interfaces/ColorGradientChangeEvent.d.ts +4 -0
- package/dist/npm/colors/interfaces/ColorGradientProps.d.ts +12 -0
- package/dist/npm/colors/interfaces/ColorPaletteChangeEvent.d.ts +0 -3
- package/dist/npm/colors/interfaces/ColorPaletteProps.d.ts +8 -3
- package/dist/npm/colors/interfaces/ColorPickerActiveColorClick.d.ts +0 -3
- package/dist/npm/colors/interfaces/ColorPickerBlurEvent.d.ts +0 -3
- package/dist/npm/colors/interfaces/ColorPickerChangeEvent.d.ts +4 -3
- package/dist/npm/colors/interfaces/ColorPickerFocusEvent.d.ts +0 -3
- package/dist/npm/colors/interfaces/ColorPickerPaletteSettings.d.ts +0 -3
- package/dist/npm/colors/interfaces/ColorPickerPopupSettings.d.ts +0 -3
- package/dist/npm/colors/interfaces/ColorPickerProps.d.ts +30 -4
- package/dist/npm/colors/interfaces/ColorPickerView.d.ts +0 -3
- package/dist/npm/colors/interfaces/FlatColorPickerViewChangeEvent.d.ts +13 -0
- package/dist/npm/colors/interfaces/FlatColorPickerViewChangeEvent.js +2 -0
- package/dist/npm/colors/interfaces/PickerProps.d.ts +4 -0
- package/dist/npm/colors/utils/color-cache.d.ts +13 -0
- package/dist/npm/colors/utils/color-cache.js +15 -1
- package/dist/npm/colors/utils/color-parser.d.ts +7 -1
- package/dist/npm/colors/utils/color-parser.js +12 -3
- package/dist/npm/input/Input.d.ts +4 -0
- package/dist/npm/input/Input.js +8 -3
- package/dist/npm/messages/index.d.ts +45 -0
- package/dist/npm/messages/index.js +47 -1
- package/dist/npm/numerictextbox/NumericTextBox.js +3 -0
- package/dist/npm/numerictextbox/interfaces/NumericTextBoxProps.d.ts +4 -0
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/radiobutton/RadioButton.js +1 -1
- package/dist/npm/radiobutton/RadioGroup.js +1 -1
- package/dist/npm/range-slider/RangeSlider.js +1 -1
- package/dist/npm/slider/Slider.js +2 -2
- 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
|
});
|
|
@@ -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
|
-
|
|
33
|
-
|
|
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 ['
|
|
76
|
+
return ['gradient', 'palette', 'combo'].includes(value);
|
|
43
77
|
}
|
|
44
78
|
},
|
|
45
|
-
|
|
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 === '
|
|
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: '
|
|
67
|
-
colorValue:
|
|
68
|
-
|
|
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
|
-
|
|
94
|
-
|
|
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
|
-
|
|
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
|
-
|
|
116
|
-
return _this.handleViewChange(e, 'ColorGradient');
|
|
117
|
-
},
|
|
263
|
+
onKeydown: _this2.handleButtonKeydown,
|
|
118
264
|
on: _this2.v3 ? undefined : {
|
|
119
|
-
"
|
|
120
|
-
|
|
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
|
-
|
|
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
|
-
|
|
142
|
-
return _this.handleViewChange(e, 'ColorPalette');
|
|
143
|
-
},
|
|
295
|
+
onKeydown: _this2.handleButtonKeydown,
|
|
144
296
|
on: _this2.v3 ? undefined : {
|
|
145
|
-
"
|
|
146
|
-
|
|
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
|
-
|
|
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
|
-
|
|
168
|
-
return _this.handleViewChange(e, 'ColorGradient');
|
|
169
|
-
},
|
|
327
|
+
onKeydown: _this2.handleButtonKeydown,
|
|
170
328
|
on: _this2.v3 ? undefined : {
|
|
171
|
-
"
|
|
172
|
-
|
|
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
|
-
|
|
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
|
-
|
|
193
|
-
return _this.handleViewChange(e, 'ColorPalette');
|
|
194
|
-
},
|
|
358
|
+
onKeydown: _this2.handleButtonKeydown,
|
|
195
359
|
on: _this2.v3 ? undefined : {
|
|
196
|
-
"
|
|
197
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 &&
|
|
403
|
+
})]), this.$props.showPreview && h("div", {
|
|
229
404
|
"class": "k-coloreditor-preview k-vstack"
|
|
230
405
|
}, [h("span", {
|
|
231
|
-
"class":
|
|
406
|
+
"class": this.previewClass,
|
|
232
407
|
style: {
|
|
233
408
|
background: this.colorValue
|
|
234
409
|
}
|
|
235
|
-
}
|
|
236
|
-
"class": "k-
|
|
410
|
+
}, [!this.colorValue && h("span", {
|
|
411
|
+
"class": "k-color-preview-mask"
|
|
412
|
+
})]), h("span", {
|
|
413
|
+
"class": this.currentClass,
|
|
237
414
|
style: {
|
|
238
|
-
background: this.
|
|
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
|
-
}
|
|
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 ?
|
|
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
|
-
|
|
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
|
-
|
|
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 [
|
|
284
|
-
} : [
|
|
443
|
+
return [cancelMessage];
|
|
444
|
+
} : [cancelMessage]), // @ts-ignore function children
|
|
285
445
|
h(kendo_vue_buttons_1.Button, {
|
|
286
|
-
|
|
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
|
-
|
|
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 [
|
|
297
|
-
} : [
|
|
460
|
+
return [applyMessage];
|
|
461
|
+
} : [applyMessage])]), footer]);
|
|
298
462
|
},
|
|
299
463
|
methods: {
|
|
300
464
|
focus: function focus() {
|
|
301
|
-
|
|
302
|
-
|
|
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 =
|
|
485
|
+
this.colorValue = null;
|
|
314
486
|
},
|
|
315
487
|
handleColorChange: function handleColorChange(event) {
|
|
316
488
|
this.colorValue = event.value;
|
|
317
489
|
},
|
|
318
|
-
|
|
319
|
-
this.
|
|
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.
|
|
523
|
+
this.colorValue = this.computedPrevColor;
|
|
323
524
|
},
|
|
324
525
|
handlePrevColorClick: function handlePrevColorClick() {
|
|
325
|
-
this.colorValue = this.
|
|
526
|
+
this.colorValue = this.computedPrevColor;
|
|
326
527
|
},
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
528
|
+
onFocus: function onFocus(event) {
|
|
529
|
+
this.$emit('focus', {
|
|
530
|
+
event: event,
|
|
531
|
+
target: this
|
|
532
|
+
});
|
|
331
533
|
},
|
|
332
|
-
|
|
333
|
-
this
|
|
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
|
*/
|
|
@@ -30,15 +30,24 @@ var HexInputVue2 = {
|
|
|
30
30
|
'focus': null
|
|
31
31
|
},
|
|
32
32
|
props: {
|
|
33
|
+
tabIndex: Number,
|
|
33
34
|
hex: String,
|
|
34
35
|
disabled: Boolean
|
|
35
36
|
},
|
|
37
|
+
computed: {
|
|
38
|
+
isHexValid: function isHexValid() {
|
|
39
|
+
return !!color_parser_1.parseColor(this.currentHex, 'rgba');
|
|
40
|
+
}
|
|
41
|
+
},
|
|
36
42
|
data: function data() {
|
|
37
43
|
return {
|
|
38
44
|
currentHex: this.$props.hex,
|
|
39
45
|
originalHex: this.$props.hex
|
|
40
46
|
};
|
|
41
47
|
},
|
|
48
|
+
mounted: function mounted() {
|
|
49
|
+
this._input = this.$refs.input._input;
|
|
50
|
+
},
|
|
42
51
|
// @ts-ignore
|
|
43
52
|
setup: !isV3 ? undefined : function () {
|
|
44
53
|
var v3 = !!isV3;
|
|
@@ -58,7 +67,9 @@ var HexInputVue2 = {
|
|
|
58
67
|
value: this.currentHex,
|
|
59
68
|
attrs: this.v3 ? undefined : {
|
|
60
69
|
value: this.currentHex,
|
|
61
|
-
|
|
70
|
+
valid: this.isHexValid,
|
|
71
|
+
disabled: this.$props.disabled,
|
|
72
|
+
tabIndex: this.tabIndex
|
|
62
73
|
},
|
|
63
74
|
onInput: this.onChange,
|
|
64
75
|
on: this.v3 ? undefined : {
|
|
@@ -70,7 +81,10 @@ var HexInputVue2 = {
|
|
|
70
81
|
onChange: this.onChange,
|
|
71
82
|
onFocus: this.onFocus,
|
|
72
83
|
onBlur: this.onBlur,
|
|
73
|
-
|
|
84
|
+
valid: this.isHexValid,
|
|
85
|
+
disabled: this.$props.disabled,
|
|
86
|
+
tabIndex: this.tabIndex,
|
|
87
|
+
ref: 'input'
|
|
74
88
|
});
|
|
75
89
|
},
|
|
76
90
|
methods: {
|