@progress/kendo-react-inputs 8.3.0-develop.11 → 8.3.0-develop.12
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 +83 -82
- package/colors/ColorGradient.js +1 -1
- package/colors/ColorGradient.mjs +31 -25
- package/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/index.d.mts +0 -2
- package/index.d.ts +0 -2
- package/maskedtextbox/MaskedTextBox.js +1 -1
- package/maskedtextbox/MaskedTextBox.mjs +28 -24
- package/maskedtextbox/parsing/stream.mjs +2 -0
- package/numerictextbox/NumericTextBox.js +1 -1
- package/numerictextbox/NumericTextBox.mjs +67 -66
- package/package-metadata.mjs +1 -1
- package/package.json +8 -8
- package/radiobutton/RadioButton.js +1 -1
- package/radiobutton/RadioButton.mjs +26 -24
- package/radiobutton/RadioGroup.js +1 -1
- package/radiobutton/RadioGroup.mjs +26 -25
- package/slider/Slider.mjs +12 -19
- package/switch/Switch.js +1 -1
- package/switch/Switch.mjs +3 -3
- package/textarea/TextArea.js +1 -1
- package/textarea/TextArea.mjs +28 -27
- package/textbox/Textbox.js +1 -1
- package/textbox/Textbox.mjs +24 -23
|
@@ -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
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("react"),t=require("prop-types"),a=require("@progress/kendo-react-common"),K=require("../package-metadata.js");function L(n){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const s in n)if(s!=="default"){const r=Object.getOwnPropertyDescriptor(n,s);Object.defineProperty(l,s,r.get?r:{enumerable:!0,get:()=>n[s]})}}return l.default=n,Object.freeze(l)}const e=L(H),N=a.createPropsContext(),g=e.forwardRef((n,l)=>{a.validatePackage(K.packageMetadata);const s=a.usePropsContext(N,n),{ariaDescribedBy:r,checked:y,children:v,className:x,disabled:o,id:B,size:F=U.size,label:d,labelPlacement:I,name:O,style:j,tabIndex:q,value:m,valid:z,onChange:h,onFocus:b,onBlur:p,required:S,...T}=s,C=a.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=a.useId(),D=e.useCallback(c=>{a.dispatchEvent(h,c,i(),{value:m})},[h,m,o]),M=e.useCallback(c=>{b&&!o&&a.dispatchEvent(b,c,i(),void 0)},[b,o]),w=e.useCallback(c=>{p&&!o&&a.dispatchEvent(p,c,i(),void 0)},[p,o]),_={type:"radio",id:B||P,name:O,className:a.classNames(a.uRadioButton.input({c:f,size:F,invalid:z===!1,checked:y}),x),ref:u,disabled:o,tabIndex:a.getTabIndex(q,o),checked:y,style:j,"aria-describedby":r,"aria-required":S,value:m,onChange:D,onFocus:M,onBlur:w,...T},k=e.createElement(e.Fragment,null,d!==void 0?e.createElement("label",{className:a.classNames(a.uRadioButton.label({c:f})),htmlFor:B||P,style:{userSelect:"none"},"aria-label":d},d):null),E=e.createElement("span",{className:a.classNames(a.uRadioButton.wrap({c:f}))},e.createElement("input",{..._}));return I==="before"?e.createElement(e.Fragment,null,k,E,v):e.createElement(e.Fragment,null,E,k,v)});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 U={size:"medium"};g.displayName="KendoRadioButton";exports.RadioButton=g;exports.RadioButtonPropsContext=N;
|
|
@@ -8,30 +8,31 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as e from "react";
|
|
10
10
|
import a from "prop-types";
|
|
11
|
-
import { createPropsContext as S, validatePackage as U, usePropsContext as
|
|
12
|
-
import { packageMetadata as
|
|
13
|
-
const
|
|
14
|
-
U(
|
|
15
|
-
const E =
|
|
11
|
+
import { createPropsContext as S, validatePackage as U, usePropsContext as A, useUnstyled as G, useId as J, dispatchEvent as d, classNames as m, uRadioButton as b, getTabIndex as Q } from "@progress/kendo-react-common";
|
|
12
|
+
import { packageMetadata as V } from "../package-metadata.mjs";
|
|
13
|
+
const W = S(), P = e.forwardRef((R, x) => {
|
|
14
|
+
U(V);
|
|
15
|
+
const E = A(W, R), {
|
|
16
16
|
ariaDescribedBy: F,
|
|
17
17
|
checked: p,
|
|
18
18
|
children: f,
|
|
19
19
|
className: I,
|
|
20
20
|
disabled: t,
|
|
21
21
|
id: g,
|
|
22
|
-
size: N =
|
|
22
|
+
size: N = X.size,
|
|
23
23
|
label: o,
|
|
24
24
|
labelPlacement: z,
|
|
25
25
|
name: T,
|
|
26
|
-
style:
|
|
27
|
-
tabIndex:
|
|
28
|
-
value:
|
|
29
|
-
valid:
|
|
26
|
+
style: q,
|
|
27
|
+
tabIndex: w,
|
|
28
|
+
value: r,
|
|
29
|
+
valid: D,
|
|
30
30
|
onChange: h,
|
|
31
|
-
onFocus:
|
|
31
|
+
onFocus: c,
|
|
32
32
|
onBlur: i,
|
|
33
|
+
required: H,
|
|
33
34
|
...j
|
|
34
|
-
} = E, y =
|
|
35
|
+
} = E, y = G(), u = y && y.uRadioButton, l = e.useRef(null), C = e.useCallback(
|
|
35
36
|
() => {
|
|
36
37
|
l.current && l.current.focus();
|
|
37
38
|
},
|
|
@@ -44,26 +45,26 @@ const V = S(), P = e.forwardRef((R, x) => {
|
|
|
44
45
|
[C]
|
|
45
46
|
);
|
|
46
47
|
e.useImperativeHandle(x, s);
|
|
47
|
-
const v =
|
|
48
|
+
const v = J(), K = e.useCallback(
|
|
48
49
|
(n) => {
|
|
49
50
|
d(
|
|
50
51
|
h,
|
|
51
52
|
n,
|
|
52
53
|
s(),
|
|
53
|
-
{ value:
|
|
54
|
+
{ value: r }
|
|
54
55
|
);
|
|
55
56
|
},
|
|
56
|
-
[h,
|
|
57
|
+
[h, r, t]
|
|
57
58
|
), L = e.useCallback(
|
|
58
59
|
(n) => {
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
c && !t && d(
|
|
61
|
+
c,
|
|
61
62
|
n,
|
|
62
63
|
s(),
|
|
63
64
|
void 0
|
|
64
65
|
);
|
|
65
66
|
},
|
|
66
|
-
[
|
|
67
|
+
[c, t]
|
|
67
68
|
), M = e.useCallback(
|
|
68
69
|
(n) => {
|
|
69
70
|
i && !t && d(
|
|
@@ -82,18 +83,19 @@ const V = S(), P = e.forwardRef((R, x) => {
|
|
|
82
83
|
b.input({
|
|
83
84
|
c: u,
|
|
84
85
|
size: N,
|
|
85
|
-
invalid:
|
|
86
|
+
invalid: D === !1,
|
|
86
87
|
checked: p
|
|
87
88
|
}),
|
|
88
89
|
I
|
|
89
90
|
),
|
|
90
91
|
ref: l,
|
|
91
92
|
disabled: t,
|
|
92
|
-
tabIndex:
|
|
93
|
+
tabIndex: Q(w, t),
|
|
93
94
|
checked: p,
|
|
94
|
-
style:
|
|
95
|
+
style: q,
|
|
95
96
|
"aria-describedby": F,
|
|
96
|
-
|
|
97
|
+
"aria-required": H,
|
|
98
|
+
value: r,
|
|
97
99
|
onChange: K,
|
|
98
100
|
onFocus: L,
|
|
99
101
|
onBlur: M,
|
|
@@ -128,11 +130,11 @@ P.propTypes = {
|
|
|
128
130
|
onFocus: a.func,
|
|
129
131
|
onBlur: a.func
|
|
130
132
|
};
|
|
131
|
-
const
|
|
133
|
+
const X = {
|
|
132
134
|
size: "medium"
|
|
133
135
|
};
|
|
134
136
|
P.displayName = "KendoRadioButton";
|
|
135
137
|
export {
|
|
136
138
|
P as RadioButton,
|
|
137
|
-
|
|
139
|
+
W as RadioButtonPropsContext
|
|
138
140
|
};
|
|
@@ -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 K=require("react"),e=require("prop-types"),U=require("./RadioButton.js"),
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const K=require("react"),e=require("prop-types"),U=require("./RadioButton.js"),t=require("@progress/kendo-react-common"),A=require("../package-metadata.js");function J(n){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const o in n)if(o!=="default"){const i=Object.getOwnPropertyDescriptor(n,o);Object.defineProperty(c,o,i.get?i:{enumerable:!0,get:()=>n[o]})}}return c.default=n,Object.freeze(c)}const s=J(K),N=t.createPropsContext(),y=s.forwardRef((n,c)=>{t.validatePackage(A.packageMetadata);const o=t.usePropsContext(N,n),{id:i,ariaLabelledBy:O,ariaDescribedBy:j,className:q,data:g,defaultValue:B,disabled:r,name:I,labelPlacement:F,layout:d,style:S,value:C,valid:x,item:D=Q.item,onChange:b,onFocus:m}=o,v=t.useUnstyled(),h=v&&v.uRadioGroup,u=s.useRef(null),R=s.useCallback(()=>{u.current&&t.focusFirstFocusableChild(u.current)},[]),p=s.useCallback(()=>({element:u.current,focus:R}),[R]);s.useImperativeHandle(c,p);const[M,k]=s.useState(B),P=C!==void 0,f=P?C:M,T=s.useCallback(a=>{const l=a.value;!P&&!r&&k(l),b&&!r&&t.dispatchEvent(b,a.syntheticEvent,p(),{value:l})},[k,b,r]),V=s.useCallback(a=>{m&&!r&&t.dispatchEvent(m,a.syntheticEvent,p(),void 0)},[m,r]),z=t.useId(),_=t.classNames(t.uRadioGroup.ul({c:h,horizontal:d==="horizontal",vertical:d==="vertical"||d===void 0}),q),w=t.useRtl(u,o.dir),H=g&&g.map((a,l)=>{const G=f===a.value,L=f==null,E={...a,valid:x,checked:G,disabled:!!(a.disabled||r),labelPlacement:a.labelPlacement?a.labelPlacement:F,tabIndex:a.tabIndex?a.tabIndex:L&&l===0||G?0:-1,index:l,name:I||z,required:a.required,onChange:T,onFocus:V};return s.createElement(D,{className:t.classNames(t.uRadioGroup.item({c:h,disabled:E.disabled||r})),key:l,role:"none"},s.createElement(U.RadioButton,{...E}))});return s.createElement("ul",{id:i,role:"radiogroup",className:_,ref:u,dir:w,style:S,"aria-labelledby":O,"aria-describedby":j},H)}),Q={item:n=>s.createElement("li",{...n})};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;
|
|
@@ -11,9 +11,9 @@ import e from "prop-types";
|
|
|
11
11
|
import { RadioButton as A } from "./RadioButton.mjs";
|
|
12
12
|
import { createPropsContext as J, validatePackage as Q, usePropsContext as W, useUnstyled as X, focusFirstFocusableChild as Y, dispatchEvent as P, useId as Z, classNames as R, uRadioGroup as E, useRtl as _ } from "@progress/kendo-react-common";
|
|
13
13
|
import { packageMetadata as $ } from "../package-metadata.mjs";
|
|
14
|
-
const ee = J(), G = t.forwardRef((
|
|
14
|
+
const ee = J(), G = t.forwardRef((r, I) => {
|
|
15
15
|
Q($);
|
|
16
|
-
const m = W(ee,
|
|
16
|
+
const m = W(ee, r), {
|
|
17
17
|
id: N,
|
|
18
18
|
ariaLabelledBy: B,
|
|
19
19
|
ariaDescribedBy: F,
|
|
@@ -23,11 +23,11 @@ const ee = J(), G = t.forwardRef((n, I) => {
|
|
|
23
23
|
disabled: s,
|
|
24
24
|
name: O,
|
|
25
25
|
labelPlacement: j,
|
|
26
|
-
layout:
|
|
27
|
-
style:
|
|
26
|
+
layout: n,
|
|
27
|
+
style: q,
|
|
28
28
|
value: p,
|
|
29
|
-
valid:
|
|
30
|
-
item:
|
|
29
|
+
valid: z,
|
|
30
|
+
item: D = ae.item,
|
|
31
31
|
onChange: c,
|
|
32
32
|
onFocus: d
|
|
33
33
|
} = m, f = X(), y = f && f.uRadioGroup, o = t.useRef(null), C = t.useCallback(
|
|
@@ -43,9 +43,9 @@ const ee = J(), G = t.forwardRef((n, I) => {
|
|
|
43
43
|
[C]
|
|
44
44
|
);
|
|
45
45
|
t.useImperativeHandle(I, i);
|
|
46
|
-
const [
|
|
46
|
+
const [H, h] = t.useState(V), v = p !== void 0, u = v ? p : H, L = t.useCallback(
|
|
47
47
|
(a) => {
|
|
48
|
-
|
|
48
|
+
const l = a.value;
|
|
49
49
|
!v && !s && h(l), c && !s && P(
|
|
50
50
|
c,
|
|
51
51
|
a.syntheticEvent,
|
|
@@ -54,7 +54,7 @@ const ee = J(), G = t.forwardRef((n, I) => {
|
|
|
54
54
|
);
|
|
55
55
|
},
|
|
56
56
|
[h, c, s]
|
|
57
|
-
),
|
|
57
|
+
), S = t.useCallback(
|
|
58
58
|
(a) => {
|
|
59
59
|
d && !s && P(
|
|
60
60
|
d,
|
|
@@ -64,28 +64,29 @@ const ee = J(), G = t.forwardRef((n, I) => {
|
|
|
64
64
|
);
|
|
65
65
|
},
|
|
66
66
|
[d, s]
|
|
67
|
-
),
|
|
67
|
+
), T = Z(), w = R(
|
|
68
68
|
E.ul({
|
|
69
69
|
c: y,
|
|
70
|
-
horizontal:
|
|
71
|
-
vertical:
|
|
70
|
+
horizontal: n === "horizontal",
|
|
71
|
+
vertical: n === "vertical" || n === void 0
|
|
72
72
|
}),
|
|
73
73
|
x
|
|
74
|
-
),
|
|
75
|
-
const g = u === a.value,
|
|
74
|
+
), K = _(o, m.dir), M = b && b.map((a, l) => {
|
|
75
|
+
const g = u === a.value, U = u == null, k = {
|
|
76
76
|
...a,
|
|
77
|
-
valid:
|
|
77
|
+
valid: z,
|
|
78
78
|
checked: g,
|
|
79
79
|
disabled: !!(a.disabled || s),
|
|
80
80
|
labelPlacement: a.labelPlacement ? a.labelPlacement : j,
|
|
81
|
-
tabIndex: a.tabIndex ? a.tabIndex :
|
|
81
|
+
tabIndex: a.tabIndex ? a.tabIndex : U && l === 0 || g ? 0 : -1,
|
|
82
82
|
index: l,
|
|
83
|
-
name: O ||
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
name: O || T,
|
|
84
|
+
required: a.required,
|
|
85
|
+
onChange: L,
|
|
86
|
+
onFocus: S
|
|
86
87
|
};
|
|
87
88
|
return /* @__PURE__ */ t.createElement(
|
|
88
|
-
|
|
89
|
+
D,
|
|
89
90
|
{
|
|
90
91
|
className: R(
|
|
91
92
|
E.item({
|
|
@@ -104,17 +105,17 @@ const ee = J(), G = t.forwardRef((n, I) => {
|
|
|
104
105
|
{
|
|
105
106
|
id: N,
|
|
106
107
|
role: "radiogroup",
|
|
107
|
-
className:
|
|
108
|
+
className: w,
|
|
108
109
|
ref: o,
|
|
109
|
-
dir:
|
|
110
|
-
style:
|
|
110
|
+
dir: K,
|
|
111
|
+
style: q,
|
|
111
112
|
"aria-labelledby": B,
|
|
112
113
|
"aria-describedby": F
|
|
113
114
|
},
|
|
114
|
-
|
|
115
|
+
M
|
|
115
116
|
);
|
|
116
117
|
}), ae = {
|
|
117
|
-
item: (
|
|
118
|
+
item: (r) => /* @__PURE__ */ t.createElement("li", { ...r })
|
|
118
119
|
};
|
|
119
120
|
G.propTypes = {
|
|
120
121
|
ariaLabelledBy: e.string,
|
package/slider/Slider.mjs
CHANGED
|
@@ -12,7 +12,7 @@ import { Keys as n, validatePackage as y, classNames as w, Draggable as S, getTa
|
|
|
12
12
|
import { provideLocalizationService as C, registerForLocalization as I } from "@progress/kendo-react-intl";
|
|
13
13
|
import { sliderIncreaseValue as d, messages as h, sliderDecreaseValue as m, sliderDragTitle as u } from "../messages/index.mjs";
|
|
14
14
|
import { SLIDER_LABEL_ATTRIBUTE as L } from "./SliderLabel.mjs";
|
|
15
|
-
import { packageMetadata as
|
|
15
|
+
import { packageMetadata as A } from "../package-metadata.mjs";
|
|
16
16
|
import { Button as v } from "@progress/kendo-react-buttons";
|
|
17
17
|
import { caretAltUpIcon as g, caretAltLeftIcon as f, caretAltRightIcon as b, caretAltDownIcon as k } from "@progress/kendo-svg-icons";
|
|
18
18
|
const p = class p extends i.Component {
|
|
@@ -74,7 +74,7 @@ const p = class p extends i.Component {
|
|
|
74
74
|
}, this.drag = (t) => {
|
|
75
75
|
const e = t.element.getBoundingClientRect(), l = this.props.vertical ? e.bottom - t.event.clientY : this.state.dir === "rtl" ? e.right - t.event.clientX : t.event.clientX - e.left, r = this.props.vertical ? e.height : e.width, o = l / r;
|
|
76
76
|
this.change(t, this.props.min + o * (this.props.max - this.props.min));
|
|
77
|
-
}, y(
|
|
77
|
+
}, y(A);
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
80
80
|
* @hidden
|
|
@@ -138,23 +138,16 @@ const p = class p extends i.Component {
|
|
|
138
138
|
...e
|
|
139
139
|
}
|
|
140
140
|
},
|
|
141
|
-
this.props.children && /* @__PURE__ */ i.createElement(
|
|
142
|
-
|
|
141
|
+
this.props.children && /* @__PURE__ */ i.createElement("ul", { className: "k-reset k-slider-items", style: { margin: 0, ...l } }, i.Children.map(this.props.children, (r, o) => r && i.cloneElement(
|
|
142
|
+
r,
|
|
143
143
|
{
|
|
144
|
-
|
|
145
|
-
|
|
144
|
+
position: 100 * (r.props.position - this.props.min) / (this.props.max - this.props.min),
|
|
145
|
+
vertical: this.props.vertical,
|
|
146
|
+
firstTick: o === 0,
|
|
147
|
+
lastTick: o === i.Children.count(this.props.children) - 1
|
|
146
148
|
},
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
{
|
|
150
|
-
position: 100 * (r.props.position - this.props.min) / (this.props.max - this.props.min),
|
|
151
|
-
vertical: this.props.vertical,
|
|
152
|
-
firstTick: o === 0,
|
|
153
|
-
lastTick: o === i.Children.count(this.props.children) - 1
|
|
154
|
-
},
|
|
155
|
-
r.props.children
|
|
156
|
-
))
|
|
157
|
-
),
|
|
149
|
+
r.props.children
|
|
150
|
+
))),
|
|
158
151
|
/* @__PURE__ */ i.createElement(
|
|
159
152
|
"div",
|
|
160
153
|
{
|
|
@@ -215,11 +208,11 @@ p.displayName = "Slider", p.propTypes = {
|
|
|
215
208
|
// TODO: validation when buttons is set to true, but no step is provided
|
|
216
209
|
};
|
|
217
210
|
let c = p;
|
|
218
|
-
const
|
|
211
|
+
const B = E(), N = D(B, c);
|
|
219
212
|
N.displayName = "KendoReactSlider";
|
|
220
213
|
I(c);
|
|
221
214
|
export {
|
|
222
215
|
N as Slider,
|
|
223
|
-
|
|
216
|
+
B as SliderPropsContext,
|
|
224
217
|
c as SliderWithoutContext
|
|
225
218
|
};
|
package/switch/Switch.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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react"),
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react"),i=require("prop-types"),s=require("@progress/kendo-react-common"),S=require("@progress/kendo-react-intl"),p=require("../messages/index.js"),N=require("../package-metadata.js");function O(o){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const e in o)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(a,e,t.get?t:{enumerable:!0,get:()=>o[e]})}}return a.default=o,Object.freeze(a)}const r=O(C),n=class n extends r.Component{constructor(a){super(a),this.setValidity=()=>{this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity.valid?"":this.props.validationMessage||this.defaultValidationMessage.toLanguageString(p.switchValidation,p.messages[p.switchValidation]))},this.limit=(e,t,d)=>{const h=d.offsetWidth,l=t.offsetWidth;return e<0?0:e>h-l?h-l:e},this.toggle=(e,t)=>{this.setState({checked:e}),this.valueDuringOnChange=e,s.dispatchEvent(this.props.onChange,t,this,{value:e}),this.valueDuringOnChange=void 0},this._element=null,this._wrapper=null,this._input=null,this._id=this.props.id,this.defaultValidationMessage=S.provideLocalizationService(this),this.focus=()=>{this.actionElement&&this.actionElement.focus()},this.dummyInput=e=>r.createElement("input",{type:"checkbox",checked:this.props.checked,ref:t=>{this._input=t},tabIndex:-1,"aria-hidden":!0,value:e,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"},onChange:s.noop,name:this.name||void 0}),this.handleClick=e=>{this.eventTimeStamp!==e.timeStamp&&(this.eventTimeStamp=e.timeStamp,this.toggle(!this.value,e))},this.handleKeyDown=e=>{if(this.props.disabled)return;const{keyCode:t}=e;(t===s.Keys.space||t===s.Keys.enter)&&(this.toggle(!this.value,e),e.preventDefault())},this.handleWrapperFocus=e=>{if(this.props.disabled)return;this.setState({focused:!0});const{onFocus:t}=this.props;t&&t.call(void 0,e)},this.handleWrapperBlur=e=>{if(this.props.disabled)return;this.setState({focused:!1});const{onBlur:t}=this.props;t&&t.call(void 0,e)},s.validatePackage(N.packageMetadata),this.state={checked:a.defaultChecked||n.defaultProps.defaultChecked,focused:!1}}get value(){return this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.checked!==void 0?this.props.checked:this.state.checked}get element(){return this._element}get actionElement(){return this._wrapper}get name(){return this.props.name}get validity(){const a=this.props.validationMessage!==void 0,e=this.props.valid!==void 0?this.props.valid:this.props.required?!!this.value:!0,t=this.props.valid!==void 0?this.props.valid:e;return{customError:a,valid:t,valueMissing:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:n.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:!1}componentDidMount(){this.setValidity(),this.forceUpdate()}componentDidUpdate(){this.setValidity()}render(){const{focused:a}=this.state,{dir:e,disabled:t,trackRounded:d,thumbRounded:h,size:l,offLabel:m,onLabel:f,tabIndex:v}=this.props;this.dir=e||this.element&&getComputedStyle(this.element).direction||void 0;const y=!this.validityStyles||this.validity.valid,k=s.classNames("k-switch",{[`k-switch-${s.kendoThemeMaps.sizeMap[l]||l}`]:l,"k-switch-on":this.value,"k-switch-off":!this.value,"k-focus":a,"k-disabled":t,"k-invalid":!y},this.props.className),w={"aria-checked":this.value,"aria-disabled":t||void 0,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,"aria-label":this.props.ariaLabel,"aria-required":this.props.required};return r.createElement("span",{ref:u=>{this._wrapper=u},role:"switch",...w,className:k,dir:this.dir,onKeyDown:this.handleKeyDown,onClick:this.handleClick,onBlur:this.handleWrapperBlur,onFocus:this.handleWrapperFocus,tabIndex:s.getTabIndex(v,t,void 0),accessKey:this.props.accessKey,id:this.props.id||this._id},r.createElement("span",{className:s.classNames("k-switch-track",{[`k-rounded-${s.kendoThemeMaps.roundedMap[d]||d}`]:d}),ref:u=>{this._element=u}},this.dummyInput(this.value),f?r.createElement("span",{className:"k-switch-label-on"},f):"",m?r.createElement("span",{className:"k-switch-label-off"},m):""),r.createElement("span",{className:"k-switch-thumb-wrap"},r.createElement("span",{className:s.classNames("k-switch-thumb",{[`k-rounded-${h}`]:h})})))}};n.displayName="Switch",n.propTypes={accessKey:i.string,checked:i.bool,className:i.string,disabled:i.bool,defaultChecked:i.bool,size:i.oneOf([null,"small","medium","large"]),trackRounded:i.oneOf([null,"small","medium","large","full"]),thumbRounded:i.oneOf([null,"small","medium","large","full"]),dir:i.string,id:i.string,ariaLabelledBy:i.string,ariaDescribedBy:i.string,offLabel:i.string,required:i.bool,tabIndex:i.number,valid:i.bool,validate:i.bool,validationMessage:i.string,onBlur:i.any,onChange:i.any,onFocus:i.any,onLabel:i.string},n.defaultProps={disabled:!1,defaultChecked:!1,size:"medium",trackRounded:"full",thumbRounded:"full",offLabel:"OFF",onBlur:s.noop,onFocus:s.noop,onLabel:"ON",validityStyles:!0};let c=n;const g=s.createPropsContext(),b=s.withIdHOC(s.withPropsContext(g,c));b.displayName="KendoReactSwitch";exports.Switch=b;exports.SwitchPropsContext=g;exports.SwitchWithoutContext=c;
|
package/switch/Switch.mjs
CHANGED
|
@@ -106,7 +106,7 @@ const a = class a extends s.Component {
|
|
|
106
106
|
* @hidden
|
|
107
107
|
*/
|
|
108
108
|
get required() {
|
|
109
|
-
return this.props.required !== void 0 ? this.props.required :
|
|
109
|
+
return this.props.required !== void 0 ? this.props.required : !1;
|
|
110
110
|
}
|
|
111
111
|
/**
|
|
112
112
|
* @hidden
|
|
@@ -142,7 +142,8 @@ const a = class a extends s.Component {
|
|
|
142
142
|
"aria-disabled": i || void 0,
|
|
143
143
|
"aria-labelledby": this.props.ariaLabelledBy,
|
|
144
144
|
"aria-describedby": this.props.ariaDescribedBy,
|
|
145
|
-
"aria-label": this.props.ariaLabel
|
|
145
|
+
"aria-label": this.props.ariaLabel,
|
|
146
|
+
"aria-required": this.props.required
|
|
146
147
|
};
|
|
147
148
|
return /* @__PURE__ */ s.createElement(
|
|
148
149
|
"span",
|
|
@@ -214,7 +215,6 @@ a.displayName = "Switch", a.propTypes = {
|
|
|
214
215
|
onBlur: h,
|
|
215
216
|
onFocus: h,
|
|
216
217
|
onLabel: "ON",
|
|
217
|
-
required: !1,
|
|
218
218
|
validityStyles: !0
|
|
219
219
|
};
|
|
220
220
|
let c = a;
|
package/textarea/TextArea.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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const se=require("react"),e=require("prop-types"),a=require("@progress/kendo-react-common");function le(s){const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const se=require("react"),e=require("prop-types"),a=require("@progress/kendo-react-common");function le(s){const u=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const o in s)if(o!=="default"){const l=Object.getOwnPropertyDescriptor(s,o);Object.defineProperty(u,o,l.get?l:{enumerable:!0,get:()=>s[o]})}}return u.default=s,Object.freeze(u)}const t=le(se),B=a.createPropsContext(),z=t.forwardRef((s,u)=>{const o=a.usePropsContext(B,s),{size:l=p.size,rounded:b=p.rounded,fillMode:O=p.fillMode,autoFocus:F=p.autoFocus,prefix:N=null,suffix:w=null,ariaDescribedBy:j,ariaLabelledBy:q,autoSize:T,className:R,defaultValue:D,disabled:n,readOnly:H,required:c,rows:$,id:L,name:_,placeholder:K,style:G,tabIndex:J,value:g,valid:P,validationMessage:M,validityStyles:S,onChange:x,onFocus:v,onBlur:y,visited:ie,touched:ue,modified:ce,resizable:h,...Q}=o,r=t.useRef(null),E=t.useCallback(()=>{r.current&&r.current.focus()},[]),[I,V]=t.useState(D),[U,W]=a.useCustomComponent(N),[X,Y]=a.useCustomComponent(w),d=g!==void 0,f=d?g:I,m=t.useCallback(()=>({element:r,focus:E,get value(){return f},get name(){return r.current&&r.current.name}}),[E,f]);t.useImperativeHandle(u,m);const[Z,A]=t.useState("auto"),ee=a.useId(),te=a.useDir(r,o.dir),C=P!==void 0?P:c?!!f:!0;t.useEffect(()=>{r.current&&r.current.setCustomValidity&&r.current.setCustomValidity(C?"":M||"")},[C,M]),a.useIsomorphicLayoutEffect(()=>{r.current&&A(`${r.current.scrollHeight}px`)},[f]);const ae=t.useCallback(i=>{const k=i.target.value;A("auto"),!d&&!n&&V(k),x&&!n&&a.dispatchEvent(x,i,{...m(),value:k},{value:k})},[V,x,n,d]),re=t.useCallback(i=>{v&&!n&&a.dispatchEvent(v,i,m(),void 0)},[v,n]),ne=t.useCallback(i=>{y&&!n&&a.dispatchEvent(y,i,m(),void 0)},[y,n]),oe={id:L||ee,role:"textbox",name:_,className:a.classNames("k-input-inner","!k-overflow-auto",{"k-resize":!T&&h!=="none"}),ref:r,disabled:n,rows:$,placeholder:K,readOnly:H,required:c,tabIndex:a.getTabIndex(J,n),autoFocus:F,style:T?{resize:"none",overflow:"hidden",height:Z}:h?{resize:h}:{},"aria-labelledby":q,"aria-describedby":j,"aria-multiline":!0,"aria-disabled":n||void 0,"aria-required":c,value:d?g:I,...Q,onChange:ae,onFocus:re,onBlur:ne};return t.createElement("span",{className:a.classNames("k-input","k-textarea",{[`k-input-${a.kendoThemeMaps.sizeMap[l]||l}`]:l,[`k-input-${O}`]:O,[`k-rounded-${a.kendoThemeMaps.roundedMap[b]||b}`]:b,"k-invalid":!(C||S!==void 0||S===!0),"k-required":c,"k-disabled":n},R),style:G,dir:te},o.prefix&&t.createElement(U,{...W}),t.createElement("textarea",{...oe}),o.suffix&&t.createElement(X,{...Y}))});z.propTypes={ariaDescribedBy:e.string,ariaLabelledBy:e.string,autoSize:e.bool,className:e.string,defaultValue:e.string,dir:e.string,disabled:e.bool,readOnly:e.bool,rows:e.number,id:e.string,name:e.string,placeholder:e.string,style:e.object,tabIndex:e.number,value:e.oneOfType([e.string,e.arrayOf(e.string),e.number]),onChange:e.func,onFocus:e.func,onBlur:e.func,size:e.oneOf([null,"small","medium","large"]),rounded:e.oneOf([null,"small","medium","large","full"]),fillMode:e.oneOf([null,"solid","flat","outline"]),resizable:e.oneOf(["none","both","horizontal","vertical"]),autoFocus:e.bool};const p={size:"medium",rounded:"medium",fillMode:"solid",autoFocus:!1};z.displayName="KendoTextArea";exports.TextArea=z;exports.TextAreaPropsContext=B;
|
package/textarea/TextArea.mjs
CHANGED
|
@@ -11,20 +11,20 @@ import e from "prop-types";
|
|
|
11
11
|
import { createPropsContext as ie, usePropsContext as ue, useCustomComponent as F, useId as de, useDir as ce, useIsomorphicLayoutEffect as fe, dispatchEvent as y, classNames as M, getTabIndex as me, kendoThemeMaps as O } from "@progress/kendo-react-common";
|
|
12
12
|
const pe = ie(), S = t.forwardRef((w, A) => {
|
|
13
13
|
const n = ue(pe, w), {
|
|
14
|
-
size:
|
|
15
|
-
rounded:
|
|
16
|
-
fillMode: k =
|
|
17
|
-
autoFocus: N =
|
|
14
|
+
size: c = d.size,
|
|
15
|
+
rounded: f = d.rounded,
|
|
16
|
+
fillMode: k = d.fillMode,
|
|
17
|
+
autoFocus: N = d.autoFocus,
|
|
18
18
|
prefix: H = null,
|
|
19
19
|
suffix: R = null,
|
|
20
20
|
ariaDescribedBy: $,
|
|
21
|
-
ariaLabelledBy:
|
|
21
|
+
ariaLabelledBy: q,
|
|
22
22
|
autoSize: C,
|
|
23
|
-
className:
|
|
24
|
-
defaultValue:
|
|
23
|
+
className: D,
|
|
24
|
+
defaultValue: L,
|
|
25
25
|
disabled: r,
|
|
26
26
|
readOnly: j,
|
|
27
|
-
required:
|
|
27
|
+
required: s,
|
|
28
28
|
rows: K,
|
|
29
29
|
id: G,
|
|
30
30
|
name: J,
|
|
@@ -49,21 +49,21 @@ const pe = ie(), S = t.forwardRef((w, A) => {
|
|
|
49
49
|
a.current && a.current.focus();
|
|
50
50
|
},
|
|
51
51
|
[]
|
|
52
|
-
), [V, B] = t.useState(
|
|
52
|
+
), [V, B] = t.useState(L), [Y, Z] = F(H), [_, ee] = F(R), l = m !== void 0, i = l ? m : V, u = t.useCallback(
|
|
53
53
|
() => ({
|
|
54
54
|
element: a,
|
|
55
55
|
focus: T,
|
|
56
56
|
get value() {
|
|
57
|
-
return
|
|
57
|
+
return i;
|
|
58
58
|
},
|
|
59
59
|
get name() {
|
|
60
60
|
return a.current && a.current.name;
|
|
61
61
|
}
|
|
62
62
|
}),
|
|
63
|
-
[T,
|
|
63
|
+
[T, i]
|
|
64
64
|
);
|
|
65
|
-
t.useImperativeHandle(A,
|
|
66
|
-
const [te, E] = t.useState("auto"), ae = de(), re = ce(a, n.dir), v = z !== void 0 ? z :
|
|
65
|
+
t.useImperativeHandle(A, u);
|
|
66
|
+
const [te, E] = t.useState("auto"), ae = de(), re = ce(a, n.dir), v = z !== void 0 ? z : s ? !!i : !0;
|
|
67
67
|
t.useEffect(
|
|
68
68
|
() => {
|
|
69
69
|
a.current && a.current.setCustomValidity && a.current.setCustomValidity(
|
|
@@ -75,28 +75,28 @@ const pe = ie(), S = t.forwardRef((w, A) => {
|
|
|
75
75
|
() => {
|
|
76
76
|
a.current && E(`${a.current.scrollHeight}px`);
|
|
77
77
|
},
|
|
78
|
-
[
|
|
78
|
+
[i]
|
|
79
79
|
);
|
|
80
80
|
const oe = t.useCallback(
|
|
81
81
|
(o) => {
|
|
82
82
|
const h = o.target.value;
|
|
83
|
-
E("auto"), !
|
|
83
|
+
E("auto"), !l && !r && B(h), p && !r && y(
|
|
84
84
|
p,
|
|
85
85
|
o,
|
|
86
86
|
{
|
|
87
|
-
...
|
|
87
|
+
...u(),
|
|
88
88
|
value: h
|
|
89
89
|
},
|
|
90
90
|
{ value: h }
|
|
91
91
|
);
|
|
92
92
|
},
|
|
93
|
-
[B, p, r,
|
|
93
|
+
[B, p, r, l]
|
|
94
94
|
), ne = t.useCallback(
|
|
95
95
|
(o) => {
|
|
96
96
|
b && !r && y(
|
|
97
97
|
b,
|
|
98
98
|
o,
|
|
99
|
-
|
|
99
|
+
u(),
|
|
100
100
|
void 0
|
|
101
101
|
);
|
|
102
102
|
},
|
|
@@ -106,7 +106,7 @@ const pe = ie(), S = t.forwardRef((w, A) => {
|
|
|
106
106
|
x && !r && y(
|
|
107
107
|
x,
|
|
108
108
|
o,
|
|
109
|
-
|
|
109
|
+
u(),
|
|
110
110
|
void 0
|
|
111
111
|
);
|
|
112
112
|
},
|
|
@@ -121,15 +121,16 @@ const pe = ie(), S = t.forwardRef((w, A) => {
|
|
|
121
121
|
rows: K,
|
|
122
122
|
placeholder: Q,
|
|
123
123
|
readOnly: j,
|
|
124
|
-
required:
|
|
124
|
+
required: s,
|
|
125
125
|
tabIndex: me(W, r),
|
|
126
126
|
autoFocus: N,
|
|
127
127
|
style: C ? { resize: "none", overflow: "hidden", height: te } : g ? { resize: g } : {},
|
|
128
|
-
"aria-labelledby":
|
|
128
|
+
"aria-labelledby": q,
|
|
129
129
|
"aria-describedby": $,
|
|
130
130
|
"aria-multiline": !0,
|
|
131
131
|
"aria-disabled": r || void 0,
|
|
132
|
-
|
|
132
|
+
"aria-required": s,
|
|
133
|
+
value: l ? m : V,
|
|
133
134
|
...X,
|
|
134
135
|
onChange: oe,
|
|
135
136
|
onFocus: ne,
|
|
@@ -142,14 +143,14 @@ const pe = ie(), S = t.forwardRef((w, A) => {
|
|
|
142
143
|
"k-input",
|
|
143
144
|
"k-textarea",
|
|
144
145
|
{
|
|
145
|
-
[`k-input-${O.sizeMap[
|
|
146
|
+
[`k-input-${O.sizeMap[c] || c}`]: c,
|
|
146
147
|
[`k-input-${k}`]: k,
|
|
147
|
-
[`k-rounded-${O.roundedMap[
|
|
148
|
+
[`k-rounded-${O.roundedMap[f] || f}`]: f,
|
|
148
149
|
"k-invalid": !(v || P !== void 0 || P === !0),
|
|
149
|
-
"k-required":
|
|
150
|
+
"k-required": s,
|
|
150
151
|
"k-disabled": r
|
|
151
152
|
},
|
|
152
|
-
|
|
153
|
+
D
|
|
153
154
|
),
|
|
154
155
|
style: U,
|
|
155
156
|
dir: re
|
|
@@ -188,7 +189,7 @@ S.propTypes = {
|
|
|
188
189
|
resizable: e.oneOf(["none", "both", "horizontal", "vertical"]),
|
|
189
190
|
autoFocus: e.bool
|
|
190
191
|
};
|
|
191
|
-
const
|
|
192
|
+
const d = {
|
|
192
193
|
size: "medium",
|
|
193
194
|
rounded: "medium",
|
|
194
195
|
fillMode: "solid",
|
package/textbox/Textbox.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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react"),c=require("prop-types"),a=require("@progress/kendo-react-common"),p=require("../package-metadata.js");function z(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const l=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,l.get?l:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const t=z(j),d=t.forwardRef((e,r)=>{a.validatePackage(p.packageMetadata);const n=t.useRef(null),l=t.useRef(null),s=t.useRef(),f=a.useUnstyled(),i=f&&f.uTextBox,b=t.useCallback(()=>{var u;return s.current!==void 0?s.current:(u=n.current)==null?void 0:u.value},[]);t.useImperativeHandle(l,()=>({get element(){return n.current},get name(){return n.current&&n.current.name},get value(){return b()}})),t.useImperativeHandle(r,()=>l.current);const{size:m=o.size,fillMode:g=o.fillMode,rounded:v=o.rounded,autoFocus:h=o.autoFocus,className:x,dir:B,style:F,prefix:T=o.prefix,suffix:_=o.suffix,valid:w,modified:D,touched:H,visited:I,...q}=e,[M]=a.useCustomComponent(T),[O]=a.useCustomComponent(_),[C,y]=t.useState(!1),R=u=>{y(!0)},N=u=>{y(!1)},S=t.useCallback(u=>{s.current=u.target.value,e.onChange&&e.onChange.call(void 0,{syntheticEvent:u,nativeEvent:u.nativeEvent,value:u.target.value,target:l.current}),s.current=void 0},[e.onChange]),{onFocus:k,onBlur:E}=a.useAsyncFocusBlur({onFocus:R,onBlur:N,onSyncFocus:e.onFocus,onSyncBlur:e.onBlur}),P=t.useMemo(()=>a.classNames(a.uTextBox.wrapper({c:i,rounded:v,fillMode:g,size:m,focused:C,required:e.required,disabled:e.disabled,invalid:e.valid===!1}),x),[x,g,C,e.disabled,e.required,e.valid,v,m,i]);return t.createElement("span",{style:F,dir:B,className:P,onFocus:k,onBlur:E},t.createElement(M,null),t.createElement("input",{ref:n,className:a.classNames(a.uTextBox.input({c:i})),autoFocus:h,...q,"aria-required":e.required,onChange:S}),t.createElement(O,null))}),o={prefix:e=>null,suffix:e=>null,size:"medium",rounded:"medium",fillMode:"solid",autoFocus:!1};d.propTypes={size:c.oneOf([null,"small","medium","large"]),rounded:c.oneOf([null,"small","medium","large","full"]),fillMode:c.oneOf([null,"solid","flat","outline"]),autoFocus:c.bool};d.displayName="KendoReactTextBoxComponent";exports.TextBox=d;
|