@progress/kendo-react-inputs 9.1.1-develop.4 → 9.2.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/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/index.d.mts +21 -0
- package/index.d.ts +21 -0
- package/maskedtextbox/MaskedTextBox.js +1 -1
- package/maskedtextbox/MaskedTextBox.mjs +53 -51
- package/numerictextbox/NumericTextBox.js +1 -1
- package/numerictextbox/NumericTextBox.mjs +83 -80
- package/package-metadata.mjs +1 -1
- package/package.json +8 -8
- package/textarea/TextArea.js +1 -1
- package/textarea/TextArea.mjs +49 -48
- package/textbox/Textbox.js +1 -1
- package/textbox/Textbox.mjs +37 -35
package/textbox/Textbox.mjs
CHANGED
|
@@ -7,16 +7,16 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as t from "react";
|
|
10
|
-
import
|
|
11
|
-
import { validatePackage as
|
|
12
|
-
import { packageMetadata as
|
|
10
|
+
import a from "prop-types";
|
|
11
|
+
import { validatePackage as I, useUnstyled as j, useCustomComponent as x, useAsyncFocusBlur as w, classNames as h, uTextBox as C } from "@progress/kendo-react-common";
|
|
12
|
+
import { packageMetadata as H } from "../package-metadata.mjs";
|
|
13
13
|
const B = t.forwardRef((e, F) => {
|
|
14
|
-
|
|
15
|
-
const l = t.useRef(null),
|
|
14
|
+
I(H);
|
|
15
|
+
const l = t.useRef(null), s = t.useRef(null), r = t.useRef(), i = j(), o = i && i.uTextBox, b = t.useCallback(() => {
|
|
16
16
|
var n;
|
|
17
|
-
return
|
|
17
|
+
return r.current !== void 0 ? r.current : (n = l.current) == null ? void 0 : n.value;
|
|
18
18
|
}, []);
|
|
19
|
-
t.useImperativeHandle(
|
|
19
|
+
t.useImperativeHandle(s, () => ({
|
|
20
20
|
get element() {
|
|
21
21
|
return l.current;
|
|
22
22
|
},
|
|
@@ -24,48 +24,49 @@ const B = t.forwardRef((e, F) => {
|
|
|
24
24
|
return l.current && l.current.name;
|
|
25
25
|
},
|
|
26
26
|
get value() {
|
|
27
|
-
return
|
|
27
|
+
return b();
|
|
28
28
|
}
|
|
29
|
-
})), t.useImperativeHandle(F, () =>
|
|
29
|
+
})), t.useImperativeHandle(F, () => s.current);
|
|
30
30
|
const {
|
|
31
31
|
size: c = u.size,
|
|
32
32
|
fillMode: d = u.fillMode,
|
|
33
33
|
rounded: f = u.rounded,
|
|
34
|
-
autoFocus:
|
|
34
|
+
autoFocus: y = u.autoFocus,
|
|
35
|
+
inputAttributes: E,
|
|
35
36
|
className: m,
|
|
36
37
|
dir: R,
|
|
37
38
|
style: _,
|
|
38
|
-
prefix:
|
|
39
|
-
suffix:
|
|
39
|
+
prefix: M = u.prefix,
|
|
40
|
+
suffix: N = u.suffix,
|
|
40
41
|
valid: D,
|
|
41
42
|
// Destruct to avoid warning when used inside a form field
|
|
42
43
|
modified: G,
|
|
43
44
|
touched: K,
|
|
44
45
|
visited: U,
|
|
45
|
-
...
|
|
46
|
-
} = e, [
|
|
47
|
-
|
|
48
|
-
},
|
|
49
|
-
|
|
46
|
+
...T
|
|
47
|
+
} = e, [q] = x(M), [k] = x(N), [v, g] = t.useState(!1), z = (n) => {
|
|
48
|
+
g(!0);
|
|
49
|
+
}, O = (n) => {
|
|
50
|
+
g(!1);
|
|
50
51
|
}, P = t.useCallback(
|
|
51
52
|
(n) => {
|
|
52
|
-
|
|
53
|
+
r.current = n.target.value, e.onChange && e.onChange.call(void 0, {
|
|
53
54
|
syntheticEvent: n,
|
|
54
55
|
nativeEvent: n.nativeEvent,
|
|
55
56
|
value: n.target.value,
|
|
56
|
-
target:
|
|
57
|
-
}),
|
|
57
|
+
target: s.current
|
|
58
|
+
}), r.current = void 0;
|
|
58
59
|
},
|
|
59
60
|
[e.onChange]
|
|
60
|
-
), { onFocus: S, onBlur:
|
|
61
|
-
onFocus:
|
|
62
|
-
onBlur:
|
|
61
|
+
), { onFocus: S, onBlur: p } = w({
|
|
62
|
+
onFocus: z,
|
|
63
|
+
onBlur: O,
|
|
63
64
|
onSyncFocus: e.onFocus,
|
|
64
65
|
onSyncBlur: e.onBlur
|
|
65
|
-
}),
|
|
66
|
+
}), A = t.useMemo(
|
|
66
67
|
() => h(
|
|
67
68
|
C.wrapper({
|
|
68
|
-
c:
|
|
69
|
+
c: o,
|
|
69
70
|
rounded: f,
|
|
70
71
|
fillMode: d,
|
|
71
72
|
size: c,
|
|
@@ -76,19 +77,19 @@ const B = t.forwardRef((e, F) => {
|
|
|
76
77
|
}),
|
|
77
78
|
m
|
|
78
79
|
),
|
|
79
|
-
[m, d, v, e.disabled, e.required, e.valid, f, c,
|
|
80
|
+
[m, d, v, e.disabled, e.required, e.valid, f, c, o]
|
|
80
81
|
);
|
|
81
|
-
return /* @__PURE__ */ t.createElement("span", { style: _, dir: R, className:
|
|
82
|
+
return /* @__PURE__ */ t.createElement("span", { style: _, dir: R, className: A, onFocus: S, onBlur: p }, /* @__PURE__ */ t.createElement(q, null), /* @__PURE__ */ t.createElement(
|
|
82
83
|
"input",
|
|
83
84
|
{
|
|
84
85
|
ref: l,
|
|
85
|
-
className: h(C.inputInner({ c:
|
|
86
|
-
autoFocus:
|
|
87
|
-
...
|
|
86
|
+
className: h(C.inputInner({ c: o })),
|
|
87
|
+
autoFocus: y,
|
|
88
|
+
...Object.assign({}, T, E),
|
|
88
89
|
"aria-required": e.required,
|
|
89
90
|
onChange: P
|
|
90
91
|
}
|
|
91
|
-
), /* @__PURE__ */ t.createElement(
|
|
92
|
+
), /* @__PURE__ */ t.createElement(k, null));
|
|
92
93
|
}), u = {
|
|
93
94
|
prefix: (e) => null,
|
|
94
95
|
suffix: (e) => null,
|
|
@@ -98,10 +99,11 @@ const B = t.forwardRef((e, F) => {
|
|
|
98
99
|
autoFocus: !1
|
|
99
100
|
};
|
|
100
101
|
B.propTypes = {
|
|
101
|
-
size:
|
|
102
|
-
rounded:
|
|
103
|
-
fillMode:
|
|
104
|
-
autoFocus:
|
|
102
|
+
size: a.oneOf([null, "small", "medium", "large"]),
|
|
103
|
+
rounded: a.oneOf([null, "small", "medium", "large", "full"]),
|
|
104
|
+
fillMode: a.oneOf([null, "solid", "flat", "outline"]),
|
|
105
|
+
autoFocus: a.bool,
|
|
106
|
+
inputAttributes: a.object
|
|
105
107
|
};
|
|
106
108
|
B.displayName = "KendoReactTextBoxComponent";
|
|
107
109
|
export {
|