@progress/kendo-react-inputs 9.5.0 → 10.0.0-develop.2
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 +21 -23
- package/colors/ColorGradient.js +1 -1
- package/colors/ColorGradient.mjs +61 -60
- package/colors/ColorPalette.js +1 -1
- package/colors/ColorPalette.mjs +25 -26
- package/colors/ColorPicker.js +1 -1
- package/colors/ColorPicker.mjs +78 -79
- package/colors/FlatColorPicker.js +1 -1
- package/colors/FlatColorPicker.mjs +61 -62
- 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.js +1 -1
- package/input/Input.mjs +36 -39
- package/maskedtextbox/MaskedTextBox.js +1 -1
- package/maskedtextbox/MaskedTextBox.mjs +79 -80
- package/numerictextbox/NumericTextBox.js +1 -1
- package/numerictextbox/NumericTextBox.mjs +18 -20
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +9 -9
- package/radiobutton/RadioButton.js +1 -1
- package/radiobutton/RadioButton.mjs +37 -39
- package/radiobutton/RadioGroup.js +1 -1
- package/radiobutton/RadioGroup.mjs +19 -21
- package/range-slider/RangeSlider.js +7 -7
- package/range-slider/RangeSlider.mjs +100 -101
- package/signature/Signature.js +1 -1
- package/signature/Signature.mjs +58 -58
- package/slider/Slider.js +1 -1
- package/slider/Slider.mjs +15 -16
- package/switch/Switch.js +1 -1
- package/switch/Switch.mjs +15 -16
- package/textbox/Textbox.js +1 -1
- package/textbox/Textbox.mjs +43 -45
|
@@ -8,18 +8,16 @@
|
|
|
8
8
|
import * as n from "react";
|
|
9
9
|
import t from "prop-types";
|
|
10
10
|
import { useInternationalization as Xe, useLocalization as Ze } from "@progress/kendo-react-intl";
|
|
11
|
-
import { createPropsContext as et,
|
|
12
|
-
import { caretAltUpIcon as
|
|
13
|
-
import { FloatingLabel as
|
|
14
|
-
import { packageMetadata as ct } from "../package-metadata.mjs";
|
|
11
|
+
import { createPropsContext as et, usePropsContext as tt, useId as nt, useCustomComponent as pe, dispatchEvent as Q, getActiveElement as be, useIsomorphicLayoutEffect as rt, classNames as at, kendoThemeMaps as ge, getTabIndex as lt } from "@progress/kendo-react-common";
|
|
12
|
+
import { caretAltUpIcon as st, caretAltDownIcon as ut } from "@progress/kendo-svg-icons";
|
|
13
|
+
import { FloatingLabel as ot } from "@progress/kendo-react-labels";
|
|
15
14
|
import { numericIncreaseValue as M, messages as T, numericDecreaseValue as z } from "../messages/index.mjs";
|
|
16
15
|
import { getInitialState as ve, formatValue as q, getStateOrPropsValue as X, rangeValue as A, sanitizeNumber as ye, decreaseValue as Ve, increaseValue as ke } from "./utils/index.mjs";
|
|
17
16
|
import { Button as Ce } from "@progress/kendo-react-buttons";
|
|
18
|
-
const
|
|
17
|
+
const it = "Please enter a valid value!", ct = et(), Ee = n.forwardRef(
|
|
19
18
|
(C, Se) => {
|
|
20
|
-
tt(
|
|
21
|
-
|
|
22
|
-
mt,
|
|
19
|
+
const G = tt(
|
|
20
|
+
ct,
|
|
23
21
|
C
|
|
24
22
|
), {
|
|
25
23
|
className: xe,
|
|
@@ -45,9 +43,9 @@ const dt = "Please enter a valid value!", mt = et(), Ee = n.forwardRef(
|
|
|
45
43
|
validationMessage: _,
|
|
46
44
|
children: Be,
|
|
47
45
|
// Removed to support direct use in Form Field component
|
|
48
|
-
touched:
|
|
49
|
-
visited:
|
|
50
|
-
modified:
|
|
46
|
+
touched: dt,
|
|
47
|
+
visited: mt,
|
|
48
|
+
modified: ft,
|
|
51
49
|
style: ne,
|
|
52
50
|
inputStyle: Me,
|
|
53
51
|
valid: H,
|
|
@@ -68,7 +66,7 @@ const dt = "Please enter a valid value!", mt = et(), Ee = n.forwardRef(
|
|
|
68
66
|
autoFocus: Ae = o.autoFocus,
|
|
69
67
|
inputAttributes: Ge,
|
|
70
68
|
...ue
|
|
71
|
-
} = G, je =
|
|
69
|
+
} = G, je = nt(), oe = Pe || je, s = Xe(), P = Ze(), a = n.useRef(null), N = n.useRef(), [_e, S] = n.useState(!1), i = n.useRef(ve()), D = n.useRef(!1), U = n.useRef(), x = n.useRef(he), h = q(
|
|
72
70
|
i.current.focused && !u ? i.current.currentLooseValue : X(b, x.current),
|
|
73
71
|
l,
|
|
74
72
|
s
|
|
@@ -77,7 +75,7 @@ const dt = "Please enter a valid value!", mt = et(), Ee = n.forwardRef(
|
|
|
77
75
|
const [He] = pe(ze), [Ke] = pe(qe);
|
|
78
76
|
n.useEffect(() => {
|
|
79
77
|
a.current && a.current.setCustomValidity && a.current.setCustomValidity(
|
|
80
|
-
B().valid ? "" : _ ||
|
|
78
|
+
B().valid ? "" : _ || it
|
|
81
79
|
);
|
|
82
80
|
});
|
|
83
81
|
const ie = n.useCallback(() => {
|
|
@@ -215,7 +213,7 @@ const dt = "Please enter a valid value!", mt = et(), Ee = n.forwardRef(
|
|
|
215
213
|
r.preventDefault(), e !== a.current && a.current.focus();
|
|
216
214
|
}
|
|
217
215
|
}, []);
|
|
218
|
-
|
|
216
|
+
rt(() => {
|
|
219
217
|
a.current && a.current.type !== "number" && i.current.selectionStart !== void 0 && i.current.selectionEnd !== void 0 && (a.current.selectionStart = i.current.selectionStart, a.current.selectionEnd = i.current.selectionEnd, i.current.selectionStart = void 0, i.current.selectionEnd = void 0);
|
|
220
218
|
}, [_e]);
|
|
221
219
|
const me = !$() || B().valid, fe = /* @__PURE__ */ n.createElement(
|
|
@@ -223,7 +221,7 @@ const dt = "Please enter a valid value!", mt = et(), Ee = n.forwardRef(
|
|
|
223
221
|
{
|
|
224
222
|
dir: te,
|
|
225
223
|
style: I ? ne : { width: Z, ...ne },
|
|
226
|
-
className:
|
|
224
|
+
className: at(
|
|
227
225
|
"k-input",
|
|
228
226
|
"k-numerictextbox",
|
|
229
227
|
{
|
|
@@ -245,7 +243,7 @@ const dt = "Please enter a valid value!", mt = et(), Ee = n.forwardRef(
|
|
|
245
243
|
{
|
|
246
244
|
role: "spinbutton",
|
|
247
245
|
value: h === null ? "" : h,
|
|
248
|
-
tabIndex:
|
|
246
|
+
tabIndex: lt(Ie, u),
|
|
249
247
|
accessKey: Oe,
|
|
250
248
|
disabled: u,
|
|
251
249
|
title: Le,
|
|
@@ -285,7 +283,7 @@ const dt = "Please enter a valid value!", mt = et(), Ee = n.forwardRef(
|
|
|
285
283
|
tabIndex: -1,
|
|
286
284
|
type: "button",
|
|
287
285
|
icon: "caret-alt-up",
|
|
288
|
-
svgIcon:
|
|
286
|
+
svgIcon: st,
|
|
289
287
|
rounded: null,
|
|
290
288
|
fillMode: L,
|
|
291
289
|
className: "k-spinner-increase",
|
|
@@ -305,7 +303,7 @@ const dt = "Please enter a valid value!", mt = et(), Ee = n.forwardRef(
|
|
|
305
303
|
tabIndex: -1,
|
|
306
304
|
type: "button",
|
|
307
305
|
icon: "caret-alt-down",
|
|
308
|
-
svgIcon:
|
|
306
|
+
svgIcon: ut,
|
|
309
307
|
rounded: null,
|
|
310
308
|
fillMode: L,
|
|
311
309
|
className: "k-spinner-decrease",
|
|
@@ -322,7 +320,7 @@ const dt = "Please enter a valid value!", mt = et(), Ee = n.forwardRef(
|
|
|
322
320
|
))
|
|
323
321
|
);
|
|
324
322
|
return I ? /* @__PURE__ */ n.createElement(
|
|
325
|
-
|
|
323
|
+
ot,
|
|
326
324
|
{
|
|
327
325
|
label: I,
|
|
328
326
|
editorId: oe,
|
|
@@ -405,5 +403,5 @@ const o = {
|
|
|
405
403
|
Ee.displayName = "KendoNumericTextBox";
|
|
406
404
|
export {
|
|
407
405
|
Ee as NumericTextBox,
|
|
408
|
-
|
|
406
|
+
ct as NumericTextBoxPropsContext
|
|
409
407
|
};
|
package/package-metadata.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 e={name:"@progress/kendo-react-inputs",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-react-inputs",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1741187205,version:"10.0.0-develop.2",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -10,8 +10,8 @@ const e = {
|
|
|
10
10
|
productName: "KendoReact",
|
|
11
11
|
productCode: "KENDOUIREACT",
|
|
12
12
|
productCodes: ["KENDOUIREACT"],
|
|
13
|
-
publishDate:
|
|
14
|
-
version: "
|
|
13
|
+
publishDate: 1741187205,
|
|
14
|
+
version: "10.0.0-develop.2",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
16
16
|
};
|
|
17
17
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-inputs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0-develop.2",
|
|
4
4
|
"description": "React Inputs offer a customizable interface for users to enter and pick different information. KendoReact Input package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
"@progress/kendo-drawing": "^1.21.2",
|
|
29
29
|
"@progress/kendo-inputs-common": "^3.1.0",
|
|
30
30
|
"@progress/kendo-licensing": "^1.5.0",
|
|
31
|
-
"@progress/kendo-react-animation": "
|
|
32
|
-
"@progress/kendo-react-buttons": "
|
|
33
|
-
"@progress/kendo-react-common": "
|
|
34
|
-
"@progress/kendo-react-dialogs": "
|
|
35
|
-
"@progress/kendo-react-intl": "
|
|
36
|
-
"@progress/kendo-react-labels": "
|
|
37
|
-
"@progress/kendo-react-popup": "
|
|
31
|
+
"@progress/kendo-react-animation": "10.0.0-develop.2",
|
|
32
|
+
"@progress/kendo-react-buttons": "10.0.0-develop.2",
|
|
33
|
+
"@progress/kendo-react-common": "10.0.0-develop.2",
|
|
34
|
+
"@progress/kendo-react-dialogs": "10.0.0-develop.2",
|
|
35
|
+
"@progress/kendo-react-intl": "10.0.0-develop.2",
|
|
36
|
+
"@progress/kendo-react-labels": "10.0.0-develop.2",
|
|
37
|
+
"@progress/kendo-react-popup": "10.0.0-develop.2",
|
|
38
38
|
"@progress/kendo-svg-icons": "^4.0.0",
|
|
39
39
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
40
40
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"package": {
|
|
61
61
|
"productName": "KendoReact",
|
|
62
62
|
"productCode": "KENDOUIREACT",
|
|
63
|
-
"publishDate":
|
|
63
|
+
"publishDate": 1741187205,
|
|
64
64
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
65
65
|
}
|
|
66
66
|
},
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("react"),t=require("prop-types"),n=require("@progress/kendo-react-common");function K(a){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const s in a)if(s!=="default"){const r=Object.getOwnPropertyDescriptor(a,s);Object.defineProperty(l,s,r.get?r:{enumerable:!0,get:()=>a[s]})}}return l.default=a,Object.freeze(l)}const e=K(M),k=n.createPropsContext(),g=e.forwardRef((a,l)=>{const s=n.usePropsContext(k,a),{ariaDescribedBy:r,checked:y,children:B,className:x,disabled:o,id:h,size:F=L.size,label:d,labelPlacement:I,name:O,style:j,tabIndex:q,value:m,valid:z,onChange:v,onFocus:b,onBlur:p,required:S,...T}=s,C=n.useUnstyled(),f=C&&C.uRadioButton,u=e.useRef(null),R=e.useCallback(()=>{u.current&&u.current.focus()},[]),i=e.useCallback(()=>({element:u.current,focus:R}),[R]);e.useImperativeHandle(l,i);const P=n.useId(),D=e.useCallback(c=>{n.dispatchEvent(v,c,i(),{value:m})},[v,m,o]),w=e.useCallback(c=>{b&&!o&&n.dispatchEvent(b,c,i(),void 0)},[b,o]),_=e.useCallback(c=>{p&&!o&&n.dispatchEvent(p,c,i(),void 0)},[p,o]),H={type:"radio",id:h||P,name:O,className:n.classNames(n.uRadioButton.input({c:f,size:F,invalid:z===!1,checked:y}),x),ref:u,disabled:o,tabIndex:n.getTabIndex(q,o),checked:y,style:j,"aria-describedby":r,"aria-required":S,value:m,onChange:D,onFocus:w,onBlur:_,...T},E=e.createElement(e.Fragment,null,d!==void 0?e.createElement("label",{className:n.classNames(n.uRadioButton.label({c:f})),htmlFor:h||P,style:{userSelect:"none"},"aria-label":d},d):null),N=e.createElement("span",{className:n.classNames(n.uRadioButton.wrap({c:f}))},e.createElement("input",{...H}));return I==="before"?e.createElement(e.Fragment,null,E,N,B):e.createElement(e.Fragment,null,N,E,B)});g.propTypes={ariaDescribedBy:t.string,checked:t.bool,className:t.string,disabled:t.bool,id:t.string,size:t.oneOf([null,"small","medium","large"]),label:t.string,labelPlacement:t.string,name:t.string,style:t.object,tabIndex:t.number,value:t.any,valid:t.bool,onChange:t.func,onFocus:t.func,onBlur:t.func};const L={size:"medium"};g.displayName="KendoRadioButton";exports.RadioButton=g;exports.RadioButtonPropsContext=k;
|
|
@@ -7,18 +7,16 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as e from "react";
|
|
9
9
|
import a from "prop-types";
|
|
10
|
-
import { createPropsContext as
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
const E = A(W, R), {
|
|
15
|
-
ariaDescribedBy: F,
|
|
10
|
+
import { createPropsContext as U, usePropsContext as A, useUnstyled as G, useId as J, dispatchEvent as d, classNames as m, uRadioButton as b, getTabIndex as M } from "@progress/kendo-react-common";
|
|
11
|
+
const Q = U(), x = e.forwardRef((E, F) => {
|
|
12
|
+
const I = A(Q, E), {
|
|
13
|
+
ariaDescribedBy: P,
|
|
16
14
|
checked: p,
|
|
17
15
|
children: f,
|
|
18
|
-
className:
|
|
19
|
-
disabled:
|
|
16
|
+
className: k,
|
|
17
|
+
disabled: n,
|
|
20
18
|
id: g,
|
|
21
|
-
size: N =
|
|
19
|
+
size: N = V.size,
|
|
22
20
|
label: o,
|
|
23
21
|
labelPlacement: z,
|
|
24
22
|
name: T,
|
|
@@ -31,7 +29,7 @@ const W = S(), P = e.forwardRef((R, x) => {
|
|
|
31
29
|
onBlur: i,
|
|
32
30
|
required: H,
|
|
33
31
|
...j
|
|
34
|
-
} =
|
|
32
|
+
} = I, y = G(), u = y && y.uRadioButton, l = e.useRef(null), C = e.useCallback(() => {
|
|
35
33
|
l.current && l.current.focus();
|
|
36
34
|
}, []), s = e.useCallback(
|
|
37
35
|
() => ({
|
|
@@ -40,32 +38,32 @@ const W = S(), P = e.forwardRef((R, x) => {
|
|
|
40
38
|
}),
|
|
41
39
|
[C]
|
|
42
40
|
);
|
|
43
|
-
e.useImperativeHandle(
|
|
44
|
-
const
|
|
45
|
-
(
|
|
46
|
-
d(h,
|
|
41
|
+
e.useImperativeHandle(F, s);
|
|
42
|
+
const B = J(), K = e.useCallback(
|
|
43
|
+
(t) => {
|
|
44
|
+
d(h, t, s(), {
|
|
47
45
|
value: r
|
|
48
46
|
});
|
|
49
47
|
},
|
|
50
|
-
[h, r,
|
|
48
|
+
[h, r, n]
|
|
51
49
|
), L = e.useCallback(
|
|
52
|
-
(
|
|
53
|
-
c && !
|
|
50
|
+
(t) => {
|
|
51
|
+
c && !n && d(
|
|
54
52
|
c,
|
|
55
|
-
|
|
53
|
+
t,
|
|
56
54
|
s(),
|
|
57
55
|
void 0
|
|
58
56
|
);
|
|
59
57
|
},
|
|
60
|
-
[c,
|
|
61
|
-
),
|
|
62
|
-
(
|
|
63
|
-
i && !
|
|
58
|
+
[c, n]
|
|
59
|
+
), O = e.useCallback(
|
|
60
|
+
(t) => {
|
|
61
|
+
i && !n && d(i, t, s(), void 0);
|
|
64
62
|
},
|
|
65
|
-
[i,
|
|
66
|
-
),
|
|
63
|
+
[i, n]
|
|
64
|
+
), S = {
|
|
67
65
|
type: "radio",
|
|
68
|
-
id: g ||
|
|
66
|
+
id: g || B,
|
|
69
67
|
name: T,
|
|
70
68
|
className: m(
|
|
71
69
|
b.input({
|
|
@@ -74,33 +72,33 @@ const W = S(), P = e.forwardRef((R, x) => {
|
|
|
74
72
|
invalid: D === !1,
|
|
75
73
|
checked: p
|
|
76
74
|
}),
|
|
77
|
-
|
|
75
|
+
k
|
|
78
76
|
),
|
|
79
77
|
ref: l,
|
|
80
|
-
disabled:
|
|
81
|
-
tabIndex:
|
|
78
|
+
disabled: n,
|
|
79
|
+
tabIndex: M(w, n),
|
|
82
80
|
checked: p,
|
|
83
81
|
style: q,
|
|
84
|
-
"aria-describedby":
|
|
82
|
+
"aria-describedby": P,
|
|
85
83
|
"aria-required": H,
|
|
86
84
|
value: r,
|
|
87
85
|
onChange: K,
|
|
88
86
|
onFocus: L,
|
|
89
|
-
onBlur:
|
|
87
|
+
onBlur: O,
|
|
90
88
|
...j
|
|
91
|
-
},
|
|
89
|
+
}, v = /* @__PURE__ */ e.createElement(e.Fragment, null, o !== void 0 ? /* @__PURE__ */ e.createElement(
|
|
92
90
|
"label",
|
|
93
91
|
{
|
|
94
92
|
className: m(b.label({ c: u })),
|
|
95
|
-
htmlFor: g ||
|
|
93
|
+
htmlFor: g || B,
|
|
96
94
|
style: { userSelect: "none" },
|
|
97
95
|
"aria-label": o
|
|
98
96
|
},
|
|
99
97
|
o
|
|
100
|
-
) : null),
|
|
101
|
-
return z === "before" ? /* @__PURE__ */ e.createElement(e.Fragment, null,
|
|
98
|
+
) : null), R = /* @__PURE__ */ e.createElement("span", { className: m(b.wrap({ c: u })) }, /* @__PURE__ */ e.createElement("input", { ...S }));
|
|
99
|
+
return z === "before" ? /* @__PURE__ */ e.createElement(e.Fragment, null, v, R, f) : /* @__PURE__ */ e.createElement(e.Fragment, null, R, v, f);
|
|
102
100
|
});
|
|
103
|
-
|
|
101
|
+
x.propTypes = {
|
|
104
102
|
ariaDescribedBy: a.string,
|
|
105
103
|
checked: a.bool,
|
|
106
104
|
className: a.string,
|
|
@@ -118,11 +116,11 @@ P.propTypes = {
|
|
|
118
116
|
onFocus: a.func,
|
|
119
117
|
onBlur: a.func
|
|
120
118
|
};
|
|
121
|
-
const
|
|
119
|
+
const V = {
|
|
122
120
|
size: "medium"
|
|
123
121
|
};
|
|
124
|
-
|
|
122
|
+
x.displayName = "KendoRadioButton";
|
|
125
123
|
export {
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
x as RadioButton,
|
|
125
|
+
Q as RadioButtonPropsContext
|
|
128
126
|
};
|
|
@@ -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 K=require("react"),e=require("prop-types"),U=require("./RadioButton.js"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const K=require("react"),e=require("prop-types"),U=require("./RadioButton.js"),a=require("@progress/kendo-react-common");function A(o){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const n in o)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(o,n);Object.defineProperty(c,n,i.get?i:{enumerable:!0,get:()=>o[n]})}}return c.default=o,Object.freeze(c)}const s=A(K),N=a.createPropsContext(),y=s.forwardRef((o,c)=>{const n=a.usePropsContext(N,o),{id:i,ariaLabelledBy:O,ariaDescribedBy:j,className:B,data:C,defaultValue:I,disabled:r,name:q,labelPlacement:F,layout:d,style:S,value:g,valid:x,item:D=J.item,onChange:b,onFocus:m}=n,h=a.useUnstyled(),v=h&&h.uRadioGroup,u=s.useRef(null),R=s.useCallback(()=>{u.current&&a.focusFirstFocusableChild(u.current)},[]),p=s.useCallback(()=>({element:u.current,focus:R}),[R]);s.useImperativeHandle(c,p);const[T,P]=s.useState(I),k=g!==void 0,f=k?g:T,V=s.useCallback(t=>{const l=t.value;!k&&!r&&P(l),b&&!r&&a.dispatchEvent(b,t.syntheticEvent,p(),{value:l})},[P,b,r]),z=s.useCallback(t=>{m&&!r&&a.dispatchEvent(m,t.syntheticEvent,p(),void 0)},[m,r]),_=a.useId(),w=a.classNames(a.uRadioGroup.ul({c:v,horizontal:d==="horizontal",vertical:d==="vertical"||d===void 0}),B),H=a.useRtl(u,n.dir),L=C&&C.map((t,l)=>{const G=f===t.value,M=f==null,E={...t,valid:x,checked:G,disabled:!!(t.disabled||r),labelPlacement:t.labelPlacement?t.labelPlacement:F,tabIndex:t.tabIndex?t.tabIndex:M&&l===0||G?0:-1,index:l,name:q||_,required:t.required,onChange:V,onFocus:z};return s.createElement(D,{className:a.classNames(a.uRadioGroup.item({c:v,disabled:E.disabled||r})),key:l,role:"none"},s.createElement(U.RadioButton,{...E}))});return s.createElement("ul",{id:i,role:"radiogroup",className:w,ref:u,dir:H,style:S,"aria-labelledby":O,"aria-describedby":j},L)}),J={item:o=>s.createElement("li",{...o})};y.propTypes={ariaLabelledBy:e.string,ariaDescribedBy:e.string,className:e.string,data:e.arrayOf(e.object),defaultValue:e.any,dir:e.string,disabled:e.bool,labelPlacement:e.string,layout:e.string,name:e.string,style:e.object,value:e.any,onChange:e.func,onFocus:e.func};y.displayName="KendoRadioGroup";exports.RadioGroup=y;exports.RadioGroupPropsContext=N;
|
|
@@ -7,12 +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
|
-
|
|
13
|
-
const
|
|
14
|
-
Q($);
|
|
15
|
-
const m = W(ee, r), {
|
|
10
|
+
import { RadioButton as J } from "./RadioButton.mjs";
|
|
11
|
+
import { createPropsContext as M, usePropsContext as Q, useUnstyled as W, focusFirstFocusableChild as X, dispatchEvent as k, useId as Y, classNames as P, uRadioGroup as E, useRtl as Z } from "@progress/kendo-react-common";
|
|
12
|
+
const _ = M(), G = t.forwardRef((r, I) => {
|
|
13
|
+
const m = Q(_, r), {
|
|
16
14
|
id: N,
|
|
17
15
|
ariaLabelledBy: B,
|
|
18
16
|
ariaDescribedBy: F,
|
|
@@ -26,11 +24,11 @@ const ee = J(), G = t.forwardRef((r, I) => {
|
|
|
26
24
|
style: q,
|
|
27
25
|
value: p,
|
|
28
26
|
valid: z,
|
|
29
|
-
item: D =
|
|
27
|
+
item: D = $.item,
|
|
30
28
|
onChange: c,
|
|
31
29
|
onFocus: d
|
|
32
|
-
} = m, f =
|
|
33
|
-
o.current &&
|
|
30
|
+
} = m, f = W(), y = f && f.uRadioGroup, o = t.useRef(null), C = t.useCallback(() => {
|
|
31
|
+
o.current && X(o.current);
|
|
34
32
|
}, []), i = t.useCallback(
|
|
35
33
|
() => ({
|
|
36
34
|
element: o.current,
|
|
@@ -42,7 +40,7 @@ const ee = J(), G = t.forwardRef((r, I) => {
|
|
|
42
40
|
const [H, h] = t.useState(V), v = p !== void 0, u = v ? p : H, L = t.useCallback(
|
|
43
41
|
(a) => {
|
|
44
42
|
const l = a.value;
|
|
45
|
-
!v && !s && h(l), c && !s &&
|
|
43
|
+
!v && !s && h(l), c && !s && k(
|
|
46
44
|
c,
|
|
47
45
|
a.syntheticEvent,
|
|
48
46
|
i(),
|
|
@@ -52,7 +50,7 @@ const ee = J(), G = t.forwardRef((r, I) => {
|
|
|
52
50
|
[h, c, s]
|
|
53
51
|
), S = t.useCallback(
|
|
54
52
|
(a) => {
|
|
55
|
-
d && !s &&
|
|
53
|
+
d && !s && k(
|
|
56
54
|
d,
|
|
57
55
|
a.syntheticEvent,
|
|
58
56
|
i(),
|
|
@@ -60,21 +58,21 @@ const ee = J(), G = t.forwardRef((r, I) => {
|
|
|
60
58
|
);
|
|
61
59
|
},
|
|
62
60
|
[d, s]
|
|
63
|
-
), T =
|
|
61
|
+
), T = Y(), w = P(
|
|
64
62
|
E.ul({
|
|
65
63
|
c: y,
|
|
66
64
|
horizontal: n === "horizontal",
|
|
67
65
|
vertical: n === "vertical" || n === void 0
|
|
68
66
|
}),
|
|
69
67
|
x
|
|
70
|
-
), K =
|
|
71
|
-
const g = u === a.value,
|
|
68
|
+
), K = Z(o, m.dir), U = b && b.map((a, l) => {
|
|
69
|
+
const g = u === a.value, A = u == null, R = {
|
|
72
70
|
...a,
|
|
73
71
|
valid: z,
|
|
74
72
|
checked: g,
|
|
75
73
|
disabled: !!(a.disabled || s),
|
|
76
74
|
labelPlacement: a.labelPlacement ? a.labelPlacement : j,
|
|
77
|
-
tabIndex: a.tabIndex ? a.tabIndex :
|
|
75
|
+
tabIndex: a.tabIndex ? a.tabIndex : A && l === 0 || g ? 0 : -1,
|
|
78
76
|
index: l,
|
|
79
77
|
name: O || T,
|
|
80
78
|
required: a.required,
|
|
@@ -84,16 +82,16 @@ const ee = J(), G = t.forwardRef((r, I) => {
|
|
|
84
82
|
return /* @__PURE__ */ t.createElement(
|
|
85
83
|
D,
|
|
86
84
|
{
|
|
87
|
-
className:
|
|
85
|
+
className: P(
|
|
88
86
|
E.item({
|
|
89
87
|
c: y,
|
|
90
|
-
disabled:
|
|
88
|
+
disabled: R.disabled || s
|
|
91
89
|
})
|
|
92
90
|
),
|
|
93
91
|
key: l,
|
|
94
92
|
role: "none"
|
|
95
93
|
},
|
|
96
|
-
/* @__PURE__ */ t.createElement(
|
|
94
|
+
/* @__PURE__ */ t.createElement(J, { ...R })
|
|
97
95
|
);
|
|
98
96
|
});
|
|
99
97
|
return /* @__PURE__ */ t.createElement(
|
|
@@ -108,9 +106,9 @@ const ee = J(), G = t.forwardRef((r, I) => {
|
|
|
108
106
|
"aria-labelledby": B,
|
|
109
107
|
"aria-describedby": F
|
|
110
108
|
},
|
|
111
|
-
|
|
109
|
+
U
|
|
112
110
|
);
|
|
113
|
-
}),
|
|
111
|
+
}), $ = {
|
|
114
112
|
item: (r) => /* @__PURE__ */ t.createElement("li", { ...r })
|
|
115
113
|
};
|
|
116
114
|
G.propTypes = {
|
|
@@ -132,5 +130,5 @@ G.propTypes = {
|
|
|
132
130
|
G.displayName = "KendoRadioGroup";
|
|
133
131
|
export {
|
|
134
132
|
G as RadioGroup,
|
|
135
|
-
|
|
133
|
+
_ as RadioGroupPropsContext
|
|
136
134
|
};
|
|
@@ -5,16 +5,16 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("react"),C=require("prop-types"),l=require("@progress/kendo-react-common"),R=require("../messages/index.js"),Y=require("@progress/kendo-react-intl"),r=require("./range-raducer.js"),J=require("../package-metadata.js");function Q(n){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const d in n)if(d!=="default"){const i=Object.getOwnPropertyDescriptor(n,d);Object.defineProperty(s,d,i.get?i:{enumerable:!0,get:()=>n[d]})}}return s.default=n,Object.freeze(s)}const a=Q(F),Z=(n,s,d)=>{const[i,e]=a.useState(n),u=a.useCallback(g=>{const I=r.rangeReducer(s.state||i,{...g,...s});d&&d(I,g.event),e(I)},[s,d]);return[i,u]},w=l.createPropsContext(),O=a.forwardRef((n,s)=>{const d=!l.validatePackage(J.packageMetadata,{component:"RangeSlider"}),i=l.usePropsContext(w,n),e={step:k.step,largeStep:k.largeStep,defaultValue:k.defaultValue,vertical:k.vertical,disabled:k.disabled,...i},u=a.useRef(null),g=a.useRef(null),I=a.useRef(null),h=a.useRef(null),D=a.useRef(null),K=a.useCallback(()=>{h.current&&h.current.focus()},[h]);a.useImperativeHandle(u,()=>({element:g.current,focus:K,props:e})),a.useImperativeHandle(s,()=>u.current);const f=a.useMemo(()=>e.min,[e.min]),y=a.useMemo(()=>e.max,[e.max]),$=a.useMemo(()=>e.step!==void 0?e.step:k.step,[e.step,k.step]),M=a.useMemo(()=>e.largeStep!==void 0?e.largeStep:k.largeStep,[e.largeStep,k.largeStep]),p=l.useDir(g,e.dir),L=(t,m)=>{e.onChange&&u.current&&e.onChange.call(void 0,{value:t,target:u.current,syntheticEvent:m})},[_,S]=a.useState(""),[A,c]=Z(e.defaultValue||k.defaultValue,{min:f,max:y,step:$,largeStep:M,state:e.value},L),o=a.useMemo(()=>e.value||A,[e.value,A]),P=a.useRef(null),T=a.useRef(null),v=a.useMemo(()=>(o.start-f)/(y-f)*100,[o.start,f,y]),N=a.useMemo(()=>(o.end-f)/(y-f)*100,[o.end,f,y]),z=a.useMemo(()=>e.vertical?{paddingTop:0,height:"100%"}:{},[e.vertical]),V=a.useMemo(()=>e.vertical?{marginTop:"0.5rem",marginBottom:"0.5rem"}:{marginLeft:"0.5rem",marginRight:"0.5rem"},[e.vertical]),G=Y.useLocalization(),E=a.useCallback(t=>{if(!T.current)return;const m=T.current.getBoundingClientRect(),b=e.vertical?m.bottom-t.clientY:p==="rtl"?m.right-t.clientX:t.clientX-m.left,x=e.vertical?m.height:m.width,X=b/x;return f+X*(y-f)},[T,e.vertical,p,f,y,A.start,A.end,e.value&&e.value.start,e.value&&e.value.end]),q=a.useCallback(t=>t<=o.start?"start":t>=o.end?"end":2*t<o.end+o.start?"start":"end",[A.start,A.end,e.value&&e.value.start,e.value&&e.value.end]),j=a.useCallback(t=>{switch(t.keyCode){case l.Keys.right:t.preventDefault(),c({type:p==="rtl"?r.RANGE_ACTION.decrease:r.RANGE_ACTION.increase,key:"start",event:t});break;case l.Keys.up:t.preventDefault(),c({type:r.RANGE_ACTION.increase,key:"start",event:t});break;case l.Keys.left:t.preventDefault(),c({type:p==="rtl"?r.RANGE_ACTION.increase:r.RANGE_ACTION.decrease,key:"start",event:t});break;case l.Keys.down:t.preventDefault(),c({type:r.RANGE_ACTION.decrease,key:"start",event:t});break;case l.Keys.home:t.preventDefault(),c({type:r.RANGE_ACTION.min,key:"start",event:t});break;case l.Keys.end:t.preventDefault(),c({type:r.RANGE_ACTION.max,key:"start",event:t});break;case l.Keys.pageDown:t.preventDefault(),c({type:p==="rtl"?r.RANGE_ACTION.increaseLarge:r.RANGE_ACTION.decreaseLarge,key:"start",event:t});break;case l.Keys.pageUp:t.preventDefault(),c({type:p==="rtl"?r.RANGE_ACTION.decreaseLarge:r.RANGE_ACTION.increaseLarge,key:"start",event:t});break}},[c]),H=a.useCallback(t=>{switch(t.keyCode){case l.Keys.right:t.preventDefault(),c({type:p==="rtl"?r.RANGE_ACTION.decrease:r.RANGE_ACTION.increase,key:"end",event:t});break;case l.Keys.up:t.preventDefault(),c({type:r.RANGE_ACTION.increase,key:"end",event:t});break;case l.Keys.left:t.preventDefault(),c({type:p==="rtl"?r.RANGE_ACTION.increase:r.RANGE_ACTION.decrease,key:"end",event:t});break;case l.Keys.down:t.preventDefault(),c({type:r.RANGE_ACTION.decrease,key:"end",event:t});break;case l.Keys.home:t.preventDefault(),c({type:r.RANGE_ACTION.min,key:"end",event:t});break;case l.Keys.end:t.preventDefault(),c({type:r.RANGE_ACTION.max,key:"end",event:t});break;case l.Keys.pageDown:t.preventDefault(),c({type:p==="rtl"?r.RANGE_ACTION.increaseLarge:r.RANGE_ACTION.decreaseLarge,key:"end",event:t});break;case l.Keys.pageUp:t.preventDefault(),c({type:p==="rtl"?r.RANGE_ACTION.decreaseLarge:r.RANGE_ACTION.increaseLarge,key:"end",event:t});break}},[c,p]),W=a.useCallback(t=>{const m=E(t),b=q(m);S(b),b==="end"?D.current.focus():h.current.focus();const x=b==="end"?r.RANGE_ACTION.end:r.RANGE_ACTION.start;c({type:x,payload:m,event:t})},[e.vertical,f,y,c]),B=t=>{const m=E(t),b=_==="end"?r.RANGE_ACTION.end:r.RANGE_ACTION.start;c({type:b,payload:m,event:t})},U=t=>{const m=E(t),b=_==="end"?r.RANGE_ACTION.end:r.RANGE_ACTION.start;c({type:b,payload:m,event:t}),S("")};return l.useDraggable(T,{onPress:W,onDrag:B,onRelease:U},{autoScroll:!1}),a.createElement(a.Fragment,null,a.createElement("div",{id:e.id,style:e.style,ref:g,dir:p,className:l.classNames("k-slider",{"k-rtl":p==="rtl","k-disabled":e.disabled,"k-slider-vertical":e.vertical,"k-slider-horizontal":!e.vertical},e.className)},a.createElement("div",{ref:T,className:"k-slider-track-wrap",style:{flexGrow:1,position:"relative",touchAction:"none",...V}},e.children&&a.createElement("ul",{className:"k-reset k-slider-items",style:{...z}},a.Children.map(e.children,(t,m)=>t&&a.cloneElement(t,{position:100*(t.props.position-e.min)/(e.max-e.min),vertical:e.vertical,firstTick:m===0,lastTick:m===a.Children.count(e.children)-1},t.props.children))),a.createElement("div",{ref:P,className:"k-slider-track",style:e.vertical?{bottom:0,height:"100%"}:{[p==="rtl"?"right":"left"]:0,width:"100%"}},v!==null&&N!==null&&a.createElement("div",{"data-selection":!0,ref:I,title:`${o.start} - ${o.end}`,className:"k-slider-selection",style:e.vertical?{height:N-v+"%",bottom:v+"%"}:{[p==="rtl"?"right":"left"]:v+"%",width:N-v+"%"}}),a.createElement("span",{ref:h,role:"slider",tabIndex:l.getTabIndex(e.startTabIndex,e.disabled,void 0),"aria-valuemin":f,"aria-valuemax":Math.max(y,o.end),"aria-valuenow":o.start,"aria-disabled":e.disabled?"true":void 0,"aria-valuetext":`${o.start} - ${o.end}`,className:"k-draghandle k-draghandle-start",title:G.toLanguageString(R.sliderDragTitle,R.messages[R.sliderDragTitle]),style:e.vertical?{bottom:"calc("+v+"%)",zIndex:1}:p==="rtl"?{right:"calc("+v+"% - 13px)",zIndex:1}:{left:"calc("+v+"%)",zIndex:1},onKeyDown:j}),a.createElement("span",{ref:D,role:"slider",tabIndex:l.getTabIndex(e.endTabIndex,e.disabled,void 0),"aria-valuemin":Math.min(f,o.start),"aria-valuemax":y,"aria-valuenow":o.end,"aria-disabled":e.disabled?"true":void 0,"aria-valuetext":`${o.start} - ${o.end}`,className:"k-draghandle k-draghandle-end",title:G.toLanguageString(R.sliderDragTitle,R.messages[R.sliderDragTitle]),style:e.vertical?{bottom:"calc("+N+"%)",zIndex:1}:p==="rtl"?{right:"calc("+N+"% - 13px)",zIndex:1}:{left:"calc("+N+"%)",zIndex:1},onKeyDown:H})))),d&&a.createElement(l.WatermarkOverlay,null))}),ee={value:(n,s,d)=>{if(n.value){const i=n.value.start,e=n.value.end,u=n.min,g=n.max;if(i>e||i>g||i<u||e>g||e<u||e<i)return new Error(`Invalid prop + ${s} supplied to ${d}.
|
|
9
9
|
The { start, end } value must be between the min & max value and { start, end } must be start < end.
|
|
10
|
-
`)}return null},defaultValue:(n,s,d)=>{if(n.defaultValue){const
|
|
10
|
+
`)}return null},defaultValue:(n,s,d)=>{if(n.defaultValue){const i=n.defaultValue.start,e=n.defaultValue.end,u=n.min,g=n.max;if(i>e||i>g||i<u||e>g||e<u||e<i)return new Error(`Invalid prop + ${s} supplied to ${d}.
|
|
11
11
|
The { start, end } value must be between the min & max value and { start, end } must be start < end.
|
|
12
|
-
`)}return null},onChange:C.func,step:C.number,min:(n,s,d)=>{const
|
|
12
|
+
`)}return null},onChange:C.func,step:C.number,min:(n,s,d)=>{const i=n[s],e=n.min,u=n.max;return e===void 0?new Error(`Invalid prop + ${s} supplied to ${d}.
|
|
13
13
|
${s} value can not be undefined.
|
|
14
|
-
`):e
|
|
14
|
+
`):i&&e>=u?new Error(`Invalid prop + ${s} supplied to ${d}.
|
|
15
15
|
${s} value can not be equal to or bigger than the max value.
|
|
16
|
-
`):null},max:(n,s,d)=>{const
|
|
16
|
+
`):null},max:(n,s,d)=>{const i=n[s],e=n.min,u=n.max;return u===void 0?new Error(`Invalid prop + ${s} supplied to ${d}.
|
|
17
17
|
${s} value can not be undefined.
|
|
18
|
-
`):
|
|
18
|
+
`):i&&u<=e?new Error(`Invalid prop + ${s} supplied to ${d}.
|
|
19
19
|
${s} value can not be equal to or smaller than the min value.
|
|
20
|
-
`):null},vertical:C.bool,disabled:C.bool,dir:C.oneOf(["ltr","rtl"])},k={step:1,largeStep:10,defaultValue:{start:0,end:0},vertical:!1,disabled:!1};
|
|
20
|
+
`):null},vertical:C.bool,disabled:C.bool,dir:C.oneOf(["ltr","rtl"])},k={step:1,largeStep:10,defaultValue:{start:0,end:0},vertical:!1,disabled:!1};O.displayName="KendoReactRangeSlider";O.propTypes=ee;exports.RangeSlider=O;exports.RangeSliderPropsContext=w;
|