@progress/kendo-vue-inputs 6.4.1-develop.2 → 6.4.2-develop.3
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/checkbox/Checkbox.mjs +20 -20
- package/colors/ColorGradient.mjs +22 -22
- package/colors/ColorInput.mjs +3 -3
- package/colors/ColorPalette.mjs +9 -9
- package/colors/ColorPicker.mjs +12 -12
- package/colors/FlatColorPicker.mjs +12 -12
- package/colors/utils/color-parser.js +1 -1
- package/colors/utils/color-parser.mjs +1 -1
- package/dist/cdn/js/kendo-vue-inputs.js +1 -1
- package/input/Input.mjs +5 -5
- package/maskedtextbox/MaskedTextBox.mjs +16 -16
- package/maskedtextbox/masking.service.mjs +9 -9
- package/numerictextbox/NumericTextBox.mjs +20 -20
- package/numerictextbox/utils/main.js +1 -1
- package/numerictextbox/utils/main.mjs +37 -37
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +9 -9
- package/radiobutton/RadioButton.mjs +9 -9
- package/radiobutton/RadioGroup.mjs +6 -6
- package/range-slider/RangeSlider.mjs +7 -7
- package/rating/Rating.mjs +7 -7
- package/rating/RatingItem.mjs +6 -6
- package/signature/Signature.mjs +2 -2
- package/signature/SignatureDialog.mjs +1 -1
- package/slider/Slider.mjs +6 -6
- package/switch/Switch.mjs +6 -6
- package/textarea/TextArea.mjs +8 -8
- package/textbox/TextBox.mjs +6 -6
package/checkbox/Checkbox.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 x,
|
|
9
|
-
import {
|
|
8
|
+
import { defineComponent as x, h as B, createVNode as l, ref as D, inject as M } from "vue";
|
|
9
|
+
import { Keys as O, getDefaultSlots as P, classNames as f, kendoThemeMaps as m, templateRendering as z, getListeners as L, getTemplate as w, getRef as g, validatePackage as I, guid as H, getTabIndex as T, setRef as N } from "@progress/kendo-vue-common";
|
|
10
10
|
import { packageMetadata as R } from "../package-metadata.mjs";
|
|
11
11
|
import { provideLocalizationService as q } from "@progress/kendo-vue-intl";
|
|
12
|
-
import {
|
|
12
|
+
import { messages as K, checkboxValidation as j, checkboxOptionalText as A } from "../messages/main.mjs";
|
|
13
13
|
const U = /* @__PURE__ */ x({
|
|
14
14
|
name: "KendoCheckbox",
|
|
15
15
|
emits: {
|
|
@@ -94,7 +94,7 @@ const U = /* @__PURE__ */ x({
|
|
|
94
94
|
};
|
|
95
95
|
},
|
|
96
96
|
created() {
|
|
97
|
-
|
|
97
|
+
I(R), this.calculatedId = H(), this.$props.defaultChecked !== void 0 && (this.currentChecked = this.$props.defaultChecked), this.$props.defaultValue !== void 0 && (this.currentValue = this.$props.defaultValue), this.currentDir = this.$props.dir;
|
|
98
98
|
},
|
|
99
99
|
computed: {
|
|
100
100
|
valueIsBooleanOrNull() {
|
|
@@ -138,17 +138,17 @@ const U = /* @__PURE__ */ x({
|
|
|
138
138
|
}
|
|
139
139
|
},
|
|
140
140
|
mounted() {
|
|
141
|
-
if (this.input =
|
|
141
|
+
if (this.input = g(this, "input"), !this.currentDir && window && this.$el) {
|
|
142
142
|
const e = window.getComputedStyle(this.$el).direction;
|
|
143
143
|
e && (this.currentDir = e);
|
|
144
144
|
}
|
|
145
145
|
this.setValidity();
|
|
146
146
|
},
|
|
147
147
|
updated() {
|
|
148
|
-
this.input || (this.input =
|
|
148
|
+
this.input || (this.input = g(this, "input")), this.setValidity();
|
|
149
149
|
},
|
|
150
150
|
setup() {
|
|
151
|
-
const e =
|
|
151
|
+
const e = D(null), t = M("kendoLocalizationService", {});
|
|
152
152
|
return {
|
|
153
153
|
inputRef: e,
|
|
154
154
|
kendoLocalizationService: t
|
|
@@ -170,16 +170,16 @@ const U = /* @__PURE__ */ x({
|
|
|
170
170
|
validityStyles: v,
|
|
171
171
|
size: r,
|
|
172
172
|
rounded: u
|
|
173
|
-
} = this.$props, o =
|
|
173
|
+
} = this.$props, o = P(this);
|
|
174
174
|
let a = b;
|
|
175
|
-
this.localizationService = q(this), this.defaultValidationMessage = this.localizeMessage(
|
|
176
|
-
const h =
|
|
175
|
+
this.localizationService = q(this), this.defaultValidationMessage = this.localizeMessage(j), this.optionalMessage = this.localizeMessage(A);
|
|
176
|
+
const h = f({
|
|
177
177
|
"k-checkbox-wrap": !0,
|
|
178
178
|
"k-disabled": i
|
|
179
|
-
}), y =
|
|
179
|
+
}), y = f({
|
|
180
180
|
"k-checkbox": !0,
|
|
181
|
-
[`k-checkbox-${
|
|
182
|
-
[`k-rounded-${
|
|
181
|
+
[`k-checkbox-${m.sizeMap[r]}`]: r,
|
|
182
|
+
[`k-rounded-${m.roundedMap[u]}`]: u,
|
|
183
183
|
"k-indeterminate": this.indeterminateProp,
|
|
184
184
|
"k-disabled": i,
|
|
185
185
|
"k-invalid": !this.isValid && v !== !1
|
|
@@ -189,12 +189,12 @@ const U = /* @__PURE__ */ x({
|
|
|
189
189
|
class: y,
|
|
190
190
|
name: $,
|
|
191
191
|
id: s || this.calculatedId,
|
|
192
|
-
ref:
|
|
192
|
+
ref: N(this, "input"),
|
|
193
193
|
"aria-labelledby": t,
|
|
194
194
|
"aria-describedby": e,
|
|
195
195
|
checked: !!this.checkedProp,
|
|
196
196
|
disabled: i,
|
|
197
|
-
tabindex:
|
|
197
|
+
tabindex: T(V, i),
|
|
198
198
|
role: "checkbox",
|
|
199
199
|
required: d !== void 0 ? d : !1,
|
|
200
200
|
"aria-checked": this.computedChecked || this.checkedProp ? !0 : this.indeterminateProp ? "mixed" : !1,
|
|
@@ -206,9 +206,9 @@ const U = /* @__PURE__ */ x({
|
|
|
206
206
|
}, null);
|
|
207
207
|
};
|
|
208
208
|
if (n) {
|
|
209
|
-
const S = n ?
|
|
210
|
-
a =
|
|
211
|
-
h:
|
|
209
|
+
const S = n ? z.call(this, n, L.call(this)) : null;
|
|
210
|
+
a = w.call(this, {
|
|
211
|
+
h: B,
|
|
212
212
|
template: S
|
|
213
213
|
});
|
|
214
214
|
}
|
|
@@ -237,7 +237,7 @@ const U = /* @__PURE__ */ x({
|
|
|
237
237
|
this.input && this.input.setCustomValidity && this.input.setCustomValidity(e ? "" : this.$props.validationMessage || this.defaultValidationMessage);
|
|
238
238
|
},
|
|
239
239
|
localizeMessage(e) {
|
|
240
|
-
return this.localizationService.toLanguageString(e,
|
|
240
|
+
return this.localizationService.toLanguageString(e, K[e]);
|
|
241
241
|
},
|
|
242
242
|
focusElement() {
|
|
243
243
|
this.input && this.input.focus();
|
|
@@ -270,7 +270,7 @@ const U = /* @__PURE__ */ x({
|
|
|
270
270
|
keyCode: t
|
|
271
271
|
} = e;
|
|
272
272
|
let i = e.currentTarget.checked;
|
|
273
|
-
t ===
|
|
273
|
+
t === O.space && (e.preventDefault(), e.stopPropagation(), this.setValue(e, !i));
|
|
274
274
|
},
|
|
275
275
|
onBlurHandler(e) {
|
|
276
276
|
this.$props.disabled || this.$emit("blur", e);
|
package/colors/ColorGradient.mjs
CHANGED
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import { defineComponent as w, createVNode as s } from "vue";
|
|
9
|
-
import {
|
|
9
|
+
import { focusFirstFocusableChild as D, Keys as n, getRef as G, focusContainer as M, classNames as A, kendoThemeMaps as K, getTabIndex as E, Draggable as z, validatePackage as W, guid as O, setRef as N } from "@progress/kendo-vue-common";
|
|
10
10
|
import { packageMetadata as P } from "../package-metadata.mjs";
|
|
11
|
-
import {
|
|
12
|
-
import { parseColor as o,
|
|
11
|
+
import { fitIntoBounds as f, isPresent as C } from "./utils/misc.mjs";
|
|
12
|
+
import { getColorFromHSV as j, parseColor as o, getColorFromHue as c, getRGBA as u, getColorFromRGBA as X, getHSV as g } from "./utils/color-parser.mjs";
|
|
13
13
|
import { removeCachedColor as Y } from "./utils/color-cache.mjs";
|
|
14
14
|
import { ColorInput as _ } from "./ColorInput.mjs";
|
|
15
15
|
import { ColorContrastLabels as U } from "./ColorContrastLabels.mjs";
|
|
@@ -60,7 +60,7 @@ const Q = "rgba", y = "rgba(255, 255, 255, 1)", ce = /* @__PURE__ */ w({
|
|
|
60
60
|
adaptive: Boolean
|
|
61
61
|
},
|
|
62
62
|
created() {
|
|
63
|
-
|
|
63
|
+
W(P), this.guid = O();
|
|
64
64
|
},
|
|
65
65
|
computed: {
|
|
66
66
|
valueSet() {
|
|
@@ -68,10 +68,10 @@ const Q = "rgba", y = "rgba(255, 255, 255, 1)", ce = /* @__PURE__ */ w({
|
|
|
68
68
|
},
|
|
69
69
|
computedValue() {
|
|
70
70
|
let e = this.valueSet || this.currentValue || this.defaultValue || o(y, Q);
|
|
71
|
-
return
|
|
71
|
+
return C(o(e, "hex", this.opacity)) || (e = y), e;
|
|
72
72
|
},
|
|
73
73
|
hsva() {
|
|
74
|
-
return this.valueSet ?
|
|
74
|
+
return this.valueSet ? g(this.computedValue) : this.currentHsva || g(this.computedValue);
|
|
75
75
|
},
|
|
76
76
|
rgba() {
|
|
77
77
|
return this.valueSet ? u(this.computedValue) : this.currentRgba;
|
|
@@ -80,7 +80,7 @@ const Q = "rgba", y = "rgba(255, 255, 255, 1)", ce = /* @__PURE__ */ w({
|
|
|
80
80
|
return this.valueSet ? o(this.computedValue, "hex", this.opacity) : this.currentHex;
|
|
81
81
|
},
|
|
82
82
|
computedBgColor() {
|
|
83
|
-
return this.currentBgColor ||
|
|
83
|
+
return this.currentBgColor || c(this.hsva.h);
|
|
84
84
|
},
|
|
85
85
|
computedTabIndex() {
|
|
86
86
|
return this.innerTabIndex !== void 0 ? this.innerTabIndex : this.focused ? 0 : -1;
|
|
@@ -117,9 +117,9 @@ const Q = "rgba", y = "rgba(255, 255, 255, 1)", ce = /* @__PURE__ */ w({
|
|
|
117
117
|
ariaDescribedBy: p,
|
|
118
118
|
ariaLabelledBy: H,
|
|
119
119
|
adaptive: d
|
|
120
|
-
} = this.$props, B =
|
|
120
|
+
} = this.$props, B = A("k-colorgradient", {
|
|
121
121
|
"k-disabled": t,
|
|
122
|
-
[`k-colorgradient-${
|
|
122
|
+
[`k-colorgradient-${K.sizeMap[e] || e}`]: e
|
|
123
123
|
}, i), b = J(this), $ = b.toLanguageString(k, m[k]), V = b.toLanguageString(S, m[S]), L = b.toLanguageString(x, m[x]), F = function() {
|
|
124
124
|
let l = {};
|
|
125
125
|
if (!this.isFirstRender) {
|
|
@@ -146,7 +146,7 @@ const Q = "rgba", y = "rgba(255, 255, 255, 1)", ce = /* @__PURE__ */ w({
|
|
|
146
146
|
class: B,
|
|
147
147
|
role: h !== -1 ? "textbox" : void 0,
|
|
148
148
|
"aria-disabled": t,
|
|
149
|
-
tabindex:
|
|
149
|
+
tabindex: E(h, t),
|
|
150
150
|
"aria-labelledby": H,
|
|
151
151
|
"aria-describedby": p,
|
|
152
152
|
onFocus: this.onFocus,
|
|
@@ -159,7 +159,7 @@ const Q = "rgba", y = "rgba(255, 255, 255, 1)", ce = /* @__PURE__ */ w({
|
|
|
159
159
|
style: {
|
|
160
160
|
background: this.computedBgColor
|
|
161
161
|
}
|
|
162
|
-
}, [s(
|
|
162
|
+
}, [s(z, {
|
|
163
163
|
onDrag: this.onDrag,
|
|
164
164
|
onRelease: this.onRelease,
|
|
165
165
|
ref: "draggable"
|
|
@@ -192,7 +192,7 @@ const Q = "rgba", y = "rgba(255, 255, 255, 1)", ce = /* @__PURE__ */ w({
|
|
|
192
192
|
ariaLabel: $
|
|
193
193
|
}, null), a && s(R, {
|
|
194
194
|
tabIndex: this.computedTabIndex,
|
|
195
|
-
value:
|
|
195
|
+
value: C(this.hsva.a) ? this.hsva.a * 100 : 100,
|
|
196
196
|
buttons: !1,
|
|
197
197
|
vertical: !d,
|
|
198
198
|
min: 0,
|
|
@@ -223,15 +223,15 @@ const Q = "rgba", y = "rgba(255, 255, 255, 1)", ce = /* @__PURE__ */ w({
|
|
|
223
223
|
methods: {
|
|
224
224
|
onKeyDownHandler(e) {
|
|
225
225
|
const t = this.$el;
|
|
226
|
-
this.innerTabIndex === void 0 && (this.focused =
|
|
226
|
+
this.innerTabIndex === void 0 && (this.focused = M(e, t)), this.$emit("keydown", e);
|
|
227
227
|
},
|
|
228
228
|
onHexChange(e, t, i) {
|
|
229
|
-
const a = u(t), r =
|
|
230
|
-
this.currentHsva = r, this.currentBgColor =
|
|
229
|
+
const a = u(t), r = g(t);
|
|
230
|
+
this.currentHsva = r, this.currentBgColor = c(r.h), this.currentRgba = a, this.currentHex = e, this.dispatchChangeEvent(t, i.event, e, t);
|
|
231
231
|
},
|
|
232
232
|
onRgbaChange(e, t) {
|
|
233
|
-
const i =
|
|
234
|
-
this.currentHsva = r, this.currentBgColor =
|
|
233
|
+
const i = X(e), a = o(i, "hex", this.opacity), r = g(i);
|
|
234
|
+
this.currentHsva = r, this.currentBgColor = c(r.h), this.currentRgba = e, this.currentHex = a, this.dispatchChangeEvent(i, t.event, a, i);
|
|
235
235
|
},
|
|
236
236
|
onAlphaSliderChange(e) {
|
|
237
237
|
this.handleHsvaChange(Object.assign({}, this.hsva, {
|
|
@@ -250,7 +250,7 @@ const Q = "rgba", y = "rgba(255, 255, 255, 1)", ce = /* @__PURE__ */ w({
|
|
|
250
250
|
this.gradientWrapper.classList.remove("k-dragging");
|
|
251
251
|
},
|
|
252
252
|
onGradientWrapperClick(e) {
|
|
253
|
-
this.firstFocusable =
|
|
253
|
+
this.firstFocusable = G(this, "draghandle"), this.firstFocusable && this.firstFocusable.focus(), this.changePosition(e);
|
|
254
254
|
},
|
|
255
255
|
move(e, t, i) {
|
|
256
256
|
const a = this.hsva;
|
|
@@ -277,15 +277,15 @@ const Q = "rgba", y = "rgba(255, 255, 255, 1)", ce = /* @__PURE__ */ w({
|
|
|
277
277
|
}
|
|
278
278
|
},
|
|
279
279
|
changePosition(e) {
|
|
280
|
-
const t = this.getGradientRectMetrics(), i = e.clientX - t.left, a = e.clientY - t.top, r =
|
|
280
|
+
const t = this.getGradientRectMetrics(), i = e.clientX - t.left, a = e.clientY - t.top, r = f(i, 0, t.width), h = f(a, 0, t.height), p = Object.assign({}, this.hsva, {
|
|
281
281
|
s: r / t.width,
|
|
282
282
|
v: 1 - h / t.height
|
|
283
283
|
});
|
|
284
284
|
this.handleHsvaChange(p, e, e.event);
|
|
285
285
|
},
|
|
286
286
|
handleHsvaChange(e, t) {
|
|
287
|
-
const i =
|
|
288
|
-
this.currentHsva = e, this.currentBgColor =
|
|
287
|
+
const i = j(e), a = o(i, "hex", this.opacity), r = o(i, "rgba");
|
|
288
|
+
this.currentHsva = e, this.currentBgColor = c(e.h), this.currentRgba = u(i), this.currentHex = a, this.dispatchChangeEvent(i, t, a, r);
|
|
289
289
|
},
|
|
290
290
|
dispatchChangeEvent(e, t, i, a) {
|
|
291
291
|
this.currentValue = e, this.$emit("changemodel", i), this.$emit("update:modelRgbaValue", a), this.$emit("update:modelValue", i), this.$emit("change", {
|
|
@@ -325,7 +325,7 @@ const Q = "rgba", y = "rgba(255, 255, 255, 1)", ce = /* @__PURE__ */ w({
|
|
|
325
325
|
},
|
|
326
326
|
focus() {
|
|
327
327
|
this.focused = !0, setTimeout(() => {
|
|
328
|
-
|
|
328
|
+
D(this.$el);
|
|
329
329
|
}, 1);
|
|
330
330
|
}
|
|
331
331
|
}
|
package/colors/ColorInput.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import { Button as G } from "@progress/kendo-vue-buttons";
|
|
|
11
11
|
import { Label as o } from "@progress/kendo-vue-labels";
|
|
12
12
|
import { provideLocalizationService as B } from "@progress/kendo-vue-intl";
|
|
13
13
|
import { colorGradientHex as c, messages as a, colorGradientInputColorButton as b, colorGradientR as u, colorGradientG as f, colorGradientB as m, colorGradientA as x, colorGradientRLabel as $, colorGradientGLabel as k, colorGradientBLabel as C, colorGradientALabel as I } from "../messages/main.mjs";
|
|
14
|
-
import {
|
|
14
|
+
import { Keys as T, guid as j } from "@progress/kendo-vue-common";
|
|
15
15
|
import { caretAltExpandIcon as A } from "@progress/kendo-svg-icons";
|
|
16
16
|
import { NumericTextBox as l } from "../numerictextbox/NumericTextBox.mjs";
|
|
17
17
|
function r(e) {
|
|
@@ -42,7 +42,7 @@ const s = ["rgba", "rgb", "hex"], q = /* @__PURE__ */ R({
|
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
created() {
|
|
45
|
-
this.hexInputId =
|
|
45
|
+
this.hexInputId = j();
|
|
46
46
|
},
|
|
47
47
|
data() {
|
|
48
48
|
return {
|
|
@@ -206,7 +206,7 @@ const s = ["rgba", "rgb", "hex"], q = /* @__PURE__ */ R({
|
|
|
206
206
|
}
|
|
207
207
|
},
|
|
208
208
|
onKeyDown(e) {
|
|
209
|
-
e.keyCode ===
|
|
209
|
+
e.keyCode === T.enter && e.stopPropagation();
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
});
|
package/colors/ColorPalette.mjs
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { defineComponent as x, createVNode as a } from "vue";
|
|
9
9
|
import { ColorPaletteService as B } from "./utils/color-palette.service.mjs";
|
|
10
|
-
import {
|
|
10
|
+
import { Keys as n, classNames as $, kendoThemeMaps as D, setRef as F, getTabIndex as U, getRef as w, validatePackage as z, guid as L } from "@progress/kendo-vue-common";
|
|
11
11
|
import { packageMetadata as A } from "../package-metadata.mjs";
|
|
12
12
|
import { PALETTEPRESETS as K } from "./models/palette-presets.mjs";
|
|
13
13
|
import { isPresent as M } from "./utils/misc.mjs";
|
|
@@ -51,13 +51,13 @@ const k = 10, O = "office", X = /* @__PURE__ */ x({
|
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
created() {
|
|
54
|
-
|
|
54
|
+
z(A), this.guid = L();
|
|
55
55
|
},
|
|
56
56
|
mounted() {
|
|
57
|
-
this.wrapper =
|
|
57
|
+
this.wrapper = w(this, "wrapper");
|
|
58
58
|
},
|
|
59
59
|
updated() {
|
|
60
|
-
this.wrapper =
|
|
60
|
+
this.wrapper = w(this, "wrapper");
|
|
61
61
|
},
|
|
62
62
|
computed: {
|
|
63
63
|
focusedColorCooridanates() {
|
|
@@ -84,8 +84,8 @@ const k = 10, O = "office", X = /* @__PURE__ */ x({
|
|
|
84
84
|
tileSize: s
|
|
85
85
|
} = this.$props, p = this.getPaletteInfo(), d = this.paletteService = new B();
|
|
86
86
|
d.setColorMatrix(p.colors, p.columns);
|
|
87
|
-
const y = d.getCellCoordsFor(this.selectedColor), f = d.getCellCoordsFor(this.focusedColor), S =
|
|
88
|
-
[`k-colorpalette-${
|
|
87
|
+
const y = d.getCellCoordsFor(this.selectedColor), f = d.getCellCoordsFor(this.focusedColor), S = $("k-colorpalette", {
|
|
88
|
+
[`k-colorpalette-${D.sizeMap[e] || e}`]: e,
|
|
89
89
|
"k-disabled": t
|
|
90
90
|
}, o), V = function(m, r, i, l) {
|
|
91
91
|
const u = i !== void 0 && i.row === r, N = i && i.col, E = l !== void 0 && l.row === r, R = l && l.col, c = typeof s != "number" ? s : {
|
|
@@ -93,7 +93,7 @@ const k = 10, O = "office", X = /* @__PURE__ */ x({
|
|
|
93
93
|
height: s
|
|
94
94
|
}, C = c ? c.width + "px" : void 0, P = c ? c.height + "px" : void 0;
|
|
95
95
|
return m.map(function(g, h) {
|
|
96
|
-
const b = u && N === h, I =
|
|
96
|
+
const b = u && N === h, I = $("k-colorpalette-tile", {
|
|
97
97
|
"k-selected": b,
|
|
98
98
|
"k-focus": E && R === h
|
|
99
99
|
});
|
|
@@ -135,8 +135,8 @@ const k = 10, O = "office", X = /* @__PURE__ */ x({
|
|
|
135
135
|
"aria-labelledby": this.$props.ariaLabelledBy,
|
|
136
136
|
"aria-describedby": this.$props.ariaDescribedBy,
|
|
137
137
|
role: "grid",
|
|
138
|
-
tabindex:
|
|
139
|
-
ref:
|
|
138
|
+
tabindex: U(this.$props.tabIndex, this.$props.disabled),
|
|
139
|
+
ref: F(this, "wrapper")
|
|
140
140
|
}, [a("table", {
|
|
141
141
|
class: "k-colorpalette-table k-palette",
|
|
142
142
|
role: "presentation"
|
package/colors/ColorPicker.mjs
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { defineComponent as A, createVNode as o, isVNode as R, h as I } from "vue";
|
|
9
9
|
import { Button as D } from "@progress/kendo-vue-buttons";
|
|
10
|
-
import {
|
|
10
|
+
import { ADAPTIVE_MEDIUM_BREAKPOINT as M, ADAPTIVE_SMALL_BREAKPOINT as E, getRef as a, Keys as n, getTabIndex as N, classNames as c, Icon as H, getIconName as F, canUseDOM as L, validatePackage as K, guid as p, kendoThemeMaps as h, setRef as _ } from "@progress/kendo-vue-common";
|
|
11
11
|
import { packageMetadata as z } from "../package-metadata.mjs";
|
|
12
12
|
import { Picker as j } from "./Picker.mjs";
|
|
13
13
|
import { FlatColorPicker as x } from "./FlatColorPicker.mjs";
|
|
@@ -150,8 +150,8 @@ const ue = /* @__PURE__ */ A({
|
|
|
150
150
|
},
|
|
151
151
|
adaptiveModeBreakpoints: {
|
|
152
152
|
default: {
|
|
153
|
-
small:
|
|
154
|
-
medium:
|
|
153
|
+
small: E,
|
|
154
|
+
medium: M
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
},
|
|
@@ -188,9 +188,9 @@ const ue = /* @__PURE__ */ A({
|
|
|
188
188
|
"k-picker": !0,
|
|
189
189
|
"k-colorpicker": !0,
|
|
190
190
|
"k-icon-picker": !0,
|
|
191
|
-
[`k-picker-${
|
|
191
|
+
[`k-picker-${h.sizeMap[e] || e}`]: e,
|
|
192
192
|
[`k-picker-${i}`]: i,
|
|
193
|
-
[`k-rounded-${
|
|
193
|
+
[`k-rounded-${h.roundedMap[t] || t}`]: t,
|
|
194
194
|
"k-invalid": !this.valid,
|
|
195
195
|
"k-disabled": this.disabled,
|
|
196
196
|
"k-focus": this.focused
|
|
@@ -211,10 +211,10 @@ const ue = /* @__PURE__ */ A({
|
|
|
211
211
|
}
|
|
212
212
|
},
|
|
213
213
|
created() {
|
|
214
|
-
|
|
214
|
+
K(z), this._popupId = "popup" + p(), this.focusableElementGuid = p();
|
|
215
215
|
},
|
|
216
216
|
mounted() {
|
|
217
|
-
this.observer =
|
|
217
|
+
this.observer = L && window.ResizeObserver && new ResizeObserver(this.calculateMedia), document != null && document.body && this.observer && this.observer.observe(document.body), this.flatcolorpickerRef = a(this, "flatcolorpicker"), this.button = a(this, "button");
|
|
218
218
|
},
|
|
219
219
|
unmounted() {
|
|
220
220
|
var e;
|
|
@@ -265,7 +265,7 @@ const ue = /* @__PURE__ */ A({
|
|
|
265
265
|
"aria-haspopup": "dialog",
|
|
266
266
|
"aria-expanded": this.computedOpen,
|
|
267
267
|
ref: this.focusableElementGuid,
|
|
268
|
-
tabindex:
|
|
268
|
+
tabindex: N(t, i),
|
|
269
269
|
title: this.$props.title,
|
|
270
270
|
onKeydown: this.onButtonKeyDown,
|
|
271
271
|
onFocusin: this.onFocusHandler,
|
|
@@ -274,13 +274,13 @@ const ue = /* @__PURE__ */ A({
|
|
|
274
274
|
onClick: this.onActiveColorClickHandler,
|
|
275
275
|
class: "k-input-inner"
|
|
276
276
|
}, [o("span", {
|
|
277
|
-
class:
|
|
277
|
+
class: c("k-value-icon", "k-color-preview", {
|
|
278
278
|
"k-no-color": !this.computedValue,
|
|
279
279
|
"k-icon-color-preview": this.icon || this.iconClassName
|
|
280
280
|
})
|
|
281
|
-
}, [(this.iconClassName || this.icon || this.svgIcon) && o(
|
|
282
|
-
class:
|
|
283
|
-
name:
|
|
281
|
+
}, [(this.iconClassName || this.icon || this.svgIcon) && o(H, {
|
|
282
|
+
class: c("k-color-preview-icon", this.iconClassName),
|
|
283
|
+
name: F(this.icon),
|
|
284
284
|
icon: this.svgIcon
|
|
285
285
|
}, null), o("span", {
|
|
286
286
|
class: "k-color-preview-mask",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { defineComponent as T, h as n, createVNode as t, isVNode as z } from "vue";
|
|
9
9
|
import { dropletSliderIcon as F, paletteIcon as L, dropletSlashIcon as R } from "@progress/kendo-svg-icons";
|
|
10
|
-
import {
|
|
10
|
+
import { Keys as c, focusContainer as M, focusFirstFocusableChild as G, templateRendering as h, getListeners as p, getTemplate as g, classNames as D, getTabIndex as j, kendoThemeMaps as N, Icon as u, validatePackage as E, setRef as m } from "@progress/kendo-vue-common";
|
|
11
11
|
import { ButtonGroup as O, Button as l } from "@progress/kendo-vue-buttons";
|
|
12
12
|
import { DEFAULT_PRESET as A, ColorPalette as _ } from "./ColorPalette.mjs";
|
|
13
13
|
import { ColorGradient as H } from "./ColorGradient.mjs";
|
|
@@ -90,7 +90,7 @@ const re = /* @__PURE__ */ T({
|
|
|
90
90
|
}
|
|
91
91
|
},
|
|
92
92
|
created() {
|
|
93
|
-
|
|
93
|
+
E(U);
|
|
94
94
|
},
|
|
95
95
|
computed: {
|
|
96
96
|
isColorGradient() {
|
|
@@ -163,13 +163,13 @@ const re = /* @__PURE__ */ T({
|
|
|
163
163
|
});
|
|
164
164
|
};
|
|
165
165
|
return t("div", {
|
|
166
|
-
tabindex:
|
|
166
|
+
tabindex: j(this.$props.tabIndex, this.$props.disabled),
|
|
167
167
|
onFocus: this.onFocus,
|
|
168
168
|
onBlur: this.onBlur,
|
|
169
169
|
onFocusout: this.onFocusout,
|
|
170
170
|
onKeydown: this.onKeyDownHandler,
|
|
171
171
|
class: D("k-flatcolorpicker k-coloreditor", {
|
|
172
|
-
[`k-coloreditor-${
|
|
172
|
+
[`k-coloreditor-${N.sizeMap[e] || e}`]: e,
|
|
173
173
|
"k-disabled": this.$props.disabled
|
|
174
174
|
}),
|
|
175
175
|
"aria-disabled": this.$props.disabled
|
|
@@ -191,7 +191,7 @@ const re = /* @__PURE__ */ T({
|
|
|
191
191
|
size: e,
|
|
192
192
|
onClick: (d) => this.handleViewChange(d, "gradient")
|
|
193
193
|
}, {
|
|
194
|
-
default: () => [t(
|
|
194
|
+
default: () => [t(u, {
|
|
195
195
|
size: e,
|
|
196
196
|
name: "droplet-slider",
|
|
197
197
|
icon: F
|
|
@@ -207,7 +207,7 @@ const re = /* @__PURE__ */ T({
|
|
|
207
207
|
size: e,
|
|
208
208
|
onClick: (d) => this.handleViewChange(d, "palette")
|
|
209
209
|
}, {
|
|
210
|
-
default: () => [t(
|
|
210
|
+
default: () => [t(u, {
|
|
211
211
|
size: e,
|
|
212
212
|
name: "palette",
|
|
213
213
|
icon: L
|
|
@@ -226,7 +226,7 @@ const re = /* @__PURE__ */ T({
|
|
|
226
226
|
onKeydown: this.handleButtonKeydown,
|
|
227
227
|
onClick: this.handleResetColor
|
|
228
228
|
}, {
|
|
229
|
-
default: () => [t(
|
|
229
|
+
default: () => [t(u, {
|
|
230
230
|
size: e,
|
|
231
231
|
name: "droplet-slash",
|
|
232
232
|
icon: R
|
|
@@ -275,12 +275,12 @@ const re = /* @__PURE__ */ T({
|
|
|
275
275
|
methods: {
|
|
276
276
|
focus() {
|
|
277
277
|
this.focused = !0, setTimeout(() => {
|
|
278
|
-
|
|
278
|
+
G(this.$el);
|
|
279
279
|
}, 1);
|
|
280
280
|
},
|
|
281
281
|
onKeyDownHandler(e) {
|
|
282
282
|
const o = this.$el;
|
|
283
|
-
this.focused =
|
|
283
|
+
this.focused = M(e, o), this.$emit("keydown", e);
|
|
284
284
|
},
|
|
285
285
|
handleViewChange(e, o) {
|
|
286
286
|
this.currentView = o, this.$emit("viewchange", {
|
|
@@ -306,13 +306,13 @@ const re = /* @__PURE__ */ T({
|
|
|
306
306
|
});
|
|
307
307
|
},
|
|
308
308
|
innerKeyDown(e) {
|
|
309
|
-
e.keyCode ===
|
|
309
|
+
e.keyCode === c.enter && this.triggerChange(e);
|
|
310
310
|
},
|
|
311
311
|
gradientKeyDown(e) {
|
|
312
|
-
e.stopPropagation(), !this.showButtons && e.keyCode ===
|
|
312
|
+
e.stopPropagation(), !this.showButtons && e.keyCode === c.enter && this.triggerChange(e);
|
|
313
313
|
},
|
|
314
314
|
handleButtonKeydown(e) {
|
|
315
|
-
e.keyCode ===
|
|
315
|
+
e.keyCode === c.enter && e.stopPropagation();
|
|
316
316
|
},
|
|
317
317
|
handleCancelBtnClick() {
|
|
318
318
|
this.colorValue = this.computedPrevColor;
|
|
@@ -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 a=require("@progress/kendo-drawing"),r=require("./misc.js"),p=(t,o,n=!1,s=!0)=>{if(["hex","rgba"].indexOf(o)===-1)throw new Error(`Unsupported color output format '${o}'. The available options are 'hex' or 'rgba'.`);if(!r.isPresent(t))return;const e=a.parseColor(t.trim(),s);if(r.isPresent(e))return o==="hex"?g(e,n):e.toCssRgba()},g=(t,o)=>o&&t.a<1?t.toCss({alpha:!0}):t.toCss(),C=(t,o=!0)=>{const n=a.parseColor(t,o);return r.isPresent(n)?n.toHSV():{}},h=(t,o=!0)=>{const n=a.parseColor(t,o);return r.isPresent(n)?n.toBytes():{}},B=t=>{const o=r.fitIntoBounds(t.h,0,359.9),n=r.fitIntoBounds(t.s,0,1),s=r.fitIntoBounds(t.v,0,1),u=r.fitIntoBounds(t.a,0,1);return a.Color.fromHSV(o,n,s,u).toCssRgba()},I=t=>B({h:t,s:1,v:1,a:1}),R=t=>{const o=r.fitIntoBounds(t.r,0,255),n=r.fitIntoBounds(t.g,0,255),s=r.fitIntoBounds(t.b,0,255),u=r.fitIntoBounds(t.a,0,1);return a.Color.fromBytes(o,n,s,u).toCssRgba()},i=(t,o)=>{const n=r.fitIntoBounds(t.r,0,255),s=r.fitIntoBounds(t.g,0,255),u=r.fitIntoBounds(t.b,0,255),e=r.fitIntoBounds(t.a,0,1),l=r.fitIntoBounds(o.r,0,255),f=r.fitIntoBounds(o.g,0,255),m=r.fitIntoBounds(o.b,0,255);return{r:Math.round((1-e)*l+e*n),g:Math.round((1-e)*f+e*s),b:Math.round((1-e)*m+e*u)}},c=t=>{let o=[t.r,t.g,t.b].map(function(n){return n/=255,n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)});return o[0]*.2126+o[1]*.7152+o[2]*.0722},d=(t,o)=>{const n=Math.max(t,o),s=Math.min(t,o);return(n+.05)/(s+.05)},F=(t,o)=>d(c(i(t,o)),c(i(o,{r:0,g:0,b:0
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@progress/kendo-drawing"),r=require("./misc.js"),p=(t,o,n=!1,s=!0)=>{if(["hex","rgba"].indexOf(o)===-1)throw new Error(`Unsupported color output format '${o}'. The available options are 'hex' or 'rgba'.`);if(!r.isPresent(t))return;const e=a.parseColor(t.trim(),s);if(r.isPresent(e))return o==="hex"?g(e,n):e.toCssRgba()},g=(t,o)=>o&&t.a<1?t.toCss({alpha:!0}):t.toCss(),C=(t,o=!0)=>{const n=a.parseColor(t,o);return r.isPresent(n)?n.toHSV():{}},h=(t,o=!0)=>{const n=a.parseColor(t,o);return r.isPresent(n)?n.toBytes():{}},B=t=>{const o=r.fitIntoBounds(t.h,0,359.9),n=r.fitIntoBounds(t.s,0,1),s=r.fitIntoBounds(t.v,0,1),u=r.fitIntoBounds(t.a,0,1);return a.Color.fromHSV(o,n,s,u).toCssRgba()},I=t=>B({h:t,s:1,v:1,a:1}),R=t=>{const o=r.fitIntoBounds(t.r,0,255),n=r.fitIntoBounds(t.g,0,255),s=r.fitIntoBounds(t.b,0,255),u=r.fitIntoBounds(t.a,0,1);return a.Color.fromBytes(o,n,s,u).toCssRgba()},i=(t,o)=>{const n=r.fitIntoBounds(t.r,0,255),s=r.fitIntoBounds(t.g,0,255),u=r.fitIntoBounds(t.b,0,255),e=r.fitIntoBounds(t.a,0,1),l=r.fitIntoBounds(o.r,0,255),f=r.fitIntoBounds(o.g,0,255),m=r.fitIntoBounds(o.b,0,255);return{r:Math.round((1-e)*l+e*n),g:Math.round((1-e)*f+e*s),b:Math.round((1-e)*m+e*u)}},c=t=>{let o=[t.r,t.g,t.b].map(function(n){return n/=255,n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)});return o[0]*.2126+o[1]*.7152+o[2]*.0722},d=(t,o)=>{const n=Math.max(t,o),s=Math.min(t,o);return(n+.05)/(s+.05)},F=(t,o)=>d(c(i(t,o)),c(i(o,{r:0,g:0,b:0})));exports.getColorFromHSV=B;exports.getColorFromHue=I;exports.getColorFromRGBA=R;exports.getContrast=d;exports.getContrastFromTwoRGBAs=F;exports.getHSV=C;exports.getHexValue=g;exports.getLuminance=c;exports.getRGBA=h;exports.getRGBFromRGBA=i;exports.parseColor=p;
|