@progress/kendo-react-inputs 8.3.0-develop.9 → 8.3.0
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 +6 -3
- package/index.d.ts +6 -3
- package/input/Input.js +1 -1
- package/input/Input.mjs +14 -13
- package/input/InputClearValue.js +1 -1
- package/input/InputClearValue.mjs +14 -10
- 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
|
@@ -12,13 +12,13 @@ import { useInternationalization as Qe, useLocalization as Xe } from "@progress/
|
|
|
12
12
|
import { createPropsContext as Ze, validatePackage as et, usePropsContext as tt, useId as nt, useCustomComponent as pe, dispatchEvent as Q, getActiveElement as be, useIsomorphicLayoutEffect as rt, classNames as at, kendoThemeMaps as ge, getTabIndex as lt } from "@progress/kendo-react-common";
|
|
13
13
|
import { caretAltUpIcon as st, caretAltDownIcon as ot } from "@progress/kendo-svg-icons";
|
|
14
14
|
import { FloatingLabel as ut } from "@progress/kendo-react-labels";
|
|
15
|
-
import { packageMetadata as
|
|
16
|
-
import { numericIncreaseValue as
|
|
17
|
-
import { getInitialState as ve, formatValue as
|
|
15
|
+
import { packageMetadata as it } from "../package-metadata.mjs";
|
|
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 G, 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
|
|
20
|
-
et(
|
|
21
|
-
const
|
|
19
|
+
const ct = "Please enter a valid value!", dt = Ze(), Ee = n.forwardRef((C, Se) => {
|
|
20
|
+
et(it);
|
|
21
|
+
const j = tt(dt, C), {
|
|
22
22
|
className: xe,
|
|
23
23
|
value: b,
|
|
24
24
|
defaultValue: he,
|
|
@@ -28,10 +28,10 @@ const it = "Please enter a valid value!", dt = Ze(), Ee = n.forwardRef((C, Se) =
|
|
|
28
28
|
accessKey: Oe,
|
|
29
29
|
title: Le,
|
|
30
30
|
placeholder: ee,
|
|
31
|
-
min:
|
|
31
|
+
min: c,
|
|
32
32
|
max: d,
|
|
33
33
|
dir: te,
|
|
34
|
-
name:
|
|
34
|
+
name: A,
|
|
35
35
|
label: I,
|
|
36
36
|
id: Pe,
|
|
37
37
|
ariaDescribedBy: Ne,
|
|
@@ -39,80 +39,80 @@ const it = "Please enter a valid value!", dt = Ze(), Ee = n.forwardRef((C, Se) =
|
|
|
39
39
|
ariaLabel: Re,
|
|
40
40
|
inputType: Fe,
|
|
41
41
|
readOnly: g,
|
|
42
|
-
validationMessage:
|
|
42
|
+
validationMessage: _,
|
|
43
43
|
children: Be,
|
|
44
44
|
style: ne,
|
|
45
45
|
inputStyle: Me,
|
|
46
|
-
valid:
|
|
46
|
+
valid: H,
|
|
47
47
|
step: v = u.step,
|
|
48
48
|
spinners: Te = u.spinners,
|
|
49
49
|
disabled: o = u.disabled,
|
|
50
|
-
required:
|
|
50
|
+
required: O = u.required,
|
|
51
51
|
validityStyles: re = u.validityStyles,
|
|
52
52
|
prefix: ze = u.prefix,
|
|
53
|
-
suffix:
|
|
53
|
+
suffix: qe = u.suffix,
|
|
54
54
|
onChange: E = u.onChange,
|
|
55
55
|
onFocus: ae = u.onFocus,
|
|
56
56
|
onBlur: le = u.onBlur,
|
|
57
57
|
rangeOnEnter: se = u.rangeOnEnter,
|
|
58
58
|
size: K = u.size,
|
|
59
59
|
rounded: w = u.rounded,
|
|
60
|
-
fillMode:
|
|
61
|
-
autoFocus:
|
|
60
|
+
fillMode: L = u.fillMode,
|
|
61
|
+
autoFocus: Ge = u.autoFocus,
|
|
62
62
|
...oe
|
|
63
|
-
} =
|
|
64
|
-
|
|
63
|
+
} = j, je = nt(), ue = Pe || je, s = Qe(), P = Xe(), a = n.useRef(null), N = n.useRef(), [Ae, S] = n.useState(!1), i = n.useRef(ve()), D = n.useRef(!1), U = n.useRef(), x = n.useRef(he), h = q(
|
|
64
|
+
i.current.focused && !o ? i.current.currentLooseValue : X(b, x.current),
|
|
65
65
|
l,
|
|
66
66
|
s
|
|
67
67
|
);
|
|
68
68
|
U.current = h;
|
|
69
|
-
const [_e] = pe(ze), [He] = pe(
|
|
69
|
+
const [_e] = pe(ze), [He] = pe(qe);
|
|
70
70
|
n.useEffect(
|
|
71
71
|
() => {
|
|
72
72
|
a.current && a.current.setCustomValidity && a.current.setCustomValidity(
|
|
73
|
-
|
|
73
|
+
B().valid ? "" : _ || ct
|
|
74
74
|
);
|
|
75
75
|
}
|
|
76
76
|
);
|
|
77
|
-
const
|
|
77
|
+
const ie = n.useCallback(
|
|
78
78
|
() => {
|
|
79
79
|
a.current && a.current.focus();
|
|
80
80
|
},
|
|
81
81
|
[]
|
|
82
|
-
), D = n.useCallback(
|
|
83
|
-
() => P.current !== void 0 ? P.current : X(b, x.current),
|
|
84
|
-
[b]
|
|
85
|
-
), ie = n.useCallback(
|
|
86
|
-
() => j,
|
|
87
|
-
[j]
|
|
88
82
|
), R = n.useCallback(
|
|
89
|
-
() =>
|
|
90
|
-
[
|
|
83
|
+
() => N.current !== void 0 ? N.current : X(b, x.current),
|
|
84
|
+
[b]
|
|
85
|
+
), ce = n.useCallback(
|
|
86
|
+
() => A,
|
|
87
|
+
[A]
|
|
91
88
|
), F = n.useCallback(
|
|
89
|
+
() => O,
|
|
90
|
+
[O]
|
|
91
|
+
), B = n.useCallback(
|
|
92
92
|
() => {
|
|
93
|
-
const r =
|
|
93
|
+
const r = _ !== void 0, e = R(), V = H !== void 0 ? H : !i.current.valueIsOutOfRange && (!F() || e != null);
|
|
94
94
|
return {
|
|
95
95
|
customError: r,
|
|
96
96
|
valid: V,
|
|
97
97
|
valueMissing: e == null
|
|
98
98
|
};
|
|
99
99
|
},
|
|
100
|
-
[
|
|
100
|
+
[_, H, R, F]
|
|
101
101
|
), $ = n.useCallback(
|
|
102
102
|
() => re,
|
|
103
103
|
[re]
|
|
104
104
|
), de = n.useCallback(
|
|
105
|
-
() =>
|
|
106
|
-
[
|
|
105
|
+
() => j,
|
|
106
|
+
[j]
|
|
107
107
|
), y = n.useCallback(
|
|
108
108
|
() => {
|
|
109
109
|
const r = {
|
|
110
110
|
element: a.current,
|
|
111
|
-
focus:
|
|
111
|
+
focus: ie
|
|
112
112
|
};
|
|
113
|
-
return Object.defineProperty(r, "name", { get:
|
|
113
|
+
return Object.defineProperty(r, "name", { get: ce }), Object.defineProperty(r, "value", { get: R }), Object.defineProperty(r, "validity", { get: B }), Object.defineProperty(r, "validityStyles", { get: $ }), Object.defineProperty(r, "required", { get: F }), Object.defineProperty(r, "props", { get: de }), r;
|
|
114
114
|
},
|
|
115
|
-
[
|
|
115
|
+
[ce, R, B, $, F, ie, de]
|
|
116
116
|
);
|
|
117
117
|
n.useImperativeHandle(Se, y);
|
|
118
118
|
const f = n.useCallback(
|
|
@@ -125,28 +125,28 @@ const it = "Please enter a valid value!", dt = Ze(), Ee = n.forwardRef((C, Se) =
|
|
|
125
125
|
decimalSelect: !1,
|
|
126
126
|
valueIsCorrected: !1,
|
|
127
127
|
valueIsOutOfRange: !1,
|
|
128
|
-
isPaste:
|
|
129
|
-
focused:
|
|
128
|
+
isPaste: D.current,
|
|
129
|
+
focused: i.current.focused
|
|
130
130
|
}),
|
|
131
131
|
[b]
|
|
132
132
|
), p = n.useCallback(
|
|
133
133
|
(r, e) => {
|
|
134
134
|
if (o)
|
|
135
135
|
return;
|
|
136
|
-
|
|
137
|
-
const V =
|
|
136
|
+
N.current = e.eventValue, x.current = e.eventValue;
|
|
137
|
+
const V = q(G(e.eventValue, c, d), l, s), m = G(s.parseNumber(V, l), c, d);
|
|
138
138
|
m !== e.eventValue && (e.valueIsOutOfRange = !0, e.eventValue = m, x.current = m), b !== e.eventValue && Q(
|
|
139
139
|
E,
|
|
140
140
|
r,
|
|
141
141
|
y(),
|
|
142
142
|
{ value: e.eventValue }
|
|
143
|
-
),
|
|
143
|
+
), N.current = void 0, i.current = e, S((J) => !J);
|
|
144
144
|
},
|
|
145
145
|
[b, E, o, S, y]
|
|
146
146
|
), Ke = n.useCallback(
|
|
147
147
|
(r) => {
|
|
148
148
|
const e = f();
|
|
149
|
-
|
|
149
|
+
D.current = !1, p(r, ye(e, l, s));
|
|
150
150
|
},
|
|
151
151
|
[l, E, s, p, f]
|
|
152
152
|
), we = n.useCallback(
|
|
@@ -155,7 +155,7 @@ const it = "Please enter a valid value!", dt = Ze(), Ee = n.forwardRef((C, Se) =
|
|
|
155
155
|
const V = s.parseNumber(String(e.currentLooseValue), l);
|
|
156
156
|
if (e.selectionEnd > e.selectionStart && e.selectionEnd - e.selectionStart === String(e.currentLooseValue).length) {
|
|
157
157
|
const m = s.numberSymbols(), k = m && r.key === m.minusSign, J = m && r.key === m.decimal;
|
|
158
|
-
|
|
158
|
+
D.current = !k && !J;
|
|
159
159
|
return;
|
|
160
160
|
}
|
|
161
161
|
switch (r.keyCode) {
|
|
@@ -164,7 +164,7 @@ const it = "Please enter a valid value!", dt = Ze(), Ee = n.forwardRef((C, Se) =
|
|
|
164
164
|
V,
|
|
165
165
|
e,
|
|
166
166
|
v,
|
|
167
|
-
|
|
167
|
+
c,
|
|
168
168
|
d,
|
|
169
169
|
l,
|
|
170
170
|
s
|
|
@@ -175,7 +175,7 @@ const it = "Please enter a valid value!", dt = Ze(), Ee = n.forwardRef((C, Se) =
|
|
|
175
175
|
V,
|
|
176
176
|
e,
|
|
177
177
|
v,
|
|
178
|
-
|
|
178
|
+
c,
|
|
179
179
|
d,
|
|
180
180
|
l,
|
|
181
181
|
s
|
|
@@ -184,8 +184,8 @@ const it = "Please enter a valid value!", dt = Ze(), Ee = n.forwardRef((C, Se) =
|
|
|
184
184
|
case 13: {
|
|
185
185
|
if (se === !1)
|
|
186
186
|
return;
|
|
187
|
-
const m =
|
|
188
|
-
e.eventValue = k, e.currentLooseValue =
|
|
187
|
+
const m = q(G(V, c, d), l, s), k = G(s.parseNumber(m, l), c, d);
|
|
188
|
+
e.eventValue = k, e.currentLooseValue = q(k, l, s), e.selectionStart = e.selectionEnd = e.currentLooseValue.length;
|
|
189
189
|
break;
|
|
190
190
|
}
|
|
191
191
|
case 110: {
|
|
@@ -198,10 +198,10 @@ const it = "Please enter a valid value!", dt = Ze(), Ee = n.forwardRef((C, Se) =
|
|
|
198
198
|
}
|
|
199
199
|
r.preventDefault(), p(r, e);
|
|
200
200
|
},
|
|
201
|
-
[l,
|
|
201
|
+
[l, c, d, v, E, se, p, f]
|
|
202
202
|
), Ue = n.useCallback(
|
|
203
203
|
() => {
|
|
204
|
-
|
|
204
|
+
D.current = !0;
|
|
205
205
|
},
|
|
206
206
|
[]
|
|
207
207
|
), W = n.useCallback(
|
|
@@ -213,13 +213,13 @@ const it = "Please enter a valid value!", dt = Ze(), Ee = n.forwardRef((C, Se) =
|
|
|
213
213
|
s.parseNumber(String(e.currentLooseValue), l),
|
|
214
214
|
e,
|
|
215
215
|
v,
|
|
216
|
-
|
|
216
|
+
c,
|
|
217
217
|
d,
|
|
218
218
|
l,
|
|
219
219
|
s
|
|
220
220
|
), p(r, e);
|
|
221
221
|
},
|
|
222
|
-
[l,
|
|
222
|
+
[l, c, d, v, E, g, o, p, f]
|
|
223
223
|
), Y = n.useCallback(
|
|
224
224
|
(r) => {
|
|
225
225
|
if (g || o)
|
|
@@ -229,13 +229,13 @@ const it = "Please enter a valid value!", dt = Ze(), Ee = n.forwardRef((C, Se) =
|
|
|
229
229
|
s.parseNumber(String(e.currentLooseValue), l),
|
|
230
230
|
e,
|
|
231
231
|
v,
|
|
232
|
-
|
|
232
|
+
c,
|
|
233
233
|
d,
|
|
234
234
|
l,
|
|
235
235
|
s
|
|
236
236
|
), p(r, e);
|
|
237
237
|
},
|
|
238
|
-
[l,
|
|
238
|
+
[l, c, d, v, E, g, o, p, f]
|
|
239
239
|
), $e = n.useCallback(
|
|
240
240
|
(r) => {
|
|
241
241
|
const e = be(document);
|
|
@@ -244,7 +244,7 @@ const it = "Please enter a valid value!", dt = Ze(), Ee = n.forwardRef((C, Se) =
|
|
|
244
244
|
[W, Y, o, g]
|
|
245
245
|
), We = n.useCallback(
|
|
246
246
|
(r) => {
|
|
247
|
-
|
|
247
|
+
i.current.currentLooseValue = U.current, i.current.focused = !0, Q(
|
|
248
248
|
ae,
|
|
249
249
|
r,
|
|
250
250
|
y(),
|
|
@@ -254,7 +254,7 @@ const it = "Please enter a valid value!", dt = Ze(), Ee = n.forwardRef((C, Se) =
|
|
|
254
254
|
[ae, S, y]
|
|
255
255
|
), Ye = n.useCallback(
|
|
256
256
|
(r) => {
|
|
257
|
-
|
|
257
|
+
i.current = ve(), Q(
|
|
258
258
|
le,
|
|
259
259
|
r,
|
|
260
260
|
y(),
|
|
@@ -273,11 +273,11 @@ const it = "Please enter a valid value!", dt = Ze(), Ee = n.forwardRef((C, Se) =
|
|
|
273
273
|
);
|
|
274
274
|
rt(
|
|
275
275
|
() => {
|
|
276
|
-
a.current && a.current.type !== "number" &&
|
|
276
|
+
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);
|
|
277
277
|
},
|
|
278
278
|
[Ae]
|
|
279
279
|
);
|
|
280
|
-
const me = !$() ||
|
|
280
|
+
const me = !$() || B().valid, fe = /* @__PURE__ */ n.createElement(
|
|
281
281
|
"span",
|
|
282
282
|
{
|
|
283
283
|
dir: te,
|
|
@@ -287,10 +287,10 @@ const it = "Please enter a valid value!", dt = Ze(), Ee = n.forwardRef((C, Se) =
|
|
|
287
287
|
"k-numerictextbox",
|
|
288
288
|
{
|
|
289
289
|
[`k-input-${ge.sizeMap[K] || K}`]: K,
|
|
290
|
-
[`k-input-${
|
|
290
|
+
[`k-input-${L}`]: L,
|
|
291
291
|
[`k-rounded-${ge.roundedMap[w] || w}`]: w,
|
|
292
292
|
"k-invalid": !me,
|
|
293
|
-
"k-required":
|
|
293
|
+
"k-required": O,
|
|
294
294
|
"k-disabled": o
|
|
295
295
|
},
|
|
296
296
|
xe
|
|
@@ -309,20 +309,21 @@ const it = "Please enter a valid value!", dt = Ze(), Ee = n.forwardRef((C, Se) =
|
|
|
309
309
|
disabled: o,
|
|
310
310
|
title: Le,
|
|
311
311
|
"aria-disabled": o ? "true" : void 0,
|
|
312
|
-
"aria-valuemin":
|
|
312
|
+
"aria-valuemin": c,
|
|
313
313
|
"aria-valuemax": d,
|
|
314
314
|
"aria-label": Re,
|
|
315
315
|
"aria-labelledby": De,
|
|
316
316
|
"aria-describedby": Ne,
|
|
317
|
+
"aria-required": O,
|
|
317
318
|
placeholder: ee,
|
|
318
319
|
spellCheck: !1,
|
|
319
320
|
autoComplete: "off",
|
|
320
321
|
autoCorrect: "off",
|
|
321
|
-
autoFocus:
|
|
322
|
+
autoFocus: Ge,
|
|
322
323
|
type: Fe || "tel",
|
|
323
324
|
className: "k-input-inner",
|
|
324
325
|
id: ue,
|
|
325
|
-
name:
|
|
326
|
+
name: A,
|
|
326
327
|
readOnly: g,
|
|
327
328
|
style: Me,
|
|
328
329
|
onChange: Ke,
|
|
@@ -350,10 +351,10 @@ const it = "Please enter a valid value!", dt = Ze(), Ee = n.forwardRef((C, Se) =
|
|
|
350
351
|
icon: "caret-alt-up",
|
|
351
352
|
svgIcon: st,
|
|
352
353
|
rounded: null,
|
|
353
|
-
fillMode:
|
|
354
|
+
fillMode: L,
|
|
354
355
|
className: "k-spinner-increase",
|
|
355
|
-
"aria-label":
|
|
356
|
-
title:
|
|
356
|
+
"aria-label": P.toLanguageString(M, T[M]),
|
|
357
|
+
title: P.toLanguageString(M, T[M]),
|
|
357
358
|
onClick: W
|
|
358
359
|
}
|
|
359
360
|
),
|
|
@@ -365,10 +366,10 @@ const it = "Please enter a valid value!", dt = Ze(), Ee = n.forwardRef((C, Se) =
|
|
|
365
366
|
icon: "caret-alt-down",
|
|
366
367
|
svgIcon: ot,
|
|
367
368
|
rounded: null,
|
|
368
|
-
fillMode:
|
|
369
|
+
fillMode: L,
|
|
369
370
|
className: "k-spinner-decrease",
|
|
370
|
-
"aria-label":
|
|
371
|
-
title:
|
|
371
|
+
"aria-label": P.toLanguageString(z, T[z]),
|
|
372
|
+
title: P.toLanguageString(z, T[z]),
|
|
372
373
|
onClick: Y
|
|
373
374
|
}
|
|
374
375
|
)
|
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: 1726561298,
|
|
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": "8.3.0
|
|
3
|
+
"version": "8.3.0",
|
|
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.20.1",
|
|
26
26
|
"@progress/kendo-inputs-common": "^3.1.0",
|
|
27
27
|
"@progress/kendo-licensing": "^1.3.4",
|
|
28
|
-
"@progress/kendo-react-animation": "8.3.0
|
|
29
|
-
"@progress/kendo-react-buttons": "8.3.0
|
|
30
|
-
"@progress/kendo-react-common": "8.3.0
|
|
31
|
-
"@progress/kendo-react-dialogs": "8.3.0
|
|
32
|
-
"@progress/kendo-react-intl": "8.3.0
|
|
33
|
-
"@progress/kendo-react-labels": "8.3.0
|
|
34
|
-
"@progress/kendo-react-popup": "8.3.0
|
|
28
|
+
"@progress/kendo-react-animation": "8.3.0",
|
|
29
|
+
"@progress/kendo-react-buttons": "8.3.0",
|
|
30
|
+
"@progress/kendo-react-common": "8.3.0",
|
|
31
|
+
"@progress/kendo-react-dialogs": "8.3.0",
|
|
32
|
+
"@progress/kendo-react-intl": "8.3.0",
|
|
33
|
+
"@progress/kendo-react-labels": "8.3.0",
|
|
34
|
+
"@progress/kendo-react-popup": "8.3.0",
|
|
35
35
|
"@progress/kendo-svg-icons": "^3.0.0",
|
|
36
36
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0",
|
|
37
37
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
|
|
@@ -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,
|