@progress/kendo-react-inputs 7.4.0 → 7.5.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/colors/ColorInput.js +1 -1
- package/colors/ColorInput.mjs +40 -41
- package/colors/ColorPalette.js +1 -1
- package/colors/ColorPalette.mjs +1 -1
- package/colors/FlatColorPicker.js +1 -1
- package/colors/FlatColorPicker.mjs +71 -71
- package/colors/Picker.js +1 -1
- package/colors/Picker.mjs +15 -14
- package/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/index.d.mts +32 -2
- package/index.d.ts +32 -2
- package/package-metadata.mjs +1 -1
- package/package.json +8 -8
- package/radiobutton/RadioButton.js +1 -1
- package/radiobutton/RadioButton.mjs +36 -35
- package/radiobutton/RadioGroup.js +1 -1
- package/radiobutton/RadioGroup.mjs +1 -1
- package/range-slider/RangeSlider.js +7 -7
- package/range-slider/RangeSlider.mjs +62 -60
- package/signature/Signature.js +1 -1
- package/signature/Signature.mjs +80 -79
- package/slider/Slider.js +1 -1
- package/slider/Slider.mjs +27 -25
- package/slider/SliderLabel.js +1 -1
- package/slider/SliderLabel.mjs +13 -18
- package/switch/Switch.js +1 -1
- package/switch/Switch.mjs +37 -38
- package/textarea/TextArea.js +1 -1
- package/textarea/TextArea.mjs +78 -76
package/index.d.mts
CHANGED
|
@@ -1071,7 +1071,7 @@ export declare interface FlatColorPickerChangeEvent {
|
|
|
1071
1071
|
/**
|
|
1072
1072
|
* The current value of the FlatColorPicker.
|
|
1073
1073
|
*/
|
|
1074
|
-
value: string;
|
|
1074
|
+
value: string | undefined;
|
|
1075
1075
|
/**
|
|
1076
1076
|
* A React Synthetic Event.
|
|
1077
1077
|
*/
|
|
@@ -1101,7 +1101,7 @@ export declare interface FlatColorPickerHandle {
|
|
|
1101
1101
|
/**
|
|
1102
1102
|
* The current value of the FlatColorPicker.
|
|
1103
1103
|
*/
|
|
1104
|
-
value: string;
|
|
1104
|
+
value: string | undefined;
|
|
1105
1105
|
}
|
|
1106
1106
|
|
|
1107
1107
|
/**
|
|
@@ -3517,6 +3517,16 @@ export declare interface SliderLabelProps {
|
|
|
3517
3517
|
* @hidden
|
|
3518
3518
|
*/
|
|
3519
3519
|
vertical?: boolean;
|
|
3520
|
+
/**
|
|
3521
|
+
* @hidden
|
|
3522
|
+
* Used to identify if a tick is first.
|
|
3523
|
+
*/
|
|
3524
|
+
firstTick?: boolean;
|
|
3525
|
+
/**
|
|
3526
|
+
* @hidden
|
|
3527
|
+
* Used to identify if a tick is last.
|
|
3528
|
+
*/
|
|
3529
|
+
lastTick?: boolean;
|
|
3520
3530
|
}
|
|
3521
3531
|
|
|
3522
3532
|
/**
|
|
@@ -4048,6 +4058,8 @@ export declare interface TextAreaProps extends FormComponentProps, Omit_5<React.
|
|
|
4048
4058
|
/**
|
|
4049
4059
|
* Specifies if the textarea element will resize its height automatically ([see example]({% slug sizing_textarea %})).
|
|
4050
4060
|
* Defaults to `false`.
|
|
4061
|
+
*
|
|
4062
|
+
* Setting the value of the prop to `true` will make the TextArea component to ignore the resize behavior of the `resizable` prop.
|
|
4051
4063
|
*/
|
|
4052
4064
|
autoSize?: boolean;
|
|
4053
4065
|
/**
|
|
@@ -4158,6 +4170,24 @@ export declare interface TextAreaProps extends FormComponentProps, Omit_5<React.
|
|
|
4158
4170
|
* Sets a custom suffix to the TextArea component.
|
|
4159
4171
|
*/
|
|
4160
4172
|
suffix?: CustomComponent<any>;
|
|
4173
|
+
/**
|
|
4174
|
+
* Defines the resize behavior of the TextArea.
|
|
4175
|
+
* The available options are:
|
|
4176
|
+
* - none — The TextArea cannot be resized.
|
|
4177
|
+
* - vertical — The TextArea can be resized vertically.
|
|
4178
|
+
* - horizontal — The TextArea can be resized horizontally.
|
|
4179
|
+
* - both — The TextArea can be resized both vertically and horizontally.
|
|
4180
|
+
*
|
|
4181
|
+
* @default `both`
|
|
4182
|
+
*
|
|
4183
|
+
* To be able to resize the TextArea, you should not set the `autoSize` property to `true`.
|
|
4184
|
+
* To be able to resize the component horizontally, add the following inline style to the TextArea:
|
|
4185
|
+
*
|
|
4186
|
+
* ```jsx
|
|
4187
|
+
* <TextArea resizable='horizontal' style={{width: 'auto'}} />
|
|
4188
|
+
* ```
|
|
4189
|
+
*/
|
|
4190
|
+
resizable?: 'none' | 'vertical' | 'horizontal' | 'both';
|
|
4161
4191
|
}
|
|
4162
4192
|
|
|
4163
4193
|
/**
|
package/index.d.ts
CHANGED
|
@@ -1071,7 +1071,7 @@ export declare interface FlatColorPickerChangeEvent {
|
|
|
1071
1071
|
/**
|
|
1072
1072
|
* The current value of the FlatColorPicker.
|
|
1073
1073
|
*/
|
|
1074
|
-
value: string;
|
|
1074
|
+
value: string | undefined;
|
|
1075
1075
|
/**
|
|
1076
1076
|
* A React Synthetic Event.
|
|
1077
1077
|
*/
|
|
@@ -1101,7 +1101,7 @@ export declare interface FlatColorPickerHandle {
|
|
|
1101
1101
|
/**
|
|
1102
1102
|
* The current value of the FlatColorPicker.
|
|
1103
1103
|
*/
|
|
1104
|
-
value: string;
|
|
1104
|
+
value: string | undefined;
|
|
1105
1105
|
}
|
|
1106
1106
|
|
|
1107
1107
|
/**
|
|
@@ -3517,6 +3517,16 @@ export declare interface SliderLabelProps {
|
|
|
3517
3517
|
* @hidden
|
|
3518
3518
|
*/
|
|
3519
3519
|
vertical?: boolean;
|
|
3520
|
+
/**
|
|
3521
|
+
* @hidden
|
|
3522
|
+
* Used to identify if a tick is first.
|
|
3523
|
+
*/
|
|
3524
|
+
firstTick?: boolean;
|
|
3525
|
+
/**
|
|
3526
|
+
* @hidden
|
|
3527
|
+
* Used to identify if a tick is last.
|
|
3528
|
+
*/
|
|
3529
|
+
lastTick?: boolean;
|
|
3520
3530
|
}
|
|
3521
3531
|
|
|
3522
3532
|
/**
|
|
@@ -4048,6 +4058,8 @@ export declare interface TextAreaProps extends FormComponentProps, Omit_5<React.
|
|
|
4048
4058
|
/**
|
|
4049
4059
|
* Specifies if the textarea element will resize its height automatically ([see example]({% slug sizing_textarea %})).
|
|
4050
4060
|
* Defaults to `false`.
|
|
4061
|
+
*
|
|
4062
|
+
* Setting the value of the prop to `true` will make the TextArea component to ignore the resize behavior of the `resizable` prop.
|
|
4051
4063
|
*/
|
|
4052
4064
|
autoSize?: boolean;
|
|
4053
4065
|
/**
|
|
@@ -4158,6 +4170,24 @@ export declare interface TextAreaProps extends FormComponentProps, Omit_5<React.
|
|
|
4158
4170
|
* Sets a custom suffix to the TextArea component.
|
|
4159
4171
|
*/
|
|
4160
4172
|
suffix?: CustomComponent<any>;
|
|
4173
|
+
/**
|
|
4174
|
+
* Defines the resize behavior of the TextArea.
|
|
4175
|
+
* The available options are:
|
|
4176
|
+
* - none — The TextArea cannot be resized.
|
|
4177
|
+
* - vertical — The TextArea can be resized vertically.
|
|
4178
|
+
* - horizontal — The TextArea can be resized horizontally.
|
|
4179
|
+
* - both — The TextArea can be resized both vertically and horizontally.
|
|
4180
|
+
*
|
|
4181
|
+
* @default `both`
|
|
4182
|
+
*
|
|
4183
|
+
* To be able to resize the TextArea, you should not set the `autoSize` property to `true`.
|
|
4184
|
+
* To be able to resize the component horizontally, add the following inline style to the TextArea:
|
|
4185
|
+
*
|
|
4186
|
+
* ```jsx
|
|
4187
|
+
* <TextArea resizable='horizontal' style={{width: 'auto'}} />
|
|
4188
|
+
* ```
|
|
4189
|
+
*/
|
|
4190
|
+
resizable?: 'none' | 'vertical' | 'horizontal' | 'both';
|
|
4161
4191
|
}
|
|
4162
4192
|
|
|
4163
4193
|
/**
|
package/package-metadata.mjs
CHANGED
|
@@ -10,7 +10,7 @@ const e = {
|
|
|
10
10
|
name: "@progress/kendo-react-inputs",
|
|
11
11
|
productName: "KendoReact",
|
|
12
12
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
13
|
-
publishDate:
|
|
13
|
+
publishDate: 1712850629,
|
|
14
14
|
version: "",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
16
16
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-inputs",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.5.0-develop.1",
|
|
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",
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
"@progress/kendo-drawing": "^1.19.0",
|
|
26
26
|
"@progress/kendo-inputs-common": "^3.1.0",
|
|
27
27
|
"@progress/kendo-licensing": "^1.3.4",
|
|
28
|
-
"@progress/kendo-react-animation": "7.
|
|
29
|
-
"@progress/kendo-react-buttons": "7.
|
|
30
|
-
"@progress/kendo-react-common": "7.
|
|
31
|
-
"@progress/kendo-react-dialogs": "7.
|
|
32
|
-
"@progress/kendo-react-intl": "7.
|
|
33
|
-
"@progress/kendo-react-labels": "7.
|
|
34
|
-
"@progress/kendo-react-popup": "7.
|
|
28
|
+
"@progress/kendo-react-animation": "7.5.0-develop.1",
|
|
29
|
+
"@progress/kendo-react-buttons": "7.5.0-develop.1",
|
|
30
|
+
"@progress/kendo-react-common": "7.5.0-develop.1",
|
|
31
|
+
"@progress/kendo-react-dialogs": "7.5.0-develop.1",
|
|
32
|
+
"@progress/kendo-react-intl": "7.5.0-develop.1",
|
|
33
|
+
"@progress/kendo-react-labels": "7.5.0-develop.1",
|
|
34
|
+
"@progress/kendo-react-popup": "7.5.0-develop.1",
|
|
35
35
|
"@progress/kendo-svg-icons": "^2.1.0",
|
|
36
36
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0",
|
|
37
37
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
|
|
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("react"),
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("react"),t=require("prop-types"),a=require("@progress/kendo-react-common"),w=require("../package-metadata.js");function _(n){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const l in n)if(l!=="default"){const c=Object.getOwnPropertyDescriptor(n,l);Object.defineProperty(s,l,c.get?c:{enumerable:!0,get:()=>n[l]})}}return s.default=n,Object.freeze(s)}const e=_(D),E=a.createPropsContext(),d=e.forwardRef((n,s)=>{a.validatePackage(w.packageMetadata);const l=a.usePropsContext(E,n),{ariaDescribedBy:c,checked:k,children:h,className:x,disabled:o,id:v,size:m,label:b,labelPlacement:F,name:I,style:N,tabIndex:O,value:p,valid:j,onChange:y,onFocus:f,onBlur:g,...M}=l,i=e.useRef(null),C=e.useCallback(()=>{i.current&&i.current.focus()},[]),u=e.useCallback(()=>({element:i.current,focus:C}),[C]);e.useImperativeHandle(s,u);const P=a.useId(),T=e.useCallback(r=>{a.dispatchEvent(y,r,u(),{value:p})},[y,p,o]),z=e.useCallback(r=>{f&&!o&&a.dispatchEvent(f,r,u(),void 0)},[f,o]),S=e.useCallback(r=>{g&&!o&&a.dispatchEvent(g,r,u(),void 0)},[g,o]),q={type:"radio",id:v||P,name:I,className:a.classNames("k-radio",{[`k-radio-${a.kendoThemeMaps.sizeMap[m]||m}`]:m,"k-invalid":j===!1,"k-checked":k},x),ref:i,disabled:o,tabIndex:a.getTabIndex(O,o),checked:k,style:N,"aria-describedby":c,value:p,onChange:T,onFocus:z,onBlur:S,...M},B=e.createElement(e.Fragment,null,b!==void 0?e.createElement("label",{className:"k-radio-label",htmlFor:v||P,style:{userSelect:"none"},"aria-label":b},b):null),R=e.createElement("span",{className:"k-radio-wrap"},e.createElement("input",{...q}));return F==="before"?e.createElement(e.Fragment,null,B,R,h):e.createElement(e.Fragment,null,R,B,h)});d.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 H={size:"medium"};d.displayName="KendoRadioButton";d.defaultProps=H;exports.RadioButton=d;exports.RadioButtonPropsContext=E;
|
|
@@ -8,30 +8,30 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as e from "react";
|
|
10
10
|
import a from "prop-types";
|
|
11
|
-
import { createPropsContext as
|
|
11
|
+
import { createPropsContext as j, validatePackage as K, usePropsContext as L, useId as O, dispatchEvent as u, classNames as S, kendoThemeMaps as $, getTabIndex as q } from "@progress/kendo-react-common";
|
|
12
12
|
import { packageMetadata as A } from "../package-metadata.mjs";
|
|
13
|
-
const G =
|
|
13
|
+
const G = j(), m = e.forwardRef((y, B) => {
|
|
14
14
|
K(A);
|
|
15
|
-
const
|
|
16
|
-
ariaDescribedBy:
|
|
17
|
-
checked:
|
|
15
|
+
const P = L(G, y), {
|
|
16
|
+
ariaDescribedBy: x,
|
|
17
|
+
checked: p,
|
|
18
18
|
children: b,
|
|
19
|
-
className:
|
|
19
|
+
className: E,
|
|
20
20
|
disabled: n,
|
|
21
|
-
id:
|
|
21
|
+
id: f,
|
|
22
22
|
size: s,
|
|
23
23
|
label: r,
|
|
24
|
-
labelPlacement:
|
|
25
|
-
name:
|
|
26
|
-
style:
|
|
27
|
-
tabIndex:
|
|
24
|
+
labelPlacement: F,
|
|
25
|
+
name: I,
|
|
26
|
+
style: N,
|
|
27
|
+
tabIndex: R,
|
|
28
28
|
value: c,
|
|
29
29
|
valid: z,
|
|
30
|
-
onChange:
|
|
30
|
+
onChange: g,
|
|
31
31
|
onFocus: i,
|
|
32
32
|
onBlur: d,
|
|
33
33
|
...T
|
|
34
|
-
} =
|
|
34
|
+
} = P, l = e.useRef(null), k = e.useCallback(
|
|
35
35
|
() => {
|
|
36
36
|
l.current && l.current.focus();
|
|
37
37
|
},
|
|
@@ -39,22 +39,22 @@ const G = w(), m = e.forwardRef((C, y) => {
|
|
|
39
39
|
), o = e.useCallback(
|
|
40
40
|
() => ({
|
|
41
41
|
element: l.current,
|
|
42
|
-
focus:
|
|
42
|
+
focus: k
|
|
43
43
|
}),
|
|
44
|
-
[
|
|
44
|
+
[k]
|
|
45
45
|
);
|
|
46
|
-
e.useImperativeHandle(
|
|
46
|
+
e.useImperativeHandle(B, o);
|
|
47
47
|
const h = O(), M = e.useCallback(
|
|
48
48
|
(t) => {
|
|
49
49
|
u(
|
|
50
|
-
|
|
50
|
+
g,
|
|
51
51
|
t,
|
|
52
52
|
o(),
|
|
53
53
|
{ value: c }
|
|
54
54
|
);
|
|
55
55
|
},
|
|
56
|
-
[
|
|
57
|
-
),
|
|
56
|
+
[g, c, n]
|
|
57
|
+
), w = e.useCallback(
|
|
58
58
|
(t) => {
|
|
59
59
|
i && !n && u(
|
|
60
60
|
i,
|
|
@@ -64,7 +64,7 @@ const G = w(), m = e.forwardRef((C, y) => {
|
|
|
64
64
|
);
|
|
65
65
|
},
|
|
66
66
|
[i, n]
|
|
67
|
-
),
|
|
67
|
+
), D = e.useCallback(
|
|
68
68
|
(t) => {
|
|
69
69
|
d && !n && u(
|
|
70
70
|
d,
|
|
@@ -74,40 +74,41 @@ const G = w(), m = e.forwardRef((C, y) => {
|
|
|
74
74
|
);
|
|
75
75
|
},
|
|
76
76
|
[d, n]
|
|
77
|
-
),
|
|
77
|
+
), H = {
|
|
78
78
|
type: "radio",
|
|
79
|
-
id:
|
|
80
|
-
name:
|
|
79
|
+
id: f || h,
|
|
80
|
+
name: I,
|
|
81
81
|
className: S(
|
|
82
82
|
"k-radio",
|
|
83
83
|
{
|
|
84
84
|
[`k-radio-${$.sizeMap[s] || s}`]: s,
|
|
85
|
-
"k-invalid": z === !1
|
|
85
|
+
"k-invalid": z === !1,
|
|
86
|
+
"k-checked": p
|
|
86
87
|
},
|
|
87
|
-
|
|
88
|
+
E
|
|
88
89
|
),
|
|
89
90
|
ref: l,
|
|
90
91
|
disabled: n,
|
|
91
|
-
tabIndex: q(
|
|
92
|
-
checked:
|
|
93
|
-
style:
|
|
94
|
-
"aria-describedby":
|
|
92
|
+
tabIndex: q(R, n),
|
|
93
|
+
checked: p,
|
|
94
|
+
style: N,
|
|
95
|
+
"aria-describedby": x,
|
|
95
96
|
value: c,
|
|
96
97
|
onChange: M,
|
|
97
|
-
onFocus:
|
|
98
|
-
onBlur:
|
|
98
|
+
onFocus: w,
|
|
99
|
+
onBlur: D,
|
|
99
100
|
...T
|
|
100
|
-
},
|
|
101
|
+
}, v = /* @__PURE__ */ e.createElement(e.Fragment, null, r !== void 0 ? /* @__PURE__ */ e.createElement(
|
|
101
102
|
"label",
|
|
102
103
|
{
|
|
103
104
|
className: "k-radio-label",
|
|
104
|
-
htmlFor:
|
|
105
|
+
htmlFor: f || h,
|
|
105
106
|
style: { userSelect: "none" },
|
|
106
107
|
"aria-label": r
|
|
107
108
|
},
|
|
108
109
|
r
|
|
109
|
-
) : null),
|
|
110
|
-
return
|
|
110
|
+
) : null), C = /* @__PURE__ */ e.createElement("span", { className: "k-radio-wrap" }, /* @__PURE__ */ e.createElement("input", { ...H }));
|
|
111
|
+
return F === "before" ? /* @__PURE__ */ e.createElement(e.Fragment, null, v, C, b) : /* @__PURE__ */ e.createElement(e.Fragment, null, C, v, b);
|
|
111
112
|
});
|
|
112
113
|
m.propTypes = {
|
|
113
114
|
ariaDescribedBy: a.string,
|
|
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("react"),e=require("prop-types"),K=require("./RadioButton.js"),s=require("@progress/kendo-react-common"),A=require("../package-metadata.js");function J(l){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const n in l)if(n!=="default"){const d=Object.getOwnPropertyDescriptor(l,n);Object.defineProperty(c,n,d.get?d:{enumerable:!0,get:()=>l[n]})}}return c.default=l,Object.freeze(c)}const t=J(L),E=s.createPropsContext(),u=t.forwardRef((l,c)=>{s.validatePackage(A.packageMetadata);const n=s.usePropsContext(E,l),{id:d,ariaLabelledBy:O,ariaDescribedBy:j,className:B,data:g,defaultValue:G,disabled:o,name:I,labelPlacement:F,layout:b,style:S,value:k,valid:q,item:x=N.item,onChange:m,onFocus:p}=n,i=t.useRef(null),C=t.useCallback(()=>{i.current&&s.focusFirstFocusableChild(i.current)},[]),f=t.useCallback(()=>({element:i.current,focus:C}),[C]);t.useImperativeHandle(c,f);const[D,v]=t.useState(G),h=k!==void 0,y=h?k:D,M=t.useCallback(a=>{let r=a.value;!h&&!o&&v(r),m&&!o&&s.dispatchEvent(m,a.syntheticEvent,f(),{value:r})},[v,m,o]),T=t.useCallback(a=>{p&&!o&&s.dispatchEvent(p,a.syntheticEvent,f(),void 0)},[p,o]),V=s.useId(),z=s.classNames("k-radio-list",{"k-list-horizontal":b==="horizontal","k-list-vertical":b==="vertical"||b===void 0},B),_=s.useRtl(i,n.dir),w=g&&g.map((a,r)=>{const P=y===a.value,H=y==null,R={...a,valid:q,checked:P,disabled:!!(a.disabled||o),labelPlacement:a.labelPlacement?a.labelPlacement:F,tabIndex:a.tabIndex?a.tabIndex:H&&r===0||P?0:-1,index:r,name:I||V,onChange:M,onFocus:T};return t.createElement(x,{className:s.classNames("k-radio-item",{"k-disabled":R.disabled||o}),key:r,role:"none"},t.createElement(K.RadioButton,{...R}))});return t.createElement("ul",{id:d,role:"radiogroup",className:z,ref:i,dir:_,style:S,"aria-labelledby":O,"aria-describedby":j},w)}),N={item:l=>t.createElement("li",{...l})};u.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};u.defaultProps=N;u.displayName="KendoRadioGroup";exports.RadioGroup=u;exports.RadioGroupPropsContext=E;
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("react"),e=require("prop-types"),K=require("./RadioButton.js"),s=require("@progress/kendo-react-common"),A=require("../package-metadata.js");function J(l){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const n in l)if(n!=="default"){const d=Object.getOwnPropertyDescriptor(l,n);Object.defineProperty(c,n,d.get?d:{enumerable:!0,get:()=>l[n]})}}return c.default=l,Object.freeze(c)}const t=J(L),E=s.createPropsContext(),u=t.forwardRef((l,c)=>{s.validatePackage(A.packageMetadata);const n=s.usePropsContext(E,l),{id:d,ariaLabelledBy:O,ariaDescribedBy:j,className:B,data:g,defaultValue:G,disabled:o,name:I,labelPlacement:F,layout:b,style:S,value:k,valid:q,item:x=N.item,onChange:m,onFocus:p}=n,i=t.useRef(null),C=t.useCallback(()=>{i.current&&s.focusFirstFocusableChild(i.current)},[]),f=t.useCallback(()=>({element:i.current,focus:C}),[C]);t.useImperativeHandle(c,f);const[D,v]=t.useState(G),h=k!==void 0,y=h?k:D,M=t.useCallback(a=>{let r=a.value;!h&&!o&&v(r),m&&!o&&s.dispatchEvent(m,a.syntheticEvent,f(),{value:r})},[v,m,o]),T=t.useCallback(a=>{p&&!o&&s.dispatchEvent(p,a.syntheticEvent,f(),void 0)},[p,o]),V=s.useId(),z=s.classNames("k-radio-list",{"k-list-horizontal":b==="horizontal","k-list-vertical":b==="vertical"||b===void 0},B),_=s.useRtl(i,n.dir),w=g&&g.map((a,r)=>{const P=y===a.value,H=y==null,R={...a,valid:q,checked:P,disabled:!!(a.disabled||o),labelPlacement:a.labelPlacement?a.labelPlacement:F,tabIndex:a.tabIndex?a.tabIndex:H&&r===0||P?0:-1,index:r,name:I||V,onChange:M,onFocus:T};return t.createElement(x,{className:s.classNames("k-radio-list-item",{"k-disabled":R.disabled||o}),key:r,role:"none"},t.createElement(K.RadioButton,{...R}))});return t.createElement("ul",{id:d,role:"radiogroup",className:z,ref:i,dir:_,style:S,"aria-labelledby":O,"aria-describedby":j},w)}),N={item:l=>t.createElement("li",{...l})};u.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};u.defaultProps=N;u.displayName="KendoRadioGroup";exports.RadioGroup=u;exports.RadioGroupPropsContext=E;
|
|
@@ -87,7 +87,7 @@ const Z = A(), m = t.forwardRef((r, E) => {
|
|
|
87
87
|
return /* @__PURE__ */ t.createElement(
|
|
88
88
|
z,
|
|
89
89
|
{
|
|
90
|
-
className: P("k-radio-item", { "k-disabled": v.disabled || l }),
|
|
90
|
+
className: P("k-radio-list-item", { "k-disabled": v.disabled || l }),
|
|
91
91
|
key: s,
|
|
92
92
|
role: "none"
|
|
93
93
|
},
|
|
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const X=require("react"),
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const X=require("react"),T=require("prop-types"),i=require("@progress/kendo-react-common"),R=require("../messages/index.js"),W=require("@progress/kendo-react-intl"),l=require("./range-raducer.js"),Y=require("../package-metadata.js");function F(r){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(n,e,s.get?s:{enumerable:!0,get:()=>r[e]})}}return n.default=r,Object.freeze(n)}const a=F(X),J=(r,n,e)=>{const[s,c]=a.useState(r),m=a.useCallback(f=>{const A=l.rangeReducer(n.state||s,{...f,...n});e&&e(A,f.event),c(A)},[n,e]);return[s,m]},_=i.createPropsContext(),I=a.forwardRef((r,n)=>{i.validatePackage(Y.packageMetadata);const e=i.usePropsContext(_,r),s=a.useRef(null),c=a.useRef(null),m=a.useRef(null),f=a.useRef(null),A=a.useRef(null),G=a.useCallback(()=>{f.current&&f.current.focus()},[f]);a.useImperativeHandle(s,()=>({element:c.current,focus:G,props:e})),a.useImperativeHandle(n,()=>s.current);const p=a.useMemo(()=>e.min,[e.min]),g=a.useMemo(()=>e.max,[e.max]),$=a.useMemo(()=>e.step!==void 0?e.step:C.step,[e.step,C.step]),y=i.useDir(c,e.dir),S=(t,u)=>{e.onChange&&s.current&&e.onChange.call(void 0,{value:t,target:s.current,syntheticEvent:u})},[D,O]=a.useState(""),[b,d]=J(e.defaultValue||C.defaultValue,{min:p,max:g,step:$,state:e.value},S),o=a.useMemo(()=>e.value||b,[e.value,b]),K=a.useRef(null),N=a.useRef(null),k=a.useMemo(()=>(o.start-p)/(g-p)*100,[o.start,p,g]),h=a.useMemo(()=>(o.end-p)/(g-p)*100,[o.end,p,g]),M=a.useMemo(()=>e.vertical?{paddingTop:0,height:"100%"}:{},[e.vertical]),P=a.useMemo(()=>e.vertical?{marginTop:"0.5rem",marginBottom:"0.5rem"}:{marginLeft:"0.5rem",marginRight:"0.5rem"},[e.vertical]),w=W.useLocalization(),x=a.useCallback(t=>{if(!N.current)return;const u=N.current.getBoundingClientRect(),v=e.vertical?u.bottom-t.clientY:y==="rtl"?u.right-t.clientX:t.clientX-u.left,E=e.vertical?u.height:u.width,B=v/E;return p+B*(g-p)},[N,e.vertical,y,p,g,b.start,b.end,e.value&&e.value.start,e.value&&e.value.end]),z=a.useCallback(t=>t<=o.start?"start":t>=o.end?"end":2*t<o.end+o.start?"start":"end",[b.start,b.end,e.value&&e.value.start,e.value&&e.value.end]),q=a.useCallback(t=>{switch(t.keyCode){case i.Keys.right:t.preventDefault(),d({type:y==="rtl"?l.RANGE_ACTION.decrease:l.RANGE_ACTION.increase,key:"start",event:t});break;case i.Keys.up:t.preventDefault(),d({type:l.RANGE_ACTION.increase,key:"start",event:t});break;case i.Keys.left:t.preventDefault(),d({type:y==="rtl"?l.RANGE_ACTION.increase:l.RANGE_ACTION.decrease,key:"start",event:t});break;case i.Keys.down:t.preventDefault(),d({type:l.RANGE_ACTION.decrease,key:"start",event:t});break;case i.Keys.home:t.preventDefault(),d({type:l.RANGE_ACTION.min,key:"start",event:t});break;case i.Keys.end:t.preventDefault(),d({type:l.RANGE_ACTION.max,key:"start",event:t});break}},[d]),V=a.useCallback(t=>{switch(t.keyCode){case i.Keys.right:t.preventDefault(),d({type:y==="rtl"?l.RANGE_ACTION.decrease:l.RANGE_ACTION.increase,key:"end",event:t});break;case i.Keys.up:t.preventDefault(),d({type:l.RANGE_ACTION.increase,key:"end",event:t});break;case i.Keys.left:t.preventDefault(),d({type:y==="rtl"?l.RANGE_ACTION.increase:l.RANGE_ACTION.decrease,key:"end",event:t});break;case i.Keys.down:t.preventDefault(),d({type:l.RANGE_ACTION.decrease,key:"end",event:t});break;case i.Keys.home:t.preventDefault(),d({type:l.RANGE_ACTION.min,key:"end",event:t});break;case i.Keys.end:t.preventDefault(),d({type:l.RANGE_ACTION.max,key:"end",event:t});break}},[d,y]),j=a.useCallback(t=>{const u=x(t),v=z(u);O(v),v==="end"?A.current.focus():f.current.focus();const E=v==="end"?l.RANGE_ACTION.end:l.RANGE_ACTION.start;d({type:E,payload:u,event:t})},[e.vertical,p,g,d]),H=t=>{const u=x(t),v=D==="end"?l.RANGE_ACTION.end:l.RANGE_ACTION.start;d({type:v,payload:u,event:t})},L=t=>{const u=x(t),v=D==="end"?l.RANGE_ACTION.end:l.RANGE_ACTION.start;d({type:v,payload:u,event:t}),O("")};return i.useDraggable(N,{onPress:j,onDrag:H,onRelease:L}),a.createElement("div",{id:e.id,style:e.style,ref:c,dir:y,className:i.classNames("k-slider",{"k-rtl":y==="rtl","k-disabled":e.disabled,"k-slider-vertical":e.vertical,"k-slider-horizontal":!e.vertical},e.className)},a.createElement("div",{ref:N,className:"k-slider-track-wrap",style:{flexGrow:1,position:"relative",touchAction:"none",...P}},e.children&&a.createElement("ul",{className:"k-reset k-slider-items",style:{...M}},a.Children.map(e.children,(t,u)=>t&&a.cloneElement(t,{position:100*(t.props.position-e.min)/(e.max-e.min),vertical:e.vertical,firstTick:u===0,lastTick:u===a.Children.count(e.children)-1},t.props.children))),a.createElement("div",{ref:K,className:"k-slider-track",style:e.vertical?{bottom:0,height:"100%"}:{[y==="rtl"?"right":"left"]:0,width:"100%"}},k!==null&&h!==null&&a.createElement("div",{"data-selection":!0,ref:m,title:`${o.start} - ${o.end}`,className:"k-slider-selection",style:e.vertical?{height:h-k+"%",bottom:k+"%"}:{[y==="rtl"?"right":"left"]:k+"%",width:h-k+"%"}}),a.createElement("span",{ref:f,role:"slider",tabIndex:i.getTabIndex(e.startTabIndex,e.disabled,void 0),"aria-valuemin":p,"aria-valuemax":Math.max(g,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:w.toLanguageString(R.sliderDragTitle,R.messages[R.sliderDragTitle]),style:e.vertical?{bottom:"calc("+k+"%)",zIndex:1}:y==="rtl"?{right:"calc("+k+"% - 13px)",zIndex:1}:{left:"calc("+k+"%)",zIndex:1},onKeyDown:q}),a.createElement("span",{ref:A,role:"slider",tabIndex:i.getTabIndex(e.endTabIndex,e.disabled,void 0),"aria-valuemin":Math.min(p,o.start),"aria-valuemax":g,"aria-valuenow":o.end,"aria-disabled":e.disabled?"true":void 0,"aria-valuetext":`${o.start} - ${o.end}`,className:"k-draghandle k-draghandle-end",title:w.toLanguageString(R.sliderDragTitle,R.messages[R.sliderDragTitle]),style:e.vertical?{bottom:"calc("+h+"%)",zIndex:1}:y==="rtl"?{right:"calc("+h+"% - 13px)",zIndex:1}:{left:"calc("+h+"%)",zIndex:1},onKeyDown:V}))))}),Q={value:(r,n,e)=>{if(r.value){const s=r.value.start,c=r.value.end,m=r.min,f=r.max;if(s>c||s>f||s<m||c>f||c<m||c<s)return new Error(`Invalid prop + ${n} supplied to ${e}.
|
|
9
9
|
The { start, end } value must be between the min & max value and { start, end } must be start < end.
|
|
10
|
-
`)}return null},defaultValue:(r,n,e)=>{if(r.defaultValue){const s=r.defaultValue.start,c=r.defaultValue.end,
|
|
10
|
+
`)}return null},defaultValue:(r,n,e)=>{if(r.defaultValue){const s=r.defaultValue.start,c=r.defaultValue.end,m=r.min,f=r.max;if(s>c||s>f||s<m||c>f||c<m||c<s)return new Error(`Invalid prop + ${n} supplied to ${e}.
|
|
11
11
|
The { start, end } value must be between the min & max value and { start, end } must be start < end.
|
|
12
|
-
`)}return null},onChange:
|
|
12
|
+
`)}return null},onChange:T.func,step:T.number,min:(r,n,e)=>{const s=r[n],c=r.min,m=r.max;return c===void 0?new Error(`Invalid prop + ${n} supplied to ${e}.
|
|
13
13
|
${n} value can not be undefined.
|
|
14
|
-
`):s&&c>=
|
|
14
|
+
`):s&&c>=m?new Error(`Invalid prop + ${n} supplied to ${e}.
|
|
15
15
|
${n} value can not be equal to or bigger than the max value.
|
|
16
|
-
`):null},max:(r,n,e)=>{const s=r[n],c=r.min,
|
|
16
|
+
`):null},max:(r,n,e)=>{const s=r[n],c=r.min,m=r.max;return m===void 0?new Error(`Invalid prop + ${n} supplied to ${e}.
|
|
17
17
|
${n} value can not be undefined.
|
|
18
|
-
`):s&&
|
|
18
|
+
`):s&&m<=c?new Error(`Invalid prop + ${n} supplied to ${e}.
|
|
19
19
|
${n} value can not be equal to or smaller than the min value.
|
|
20
|
-
`):null},vertical:
|
|
20
|
+
`):null},vertical:T.bool,disabled:T.bool,dir:T.oneOf(["ltr","rtl"])},C={step:1,defaultValue:{start:0,end:0},vertical:!1,disabled:!1};I.displayName="KendoReactRangeSlider";I.propTypes=Q;I.defaultProps=C;exports.RangeSlider=I;exports.RangeSliderPropsContext=_;
|