@progress/kendo-react-inputs 13.4.0-develop.2 → 13.4.0-develop.4
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.js +1 -1
- package/checkbox/Checkbox.mjs +23 -23
- package/checkbox/interfaces/CheckboxProps.d.ts +1 -1
- package/colors/ColorGradient.mjs +4 -4
- package/colors/ColorInput.d.ts +1 -1
- package/colors/ColorPicker.js +1 -1
- package/colors/ColorPicker.mjs +12 -12
- package/colors/FlatColorPicker.d.ts +1 -1
- package/colors/FlatColorPicker.mjs +11 -11
- package/colors/HexInput.d.ts +1 -1
- package/colors/interfaces/ColorGradientProps.d.ts +1 -1
- package/colors/interfaces/ColorPickerProps.d.ts +1 -1
- package/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/index.d.mts +1 -1
- package/index.d.ts +1 -1
- package/input/Input.mjs +13 -13
- package/maskedtextbox/MaskedTextBox.d.ts +1 -1
- package/maskedtextbox/MaskedTextBox.js +1 -1
- package/maskedtextbox/MaskedTextBox.mjs +15 -15
- package/maskedtextbox/MaskedTextBoxProps.d.ts +1 -1
- package/numerictextbox/NumericTextBox.js +1 -1
- package/numerictextbox/NumericTextBox.mjs +40 -40
- package/numerictextbox/interfaces/NumericTextBoxProps.d.ts +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +1 -1
- package/package.json +10 -10
- package/radiobutton/RadioButton.mjs +18 -18
- package/radiobutton/RadioGroup.mjs +15 -15
- package/range-slider/RangeSlider.mjs +15 -15
- package/rating/Rating.mjs +12 -12
- package/rating/RatingItem.mjs +4 -4
- package/signature/Signature.js +1 -1
- package/signature/Signature.mjs +13 -13
- package/signature/interfaces/SignatureProps.d.ts +1 -1
- package/slider/Slider.d.ts +12 -78
- package/slider/Slider.js +1 -1
- package/slider/Slider.mjs +241 -191
- package/switch/Switch.d.ts +11 -126
- package/switch/Switch.js +1 -1
- package/switch/Switch.mjs +187 -209
- package/textarea/TextArea.js +1 -1
- package/textarea/TextArea.mjs +21 -21
- package/textarea/interfaces/TextAreaProps.d.ts +1 -1
- package/textbox/Textbox.d.ts +2 -1
- package/textbox/Textbox.js +1 -1
- package/textbox/Textbox.mjs +19 -19
|
@@ -7,16 +7,16 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as e from "react";
|
|
9
9
|
import a from "prop-types";
|
|
10
|
-
import { createPropsContext as
|
|
11
|
-
const
|
|
12
|
-
const I =
|
|
10
|
+
import { createPropsContext as S, usePropsContext as U, useUnstyled as A, useId as G, dispatchEvent as d, getTabIndex as J, classNames as m, uRadioButton as b } from "@progress/kendo-react-common";
|
|
11
|
+
const M = S(), x = e.forwardRef((E, F) => {
|
|
12
|
+
const I = U(M, E), {
|
|
13
13
|
ariaDescribedBy: P,
|
|
14
14
|
checked: p,
|
|
15
15
|
children: f,
|
|
16
16
|
className: k,
|
|
17
17
|
disabled: n,
|
|
18
18
|
id: g,
|
|
19
|
-
size: N =
|
|
19
|
+
size: N = Q.size,
|
|
20
20
|
label: o,
|
|
21
21
|
labelPlacement: z,
|
|
22
22
|
name: T,
|
|
@@ -28,8 +28,8 @@ const Q = U(), x = e.forwardRef((E, F) => {
|
|
|
28
28
|
onFocus: c,
|
|
29
29
|
onBlur: i,
|
|
30
30
|
required: H,
|
|
31
|
-
...
|
|
32
|
-
} = I, y =
|
|
31
|
+
..._
|
|
32
|
+
} = I, y = A(), u = y && y.uRadioButton, l = e.useRef(null), C = e.useCallback(() => {
|
|
33
33
|
l.current && l.current.focus();
|
|
34
34
|
}, []), s = e.useCallback(
|
|
35
35
|
() => ({
|
|
@@ -39,14 +39,14 @@ const Q = U(), x = e.forwardRef((E, F) => {
|
|
|
39
39
|
[C]
|
|
40
40
|
);
|
|
41
41
|
e.useImperativeHandle(F, s);
|
|
42
|
-
const v =
|
|
42
|
+
const v = G(), j = e.useCallback(
|
|
43
43
|
(t) => {
|
|
44
44
|
d(h, t, s(), {
|
|
45
45
|
value: r
|
|
46
46
|
});
|
|
47
47
|
},
|
|
48
48
|
[h, r, n]
|
|
49
|
-
),
|
|
49
|
+
), K = e.useCallback(
|
|
50
50
|
(t) => {
|
|
51
51
|
c && !n && d(
|
|
52
52
|
c,
|
|
@@ -56,12 +56,12 @@ const Q = U(), x = e.forwardRef((E, F) => {
|
|
|
56
56
|
);
|
|
57
57
|
},
|
|
58
58
|
[c, n]
|
|
59
|
-
),
|
|
59
|
+
), L = e.useCallback(
|
|
60
60
|
(t) => {
|
|
61
61
|
i && !n && d(i, t, s(), void 0);
|
|
62
62
|
},
|
|
63
63
|
[i, n]
|
|
64
|
-
),
|
|
64
|
+
), O = {
|
|
65
65
|
type: "radio",
|
|
66
66
|
id: g || v,
|
|
67
67
|
name: T,
|
|
@@ -76,16 +76,16 @@ const Q = U(), x = e.forwardRef((E, F) => {
|
|
|
76
76
|
),
|
|
77
77
|
ref: l,
|
|
78
78
|
disabled: n,
|
|
79
|
-
tabIndex:
|
|
79
|
+
tabIndex: J(w, n),
|
|
80
80
|
checked: p,
|
|
81
81
|
style: q,
|
|
82
82
|
"aria-describedby": P,
|
|
83
83
|
"aria-required": H,
|
|
84
84
|
value: r,
|
|
85
|
-
onChange:
|
|
86
|
-
onFocus:
|
|
87
|
-
onBlur:
|
|
88
|
-
...
|
|
85
|
+
onChange: j,
|
|
86
|
+
onFocus: K,
|
|
87
|
+
onBlur: L,
|
|
88
|
+
..._
|
|
89
89
|
}, B = /* @__PURE__ */ e.createElement(e.Fragment, null, o !== void 0 ? /* @__PURE__ */ e.createElement(
|
|
90
90
|
"label",
|
|
91
91
|
{
|
|
@@ -95,7 +95,7 @@ const Q = U(), x = e.forwardRef((E, F) => {
|
|
|
95
95
|
"aria-label": o
|
|
96
96
|
},
|
|
97
97
|
o
|
|
98
|
-
) : null), R = /* @__PURE__ */ e.createElement("span", { className: m(b.wrap({ c: u })) }, /* @__PURE__ */ e.createElement("input", { ...
|
|
98
|
+
) : null), R = /* @__PURE__ */ e.createElement("span", { className: m(b.wrap({ c: u })) }, /* @__PURE__ */ e.createElement("input", { ...O }));
|
|
99
99
|
return z === "before" ? /* @__PURE__ */ e.createElement(e.Fragment, null, B, R, f) : /* @__PURE__ */ e.createElement(e.Fragment, null, R, B, f);
|
|
100
100
|
});
|
|
101
101
|
x.propTypes = {
|
|
@@ -116,11 +116,11 @@ x.propTypes = {
|
|
|
116
116
|
onFocus: a.func,
|
|
117
117
|
onBlur: a.func
|
|
118
118
|
};
|
|
119
|
-
const
|
|
119
|
+
const Q = {
|
|
120
120
|
size: void 0
|
|
121
121
|
};
|
|
122
122
|
x.displayName = "KendoRadioButton";
|
|
123
123
|
export {
|
|
124
124
|
x as RadioButton,
|
|
125
|
-
|
|
125
|
+
M as RadioButtonPropsContext
|
|
126
126
|
};
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as t from "react";
|
|
9
9
|
import e from "prop-types";
|
|
10
|
-
import { RadioButton as
|
|
11
|
-
import { createPropsContext as
|
|
12
|
-
const
|
|
13
|
-
const m =
|
|
10
|
+
import { RadioButton as A } from "./RadioButton.mjs";
|
|
11
|
+
import { createPropsContext as J, usePropsContext as M, useUnstyled as Q, focusFirstFocusableChild as W, dispatchEvent as k, useId as X, classNames as P, uRadioGroup as E, useRtl as Y } from "@progress/kendo-react-common";
|
|
12
|
+
const Z = J(), G = t.forwardRef((r, I) => {
|
|
13
|
+
const m = M(Z, r), {
|
|
14
14
|
id: N,
|
|
15
15
|
ariaLabelledBy: B,
|
|
16
16
|
ariaDescribedBy: F,
|
|
@@ -27,8 +27,8 @@ const _ = M(), G = t.forwardRef((r, I) => {
|
|
|
27
27
|
item: D = $.item,
|
|
28
28
|
onChange: c,
|
|
29
29
|
onFocus: d
|
|
30
|
-
} = m, f =
|
|
31
|
-
o.current &&
|
|
30
|
+
} = m, f = Q(), y = f && f.uRadioGroup, o = t.useRef(null), C = t.useCallback(() => {
|
|
31
|
+
o.current && W(o.current);
|
|
32
32
|
}, []), i = t.useCallback(
|
|
33
33
|
() => ({
|
|
34
34
|
element: o.current,
|
|
@@ -58,21 +58,21 @@ const _ = M(), G = t.forwardRef((r, I) => {
|
|
|
58
58
|
);
|
|
59
59
|
},
|
|
60
60
|
[d, s]
|
|
61
|
-
), T =
|
|
61
|
+
), T = X(), _ = P(
|
|
62
62
|
E.ul({
|
|
63
63
|
c: y,
|
|
64
64
|
horizontal: n === "horizontal",
|
|
65
65
|
vertical: n === "vertical" || n === void 0
|
|
66
66
|
}),
|
|
67
67
|
x
|
|
68
|
-
),
|
|
69
|
-
const g = u === a.value,
|
|
68
|
+
), w = Y(o, m.dir), K = b && b.map((a, l) => {
|
|
69
|
+
const g = u === a.value, U = u == null, R = {
|
|
70
70
|
...a,
|
|
71
71
|
valid: z,
|
|
72
72
|
checked: g,
|
|
73
73
|
disabled: !!(a.disabled || s),
|
|
74
74
|
labelPlacement: a.labelPlacement ? a.labelPlacement : j,
|
|
75
|
-
tabIndex: a.tabIndex ? a.tabIndex :
|
|
75
|
+
tabIndex: a.tabIndex ? a.tabIndex : U && l === 0 || g ? 0 : -1,
|
|
76
76
|
index: l,
|
|
77
77
|
name: O || T,
|
|
78
78
|
required: a.required,
|
|
@@ -91,7 +91,7 @@ const _ = M(), G = t.forwardRef((r, I) => {
|
|
|
91
91
|
key: l,
|
|
92
92
|
role: "none"
|
|
93
93
|
},
|
|
94
|
-
/* @__PURE__ */ t.createElement(
|
|
94
|
+
/* @__PURE__ */ t.createElement(A, { ...R })
|
|
95
95
|
);
|
|
96
96
|
});
|
|
97
97
|
return /* @__PURE__ */ t.createElement(
|
|
@@ -99,14 +99,14 @@ const _ = M(), G = t.forwardRef((r, I) => {
|
|
|
99
99
|
{
|
|
100
100
|
id: N,
|
|
101
101
|
role: "radiogroup",
|
|
102
|
-
className:
|
|
102
|
+
className: _,
|
|
103
103
|
ref: o,
|
|
104
|
-
dir:
|
|
104
|
+
dir: w,
|
|
105
105
|
style: q,
|
|
106
106
|
"aria-labelledby": B,
|
|
107
107
|
"aria-describedby": F
|
|
108
108
|
},
|
|
109
|
-
|
|
109
|
+
K
|
|
110
110
|
);
|
|
111
111
|
}), $ = {
|
|
112
112
|
item: (r) => /* @__PURE__ */ t.createElement("li", { ...r })
|
|
@@ -130,5 +130,5 @@ G.propTypes = {
|
|
|
130
130
|
G.displayName = "KendoRadioGroup";
|
|
131
131
|
export {
|
|
132
132
|
G as RadioGroup,
|
|
133
|
-
|
|
133
|
+
Z as RadioGroupPropsContext
|
|
134
134
|
};
|
|
@@ -59,18 +59,18 @@ const se = (n, s, p) => {
|
|
|
59
59
|
state: e.value
|
|
60
60
|
},
|
|
61
61
|
W
|
|
62
|
-
), d = a.useMemo(() => e.value || x, [e.value, x]),
|
|
62
|
+
), d = a.useMemo(() => e.value || x, [e.value, x]), _ = a.useRef(null), R = a.useRef(null), h = a.useMemo(() => (d.start - g) / (k - g) * 100, [d.start, g, k]), D = a.useMemo(() => (d.end - g) / (k - g) * 100, [d.end, g, k]), q = a.useMemo(
|
|
63
63
|
() => e.vertical ? { paddingTop: 0, height: "100%" } : {},
|
|
64
64
|
[e.vertical]
|
|
65
|
-
),
|
|
65
|
+
), B = a.useMemo(
|
|
66
66
|
() => e.vertical ? { marginTop: "0.5rem", marginBottom: "0.5rem" } : { marginLeft: "0.5rem", marginRight: "0.5rem" },
|
|
67
67
|
[e.vertical]
|
|
68
68
|
), M = ne(), C = a.useCallback(
|
|
69
69
|
(t) => {
|
|
70
70
|
if (!R.current)
|
|
71
71
|
return;
|
|
72
|
-
const u = R.current.getBoundingClientRect(), v = e.vertical ? u.bottom - t.clientY : o === "rtl" ? u.right - t.clientX : t.clientX - u.left, I = e.vertical ? u.height : u.width,
|
|
73
|
-
return g +
|
|
72
|
+
const u = R.current.getBoundingClientRect(), v = e.vertical ? u.bottom - t.clientY : o === "rtl" ? u.right - t.clientX : t.clientX - u.left, I = e.vertical ? u.height : u.width, Y = v / I;
|
|
73
|
+
return g + Y * (k - g);
|
|
74
74
|
},
|
|
75
75
|
[
|
|
76
76
|
R,
|
|
@@ -83,10 +83,10 @@ const se = (n, s, p) => {
|
|
|
83
83
|
e.value && e.value.start,
|
|
84
84
|
e.value && e.value.end
|
|
85
85
|
]
|
|
86
|
-
),
|
|
86
|
+
), G = a.useCallback(
|
|
87
87
|
(t) => t <= d.start ? "start" : t >= d.end ? "end" : 2 * t < d.end + d.start ? "start" : "end",
|
|
88
88
|
[x.start, x.end, e.value && e.value.start, e.value && e.value.end]
|
|
89
|
-
),
|
|
89
|
+
), U = a.useCallback(
|
|
90
90
|
(t) => {
|
|
91
91
|
switch (t.keyCode) {
|
|
92
92
|
case m.right:
|
|
@@ -132,7 +132,7 @@ const se = (n, s, p) => {
|
|
|
132
132
|
}
|
|
133
133
|
},
|
|
134
134
|
[l]
|
|
135
|
-
),
|
|
135
|
+
), X = a.useCallback(
|
|
136
136
|
(t) => {
|
|
137
137
|
switch (t.keyCode) {
|
|
138
138
|
case m.right:
|
|
@@ -178,9 +178,9 @@ const se = (n, s, p) => {
|
|
|
178
178
|
}
|
|
179
179
|
},
|
|
180
180
|
[l, o]
|
|
181
|
-
),
|
|
181
|
+
), F = a.useCallback(
|
|
182
182
|
(t) => {
|
|
183
|
-
const u = C(t), v =
|
|
183
|
+
const u = C(t), v = G(u);
|
|
184
184
|
L(v), v === "end" ? T.current.focus() : w.current.focus();
|
|
185
185
|
const I = v === "end" ? r.end : r.start;
|
|
186
186
|
l({ type: I, payload: u, event: t });
|
|
@@ -190,7 +190,7 @@ const se = (n, s, p) => {
|
|
|
190
190
|
return te(
|
|
191
191
|
R,
|
|
192
192
|
{
|
|
193
|
-
onPress:
|
|
193
|
+
onPress: F,
|
|
194
194
|
onDrag: (t) => {
|
|
195
195
|
const u = C(t), v = E === "end" ? r.end : r.start;
|
|
196
196
|
l({ type: v, payload: u, event: t });
|
|
@@ -228,10 +228,10 @@ const se = (n, s, p) => {
|
|
|
228
228
|
flexGrow: 1,
|
|
229
229
|
position: "relative",
|
|
230
230
|
touchAction: "none",
|
|
231
|
-
...
|
|
231
|
+
...B
|
|
232
232
|
}
|
|
233
233
|
},
|
|
234
|
-
e.children && /* @__PURE__ */ a.createElement("ul", { className: "k-reset k-slider-items", style: { ...
|
|
234
|
+
e.children && /* @__PURE__ */ a.createElement("ul", { className: "k-reset k-slider-items", style: { ...q } }, a.Children.map(e.children, (t, u) => t && a.cloneElement(
|
|
235
235
|
t,
|
|
236
236
|
{
|
|
237
237
|
position: 100 * (t.props.position - e.min) / (e.max - e.min),
|
|
@@ -244,7 +244,7 @@ const se = (n, s, p) => {
|
|
|
244
244
|
/* @__PURE__ */ a.createElement(
|
|
245
245
|
"div",
|
|
246
246
|
{
|
|
247
|
-
ref:
|
|
247
|
+
ref: _,
|
|
248
248
|
className: "k-slider-track",
|
|
249
249
|
style: e.vertical ? { bottom: 0, height: "100%" } : { [o === "rtl" ? "right" : "left"]: 0, width: "100%" }
|
|
250
250
|
},
|
|
@@ -275,7 +275,7 @@ const se = (n, s, p) => {
|
|
|
275
275
|
className: "k-draghandle k-draghandle-start",
|
|
276
276
|
title: M.toLanguageString($, z[$]),
|
|
277
277
|
style: e.vertical ? { bottom: "calc(" + h + "%)", zIndex: 1 } : o === "rtl" ? { right: "calc(" + h + "% - 13px)", zIndex: 1 } : { left: "calc(" + h + "%)", zIndex: 1 },
|
|
278
|
-
onKeyDown:
|
|
278
|
+
onKeyDown: U
|
|
279
279
|
}
|
|
280
280
|
),
|
|
281
281
|
/* @__PURE__ */ a.createElement(
|
|
@@ -292,7 +292,7 @@ const se = (n, s, p) => {
|
|
|
292
292
|
className: "k-draghandle k-draghandle-end",
|
|
293
293
|
title: M.toLanguageString($, z[$]),
|
|
294
294
|
style: e.vertical ? { bottom: "calc(" + D + "%)", zIndex: 1 } : o === "rtl" ? { right: "calc(" + D + "% - 13px)", zIndex: 1 } : { left: "calc(" + D + "%)", zIndex: 1 },
|
|
295
|
-
onKeyDown:
|
|
295
|
+
onKeyDown: X
|
|
296
296
|
}
|
|
297
297
|
)
|
|
298
298
|
)
|
package/rating/Rating.mjs
CHANGED
|
@@ -12,15 +12,15 @@ import { starOutlineIcon as $, starIcon as K } from "@progress/kendo-svg-icons";
|
|
|
12
12
|
import { RatingItem as oe } from "./RatingItem.mjs";
|
|
13
13
|
import { RATING_ACTION as r, ratingReducer as ie } from "./rating-reducer.mjs";
|
|
14
14
|
import { calcIsFirstHalf as L, toRound as D, getRemainder as re, isHalf as ce, isSelected as F, isCorrectValue as A } from "./utils/index.mjs";
|
|
15
|
-
import { ratingAriaLabel as
|
|
15
|
+
import { ratingAriaLabel as _, messages as ue } from "../messages/index.mjs";
|
|
16
16
|
import { useLocalization as me } from "@progress/kendo-react-intl";
|
|
17
|
-
const
|
|
17
|
+
const X = (n, g, v) => {
|
|
18
18
|
const [e, N] = a.useState(n);
|
|
19
19
|
return [e, (h) => {
|
|
20
20
|
const o = ie(g.state || e, { ...h, ...g });
|
|
21
21
|
v && v(o, h.event), N(o);
|
|
22
22
|
}];
|
|
23
|
-
}, de = te(),
|
|
23
|
+
}, de = te(), q = a.forwardRef((n, g) => {
|
|
24
24
|
const v = ae(de, n), e = {
|
|
25
25
|
dir: s.dir,
|
|
26
26
|
min: s.min,
|
|
@@ -38,7 +38,7 @@ const q = (n, g, v) => {
|
|
|
38
38
|
element: h.current,
|
|
39
39
|
props: e
|
|
40
40
|
})), a.useImperativeHandle(g, () => m.current);
|
|
41
|
-
const
|
|
41
|
+
const G = a.useCallback(
|
|
42
42
|
(t, l) => {
|
|
43
43
|
e.onChange && m.current && e.onChange.call(void 0, {
|
|
44
44
|
value: t,
|
|
@@ -47,7 +47,7 @@ const q = (n, g, v) => {
|
|
|
47
47
|
});
|
|
48
48
|
},
|
|
49
49
|
[e.onChange]
|
|
50
|
-
), I = a.useMemo(() => e.min !== void 0 ? e.min : s.min, [e.min]), x = a.useMemo(() => e.max !== void 0 ? e.max : s.max, [e.max]), d = a.useMemo(() => e.precision || s.precision, [e.precision]), i = a.useMemo(() => e.step !== void 0 ? e.step : s.step, [e.step]), V = a.useMemo(() => e.readonly || s.readonly, [e.readonly]), k = a.useMemo(() => e.disabled || s.disabled, [e.disabled]),
|
|
50
|
+
), I = a.useMemo(() => e.min !== void 0 ? e.min : s.min, [e.min]), x = a.useMemo(() => e.max !== void 0 ? e.max : s.max, [e.max]), d = a.useMemo(() => e.precision || s.precision, [e.precision]), i = a.useMemo(() => e.step !== void 0 ? e.step : s.step, [e.step]), V = a.useMemo(() => e.readonly || s.readonly, [e.readonly]), k = a.useMemo(() => e.disabled || s.disabled, [e.disabled]), W = a.useMemo(() => e.item || s.item, [e.item]), [H, p] = X(
|
|
51
51
|
e.defaultValue !== void 0 ? e.defaultValue : s.defaultValue,
|
|
52
52
|
{
|
|
53
53
|
state: e.value,
|
|
@@ -55,8 +55,8 @@ const q = (n, g, v) => {
|
|
|
55
55
|
max: x,
|
|
56
56
|
step: d === "half" ? i / 2 : i
|
|
57
57
|
},
|
|
58
|
-
|
|
59
|
-
), [T, O] =
|
|
58
|
+
G
|
|
59
|
+
), [T, O] = X(null, {
|
|
60
60
|
state: e.value,
|
|
61
61
|
min: I,
|
|
62
62
|
max: x,
|
|
@@ -177,7 +177,7 @@ const q = (n, g, v) => {
|
|
|
177
177
|
const l = D(t + ee, E), f = d === "half" ? ce(l, C !== null ? C : u !== null ? u : 0, i) : !1, M = F(l, u, i, z), w = F(l, C !== null ? C : u, i, z), b = F(l, C, i, z);
|
|
178
178
|
P.push(
|
|
179
179
|
/* @__PURE__ */ a.createElement(
|
|
180
|
-
|
|
180
|
+
W,
|
|
181
181
|
{
|
|
182
182
|
key: l,
|
|
183
183
|
value: l,
|
|
@@ -261,7 +261,7 @@ const q = (n, g, v) => {
|
|
|
261
261
|
"aria-valuemax": x,
|
|
262
262
|
"aria-valuenow": u !== null ? u : void 0,
|
|
263
263
|
"aria-disabled": k ? "true" : void 0,
|
|
264
|
-
"aria-label": N.toLanguageString(
|
|
264
|
+
"aria-label": N.toLanguageString(_, ue[_]),
|
|
265
265
|
"aria-labelledby": e.ariaLabelledBy,
|
|
266
266
|
"aria-describedby": e.ariaDescribedBy
|
|
267
267
|
},
|
|
@@ -307,9 +307,9 @@ const q = (n, g, v) => {
|
|
|
307
307
|
selection: "continues",
|
|
308
308
|
precision: "item"
|
|
309
309
|
};
|
|
310
|
-
|
|
311
|
-
|
|
310
|
+
q.displayName = "KendoReactRating";
|
|
311
|
+
q.propTypes = pe;
|
|
312
312
|
export {
|
|
313
|
-
|
|
313
|
+
q as Rating,
|
|
314
314
|
de as RatingPropsContext
|
|
315
315
|
};
|
package/rating/RatingItem.mjs
CHANGED
|
@@ -40,7 +40,7 @@ const s = n.forwardRef((c, u) => {
|
|
|
40
40
|
});
|
|
41
41
|
},
|
|
42
42
|
[e.onFocus]
|
|
43
|
-
),
|
|
43
|
+
), f = n.useCallback(
|
|
44
44
|
(t) => {
|
|
45
45
|
e.onBlur && e.onBlur.call(void 0, {
|
|
46
46
|
target: o.current,
|
|
@@ -48,7 +48,7 @@ const s = n.forwardRef((c, u) => {
|
|
|
48
48
|
});
|
|
49
49
|
},
|
|
50
50
|
[e.onBlur]
|
|
51
|
-
),
|
|
51
|
+
), h = n.useCallback(
|
|
52
52
|
(t) => {
|
|
53
53
|
e.onMouseMove && e.onMouseMove.call(void 0, {
|
|
54
54
|
target: o.current,
|
|
@@ -95,10 +95,10 @@ const s = n.forwardRef((c, u) => {
|
|
|
95
95
|
onClick: i,
|
|
96
96
|
onKeyDown: d,
|
|
97
97
|
onFocus: v,
|
|
98
|
-
onBlur:
|
|
98
|
+
onBlur: f,
|
|
99
99
|
onMouseEnter: M,
|
|
100
100
|
onMouseLeave: m,
|
|
101
|
-
onMouseMove:
|
|
101
|
+
onMouseMove: h
|
|
102
102
|
},
|
|
103
103
|
e.children
|
|
104
104
|
);
|
package/signature/Signature.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 ze=require("@progress/kendo-inputs-common"),_=require("@progress/kendo-react-buttons"),a=require("@progress/kendo-react-common"),Oe=require("@progress/kendo-react-dialogs"),Ee=require("@progress/kendo-react-intl"),r=require("prop-types"),xe=require("react"),p=require("../messages/index.js"),ne=require("../package-metadata.js"),Me=require("./utils/index.js"),N=require("@progress/kendo-svg-icons");function we(c){const k=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const g in c)if(g!=="default"){const v=Object.getOwnPropertyDescriptor(c,g);Object.defineProperty(k,g,v.get?v:{enumerable:!0,get:()=>c[g]})}}return k.default=c,Object.freeze(k)}const n=we(xe),Ie=250,Le=84,ae=3,re=2,Pe="#000000",qe="#ffffff",oe=c=>c!==void 0,se=a.createPropsContext(),E=n.forwardRef((c,k)=>{const g=!a.validatePackage(ne.packageMetadata,{component:"Signature"}),v=a.getLicenseMessage(ne.packageMetadata),F=a.usePropsContext(se,c),e=n.useMemo(()=>({strokeWidth:l.strokeWidth,smooth:l.smooth,popupScale:l.popupScale,exportScale:l.exportScale,maximizable:l.maximizable,disabled:l.disabled,required:l.required,validityStyles:l.validityStyles,onChange:l.onChange,onFocus:l.onFocus,onBlur:l.onBlur,onOpen:l.onOpen,onClose:l.onClose,size:l.size,rounded:l.rounded,fillMode:l.fillMode,...F}),[F]),x=Ee.useLocalization(),d=n.useRef(null),y=n.useRef(null),j=n.useRef(null),W=n.useRef(null),M=n.useRef(null),[s,ie]=n.useState(),[h,G]=n.useState(!1),[w,A]=n.useState(!1),[C,V]=n.useState(),[le,ce]=n.useState(),U=oe(e.value)?e.value:C,[ue,de]=n.useState(!1),b=oe(e.open),f=b?e.open:ue,me=e.maximized||w||!e.maximizable||e.disabled,pe=!(e.maximized&&!w),ge=!(!(e.value||C)||w||e.readOnly||e.disabled),H=x.toLanguageString(p.signatureMaximize,p.messages[p.signatureMaximize]),$=x.toLanguageString(p.signatureMinimize,p.messages[p.signatureMinimize]),K=x.toLanguageString(p.signatureClear,p.messages[p.signatureClear]),I=e.popupScale||ae,L=e.exportScale||re,P=t=>{V(t),e.onChange&&e.onChange({value:t})},fe=t=>{s==null||s.loadImage(t.value),P(t.value)};n.useEffect(()=>{e.value!==C&&(V(e.value),s==null||s.loadImage(e.value))},[e.value]);const ke=()=>{s==null||s.clear(),P()},S=n.useCallback(t=>{b||de(t)},[b]),be=t=>{var o,i;Z(t),(i=((o=M.current)==null?void 0:o.element)||y.current)==null||i.focus()},q=n.useCallback(()=>{let t=Pe;return!e.color&&typeof document!="undefined"&&d.current&&(t=getComputedStyle(d.current).color),e.color||t},[e.color]),D=n.useCallback(()=>{let t=qe;return!e.backgroundColor&&typeof document!="undefined"&&d.current&&(t=getComputedStyle(d.current).backgroundColor),e.backgroundColor||t},[e.backgroundColor]),X=()=>({scale:e.maximized?e.popupScale:1,color:q(),backgroundColor:D(),strokeWidth:e.strokeWidth,smooth:e.smooth,readonly:e.readOnly}),J=async t=>{const{width:o,height:i}=t;return await(s==null?void 0:s.exportImage({width:o*L,height:i*L}))};n.useEffect(()=>{const t=y.current,o=new ze.SignaturePad(t,X());return U&&o.loadImage(U),ie(o),()=>o.destroy()},[]),n.useEffect(()=>{s==null||s.setOptions({onChange:async()=>P(await J(ee())),onDraw:()=>A(!0),onDrawEnd:()=>A(!1)})},[s]),a.useIsomorphicLayoutEffect(()=>s==null?void 0:s.setOptions(X()),[e.readOnly,e.color,e.backgroundColor,e.strokeWidth,e.smooth]),n.useEffect(()=>{var i,u;const t=(u=(i=j.current)==null?void 0:i.element)==null?void 0:u.querySelector(".k-overlay");if(!t)return;const o=()=>S(!1);return t.addEventListener("click",o),()=>t.removeEventListener("click",o)},[f]),n.useEffect(()=>{if(!f||typeof document=="undefined")return;const t=o=>{var i,u;o.key==="Escape"&&(S(!1),(u=(i=M.current)==null?void 0:i.element)==null||u.focus())};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[f]),n.useEffect(()=>{var t,o;e.maximized&&((o=(t=W.current)==null?void 0:t.element)==null||o.focus())},[]);const R=n.useCallback(()=>{var t;return(t=y.current)==null?void 0:t.focus()},[]),z=n.useCallback(()=>e.value,[e.value]),Q=n.useCallback(()=>e.name,[e.name]),O=n.useCallback(()=>e.required,[e.required]),T=n.useCallback(()=>{const t=e.validationMessage!==void 0,i=!z(),u=e.valid!==void 0?e.valid:!O()||!i;return{customError:t,valid:u,valueMissing:i}},[e.validationMessage,e.valid,z,O]),B=n.useCallback(()=>e.validityStyles,[e.validityStyles]),Y=n.useCallback(()=>e,[e]),m=n.useCallback(()=>{const t={element:d.current,focus:R};return Object.defineProperty(t,"name",{get:Q}),Object.defineProperty(t,"value",{get:z}),Object.defineProperty(t,"validity",{get:T}),Object.defineProperty(t,"validityStyles",{get:B}),Object.defineProperty(t,"required",{get:O}),Object.defineProperty(t,"props",{get:Y}),Object.defineProperty(t,"color",{get:q}),Object.defineProperty(t,"backgroundColor",{get:D}),t},[Q,z,T,B,O,R,Y,q,D]);n.useImperativeHandle(k,m);const ve=n.useCallback(t=>{h||e.maximized||(G(!0),a.dispatchEvent(e.onFocus,t,m(),{}))},[h,e.onFocus,m]),ye=n.useCallback(t=>{Me.hasParent(t.relatedTarget,d.current)||(G(!1),a.dispatchEvent(e.onBlur,t,m(),{}))},[h,e.onBlur,m]),he=n.useCallback(async t=>{ce(await J(te())),S(!0),a.dispatchEvent(e.onOpen,t,m(),{})},[f,b,e.onOpen,e.value,C,m]),Z=n.useCallback(t=>{S(!1),a.dispatchEvent(e.onClose,t,m(),{})},[f,b,e.onClose,m]),Ce=()=>{ke(),R()},ee=()=>{var i,u;const t=e.width||((i=d.current)==null?void 0:i.offsetWidth)||Ie,o=e.height||((u=d.current)==null?void 0:u.offsetHeight)||Le;return{width:t,height:o}},te=()=>{const{width:t,height:o}=ee();return{width:t*I,height:o*I}},Se=!B()||T().valid;return n.createElement("div",{ref:d,dir:e.dir,style:{width:e.width,height:e.height,...e.style},className:a.classNames("k-input","k-signature",{"k-signature-maximized":e.maximized,[`k-signature-${a.kendoThemeMaps.sizeMap[e.size]||e.size}`]:e.size,[`k-signature-${e.fillMode}`]:e.fillMode,[`k-input-${e.fillMode}`]:e.fillMode,[`k-rounded-${a.kendoThemeMaps.roundedMap[e.rounded]||e.rounded}`]:e.rounded,"k-invalid":!Se,"k-required":e.required,"k-disabled":e.disabled,"k-focus":h},e.className),onFocus:ve,onBlur:ye},n.createElement("div",{className:"k-signature-canvas",ref:y,tabIndex:a.getTabIndex(e.tabIndex,e.disabled),role:"img",id:e.id,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledBy,"aria-describedby":e.ariaDescribedBy,"aria-disabled":e.disabled?"true":void 0,style:e.inputStyle}),n.createElement("div",{className:"k-signature-actions k-signature-actions-top"},n.createElement(_.Button,{type:"button",className:a.classNames("k-signature-action","k-signature-maximize",{"k-hidden":e.disabled||me}),ref:M,icon:"hyperlink-open",svgIcon:N.hyperlinkOpenIcon,size:e.size,rounded:e.rounded,fillMode:"flat",onClick:he,"aria-label":H,title:H}),n.createElement(_.Button,{type:"button",className:a.classNames("k-signature-action","k-signature-minimize","k-rotate-180",{"k-hidden":e.disabled||pe}),ref:W,icon:"hyperlink-open",svgIcon:N.hyperlinkOpenIcon,size:e.size,rounded:e.rounded,fillMode:"flat",onClick:Z,"aria-label":$,title:$})),!e.hideLine&&n.createElement("div",{className:"k-signature-line",style:{zIndex:2,pointerEvents:"none"}}),n.createElement("div",{className:"k-signature-actions k-signature-actions-bottom"},ge&&n.createElement(_.Button,{type:"button",className:"k-signature-action k-signature-clear",icon:"x",svgIcon:N.xIcon,size:e.size,rounded:e.rounded,fillMode:"flat",onClick:Ce,"aria-label":K,title:K})),f&&n.createElement(Oe.Dialog,{ref:j},n.createElement(E,{...e,...te(),value:le,maximized:!0,exportScale:1/I*L,open:!1,onChange:fe,onClose:be})),g&&n.createElement(a.WatermarkOverlay,{message:v}))});E.propTypes={value:r.string,width:r.number,height:r.number,tabIndex:r.number,dir:r.string,ariaDescribedBy:r.string,ariaLabelledBy:r.string,ariaLabel:r.string,readOnly:r.bool,disabled:r.bool,validationMessage:r.string,required:r.bool,onChange:r.func,onFocus:r.func,onBlur:r.func,onOpen:r.func,onClose:r.func,size:r.oneOf(["small","medium","large"]),rounded:r.oneOf(["small","medium","large"]),fillMode:r.oneOf(["solid","flat","outline"])};const l={strokeWidth:1,smooth:!1,popupScale:ae,exportScale:re,maximizable:!0,disabled:!1,required:!1,validityStyles:!0,onChange:c=>a.noop,onFocus:c=>a.noop,onBlur:c=>a.noop,onOpen:c=>a.noop,onClose:c=>a.noop,size:void 0,rounded:void 0,fillMode:void 0};E.displayName="KendoSignature";exports.Signature=E;exports.SignaturePropsContext=se;
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ze=require("@progress/kendo-inputs-common"),_=require("@progress/kendo-react-buttons"),a=require("@progress/kendo-react-common"),Oe=require("@progress/kendo-react-dialogs"),Ee=require("@progress/kendo-react-intl"),r=require("prop-types"),xe=require("react"),p=require("../messages/index.js"),ne=require("../package-metadata.js"),Me=require("./utils/index.js"),N=require("@progress/kendo-svg-icons");function we(c){const k=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const g in c)if(g!=="default"){const v=Object.getOwnPropertyDescriptor(c,g);Object.defineProperty(k,g,v.get?v:{enumerable:!0,get:()=>c[g]})}}return k.default=c,Object.freeze(k)}const n=we(xe),Ie=250,Le=84,ae=3,re=2,Pe="#000000",qe="#ffffff",oe=c=>c!==void 0,se=a.createPropsContext(),E=n.forwardRef((c,k)=>{const g=!a.validatePackage(ne.packageMetadata,{component:"Signature"}),v=a.getLicenseMessage(ne.packageMetadata),F=a.usePropsContext(se,c),e=n.useMemo(()=>({strokeWidth:l.strokeWidth,smooth:l.smooth,popupScale:l.popupScale,exportScale:l.exportScale,maximizable:l.maximizable,disabled:l.disabled,required:l.required,validityStyles:l.validityStyles,onChange:l.onChange,onFocus:l.onFocus,onBlur:l.onBlur,onOpen:l.onOpen,onClose:l.onClose,size:l.size,rounded:l.rounded,fillMode:l.fillMode,...F}),[F]),x=Ee.useLocalization(),d=n.useRef(null),y=n.useRef(null),j=n.useRef(null),W=n.useRef(null),M=n.useRef(null),[s,ie]=n.useState(),[h,G]=n.useState(!1),[w,A]=n.useState(!1),[C,V]=n.useState(),[le,ce]=n.useState(),U=oe(e.value)?e.value:C,[ue,de]=n.useState(!1),b=oe(e.open),f=b?e.open:ue,me=e.maximized||w||!e.maximizable||e.disabled,pe=!(e.maximized&&!w),ge=!(!(e.value||C)||w||e.readOnly||e.disabled),H=x.toLanguageString(p.signatureMaximize,p.messages[p.signatureMaximize]),$=x.toLanguageString(p.signatureMinimize,p.messages[p.signatureMinimize]),K=x.toLanguageString(p.signatureClear,p.messages[p.signatureClear]),I=e.popupScale||ae,L=e.exportScale||re,P=t=>{V(t),e.onChange&&e.onChange({value:t})},fe=t=>{s==null||s.loadImage(t.value),P(t.value)};n.useEffect(()=>{e.value!==C&&(V(e.value),s==null||s.loadImage(e.value))},[e.value]);const ke=()=>{s==null||s.clear(),P()},S=n.useCallback(t=>{b||de(t)},[b]),be=t=>{var o,i;Z(t),(i=((o=M.current)==null?void 0:o.element)||y.current)==null||i.focus()},q=n.useCallback(()=>{let t=Pe;return!e.color&&typeof document!="undefined"&&d.current&&(t=getComputedStyle(d.current).color),e.color||t},[e.color]),D=n.useCallback(()=>{let t=qe;return!e.backgroundColor&&typeof document!="undefined"&&d.current&&(t=getComputedStyle(d.current).backgroundColor),e.backgroundColor||t},[e.backgroundColor]),X=()=>({scale:e.maximized?e.popupScale:1,color:q(),backgroundColor:D(),strokeWidth:e.strokeWidth,smooth:e.smooth,readonly:e.readOnly}),J=async t=>{const{width:o,height:i}=t;return await(s==null?void 0:s.exportImage({width:o*L,height:i*L}))};n.useEffect(()=>{const t=y.current,o=new ze.SignaturePad(t,X());return U&&o.loadImage(U),ie(o),()=>o.destroy()},[]),n.useEffect(()=>{s==null||s.setOptions({onChange:async()=>P(await J(ee())),onDraw:()=>A(!0),onDrawEnd:()=>A(!1)})},[s]),a.useIsomorphicLayoutEffect(()=>s==null?void 0:s.setOptions(X()),[e.readOnly,e.color,e.backgroundColor,e.strokeWidth,e.smooth]),n.useEffect(()=>{var i,u;const t=(u=(i=j.current)==null?void 0:i.element)==null?void 0:u.querySelector(".k-overlay");if(!t)return;const o=()=>S(!1);return t.addEventListener("click",o),()=>t.removeEventListener("click",o)},[f]),n.useEffect(()=>{if(!f||typeof document=="undefined")return;const t=o=>{var i,u;o.key==="Escape"&&(S(!1),(u=(i=M.current)==null?void 0:i.element)==null||u.focus())};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[f]),n.useEffect(()=>{var t,o;e.maximized&&((o=(t=W.current)==null?void 0:t.element)==null||o.focus())},[]);const R=n.useCallback(()=>{var t;return(t=y.current)==null?void 0:t.focus()},[]),z=n.useCallback(()=>e.value,[e.value]),Q=n.useCallback(()=>e.name,[e.name]),O=n.useCallback(()=>e.required,[e.required]),T=n.useCallback(()=>{const t=e.validationMessage!==void 0,i=!z(),u=e.valid!==void 0?e.valid:!O()||!i;return{customError:t,valid:u,valueMissing:i}},[e.validationMessage,e.valid,z,O]),B=n.useCallback(()=>e.validityStyles,[e.validityStyles]),Y=n.useCallback(()=>e,[e]),m=n.useCallback(()=>{const t={element:d.current,focus:R};return Object.defineProperty(t,"name",{get:Q}),Object.defineProperty(t,"value",{get:z}),Object.defineProperty(t,"validity",{get:T}),Object.defineProperty(t,"validityStyles",{get:B}),Object.defineProperty(t,"required",{get:O}),Object.defineProperty(t,"props",{get:Y}),Object.defineProperty(t,"color",{get:q}),Object.defineProperty(t,"backgroundColor",{get:D}),t},[Q,z,T,B,O,R,Y,q,D]);n.useImperativeHandle(k,m);const ve=n.useCallback(t=>{h||e.maximized||(G(!0),a.dispatchEvent(e.onFocus,t,m(),{}))},[h,e.onFocus,m]),ye=n.useCallback(t=>{Me.hasParent(t.relatedTarget,d.current)||(G(!1),a.dispatchEvent(e.onBlur,t,m(),{}))},[h,e.onBlur,m]),he=n.useCallback(async t=>{ce(await J(te())),S(!0),a.dispatchEvent(e.onOpen,t,m(),{})},[f,b,e.onOpen,e.value,C,m]),Z=n.useCallback(t=>{S(!1),a.dispatchEvent(e.onClose,t,m(),{})},[f,b,e.onClose,m]),Ce=()=>{ke(),R()},ee=()=>{var i,u;const t=e.width||((i=d.current)==null?void 0:i.offsetWidth)||Ie,o=e.height||((u=d.current)==null?void 0:u.offsetHeight)||Le;return{width:t,height:o}},te=()=>{const{width:t,height:o}=ee();return{width:t*I,height:o*I}},Se=!B()||T().valid;return n.createElement("div",{ref:d,dir:e.dir,style:{width:e.width,height:e.height,...e.style},className:a.classNames("k-input","k-signature",{"k-signature-maximized":e.maximized,[`k-signature-${a.kendoThemeMaps.sizeMap[e.size]||e.size}`]:e.size,[`k-signature-${e.fillMode}`]:e.fillMode,[`k-input-${e.fillMode}`]:e.fillMode,[`k-rounded-${a.kendoThemeMaps.roundedMap[e.rounded]||e.rounded}`]:e.rounded,"k-invalid":!Se,"k-required":e.required,"k-disabled":e.disabled,"k-focus":h},e.className),onFocus:ve,onBlur:ye},n.createElement("div",{className:"k-signature-canvas",ref:y,tabIndex:a.getTabIndex(e.tabIndex,e.disabled),role:"img",id:e.id,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledBy,"aria-describedby":e.ariaDescribedBy,"aria-disabled":e.disabled?"true":void 0,style:e.inputStyle}),n.createElement("div",{className:"k-signature-actions k-signature-actions-top"},n.createElement(_.Button,{type:"button",className:a.classNames("k-signature-action","k-signature-maximize",{"k-hidden":e.disabled||me}),ref:M,icon:"hyperlink-open",svgIcon:N.hyperlinkOpenIcon,size:e.size,rounded:e.rounded,fillMode:"flat",onClick:he,"aria-label":H,title:H}),n.createElement(_.Button,{type:"button",className:a.classNames("k-signature-action","k-signature-minimize","k-rotate-180",{"k-hidden":e.disabled||pe}),ref:W,icon:"hyperlink-open",svgIcon:N.hyperlinkOpenIcon,size:e.size,rounded:e.rounded,fillMode:"flat",onClick:Z,"aria-label":$,title:$})),!e.hideLine&&n.createElement("div",{className:"k-signature-line",style:{zIndex:2,pointerEvents:"none"}}),n.createElement("div",{className:"k-signature-actions k-signature-actions-bottom"},ge&&n.createElement(_.Button,{type:"button",className:"k-signature-action k-signature-clear",icon:"x",svgIcon:N.xIcon,size:e.size,rounded:e.rounded,fillMode:"flat",onClick:Ce,"aria-label":K,title:K})),f&&n.createElement(Oe.Dialog,{ref:j},n.createElement(E,{...e,...te(),value:le,maximized:!0,exportScale:1/I*L,open:!1,onChange:fe,onClose:be})),g&&n.createElement(a.WatermarkOverlay,{message:v}))});E.propTypes={value:r.string,width:r.number,height:r.number,tabIndex:r.number,dir:r.string,ariaDescribedBy:r.string,ariaLabelledBy:r.string,ariaLabel:r.string,readOnly:r.bool,disabled:r.bool,validationMessage:r.string,required:r.bool,onChange:r.func,onFocus:r.func,onBlur:r.func,onOpen:r.func,onClose:r.func,size:r.oneOf(["small","medium","large"]),rounded:r.oneOf(["small","medium","large","none"]),fillMode:r.oneOf(["solid","flat","outline"])};const l={strokeWidth:1,smooth:!1,popupScale:ae,exportScale:re,maximizable:!0,disabled:!1,required:!1,validityStyles:!0,onChange:c=>a.noop,onFocus:c=>a.noop,onBlur:c=>a.noop,onOpen:c=>a.noop,onClose:c=>a.noop,size:void 0,rounded:void 0,fillMode:void 0};E.displayName="KendoSignature";exports.Signature=E;exports.SignaturePropsContext=se;
|
package/signature/Signature.mjs
CHANGED
|
@@ -8,16 +8,16 @@
|
|
|
8
8
|
import { SignaturePad as Le } from "@progress/kendo-inputs-common";
|
|
9
9
|
import { Button as T } from "@progress/kendo-react-buttons";
|
|
10
10
|
import { createPropsContext as we, validatePackage as Ie, getLicenseMessage as Pe, usePropsContext as De, noop as f, useIsomorphicLayoutEffect as Te, dispatchEvent as h, classNames as B, kendoThemeMaps as ee, getTabIndex as Be, WatermarkOverlay as Re } from "@progress/kendo-react-common";
|
|
11
|
-
import { Dialog as
|
|
12
|
-
import { useLocalization as
|
|
11
|
+
import { Dialog as _e } from "@progress/kendo-react-dialogs";
|
|
12
|
+
import { useLocalization as Fe } 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
16
|
import { packageMetadata as ae } from "../package-metadata.mjs";
|
|
17
17
|
import { hasParent as Ne } from "./utils/index.mjs";
|
|
18
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(),
|
|
20
|
-
const ue = !Ie(ae, { component: "Signature" }), de = Pe(ae),
|
|
19
|
+
const qe = 250, Ge = 84, se = 3, le = 2, Ae = "#000000", Ve = "#ffffff", ie = (d) => d !== void 0, je = we(), _ = o.forwardRef((d, ce) => {
|
|
20
|
+
const ue = !Ie(ae, { component: "Signature" }), de = Pe(ae), F = De(je, d), e = o.useMemo(
|
|
21
21
|
() => ({
|
|
22
22
|
strokeWidth: s.strokeWidth,
|
|
23
23
|
smooth: s.smooth,
|
|
@@ -35,10 +35,10 @@ const qe = 250, Ge = 84, se = 3, le = 2, Ae = "#000000", Ve = "#ffffff", ie = (d
|
|
|
35
35
|
size: s.size,
|
|
36
36
|
rounded: s.rounded,
|
|
37
37
|
fillMode: s.fillMode,
|
|
38
|
-
...
|
|
38
|
+
...F
|
|
39
39
|
}),
|
|
40
|
-
[
|
|
41
|
-
), S =
|
|
40
|
+
[F]
|
|
41
|
+
), S = Fe(), c = o.useRef(null), g = o.useRef(null), N = o.useRef(null), W = o.useRef(null), z = 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, ve = !(e.maximized && !E), ye = !(!(e.value || k) || E || e.readOnly || e.disabled), j = S.toLanguageString(te, R[te]), U = S.toLanguageString(oe, R[oe]), H = S.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);
|
|
@@ -262,8 +262,8 @@ const qe = 250, Ge = 84, se = 3, le = 2, Ae = "#000000", Ve = "#ffffff", ie = (d
|
|
|
262
262
|
title: H
|
|
263
263
|
}
|
|
264
264
|
)),
|
|
265
|
-
m && /* @__PURE__ */ o.createElement(
|
|
266
|
-
|
|
265
|
+
m && /* @__PURE__ */ o.createElement(_e, { ref: N }, /* @__PURE__ */ o.createElement(
|
|
266
|
+
_,
|
|
267
267
|
{
|
|
268
268
|
...e,
|
|
269
269
|
...Z(),
|
|
@@ -278,7 +278,7 @@ const qe = 250, Ge = 84, se = 3, le = 2, Ae = "#000000", Ve = "#ffffff", ie = (d
|
|
|
278
278
|
ue && /* @__PURE__ */ o.createElement(Re, { message: de })
|
|
279
279
|
);
|
|
280
280
|
});
|
|
281
|
-
|
|
281
|
+
_.propTypes = {
|
|
282
282
|
value: a.string,
|
|
283
283
|
width: a.number,
|
|
284
284
|
height: a.number,
|
|
@@ -297,7 +297,7 @@ F.propTypes = {
|
|
|
297
297
|
onOpen: a.func,
|
|
298
298
|
onClose: a.func,
|
|
299
299
|
size: a.oneOf(["small", "medium", "large"]),
|
|
300
|
-
rounded: a.oneOf(["small", "medium", "large"]),
|
|
300
|
+
rounded: a.oneOf(["small", "medium", "large", "none"]),
|
|
301
301
|
fillMode: a.oneOf(["solid", "flat", "outline"])
|
|
302
302
|
};
|
|
303
303
|
const s = {
|
|
@@ -318,8 +318,8 @@ const s = {
|
|
|
318
318
|
rounded: void 0,
|
|
319
319
|
fillMode: void 0
|
|
320
320
|
};
|
|
321
|
-
|
|
321
|
+
_.displayName = "KendoSignature";
|
|
322
322
|
export {
|
|
323
|
-
|
|
323
|
+
_ as Signature,
|
|
324
324
|
je as SignaturePropsContext
|
|
325
325
|
};
|
|
@@ -153,7 +153,7 @@ export interface SignatureProps extends FormComponentProps {
|
|
|
153
153
|
* <Signature rounded="medium" />
|
|
154
154
|
* ```
|
|
155
155
|
*/
|
|
156
|
-
rounded?: 'small' | 'medium' | 'large';
|
|
156
|
+
rounded?: 'small' | 'medium' | 'large' | 'none';
|
|
157
157
|
/**
|
|
158
158
|
* Configures the fill mode of the Signature.
|
|
159
159
|
*
|
package/slider/Slider.d.ts
CHANGED
|
@@ -5,14 +5,13 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { default as PropTypes } from 'prop-types';
|
|
9
8
|
import { FormComponentProps, BaseEvent } from '@progress/kendo-react-common';
|
|
10
9
|
import { Direction } from '../interfaces/Direction.js';
|
|
11
10
|
import * as React from 'react';
|
|
12
11
|
/**
|
|
13
12
|
* The arguments for the `onChange` Slider event.
|
|
14
13
|
*/
|
|
15
|
-
export interface SliderChangeEvent extends BaseEvent<
|
|
14
|
+
export interface SliderChangeEvent extends BaseEvent<SliderHandle> {
|
|
16
15
|
/**
|
|
17
16
|
* The current value of the Slider.
|
|
18
17
|
*/
|
|
@@ -189,78 +188,8 @@ export interface SliderProps extends FormComponentProps {
|
|
|
189
188
|
*/
|
|
190
189
|
dir?: Direction;
|
|
191
190
|
}
|
|
192
|
-
/**
|
|
193
|
-
* @hidden
|
|
194
|
-
*/
|
|
195
|
-
interface SliderState {
|
|
196
|
-
value: number;
|
|
197
|
-
focused: boolean;
|
|
198
|
-
dir?: Direction;
|
|
199
|
-
}
|
|
200
191
|
/** @hidden */
|
|
201
|
-
export declare
|
|
202
|
-
static displayName: string;
|
|
203
|
-
/**
|
|
204
|
-
* @hidden
|
|
205
|
-
*/
|
|
206
|
-
static propTypes: {
|
|
207
|
-
min: PropTypes.Validator<number>;
|
|
208
|
-
max: PropTypes.Validator<number>;
|
|
209
|
-
value: PropTypes.Requireable<number>;
|
|
210
|
-
vertical: PropTypes.Requireable<boolean>;
|
|
211
|
-
id: PropTypes.Requireable<string>;
|
|
212
|
-
ariaLabelledBy: PropTypes.Requireable<string>;
|
|
213
|
-
ariaDescribedBy: PropTypes.Requireable<string>;
|
|
214
|
-
ariaLabel: PropTypes.Requireable<string>;
|
|
215
|
-
};
|
|
216
|
-
/**
|
|
217
|
-
* @hidden
|
|
218
|
-
*/
|
|
219
|
-
static getDerivedStateFromProps(props: SliderProps, state: SliderState): {
|
|
220
|
-
value: number;
|
|
221
|
-
} | null;
|
|
222
|
-
/**
|
|
223
|
-
* @hidden
|
|
224
|
-
*/
|
|
225
|
-
state: {
|
|
226
|
-
value: number;
|
|
227
|
-
focused: boolean;
|
|
228
|
-
dir: Direction | undefined;
|
|
229
|
-
};
|
|
230
|
-
private _sliderTrack;
|
|
231
|
-
private _element;
|
|
232
|
-
constructor(props: SliderProps);
|
|
233
|
-
/**
|
|
234
|
-
* @hidden
|
|
235
|
-
*/
|
|
236
|
-
componentDidMount(): void;
|
|
237
|
-
/**
|
|
238
|
-
* @hidden
|
|
239
|
-
*/
|
|
240
|
-
buttons: (props: any) => any;
|
|
241
|
-
/**
|
|
242
|
-
* @hidden
|
|
243
|
-
*/
|
|
244
|
-
render(): React.JSX.Element;
|
|
245
|
-
/**
|
|
246
|
-
* @hidden
|
|
247
|
-
*/
|
|
248
|
-
focus: () => void;
|
|
249
|
-
/**
|
|
250
|
-
* @hidden
|
|
251
|
-
*/
|
|
252
|
-
get sliderTrack(): HTMLDivElement | null;
|
|
253
|
-
private isLabel;
|
|
254
|
-
private onFocus;
|
|
255
|
-
private onBlur;
|
|
256
|
-
private onKeyDown;
|
|
257
|
-
private decrement;
|
|
258
|
-
private increment;
|
|
259
|
-
private dragStart;
|
|
260
|
-
private dragOver;
|
|
261
|
-
private drag;
|
|
262
|
-
private change;
|
|
263
|
-
}
|
|
192
|
+
export declare const SliderWithoutContext: React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<SliderHandle>>;
|
|
264
193
|
/**
|
|
265
194
|
* Represents the PropsContext of the `Slider` component.
|
|
266
195
|
* Used for global configuration of all `Slider` instances.
|
|
@@ -274,15 +203,20 @@ export declare const SliderPropsContext: React.Context<(p: SliderProps) => Slide
|
|
|
274
203
|
* @remarks
|
|
275
204
|
* Supported children components are: {@link SliderLabel}.
|
|
276
205
|
*/
|
|
277
|
-
export interface SliderHandle
|
|
206
|
+
export interface SliderHandle {
|
|
207
|
+
/**
|
|
208
|
+
* The props of the SliderHandle component.
|
|
209
|
+
*/
|
|
210
|
+
props: SliderProps;
|
|
211
|
+
/**
|
|
212
|
+
* Gets the slider track element.
|
|
213
|
+
*/
|
|
214
|
+
sliderTrack: HTMLDivElement | null;
|
|
278
215
|
}
|
|
279
|
-
/** @hidden */
|
|
280
|
-
export type Slider = SliderHandle;
|
|
281
216
|
/**
|
|
282
217
|
* Represents the [KendoReact Slider component](https://www.telerik.com/kendo-react-ui/components/inputs/slider).
|
|
283
218
|
*
|
|
284
219
|
* Accepts properties of type [SliderProps](https://www.telerik.com/kendo-react-ui/components/inputs/api/sliderprops).
|
|
285
220
|
* Obtaining the `ref` returns an object of type [SliderHandle](https://www.telerik.com/kendo-react-ui/components/inputs/api/sliderhandle).
|
|
286
221
|
*/
|
|
287
|
-
export declare const Slider: React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<any>>;
|
|
288
|
-
export {};
|
|
222
|
+
export declare const Slider: React.ForwardRefExoticComponent<Omit<SliderProps & React.RefAttributes<SliderHandle>, "ref"> & React.RefAttributes<any>>;
|