@progress/kendo-vue-inputs 9.2.1-develop.1 → 9.3.0-develop.1
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/colors/ColorContrastLabels.js +1 -1
- package/colors/ColorContrastLabels.mjs +4 -4
- package/colors/ColorGradient.d.ts +4 -0
- package/colors/ColorGradient.js +2 -2
- package/colors/ColorGradient.mjs +52 -46
- package/colors/ColorInput.js +1 -1
- package/colors/ColorInput.mjs +84 -80
- package/colors/ColorPalette.d.ts +2 -0
- package/colors/ColorPalette.js +1 -1
- package/colors/ColorPalette.mjs +18 -16
- package/colors/FlatColorPicker.d.ts +6 -0
- package/colors/FlatColorPicker.js +1 -1
- package/colors/FlatColorPicker.mjs +65 -75
- package/colors/HexInput.d.ts +1 -0
- package/colors/HexInput.js +1 -1
- package/colors/HexInput.mjs +12 -11
- package/colors/interfaces/ColorGradientProps.d.ts +9 -0
- package/colors/interfaces/ColorPaletteProps.d.ts +4 -0
- package/colors/interfaces/ColorPickerPaletteSettings.d.ts +4 -0
- package/dist/cdn/js/kendo-vue-inputs.js +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +9 -9
- package/slider/Slider.js +1 -1
- package/slider/Slider.mjs +8 -7
|
@@ -5,21 +5,21 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { defineComponent as
|
|
9
|
-
import { dropletSliderIcon as
|
|
10
|
-
import { Keys as c, focusContainer as
|
|
11
|
-
import { ButtonGroup as
|
|
12
|
-
import { DEFAULT_PRESET as
|
|
13
|
-
import { ColorGradient as
|
|
14
|
-
import { packageMetadata as
|
|
15
|
-
import { flatColorPickerGradientBtn as
|
|
16
|
-
import { parseColor as
|
|
17
|
-
import { DEFAULT_GRADIENT_SETTINGS as
|
|
18
|
-
import { provideLocalizationService as
|
|
19
|
-
function
|
|
20
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !
|
|
8
|
+
import { defineComponent as K, h as l, createVNode as t, isVNode as T } from "vue";
|
|
9
|
+
import { dropletSliderIcon as L, paletteIcon as z, dropletSlashIcon as F } from "@progress/kendo-svg-icons";
|
|
10
|
+
import { Keys as c, focusContainer as R, focusFirstFocusableChild as M, templateRendering as u, getListeners as h, getTemplate as p, classNames as G, kendoThemeMaps as D, getTabIndex as j, validatePackage as N, setRef as g } from "@progress/kendo-vue-common";
|
|
11
|
+
import { ButtonGroup as E, Button as a } from "@progress/kendo-vue-buttons";
|
|
12
|
+
import { DEFAULT_PRESET as O, ColorPalette as A } from "./ColorPalette.mjs";
|
|
13
|
+
import { ColorGradient as _ } from "./ColorGradient.mjs";
|
|
14
|
+
import { packageMetadata as H } from "../package-metadata.mjs";
|
|
15
|
+
import { flatColorPickerGradientBtn as m, messages as r, flatColorPickerPaletteBtn as f, flatColorPickerClearBtn as C, flatColorPickerCancelBtn as v, flatColorPickerApplyBtn as b } from "../messages/main.mjs";
|
|
16
|
+
import { parseColor as U } from "./utils/color-parser.mjs";
|
|
17
|
+
import { DEFAULT_GRADIENT_SETTINGS as q } from "./utils/color-cache.mjs";
|
|
18
|
+
import { provideLocalizationService as J } from "@progress/kendo-vue-intl";
|
|
19
|
+
function k(e) {
|
|
20
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !T(e);
|
|
21
21
|
}
|
|
22
|
-
const
|
|
22
|
+
const le = /* @__PURE__ */ K({
|
|
23
23
|
name: "KendoFlatColorPicker",
|
|
24
24
|
emits: {
|
|
25
25
|
viewchange: (e) => !0,
|
|
@@ -67,20 +67,21 @@ const ne = /* @__PURE__ */ T({
|
|
|
67
67
|
gradientSettings: {
|
|
68
68
|
type: Object,
|
|
69
69
|
default: function() {
|
|
70
|
-
return
|
|
70
|
+
return q;
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
73
|
paletteSettings: {
|
|
74
74
|
type: Object,
|
|
75
75
|
default: function() {
|
|
76
76
|
return {
|
|
77
|
-
palette:
|
|
77
|
+
palette: O
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
80
|
},
|
|
81
81
|
size: {
|
|
82
82
|
type: String
|
|
83
83
|
},
|
|
84
|
+
ariaLabel: String,
|
|
84
85
|
adaptive: Boolean
|
|
85
86
|
},
|
|
86
87
|
inject: {
|
|
@@ -89,7 +90,7 @@ const ne = /* @__PURE__ */ T({
|
|
|
89
90
|
}
|
|
90
91
|
},
|
|
91
92
|
created() {
|
|
92
|
-
|
|
93
|
+
N(H);
|
|
93
94
|
},
|
|
94
95
|
computed: {
|
|
95
96
|
isColorGradient() {
|
|
@@ -132,15 +133,15 @@ const ne = /* @__PURE__ */ T({
|
|
|
132
133
|
const {
|
|
133
134
|
size: e,
|
|
134
135
|
adaptive: o
|
|
135
|
-
} = this.$props, i =
|
|
136
|
+
} = this.$props, i = J(this), w = i.toLanguageString(m, r[m]), y = i.toLanguageString(f, r[f]), V = i.toLanguageString(C, r[C]), n = i.toLanguageString(v, r[v]), s = i.toLanguageString(b, r[b]), B = u.call(this, this.$props.header, h.call(this)), P = u.call(this, this.$props.footer, h.call(this)), S = p.call(this, {
|
|
136
137
|
h: l,
|
|
137
|
-
template:
|
|
138
|
-
}),
|
|
138
|
+
template: B
|
|
139
|
+
}), I = p.call(this, {
|
|
139
140
|
h: l,
|
|
140
|
-
template:
|
|
141
|
-
}),
|
|
142
|
-
return l(
|
|
143
|
-
ref:
|
|
141
|
+
template: P
|
|
142
|
+
}), $ = function() {
|
|
143
|
+
return l(_, {
|
|
144
|
+
ref: g(this, "gradient"),
|
|
144
145
|
tabIndex: -1,
|
|
145
146
|
value: this.colorValue,
|
|
146
147
|
innerTabIndex: this.computedTabIndex,
|
|
@@ -148,11 +149,12 @@ const ne = /* @__PURE__ */ T({
|
|
|
148
149
|
onChange: this.handleColorChange,
|
|
149
150
|
onKeydown: this.innerKeyDown,
|
|
150
151
|
adaptive: o,
|
|
152
|
+
role: "none",
|
|
151
153
|
...this.gradientSettings
|
|
152
154
|
});
|
|
153
155
|
}, x = function() {
|
|
154
|
-
return l(
|
|
155
|
-
ref:
|
|
156
|
+
return l(A, {
|
|
157
|
+
ref: g(this, "palette"),
|
|
156
158
|
tabIndex: this.computedTabIndex,
|
|
157
159
|
value: this.colorValue,
|
|
158
160
|
size: e,
|
|
@@ -162,21 +164,23 @@ const ne = /* @__PURE__ */ T({
|
|
|
162
164
|
});
|
|
163
165
|
};
|
|
164
166
|
return t("div", {
|
|
165
|
-
tabindex:
|
|
167
|
+
tabindex: j(this.$props.tabIndex, this.$props.disabled),
|
|
166
168
|
onFocus: this.onFocus,
|
|
167
169
|
onBlur: this.onBlur,
|
|
168
170
|
onFocusout: this.onFocusout,
|
|
169
171
|
onKeydown: this.onKeyDownHandler,
|
|
170
|
-
class:
|
|
171
|
-
[`k-coloreditor-${
|
|
172
|
+
class: G("k-flatcolorpicker k-coloreditor", {
|
|
173
|
+
[`k-coloreditor-${D.sizeMap[e] || e}`]: e,
|
|
172
174
|
"k-disabled": this.$props.disabled
|
|
173
175
|
}),
|
|
174
|
-
"aria-disabled": this.$props.disabled
|
|
175
|
-
|
|
176
|
+
"aria-disabled": this.$props.disabled || void 0,
|
|
177
|
+
role: "textbox",
|
|
178
|
+
"aria-label": this.$props.ariaLabel
|
|
179
|
+
}, [S, this.$props.showClearButton && this.$props.showPreview && t("div", {
|
|
176
180
|
class: "k-coloreditor-header k-hstack"
|
|
177
|
-
}, [
|
|
181
|
+
}, [t("div", {
|
|
178
182
|
class: "k-coloreditor-header-actions k-hstack"
|
|
179
|
-
}, [t(
|
|
183
|
+
}, [this.$props.view === "combo" && t(E, {
|
|
180
184
|
class: "k-button-group-flat"
|
|
181
185
|
}, {
|
|
182
186
|
default: () => [t(a, {
|
|
@@ -186,32 +190,22 @@ const ne = /* @__PURE__ */ T({
|
|
|
186
190
|
fillMode: "flat",
|
|
187
191
|
selected: this.isColorGradient,
|
|
188
192
|
onKeydown: this.handleButtonKeydown,
|
|
189
|
-
ariaLabel:
|
|
193
|
+
ariaLabel: w,
|
|
190
194
|
size: e,
|
|
191
|
-
onClick: (d) => this.handleViewChange(d, "gradient")
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
size: e,
|
|
195
|
-
name: "droplet-slider",
|
|
196
|
-
icon: F
|
|
197
|
-
}, null)]
|
|
198
|
-
}), t(a, {
|
|
195
|
+
onClick: (d) => this.handleViewChange(d, "gradient"),
|
|
196
|
+
svgIcon: L
|
|
197
|
+
}, null), t(a, {
|
|
199
198
|
tabIndex: this.computedTabIndex,
|
|
200
199
|
type: "button",
|
|
201
200
|
togglable: !0,
|
|
202
201
|
fillMode: "flat",
|
|
203
202
|
selected: !this.isColorGradient,
|
|
204
203
|
onKeydown: this.handleButtonKeydown,
|
|
205
|
-
ariaLabel:
|
|
204
|
+
ariaLabel: y,
|
|
206
205
|
size: e,
|
|
207
|
-
onClick: (d) => this.handleViewChange(d, "palette")
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
size: e,
|
|
211
|
-
name: "palette",
|
|
212
|
-
icon: L
|
|
213
|
-
}, null)]
|
|
214
|
-
})]
|
|
206
|
+
onClick: (d) => this.handleViewChange(d, "palette"),
|
|
207
|
+
svgIcon: z
|
|
208
|
+
}, null)]
|
|
215
209
|
})]), t("div", {
|
|
216
210
|
class: "k-spacer"
|
|
217
211
|
}, null), t("div", {
|
|
@@ -220,37 +214,32 @@ const ne = /* @__PURE__ */ T({
|
|
|
220
214
|
tabIndex: this.computedTabIndex,
|
|
221
215
|
type: "button",
|
|
222
216
|
fillMode: "flat",
|
|
223
|
-
ariaLabel:
|
|
217
|
+
ariaLabel: V,
|
|
218
|
+
svgIcon: F,
|
|
224
219
|
size: e,
|
|
225
220
|
onKeydown: this.handleButtonKeydown,
|
|
226
221
|
onClick: this.handleResetColor
|
|
227
|
-
}, {
|
|
228
|
-
default: () => [t(u, {
|
|
229
|
-
size: e,
|
|
230
|
-
name: "droplet-slash",
|
|
231
|
-
icon: R
|
|
232
|
-
}, null)]
|
|
233
|
-
}), this.$props.showPreview && t("div", {
|
|
222
|
+
}, null), this.$props.showPreview && t("div", {
|
|
234
223
|
class: "k-coloreditor-preview k-vstack"
|
|
235
224
|
}, [t("span", {
|
|
236
|
-
class: this.previewClass
|
|
225
|
+
class: this.previewClass
|
|
226
|
+
}, [t("span", {
|
|
227
|
+
class: "k-color-preview-mask",
|
|
237
228
|
style: {
|
|
238
229
|
background: this.colorValue
|
|
239
230
|
}
|
|
240
|
-
}, [!this.colorValue && t("span", {
|
|
241
|
-
class: "k-color-preview-mask"
|
|
242
231
|
}, null)]), t("span", {
|
|
243
|
-
class: this.currentClass
|
|
232
|
+
class: this.currentClass
|
|
233
|
+
}, [t("span", {
|
|
234
|
+
class: "k-color-preview-mask",
|
|
244
235
|
style: {
|
|
245
236
|
background: this.computedPrevColor
|
|
246
237
|
},
|
|
247
238
|
onClick: this.handlePrevColorClick
|
|
248
|
-
}, [!this.computedPrevColor && t("span", {
|
|
249
|
-
class: "k-color-preview-mask"
|
|
250
239
|
}, null)])])])]), t("div", {
|
|
251
240
|
class: "k-coloreditor-views k-vstack"
|
|
252
|
-
}, [this.isColorGradient ?
|
|
253
|
-
class: "k-coloreditor-footer k-actions k-actions-
|
|
241
|
+
}, [this.isColorGradient ? $.call(this) : x.call(this)]), this.$props.showButtons && t("div", {
|
|
242
|
+
class: "k-coloreditor-footer k-actions k-actions-horizontal k-actions-start"
|
|
254
243
|
}, [t(a, {
|
|
255
244
|
tabIndex: this.computedTabIndex,
|
|
256
245
|
type: "button",
|
|
@@ -258,28 +247,29 @@ const ne = /* @__PURE__ */ T({
|
|
|
258
247
|
size: e,
|
|
259
248
|
onKeydown: this.handleButtonKeydown,
|
|
260
249
|
onClick: this.handleCancelBtnClick
|
|
261
|
-
},
|
|
250
|
+
}, k(n) ? n : {
|
|
262
251
|
default: () => [n]
|
|
263
252
|
}), t(a, {
|
|
264
253
|
tabIndex: this.computedTabIndex,
|
|
265
254
|
type: "button",
|
|
266
|
-
class: "k-coloreditor-apply
|
|
255
|
+
class: "k-coloreditor-apply",
|
|
256
|
+
themeColor: "primary",
|
|
267
257
|
size: e,
|
|
268
258
|
onKeydown: this.handleButtonKeydown,
|
|
269
259
|
onClick: this.triggerChange
|
|
270
|
-
},
|
|
260
|
+
}, k(s) ? s : {
|
|
271
261
|
default: () => [s]
|
|
272
|
-
})]),
|
|
262
|
+
})]), I]);
|
|
273
263
|
},
|
|
274
264
|
methods: {
|
|
275
265
|
focus() {
|
|
276
266
|
this.focused = !0, setTimeout(() => {
|
|
277
|
-
|
|
267
|
+
M(this.$el);
|
|
278
268
|
}, 1);
|
|
279
269
|
},
|
|
280
270
|
onKeyDownHandler(e) {
|
|
281
271
|
const o = this.$el;
|
|
282
|
-
this.focused =
|
|
272
|
+
this.focused = R(e, o), this.$emit("keydown", e);
|
|
283
273
|
},
|
|
284
274
|
handleViewChange(e, o) {
|
|
285
275
|
this.currentView = o, this.$emit("viewchange", {
|
|
@@ -297,7 +287,7 @@ const ne = /* @__PURE__ */ T({
|
|
|
297
287
|
this.colorValue = e.value, !this.showButtons && !this.adaptive && this.triggerChange(e);
|
|
298
288
|
},
|
|
299
289
|
triggerChange(e) {
|
|
300
|
-
const o =
|
|
290
|
+
const o = U(this.colorValue, "rgba");
|
|
301
291
|
this.currentPrevColor = this.colorValue, this.$emit("changemodel", this.colorValue), this.$emit("update:modelValue", this.colorValue), this.$emit("update:modelRgbaValue", o), this.$emit("change", {
|
|
302
292
|
event: e,
|
|
303
293
|
value: this.colorValue,
|
|
@@ -340,5 +330,5 @@ const ne = /* @__PURE__ */ T({
|
|
|
340
330
|
}
|
|
341
331
|
});
|
|
342
332
|
export {
|
|
343
|
-
|
|
333
|
+
le as FlatColorPicker
|
|
344
334
|
};
|
package/colors/HexInput.d.ts
CHANGED
package/colors/HexInput.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),s=require("./utils/color-parser.js"),n=require("./utils/misc.js"),o=require("../textbox/TextBox.js"),u=r.defineComponent({name:"KendoHexInput",emits:{hexchange:e=>!0,blur:e=>!0,focus:e=>!0},props:{tabIndex:Number,hex:String,disabled:Boolean,id:String,size:String},computed:{isHexValid(){return!!s.parseColor(this.currentHex,"rgba")}},data(){return{currentHex:this.$props.hex,originalHex:this.$props.hex,isFocused:!1}},mounted(){this._input=this.$refs.input._input},watch:{hex:function(e){this.isFocused||(this.currentHex=e)}},render(){return r.createVNode(o.TextBox,{id:this.$props.id,value:this.currentHex,onInput:this.onChange,onChange:this.onChange,onFocus:this.onFocus,onBlur:this.onBlur,valid:this.isHexValid,disabled:this.$props.disabled,size:this.$props.size,tabIndex:this.tabIndex,ref:"input"},null)},methods:{onChange(e){const t=e.target.value,i=s.parseColor(t,"rgba");this.currentHex=t,n.isPresent(i)&&this.$emit("hexchange",{hex:t,value:i,event:e})},onBlur(e){this.isFocused=!1,n.isPresent(s.parseColor(this.currentHex,"rgba"))?this.currentHex=this.hex:this.currentHex=this.originalHex,this.$emit("blur",{event:e})},onFocus(e){this.isFocused=!0,this.$emit("focus",{event:e})}}});exports.HexInput=u;
|
package/colors/HexInput.mjs
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { defineComponent as
|
|
8
|
+
import { defineComponent as n, createVNode as o } from "vue";
|
|
9
9
|
import { parseColor as i } from "./utils/color-parser.mjs";
|
|
10
|
-
import { isPresent as
|
|
10
|
+
import { isPresent as r } from "./utils/misc.mjs";
|
|
11
11
|
import { TextBox as h } from "../textbox/TextBox.mjs";
|
|
12
|
-
const
|
|
12
|
+
const p = /* @__PURE__ */ n({
|
|
13
13
|
name: "KendoHexInput",
|
|
14
14
|
emits: {
|
|
15
15
|
hexchange: (e) => !0,
|
|
@@ -31,7 +31,8 @@ const d = /* @__PURE__ */ s({
|
|
|
31
31
|
data() {
|
|
32
32
|
return {
|
|
33
33
|
currentHex: this.$props.hex,
|
|
34
|
-
originalHex: this.$props.hex
|
|
34
|
+
originalHex: this.$props.hex,
|
|
35
|
+
isFocused: !1
|
|
35
36
|
};
|
|
36
37
|
},
|
|
37
38
|
mounted() {
|
|
@@ -39,7 +40,7 @@ const d = /* @__PURE__ */ s({
|
|
|
39
40
|
},
|
|
40
41
|
watch: {
|
|
41
42
|
hex: function(e) {
|
|
42
|
-
this.currentHex = e;
|
|
43
|
+
this.isFocused || (this.currentHex = e);
|
|
43
44
|
}
|
|
44
45
|
},
|
|
45
46
|
render() {
|
|
@@ -59,25 +60,25 @@ const d = /* @__PURE__ */ s({
|
|
|
59
60
|
},
|
|
60
61
|
methods: {
|
|
61
62
|
onChange(e) {
|
|
62
|
-
const t = e.target.value,
|
|
63
|
-
this.currentHex = t,
|
|
63
|
+
const t = e.target.value, s = i(t, "rgba");
|
|
64
|
+
this.currentHex = t, r(s) && this.$emit("hexchange", {
|
|
64
65
|
hex: t,
|
|
65
|
-
value:
|
|
66
|
+
value: s,
|
|
66
67
|
event: e
|
|
67
68
|
});
|
|
68
69
|
},
|
|
69
70
|
onBlur(e) {
|
|
70
|
-
|
|
71
|
+
this.isFocused = !1, r(i(this.currentHex, "rgba")) ? this.currentHex = this.hex : this.currentHex = this.originalHex, this.$emit("blur", {
|
|
71
72
|
event: e
|
|
72
73
|
});
|
|
73
74
|
},
|
|
74
75
|
onFocus(e) {
|
|
75
|
-
this.$emit("focus", {
|
|
76
|
+
this.isFocused = !0, this.$emit("focus", {
|
|
76
77
|
event: e
|
|
77
78
|
});
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
81
|
});
|
|
81
82
|
export {
|
|
82
|
-
|
|
83
|
+
p as HexInput
|
|
83
84
|
};
|
|
@@ -76,6 +76,10 @@ export interface ColorGradientProps {
|
|
|
76
76
|
* Identifies the element(s) which will label the component.
|
|
77
77
|
*/
|
|
78
78
|
ariaLabelledBy?: string;
|
|
79
|
+
/**
|
|
80
|
+
* Specifies the aria-label attribute of the ColorGradient.
|
|
81
|
+
*/
|
|
82
|
+
ariaLabel?: string;
|
|
79
83
|
/**
|
|
80
84
|
* Configures the `size` of the ColorGradient.
|
|
81
85
|
*
|
|
@@ -87,6 +91,11 @@ export interface ColorGradientProps {
|
|
|
87
91
|
* @default undefined
|
|
88
92
|
*/
|
|
89
93
|
size?: 'small' | 'medium' | 'large';
|
|
94
|
+
/**
|
|
95
|
+
* @hidden
|
|
96
|
+
* Internal prop that sets the `role` of the ColorGradient. If not set, the role will be `textbox` when the component is focusable.
|
|
97
|
+
*/
|
|
98
|
+
role?: string;
|
|
90
99
|
/**
|
|
91
100
|
* @hidden
|
|
92
101
|
* Internal prop that determines whether the ColorGradient is in adaptive state.
|
|
@@ -71,6 +71,10 @@ export interface ColorPaletteProps {
|
|
|
71
71
|
* Identifies the element(s) which will label the component.
|
|
72
72
|
*/
|
|
73
73
|
ariaLabelledBy?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Specifies the aria-label attribute of the ColorPalette.
|
|
76
|
+
*/
|
|
77
|
+
ariaLabel?: string;
|
|
74
78
|
/**
|
|
75
79
|
* Configures the `size` of the ColorPalette.
|
|
76
80
|
*
|