@progress/kendo-react-inputs 11.4.0-develop.6 → 11.4.0-develop.7
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/ColorGradient.js +1 -1
- package/colors/ColorGradient.mjs +47 -47
- package/colors/ColorPicker.js +1 -1
- package/colors/ColorPicker.mjs +78 -78
- package/colors/FlatColorPicker.js +1 -1
- package/colors/FlatColorPicker.mjs +125 -125
- package/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/index.d.mts +1 -0
- package/index.d.ts +1 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +11 -11
- package/range-slider/RangeSlider.js +11 -11
- package/range-slider/RangeSlider.mjs +96 -96
- package/signature/Signature.js +1 -1
- package/signature/Signature.mjs +79 -79
package/signature/Signature.mjs
CHANGED
|
@@ -5,67 +5,67 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { SignaturePad as
|
|
8
|
+
import { SignaturePad as Le } from "@progress/kendo-inputs-common";
|
|
9
9
|
import { Button as T } from "@progress/kendo-react-buttons";
|
|
10
|
-
import { createPropsContext as
|
|
11
|
-
import { Dialog as
|
|
12
|
-
import { useLocalization as
|
|
10
|
+
import { createPropsContext as we, validatePackage as Ie, getLicenseMessage as Pe, usePropsContext as De, useIsomorphicLayoutEffect as Te, dispatchEvent as h, classNames as B, kendoThemeMaps as ee, getTabIndex as Be, WatermarkOverlay as Re, noop as f } from "@progress/kendo-react-common";
|
|
11
|
+
import { Dialog as Fe } from "@progress/kendo-react-dialogs";
|
|
12
|
+
import { useLocalization as _e } from "@progress/kendo-react-intl";
|
|
13
13
|
import a from "prop-types";
|
|
14
14
|
import * as o from "react";
|
|
15
15
|
import { signatureMaximize as te, messages as R, signatureMinimize as oe, signatureClear as ne } from "../messages/index.mjs";
|
|
16
|
-
import { packageMetadata as
|
|
17
|
-
import { hasParent as
|
|
18
|
-
import { hyperlinkOpenIcon as
|
|
19
|
-
const
|
|
20
|
-
const
|
|
16
|
+
import { packageMetadata as ae } from "../package-metadata.mjs";
|
|
17
|
+
import { hasParent as Ne } from "./utils/index.mjs";
|
|
18
|
+
import { hyperlinkOpenIcon as re, xIcon as We } from "@progress/kendo-svg-icons";
|
|
19
|
+
const qe = 250, Ge = 84, se = 3, le = 2, Ae = "#000000", Ve = "#ffffff", ie = (d) => d !== void 0, je = we(), F = o.forwardRef((d, ce) => {
|
|
20
|
+
const ue = !Ie(ae, { component: "Signature" }), de = Pe(ae), _ = De(je, d), e = o.useMemo(
|
|
21
21
|
() => ({
|
|
22
|
-
strokeWidth:
|
|
23
|
-
smooth:
|
|
24
|
-
popupScale:
|
|
25
|
-
exportScale:
|
|
26
|
-
maximizable:
|
|
27
|
-
disabled:
|
|
28
|
-
required:
|
|
29
|
-
validityStyles:
|
|
30
|
-
onChange:
|
|
31
|
-
onFocus:
|
|
32
|
-
onBlur:
|
|
33
|
-
onOpen:
|
|
34
|
-
onClose:
|
|
35
|
-
size:
|
|
36
|
-
rounded:
|
|
37
|
-
fillMode:
|
|
22
|
+
strokeWidth: s.strokeWidth,
|
|
23
|
+
smooth: s.smooth,
|
|
24
|
+
popupScale: s.popupScale,
|
|
25
|
+
exportScale: s.exportScale,
|
|
26
|
+
maximizable: s.maximizable,
|
|
27
|
+
disabled: s.disabled,
|
|
28
|
+
required: s.required,
|
|
29
|
+
validityStyles: s.validityStyles,
|
|
30
|
+
onChange: s.onChange,
|
|
31
|
+
onFocus: s.onFocus,
|
|
32
|
+
onBlur: s.onBlur,
|
|
33
|
+
onOpen: s.onOpen,
|
|
34
|
+
onClose: s.onClose,
|
|
35
|
+
size: s.size,
|
|
36
|
+
rounded: s.rounded,
|
|
37
|
+
fillMode: s.fillMode,
|
|
38
38
|
..._
|
|
39
39
|
}),
|
|
40
40
|
[_]
|
|
41
|
-
), z =
|
|
41
|
+
), z = _e(), c = o.useRef(null), g = o.useRef(null), N = o.useRef(null), W = o.useRef(null), S = o.useRef(null), [r, me] = o.useState(), [b, q] = o.useState(!1), [E, G] = o.useState(!1), [k, A] = o.useState(), [pe, fe] = o.useState(), V = ie(e.value) ? e.value : k, [ge, be] = o.useState(!1), p = ie(e.open), m = p ? e.open : ge, ke = e.maximized || E || !e.maximizable || e.disabled, ye = !(e.maximized && !E), ve = !(!(e.value || k) || E || e.readOnly || e.disabled), j = z.toLanguageString(te, R[te]), U = z.toLanguageString(oe, R[oe]), H = z.toLanguageString(ne, R[ne]), O = e.popupScale || se, x = e.exportScale || le, M = (t) => {
|
|
42
42
|
A(t), e.onChange && e.onChange({ value: t });
|
|
43
|
-
},
|
|
43
|
+
}, Ce = (t) => {
|
|
44
44
|
r == null || r.loadImage(t.value), M(t.value);
|
|
45
45
|
};
|
|
46
46
|
o.useEffect(() => {
|
|
47
47
|
e.value !== k && (A(e.value), r == null || r.loadImage(e.value));
|
|
48
48
|
}, [e.value]);
|
|
49
|
-
const
|
|
49
|
+
const he = () => {
|
|
50
50
|
r == null || r.clear(), M();
|
|
51
51
|
}, y = o.useCallback(
|
|
52
52
|
(t) => {
|
|
53
|
-
p ||
|
|
53
|
+
p || be(t);
|
|
54
54
|
},
|
|
55
55
|
[p]
|
|
56
|
-
),
|
|
56
|
+
), ze = (t) => {
|
|
57
57
|
var n, i;
|
|
58
58
|
Q(t), (i = ((n = S.current) == null ? void 0 : n.element) || g.current) == null || i.focus();
|
|
59
|
-
},
|
|
60
|
-
let t =
|
|
59
|
+
}, L = o.useCallback(() => {
|
|
60
|
+
let t = Ae;
|
|
61
61
|
return !e.color && typeof document != "undefined" && c.current && (t = getComputedStyle(c.current).color), e.color || t;
|
|
62
|
-
}, [e.color]),
|
|
63
|
-
let t =
|
|
62
|
+
}, [e.color]), w = o.useCallback(() => {
|
|
63
|
+
let t = Ve;
|
|
64
64
|
return !e.backgroundColor && typeof document != "undefined" && c.current && (t = getComputedStyle(c.current).backgroundColor), e.backgroundColor || t;
|
|
65
65
|
}, [e.backgroundColor]), $ = () => ({
|
|
66
66
|
scale: e.maximized ? e.popupScale : 1,
|
|
67
|
-
color:
|
|
68
|
-
backgroundColor:
|
|
67
|
+
color: L(),
|
|
68
|
+
backgroundColor: w(),
|
|
69
69
|
strokeWidth: e.strokeWidth,
|
|
70
70
|
smooth: e.smooth,
|
|
71
71
|
readonly: e.readOnly
|
|
@@ -77,20 +77,20 @@ const Ne = 250, We = 84, ie = 3, le = 2, qe = "#000000", Ge = "#ffffff", re = (d
|
|
|
77
77
|
}));
|
|
78
78
|
};
|
|
79
79
|
o.useEffect(() => {
|
|
80
|
-
const t = g.current, n = new
|
|
81
|
-
return V && n.loadImage(V),
|
|
80
|
+
const t = g.current, n = new Le(t, $());
|
|
81
|
+
return V && n.loadImage(V), me(n), () => n.destroy();
|
|
82
82
|
}, []), o.useEffect(() => {
|
|
83
83
|
r == null || r.setOptions({
|
|
84
84
|
onChange: async () => M(await K(Y())),
|
|
85
85
|
onDraw: () => G(!0),
|
|
86
86
|
onDrawEnd: () => G(!1)
|
|
87
87
|
});
|
|
88
|
-
}, [r]),
|
|
88
|
+
}, [r]), Te(
|
|
89
89
|
() => r == null ? void 0 : r.setOptions($()),
|
|
90
90
|
[e.readOnly, e.color, e.backgroundColor, e.strokeWidth, e.smooth]
|
|
91
91
|
), o.useEffect(() => {
|
|
92
|
-
var i,
|
|
93
|
-
const t = (
|
|
92
|
+
var i, l;
|
|
93
|
+
const t = (l = (i = N.current) == null ? void 0 : i.element) == null ? void 0 : l.querySelector(".k-overlay");
|
|
94
94
|
if (!t)
|
|
95
95
|
return;
|
|
96
96
|
const n = () => y(!1);
|
|
@@ -99,8 +99,8 @@ const Ne = 250, We = 84, ie = 3, le = 2, qe = "#000000", Ge = "#ffffff", re = (d
|
|
|
99
99
|
if (!m || typeof document == "undefined")
|
|
100
100
|
return;
|
|
101
101
|
const t = (n) => {
|
|
102
|
-
var i,
|
|
103
|
-
n.key === "Escape" && (y(!1), (
|
|
102
|
+
var i, l;
|
|
103
|
+
n.key === "Escape" && (y(!1), (l = (i = S.current) == null ? void 0 : i.element) == null || l.focus());
|
|
104
104
|
};
|
|
105
105
|
return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
|
|
106
106
|
}, [m]), o.useEffect(() => {
|
|
@@ -111,10 +111,10 @@ const Ne = 250, We = 84, ie = 3, le = 2, qe = "#000000", Ge = "#ffffff", re = (d
|
|
|
111
111
|
var t;
|
|
112
112
|
return (t = g.current) == null ? void 0 : t.focus();
|
|
113
113
|
}, []), v = o.useCallback(() => e.value, [e.value]), X = o.useCallback(() => e.name, [e.name]), C = o.useCallback(() => e.required, [e.required]), P = o.useCallback(() => {
|
|
114
|
-
const t = e.validationMessage !== void 0, i = !v(),
|
|
114
|
+
const t = e.validationMessage !== void 0, i = !v(), l = e.valid !== void 0 ? e.valid : !C() || !i;
|
|
115
115
|
return {
|
|
116
116
|
customError: t,
|
|
117
|
-
valid:
|
|
117
|
+
valid: l,
|
|
118
118
|
valueMissing: i
|
|
119
119
|
};
|
|
120
120
|
}, [e.validationMessage, e.valid, v, C]), D = o.useCallback(() => e.validityStyles, [e.validityStyles]), J = o.useCallback(() => e, [e]), u = o.useCallback(() => {
|
|
@@ -122,7 +122,7 @@ const Ne = 250, We = 84, ie = 3, le = 2, qe = "#000000", Ge = "#ffffff", re = (d
|
|
|
122
122
|
element: c.current,
|
|
123
123
|
focus: I
|
|
124
124
|
};
|
|
125
|
-
return Object.defineProperty(t, "name", { get: X }), Object.defineProperty(t, "value", { get: v }), Object.defineProperty(t, "validity", { get: P }), Object.defineProperty(t, "validityStyles", { get: D }), Object.defineProperty(t, "required", { get: C }), Object.defineProperty(t, "props", { get: J }), Object.defineProperty(t, "color", { get:
|
|
125
|
+
return Object.defineProperty(t, "name", { get: X }), Object.defineProperty(t, "value", { get: v }), Object.defineProperty(t, "validity", { get: P }), Object.defineProperty(t, "validityStyles", { get: D }), Object.defineProperty(t, "required", { get: C }), Object.defineProperty(t, "props", { get: J }), Object.defineProperty(t, "color", { get: L }), Object.defineProperty(t, "backgroundColor", { get: w }), t;
|
|
126
126
|
}, [
|
|
127
127
|
X,
|
|
128
128
|
v,
|
|
@@ -131,23 +131,23 @@ const Ne = 250, We = 84, ie = 3, le = 2, qe = "#000000", Ge = "#ffffff", re = (d
|
|
|
131
131
|
C,
|
|
132
132
|
I,
|
|
133
133
|
J,
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
L,
|
|
135
|
+
w
|
|
136
136
|
]);
|
|
137
|
-
o.useImperativeHandle(
|
|
138
|
-
const
|
|
137
|
+
o.useImperativeHandle(ce, u);
|
|
138
|
+
const Se = o.useCallback(
|
|
139
139
|
(t) => {
|
|
140
140
|
b || e.maximized || (q(!0), h(e.onFocus, t, u(), {}));
|
|
141
141
|
},
|
|
142
142
|
[b, e.onFocus, u]
|
|
143
|
-
),
|
|
143
|
+
), Ee = o.useCallback(
|
|
144
144
|
(t) => {
|
|
145
|
-
|
|
145
|
+
Ne(t.relatedTarget, c.current) || (q(!1), h(e.onBlur, t, u(), {}));
|
|
146
146
|
},
|
|
147
147
|
[b, e.onBlur, u]
|
|
148
|
-
),
|
|
148
|
+
), Oe = o.useCallback(
|
|
149
149
|
async (t) => {
|
|
150
|
-
|
|
150
|
+
fe(await K(Z())), y(!0), h(e.onOpen, t, u(), {});
|
|
151
151
|
},
|
|
152
152
|
[m, p, e.onOpen, e.value, k, u]
|
|
153
153
|
), Q = o.useCallback(
|
|
@@ -155,11 +155,11 @@ const Ne = 250, We = 84, ie = 3, le = 2, qe = "#000000", Ge = "#ffffff", re = (d
|
|
|
155
155
|
y(!1), h(e.onClose, t, u(), {});
|
|
156
156
|
},
|
|
157
157
|
[m, p, e.onClose, u]
|
|
158
|
-
),
|
|
159
|
-
|
|
158
|
+
), xe = () => {
|
|
159
|
+
he(), I();
|
|
160
160
|
}, Y = () => {
|
|
161
|
-
var i,
|
|
162
|
-
const t = e.width || ((i = c.current) == null ? void 0 : i.offsetWidth) ||
|
|
161
|
+
var i, l;
|
|
162
|
+
const t = e.width || ((i = c.current) == null ? void 0 : i.offsetWidth) || qe, n = e.height || ((l = c.current) == null ? void 0 : l.offsetHeight) || Ge;
|
|
163
163
|
return {
|
|
164
164
|
width: t,
|
|
165
165
|
height: n
|
|
@@ -170,7 +170,7 @@ const Ne = 250, We = 84, ie = 3, le = 2, qe = "#000000", Ge = "#ffffff", re = (d
|
|
|
170
170
|
width: t * O,
|
|
171
171
|
height: n * O
|
|
172
172
|
};
|
|
173
|
-
},
|
|
173
|
+
}, Me = !D() || P().valid;
|
|
174
174
|
return /* @__PURE__ */ o.createElement(
|
|
175
175
|
"div",
|
|
176
176
|
{
|
|
@@ -186,22 +186,22 @@ const Ne = 250, We = 84, ie = 3, le = 2, qe = "#000000", Ge = "#ffffff", re = (d
|
|
|
186
186
|
[`k-signature-${e.fillMode}`]: e.fillMode,
|
|
187
187
|
[`k-input-${e.fillMode}`]: e.fillMode,
|
|
188
188
|
[`k-rounded-${ee.roundedMap[e.rounded] || e.rounded}`]: e.rounded,
|
|
189
|
-
"k-invalid": !
|
|
189
|
+
"k-invalid": !Me,
|
|
190
190
|
"k-required": e.required,
|
|
191
191
|
"k-disabled": e.disabled,
|
|
192
192
|
"k-focus": b
|
|
193
193
|
},
|
|
194
194
|
e.className
|
|
195
195
|
),
|
|
196
|
-
onFocus:
|
|
197
|
-
onBlur:
|
|
196
|
+
onFocus: Se,
|
|
197
|
+
onBlur: Ee
|
|
198
198
|
},
|
|
199
199
|
/* @__PURE__ */ o.createElement(
|
|
200
200
|
"div",
|
|
201
201
|
{
|
|
202
202
|
className: "k-signature-canvas",
|
|
203
203
|
ref: g,
|
|
204
|
-
tabIndex:
|
|
204
|
+
tabIndex: Be(e.tabIndex, e.disabled),
|
|
205
205
|
role: "img",
|
|
206
206
|
id: e.id,
|
|
207
207
|
"aria-label": e.ariaLabel,
|
|
@@ -215,14 +215,14 @@ const Ne = 250, We = 84, ie = 3, le = 2, qe = "#000000", Ge = "#ffffff", re = (d
|
|
|
215
215
|
{
|
|
216
216
|
type: "button",
|
|
217
217
|
className: B("k-signature-action", "k-signature-maximize", {
|
|
218
|
-
"k-hidden": e.disabled ||
|
|
218
|
+
"k-hidden": e.disabled || ke
|
|
219
219
|
}),
|
|
220
220
|
ref: S,
|
|
221
221
|
icon: "hyperlink-open",
|
|
222
|
-
svgIcon:
|
|
222
|
+
svgIcon: re,
|
|
223
223
|
fillMode: "flat",
|
|
224
224
|
size: e.size,
|
|
225
|
-
onClick:
|
|
225
|
+
onClick: Oe,
|
|
226
226
|
"aria-label": j,
|
|
227
227
|
title: j
|
|
228
228
|
}
|
|
@@ -231,11 +231,11 @@ const Ne = 250, We = 84, ie = 3, le = 2, qe = "#000000", Ge = "#ffffff", re = (d
|
|
|
231
231
|
{
|
|
232
232
|
type: "button",
|
|
233
233
|
className: B("k-signature-action", "k-signature-minimize", "k-rotate-180", {
|
|
234
|
-
"k-hidden": e.disabled ||
|
|
234
|
+
"k-hidden": e.disabled || ye
|
|
235
235
|
}),
|
|
236
236
|
ref: W,
|
|
237
237
|
icon: "hyperlink-open",
|
|
238
|
-
svgIcon:
|
|
238
|
+
svgIcon: re,
|
|
239
239
|
fillMode: "flat",
|
|
240
240
|
size: e.size,
|
|
241
241
|
onClick: Q,
|
|
@@ -244,34 +244,34 @@ const Ne = 250, We = 84, ie = 3, le = 2, qe = "#000000", Ge = "#ffffff", re = (d
|
|
|
244
244
|
}
|
|
245
245
|
)),
|
|
246
246
|
!e.hideLine && /* @__PURE__ */ o.createElement("div", { className: "k-signature-line", style: { zIndex: 2, pointerEvents: "none" } }),
|
|
247
|
-
/* @__PURE__ */ o.createElement("div", { className: "k-signature-actions k-signature-actions-bottom" },
|
|
247
|
+
/* @__PURE__ */ o.createElement("div", { className: "k-signature-actions k-signature-actions-bottom" }, ve && /* @__PURE__ */ o.createElement(
|
|
248
248
|
T,
|
|
249
249
|
{
|
|
250
250
|
type: "button",
|
|
251
251
|
className: "k-signature-action k-signature-clear",
|
|
252
252
|
icon: "x",
|
|
253
|
-
svgIcon:
|
|
253
|
+
svgIcon: We,
|
|
254
254
|
fillMode: "flat",
|
|
255
255
|
size: e.size,
|
|
256
|
-
onClick:
|
|
256
|
+
onClick: xe,
|
|
257
257
|
"aria-label": H,
|
|
258
258
|
title: H
|
|
259
259
|
}
|
|
260
260
|
)),
|
|
261
|
-
m && /* @__PURE__ */ o.createElement(
|
|
261
|
+
m && /* @__PURE__ */ o.createElement(Fe, { ref: N }, /* @__PURE__ */ o.createElement(
|
|
262
262
|
F,
|
|
263
263
|
{
|
|
264
264
|
...e,
|
|
265
265
|
...Z(),
|
|
266
|
-
value:
|
|
266
|
+
value: pe,
|
|
267
267
|
maximized: !0,
|
|
268
268
|
exportScale: 1 / O * x,
|
|
269
269
|
open: !1,
|
|
270
|
-
onChange:
|
|
271
|
-
onClose:
|
|
270
|
+
onChange: Ce,
|
|
271
|
+
onClose: ze
|
|
272
272
|
}
|
|
273
273
|
)),
|
|
274
|
-
|
|
274
|
+
ue && /* @__PURE__ */ o.createElement(Re, { message: de })
|
|
275
275
|
);
|
|
276
276
|
});
|
|
277
277
|
F.propTypes = {
|
|
@@ -296,10 +296,10 @@ F.propTypes = {
|
|
|
296
296
|
rounded: a.oneOf([null, "small", "medium", "large"]),
|
|
297
297
|
fillMode: a.oneOf([null, "solid", "flat", "outline"])
|
|
298
298
|
};
|
|
299
|
-
const
|
|
299
|
+
const s = {
|
|
300
300
|
strokeWidth: 1,
|
|
301
301
|
smooth: !1,
|
|
302
|
-
popupScale:
|
|
302
|
+
popupScale: se,
|
|
303
303
|
exportScale: le,
|
|
304
304
|
maximizable: !0,
|
|
305
305
|
disabled: !1,
|
|
@@ -317,5 +317,5 @@ const l = {
|
|
|
317
317
|
F.displayName = "KendoSignature";
|
|
318
318
|
export {
|
|
319
319
|
F as Signature,
|
|
320
|
-
|
|
320
|
+
je as SignaturePropsContext
|
|
321
321
|
};
|