@progress/kendo-vue-inputs 3.6.4 → 3.6.5-dev.202210181442
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 +17 -35
- package/dist/es/colors/ColorContrastLabels.js +0 -2
- package/dist/es/colors/ColorContrastSvg.js +6 -20
- package/dist/es/colors/ColorGradient.js +2 -28
- package/dist/es/colors/ColorInput.js +12 -20
- package/dist/es/colors/ColorPalette.js +0 -19
- package/dist/es/colors/ColorPicker.js +28 -52
- package/dist/es/colors/FlatColorPicker.js +14 -24
- package/dist/es/colors/HexInput.js +0 -4
- package/dist/es/colors/Picker.js +6 -9
- package/dist/es/input/Input.js +15 -29
- package/dist/es/input-separator/InputSeparator.js +0 -2
- package/dist/es/maskedtextbox/MaskedTextBox.js +13 -32
- package/dist/es/numerictextbox/NumericTextBox.js +15 -48
- package/dist/es/numerictextbox/utils/main.js +33 -132
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/radiobutton/RadioButton.js +11 -16
- package/dist/es/radiobutton/RadioGroup.js +9 -12
- package/dist/es/range-slider/RangeSlider.js +9 -32
- package/dist/es/range-slider/range-raducer.js +0 -26
- package/dist/es/slider/Slider.js +8 -20
- package/dist/es/slider/SliderLabel.js +2 -12
- package/dist/es/switch/Switch.js +6 -18
- package/dist/es/textarea/TextArea.js +27 -40
- package/dist/esm/checkbox/Checkbox.js +17 -35
- package/dist/esm/colors/ColorContrastLabels.js +0 -2
- package/dist/esm/colors/ColorContrastSvg.js +6 -20
- package/dist/esm/colors/ColorGradient.js +2 -28
- package/dist/esm/colors/ColorInput.js +12 -20
- package/dist/esm/colors/ColorPalette.js +0 -19
- package/dist/esm/colors/ColorPicker.js +28 -52
- package/dist/esm/colors/FlatColorPicker.js +14 -24
- package/dist/esm/colors/HexInput.js +0 -4
- package/dist/esm/colors/Picker.js +6 -9
- package/dist/esm/input/Input.js +15 -29
- package/dist/esm/input-separator/InputSeparator.js +0 -2
- package/dist/esm/maskedtextbox/MaskedTextBox.js +13 -32
- package/dist/esm/numerictextbox/NumericTextBox.js +15 -48
- package/dist/esm/numerictextbox/utils/main.js +33 -132
- package/dist/esm/package-metadata.js +1 -1
- package/dist/esm/radiobutton/RadioButton.js +11 -16
- package/dist/esm/radiobutton/RadioGroup.js +9 -12
- package/dist/esm/range-slider/RangeSlider.js +9 -32
- package/dist/esm/range-slider/range-raducer.js +0 -26
- package/dist/esm/slider/Slider.js +8 -20
- package/dist/esm/slider/SliderLabel.js +2 -12
- package/dist/esm/switch/Switch.js +6 -18
- package/dist/esm/textarea/TextArea.js +27 -40
- package/dist/npm/checkbox/Checkbox.js +19 -43
- package/dist/npm/colors/ColorContrastLabels.js +2 -9
- package/dist/npm/colors/ColorContrastSvg.js +8 -26
- package/dist/npm/colors/ColorGradient.js +4 -44
- package/dist/npm/colors/ColorInput.js +12 -29
- package/dist/npm/colors/ColorPalette.js +2 -29
- package/dist/npm/colors/ColorPicker.js +26 -59
- package/dist/npm/colors/FlatColorPicker.js +14 -35
- package/dist/npm/colors/HexInput.js +2 -11
- package/dist/npm/colors/Picker.js +8 -15
- package/dist/npm/input/Input.js +15 -34
- package/dist/npm/input-separator/InputSeparator.js +2 -8
- package/dist/npm/maskedtextbox/MaskedTextBox.js +15 -40
- package/dist/npm/numerictextbox/NumericTextBox.js +17 -59
- package/dist/npm/numerictextbox/utils/main.js +33 -160
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/radiobutton/RadioButton.js +13 -23
- package/dist/npm/radiobutton/RadioGroup.js +11 -19
- package/dist/npm/range-slider/RangeSlider.js +7 -38
- package/dist/npm/range-slider/range-raducer.js +0 -27
- package/dist/npm/slider/Slider.js +10 -30
- package/dist/npm/slider/SliderLabel.js +2 -15
- package/dist/npm/switch/Switch.js +8 -26
- package/dist/npm/textarea/TextArea.js +25 -43
- package/package.json +11 -11
|
@@ -2,30 +2,26 @@ var __assign = this && this.__assign || function () {
|
|
|
2
2
|
__assign = Object.assign || function (t) {
|
|
3
3
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
4
|
s = arguments[i];
|
|
5
|
-
|
|
6
5
|
for (var p in s) {
|
|
7
6
|
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
8
7
|
}
|
|
9
8
|
}
|
|
10
|
-
|
|
11
9
|
return t;
|
|
12
10
|
};
|
|
13
|
-
|
|
14
11
|
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
};
|
|
13
|
+
// @ts-ignore
|
|
18
14
|
import * as Vue from 'vue';
|
|
19
15
|
var allVue = Vue;
|
|
20
16
|
var gh = allVue.h;
|
|
21
17
|
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
22
|
-
import { guid, isRtl, getTabIndex, validatePackage, kendoThemeMaps, templateDefinition, templateRendering, getListeners, getTemplate
|
|
18
|
+
import { guid, isRtl, getTabIndex, validatePackage, kendoThemeMaps, templateDefinition, templateRendering, getListeners, getTemplate
|
|
19
|
+
// useDir,
|
|
23
20
|
} from '@progress/kendo-vue-common';
|
|
24
21
|
import { packageMetadata } from '../package-metadata';
|
|
25
22
|
/**
|
|
26
23
|
* @hidden
|
|
27
24
|
*/
|
|
28
|
-
|
|
29
25
|
var TextAreaVue2 = {
|
|
30
26
|
name: 'KendoTextArea',
|
|
31
27
|
model: {
|
|
@@ -120,15 +116,14 @@ var TextAreaVue2 = {
|
|
|
120
116
|
computed: {
|
|
121
117
|
rootClassName: function rootClassName() {
|
|
122
118
|
var _a;
|
|
123
|
-
|
|
124
119
|
var _b = this.$props,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
120
|
+
size = _b.size,
|
|
121
|
+
fillMode = _b.fillMode,
|
|
122
|
+
rounded = _b.rounded,
|
|
123
|
+
required = _b.required,
|
|
124
|
+
showLoadingIcon = _b.showLoadingIcon,
|
|
125
|
+
resizable = _b.resizable,
|
|
126
|
+
autoSize = _b.autoSize;
|
|
132
127
|
var invalid = this.validityStyles === true ? !this.isValid : false;
|
|
133
128
|
return _a = {
|
|
134
129
|
'k-input': true,
|
|
@@ -137,7 +132,6 @@ var TextAreaVue2 = {
|
|
|
137
132
|
},
|
|
138
133
|
inputInnerClass: function inputInnerClass() {
|
|
139
134
|
var _a;
|
|
140
|
-
|
|
141
135
|
return _a = {
|
|
142
136
|
'k-input-inner': true,
|
|
143
137
|
'!k-resize-none': true,
|
|
@@ -204,26 +198,24 @@ var TextAreaVue2 = {
|
|
|
204
198
|
// @ts-ignore
|
|
205
199
|
render: function render(createElement) {
|
|
206
200
|
var _this = this;
|
|
207
|
-
|
|
208
201
|
var h = gh || createElement;
|
|
209
202
|
var _a = this.$props,
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
203
|
+
ariaDescribedBy = _a.ariaDescribedBy,
|
|
204
|
+
ariaLabelledBy = _a.ariaLabelledBy,
|
|
205
|
+
autoSize = _a.autoSize,
|
|
206
|
+
disabled = _a.disabled,
|
|
207
|
+
readOnly = _a.readOnly,
|
|
208
|
+
required = _a.required,
|
|
209
|
+
rows = _a.rows,
|
|
210
|
+
id = _a.id,
|
|
211
|
+
name = _a.name,
|
|
212
|
+
placeholder = _a.placeholder,
|
|
213
|
+
tabIndex = _a.tabIndex,
|
|
214
|
+
iconName = _a.iconName,
|
|
215
|
+
showValidationIcon = _a.showValidationIcon,
|
|
216
|
+
showLoadingIcon = _a.showLoadingIcon,
|
|
217
|
+
showClearButton = _a.showClearButton,
|
|
218
|
+
title = _a.title;
|
|
227
219
|
var textAreaAttrs = __assign({
|
|
228
220
|
id: id || this.calculatedId,
|
|
229
221
|
name: name,
|
|
@@ -239,7 +231,6 @@ var TextAreaVue2 = {
|
|
|
239
231
|
'aria-multiline': true,
|
|
240
232
|
'aria-disabled': disabled || undefined
|
|
241
233
|
}, this.$attrs);
|
|
242
|
-
|
|
243
234
|
var inputPrefixTemplate = templateRendering.call(this, this.$props.inputPrefix, getListeners.call(this));
|
|
244
235
|
var inputSuffixTemplate = templateRendering.call(this, this.$props.inputSuffix, getListeners.call(this));
|
|
245
236
|
var inputPrefix = getTemplate.call(this, {
|
|
@@ -329,7 +320,6 @@ var TextAreaVue2 = {
|
|
|
329
320
|
if (this.element && this.element.setCustomValidity) {
|
|
330
321
|
this.element.setCustomValidity(this.isValid ? '' : this.validationMessage || '');
|
|
331
322
|
}
|
|
332
|
-
|
|
333
323
|
if (this.element) {
|
|
334
324
|
this.textAreaHeight = "".concat(this.element.scrollHeight, "px");
|
|
335
325
|
}
|
|
@@ -344,12 +334,10 @@ var TextAreaVue2 = {
|
|
|
344
334
|
},
|
|
345
335
|
emitUpdate: function emitUpdate(event, eventName, value) {
|
|
346
336
|
var newValue = value;
|
|
347
|
-
|
|
348
337
|
if (!this.$props.disabled) {
|
|
349
338
|
this.textAreaHeight = 'auto';
|
|
350
339
|
this.currentValue = newValue;
|
|
351
340
|
}
|
|
352
|
-
|
|
353
341
|
if (!this.$props.disabled) {
|
|
354
342
|
this.$emit('changemodel', newValue);
|
|
355
343
|
this.$emit('update:modelValue', newValue);
|
|
@@ -420,6 +408,5 @@ var TextAreaVue2 = {
|
|
|
420
408
|
* </script>
|
|
421
409
|
* ```
|
|
422
410
|
*/
|
|
423
|
-
|
|
424
411
|
var TextArea = TextAreaVue2;
|
|
425
412
|
export { TextArea, TextAreaVue2 };
|
|
@@ -12,7 +12,6 @@ import { messages, checkboxValidation, checkboxOptionalText } from '../messages/
|
|
|
12
12
|
/**
|
|
13
13
|
* @hidden
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
15
|
var CheckboxVue2 = {
|
|
17
16
|
name: 'KendoCheckbox',
|
|
18
17
|
// @ts-ignore
|
|
@@ -99,15 +98,12 @@ var CheckboxVue2 = {
|
|
|
99
98
|
created: function created() {
|
|
100
99
|
validatePackage(packageMetadata);
|
|
101
100
|
this.calculatedId = guid();
|
|
102
|
-
|
|
103
101
|
if (this.$props.defaultChecked !== undefined) {
|
|
104
102
|
this.currentChecked = this.$props.defaultChecked;
|
|
105
103
|
}
|
|
106
|
-
|
|
107
104
|
if (this.$props.defaultValue !== undefined) {
|
|
108
105
|
this.currentValue = this.$props.defaultValue;
|
|
109
106
|
}
|
|
110
|
-
|
|
111
107
|
this.currentDir = this.$props.dir;
|
|
112
108
|
},
|
|
113
109
|
computed: {
|
|
@@ -147,23 +143,19 @@ var CheckboxVue2 = {
|
|
|
147
143
|
},
|
|
148
144
|
mounted: function mounted() {
|
|
149
145
|
this.input = getRef(this, 'input');
|
|
150
|
-
|
|
151
146
|
if (!this.currentDir && window && this.$el) {
|
|
152
147
|
// Note: getComputedStyle forces reflow
|
|
153
148
|
var direction = window.getComputedStyle(this.$el).direction;
|
|
154
|
-
|
|
155
149
|
if (direction) {
|
|
156
150
|
this.currentDir = direction;
|
|
157
151
|
}
|
|
158
152
|
}
|
|
159
|
-
|
|
160
153
|
this.setValidity();
|
|
161
154
|
},
|
|
162
155
|
updated: function updated() {
|
|
163
156
|
if (!this.input) {
|
|
164
157
|
this.input = getRef(this, 'input');
|
|
165
158
|
}
|
|
166
|
-
|
|
167
159
|
this.setValidity();
|
|
168
160
|
},
|
|
169
161
|
// @ts-ignore
|
|
@@ -179,23 +171,22 @@ var CheckboxVue2 = {
|
|
|
179
171
|
},
|
|
180
172
|
render: function render(createElement) {
|
|
181
173
|
var _a;
|
|
182
|
-
|
|
183
174
|
var h = gh || createElement;
|
|
184
175
|
var _b = this.$props,
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
176
|
+
ariaDescribedBy = _b.ariaDescribedBy,
|
|
177
|
+
ariaLabelledBy = _b.ariaLabelledBy,
|
|
178
|
+
disabled = _b.disabled,
|
|
179
|
+
id = _b.id,
|
|
180
|
+
label = _b.label,
|
|
181
|
+
labelRender = _b.labelRender,
|
|
182
|
+
labelPlacement = _b.labelPlacement,
|
|
183
|
+
name = _b.name,
|
|
184
|
+
labelOptional = _b.labelOptional,
|
|
185
|
+
tabIndex = _b.tabIndex,
|
|
186
|
+
required = _b.required,
|
|
187
|
+
validityStyles = _b.validityStyles,
|
|
188
|
+
size = _b.size,
|
|
189
|
+
rounded = _b.rounded;
|
|
199
190
|
var defaultSlot = getDefaultSlots(this);
|
|
200
191
|
var renderedLabel = label;
|
|
201
192
|
this.localizationService = provideLocalizationService(this);
|
|
@@ -207,7 +198,6 @@ var CheckboxVue2 = {
|
|
|
207
198
|
var inputClasses = classNames((_a = {
|
|
208
199
|
'k-checkbox': true
|
|
209
200
|
}, _a["k-checkbox-".concat(kendoThemeMaps.sizeMap[size])] = size, _a["k-rounded-".concat(kendoThemeMaps.roundedMap[rounded])] = rounded, _a['k-indeterminate'] = this.indeterminateProp, _a['k-disabled'] = disabled, _a['k-invalid k-invalid'] = !(this.isValid || validityStyles !== undefined || validityStyles === true), _a));
|
|
210
|
-
|
|
211
201
|
var checkboxInput = function checkboxInput() {
|
|
212
202
|
return h("input", {
|
|
213
203
|
type: 'checkbox',
|
|
@@ -252,7 +242,6 @@ var CheckboxVue2 = {
|
|
|
252
242
|
onBlur: this.onBlurHandler
|
|
253
243
|
});
|
|
254
244
|
};
|
|
255
|
-
|
|
256
245
|
if (labelRender) {
|
|
257
246
|
var renderTemplate = labelRender ? templateRendering.call(this, labelRender, getListeners.call(this)) : null;
|
|
258
247
|
renderedLabel = getTemplate.call(this, {
|
|
@@ -260,7 +249,6 @@ var CheckboxVue2 = {
|
|
|
260
249
|
template: renderTemplate
|
|
261
250
|
});
|
|
262
251
|
}
|
|
263
|
-
|
|
264
252
|
var checkboxLabel = function checkboxLabel() {
|
|
265
253
|
return renderedLabel !== undefined ? h("label", {
|
|
266
254
|
"class": 'k-checkbox-label',
|
|
@@ -275,7 +263,6 @@ var CheckboxVue2 = {
|
|
|
275
263
|
"class": "k-label-optional"
|
|
276
264
|
}, [this.optionalMessage])]) : null;
|
|
277
265
|
};
|
|
278
|
-
|
|
279
266
|
return labelPlacement === 'before' ? h("span", {
|
|
280
267
|
"class": checkboxClasses,
|
|
281
268
|
dir: 'rtl',
|
|
@@ -292,8 +279,8 @@ var CheckboxVue2 = {
|
|
|
292
279
|
},
|
|
293
280
|
methods: {
|
|
294
281
|
setValidity: function setValidity() {
|
|
295
|
-
var isValid = this.$props.valid !== undefined ? this.$props.valid : !this.$props.required ? true : this.computedChecked ? true : false;
|
|
296
|
-
|
|
282
|
+
var isValid = this.$props.valid !== undefined ? this.$props.valid : !this.$props.required ? true : this.computedChecked ? true : false;
|
|
283
|
+
// @ts-ignore
|
|
297
284
|
if (this.input && this.input.setCustomValidity) {
|
|
298
285
|
// @ts-ignore
|
|
299
286
|
this.input.setCustomValidity(isValid ? '' : this.$props.validationMessage || this.defaultValidationMessage);
|
|
@@ -316,13 +303,12 @@ var CheckboxVue2 = {
|
|
|
316
303
|
that.currentValue = val;
|
|
317
304
|
that.currentChecked = val;
|
|
318
305
|
}
|
|
319
|
-
|
|
320
306
|
if (!that.$props.disabled) {
|
|
321
307
|
var handle = {
|
|
322
308
|
element: that.$el,
|
|
323
309
|
focus: null // focusElement
|
|
324
|
-
|
|
325
310
|
};
|
|
311
|
+
|
|
326
312
|
that.$emit('changemodel', val);
|
|
327
313
|
that.$emit('update:modelValue', val);
|
|
328
314
|
that.$emit('change', {
|
|
@@ -331,7 +317,6 @@ var CheckboxVue2 = {
|
|
|
331
317
|
value: val
|
|
332
318
|
});
|
|
333
319
|
}
|
|
334
|
-
|
|
335
320
|
this.$data.valueDuringOnChange = undefined;
|
|
336
321
|
});
|
|
337
322
|
},
|
|
@@ -343,10 +328,8 @@ var CheckboxVue2 = {
|
|
|
343
328
|
if (this.$props.disabled) {
|
|
344
329
|
return;
|
|
345
330
|
}
|
|
346
|
-
|
|
347
331
|
var keyCode = e.keyCode;
|
|
348
332
|
var currentVal = e.currentTarget.checked;
|
|
349
|
-
|
|
350
333
|
if (keyCode === Keys.space) {
|
|
351
334
|
e.preventDefault();
|
|
352
335
|
e.stopPropagation();
|
|
@@ -368,6 +351,5 @@ var CheckboxVue2 = {
|
|
|
368
351
|
/**
|
|
369
352
|
* @hidden
|
|
370
353
|
*/
|
|
371
|
-
|
|
372
354
|
var Checkbox = CheckboxVue2;
|
|
373
355
|
export { Checkbox, CheckboxVue2 };
|
|
@@ -9,7 +9,6 @@ import { getContrastFromTwoRGBAs } from './utils/color-parser.js';
|
|
|
9
9
|
/**
|
|
10
10
|
* @hidden
|
|
11
11
|
*/
|
|
12
|
-
|
|
13
12
|
var ColorContrastLabelsVue2 = {
|
|
14
13
|
name: 'KendoColorContrastLabels',
|
|
15
14
|
props: {
|
|
@@ -79,6 +78,5 @@ var ColorContrastLabelsVue2 = {
|
|
|
79
78
|
/**
|
|
80
79
|
* @hidden
|
|
81
80
|
*/
|
|
82
|
-
|
|
83
81
|
var ColorContrastLabels = ColorContrastLabelsVue2;
|
|
84
82
|
export { ColorContrastLabels, ColorContrastLabelsVue2 };
|
|
@@ -11,7 +11,6 @@ var STEP_COUNT = 16;
|
|
|
11
11
|
/**
|
|
12
12
|
* @hidden
|
|
13
13
|
*/
|
|
14
|
-
|
|
15
14
|
var ColorContrastSvgVue2 = {
|
|
16
15
|
name: 'KendoColorContrastSvg',
|
|
17
16
|
props: {
|
|
@@ -29,18 +28,17 @@ var ColorContrastSvgVue2 = {
|
|
|
29
28
|
// @ts-ignore
|
|
30
29
|
render: function render(createElement) {
|
|
31
30
|
var _this = this;
|
|
32
|
-
|
|
33
31
|
var h = gh || createElement;
|
|
34
|
-
|
|
35
32
|
var svgPath = function svgPath(points, command) {
|
|
36
33
|
if (points.length === 0) {
|
|
37
34
|
return '';
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
}
|
|
36
|
+
// build the d attributes by looping over the points
|
|
41
37
|
var d = points.reduce(function (acc, point, i, a) {
|
|
42
|
-
return i === 0 ?
|
|
43
|
-
|
|
38
|
+
return i === 0 ?
|
|
39
|
+
// if first point
|
|
40
|
+
"M ".concat(point[0], ",").concat(point[1]) :
|
|
41
|
+
// else
|
|
44
42
|
"".concat(acc, " ").concat(command(point, i, a));
|
|
45
43
|
}, '');
|
|
46
44
|
return h("path", {
|
|
@@ -56,9 +54,7 @@ var ColorContrastSvgVue2 = {
|
|
|
56
54
|
"stroke-width": "1"
|
|
57
55
|
});
|
|
58
56
|
};
|
|
59
|
-
|
|
60
57
|
var gradientRectMetrics = this.$props.metrics;
|
|
61
|
-
|
|
62
58
|
var findValue = function findValue(contrast, saturation, low, high, comparer) {
|
|
63
59
|
var mid = (low + high) / 2;
|
|
64
60
|
var hsva = Object.assign({}, _this.$props.hsva, {
|
|
@@ -66,7 +62,6 @@ var ColorContrastSvgVue2 = {
|
|
|
66
62
|
v: 1 - mid / gradientRectMetrics.height
|
|
67
63
|
});
|
|
68
64
|
var currentContrast = getContrastFromTwoRGBAs(getRGBA(getColorFromHSV(hsva)), getRGBA(_this.$props.backgroundColor || ''));
|
|
69
|
-
|
|
70
65
|
if (low + 0.5 > high) {
|
|
71
66
|
if (currentContrast < contrast + 1 && currentContrast > contrast - 1) {
|
|
72
67
|
return mid;
|
|
@@ -74,36 +69,28 @@ var ColorContrastSvgVue2 = {
|
|
|
74
69
|
return null;
|
|
75
70
|
}
|
|
76
71
|
}
|
|
77
|
-
|
|
78
72
|
if (comparer(currentContrast, contrast)) {
|
|
79
73
|
return findValue(contrast, saturation, low, high - (high - low) / 2, comparer);
|
|
80
74
|
}
|
|
81
|
-
|
|
82
75
|
return findValue(contrast, saturation, low + (high - low) / 2, high, comparer);
|
|
83
76
|
};
|
|
84
|
-
|
|
85
77
|
var getPaths = function getPaths(contrast, stepCount, reversed) {
|
|
86
78
|
if (reversed === void 0) {
|
|
87
79
|
reversed = false;
|
|
88
80
|
}
|
|
89
|
-
|
|
90
81
|
var points = [];
|
|
91
|
-
|
|
92
82
|
for (var i = 0; i <= gradientRectMetrics.width; i += gradientRectMetrics.width / stepCount) {
|
|
93
83
|
var value = findValue(contrast, i, 0, gradientRectMetrics.height, reversed ? function (a, b) {
|
|
94
84
|
return a < b;
|
|
95
85
|
} : function (a, b) {
|
|
96
86
|
return a > b;
|
|
97
87
|
});
|
|
98
|
-
|
|
99
88
|
if (value !== null) {
|
|
100
89
|
points.push([i, value]);
|
|
101
90
|
}
|
|
102
91
|
}
|
|
103
|
-
|
|
104
92
|
return points;
|
|
105
93
|
};
|
|
106
|
-
|
|
107
94
|
var bezierCommandCalc = bezierCommand(controlPoint(line));
|
|
108
95
|
return h("svg", {
|
|
109
96
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -125,6 +112,5 @@ var ColorContrastSvgVue2 = {
|
|
|
125
112
|
/**
|
|
126
113
|
* @hidden
|
|
127
114
|
*/
|
|
128
|
-
|
|
129
115
|
var ColorContrastSvg = ColorContrastSvgVue2;
|
|
130
116
|
export { ColorContrastSvg, ColorContrastSvgVue2 };
|
|
@@ -20,7 +20,6 @@ var DEFAULT_SELECTED_COLOR = 'rgba(255, 255, 255, 1)';
|
|
|
20
20
|
/**
|
|
21
21
|
* @hidden
|
|
22
22
|
*/
|
|
23
|
-
|
|
24
23
|
var ColorGradientVue2 = {
|
|
25
24
|
name: 'KendoColorGradient',
|
|
26
25
|
model: {
|
|
@@ -71,12 +70,10 @@ var ColorGradientVue2 = {
|
|
|
71
70
|
},
|
|
72
71
|
computedValue: function computedValue() {
|
|
73
72
|
var value = this.valueSet || this.currentValue || this.defaultValue || parseColor(DEFAULT_SELECTED_COLOR, FORMAT);
|
|
74
|
-
|
|
75
73
|
if (!isPresent(parseColor(value, 'hex', this.opacity))) {
|
|
76
74
|
// Validate/sanitize the input.
|
|
77
75
|
value = DEFAULT_SELECTED_COLOR;
|
|
78
76
|
}
|
|
79
|
-
|
|
80
77
|
return value;
|
|
81
78
|
},
|
|
82
79
|
hsva: function hsva() {
|
|
@@ -108,14 +105,11 @@ var ColorGradientVue2 = {
|
|
|
108
105
|
},
|
|
109
106
|
mounted: function mounted() {
|
|
110
107
|
this.setAlphaSliderBackground(this.computedBgColor);
|
|
111
|
-
|
|
112
108
|
if (this.$el) {
|
|
113
109
|
this.draggable = this.$refs.draggable;
|
|
114
110
|
this.gradientWrapper = this.draggable && this.draggable.element;
|
|
115
111
|
}
|
|
116
|
-
|
|
117
112
|
this.alphaSlider = this.v3 ? this.alphaSliderRef : this.$refs.alphaSlider;
|
|
118
|
-
|
|
119
113
|
if (this.isFirstRender) {
|
|
120
114
|
this.isFirstRender = false;
|
|
121
115
|
}
|
|
@@ -136,19 +130,15 @@ var ColorGradientVue2 = {
|
|
|
136
130
|
// @ts-ignore
|
|
137
131
|
render: function render(createElement) {
|
|
138
132
|
var _this2 = this;
|
|
139
|
-
|
|
140
133
|
var _this = this;
|
|
141
|
-
|
|
142
134
|
var h = gh || createElement;
|
|
143
135
|
var className = classNames('k-colorgradient', {
|
|
144
136
|
'k-disabled': this.$props.disabled
|
|
145
137
|
});
|
|
146
138
|
var localizationService = provideLocalizationService(this);
|
|
147
139
|
var dragHandle = localizationService.toLanguageString(colorGradientDragHandle, messages[colorGradientDragHandle]);
|
|
148
|
-
|
|
149
140
|
var renderRectangleDragHandle = function renderRectangleDragHandle() {
|
|
150
141
|
var style = {};
|
|
151
|
-
|
|
152
142
|
if (!this.isFirstRender) {
|
|
153
143
|
var gradientRectMetrics = this.getGradientRectMetrics();
|
|
154
144
|
var top_1 = (1 - this.hsva.v) * gradientRectMetrics.height;
|
|
@@ -156,7 +146,6 @@ var ColorGradientVue2 = {
|
|
|
156
146
|
style.top = "".concat(top_1, "px");
|
|
157
147
|
style.left = "".concat(left, "px");
|
|
158
148
|
}
|
|
159
|
-
|
|
160
149
|
return h("div", {
|
|
161
150
|
"class": "k-hsv-draghandle k-draghandle",
|
|
162
151
|
role: "slider",
|
|
@@ -179,7 +168,6 @@ var ColorGradientVue2 = {
|
|
|
179
168
|
ref: setRef(this, 'draghandle')
|
|
180
169
|
});
|
|
181
170
|
};
|
|
182
|
-
|
|
183
171
|
return h("div", {
|
|
184
172
|
id: this.$props.id,
|
|
185
173
|
attrs: this.v3 ? undefined : {
|
|
@@ -211,7 +199,8 @@ var ColorGradientVue2 = {
|
|
|
211
199
|
style: {
|
|
212
200
|
background: this.computedBgColor
|
|
213
201
|
}
|
|
214
|
-
}, [
|
|
202
|
+
}, [
|
|
203
|
+
// @ts-ignore function children
|
|
215
204
|
h(Draggable, {
|
|
216
205
|
onDrag: this.onDrag,
|
|
217
206
|
on: this.v3 ? undefined : {
|
|
@@ -342,11 +331,9 @@ var ColorGradientVue2 = {
|
|
|
342
331
|
methods: {
|
|
343
332
|
onKeyDownHandler: function onKeyDownHandler(e) {
|
|
344
333
|
var element = this.$el;
|
|
345
|
-
|
|
346
334
|
if (this.innerTabIndex === undefined) {
|
|
347
335
|
this.focused = focusContainer(e, element);
|
|
348
336
|
}
|
|
349
|
-
|
|
350
337
|
this.$emit('keydown', e);
|
|
351
338
|
},
|
|
352
339
|
onHexChange: function onHexChange(hex, value, event) {
|
|
@@ -387,25 +374,20 @@ var ColorGradientVue2 = {
|
|
|
387
374
|
},
|
|
388
375
|
onGradientWrapperClick: function onGradientWrapperClick(event) {
|
|
389
376
|
this.firstFocusable = getRef(this, 'draghandle');
|
|
390
|
-
|
|
391
377
|
if (this.firstFocusable) {
|
|
392
378
|
this.firstFocusable.focus();
|
|
393
379
|
}
|
|
394
|
-
|
|
395
380
|
this.changePosition(event);
|
|
396
381
|
},
|
|
397
382
|
move: function move(e, prop, d) {
|
|
398
383
|
var c = this.hsva;
|
|
399
384
|
c[prop] += d * (e.shiftKey ? 0.01 : 0.05);
|
|
400
|
-
|
|
401
385
|
if (c[prop] < 0) {
|
|
402
386
|
c[prop] = 0;
|
|
403
387
|
}
|
|
404
|
-
|
|
405
388
|
if (c[prop] > 1) {
|
|
406
389
|
c[prop] = 1;
|
|
407
390
|
}
|
|
408
|
-
|
|
409
391
|
e.preventDefault();
|
|
410
392
|
this.handleHsvaChange(c, e);
|
|
411
393
|
},
|
|
@@ -414,25 +396,19 @@ var ColorGradientVue2 = {
|
|
|
414
396
|
case Keys.left:
|
|
415
397
|
this.move(e, 's', -1);
|
|
416
398
|
break;
|
|
417
|
-
|
|
418
399
|
case Keys.right:
|
|
419
400
|
this.move(e, 's', 1);
|
|
420
401
|
break;
|
|
421
|
-
|
|
422
402
|
case Keys.up:
|
|
423
403
|
this.move(e, 'v', 1);
|
|
424
404
|
break;
|
|
425
|
-
|
|
426
405
|
case Keys.down:
|
|
427
406
|
this.move(e, 'v', -1);
|
|
428
407
|
break;
|
|
429
|
-
|
|
430
408
|
case Keys.enter:
|
|
431
409
|
break;
|
|
432
|
-
|
|
433
410
|
case Keys.esc:
|
|
434
411
|
break;
|
|
435
|
-
|
|
436
412
|
default:
|
|
437
413
|
break;
|
|
438
414
|
}
|
|
@@ -503,7 +479,6 @@ var ColorGradientVue2 = {
|
|
|
503
479
|
},
|
|
504
480
|
focus: function focus() {
|
|
505
481
|
var _this = this;
|
|
506
|
-
|
|
507
482
|
this.focused = true;
|
|
508
483
|
setTimeout(function () {
|
|
509
484
|
focusFirstFocusableChild(_this.$el);
|
|
@@ -514,6 +489,5 @@ var ColorGradientVue2 = {
|
|
|
514
489
|
/**
|
|
515
490
|
* @hidden
|
|
516
491
|
*/
|
|
517
|
-
|
|
518
492
|
var ColorGradient = ColorGradientVue2;
|
|
519
493
|
export { ColorGradient, ColorGradientVue2 };
|
|
@@ -2,19 +2,15 @@ var __assign = this && this.__assign || function () {
|
|
|
2
2
|
__assign = Object.assign || function (t) {
|
|
3
3
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
4
|
s = arguments[i];
|
|
5
|
-
|
|
6
5
|
for (var p in s) {
|
|
7
6
|
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
8
7
|
}
|
|
9
8
|
}
|
|
10
|
-
|
|
11
9
|
return t;
|
|
12
10
|
};
|
|
13
|
-
|
|
14
11
|
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
};
|
|
13
|
+
// @ts-ignore
|
|
18
14
|
import * as Vue from 'vue';
|
|
19
15
|
var allVue = Vue;
|
|
20
16
|
var gh = allVue.h;
|
|
@@ -29,12 +25,10 @@ import { guid, Keys } from '@progress/kendo-vue-common';
|
|
|
29
25
|
/**
|
|
30
26
|
* @hidden
|
|
31
27
|
*/
|
|
32
|
-
|
|
33
28
|
var modes = ['rgba', 'rgb', 'hex'];
|
|
34
29
|
/**
|
|
35
30
|
* @hidden
|
|
36
31
|
*/
|
|
37
|
-
|
|
38
32
|
var ColorInputVue2 = {
|
|
39
33
|
name: 'KendoColorInput',
|
|
40
34
|
// @ts-ignore
|
|
@@ -138,7 +132,8 @@ var ColorInputVue2 = {
|
|
|
138
132
|
},
|
|
139
133
|
disabled: this.$props.disabled,
|
|
140
134
|
ref: 'hexinput'
|
|
141
|
-
})]),
|
|
135
|
+
})]),
|
|
136
|
+
// @ts-ignore function children
|
|
142
137
|
h(Label, {
|
|
143
138
|
"class": "k-colorgradient-input-label",
|
|
144
139
|
"for": this.hexInputId,
|
|
@@ -174,7 +169,8 @@ var ColorInputVue2 = {
|
|
|
174
169
|
"change": this.onRgbaRChange
|
|
175
170
|
},
|
|
176
171
|
disabled: this.$props.disabled
|
|
177
|
-
}),
|
|
172
|
+
}),
|
|
173
|
+
// @ts-ignore function children
|
|
178
174
|
h(Label, {
|
|
179
175
|
"class": "k-colorgradient-input-label"
|
|
180
176
|
}, this.v3 ? function () {
|
|
@@ -206,7 +202,8 @@ var ColorInputVue2 = {
|
|
|
206
202
|
"change": this.onRgbaGChange
|
|
207
203
|
},
|
|
208
204
|
disabled: this.$props.disabled
|
|
209
|
-
}),
|
|
205
|
+
}),
|
|
206
|
+
// @ts-ignore function children
|
|
210
207
|
h(Label, {
|
|
211
208
|
"class": "k-colorgradient-input-label"
|
|
212
209
|
}, this.v3 ? function () {
|
|
@@ -239,7 +236,8 @@ var ColorInputVue2 = {
|
|
|
239
236
|
},
|
|
240
237
|
disabled: this.$props.disabled,
|
|
241
238
|
ref: 'numericb'
|
|
242
|
-
}),
|
|
239
|
+
}),
|
|
240
|
+
// @ts-ignore function children
|
|
243
241
|
h(Label, {
|
|
244
242
|
"class": "k-colorgradient-input-label"
|
|
245
243
|
}, this.v3 ? function () {
|
|
@@ -274,7 +272,8 @@ var ColorInputVue2 = {
|
|
|
274
272
|
},
|
|
275
273
|
disabled: this.$props.disabled,
|
|
276
274
|
ref: 'numerica'
|
|
277
|
-
}), this.$props.opacity &&
|
|
275
|
+
}), this.$props.opacity &&
|
|
276
|
+
// @ts-ignore function children
|
|
278
277
|
h(Label, {
|
|
279
278
|
"class": "k-colorgradient-input-label"
|
|
280
279
|
}, this.v3 ? function () {
|
|
@@ -307,28 +306,22 @@ var ColorInputVue2 = {
|
|
|
307
306
|
},
|
|
308
307
|
dispatchRgbaChange: function dispatchRgbaChange(newValue, event) {
|
|
309
308
|
var rgba = __assign({}, this.$props.rgba);
|
|
310
|
-
|
|
311
309
|
if (newValue.r !== undefined) {
|
|
312
310
|
rgba.r = newValue.r;
|
|
313
311
|
}
|
|
314
|
-
|
|
315
312
|
if (newValue.g !== undefined) {
|
|
316
313
|
rgba.g = newValue.g;
|
|
317
314
|
}
|
|
318
|
-
|
|
319
315
|
if (newValue.b !== undefined) {
|
|
320
316
|
rgba.b = newValue.b;
|
|
321
317
|
}
|
|
322
|
-
|
|
323
318
|
if (newValue.a !== undefined) {
|
|
324
319
|
rgba.a = newValue.a;
|
|
325
320
|
}
|
|
326
|
-
|
|
327
321
|
this.$emit('rgbachange', rgba, event);
|
|
328
322
|
},
|
|
329
323
|
onToggleModeChange: function onToggleModeChange() {
|
|
330
324
|
var index = modes.length - 1 === modes.indexOf(this.inputMode) ? 0 : modes.indexOf(this.inputMode) + 1;
|
|
331
|
-
|
|
332
325
|
if (!this.$props.opacity) {
|
|
333
326
|
var nextIndex = modes[index] === 'rgba' ? index + 1 : index;
|
|
334
327
|
this.inputMode = modes[nextIndex];
|
|
@@ -346,6 +339,5 @@ var ColorInputVue2 = {
|
|
|
346
339
|
/**
|
|
347
340
|
* @hidden
|
|
348
341
|
*/
|
|
349
|
-
|
|
350
342
|
var ColorInput = ColorInputVue2;
|
|
351
343
|
export { ColorInput, ColorInputVue2 };
|