@progress/kendo-vue-inputs 3.4.0 → 3.4.2-dev.202207070519
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 +9 -12
- package/dist/es/colors/ColorContrastLabels.d.ts +49 -0
- package/dist/es/colors/ColorContrastLabels.js +80 -0
- package/dist/es/colors/ColorContrastSvg.d.ts +50 -0
- package/dist/es/colors/ColorContrastSvg.js +109 -0
- package/dist/es/colors/ColorGradient.d.ts +51 -0
- package/dist/es/colors/ColorGradient.js +408 -0
- package/dist/es/colors/ColorInput.d.ts +54 -0
- package/dist/es/colors/ColorInput.js +269 -0
- package/dist/es/colors/ColorPalette.js +9 -12
- package/dist/es/colors/ColorPicker.js +5 -4
- package/dist/es/colors/FlatColorPicker.d.ts +103 -0
- package/dist/es/colors/FlatColorPicker.js +295 -0
- package/dist/es/colors/HexInput.d.ts +51 -0
- package/dist/es/colors/HexInput.js +72 -0
- package/dist/es/colors/Picker.js +3 -2
- package/dist/es/colors/interfaces/ColorGradientChangeEvent.d.ts +9 -0
- package/dist/es/colors/interfaces/ColorGradientChangeEvent.js +0 -0
- package/dist/es/colors/interfaces/ColorGradientProps.d.ts +56 -0
- package/dist/es/colors/interfaces/ColorGradientProps.js +0 -0
- package/dist/es/input/Input.js +3 -2
- package/dist/es/input-separator/InputSeparator.js +3 -2
- package/dist/es/main.d.ts +1 -0
- package/dist/es/main.js +1 -0
- package/dist/es/maskedtextbox/MaskedTextBox.js +21 -24
- package/dist/es/messages/index.d.ts +15 -0
- package/dist/es/messages/index.js +15 -0
- package/dist/es/numerictextbox/NumericTextBox.d.ts +4 -0
- package/dist/es/numerictextbox/NumericTextBox.js +16 -19
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/radiobutton/RadioButton.js +8 -11
- package/dist/es/radiobutton/RadioGroup.js +3 -2
- package/dist/es/range-slider/RangeSlider.js +13 -12
- package/dist/es/slider/Slider.d.ts +4 -0
- package/dist/es/slider/Slider.js +5 -4
- package/dist/es/slider/SliderLabel.js +3 -2
- package/dist/es/switch/Switch.js +14 -19
- package/dist/es/textarea/TextArea.js +3 -2
- package/dist/npm/checkbox/Checkbox.js +8 -11
- package/dist/npm/colors/ColorContrastLabels.d.ts +49 -0
- package/dist/npm/colors/ColorContrastLabels.js +92 -0
- package/dist/npm/colors/ColorContrastSvg.d.ts +50 -0
- package/dist/npm/colors/ColorContrastSvg.js +120 -0
- package/dist/npm/colors/ColorGradient.d.ts +51 -0
- package/dist/npm/colors/ColorGradient.js +427 -0
- package/dist/npm/colors/ColorInput.d.ts +54 -0
- package/dist/npm/colors/ColorInput.js +284 -0
- package/dist/npm/colors/ColorPalette.js +8 -11
- package/dist/npm/colors/ColorPicker.js +5 -4
- package/dist/npm/colors/FlatColorPicker.d.ts +103 -0
- package/dist/npm/colors/FlatColorPicker.js +310 -0
- package/dist/npm/colors/HexInput.d.ts +51 -0
- package/dist/npm/colors/HexInput.js +84 -0
- package/dist/npm/colors/Picker.js +3 -2
- package/dist/npm/colors/interfaces/ColorGradientChangeEvent.d.ts +9 -0
- package/dist/npm/colors/interfaces/ColorGradientChangeEvent.js +2 -0
- package/dist/npm/colors/interfaces/ColorGradientProps.d.ts +56 -0
- package/dist/npm/colors/interfaces/ColorGradientProps.js +2 -0
- package/dist/npm/input/Input.js +3 -2
- package/dist/npm/input-separator/InputSeparator.js +3 -2
- package/dist/npm/main.d.ts +1 -0
- package/dist/npm/main.js +1 -0
- package/dist/npm/maskedtextbox/MaskedTextBox.js +20 -23
- package/dist/npm/messages/index.d.ts +15 -0
- package/dist/npm/messages/index.js +16 -1
- package/dist/npm/numerictextbox/NumericTextBox.d.ts +4 -0
- package/dist/npm/numerictextbox/NumericTextBox.js +15 -18
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/radiobutton/RadioButton.js +7 -10
- package/dist/npm/radiobutton/RadioGroup.js +3 -2
- package/dist/npm/range-slider/RangeSlider.js +13 -12
- package/dist/npm/slider/Slider.d.ts +4 -0
- package/dist/npm/slider/Slider.js +5 -4
- package/dist/npm/slider/SliderLabel.js +3 -2
- package/dist/npm/switch/Switch.js +13 -18
- package/dist/npm/textarea/TextArea.js +3 -2
- package/package.json +11 -11
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import * as Vue from 'vue';
|
|
3
|
+
var allVue = Vue;
|
|
4
|
+
var gh = allVue.h;
|
|
5
|
+
var isV3 = allVue.version[0] === '3';
|
|
6
|
+
import { classNames, validatePackage, getTabIndex } from '@progress/kendo-vue-common';
|
|
7
|
+
import { ButtonGroup, Button } from '@progress/kendo-vue-buttons';
|
|
8
|
+
import { ColorPalette } from './ColorPalette';
|
|
9
|
+
import { ColorGradient } from './ColorGradient';
|
|
10
|
+
import { packageMetadata } from '../package-metadata';
|
|
11
|
+
import { messages, flatColorPickerApplyBtn, flatColorPickerCancelBtn } from '../messages';
|
|
12
|
+
/**
|
|
13
|
+
* @hidden
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
var FlatColorPickerVue2 = {
|
|
17
|
+
name: 'KendoFlatColorPicker',
|
|
18
|
+
created: function created() {
|
|
19
|
+
validatePackage(packageMetadata);
|
|
20
|
+
},
|
|
21
|
+
props: {
|
|
22
|
+
value: String,
|
|
23
|
+
tabIndex: Number,
|
|
24
|
+
disabled: Boolean,
|
|
25
|
+
view: {
|
|
26
|
+
type: String,
|
|
27
|
+
validator: function validator(value) {
|
|
28
|
+
return ['ColorGradient', 'ColorPalette'].includes(value);
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
header: [String, Object, Function, Boolean],
|
|
32
|
+
showClearButton: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: true
|
|
35
|
+
},
|
|
36
|
+
showPreview: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: true
|
|
39
|
+
},
|
|
40
|
+
showButtons: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: true
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
computed: {
|
|
46
|
+
isColorGradient: function isColorGradient() {
|
|
47
|
+
return this.view ? this.view === 'ColorGradient' : this.currentView === 'ColorGradient';
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
data: function data() {
|
|
51
|
+
return {
|
|
52
|
+
currentView: 'ColorGradient',
|
|
53
|
+
colorValue: 'rgba(255, 255, 255, 1)',
|
|
54
|
+
prevColor: 'rgba(255, 255, 255, 1)'
|
|
55
|
+
};
|
|
56
|
+
},
|
|
57
|
+
// @ts-ignore
|
|
58
|
+
setup: !isV3 ? undefined : function () {
|
|
59
|
+
var v3 = !!isV3;
|
|
60
|
+
return {
|
|
61
|
+
v3: v3
|
|
62
|
+
};
|
|
63
|
+
},
|
|
64
|
+
// @ts-ignore
|
|
65
|
+
render: function render(createElement) {
|
|
66
|
+
var _this = this;
|
|
67
|
+
|
|
68
|
+
var h = gh || createElement;
|
|
69
|
+
return h("div", {
|
|
70
|
+
tabindex: getTabIndex(this.$props.tabIndex, this.$props.disabled),
|
|
71
|
+
attrs: this.v3 ? undefined : {
|
|
72
|
+
tabindex: getTabIndex(this.$props.tabIndex, this.$props.disabled)
|
|
73
|
+
},
|
|
74
|
+
"class": classNames('k-flatcolorpicker k-coloreditor', {
|
|
75
|
+
'k-disabled': this.$props.disabled
|
|
76
|
+
}),
|
|
77
|
+
onBlur: this.handleFlatColorPickerBlur,
|
|
78
|
+
on: this.v3 ? undefined : {
|
|
79
|
+
"blur": this.handleFlatColorPickerBlur
|
|
80
|
+
}
|
|
81
|
+
}, [this.$props.header || h("div", {
|
|
82
|
+
"class": "k-coloreditor-header k-hstack"
|
|
83
|
+
}, [h("div", {
|
|
84
|
+
"class": "k-coloreditor-header-actions k-hstack"
|
|
85
|
+
}, [// @ts-ignore function children
|
|
86
|
+
h(ButtonGroup, this.v3 ? function () {
|
|
87
|
+
return [// @ts-ignore function children
|
|
88
|
+
h(Button, {
|
|
89
|
+
type: "button",
|
|
90
|
+
attrs: _this.v3 ? undefined : {
|
|
91
|
+
type: "button",
|
|
92
|
+
togglable: true,
|
|
93
|
+
fillMode: 'flat',
|
|
94
|
+
selected: _this.colorGradientView
|
|
95
|
+
},
|
|
96
|
+
togglable: true,
|
|
97
|
+
fillMode: 'flat',
|
|
98
|
+
selected: _this.colorGradientView
|
|
99
|
+
}, _this.v3 ? function () {
|
|
100
|
+
return [h("span", {
|
|
101
|
+
"class": "k-icon k-i-color-canvas"
|
|
102
|
+
})];
|
|
103
|
+
} : [h("span", {
|
|
104
|
+
"class": "k-icon k-i-color-canvas"
|
|
105
|
+
})]), // @ts-ignore function children
|
|
106
|
+
h(Button, {
|
|
107
|
+
type: "button",
|
|
108
|
+
attrs: _this.v3 ? undefined : {
|
|
109
|
+
type: "button",
|
|
110
|
+
togglable: true,
|
|
111
|
+
fillMode: 'flat',
|
|
112
|
+
selected: !_this.colorGradientView
|
|
113
|
+
},
|
|
114
|
+
togglable: true,
|
|
115
|
+
fillMode: 'flat',
|
|
116
|
+
selected: !_this.colorGradientView
|
|
117
|
+
}, _this.v3 ? function () {
|
|
118
|
+
return [h("span", {
|
|
119
|
+
"class": "k-icon k-i-palette"
|
|
120
|
+
})];
|
|
121
|
+
} : [h("span", {
|
|
122
|
+
"class": "k-icon k-i-palette"
|
|
123
|
+
})])];
|
|
124
|
+
} : [h(Button, {
|
|
125
|
+
type: "button",
|
|
126
|
+
attrs: _this.v3 ? undefined : {
|
|
127
|
+
type: "button",
|
|
128
|
+
togglable: true,
|
|
129
|
+
fillMode: 'flat',
|
|
130
|
+
selected: _this.colorGradientView
|
|
131
|
+
},
|
|
132
|
+
togglable: true,
|
|
133
|
+
fillMode: 'flat',
|
|
134
|
+
selected: _this.colorGradientView
|
|
135
|
+
}, _this.v3 ? function () {
|
|
136
|
+
return [h("span", {
|
|
137
|
+
"class": "k-icon k-i-color-canvas"
|
|
138
|
+
})];
|
|
139
|
+
} : [h("span", {
|
|
140
|
+
"class": "k-icon k-i-color-canvas"
|
|
141
|
+
})]), h(Button, {
|
|
142
|
+
type: "button",
|
|
143
|
+
attrs: _this.v3 ? undefined : {
|
|
144
|
+
type: "button",
|
|
145
|
+
togglable: true,
|
|
146
|
+
fillMode: 'flat',
|
|
147
|
+
selected: !_this.colorGradientView
|
|
148
|
+
},
|
|
149
|
+
togglable: true,
|
|
150
|
+
fillMode: 'flat',
|
|
151
|
+
selected: !_this.colorGradientView
|
|
152
|
+
}, _this.v3 ? function () {
|
|
153
|
+
return [h("span", {
|
|
154
|
+
"class": "k-icon k-i-palette"
|
|
155
|
+
})];
|
|
156
|
+
} : [h("span", {
|
|
157
|
+
"class": "k-icon k-i-palette"
|
|
158
|
+
})])])]), h("div", {
|
|
159
|
+
"class": "k-spacer"
|
|
160
|
+
}), h("div", {
|
|
161
|
+
"class": "k-coloreditor-header-actions k-hstack"
|
|
162
|
+
}, [this.$props.showClearButton && // @ts-ignore function children
|
|
163
|
+
h(Button, {
|
|
164
|
+
type: "button",
|
|
165
|
+
attrs: this.v3 ? undefined : {
|
|
166
|
+
type: "button",
|
|
167
|
+
fillMode: 'flat'
|
|
168
|
+
},
|
|
169
|
+
fillMode: 'flat',
|
|
170
|
+
onClick: this.handleResetColor,
|
|
171
|
+
on: this.v3 ? undefined : {
|
|
172
|
+
"click": this.handleResetColor
|
|
173
|
+
}
|
|
174
|
+
}, this.v3 ? function () {
|
|
175
|
+
return [h("span", {
|
|
176
|
+
"class": "k-icon k-i-reset-color"
|
|
177
|
+
})];
|
|
178
|
+
} : [h("span", {
|
|
179
|
+
"class": "k-icon k-i-reset-color"
|
|
180
|
+
})]), this.$props.showPreview && defaultProps.showPreview && h("div", {
|
|
181
|
+
"class": "k-coloreditor-preview k-vstack"
|
|
182
|
+
}, [h("span", {
|
|
183
|
+
"class": "k-coloreditor-preview-color k-color-preview",
|
|
184
|
+
style: {
|
|
185
|
+
background: this.colorValue
|
|
186
|
+
}
|
|
187
|
+
}), h("span", {
|
|
188
|
+
"class": "k-coloreditor-current-color k-color-preview",
|
|
189
|
+
style: {
|
|
190
|
+
background: this.prevColor
|
|
191
|
+
},
|
|
192
|
+
onClick: this.handlePrevColorClick,
|
|
193
|
+
on: this.v3 ? undefined : {
|
|
194
|
+
"click": this.handlePrevColorClick
|
|
195
|
+
}
|
|
196
|
+
})])])]), h("div", {
|
|
197
|
+
"class": "k-coloreditor-views k-vstack"
|
|
198
|
+
}, [this.isColorGradient ? h(ColorGradient // ref={colorGradientRef}
|
|
199
|
+
, {
|
|
200
|
+
value: this.colorValue,
|
|
201
|
+
attrs: this.v3 ? undefined : {
|
|
202
|
+
value: this.colorValue
|
|
203
|
+
},
|
|
204
|
+
onChange: this.handleColorChange,
|
|
205
|
+
on: this.v3 ? undefined : {
|
|
206
|
+
"change": this.handleColorChange,
|
|
207
|
+
"focus": this.handleFocus
|
|
208
|
+
},
|
|
209
|
+
onFocus: this.handleFocus
|
|
210
|
+
}) : h(ColorPalette, {
|
|
211
|
+
value: this.colorValue,
|
|
212
|
+
attrs: this.v3 ? undefined : {
|
|
213
|
+
value: this.colorValue
|
|
214
|
+
},
|
|
215
|
+
onChange: this.handleColorChange,
|
|
216
|
+
on: this.v3 ? undefined : {
|
|
217
|
+
"change": this.handleColorChange,
|
|
218
|
+
"focus": this.handleFocus
|
|
219
|
+
},
|
|
220
|
+
onFocus: this.handleFocus
|
|
221
|
+
})]), this.$props.showButtons && defaultProps.showButtons && h("div", {
|
|
222
|
+
"class": "k-coloreditor-footer k-actions k-actions-end"
|
|
223
|
+
}, [// @ts-ignore function children
|
|
224
|
+
h(Button, {
|
|
225
|
+
type: "button",
|
|
226
|
+
attrs: this.v3 ? undefined : {
|
|
227
|
+
type: "button"
|
|
228
|
+
},
|
|
229
|
+
"class": "k-coloreditor-cancel",
|
|
230
|
+
onClick: this.handleCancelBtnClick,
|
|
231
|
+
on: this.v3 ? undefined : {
|
|
232
|
+
"click": this.handleCancelBtnClick
|
|
233
|
+
}
|
|
234
|
+
}, this.v3 ? function () {
|
|
235
|
+
return [messages[flatColorPickerCancelBtn]];
|
|
236
|
+
} : [messages[flatColorPickerCancelBtn]]), // @ts-ignore function children
|
|
237
|
+
h(Button, {
|
|
238
|
+
type: "button",
|
|
239
|
+
attrs: this.v3 ? undefined : {
|
|
240
|
+
type: "button"
|
|
241
|
+
},
|
|
242
|
+
"class": "k-coloreditor-apply k-primary",
|
|
243
|
+
onClick: this.handleApplyBtnClick,
|
|
244
|
+
on: this.v3 ? undefined : {
|
|
245
|
+
"click": this.handleApplyBtnClick
|
|
246
|
+
}
|
|
247
|
+
}, this.v3 ? function () {
|
|
248
|
+
return [messages[flatColorPickerApplyBtn]];
|
|
249
|
+
} : [messages[flatColorPickerApplyBtn]])])]);
|
|
250
|
+
},
|
|
251
|
+
methods: {
|
|
252
|
+
focus: function focus() {
|
|
253
|
+
if (this.$el) {
|
|
254
|
+
this.$el.focus();
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
handleViewChange: function handleViewChange(viewType) {
|
|
258
|
+
this.currentView = viewType;
|
|
259
|
+
},
|
|
260
|
+
handleResetColor: function handleResetColor() {
|
|
261
|
+
this.colorValue = 'rgba(255, 255, 255, 1)';
|
|
262
|
+
},
|
|
263
|
+
handleColorChange: function handleColorChange(event) {
|
|
264
|
+
this.colorValue = event.value;
|
|
265
|
+
},
|
|
266
|
+
handleApplyBtnClick: function handleApplyBtnClick() {
|
|
267
|
+
this.prevColor = this.colorValue;
|
|
268
|
+
},
|
|
269
|
+
handleCancelBtnClick: function handleCancelBtnClick() {
|
|
270
|
+
this.prevColor = 'rgba(255, 255, 255, 1)';
|
|
271
|
+
},
|
|
272
|
+
handlePrevColorClick: function handlePrevColorClick() {
|
|
273
|
+
this.colorValue = this.prevColor;
|
|
274
|
+
},
|
|
275
|
+
handleFocus: function handleFocus() {
|
|
276
|
+
if (this.$el) {
|
|
277
|
+
this.$el.focus();
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
handleFlatColorPickerBlur: function handleFlatColorPickerBlur() {
|
|
281
|
+
this.prevColor(this.colorValue);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
var defaultProps = {
|
|
286
|
+
showClearButton: true,
|
|
287
|
+
showPreview: true,
|
|
288
|
+
showButtons: true
|
|
289
|
+
};
|
|
290
|
+
/**
|
|
291
|
+
* @hidden
|
|
292
|
+
*/
|
|
293
|
+
|
|
294
|
+
var FlatColorPicker = FlatColorPickerVue2;
|
|
295
|
+
export { FlatColorPicker, FlatColorPickerVue2 };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type } from '../additionalTypes';
|
|
2
|
+
declare type DefaultData<V> = object | ((this: V) => {});
|
|
3
|
+
declare type DefaultMethods<V> = {
|
|
4
|
+
[key: string]: (this: V, ...args: any[]) => any;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* @hidden
|
|
8
|
+
*/
|
|
9
|
+
export interface HexInputProps {
|
|
10
|
+
hex: string;
|
|
11
|
+
onHexChange?: any;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @hidden
|
|
16
|
+
*/
|
|
17
|
+
export interface HexInputState {
|
|
18
|
+
originalHex: string;
|
|
19
|
+
hex: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* @hidden
|
|
23
|
+
*/
|
|
24
|
+
export interface HexInputComputed {
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* @hidden
|
|
29
|
+
*/
|
|
30
|
+
export interface HexInputMethods {
|
|
31
|
+
[key: string]: any;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @hidden
|
|
35
|
+
*/
|
|
36
|
+
export interface HexInputData {
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @hidden
|
|
40
|
+
*/
|
|
41
|
+
export interface HexInputAll extends Vue2type, HexInputMethods, HexInputData, HexInputComputed, HexInputState {
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* @hidden
|
|
45
|
+
*/
|
|
46
|
+
declare let HexInputVue2: ComponentOptions<HexInputAll, DefaultData<HexInputData>, DefaultMethods<HexInputAll>, HexInputComputed, RecordPropsDefinition<HexInputProps>>;
|
|
47
|
+
/**
|
|
48
|
+
* @hidden
|
|
49
|
+
*/
|
|
50
|
+
declare const HexInput: DefineComponent<HexInputProps, any, HexInputData, HexInputComputed, HexInputMethods, {}, {}, {}, string, HexInputProps, HexInputProps, {}>;
|
|
51
|
+
export { HexInput, HexInputVue2 };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import * as Vue from 'vue';
|
|
3
|
+
var allVue = Vue;
|
|
4
|
+
var gh = allVue.h;
|
|
5
|
+
var isV3 = allVue.version[0] === '3';
|
|
6
|
+
import { parseColor } from './utils/color-parser';
|
|
7
|
+
import { isPresent } from './utils/misc';
|
|
8
|
+
import { Input } from '../input/Input';
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
var HexInputVue2 = {
|
|
14
|
+
name: 'KendoHexInput',
|
|
15
|
+
props: {
|
|
16
|
+
hex: String,
|
|
17
|
+
disabled: Boolean
|
|
18
|
+
},
|
|
19
|
+
data: function data() {
|
|
20
|
+
return {
|
|
21
|
+
hex: this.$props.hex,
|
|
22
|
+
originalHex: this.$props.hex
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
setup: !isV3 ? undefined : function () {
|
|
27
|
+
var v3 = !!isV3;
|
|
28
|
+
return {
|
|
29
|
+
v3: v3
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
// @ts-ignore
|
|
33
|
+
render: function render(createElement) {
|
|
34
|
+
var h = gh || createElement;
|
|
35
|
+
return h(Input, {
|
|
36
|
+
value: this.hex,
|
|
37
|
+
attrs: this.v3 ? undefined : {
|
|
38
|
+
value: this.hex,
|
|
39
|
+
disabled: this.$props.disabled
|
|
40
|
+
},
|
|
41
|
+
onChange: this.onChange,
|
|
42
|
+
on: this.v3 ? undefined : {
|
|
43
|
+
"change": this.onChange,
|
|
44
|
+
"blur": this.onBlur
|
|
45
|
+
},
|
|
46
|
+
onBlur: this.onBlur,
|
|
47
|
+
disabled: this.$props.disabled
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
methods: {
|
|
51
|
+
onChange: function onChange(event) {
|
|
52
|
+
var hex = event.target.value;
|
|
53
|
+
var value = parseColor(hex, 'rgba');
|
|
54
|
+
this.hex = hex;
|
|
55
|
+
|
|
56
|
+
if (isPresent(value)) {
|
|
57
|
+
this.$props.onHexChange(hex, value, event);
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
onBlur: function onBlur() {
|
|
61
|
+
if (!isPresent(parseColor(this.hex, 'rgba'))) {
|
|
62
|
+
this.hex = this.originalHex;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* @hidden
|
|
69
|
+
*/
|
|
70
|
+
|
|
71
|
+
var HexInput = HexInputVue2;
|
|
72
|
+
export { HexInput, HexInputVue2 };
|
package/dist/es/colors/Picker.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import * as Vue from 'vue';
|
|
3
3
|
var allVue = Vue;
|
|
4
4
|
var gh = allVue.h;
|
|
5
|
+
var isV3 = allVue.version[0] === '3';
|
|
5
6
|
import { Popup } from '@progress/kendo-vue-popup';
|
|
6
7
|
import { classNames, getDefaultSlots } from '@progress/kendo-vue-common';
|
|
7
8
|
/**
|
|
@@ -44,8 +45,8 @@ var PickerVue2 = {
|
|
|
44
45
|
}
|
|
45
46
|
},
|
|
46
47
|
// @ts-ignore
|
|
47
|
-
setup: !
|
|
48
|
-
var v3 = !!
|
|
48
|
+
setup: !isV3 ? undefined : function () {
|
|
49
|
+
var v3 = !!isV3;
|
|
49
50
|
return {
|
|
50
51
|
v3: v3
|
|
51
52
|
};
|
|
File without changes
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ColorGradientChangeEvent } from './ColorGradientChangeEvent';
|
|
2
|
+
/**
|
|
3
|
+
* Represents the props of the [KendoReact ColorGradient component]({% slug overview_colorgradient %}).
|
|
4
|
+
*/
|
|
5
|
+
export interface ColorGradientProps {
|
|
6
|
+
/**
|
|
7
|
+
* The default value of the ColorGradient.
|
|
8
|
+
*/
|
|
9
|
+
defaultValue?: string;
|
|
10
|
+
/**
|
|
11
|
+
* The value of the ColorGradient.
|
|
12
|
+
*/
|
|
13
|
+
value?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Determines the event handler that will be fired when the user edits the value.
|
|
16
|
+
*/
|
|
17
|
+
onChange?: (event: ColorGradientChangeEvent) => void;
|
|
18
|
+
/**
|
|
19
|
+
* Represents the focus event.
|
|
20
|
+
*/
|
|
21
|
+
onFocus?: (event: any) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Determines whether the alpha slider and the alpha input will be displayed. Defaults to `true`.
|
|
24
|
+
*/
|
|
25
|
+
opacity?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Enables the color contrast tool.
|
|
28
|
+
* Sets the background color that will be compared to the selected value.
|
|
29
|
+
* The tool will calculate the contrast ratio between two colors.
|
|
30
|
+
* Currently, only the RGBA format is supported.
|
|
31
|
+
*/
|
|
32
|
+
backgroundColor?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Determines whether the ColorGradient is disabled
|
|
35
|
+
* ([more information and example]({% slug disabled_colorgradient %})).
|
|
36
|
+
*
|
|
37
|
+
*/
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Sets the `tabIndex` property of the ColorGradient.
|
|
41
|
+
*/
|
|
42
|
+
tabIndex?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Specifies the id of the component.
|
|
45
|
+
*/
|
|
46
|
+
id?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Identifies the element(s) which will describe the component, similar to [HTML aria-describedby attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-describedby_attribute).
|
|
49
|
+
* For example these elements could contain error or hint message.
|
|
50
|
+
*/
|
|
51
|
+
ariaDescribedBy?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Identifies the element(s) which will label the component.
|
|
54
|
+
*/
|
|
55
|
+
ariaLabelledBy?: string;
|
|
56
|
+
}
|
|
File without changes
|
package/dist/es/input/Input.js
CHANGED
|
@@ -18,6 +18,7 @@ var __assign = this && this.__assign || function () {
|
|
|
18
18
|
import * as Vue from 'vue';
|
|
19
19
|
var allVue = Vue;
|
|
20
20
|
var gh = allVue.h;
|
|
21
|
+
var isV3 = allVue.version[0] === '3';
|
|
21
22
|
var ref = allVue.ref;
|
|
22
23
|
import { guid, templateDefinition, validatePackage, kendoThemeMaps, templateRendering, getListeners, getTemplate } from '@progress/kendo-vue-common';
|
|
23
24
|
import { packageMetadata } from '../package-metadata';
|
|
@@ -138,8 +139,8 @@ var InputVue2 = {
|
|
|
138
139
|
this.setValidity();
|
|
139
140
|
},
|
|
140
141
|
// @ts-ignore
|
|
141
|
-
setup: !
|
|
142
|
-
var v3 = !!
|
|
142
|
+
setup: !isV3 ? undefined : function () {
|
|
143
|
+
var v3 = !!isV3;
|
|
143
144
|
var inputRef = ref(null);
|
|
144
145
|
return {
|
|
145
146
|
v3: v3,
|
|
@@ -3,6 +3,7 @@ import { validatePackage } from '@progress/kendo-licensing';
|
|
|
3
3
|
import * as Vue from 'vue';
|
|
4
4
|
var allVue = Vue;
|
|
5
5
|
var gh = allVue.h;
|
|
6
|
+
var isV3 = allVue.version[0] === '3';
|
|
6
7
|
var ref = allVue.ref;
|
|
7
8
|
import { packageMetadata } from '../package-metadata';
|
|
8
9
|
/**
|
|
@@ -14,8 +15,8 @@ var InputSeparatorVue2 = {
|
|
|
14
15
|
validatePackage(packageMetadata);
|
|
15
16
|
},
|
|
16
17
|
// @ts-ignore
|
|
17
|
-
setup: !
|
|
18
|
-
var v3 = !!
|
|
18
|
+
setup: !isV3 ? undefined : function () {
|
|
19
|
+
var v3 = !!isV3;
|
|
19
20
|
return {
|
|
20
21
|
v3: v3
|
|
21
22
|
};
|
package/dist/es/main.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from './colors/interfaces/ColorPickerFocusEvent';
|
|
|
10
10
|
export * from './colors/interfaces/ColorPickerPaletteSettings';
|
|
11
11
|
export * from './colors/interfaces/ColorPickerPopupSettings';
|
|
12
12
|
export * from './colors/interfaces/ColorPickerProps';
|
|
13
|
+
export * from './colors/FlatColorPicker';
|
|
13
14
|
export { Switch, SwitchVue2, SwitchProps, SwitchState, SwitchChangeEvent } from './switch/Switch';
|
|
14
15
|
export * from './input-separator/InputSeparator';
|
|
15
16
|
export * from './input/Input';
|
package/dist/es/main.js
CHANGED
|
@@ -8,6 +8,7 @@ export * from './colors/interfaces/ColorPickerFocusEvent';
|
|
|
8
8
|
export * from './colors/interfaces/ColorPickerPaletteSettings';
|
|
9
9
|
export * from './colors/interfaces/ColorPickerPopupSettings';
|
|
10
10
|
export * from './colors/interfaces/ColorPickerProps';
|
|
11
|
+
export * from './colors/FlatColorPicker';
|
|
11
12
|
export { Switch, SwitchVue2 } from './switch/Switch';
|
|
12
13
|
export * from './input-separator/InputSeparator';
|
|
13
14
|
export * from './input/Input';
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
import * as Vue from 'vue';
|
|
3
3
|
var allVue = Vue;
|
|
4
4
|
var gh = allVue.h;
|
|
5
|
+
var isV3 = allVue.version[0] === '3';
|
|
5
6
|
var ref = allVue.ref;
|
|
6
7
|
import { MaskingService } from './masking.service';
|
|
7
8
|
import { defaultRules, maskingChanged, returnFalse } from './utils';
|
|
8
|
-
import { guid, getTabIndex, validatePackage, kendoThemeMaps, templateDefinition, templateRendering, getListeners, getTemplate } from '@progress/kendo-vue-common';
|
|
9
|
+
import { guid, getTabIndex, validatePackage, kendoThemeMaps, templateDefinition, templateRendering, getListeners, getTemplate, setRef } from '@progress/kendo-vue-common';
|
|
9
10
|
import { packageMetadata } from '../package-metadata';
|
|
10
11
|
/**
|
|
11
12
|
* @hidden
|
|
@@ -120,8 +121,8 @@ var MaskedTextBoxVue2 = {
|
|
|
120
121
|
this.isPasted = false;
|
|
121
122
|
},
|
|
122
123
|
// @ts-ignore
|
|
123
|
-
setup: !
|
|
124
|
-
var v3 = !!
|
|
124
|
+
setup: !isV3 ? undefined : function () {
|
|
125
|
+
var v3 = !!isV3;
|
|
125
126
|
var inputRef = ref(null);
|
|
126
127
|
return {
|
|
127
128
|
v3: v3,
|
|
@@ -372,8 +373,6 @@ var MaskedTextBoxVue2 = {
|
|
|
372
373
|
},
|
|
373
374
|
// @ts-ignore
|
|
374
375
|
render: function render(createElement) {
|
|
375
|
-
var _this = this;
|
|
376
|
-
|
|
377
376
|
var h = gh || createElement;
|
|
378
377
|
var inputId = this.$props.id || this.inputId;
|
|
379
378
|
var _a = this.$props,
|
|
@@ -419,26 +418,26 @@ var MaskedTextBoxVue2 = {
|
|
|
419
418
|
type: this.$props.type,
|
|
420
419
|
attrs: this.v3 ? undefined : {
|
|
421
420
|
type: this.$props.type,
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
421
|
+
autocomplete: "off",
|
|
422
|
+
autocorrect: "off",
|
|
423
|
+
autocapitalize: "off",
|
|
424
|
+
spellcheck: false,
|
|
426
425
|
id: inputId,
|
|
427
426
|
"aria-labelledby": this.$props.ariaLabelledBy,
|
|
428
427
|
"aria-describedby": this.$props.ariaDescribedBy,
|
|
429
428
|
name: this.$props.name,
|
|
430
|
-
|
|
431
|
-
|
|
429
|
+
tabindex: getTabIndex(this.$props.tabIndex, this.$props.disabled, true),
|
|
430
|
+
accesskey: this.$props.accessKey,
|
|
432
431
|
title: this.$props.title,
|
|
433
432
|
disabled: this.$props.disabled || undefined,
|
|
434
|
-
|
|
433
|
+
readonly: this.$props.readonly || undefined,
|
|
435
434
|
placeholder: this.$props.placeholder,
|
|
436
435
|
required: this.$props.required
|
|
437
436
|
},
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
437
|
+
autocomplete: "off",
|
|
438
|
+
autocorrect: "off",
|
|
439
|
+
autocapitalize: "off",
|
|
440
|
+
spellcheck: false,
|
|
442
441
|
"class": this.inputInnerClass,
|
|
443
442
|
value: this.v3 ? newValue : null,
|
|
444
443
|
domProps: this.v3 ? undefined : {
|
|
@@ -448,29 +447,27 @@ var MaskedTextBoxVue2 = {
|
|
|
448
447
|
"aria-labelledby": this.$props.ariaLabelledBy,
|
|
449
448
|
"aria-describedby": this.$props.ariaDescribedBy,
|
|
450
449
|
name: this.$props.name,
|
|
451
|
-
|
|
452
|
-
|
|
450
|
+
tabindex: getTabIndex(this.$props.tabIndex, this.$props.disabled, true),
|
|
451
|
+
accesskey: this.$props.accessKey,
|
|
453
452
|
title: this.$props.title,
|
|
454
453
|
disabled: this.$props.disabled || undefined,
|
|
455
|
-
|
|
454
|
+
readonly: this.$props.readonly || undefined,
|
|
456
455
|
placeholder: this.$props.placeholder,
|
|
457
456
|
required: this.$props.required,
|
|
458
|
-
ref: this
|
|
459
|
-
_this.inputRef = el;
|
|
460
|
-
} : 'input',
|
|
457
|
+
ref: setRef(this, 'input'),
|
|
461
458
|
onInput: this.onChangeHandler,
|
|
462
459
|
on: this.v3 ? undefined : {
|
|
463
460
|
"input": this.onChangeHandler,
|
|
464
461
|
"paste": this.pasteHandler,
|
|
465
462
|
"focus": this.focusHandler,
|
|
466
463
|
"blur": this.blurHandler,
|
|
467
|
-
"
|
|
464
|
+
"dragstart": returnFalse,
|
|
468
465
|
"drop": returnFalse
|
|
469
466
|
},
|
|
470
467
|
onPaste: this.pasteHandler,
|
|
471
468
|
onFocus: this.focusHandler,
|
|
472
469
|
onBlur: this.blurHandler,
|
|
473
|
-
|
|
470
|
+
onDragstart: returnFalse,
|
|
474
471
|
onDrop: returnFalse
|
|
475
472
|
}), this.$props.inputSuffix && h("span", {
|
|
476
473
|
"class": "k-input-suffix"
|