@progress/kendo-react-inputs 14.5.0-develop.8 → 15.0.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/MaskedTextBoxMcpWrapper.d.ts +17 -0
- package/MaskedTextBoxMcpWrapper.js +8 -0
- package/MaskedTextBoxMcpWrapper.mjs +18 -0
- package/README.md +4 -4
- package/checkbox/Checkbox.js +1 -1
- package/checkbox/Checkbox.mjs +64 -64
- package/colors/ColorGradient.js +1 -1
- package/colors/ColorGradient.mjs +74 -72
- package/colors/ColorInput.js +1 -1
- package/colors/ColorInput.mjs +57 -45
- package/colors/ColorPalette.js +1 -1
- package/colors/ColorPalette.mjs +84 -81
- package/colors/ColorPicker.js +1 -1
- package/colors/ColorPicker.mjs +228 -215
- package/colors/FlatColorPicker.js +1 -1
- package/colors/FlatColorPicker.mjs +86 -94
- package/colors/interfaces/ColorPickerProps.d.ts +6 -1
- package/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/index.d.mts +5 -1
- package/index.d.ts +5 -1
- package/index.js +1 -1
- package/index.mjs +92 -89
- package/maskedtextbox/MaskedTextBoxProps.d.ts +6 -1
- package/messages/index.d.ts +55 -0
- package/messages/index.js +1 -1
- package/messages/index.mjs +82 -60
- package/numerictextbox/NumericTextBox.js +1 -1
- package/numerictextbox/NumericTextBox.mjs +215 -213
- package/numerictextbox/interfaces/NumericTextBoxProps.d.ts +6 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +16 -11
- package/radiobutton/RadioButton.js +1 -1
- package/radiobutton/RadioButton.mjs +23 -20
- package/radiobutton/interfaces/RadioButtonProps.d.ts +7 -0
- package/range-slider/RangeSlider.d.ts +14 -1
- package/range-slider/RangeSlider.js +11 -11
- package/range-slider/RangeSlider.mjs +188 -185
- package/rating/Rating.d.ts +6 -1
- package/rating/Rating.js +3 -3
- package/rating/Rating.mjs +83 -76
- package/signature/Signature.js +1 -1
- package/signature/Signature.mjs +127 -129
- package/signature/interfaces/SignatureProps.d.ts +6 -1
- package/slider/Slider.d.ts +6 -1
- package/slider/Slider.js +1 -1
- package/slider/Slider.mjs +155 -150
- package/slider/SliderLabel.js +1 -1
- package/slider/SliderLabel.mjs +3 -2
- package/switch/Switch.d.ts +6 -1
- package/switch/Switch.js +1 -1
- package/switch/Switch.mjs +100 -100
- package/textarea/TextArea.js +1 -1
- package/textarea/TextArea.mjs +101 -101
- package/textarea/interfaces/TextAreaProps.d.ts +6 -1
- package/textbox/Textbox.d.ts +20 -1
- package/textbox/Textbox.js +1 -1
- package/textbox/Textbox.mjs +92 -81
package/signature/Signature.mjs
CHANGED
|
@@ -6,91 +6,91 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import { SignaturePad as Le } from "@progress/kendo-inputs-common";
|
|
9
|
-
import { Button as
|
|
10
|
-
import { validatePackage as
|
|
11
|
-
import { Dialog as
|
|
12
|
-
import { useLocalization as
|
|
9
|
+
import { Button as R } from "@progress/kendo-react-buttons";
|
|
10
|
+
import { validatePackage as Ie, getLicenseMessage as Pe, usePropsContext as De, noop as f, useIsomorphicLayoutEffect as Re, useWebMcpRegister as Te, dispatchEvent as h, classNames as T, kendoThemeMaps as Y, getTabIndex as Be, WatermarkOverlay as Fe, createPropsContext as _e } from "@progress/kendo-react-common";
|
|
11
|
+
import { Dialog as We } from "@progress/kendo-react-dialogs";
|
|
12
|
+
import { useLocalization as Ne } from "@progress/kendo-react-intl";
|
|
13
13
|
import a from "prop-types";
|
|
14
14
|
import * as o from "react";
|
|
15
|
-
import { signatureMaximize as
|
|
16
|
-
import { packageMetadata as
|
|
17
|
-
import { hasParent as
|
|
18
|
-
import { hyperlinkOpenIcon as
|
|
19
|
-
const
|
|
20
|
-
const
|
|
15
|
+
import { signatureMaximize as Z, messages as B, signatureMinimize as ee, signatureClear as te } from "../messages/index.mjs";
|
|
16
|
+
import { packageMetadata as oe } from "../package-metadata.mjs";
|
|
17
|
+
import { hasParent as qe } from "./utils/index.mjs";
|
|
18
|
+
import { hyperlinkOpenIcon as ne, xIcon as Ge } from "@progress/kendo-svg-icons";
|
|
19
|
+
const Ae = 250, Ve = 84, re = 3, se = 2, je = "#000000", Ue = "#ffffff", ae = (d) => d !== void 0, He = _e(), F = o.forwardRef((d, ie) => {
|
|
20
|
+
const le = !Ie(oe, { component: "Signature" }), ce = Pe(oe), _ = De(He, 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: i.strokeWidth,
|
|
23
|
+
smooth: i.smooth,
|
|
24
|
+
popupScale: i.popupScale,
|
|
25
|
+
exportScale: i.exportScale,
|
|
26
|
+
maximizable: i.maximizable,
|
|
27
|
+
disabled: i.disabled,
|
|
28
|
+
required: i.required,
|
|
29
|
+
validityStyles: i.validityStyles,
|
|
30
|
+
onChange: i.onChange,
|
|
31
|
+
onFocus: i.onFocus,
|
|
32
|
+
onBlur: i.onBlur,
|
|
33
|
+
onOpen: i.onOpen,
|
|
34
|
+
onClose: i.onClose,
|
|
35
|
+
size: i.size,
|
|
36
|
+
rounded: i.rounded,
|
|
37
|
+
fillMode: i.fillMode,
|
|
38
38
|
..._
|
|
39
39
|
}),
|
|
40
40
|
[_]
|
|
41
|
-
), S =
|
|
41
|
+
), S = Ne(), u = o.useRef(null), g = o.useRef(null), W = o.useRef(null), N = o.useRef(null), z = o.useRef(null), [r, ue] = o.useState(), [k, q] = o.useState(!1), [E, G] = o.useState(!1), [b, A] = o.useState(), [de, me] = o.useState(), V = ae(e.value) ? e.value : b, [pe, fe] = o.useState(!1), p = ae(e.open), m = p ? e.open : pe, ge = e.maximized || E || !e.maximizable || e.disabled, ke = !(e.maximized && !E), be = !(!(e.value || b) || E || e.readOnly || e.disabled), ve = S.toLanguageString(Z, B[Z]), ye = S.toLanguageString(ee, B[ee]), Ce = S.toLanguageString(te, B[te]), O = e.popupScale || re, x = e.exportScale || se, M = (t) => {
|
|
42
42
|
A(t), e.onChange && e.onChange({ value: t });
|
|
43
|
-
},
|
|
43
|
+
}, he = (t) => {
|
|
44
44
|
r == null || r.loadImage(t.value), M(t.value);
|
|
45
45
|
};
|
|
46
46
|
o.useEffect(() => {
|
|
47
|
-
e.value !==
|
|
47
|
+
e.value !== b && (A(e.value), r == null || r.loadImage(e.value));
|
|
48
48
|
}, [e.value]);
|
|
49
|
-
const
|
|
49
|
+
const Se = () => {
|
|
50
50
|
r == null || r.clear(), M();
|
|
51
51
|
}, v = o.useCallback(
|
|
52
52
|
(t) => {
|
|
53
|
-
p ||
|
|
53
|
+
p || fe(t);
|
|
54
54
|
},
|
|
55
55
|
[p]
|
|
56
|
-
),
|
|
57
|
-
var n,
|
|
58
|
-
|
|
59
|
-
},
|
|
60
|
-
let t =
|
|
61
|
-
return !e.color && typeof document != "undefined" &&
|
|
62
|
-
}, [e.color]),
|
|
63
|
-
let t =
|
|
64
|
-
return !e.backgroundColor && typeof document != "undefined" &&
|
|
65
|
-
}, [e.backgroundColor]),
|
|
56
|
+
), ze = (t) => {
|
|
57
|
+
var n, s;
|
|
58
|
+
X(t), (s = ((n = z.current) == null ? void 0 : n.element) || g.current) == null || s.focus();
|
|
59
|
+
}, w = o.useCallback(() => {
|
|
60
|
+
let t = je;
|
|
61
|
+
return !e.color && typeof document != "undefined" && u.current && (t = getComputedStyle(u.current).color), e.color || t;
|
|
62
|
+
}, [e.color]), L = o.useCallback(() => {
|
|
63
|
+
let t = Ue;
|
|
64
|
+
return !e.backgroundColor && typeof document != "undefined" && u.current && (t = getComputedStyle(u.current).backgroundColor), e.backgroundColor || t;
|
|
65
|
+
}, [e.backgroundColor]), j = () => ({
|
|
66
66
|
scale: e.maximized ? e.popupScale : 1,
|
|
67
|
-
color:
|
|
68
|
-
backgroundColor:
|
|
67
|
+
color: w(),
|
|
68
|
+
backgroundColor: L(),
|
|
69
69
|
strokeWidth: e.strokeWidth,
|
|
70
70
|
smooth: e.smooth,
|
|
71
71
|
readonly: e.readOnly
|
|
72
|
-
}),
|
|
73
|
-
const { width: n, height:
|
|
72
|
+
}), U = async (t) => {
|
|
73
|
+
const { width: n, height: s } = t;
|
|
74
74
|
return await (r == null ? void 0 : r.exportImage({
|
|
75
75
|
width: n * x,
|
|
76
|
-
height:
|
|
76
|
+
height: s * x
|
|
77
77
|
}));
|
|
78
78
|
};
|
|
79
79
|
o.useEffect(() => {
|
|
80
|
-
const t = g.current, n = new Le(t,
|
|
81
|
-
return V && n.loadImage(V),
|
|
80
|
+
const t = g.current, n = new Le(t, j());
|
|
81
|
+
return V && n.loadImage(V), ue(n), () => n.destroy();
|
|
82
82
|
}, []), o.useEffect(() => {
|
|
83
83
|
r == null || r.setOptions({
|
|
84
|
-
onChange: async () => M(await
|
|
84
|
+
onChange: async () => M(await U(J())),
|
|
85
85
|
onDraw: () => G(!0),
|
|
86
86
|
onDrawEnd: () => G(!1)
|
|
87
87
|
});
|
|
88
|
-
}, [r]),
|
|
89
|
-
() => r == null ? void 0 : r.setOptions(
|
|
88
|
+
}, [r]), Re(
|
|
89
|
+
() => r == null ? void 0 : r.setOptions(j()),
|
|
90
90
|
[e.readOnly, e.color, e.backgroundColor, e.strokeWidth, e.smooth]
|
|
91
91
|
), o.useEffect(() => {
|
|
92
|
-
var
|
|
93
|
-
const t = (
|
|
92
|
+
var s, c;
|
|
93
|
+
const t = (c = (s = W.current) == null ? void 0 : s.element) == null ? void 0 : c.querySelector(".k-overlay");
|
|
94
94
|
if (!t)
|
|
95
95
|
return;
|
|
96
96
|
const n = () => v(!1);
|
|
@@ -99,183 +99,181 @@ const qe = 250, Ge = 84, se = 3, le = 2, Ae = "#000000", Ve = "#ffffff", ie = (d
|
|
|
99
99
|
if (!m || typeof document == "undefined")
|
|
100
100
|
return;
|
|
101
101
|
const t = (n) => {
|
|
102
|
-
var
|
|
103
|
-
n.key === "Escape" && (v(!1), (
|
|
102
|
+
var s, c;
|
|
103
|
+
n.key === "Escape" && (v(!1), (c = (s = z.current) == null ? void 0 : s.element) == null || c.focus());
|
|
104
104
|
};
|
|
105
105
|
return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
|
|
106
106
|
}, [m]), o.useEffect(() => {
|
|
107
107
|
var t, n;
|
|
108
|
-
e.maximized && ((n = (t =
|
|
108
|
+
e.maximized && ((n = (t = N.current) == null ? void 0 : t.element) == null || n.focus());
|
|
109
109
|
}, []);
|
|
110
110
|
const I = o.useCallback(() => {
|
|
111
111
|
var t;
|
|
112
112
|
return (t = g.current) == null ? void 0 : t.focus();
|
|
113
|
-
}, []), y = o.useCallback(() => e.value, [e.value]),
|
|
114
|
-
const t = e.validationMessage !== void 0,
|
|
113
|
+
}, []), y = o.useCallback(() => e.value, [e.value]), H = o.useCallback(() => e.name, [e.name]), C = o.useCallback(() => e.required, [e.required]), P = o.useCallback(() => {
|
|
114
|
+
const t = e.validationMessage !== void 0, s = !y(), c = e.valid !== void 0 ? e.valid : !C() || !s;
|
|
115
115
|
return {
|
|
116
116
|
customError: t,
|
|
117
|
-
valid:
|
|
118
|
-
valueMissing:
|
|
117
|
+
valid: c,
|
|
118
|
+
valueMissing: s
|
|
119
119
|
};
|
|
120
|
-
}, [e.validationMessage, e.valid, y, C]), D = o.useCallback(() => e.validityStyles, [e.validityStyles]),
|
|
120
|
+
}, [e.validationMessage, e.valid, y, C]), D = o.useCallback(() => e.validityStyles, [e.validityStyles]), $ = o.useCallback(() => e, [e]), l = o.useCallback(() => {
|
|
121
121
|
const t = {
|
|
122
|
-
element:
|
|
122
|
+
element: u.current,
|
|
123
123
|
focus: I
|
|
124
124
|
};
|
|
125
|
-
return Object.defineProperty(t, "name", { get:
|
|
125
|
+
return Object.defineProperty(t, "name", { get: H }), Object.defineProperty(t, "value", { get: y }), Object.defineProperty(t, "validity", { get: P }), Object.defineProperty(t, "validityStyles", { get: D }), Object.defineProperty(t, "required", { get: C }), Object.defineProperty(t, "props", { get: $ }), Object.defineProperty(t, "color", { get: w }), Object.defineProperty(t, "backgroundColor", { get: L }), t;
|
|
126
126
|
}, [
|
|
127
|
-
|
|
127
|
+
H,
|
|
128
128
|
y,
|
|
129
129
|
P,
|
|
130
130
|
D,
|
|
131
131
|
C,
|
|
132
132
|
I,
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
133
|
+
$,
|
|
134
|
+
w,
|
|
135
|
+
L
|
|
136
136
|
]);
|
|
137
|
-
o.useImperativeHandle(
|
|
138
|
-
const
|
|
137
|
+
o.useImperativeHandle(ie, l);
|
|
138
|
+
const K = o.useRef(null);
|
|
139
|
+
o.useImperativeHandle(K, l), Te("signature", K, e, e.webMcp);
|
|
140
|
+
const Ee = o.useCallback(
|
|
139
141
|
(t) => {
|
|
140
|
-
|
|
142
|
+
k || e.maximized || (q(!0), h(e.onFocus, t, l(), {}));
|
|
141
143
|
},
|
|
142
|
-
[
|
|
143
|
-
),
|
|
144
|
+
[k, e.onFocus, l]
|
|
145
|
+
), Oe = o.useCallback(
|
|
144
146
|
(t) => {
|
|
145
|
-
|
|
147
|
+
qe(t.relatedTarget, u.current) || (q(!1), h(e.onBlur, t, l(), {}));
|
|
146
148
|
},
|
|
147
|
-
[
|
|
148
|
-
),
|
|
149
|
+
[k, e.onBlur, l]
|
|
150
|
+
), xe = o.useCallback(
|
|
149
151
|
async (t) => {
|
|
150
|
-
|
|
152
|
+
me(await U(Q())), v(!0), h(e.onOpen, t, l(), {});
|
|
151
153
|
},
|
|
152
|
-
[m, p, e.onOpen, e.value,
|
|
153
|
-
),
|
|
154
|
+
[m, p, e.onOpen, e.value, b, l]
|
|
155
|
+
), X = o.useCallback(
|
|
154
156
|
(t) => {
|
|
155
|
-
v(!1), h(e.onClose, t,
|
|
157
|
+
v(!1), h(e.onClose, t, l(), {});
|
|
156
158
|
},
|
|
157
|
-
[m, p, e.onClose,
|
|
158
|
-
),
|
|
159
|
-
|
|
160
|
-
},
|
|
161
|
-
var
|
|
162
|
-
const t = e.width || ((
|
|
159
|
+
[m, p, e.onClose, l]
|
|
160
|
+
), Me = () => {
|
|
161
|
+
Se(), I();
|
|
162
|
+
}, J = () => {
|
|
163
|
+
var s, c;
|
|
164
|
+
const t = e.width || ((s = u.current) == null ? void 0 : s.offsetWidth) || Ae, n = e.height || ((c = u.current) == null ? void 0 : c.offsetHeight) || Ve;
|
|
163
165
|
return {
|
|
164
166
|
width: t,
|
|
165
167
|
height: n
|
|
166
168
|
};
|
|
167
|
-
},
|
|
168
|
-
const { width: t, height: n } =
|
|
169
|
+
}, Q = () => {
|
|
170
|
+
const { width: t, height: n } = J();
|
|
169
171
|
return {
|
|
170
172
|
width: t * O,
|
|
171
173
|
height: n * O
|
|
172
174
|
};
|
|
173
|
-
},
|
|
175
|
+
}, we = !D() || P().valid;
|
|
174
176
|
return /* @__PURE__ */ o.createElement(
|
|
175
177
|
"div",
|
|
176
178
|
{
|
|
177
|
-
ref:
|
|
179
|
+
ref: u,
|
|
178
180
|
dir: e.dir,
|
|
179
181
|
style: { width: e.width, height: e.height, ...e.style },
|
|
180
|
-
className:
|
|
182
|
+
className: T(
|
|
181
183
|
"k-input",
|
|
182
184
|
"k-signature",
|
|
183
185
|
{
|
|
184
186
|
"k-signature-maximized": e.maximized,
|
|
185
|
-
[`k-signature-${
|
|
187
|
+
[`k-signature-${Y.sizeMap[e.size] || e.size}`]: e.size,
|
|
186
188
|
[`k-signature-${e.fillMode}`]: e.fillMode,
|
|
187
189
|
[`k-input-${e.fillMode}`]: e.fillMode,
|
|
188
|
-
[`k-rounded-${
|
|
189
|
-
"k-invalid": !
|
|
190
|
+
[`k-rounded-${Y.roundedMap[e.rounded] || e.rounded}`]: e.rounded,
|
|
191
|
+
"k-invalid": !we,
|
|
190
192
|
"k-required": e.required,
|
|
191
193
|
"k-disabled": e.disabled,
|
|
192
|
-
"k-focus":
|
|
194
|
+
"k-focus": k
|
|
193
195
|
},
|
|
194
196
|
e.className
|
|
195
197
|
),
|
|
196
|
-
onFocus:
|
|
197
|
-
onBlur:
|
|
198
|
+
onFocus: Ee,
|
|
199
|
+
onBlur: Oe
|
|
198
200
|
},
|
|
199
201
|
/* @__PURE__ */ o.createElement(
|
|
200
202
|
"div",
|
|
201
203
|
{
|
|
202
204
|
className: "k-signature-canvas",
|
|
203
205
|
ref: g,
|
|
204
|
-
tabIndex: Te(e.tabIndex, e.disabled),
|
|
205
206
|
role: "img",
|
|
207
|
+
tabIndex: Be(e.tabIndex, e.disabled),
|
|
206
208
|
id: e.id,
|
|
207
209
|
"aria-label": e.ariaLabel,
|
|
208
210
|
"aria-labelledby": e.ariaLabelledBy,
|
|
209
211
|
"aria-describedby": e.ariaDescribedBy,
|
|
210
|
-
"aria-disabled": e.disabled ? "true" : void 0,
|
|
211
212
|
style: e.inputStyle
|
|
212
213
|
}
|
|
213
214
|
),
|
|
214
215
|
/* @__PURE__ */ o.createElement("div", { className: "k-signature-actions k-signature-actions-top" }, /* @__PURE__ */ o.createElement(
|
|
215
|
-
|
|
216
|
+
R,
|
|
216
217
|
{
|
|
217
218
|
type: "button",
|
|
218
|
-
className:
|
|
219
|
-
"k-hidden": e.disabled ||
|
|
219
|
+
className: T("k-signature-action", "k-signature-maximize", {
|
|
220
|
+
"k-hidden": e.disabled || ge
|
|
220
221
|
}),
|
|
221
222
|
ref: z,
|
|
222
223
|
icon: "hyperlink-open",
|
|
223
|
-
svgIcon:
|
|
224
|
+
svgIcon: ne,
|
|
224
225
|
size: e.size,
|
|
225
226
|
rounded: e.rounded,
|
|
226
227
|
fillMode: "flat",
|
|
227
|
-
onClick:
|
|
228
|
-
|
|
229
|
-
title: j
|
|
228
|
+
onClick: xe,
|
|
229
|
+
title: ve
|
|
230
230
|
}
|
|
231
231
|
), /* @__PURE__ */ o.createElement(
|
|
232
|
-
|
|
232
|
+
R,
|
|
233
233
|
{
|
|
234
234
|
type: "button",
|
|
235
|
-
className:
|
|
236
|
-
"k-hidden": e.disabled ||
|
|
235
|
+
className: T("k-signature-action", "k-signature-minimize", {
|
|
236
|
+
"k-hidden": e.disabled || ke
|
|
237
237
|
}),
|
|
238
|
-
ref:
|
|
238
|
+
ref: N,
|
|
239
239
|
icon: "hyperlink-open",
|
|
240
|
-
svgIcon:
|
|
240
|
+
svgIcon: ne,
|
|
241
241
|
size: e.size,
|
|
242
242
|
rounded: e.rounded,
|
|
243
243
|
fillMode: "flat",
|
|
244
|
-
onClick:
|
|
245
|
-
|
|
246
|
-
title: U
|
|
244
|
+
onClick: X,
|
|
245
|
+
title: ye
|
|
247
246
|
}
|
|
248
247
|
)),
|
|
249
248
|
!e.hideLine && /* @__PURE__ */ o.createElement("div", { className: "k-signature-line", style: { zIndex: 2, pointerEvents: "none" } }),
|
|
250
|
-
/* @__PURE__ */ o.createElement("div", { className: "k-signature-actions k-signature-actions-bottom" },
|
|
251
|
-
|
|
249
|
+
/* @__PURE__ */ o.createElement("div", { className: "k-signature-actions k-signature-actions-bottom" }, be && /* @__PURE__ */ o.createElement(
|
|
250
|
+
R,
|
|
252
251
|
{
|
|
253
252
|
type: "button",
|
|
254
253
|
className: "k-signature-action k-signature-clear",
|
|
255
254
|
icon: "x",
|
|
256
|
-
svgIcon:
|
|
255
|
+
svgIcon: Ge,
|
|
257
256
|
size: e.size,
|
|
258
257
|
rounded: e.rounded,
|
|
259
258
|
fillMode: "flat",
|
|
260
|
-
onClick:
|
|
261
|
-
|
|
262
|
-
title: H
|
|
259
|
+
onClick: Me,
|
|
260
|
+
title: Ce
|
|
263
261
|
}
|
|
264
262
|
)),
|
|
265
|
-
m && /* @__PURE__ */ o.createElement(
|
|
263
|
+
m && /* @__PURE__ */ o.createElement(We, { ref: W }, /* @__PURE__ */ o.createElement(
|
|
266
264
|
F,
|
|
267
265
|
{
|
|
268
266
|
...e,
|
|
269
|
-
...
|
|
270
|
-
value:
|
|
267
|
+
...Q(),
|
|
268
|
+
value: de,
|
|
271
269
|
maximized: !0,
|
|
272
270
|
exportScale: 1 / O * x,
|
|
273
271
|
open: !1,
|
|
274
|
-
onChange:
|
|
275
|
-
onClose:
|
|
272
|
+
onChange: he,
|
|
273
|
+
onClose: ze
|
|
276
274
|
}
|
|
277
275
|
)),
|
|
278
|
-
|
|
276
|
+
le && /* @__PURE__ */ o.createElement(Fe, { message: ce })
|
|
279
277
|
);
|
|
280
278
|
});
|
|
281
279
|
F.propTypes = {
|
|
@@ -300,11 +298,11 @@ F.propTypes = {
|
|
|
300
298
|
rounded: a.oneOf(["small", "medium", "large", "none"]),
|
|
301
299
|
fillMode: a.oneOf(["solid", "flat", "outline"])
|
|
302
300
|
};
|
|
303
|
-
const
|
|
301
|
+
const i = {
|
|
304
302
|
strokeWidth: 1,
|
|
305
303
|
smooth: !1,
|
|
306
|
-
popupScale:
|
|
307
|
-
exportScale:
|
|
304
|
+
popupScale: re,
|
|
305
|
+
exportScale: se,
|
|
308
306
|
maximizable: !0,
|
|
309
307
|
disabled: !1,
|
|
310
308
|
required: !1,
|
|
@@ -321,5 +319,5 @@ const s = {
|
|
|
321
319
|
F.displayName = "KendoSignature";
|
|
322
320
|
export {
|
|
323
321
|
F as Signature,
|
|
324
|
-
|
|
322
|
+
He as SignaturePropsContext
|
|
325
323
|
};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { FormComponentProps } from '@progress/kendo-react-common';
|
|
8
|
+
import { FormComponentProps, WebMcpProps } from '@progress/kendo-react-common';
|
|
9
9
|
import { SignatureChangeEvent } from './SignatureChangeEvent';
|
|
10
10
|
import { SignatureFocusEvent } from './SignatureFocusEvent';
|
|
11
11
|
import { SignatureBlurEvent } from './SignatureBlurEvent';
|
|
@@ -332,4 +332,9 @@ export interface SignatureProps extends FormComponentProps {
|
|
|
332
332
|
children?: React.ReactNode;
|
|
333
333
|
/** @hidden */
|
|
334
334
|
maximized?: boolean;
|
|
335
|
+
/**
|
|
336
|
+
* Enables Web MCP tool registration for this component.
|
|
337
|
+
* Requires a parent `WebMcpProvider` from `@progress/kendo-react-webmcp`.
|
|
338
|
+
*/
|
|
339
|
+
webMcp?: boolean | WebMcpProps;
|
|
335
340
|
}
|
package/slider/Slider.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { FormComponentProps, BaseEvent } from '@progress/kendo-react-common';
|
|
8
|
+
import { FormComponentProps, BaseEvent, WebMcpProps } from '@progress/kendo-react-common';
|
|
9
9
|
import { Direction } from '../interfaces/Direction';
|
|
10
10
|
import * as React from 'react';
|
|
11
11
|
/**
|
|
@@ -196,6 +196,11 @@ export interface SliderProps extends FormComponentProps {
|
|
|
196
196
|
* ```
|
|
197
197
|
*/
|
|
198
198
|
dir?: Direction;
|
|
199
|
+
/**
|
|
200
|
+
* Enables Web MCP tool registration for this component.
|
|
201
|
+
* Requires a parent `WebMcpProvider` from `@progress/kendo-react-webmcp`.
|
|
202
|
+
*/
|
|
203
|
+
webMcp?: boolean | WebMcpProps;
|
|
199
204
|
}
|
|
200
205
|
/** @hidden */
|
|
201
206
|
export declare const SliderWithoutContext: React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<SliderHandle>>;
|
package/slider/Slider.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 a=require("react"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),i=require("prop-types"),s=require("@progress/kendo-react-common"),F=require("@progress/kendo-react-intl"),r=require("../messages/index.js"),ae=require("./SliderLabel.js"),j=require("@progress/kendo-react-buttons"),f=require("@progress/kendo-svg-icons");function le(e){const k=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const v=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(k,o,v.get?v:{enumerable:!0,get:()=>e[o]})}}return k.default=e,Object.freeze(k)}const c=le(a),h={step:1,largeStep:10,buttons:!1,vertical:!1,disabled:!1,tabIndex:0},R=c.forwardRef((e,k)=>{var K,M,O;const{step:o=h.step,largeStep:v=h.largeStep,vertical:l=h.vertical,disabled:m=h.disabled,tabIndex:P=h.tabIndex}=e,[U,W]=a.useState((K=e.defaultValue)!=null?K:e.min),[H,z]=a.useState(!1),[E,X]=a.useState(e.dir),N=a.useRef(null),y=a.useRef(null),S=a.useMemo(()=>new F.LocalizationService,[]),A=a.useRef(null),B=e.value!==void 0,w=B&&e.value!==void 0?e.value:U,d=a.useMemo(()=>w<e.min?e.min:w>e.max?e.max:w,[w,e.min,e.max]),C=a.useMemo(()=>{const t=e.max-e.min;return t===0?0:(d-e.min)/t*100},[d,e.min,e.max]),b=(M=e.dir)!=null?M:E;a.useEffect(()=>{if(e.dir===void 0&&y.current){const n=window.getComputedStyle(y.current).direction;n!==E&&X(n)}},[e.dir,E]);const q=a.useCallback(t=>{let n=t;for(;n;){if(n.getAttribute(ae.SLIDER_LABEL_ATTRIBUTE))return!0;n=n.parentElement}return!1},[]),g=a.useCallback((t,n)=>{const u=Math.min(Math.max(n,e.min),e.max);B||W(u),s.dispatchEvent(e.onChange,t,A.current,{value:u})},[e.min,e.max,e.onChange,B]),G=a.useCallback(()=>{z(!0)},[]),Y=a.useCallback(()=>{z(!1)},[]),J=a.useCallback(t=>{if(m)return;let n;t.keyCode===s.Keys.left||t.keyCode===s.Keys.down?n=d-(o||0):t.keyCode===s.Keys.right||t.keyCode===s.Keys.up?n=d+(o||0):t.keyCode===s.Keys.pageDown?n=d-(v||0):t.keyCode===s.Keys.pageUp?n=d+(v||0):t.keyCode===s.Keys.home?n=e.min:t.keyCode===s.Keys.end&&(n=e.max),n!==void 0&&(t.preventDefault(),g(t,n))},[d,o,v,e.min,e.max,g,m]),Q=a.useCallback(t=>{t.preventDefault(),!m&&g(t,d-(o||0))},[d,o,g,m]),Z=a.useCallback(t=>{t.preventDefault(),!m&&g(t,d+(o||0))},[d,o,g,m]),D=a.useCallback(t=>{const n=t.element.getBoundingClientRect();let u;l?u=n.bottom-t.event.clientY:u=b==="rtl"?n.right-t.event.clientX:t.event.clientX-n.left;const x=l?n.height:n.width,I=u/x;g(t,e.min+I*(e.max-e.min))},[l,e.min,e.max,b,g]),$=a.useCallback(t=>{q(t.event.originalEvent.target)||(t.event.isTouch&&t.event.originalEvent.preventDefault(),D(t))},[q,D]),p=a.useCallback(t=>{t.event.originalEvent.preventDefault(),D(t)},[D]),L=a.useCallback(()=>{y.current&&y.current.focus()},[]),ee=a.useCallback(t=>{if(!t.enabled)return t.children;let n,u,x,I;return b==="rtl"?(n=l?f.chevronUpIcon:f.chevronLeftIcon,u=l?f.chevronDownIcon:f.chevronRightIcon,x=l?"chevron-up":"chevron-left",I=l?"chevron-down":"chevron-right"):(n=l?f.chevronUpIcon:f.chevronRightIcon,u=l?f.chevronDownIcon:f.chevronLeftIcon,x=l?"chevron-up":"chevron-right",I=l?"chevron-down":"chevron-left"),c.createElement(c.Fragment,null,c.createElement(j.Button,{className:"k-button-decrease",rounded:"full",icon:I,svgIcon:u,title:t.decrementTitle,onClick:t.decrement}),t.children,c.createElement(j.Button,{className:"k-button-increase",rounded:"full",icon:x,svgIcon:n,title:t.incrementTitle,onClick:t.increment}))},[b,l]);a.useImperativeHandle(k,()=>({props:e,sliderTrack:N.current,focus:L}),[e,L]),s.useWebMcpRegister("slider",A,e,e.webMcp),a.useEffect(()=>{A.current={props:e,sliderTrack:N.current,focus:L}},[e,L]);const te=l?{marginTop:"0.5rem",marginBottom:"0.5rem"}:{marginLeft:"0.5rem",marginRight:"0.5rem"},ne=l?{paddingTop:0,height:"100%"}:{};let T;return l?T={bottom:"calc("+C+"%)",zIndex:1}:b==="rtl"?T={right:"calc("+C+"% - 13px)",zIndex:1}:T={left:"calc("+C+"%)",zIndex:1},c.createElement("div",{ref:y,dir:b,id:e.id,"aria-label":e.ariaLabel||S.toLanguageString(r.sliderAriaLabel,r.messages[r.sliderAriaLabel]),style:{gap:0,...e.style},onFocus:G,onBlur:Y,onKeyDown:J,className:s.classNames("k-slider",{"k-focus":H,"k-disabled":m,"k-slider-horizontal":!l,"k-slider-vertical":l},e.className)},ee({enabled:(O=e.buttons)!=null?O:h.buttons,decrement:Q,increment:Z,incrementTitle:S.toLanguageString(r.sliderIncreaseValue,r.messages[r.sliderIncreaseValue]),decrementTitle:S.toLanguageString(r.sliderDecreaseValue,r.messages[r.sliderDecreaseValue]),children:c.createElement(s.Draggable,{onDrag:p,onPress:$,autoScroll:!1},c.createElement("div",{className:"k-slider-track-wrap",style:{flexGrow:1,position:"relative",touchAction:"none",...te}},e.children&&c.createElement("ul",{className:"k-reset k-slider-items","aria-hidden":"true",style:{margin:0,...ne}},c.Children.map(e.children,(t,n)=>t&&c.cloneElement(t,{position:100*(t.props.position-e.min)/(e.max-e.min),vertical:l,firstTick:n===0,lastTick:n===c.Children.count(e.children)-1},t.props.children))),c.createElement("div",{className:"k-slider-track",style:l?{bottom:0,height:"100%"}:{[b==="rtl"?"right":"left"]:0,width:"100%"},ref:N},c.createElement("div",{className:"k-slider-selection",style:l?{height:C+"%"}:{width:C+"%"}}),c.createElement("span",{role:"slider","aria-valuemin":e.min,"aria-valuemax":e.max,"aria-valuenow":d,"aria-orientation":l?"vertical":void 0,"aria-disabled":m?"true":void 0,"aria-labelledby":e.ariaLabelledBy,"aria-describedby":e.ariaDescribedBy,"aria-label":e.ariaLabel||S.toLanguageString(r.sliderAriaLabel,r.messages[r.sliderAriaLabel]),tabIndex:s.getTabIndex(P,m,void 0),className:"k-draghandle k-draghandle-end",title:S.toLanguageString(r.sliderDragTitle,r.messages[r.sliderDragTitle]),style:T}))))}))});R.displayName="Slider";const _=s.createPropsContext(),V=s.withPropsContext(_,R);V.displayName="KendoReactSlider";V.propTypes={value:i.number,defaultValue:i.number,min:i.number.isRequired,max:i.number.isRequired,step:i.number,largeStep:i.number,onChange:i.func,style:i.object,className:i.string,buttons:i.bool,tabIndex:i.number,disabled:i.bool,vertical:i.bool,id:i.string,ariaDescribedBy:i.string,ariaLabelledBy:i.string,ariaLabel:i.string,dir:i.oneOf(["ltr","rtl"]),children:i.node};F.registerForLocalization(R);exports.Slider=V;exports.SliderPropsContext=_;exports.SliderWithoutContext=R;
|