@progress/kendo-react-inputs 8.3.0-develop.5 → 8.3.0-develop.7
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 +10 -2
- package/index.d.ts +10 -2
- 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/package-metadata.mjs +1 -1
- package/package.json +8 -8
- package/textbox/Textbox.js +1 -1
- package/textbox/Textbox.mjs +82 -84
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
|
};
|