@progress/kendo-react-inputs 8.3.0-develop.1 → 8.3.0-develop.11
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/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/index.d.mts +16 -3
- package/index.d.ts +16 -3
- package/input/Input.js +1 -1
- package/input/Input.mjs +84 -77
- package/input/InputPrefix.js +1 -1
- package/input/InputPrefix.mjs +19 -11
- package/input/InputSuffix.js +1 -1
- package/input/InputSuffix.mjs +19 -11
- package/maskedtextbox/MaskedTextBox.js +1 -1
- package/maskedtextbox/MaskedTextBox.mjs +69 -69
- package/package-metadata.mjs +1 -1
- package/package.json +8 -8
- package/radiobutton/RadioButton.js +1 -1
- package/radiobutton/RadioButton.mjs +80 -80
- package/radiobutton/RadioGroup.js +1 -1
- package/radiobutton/RadioGroup.mjs +76 -71
- package/textbox/Textbox.js +1 -1
- package/textbox/Textbox.mjs +82 -84
|
@@ -8,110 +8,115 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as t from "react";
|
|
10
10
|
import e from "prop-types";
|
|
11
|
-
import { RadioButton as
|
|
12
|
-
import { createPropsContext as
|
|
13
|
-
import { packageMetadata as
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
const m =
|
|
17
|
-
id:
|
|
18
|
-
ariaLabelledBy:
|
|
19
|
-
ariaDescribedBy:
|
|
20
|
-
className:
|
|
11
|
+
import { RadioButton as A } from "./RadioButton.mjs";
|
|
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
|
+
import { packageMetadata as $ } from "../package-metadata.mjs";
|
|
14
|
+
const ee = J(), G = t.forwardRef((n, I) => {
|
|
15
|
+
Q($);
|
|
16
|
+
const m = W(ee, n), {
|
|
17
|
+
id: N,
|
|
18
|
+
ariaLabelledBy: B,
|
|
19
|
+
ariaDescribedBy: F,
|
|
20
|
+
className: x,
|
|
21
21
|
data: b,
|
|
22
|
-
defaultValue:
|
|
23
|
-
disabled:
|
|
24
|
-
name:
|
|
25
|
-
labelPlacement:
|
|
26
|
-
layout:
|
|
27
|
-
style:
|
|
22
|
+
defaultValue: V,
|
|
23
|
+
disabled: s,
|
|
24
|
+
name: O,
|
|
25
|
+
labelPlacement: j,
|
|
26
|
+
layout: r,
|
|
27
|
+
style: z,
|
|
28
28
|
value: p,
|
|
29
|
-
valid:
|
|
30
|
-
item:
|
|
29
|
+
valid: D,
|
|
30
|
+
item: H = ae.item,
|
|
31
31
|
onChange: c,
|
|
32
|
-
onFocus:
|
|
33
|
-
} = m, o = t.useRef(null),
|
|
32
|
+
onFocus: d
|
|
33
|
+
} = m, f = X(), y = f && f.uRadioGroup, o = t.useRef(null), C = t.useCallback(
|
|
34
34
|
() => {
|
|
35
|
-
o.current &&
|
|
35
|
+
o.current && Y(o.current);
|
|
36
36
|
},
|
|
37
37
|
[]
|
|
38
|
-
),
|
|
38
|
+
), i = t.useCallback(
|
|
39
39
|
() => ({
|
|
40
40
|
element: o.current,
|
|
41
|
-
focus:
|
|
41
|
+
focus: C
|
|
42
42
|
}),
|
|
43
|
-
[
|
|
43
|
+
[C]
|
|
44
44
|
);
|
|
45
|
-
t.useImperativeHandle(
|
|
46
|
-
const [
|
|
45
|
+
t.useImperativeHandle(I, i);
|
|
46
|
+
const [L, h] = t.useState(V), v = p !== void 0, u = v ? p : L, S = t.useCallback(
|
|
47
47
|
(a) => {
|
|
48
|
-
let
|
|
49
|
-
!
|
|
48
|
+
let l = a.value;
|
|
49
|
+
!v && !s && h(l), c && !s && P(
|
|
50
50
|
c,
|
|
51
51
|
a.syntheticEvent,
|
|
52
|
-
|
|
53
|
-
{ value:
|
|
52
|
+
i(),
|
|
53
|
+
{ value: l }
|
|
54
54
|
);
|
|
55
55
|
},
|
|
56
|
-
[
|
|
57
|
-
),
|
|
56
|
+
[h, c, s]
|
|
57
|
+
), T = t.useCallback(
|
|
58
58
|
(a) => {
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
d && !s && P(
|
|
60
|
+
d,
|
|
61
61
|
a.syntheticEvent,
|
|
62
|
-
|
|
62
|
+
i(),
|
|
63
63
|
void 0
|
|
64
64
|
);
|
|
65
65
|
},
|
|
66
|
-
[
|
|
67
|
-
),
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
),
|
|
75
|
-
const
|
|
66
|
+
[d, s]
|
|
67
|
+
), w = Z(), K = R(
|
|
68
|
+
E.ul({
|
|
69
|
+
c: y,
|
|
70
|
+
horizontal: r === "horizontal",
|
|
71
|
+
vertical: r === "vertical" || r === void 0
|
|
72
|
+
}),
|
|
73
|
+
x
|
|
74
|
+
), M = _(o, m.dir), U = b && b.map((a, l) => {
|
|
75
|
+
const g = u === a.value, q = u == null, k = {
|
|
76
76
|
...a,
|
|
77
|
-
valid:
|
|
78
|
-
checked:
|
|
79
|
-
disabled: !!(a.disabled ||
|
|
80
|
-
labelPlacement: a.labelPlacement ? a.labelPlacement :
|
|
81
|
-
tabIndex: a.tabIndex ? a.tabIndex :
|
|
82
|
-
index:
|
|
83
|
-
name:
|
|
84
|
-
onChange:
|
|
85
|
-
onFocus:
|
|
77
|
+
valid: D,
|
|
78
|
+
checked: g,
|
|
79
|
+
disabled: !!(a.disabled || s),
|
|
80
|
+
labelPlacement: a.labelPlacement ? a.labelPlacement : j,
|
|
81
|
+
tabIndex: a.tabIndex ? a.tabIndex : q && l === 0 || g ? 0 : -1,
|
|
82
|
+
index: l,
|
|
83
|
+
name: O || w,
|
|
84
|
+
onChange: S,
|
|
85
|
+
onFocus: T
|
|
86
86
|
};
|
|
87
87
|
return /* @__PURE__ */ t.createElement(
|
|
88
|
-
|
|
88
|
+
H,
|
|
89
89
|
{
|
|
90
|
-
className:
|
|
91
|
-
|
|
90
|
+
className: R(
|
|
91
|
+
E.item({
|
|
92
|
+
c: y,
|
|
93
|
+
disabled: k.disabled || s
|
|
94
|
+
})
|
|
95
|
+
),
|
|
96
|
+
key: l,
|
|
92
97
|
role: "none"
|
|
93
98
|
},
|
|
94
|
-
/* @__PURE__ */ t.createElement(
|
|
99
|
+
/* @__PURE__ */ t.createElement(A, { ...k })
|
|
95
100
|
);
|
|
96
101
|
});
|
|
97
102
|
return /* @__PURE__ */ t.createElement(
|
|
98
103
|
"ul",
|
|
99
104
|
{
|
|
100
|
-
id:
|
|
105
|
+
id: N,
|
|
101
106
|
role: "radiogroup",
|
|
102
|
-
className:
|
|
107
|
+
className: K,
|
|
103
108
|
ref: o,
|
|
104
|
-
dir:
|
|
105
|
-
style:
|
|
106
|
-
"aria-labelledby":
|
|
107
|
-
"aria-describedby":
|
|
109
|
+
dir: M,
|
|
110
|
+
style: z,
|
|
111
|
+
"aria-labelledby": B,
|
|
112
|
+
"aria-describedby": F
|
|
108
113
|
},
|
|
109
|
-
|
|
114
|
+
U
|
|
110
115
|
);
|
|
111
|
-
}),
|
|
112
|
-
item: (
|
|
116
|
+
}), ae = {
|
|
117
|
+
item: (n) => /* @__PURE__ */ t.createElement("li", { ...n })
|
|
113
118
|
};
|
|
114
|
-
|
|
119
|
+
G.propTypes = {
|
|
115
120
|
ariaLabelledBy: e.string,
|
|
116
121
|
ariaDescribedBy: e.string,
|
|
117
122
|
className: e.string,
|
|
@@ -127,8 +132,8 @@ P.propTypes = {
|
|
|
127
132
|
onChange: e.func,
|
|
128
133
|
onFocus: e.func
|
|
129
134
|
};
|
|
130
|
-
|
|
135
|
+
G.displayName = "KendoRadioGroup";
|
|
131
136
|
export {
|
|
132
|
-
|
|
133
|
-
|
|
137
|
+
G as RadioGroup,
|
|
138
|
+
ee as RadioGroupPropsContext
|
|
134
139
|
};
|
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 P=require("react"),c=require("prop-types"),l=require("@progress/kendo-react-common"),j=require("../package-metadata.js");function z(e){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(s,n,a.get?a:{enumerable:!0,get:()=>e[n]})}}return s.default=e,Object.freeze(s)}const t=z(P),d=t.forwardRef((e,s)=>{l.validatePackage(j.packageMetadata);const n=t.useRef(null),a=t.useRef(null),r=t.useRef(),f=l.useUnstyled(),i=f&&f.uTextBox,b=t.useCallback(()=>{var u;return r.current!==void 0?r.current:(u=n.current)==null?void 0:u.value},[]);t.useImperativeHandle(a,()=>({get element(){return n.current},get name(){return n.current&&n.current.name},get value(){return b()}})),t.useImperativeHandle(s,()=>a.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,...M}=e,[O]=l.useCustomComponent(T),[R]=l.useCustomComponent(_),[C,y]=t.useState(!1),N=u=>{y(!0)},S=u=>{y(!1)},k=t.useCallback(u=>{r.current=u.target.value,e.onChange&&e.onChange.call(void 0,{syntheticEvent:u,nativeEvent:u.nativeEvent,value:u.target.value,target:a.current}),r.current=void 0},[e.onChange]),{onFocus:p,onBlur:q}=l.useAsyncFocusBlur({onFocus:N,onBlur:S,onSyncFocus:e.onFocus,onSyncBlur:e.onBlur}),E=t.useMemo(()=>l.classNames(l.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:E,onFocus:p,onBlur:q},t.createElement(O,null),t.createElement("input",{ref:n,className:l.classNames(l.uTextBox.input({c:i})),autoFocus:h,...M,onChange:k}),t.createElement(R,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;
|
package/textbox/Textbox.mjs
CHANGED
|
@@ -6,21 +6,21 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
10
|
-
import
|
|
11
|
-
import { validatePackage as
|
|
12
|
-
import { packageMetadata as
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
const l =
|
|
9
|
+
import * as t from "react";
|
|
10
|
+
import o from "prop-types";
|
|
11
|
+
import { validatePackage as w, useUnstyled as H, useCustomComponent as g, useAsyncFocusBlur as I, classNames as h, uTextBox as C } from "@progress/kendo-react-common";
|
|
12
|
+
import { packageMetadata as A } from "../package-metadata.mjs";
|
|
13
|
+
const B = t.forwardRef((e, F) => {
|
|
14
|
+
w(A);
|
|
15
|
+
const l = t.useRef(null), s = t.useRef(null), a = t.useRef(), c = H(), r = c && c.uTextBox, y = t.useCallback(
|
|
16
16
|
() => {
|
|
17
|
-
var
|
|
18
|
-
return
|
|
17
|
+
var n;
|
|
18
|
+
return a.current !== void 0 ? a.current : (n = l.current) == null ? void 0 : n.value;
|
|
19
19
|
},
|
|
20
20
|
[]
|
|
21
21
|
);
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
t.useImperativeHandle(
|
|
23
|
+
s,
|
|
24
24
|
() => ({
|
|
25
25
|
get element() {
|
|
26
26
|
return l.current;
|
|
@@ -29,100 +29,98 @@ const v = e.forwardRef((n, g) => {
|
|
|
29
29
|
return l.current && l.current.name;
|
|
30
30
|
},
|
|
31
31
|
get value() {
|
|
32
|
-
return
|
|
32
|
+
return y();
|
|
33
33
|
}
|
|
34
34
|
})
|
|
35
|
-
),
|
|
36
|
-
|
|
37
|
-
() =>
|
|
35
|
+
), t.useImperativeHandle(
|
|
36
|
+
F,
|
|
37
|
+
() => s.current
|
|
38
38
|
);
|
|
39
39
|
const {
|
|
40
|
-
size:
|
|
41
|
-
fillMode:
|
|
42
|
-
rounded:
|
|
43
|
-
autoFocus:
|
|
44
|
-
className:
|
|
45
|
-
dir:
|
|
46
|
-
style:
|
|
47
|
-
prefix:
|
|
48
|
-
suffix:
|
|
49
|
-
valid:
|
|
40
|
+
size: i = u.size,
|
|
41
|
+
fillMode: d = u.fillMode,
|
|
42
|
+
rounded: f = u.rounded,
|
|
43
|
+
autoFocus: E = u.autoFocus,
|
|
44
|
+
className: m,
|
|
45
|
+
dir: R,
|
|
46
|
+
style: _,
|
|
47
|
+
prefix: b = u.prefix,
|
|
48
|
+
suffix: M = u.suffix,
|
|
49
|
+
valid: D,
|
|
50
50
|
// Destruct to avoid warning when used inside a form field
|
|
51
|
-
modified:
|
|
52
|
-
touched:
|
|
53
|
-
visited:
|
|
54
|
-
...
|
|
55
|
-
} =
|
|
56
|
-
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
},
|
|
60
|
-
(
|
|
61
|
-
|
|
62
|
-
syntheticEvent:
|
|
63
|
-
nativeEvent:
|
|
64
|
-
value:
|
|
65
|
-
target:
|
|
66
|
-
}),
|
|
51
|
+
modified: G,
|
|
52
|
+
touched: K,
|
|
53
|
+
visited: U,
|
|
54
|
+
...N
|
|
55
|
+
} = e, [T] = g(b), [k] = g(M), [v, x] = t.useState(!1), z = (n) => {
|
|
56
|
+
x(!0);
|
|
57
|
+
}, P = (n) => {
|
|
58
|
+
x(!1);
|
|
59
|
+
}, S = t.useCallback(
|
|
60
|
+
(n) => {
|
|
61
|
+
a.current = n.target.value, e.onChange && e.onChange.call(void 0, {
|
|
62
|
+
syntheticEvent: n,
|
|
63
|
+
nativeEvent: n.nativeEvent,
|
|
64
|
+
value: n.target.value,
|
|
65
|
+
target: s.current
|
|
66
|
+
}), a.current = void 0;
|
|
67
67
|
},
|
|
68
|
-
[
|
|
69
|
-
), { onFocus:
|
|
70
|
-
onFocus:
|
|
71
|
-
onBlur:
|
|
72
|
-
onSyncFocus:
|
|
73
|
-
onSyncBlur:
|
|
74
|
-
})
|
|
75
|
-
|
|
68
|
+
[e.onChange]
|
|
69
|
+
), { onFocus: p, onBlur: q } = I({
|
|
70
|
+
onFocus: z,
|
|
71
|
+
onBlur: P,
|
|
72
|
+
onSyncFocus: e.onFocus,
|
|
73
|
+
onSyncBlur: e.onBlur
|
|
74
|
+
}), O = t.useMemo(
|
|
75
|
+
() => h(C.wrapper({
|
|
76
|
+
c: r,
|
|
77
|
+
rounded: f,
|
|
78
|
+
fillMode: d,
|
|
79
|
+
size: i,
|
|
80
|
+
focused: v,
|
|
81
|
+
required: e.required,
|
|
82
|
+
disabled: e.disabled,
|
|
83
|
+
invalid: e.valid === !1
|
|
84
|
+
}), m),
|
|
85
|
+
[m, d, v, e.disabled, e.required, e.valid, f, i, r]
|
|
86
|
+
);
|
|
87
|
+
return /* @__PURE__ */ t.createElement(
|
|
76
88
|
"span",
|
|
77
89
|
{
|
|
78
|
-
style:
|
|
79
|
-
dir:
|
|
80
|
-
className: O
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
[`k-input-${m.sizeMap[s] || s}`]: s,
|
|
84
|
-
[`k-input-${c}`]: c,
|
|
85
|
-
[`k-rounded-${m.roundedMap[i] || i}`]: i
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
"k-focus": R,
|
|
89
|
-
"k-required": n.required,
|
|
90
|
-
"k-disabled": n.disabled,
|
|
91
|
-
"k-invalid": n.valid === !1
|
|
92
|
-
},
|
|
93
|
-
h
|
|
94
|
-
),
|
|
95
|
-
onFocus: N,
|
|
96
|
-
onBlur: T
|
|
90
|
+
style: _,
|
|
91
|
+
dir: R,
|
|
92
|
+
className: O,
|
|
93
|
+
onFocus: p,
|
|
94
|
+
onBlur: q
|
|
97
95
|
},
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
/* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ t.createElement(T, null),
|
|
97
|
+
/* @__PURE__ */ t.createElement(
|
|
100
98
|
"input",
|
|
101
99
|
{
|
|
102
100
|
ref: l,
|
|
103
|
-
className:
|
|
104
|
-
autoFocus:
|
|
105
|
-
...
|
|
106
|
-
onChange:
|
|
101
|
+
className: h(C.input({ c: r })),
|
|
102
|
+
autoFocus: E,
|
|
103
|
+
...N,
|
|
104
|
+
onChange: S
|
|
107
105
|
}
|
|
108
106
|
),
|
|
109
|
-
/* @__PURE__ */
|
|
107
|
+
/* @__PURE__ */ t.createElement(k, null)
|
|
110
108
|
);
|
|
111
109
|
}), u = {
|
|
112
|
-
prefix: (
|
|
113
|
-
suffix: (
|
|
110
|
+
prefix: (e) => null,
|
|
111
|
+
suffix: (e) => null,
|
|
114
112
|
size: "medium",
|
|
115
113
|
rounded: "medium",
|
|
116
114
|
fillMode: "solid",
|
|
117
115
|
autoFocus: !1
|
|
118
116
|
};
|
|
119
|
-
|
|
120
|
-
size:
|
|
121
|
-
rounded:
|
|
122
|
-
fillMode:
|
|
123
|
-
autoFocus:
|
|
117
|
+
B.propTypes = {
|
|
118
|
+
size: o.oneOf([null, "small", "medium", "large"]),
|
|
119
|
+
rounded: o.oneOf([null, "small", "medium", "large", "full"]),
|
|
120
|
+
fillMode: o.oneOf([null, "solid", "flat", "outline"]),
|
|
121
|
+
autoFocus: o.bool
|
|
124
122
|
};
|
|
125
|
-
|
|
123
|
+
B.displayName = "KendoReactTextBoxComponent";
|
|
126
124
|
export {
|
|
127
|
-
|
|
125
|
+
B as TextBox
|
|
128
126
|
};
|