@progress/kendo-react-inputs 9.1.1-develop.4 → 9.2.0-develop.2
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 +87 -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
|
@@ -8,19 +8,19 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as n from "react";
|
|
10
10
|
import t from "prop-types";
|
|
11
|
-
import { useInternationalization as
|
|
12
|
-
import { createPropsContext as
|
|
13
|
-
import { caretAltUpIcon as
|
|
14
|
-
import { FloatingLabel as
|
|
15
|
-
import { packageMetadata as
|
|
11
|
+
import { useInternationalization as Xe, useLocalization as Ze } from "@progress/kendo-react-intl";
|
|
12
|
+
import { createPropsContext as et, validatePackage as tt, usePropsContext as nt, useId as rt, useCustomComponent as pe, dispatchEvent as Q, getActiveElement as be, useIsomorphicLayoutEffect as at, classNames as lt, kendoThemeMaps as ge, getTabIndex as st } from "@progress/kendo-react-common";
|
|
13
|
+
import { caretAltUpIcon as ut, caretAltDownIcon as ot } from "@progress/kendo-svg-icons";
|
|
14
|
+
import { FloatingLabel as it } from "@progress/kendo-react-labels";
|
|
15
|
+
import { packageMetadata as ct } from "../package-metadata.mjs";
|
|
16
16
|
import { numericIncreaseValue as M, messages as T, numericDecreaseValue as z } from "../messages/index.mjs";
|
|
17
|
-
import { getInitialState as ve, formatValue as q, getStateOrPropsValue as X, rangeValue as
|
|
17
|
+
import { getInitialState as ve, formatValue as q, getStateOrPropsValue as X, rangeValue as A, sanitizeNumber as ye, decreaseValue as Ve, increaseValue as ke } from "./utils/index.mjs";
|
|
18
18
|
import { Button as Ce } from "@progress/kendo-react-buttons";
|
|
19
|
-
const
|
|
19
|
+
const dt = "Please enter a valid value!", mt = et(), Ee = n.forwardRef(
|
|
20
20
|
(C, Se) => {
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
21
|
+
tt(ct);
|
|
22
|
+
const G = nt(
|
|
23
|
+
mt,
|
|
24
24
|
C
|
|
25
25
|
), {
|
|
26
26
|
className: xe,
|
|
@@ -35,7 +35,7 @@ const ct = "Please enter a valid value!", dt = Ze(), Ee = n.forwardRef(
|
|
|
35
35
|
min: c,
|
|
36
36
|
max: d,
|
|
37
37
|
dir: te,
|
|
38
|
-
name:
|
|
38
|
+
name: j,
|
|
39
39
|
label: I,
|
|
40
40
|
id: Pe,
|
|
41
41
|
ariaDescribedBy: Ne,
|
|
@@ -45,47 +45,52 @@ const ct = "Please enter a valid value!", dt = Ze(), Ee = n.forwardRef(
|
|
|
45
45
|
readOnly: g,
|
|
46
46
|
validationMessage: _,
|
|
47
47
|
children: Be,
|
|
48
|
+
// Removed to support direct use in Form Field component
|
|
49
|
+
touched: ft,
|
|
50
|
+
visited: pt,
|
|
51
|
+
modified: bt,
|
|
48
52
|
style: ne,
|
|
49
53
|
inputStyle: Me,
|
|
50
54
|
valid: H,
|
|
51
|
-
step: v =
|
|
52
|
-
spinners: Te =
|
|
53
|
-
disabled:
|
|
54
|
-
required: O =
|
|
55
|
-
validityStyles: re =
|
|
56
|
-
prefix: ze =
|
|
57
|
-
suffix: qe =
|
|
58
|
-
onChange: E =
|
|
59
|
-
onFocus: ae =
|
|
60
|
-
onBlur: le =
|
|
61
|
-
rangeOnEnter: se =
|
|
62
|
-
size: K =
|
|
63
|
-
rounded: w =
|
|
64
|
-
fillMode: L =
|
|
65
|
-
autoFocus:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
55
|
+
step: v = o.step,
|
|
56
|
+
spinners: Te = o.spinners,
|
|
57
|
+
disabled: u = o.disabled,
|
|
58
|
+
required: O = o.required,
|
|
59
|
+
validityStyles: re = o.validityStyles,
|
|
60
|
+
prefix: ze = o.prefix,
|
|
61
|
+
suffix: qe = o.suffix,
|
|
62
|
+
onChange: E = o.onChange,
|
|
63
|
+
onFocus: ae = o.onFocus,
|
|
64
|
+
onBlur: le = o.onBlur,
|
|
65
|
+
rangeOnEnter: se = o.rangeOnEnter,
|
|
66
|
+
size: K = o.size,
|
|
67
|
+
rounded: w = o.rounded,
|
|
68
|
+
fillMode: L = o.fillMode,
|
|
69
|
+
autoFocus: Ae = o.autoFocus,
|
|
70
|
+
inputAttributes: Ge,
|
|
71
|
+
...ue
|
|
72
|
+
} = G, je = rt(), oe = Pe || je, s = Xe(), P = Ze(), a = n.useRef(null), N = n.useRef(), [_e, S] = n.useState(!1), i = n.useRef(ve()), D = n.useRef(!1), U = n.useRef(), x = n.useRef(he), h = q(
|
|
73
|
+
i.current.focused && !u ? i.current.currentLooseValue : X(b, x.current),
|
|
69
74
|
l,
|
|
70
75
|
s
|
|
71
76
|
);
|
|
72
77
|
U.current = h;
|
|
73
|
-
const [
|
|
78
|
+
const [He] = pe(ze), [Ke] = pe(qe);
|
|
74
79
|
n.useEffect(() => {
|
|
75
80
|
a.current && a.current.setCustomValidity && a.current.setCustomValidity(
|
|
76
|
-
B().valid ? "" : _ ||
|
|
81
|
+
B().valid ? "" : _ || dt
|
|
77
82
|
);
|
|
78
83
|
});
|
|
79
84
|
const ie = n.useCallback(() => {
|
|
80
85
|
a.current && a.current.focus();
|
|
81
|
-
}, []), R = n.useCallback(() => N.current !== void 0 ? N.current : X(b, x.current), [b]), ce = n.useCallback(() =>
|
|
86
|
+
}, []), R = n.useCallback(() => N.current !== void 0 ? N.current : X(b, x.current), [b]), ce = n.useCallback(() => j, [j]), F = n.useCallback(() => O, [O]), B = n.useCallback(() => {
|
|
82
87
|
const r = _ !== void 0, e = R(), V = H !== void 0 ? H : !i.current.valueIsOutOfRange && (!F() || e != null);
|
|
83
88
|
return {
|
|
84
89
|
customError: r,
|
|
85
90
|
valid: V,
|
|
86
91
|
valueMissing: e == null
|
|
87
92
|
};
|
|
88
|
-
}, [_, H, R, F]), $ = n.useCallback(() => re, [re]), de = n.useCallback(() =>
|
|
93
|
+
}, [_, H, R, F]), $ = n.useCallback(() => re, [re]), de = n.useCallback(() => G, [G]), y = n.useCallback(() => {
|
|
89
94
|
const r = {
|
|
90
95
|
element: a.current,
|
|
91
96
|
focus: ie
|
|
@@ -106,22 +111,22 @@ const ct = "Please enter a valid value!", dt = Ze(), Ee = n.forwardRef(
|
|
|
106
111
|
focused: i.current.focused
|
|
107
112
|
}), [b]), p = n.useCallback(
|
|
108
113
|
(r, e) => {
|
|
109
|
-
if (
|
|
114
|
+
if (u)
|
|
110
115
|
return;
|
|
111
116
|
N.current = e.eventValue, x.current = e.eventValue;
|
|
112
|
-
const V = q(
|
|
117
|
+
const V = q(A(e.eventValue, c, d), l, s), m = A(s.parseNumber(V, l), c, d);
|
|
113
118
|
m !== e.eventValue && (e.valueIsOutOfRange = !0, e.eventValue = m, x.current = m), b !== e.eventValue && Q(E, r, y(), {
|
|
114
119
|
value: e.eventValue
|
|
115
120
|
}), N.current = void 0, i.current = e, S((J) => !J);
|
|
116
121
|
},
|
|
117
|
-
[b, E,
|
|
118
|
-
),
|
|
122
|
+
[b, E, u, S, y]
|
|
123
|
+
), we = n.useCallback(
|
|
119
124
|
(r) => {
|
|
120
125
|
const e = f();
|
|
121
126
|
D.current = !1, p(r, ye(e, l, s));
|
|
122
127
|
},
|
|
123
128
|
[l, E, s, p, f]
|
|
124
|
-
),
|
|
129
|
+
), Ue = n.useCallback(
|
|
125
130
|
(r) => {
|
|
126
131
|
let e = f();
|
|
127
132
|
const V = s.parseNumber(String(e.currentLooseValue), l);
|
|
@@ -140,7 +145,7 @@ const ct = "Please enter a valid value!", dt = Ze(), Ee = n.forwardRef(
|
|
|
140
145
|
case 13: {
|
|
141
146
|
if (se === !1)
|
|
142
147
|
return;
|
|
143
|
-
const m = q(
|
|
148
|
+
const m = q(A(V, c, d), l, s), k = A(s.parseNumber(m, l), c, d);
|
|
144
149
|
e.eventValue = k, e.currentLooseValue = q(k, l, s), e.selectionStart = e.selectionEnd = e.currentLooseValue.length;
|
|
145
150
|
break;
|
|
146
151
|
}
|
|
@@ -155,11 +160,11 @@ const ct = "Please enter a valid value!", dt = Ze(), Ee = n.forwardRef(
|
|
|
155
160
|
r.preventDefault(), p(r, e);
|
|
156
161
|
},
|
|
157
162
|
[l, c, d, v, E, se, p, f]
|
|
158
|
-
),
|
|
163
|
+
), $e = n.useCallback(() => {
|
|
159
164
|
D.current = !0;
|
|
160
165
|
}, []), W = n.useCallback(
|
|
161
166
|
(r) => {
|
|
162
|
-
if (g ||
|
|
167
|
+
if (g || u)
|
|
163
168
|
return;
|
|
164
169
|
const e = f();
|
|
165
170
|
ke(
|
|
@@ -172,10 +177,10 @@ const ct = "Please enter a valid value!", dt = Ze(), Ee = n.forwardRef(
|
|
|
172
177
|
s
|
|
173
178
|
), p(r, e);
|
|
174
179
|
},
|
|
175
|
-
[l, c, d, v, E, g,
|
|
180
|
+
[l, c, d, v, E, g, u, p, f]
|
|
176
181
|
), Y = n.useCallback(
|
|
177
182
|
(r) => {
|
|
178
|
-
if (g ||
|
|
183
|
+
if (g || u)
|
|
179
184
|
return;
|
|
180
185
|
const e = f();
|
|
181
186
|
Ve(
|
|
@@ -188,38 +193,38 @@ const ct = "Please enter a valid value!", dt = Ze(), Ee = n.forwardRef(
|
|
|
188
193
|
s
|
|
189
194
|
), p(r, e);
|
|
190
195
|
},
|
|
191
|
-
[l, c, d, v, E, g,
|
|
192
|
-
),
|
|
196
|
+
[l, c, d, v, E, g, u, p, f]
|
|
197
|
+
), We = n.useCallback(
|
|
193
198
|
(r) => {
|
|
194
199
|
const e = be(document);
|
|
195
|
-
!document || e !== a.current || !a.current || g ||
|
|
200
|
+
!document || e !== a.current || !a.current || g || u || (r.nativeEvent.deltaY < 0 && W(r), r.nativeEvent.deltaY > 0 && Y(r));
|
|
196
201
|
},
|
|
197
|
-
[W, Y,
|
|
198
|
-
),
|
|
202
|
+
[W, Y, u, g]
|
|
203
|
+
), Ye = n.useCallback(
|
|
199
204
|
(r) => {
|
|
200
205
|
i.current.currentLooseValue = U.current, i.current.focused = !0, Q(ae, r, y(), {}), S((e) => !e);
|
|
201
206
|
},
|
|
202
207
|
[ae, S, y]
|
|
203
|
-
),
|
|
208
|
+
), Je = n.useCallback(
|
|
204
209
|
(r) => {
|
|
205
210
|
i.current = ve(), Q(le, r, y(), {}), S((e) => !e);
|
|
206
211
|
},
|
|
207
212
|
[le, S, y]
|
|
208
|
-
),
|
|
213
|
+
), Qe = n.useCallback((r) => {
|
|
209
214
|
if (document && a.current) {
|
|
210
215
|
const e = be(document);
|
|
211
216
|
r.preventDefault(), e !== a.current && a.current.focus();
|
|
212
217
|
}
|
|
213
218
|
}, []);
|
|
214
|
-
|
|
219
|
+
at(() => {
|
|
215
220
|
a.current && a.current.type !== "number" && i.current.selectionStart !== void 0 && i.current.selectionEnd !== void 0 && (a.current.selectionStart = i.current.selectionStart, a.current.selectionEnd = i.current.selectionEnd, i.current.selectionStart = void 0, i.current.selectionEnd = void 0);
|
|
216
|
-
}, [
|
|
221
|
+
}, [_e]);
|
|
217
222
|
const me = !$() || B().valid, fe = /* @__PURE__ */ n.createElement(
|
|
218
223
|
"span",
|
|
219
224
|
{
|
|
220
225
|
dir: te,
|
|
221
226
|
style: I ? ne : { width: Z, ...ne },
|
|
222
|
-
className:
|
|
227
|
+
className: lt(
|
|
223
228
|
"k-input",
|
|
224
229
|
"k-numerictextbox",
|
|
225
230
|
{
|
|
@@ -228,24 +233,24 @@ const ct = "Please enter a valid value!", dt = Ze(), Ee = n.forwardRef(
|
|
|
228
233
|
[`k-rounded-${ge.roundedMap[w] || w}`]: w,
|
|
229
234
|
"k-invalid": !me,
|
|
230
235
|
"k-required": O,
|
|
231
|
-
"k-disabled":
|
|
236
|
+
"k-disabled": u
|
|
232
237
|
},
|
|
233
238
|
xe
|
|
234
239
|
),
|
|
235
|
-
"aria-disabled":
|
|
236
|
-
...I ? {} :
|
|
240
|
+
"aria-disabled": u ? "true" : void 0,
|
|
241
|
+
...I ? {} : ue
|
|
237
242
|
},
|
|
238
|
-
/* @__PURE__ */ n.createElement(
|
|
243
|
+
/* @__PURE__ */ n.createElement(He, null),
|
|
239
244
|
/* @__PURE__ */ n.createElement(
|
|
240
245
|
"input",
|
|
241
246
|
{
|
|
242
247
|
role: "spinbutton",
|
|
243
248
|
value: h === null ? "" : h,
|
|
244
|
-
tabIndex:
|
|
249
|
+
tabIndex: st(Ie, u),
|
|
245
250
|
accessKey: Oe,
|
|
246
|
-
disabled:
|
|
251
|
+
disabled: u,
|
|
247
252
|
title: Le,
|
|
248
|
-
"aria-disabled":
|
|
253
|
+
"aria-disabled": u ? "true" : void 0,
|
|
249
254
|
"aria-valuemin": c,
|
|
250
255
|
"aria-valuemax": d,
|
|
251
256
|
"aria-label": Re,
|
|
@@ -256,31 +261,32 @@ const ct = "Please enter a valid value!", dt = Ze(), Ee = n.forwardRef(
|
|
|
256
261
|
spellCheck: !1,
|
|
257
262
|
autoComplete: "off",
|
|
258
263
|
autoCorrect: "off",
|
|
259
|
-
autoFocus:
|
|
264
|
+
autoFocus: Ae,
|
|
260
265
|
type: Fe || "tel",
|
|
261
266
|
className: "k-input-inner",
|
|
262
|
-
id:
|
|
263
|
-
name:
|
|
267
|
+
id: oe,
|
|
268
|
+
name: j,
|
|
264
269
|
readOnly: g,
|
|
265
270
|
style: Me,
|
|
266
|
-
onChange:
|
|
267
|
-
onFocus:
|
|
268
|
-
onBlur:
|
|
269
|
-
onKeyDown:
|
|
270
|
-
onPaste:
|
|
271
|
-
onWheel:
|
|
272
|
-
ref: a
|
|
271
|
+
onChange: we,
|
|
272
|
+
onFocus: Ye,
|
|
273
|
+
onBlur: Je,
|
|
274
|
+
onKeyDown: Ue,
|
|
275
|
+
onPaste: $e,
|
|
276
|
+
onWheel: We,
|
|
277
|
+
ref: a,
|
|
278
|
+
...Ge
|
|
273
279
|
}
|
|
274
280
|
),
|
|
275
|
-
/* @__PURE__ */ n.createElement(
|
|
281
|
+
/* @__PURE__ */ n.createElement(Ke, null),
|
|
276
282
|
Be,
|
|
277
|
-
Te && /* @__PURE__ */ n.createElement("span", { className: "k-input-spinner k-spin-button", onMouseDown:
|
|
283
|
+
Te && /* @__PURE__ */ n.createElement("span", { className: "k-input-spinner k-spin-button", onMouseDown: Qe }, /* @__PURE__ */ n.createElement(
|
|
278
284
|
Ce,
|
|
279
285
|
{
|
|
280
286
|
tabIndex: -1,
|
|
281
287
|
type: "button",
|
|
282
288
|
icon: "caret-alt-up",
|
|
283
|
-
svgIcon:
|
|
289
|
+
svgIcon: ut,
|
|
284
290
|
rounded: null,
|
|
285
291
|
fillMode: L,
|
|
286
292
|
className: "k-spinner-increase",
|
|
@@ -317,18 +323,18 @@ const ct = "Please enter a valid value!", dt = Ze(), Ee = n.forwardRef(
|
|
|
317
323
|
))
|
|
318
324
|
);
|
|
319
325
|
return I ? /* @__PURE__ */ n.createElement(
|
|
320
|
-
|
|
326
|
+
it,
|
|
321
327
|
{
|
|
322
328
|
label: I,
|
|
323
|
-
editorId:
|
|
329
|
+
editorId: oe,
|
|
324
330
|
editorValue: h === null ? "" : h,
|
|
325
331
|
editorValid: me,
|
|
326
|
-
editorDisabled:
|
|
332
|
+
editorDisabled: u,
|
|
327
333
|
editorPlaceholder: ee,
|
|
328
334
|
children: fe,
|
|
329
335
|
style: { width: Z },
|
|
330
336
|
dir: te,
|
|
331
|
-
...
|
|
337
|
+
...ue
|
|
332
338
|
}
|
|
333
339
|
) : fe;
|
|
334
340
|
}
|
|
@@ -374,9 +380,10 @@ Ee.propTypes = {
|
|
|
374
380
|
onBlur: t.func,
|
|
375
381
|
size: t.oneOf([null, "small", "medium", "large"]),
|
|
376
382
|
rounded: t.oneOf([null, "small", "medium", "large", "full"]),
|
|
377
|
-
fillMode: t.oneOf([null, "solid", "flat", "outline"])
|
|
383
|
+
fillMode: t.oneOf([null, "solid", "flat", "outline"]),
|
|
384
|
+
inputAttributes: t.object
|
|
378
385
|
};
|
|
379
|
-
const
|
|
386
|
+
const o = {
|
|
380
387
|
prefix: (C) => null,
|
|
381
388
|
suffix: (C) => null,
|
|
382
389
|
step: 1,
|
|
@@ -399,5 +406,5 @@ const u = {
|
|
|
399
406
|
Ee.displayName = "KendoNumericTextBox";
|
|
400
407
|
export {
|
|
401
408
|
Ee as NumericTextBox,
|
|
402
|
-
|
|
409
|
+
mt as NumericTextBoxPropsContext
|
|
403
410
|
};
|
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: 1734711398,
|
|
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": "9.
|
|
3
|
+
"version": "9.2.0-develop.2",
|
|
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.21.2",
|
|
26
26
|
"@progress/kendo-inputs-common": "^3.1.0",
|
|
27
27
|
"@progress/kendo-licensing": "^1.3.4",
|
|
28
|
-
"@progress/kendo-react-animation": "9.
|
|
29
|
-
"@progress/kendo-react-buttons": "9.
|
|
30
|
-
"@progress/kendo-react-common": "9.
|
|
31
|
-
"@progress/kendo-react-dialogs": "9.
|
|
32
|
-
"@progress/kendo-react-intl": "9.
|
|
33
|
-
"@progress/kendo-react-labels": "9.
|
|
34
|
-
"@progress/kendo-react-popup": "9.
|
|
28
|
+
"@progress/kendo-react-animation": "9.2.0-develop.2",
|
|
29
|
+
"@progress/kendo-react-buttons": "9.2.0-develop.2",
|
|
30
|
+
"@progress/kendo-react-common": "9.2.0-develop.2",
|
|
31
|
+
"@progress/kendo-react-dialogs": "9.2.0-develop.2",
|
|
32
|
+
"@progress/kendo-react-intl": "9.2.0-develop.2",
|
|
33
|
+
"@progress/kendo-react-labels": "9.2.0-develop.2",
|
|
34
|
+
"@progress/kendo-react-popup": "9.2.0-develop.2",
|
|
35
35
|
"@progress/kendo-svg-icons": "^4.0.0",
|
|
36
36
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
37
37
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
|
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
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const le=require("react"),e=require("prop-types"),a=require("@progress/kendo-react-common");function ie(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=ie(le),B=a.createPropsContext(),O=t.forwardRef((s,u)=>{const o=a.usePropsContext(B,s),{size:l=p.size,rounded:b=p.rounded,fillMode:z=p.fillMode,autoFocus:F=p.autoFocus,prefix:N=null,suffix:j=null,ariaDescribedBy:w,ariaLabelledBy:q,autoSize:T,className:R,defaultValue:D,disabled:r,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:ue,touched:ce,modified:de,resizable:h,inputAttributes:Q,...U}=o,n=t.useRef(null),E=t.useCallback(()=>{n.current&&n.current.focus()},[]),[A,I]=t.useState(D),[W,X]=a.useCustomComponent(N),[Y,Z]=a.useCustomComponent(j),d=g!==void 0,f=d?g:A,m=t.useCallback(()=>({element:n,focus:E,get value(){return f},get name(){return n.current&&n.current.name}}),[E,f]);t.useImperativeHandle(u,m);const[ee,V]=t.useState("auto"),te=a.useId(),ae=a.useDir(n,o.dir),C=P!==void 0?P:c?!!f:!0;t.useEffect(()=>{n.current&&n.current.setCustomValidity&&n.current.setCustomValidity(C?"":M||"")},[C,M]),a.useIsomorphicLayoutEffect(()=>{n.current&&V(`${n.current.scrollHeight}px`)},[f]);const ne=t.useCallback(i=>{const k=i.target.value;V("auto"),!d&&!r&&I(k),x&&!r&&a.dispatchEvent(x,i,{...m(),value:k},{value:k})},[I,x,r,d]),re=t.useCallback(i=>{v&&!r&&a.dispatchEvent(v,i,m(),void 0)},[v,r]),oe=t.useCallback(i=>{y&&!r&&a.dispatchEvent(y,i,m(),void 0)},[y,r]),se={id:L||te,role:"textbox",name:_,className:a.classNames("k-input-inner","!k-overflow-auto",{"k-resize":!T&&h!=="none"}),ref:n,disabled:r,rows:$,placeholder:K,readOnly:H,required:c,tabIndex:a.getTabIndex(J,r),autoFocus:F,style:T?{resize:"none",overflow:"hidden",height:ee}:h?{resize:h}:{},"aria-labelledby":q,"aria-describedby":w,"aria-multiline":!0,"aria-disabled":r||void 0,"aria-required":c,value:d?g:A,...Object.assign({},U,Q),onChange:ne,onFocus:re,onBlur:oe};return t.createElement("span",{className:a.classNames("k-input","k-textarea",{[`k-input-${a.kendoThemeMaps.sizeMap[l]||l}`]:l,[`k-input-${z}`]:z,[`k-rounded-${a.kendoThemeMaps.roundedMap[b]||b}`]:b,"k-invalid":!(C||S!==void 0||S===!0),"k-required":c,"k-disabled":r},R),style:G,dir:ae},o.prefix&&t.createElement(W,{...X}),t.createElement("textarea",{...se}),o.suffix&&t.createElement(Y,{...Z}))});O.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};O.displayName="KendoTextArea";exports.TextArea=O;exports.TextAreaPropsContext=B;
|
package/textarea/TextArea.mjs
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as t from "react";
|
|
10
10
|
import e from "prop-types";
|
|
11
|
-
import { createPropsContext as
|
|
12
|
-
const
|
|
13
|
-
const
|
|
11
|
+
import { createPropsContext as ue, usePropsContext as de, useCustomComponent as E, useId as ce, useDir as fe, useIsomorphicLayoutEffect as me, dispatchEvent as y, classNames as F, getTabIndex as pe, kendoThemeMaps as M } from "@progress/kendo-react-common";
|
|
12
|
+
const be = ue(), A = t.forwardRef((S, w) => {
|
|
13
|
+
const s = de(be, S), {
|
|
14
14
|
size: c = d.size,
|
|
15
15
|
rounded: f = d.rounded,
|
|
16
16
|
fillMode: k = d.fillMode,
|
|
@@ -24,7 +24,7 @@ const pe = ie(), S = t.forwardRef((w, A) => {
|
|
|
24
24
|
defaultValue: L,
|
|
25
25
|
disabled: r,
|
|
26
26
|
readOnly: j,
|
|
27
|
-
required:
|
|
27
|
+
required: n,
|
|
28
28
|
rows: K,
|
|
29
29
|
id: G,
|
|
30
30
|
name: J,
|
|
@@ -34,39 +34,40 @@ const pe = ie(), S = t.forwardRef((w, A) => {
|
|
|
34
34
|
value: m,
|
|
35
35
|
valid: z,
|
|
36
36
|
validationMessage: I,
|
|
37
|
-
validityStyles:
|
|
37
|
+
validityStyles: O,
|
|
38
38
|
onChange: p,
|
|
39
39
|
onFocus: b,
|
|
40
|
-
onBlur:
|
|
40
|
+
onBlur: g,
|
|
41
41
|
// Removed to support direct use in Form Field component
|
|
42
|
-
visited:
|
|
42
|
+
visited: ge,
|
|
43
43
|
touched: xe,
|
|
44
|
-
modified:
|
|
45
|
-
resizable:
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
modified: ve,
|
|
45
|
+
resizable: x,
|
|
46
|
+
inputAttributes: X,
|
|
47
|
+
...Y
|
|
48
|
+
} = s, a = t.useRef(null), P = t.useCallback(() => {
|
|
48
49
|
a.current && a.current.focus();
|
|
49
|
-
}, []), [
|
|
50
|
+
}, []), [T, V] = t.useState(L), [Z, _] = E(H), [ee, te] = E(R), l = m !== void 0, i = l ? m : T, u = t.useCallback(() => ({
|
|
50
51
|
element: a,
|
|
51
|
-
focus:
|
|
52
|
+
focus: P,
|
|
52
53
|
get value() {
|
|
53
54
|
return i;
|
|
54
55
|
},
|
|
55
56
|
get name() {
|
|
56
57
|
return a.current && a.current.name;
|
|
57
58
|
}
|
|
58
|
-
}), [
|
|
59
|
-
t.useImperativeHandle(
|
|
60
|
-
const [
|
|
59
|
+
}), [P, i]);
|
|
60
|
+
t.useImperativeHandle(w, u);
|
|
61
|
+
const [ae, B] = t.useState("auto"), re = ce(), oe = fe(a, s.dir), v = z !== void 0 ? z : n ? !!i : !0;
|
|
61
62
|
t.useEffect(() => {
|
|
62
63
|
a.current && a.current.setCustomValidity && a.current.setCustomValidity(v ? "" : I || "");
|
|
63
|
-
}, [v, I]),
|
|
64
|
-
a.current &&
|
|
64
|
+
}, [v, I]), me(() => {
|
|
65
|
+
a.current && B(`${a.current.scrollHeight}px`);
|
|
65
66
|
}, [i]);
|
|
66
|
-
const
|
|
67
|
+
const se = t.useCallback(
|
|
67
68
|
(o) => {
|
|
68
69
|
const h = o.target.value;
|
|
69
|
-
|
|
70
|
+
B("auto"), !l && !r && V(h), p && !r && y(
|
|
70
71
|
p,
|
|
71
72
|
o,
|
|
72
73
|
{
|
|
@@ -76,67 +77,67 @@ const pe = ie(), S = t.forwardRef((w, A) => {
|
|
|
76
77
|
{ value: h }
|
|
77
78
|
);
|
|
78
79
|
},
|
|
79
|
-
[
|
|
80
|
+
[V, p, r, l]
|
|
80
81
|
), ne = t.useCallback(
|
|
81
82
|
(o) => {
|
|
82
83
|
b && !r && y(b, o, u(), void 0);
|
|
83
84
|
},
|
|
84
85
|
[b, r]
|
|
85
|
-
),
|
|
86
|
+
), le = t.useCallback(
|
|
86
87
|
(o) => {
|
|
87
|
-
|
|
88
|
+
g && !r && y(g, o, u(), void 0);
|
|
88
89
|
},
|
|
89
|
-
[
|
|
90
|
-
),
|
|
91
|
-
id: G ||
|
|
90
|
+
[g, r]
|
|
91
|
+
), ie = {
|
|
92
|
+
id: G || re,
|
|
92
93
|
role: "textbox",
|
|
93
94
|
name: J,
|
|
94
|
-
className:
|
|
95
|
+
className: F("k-input-inner", "!k-overflow-auto", { "k-resize": !C && x !== "none" }),
|
|
95
96
|
ref: a,
|
|
96
97
|
disabled: r,
|
|
97
98
|
rows: K,
|
|
98
99
|
placeholder: Q,
|
|
99
100
|
readOnly: j,
|
|
100
|
-
required:
|
|
101
|
-
tabIndex:
|
|
101
|
+
required: n,
|
|
102
|
+
tabIndex: pe(W, r),
|
|
102
103
|
autoFocus: N,
|
|
103
|
-
style: C ? { resize: "none", overflow: "hidden", height:
|
|
104
|
+
style: C ? { resize: "none", overflow: "hidden", height: ae } : x ? { resize: x } : {},
|
|
104
105
|
"aria-labelledby": q,
|
|
105
106
|
"aria-describedby": $,
|
|
106
107
|
"aria-multiline": !0,
|
|
107
108
|
"aria-disabled": r || void 0,
|
|
108
|
-
"aria-required":
|
|
109
|
-
value: l ? m :
|
|
110
|
-
...X,
|
|
111
|
-
onChange:
|
|
109
|
+
"aria-required": n,
|
|
110
|
+
value: l ? m : T,
|
|
111
|
+
...Object.assign({}, Y, X),
|
|
112
|
+
onChange: se,
|
|
112
113
|
onFocus: ne,
|
|
113
|
-
onBlur:
|
|
114
|
+
onBlur: le
|
|
114
115
|
};
|
|
115
116
|
return /* @__PURE__ */ t.createElement(
|
|
116
117
|
"span",
|
|
117
118
|
{
|
|
118
|
-
className:
|
|
119
|
+
className: F(
|
|
119
120
|
"k-input",
|
|
120
121
|
"k-textarea",
|
|
121
122
|
{
|
|
122
|
-
[`k-input-${
|
|
123
|
+
[`k-input-${M.sizeMap[c] || c}`]: c,
|
|
123
124
|
[`k-input-${k}`]: k,
|
|
124
|
-
[`k-rounded-${
|
|
125
|
-
"k-invalid": !(v ||
|
|
126
|
-
"k-required":
|
|
125
|
+
[`k-rounded-${M.roundedMap[f] || f}`]: f,
|
|
126
|
+
"k-invalid": !(v || O !== void 0 || O === !0),
|
|
127
|
+
"k-required": n,
|
|
127
128
|
"k-disabled": r
|
|
128
129
|
},
|
|
129
130
|
D
|
|
130
131
|
),
|
|
131
132
|
style: U,
|
|
132
|
-
dir:
|
|
133
|
+
dir: oe
|
|
133
134
|
},
|
|
134
|
-
|
|
135
|
-
/* @__PURE__ */ t.createElement("textarea", { ...
|
|
136
|
-
|
|
135
|
+
s.prefix && /* @__PURE__ */ t.createElement(Z, { ..._ }),
|
|
136
|
+
/* @__PURE__ */ t.createElement("textarea", { ...ie }),
|
|
137
|
+
s.suffix && /* @__PURE__ */ t.createElement(ee, { ...te })
|
|
137
138
|
);
|
|
138
139
|
});
|
|
139
|
-
|
|
140
|
+
A.propTypes = {
|
|
140
141
|
ariaDescribedBy: e.string,
|
|
141
142
|
ariaLabelledBy: e.string,
|
|
142
143
|
autoSize: e.bool,
|
|
@@ -167,8 +168,8 @@ const d = {
|
|
|
167
168
|
fillMode: "solid",
|
|
168
169
|
autoFocus: !1
|
|
169
170
|
};
|
|
170
|
-
|
|
171
|
+
A.displayName = "KendoTextArea";
|
|
171
172
|
export {
|
|
172
|
-
|
|
173
|
-
|
|
173
|
+
A as TextArea,
|
|
174
|
+
be as TextAreaPropsContext
|
|
174
175
|
};
|
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"),s=require("prop-types"),a=require("@progress/kendo-react-common"),z=require("../package-metadata.js");function w(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=w(P),d=t.forwardRef((e,r)=>{a.validatePackage(z.packageMetadata);const n=t.useRef(null),l=t.useRef(null),c=t.useRef(),f=a.useUnstyled(),i=f&&f.uTextBox,y=t.useCallback(()=>{var u;return c.current!==void 0?c.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 y()}})),t.useImperativeHandle(r,()=>l.current);const{size:m=o.size,fillMode:g=o.fillMode,rounded:v=o.rounded,autoFocus:h=o.autoFocus,inputAttributes:B,className:x,dir:F,style:O,prefix:T=o.prefix,suffix:_=o.suffix,valid:A,modified:D,touched:I,visited:H,...q}=e,[M]=a.useCustomComponent(T),[R]=a.useCustomComponent(_),[b,C]=t.useState(!1),N=u=>{C(!0)},S=u=>{C(!1)},j=t.useCallback(u=>{c.current=u.target.value,e.onChange&&e.onChange.call(void 0,{syntheticEvent:u,nativeEvent:u.nativeEvent,value:u.target.value,target:l.current}),c.current=void 0},[e.onChange]),{onFocus:k,onBlur:p}=a.useAsyncFocusBlur({onFocus:N,onBlur:S,onSyncFocus:e.onFocus,onSyncBlur:e.onBlur}),E=t.useMemo(()=>a.classNames(a.uTextBox.wrapper({c:i,rounded:v,fillMode:g,size:m,focused:b,required:e.required,disabled:e.disabled,invalid:e.valid===!1}),x),[x,g,b,e.disabled,e.required,e.valid,v,m,i]);return t.createElement("span",{style:O,dir:F,className:E,onFocus:k,onBlur:p},t.createElement(M,null),t.createElement("input",{ref:n,className:a.classNames(a.uTextBox.inputInner({c:i})),autoFocus:h,...Object.assign({},q,B),"aria-required":e.required,onChange:j}),t.createElement(R,null))}),o={prefix:e=>null,suffix:e=>null,size:"medium",rounded:"medium",fillMode:"solid",autoFocus:!1};d.propTypes={size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),fillMode:s.oneOf([null,"solid","flat","outline"]),autoFocus:s.bool,inputAttributes:s.object};d.displayName="KendoReactTextBoxComponent";exports.TextBox=d;
|