@progress/kendo-react-inputs 8.2.0-develop.8 → 8.2.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 +74 -70
- package/colors/ColorGradient.js +1 -1
- package/colors/ColorGradient.mjs +181 -121
- package/colors/ColorPalette.js +1 -1
- package/colors/ColorPalette.mjs +29 -29
- package/colors/ColorPicker.js +1 -1
- package/colors/ColorPicker.mjs +168 -152
- package/colors/FlatColorPicker.js +1 -1
- package/colors/FlatColorPicker.mjs +120 -104
- package/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/index.d.mts +120 -45
- package/index.d.ts +120 -45
- package/input/Input.js +1 -1
- package/input/Input.mjs +47 -43
- package/maskedtextbox/MaskedTextBox.js +1 -1
- package/maskedtextbox/MaskedTextBox.mjs +61 -57
- package/numerictextbox/NumericTextBox.js +1 -1
- package/numerictextbox/NumericTextBox.mjs +89 -86
- package/package-metadata.mjs +1 -1
- package/package.json +8 -8
- package/range-slider/RangeSlider.js +11 -11
- package/range-slider/RangeSlider.mjs +176 -154
- package/range-slider/range-raducer.js +1 -1
- package/range-slider/range-raducer.mjs +35 -1
- package/signature/Signature.js +1 -1
- package/signature/Signature.mjs +112 -111
- package/slider/Slider.js +1 -1
- package/slider/Slider.mjs +29 -29
- package/textarea/TextArea.js +1 -1
- package/textarea/TextArea.mjs +96 -92
- package/textbox/Textbox.js +1 -1
- package/textbox/Textbox.mjs +54 -50
|
@@ -8,17 +8,17 @@
|
|
|
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
|
|
16
|
-
import { numericIncreaseValue as
|
|
11
|
+
import { useInternationalization as Qe, useLocalization as Xe } from "@progress/kendo-react-intl";
|
|
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
|
+
import { caretAltUpIcon as st, caretAltDownIcon as ot } from "@progress/kendo-svg-icons";
|
|
14
|
+
import { FloatingLabel as ut } from "@progress/kendo-react-labels";
|
|
15
|
+
import { packageMetadata as ct } from "../package-metadata.mjs";
|
|
16
|
+
import { numericIncreaseValue as B, messages as M, numericDecreaseValue as T } from "../messages/index.mjs";
|
|
17
17
|
import { getInitialState as ve, formatValue as z, 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 it = "Please enter a valid value!",
|
|
20
|
-
|
|
21
|
-
const q =
|
|
19
|
+
const it = "Please enter a valid value!", dt = Ze(), Ee = n.forwardRef((C, Se) => {
|
|
20
|
+
et(ct);
|
|
21
|
+
const q = tt(dt, C), {
|
|
22
22
|
className: xe,
|
|
23
23
|
value: b,
|
|
24
24
|
defaultValue: he,
|
|
@@ -28,7 +28,7 @@ const it = "Please enter a valid value!", ct = Xe(), Ee = n.forwardRef((C, Se) =
|
|
|
28
28
|
accessKey: Oe,
|
|
29
29
|
title: Le,
|
|
30
30
|
placeholder: ee,
|
|
31
|
-
min:
|
|
31
|
+
min: i,
|
|
32
32
|
max: d,
|
|
33
33
|
dir: te,
|
|
34
34
|
name: j,
|
|
@@ -37,43 +37,44 @@ const it = "Please enter a valid value!", ct = Xe(), Ee = n.forwardRef((C, Se) =
|
|
|
37
37
|
ariaDescribedBy: Ne,
|
|
38
38
|
ariaLabelledBy: De,
|
|
39
39
|
ariaLabel: Re,
|
|
40
|
-
inputType:
|
|
40
|
+
inputType: Fe,
|
|
41
41
|
readOnly: g,
|
|
42
42
|
validationMessage: A,
|
|
43
|
-
children:
|
|
43
|
+
children: Be,
|
|
44
44
|
style: ne,
|
|
45
|
-
inputStyle:
|
|
45
|
+
inputStyle: Me,
|
|
46
46
|
valid: _,
|
|
47
|
-
step: v =
|
|
48
|
-
spinners: Te =
|
|
49
|
-
disabled: o =
|
|
50
|
-
required: H =
|
|
51
|
-
validityStyles: re =
|
|
52
|
-
prefix: ze =
|
|
53
|
-
suffix: Ge =
|
|
54
|
-
onChange: E =
|
|
55
|
-
onFocus: ae =
|
|
56
|
-
onBlur: le =
|
|
57
|
-
rangeOnEnter: se =
|
|
58
|
-
size: K =
|
|
59
|
-
rounded: w =
|
|
60
|
-
fillMode: O =
|
|
47
|
+
step: v = u.step,
|
|
48
|
+
spinners: Te = u.spinners,
|
|
49
|
+
disabled: o = u.disabled,
|
|
50
|
+
required: H = u.required,
|
|
51
|
+
validityStyles: re = u.validityStyles,
|
|
52
|
+
prefix: ze = u.prefix,
|
|
53
|
+
suffix: Ge = u.suffix,
|
|
54
|
+
onChange: E = u.onChange,
|
|
55
|
+
onFocus: ae = u.onFocus,
|
|
56
|
+
onBlur: le = u.onBlur,
|
|
57
|
+
rangeOnEnter: se = u.rangeOnEnter,
|
|
58
|
+
size: K = u.size,
|
|
59
|
+
rounded: w = u.rounded,
|
|
60
|
+
fillMode: O = u.fillMode,
|
|
61
|
+
autoFocus: qe = u.autoFocus,
|
|
61
62
|
...oe
|
|
62
|
-
} = q,
|
|
63
|
-
|
|
63
|
+
} = q, je = nt(), ue = Pe || je, s = Qe(), L = Xe(), a = n.useRef(null), P = n.useRef(), [Ae, S] = n.useState(!1), c = n.useRef(ve()), N = n.useRef(!1), U = n.useRef(), x = n.useRef(he), h = z(
|
|
64
|
+
c.current.focused && !o ? c.current.currentLooseValue : X(b, x.current),
|
|
64
65
|
l,
|
|
65
66
|
s
|
|
66
67
|
);
|
|
67
68
|
U.current = h;
|
|
68
|
-
const [
|
|
69
|
+
const [_e] = pe(ze), [He] = pe(Ge);
|
|
69
70
|
n.useEffect(
|
|
70
71
|
() => {
|
|
71
72
|
a.current && a.current.setCustomValidity && a.current.setCustomValidity(
|
|
72
|
-
|
|
73
|
+
F().valid ? "" : A || it
|
|
73
74
|
);
|
|
74
75
|
}
|
|
75
76
|
);
|
|
76
|
-
const
|
|
77
|
+
const ce = n.useCallback(
|
|
77
78
|
() => {
|
|
78
79
|
a.current && a.current.focus();
|
|
79
80
|
},
|
|
@@ -81,15 +82,15 @@ const it = "Please enter a valid value!", ct = Xe(), Ee = n.forwardRef((C, Se) =
|
|
|
81
82
|
), D = n.useCallback(
|
|
82
83
|
() => P.current !== void 0 ? P.current : X(b, x.current),
|
|
83
84
|
[b]
|
|
84
|
-
),
|
|
85
|
+
), ie = n.useCallback(
|
|
85
86
|
() => j,
|
|
86
87
|
[j]
|
|
87
88
|
), R = n.useCallback(
|
|
88
89
|
() => H,
|
|
89
90
|
[H]
|
|
90
|
-
),
|
|
91
|
+
), F = n.useCallback(
|
|
91
92
|
() => {
|
|
92
|
-
const r = A !== void 0, e = D(), V = _ !== void 0 ? _ : !
|
|
93
|
+
const r = A !== void 0, e = D(), V = _ !== void 0 ? _ : !c.current.valueIsOutOfRange && (!R() || e != null);
|
|
93
94
|
return {
|
|
94
95
|
customError: r,
|
|
95
96
|
valid: V,
|
|
@@ -107,11 +108,11 @@ const it = "Please enter a valid value!", ct = Xe(), Ee = n.forwardRef((C, Se) =
|
|
|
107
108
|
() => {
|
|
108
109
|
const r = {
|
|
109
110
|
element: a.current,
|
|
110
|
-
focus:
|
|
111
|
+
focus: ce
|
|
111
112
|
};
|
|
112
|
-
return Object.defineProperty(r, "name", { get:
|
|
113
|
+
return Object.defineProperty(r, "name", { get: ie }), Object.defineProperty(r, "value", { get: D }), Object.defineProperty(r, "validity", { get: F }), Object.defineProperty(r, "validityStyles", { get: $ }), Object.defineProperty(r, "required", { get: R }), Object.defineProperty(r, "props", { get: de }), r;
|
|
113
114
|
},
|
|
114
|
-
[
|
|
115
|
+
[ie, D, F, $, R, ce, de]
|
|
115
116
|
);
|
|
116
117
|
n.useImperativeHandle(Se, y);
|
|
117
118
|
const f = n.useCallback(
|
|
@@ -125,7 +126,7 @@ const it = "Please enter a valid value!", ct = Xe(), Ee = n.forwardRef((C, Se) =
|
|
|
125
126
|
valueIsCorrected: !1,
|
|
126
127
|
valueIsOutOfRange: !1,
|
|
127
128
|
isPaste: N.current,
|
|
128
|
-
focused:
|
|
129
|
+
focused: c.current.focused
|
|
129
130
|
}),
|
|
130
131
|
[b]
|
|
131
132
|
), p = n.useCallback(
|
|
@@ -133,22 +134,22 @@ const it = "Please enter a valid value!", ct = Xe(), Ee = n.forwardRef((C, Se) =
|
|
|
133
134
|
if (o)
|
|
134
135
|
return;
|
|
135
136
|
P.current = e.eventValue, x.current = e.eventValue;
|
|
136
|
-
const V = z(G(e.eventValue,
|
|
137
|
+
const V = z(G(e.eventValue, i, d), l, s), m = G(s.parseNumber(V, l), i, d);
|
|
137
138
|
m !== e.eventValue && (e.valueIsOutOfRange = !0, e.eventValue = m, x.current = m), b !== e.eventValue && Q(
|
|
138
139
|
E,
|
|
139
140
|
r,
|
|
140
141
|
y(),
|
|
141
142
|
{ value: e.eventValue }
|
|
142
|
-
), P.current = void 0,
|
|
143
|
+
), P.current = void 0, c.current = e, S((J) => !J);
|
|
143
144
|
},
|
|
144
145
|
[b, E, o, S, y]
|
|
145
|
-
),
|
|
146
|
+
), Ke = n.useCallback(
|
|
146
147
|
(r) => {
|
|
147
148
|
const e = f();
|
|
148
149
|
N.current = !1, p(r, ye(e, l, s));
|
|
149
150
|
},
|
|
150
151
|
[l, E, s, p, f]
|
|
151
|
-
),
|
|
152
|
+
), we = n.useCallback(
|
|
152
153
|
(r) => {
|
|
153
154
|
let e = f();
|
|
154
155
|
const V = s.parseNumber(String(e.currentLooseValue), l);
|
|
@@ -163,7 +164,7 @@ const it = "Please enter a valid value!", ct = Xe(), Ee = n.forwardRef((C, Se) =
|
|
|
163
164
|
V,
|
|
164
165
|
e,
|
|
165
166
|
v,
|
|
166
|
-
|
|
167
|
+
i,
|
|
167
168
|
d,
|
|
168
169
|
l,
|
|
169
170
|
s
|
|
@@ -174,7 +175,7 @@ const it = "Please enter a valid value!", ct = Xe(), Ee = n.forwardRef((C, Se) =
|
|
|
174
175
|
V,
|
|
175
176
|
e,
|
|
176
177
|
v,
|
|
177
|
-
|
|
178
|
+
i,
|
|
178
179
|
d,
|
|
179
180
|
l,
|
|
180
181
|
s
|
|
@@ -183,7 +184,7 @@ const it = "Please enter a valid value!", ct = Xe(), Ee = n.forwardRef((C, Se) =
|
|
|
183
184
|
case 13: {
|
|
184
185
|
if (se === !1)
|
|
185
186
|
return;
|
|
186
|
-
const m = z(G(V,
|
|
187
|
+
const m = z(G(V, i, d), l, s), k = G(s.parseNumber(m, l), i, d);
|
|
187
188
|
e.eventValue = k, e.currentLooseValue = z(k, l, s), e.selectionStart = e.selectionEnd = e.currentLooseValue.length;
|
|
188
189
|
break;
|
|
189
190
|
}
|
|
@@ -197,8 +198,8 @@ const it = "Please enter a valid value!", ct = Xe(), Ee = n.forwardRef((C, Se) =
|
|
|
197
198
|
}
|
|
198
199
|
r.preventDefault(), p(r, e);
|
|
199
200
|
},
|
|
200
|
-
[l,
|
|
201
|
-
),
|
|
201
|
+
[l, i, d, v, E, se, p, f]
|
|
202
|
+
), Ue = n.useCallback(
|
|
202
203
|
() => {
|
|
203
204
|
N.current = !0;
|
|
204
205
|
},
|
|
@@ -212,13 +213,13 @@ const it = "Please enter a valid value!", ct = Xe(), Ee = n.forwardRef((C, Se) =
|
|
|
212
213
|
s.parseNumber(String(e.currentLooseValue), l),
|
|
213
214
|
e,
|
|
214
215
|
v,
|
|
215
|
-
|
|
216
|
+
i,
|
|
216
217
|
d,
|
|
217
218
|
l,
|
|
218
219
|
s
|
|
219
220
|
), p(r, e);
|
|
220
221
|
},
|
|
221
|
-
[l,
|
|
222
|
+
[l, i, d, v, E, g, o, p, f]
|
|
222
223
|
), Y = n.useCallback(
|
|
223
224
|
(r) => {
|
|
224
225
|
if (g || o)
|
|
@@ -228,22 +229,22 @@ const it = "Please enter a valid value!", ct = Xe(), Ee = n.forwardRef((C, Se) =
|
|
|
228
229
|
s.parseNumber(String(e.currentLooseValue), l),
|
|
229
230
|
e,
|
|
230
231
|
v,
|
|
231
|
-
|
|
232
|
+
i,
|
|
232
233
|
d,
|
|
233
234
|
l,
|
|
234
235
|
s
|
|
235
236
|
), p(r, e);
|
|
236
237
|
},
|
|
237
|
-
[l,
|
|
238
|
-
),
|
|
238
|
+
[l, i, d, v, E, g, o, p, f]
|
|
239
|
+
), $e = n.useCallback(
|
|
239
240
|
(r) => {
|
|
240
241
|
const e = be(document);
|
|
241
242
|
!document || e !== a.current || !a.current || g || o || (r.nativeEvent.deltaY < 0 && W(r), r.nativeEvent.deltaY > 0 && Y(r));
|
|
242
243
|
},
|
|
243
244
|
[W, Y, o, g]
|
|
244
|
-
),
|
|
245
|
+
), We = n.useCallback(
|
|
245
246
|
(r) => {
|
|
246
|
-
|
|
247
|
+
c.current.currentLooseValue = U.current, c.current.focused = !0, Q(
|
|
247
248
|
ae,
|
|
248
249
|
r,
|
|
249
250
|
y(),
|
|
@@ -251,9 +252,9 @@ const it = "Please enter a valid value!", ct = Xe(), Ee = n.forwardRef((C, Se) =
|
|
|
251
252
|
), S((e) => !e);
|
|
252
253
|
},
|
|
253
254
|
[ae, S, y]
|
|
254
|
-
),
|
|
255
|
+
), Ye = n.useCallback(
|
|
255
256
|
(r) => {
|
|
256
|
-
|
|
257
|
+
c.current = ve(), Q(
|
|
257
258
|
le,
|
|
258
259
|
r,
|
|
259
260
|
y(),
|
|
@@ -261,7 +262,7 @@ const it = "Please enter a valid value!", ct = Xe(), Ee = n.forwardRef((C, Se) =
|
|
|
261
262
|
), S((e) => !e);
|
|
262
263
|
},
|
|
263
264
|
[le, S, y]
|
|
264
|
-
),
|
|
265
|
+
), Je = n.useCallback(
|
|
265
266
|
(r) => {
|
|
266
267
|
if (document && a.current) {
|
|
267
268
|
const e = be(document);
|
|
@@ -270,18 +271,18 @@ const it = "Please enter a valid value!", ct = Xe(), Ee = n.forwardRef((C, Se) =
|
|
|
270
271
|
},
|
|
271
272
|
[]
|
|
272
273
|
);
|
|
273
|
-
|
|
274
|
+
rt(
|
|
274
275
|
() => {
|
|
275
|
-
a.current && a.current.type !== "number" &&
|
|
276
|
+
a.current && a.current.type !== "number" && c.current.selectionStart !== void 0 && c.current.selectionEnd !== void 0 && (a.current.selectionStart = c.current.selectionStart, a.current.selectionEnd = c.current.selectionEnd, c.current.selectionStart = void 0, c.current.selectionEnd = void 0);
|
|
276
277
|
},
|
|
277
|
-
[
|
|
278
|
+
[Ae]
|
|
278
279
|
);
|
|
279
|
-
const me = !$() ||
|
|
280
|
+
const me = !$() || F().valid, fe = /* @__PURE__ */ n.createElement(
|
|
280
281
|
"span",
|
|
281
282
|
{
|
|
282
283
|
dir: te,
|
|
283
284
|
style: I ? ne : { width: Z, ...ne },
|
|
284
|
-
className:
|
|
285
|
+
className: at(
|
|
285
286
|
"k-input",
|
|
286
287
|
"k-numerictextbox",
|
|
287
288
|
{
|
|
@@ -297,18 +298,18 @@ const it = "Please enter a valid value!", ct = Xe(), Ee = n.forwardRef((C, Se) =
|
|
|
297
298
|
"aria-disabled": o ? "true" : void 0,
|
|
298
299
|
...I ? {} : oe
|
|
299
300
|
},
|
|
300
|
-
/* @__PURE__ */ n.createElement(
|
|
301
|
+
/* @__PURE__ */ n.createElement(_e, null),
|
|
301
302
|
/* @__PURE__ */ n.createElement(
|
|
302
303
|
"input",
|
|
303
304
|
{
|
|
304
305
|
role: "spinbutton",
|
|
305
306
|
value: h === null ? "" : h,
|
|
306
|
-
tabIndex:
|
|
307
|
+
tabIndex: lt(Ie, o),
|
|
307
308
|
accessKey: Oe,
|
|
308
309
|
disabled: o,
|
|
309
310
|
title: Le,
|
|
310
311
|
"aria-disabled": o ? "true" : void 0,
|
|
311
|
-
"aria-valuemin":
|
|
312
|
+
"aria-valuemin": i,
|
|
312
313
|
"aria-valuemax": d,
|
|
313
314
|
"aria-label": Re,
|
|
314
315
|
"aria-labelledby": De,
|
|
@@ -317,28 +318,29 @@ const it = "Please enter a valid value!", ct = Xe(), Ee = n.forwardRef((C, Se) =
|
|
|
317
318
|
spellCheck: !1,
|
|
318
319
|
autoComplete: "off",
|
|
319
320
|
autoCorrect: "off",
|
|
320
|
-
|
|
321
|
+
autoFocus: qe,
|
|
322
|
+
type: Fe || "tel",
|
|
321
323
|
className: "k-input-inner",
|
|
322
324
|
id: ue,
|
|
323
325
|
name: j,
|
|
324
326
|
readOnly: g,
|
|
325
|
-
style:
|
|
326
|
-
onChange:
|
|
327
|
-
onFocus:
|
|
328
|
-
onBlur:
|
|
329
|
-
onKeyDown:
|
|
330
|
-
onPaste:
|
|
331
|
-
onWheel:
|
|
327
|
+
style: Me,
|
|
328
|
+
onChange: Ke,
|
|
329
|
+
onFocus: We,
|
|
330
|
+
onBlur: Ye,
|
|
331
|
+
onKeyDown: we,
|
|
332
|
+
onPaste: Ue,
|
|
333
|
+
onWheel: $e,
|
|
332
334
|
ref: a
|
|
333
335
|
}
|
|
334
336
|
),
|
|
335
|
-
/* @__PURE__ */ n.createElement(
|
|
336
|
-
|
|
337
|
+
/* @__PURE__ */ n.createElement(He, null),
|
|
338
|
+
Be,
|
|
337
339
|
Te && /* @__PURE__ */ n.createElement(
|
|
338
340
|
"span",
|
|
339
341
|
{
|
|
340
342
|
className: "k-input-spinner k-spin-button",
|
|
341
|
-
onMouseDown:
|
|
343
|
+
onMouseDown: Je
|
|
342
344
|
},
|
|
343
345
|
/* @__PURE__ */ n.createElement(
|
|
344
346
|
Ce,
|
|
@@ -346,12 +348,12 @@ const it = "Please enter a valid value!", ct = Xe(), Ee = n.forwardRef((C, Se) =
|
|
|
346
348
|
tabIndex: -1,
|
|
347
349
|
type: "button",
|
|
348
350
|
icon: "caret-alt-up",
|
|
349
|
-
svgIcon:
|
|
351
|
+
svgIcon: st,
|
|
350
352
|
rounded: null,
|
|
351
353
|
fillMode: O,
|
|
352
354
|
className: "k-spinner-increase",
|
|
353
|
-
"aria-label": L.toLanguageString(
|
|
354
|
-
title: L.toLanguageString(
|
|
355
|
+
"aria-label": L.toLanguageString(B, M[B]),
|
|
356
|
+
title: L.toLanguageString(B, M[B]),
|
|
355
357
|
onClick: W
|
|
356
358
|
}
|
|
357
359
|
),
|
|
@@ -361,19 +363,19 @@ const it = "Please enter a valid value!", ct = Xe(), Ee = n.forwardRef((C, Se) =
|
|
|
361
363
|
tabIndex: -1,
|
|
362
364
|
type: "button",
|
|
363
365
|
icon: "caret-alt-down",
|
|
364
|
-
svgIcon:
|
|
366
|
+
svgIcon: ot,
|
|
365
367
|
rounded: null,
|
|
366
368
|
fillMode: O,
|
|
367
369
|
className: "k-spinner-decrease",
|
|
368
|
-
"aria-label": L.toLanguageString(T,
|
|
369
|
-
title: L.toLanguageString(T,
|
|
370
|
+
"aria-label": L.toLanguageString(T, M[T]),
|
|
371
|
+
title: L.toLanguageString(T, M[T]),
|
|
370
372
|
onClick: Y
|
|
371
373
|
}
|
|
372
374
|
)
|
|
373
375
|
)
|
|
374
376
|
);
|
|
375
377
|
return I ? /* @__PURE__ */ n.createElement(
|
|
376
|
-
|
|
378
|
+
ut,
|
|
377
379
|
{
|
|
378
380
|
label: I,
|
|
379
381
|
editorId: ue,
|
|
@@ -434,7 +436,7 @@ Ee.propTypes = {
|
|
|
434
436
|
rounded: t.oneOf([null, "small", "medium", "large", "full"]),
|
|
435
437
|
fillMode: t.oneOf([null, "solid", "flat", "outline"])
|
|
436
438
|
};
|
|
437
|
-
const
|
|
439
|
+
const u = {
|
|
438
440
|
prefix: (C) => null,
|
|
439
441
|
suffix: (C) => null,
|
|
440
442
|
step: 1,
|
|
@@ -443,6 +445,7 @@ const i = {
|
|
|
443
445
|
required: !1,
|
|
444
446
|
validityStyles: !0,
|
|
445
447
|
rangeOnEnter: !0,
|
|
448
|
+
autoFocus: !1,
|
|
446
449
|
onChange: (C) => {
|
|
447
450
|
},
|
|
448
451
|
onFocus: (C) => {
|
|
@@ -456,5 +459,5 @@ const i = {
|
|
|
456
459
|
Ee.displayName = "KendoNumericTextBox";
|
|
457
460
|
export {
|
|
458
461
|
Ee as NumericTextBox,
|
|
459
|
-
|
|
462
|
+
dt as NumericTextBoxPropsContext
|
|
460
463
|
};
|
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: 1722843933,
|
|
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.2.0
|
|
3
|
+
"version": "8.2.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.2.0
|
|
29
|
-
"@progress/kendo-react-buttons": "8.2.0
|
|
30
|
-
"@progress/kendo-react-common": "8.2.0
|
|
31
|
-
"@progress/kendo-react-dialogs": "8.2.0
|
|
32
|
-
"@progress/kendo-react-intl": "8.2.0
|
|
33
|
-
"@progress/kendo-react-labels": "8.2.0
|
|
34
|
-
"@progress/kendo-react-popup": "8.2.0
|
|
28
|
+
"@progress/kendo-react-animation": "8.2.0",
|
|
29
|
+
"@progress/kendo-react-buttons": "8.2.0",
|
|
30
|
+
"@progress/kendo-react-common": "8.2.0",
|
|
31
|
+
"@progress/kendo-react-dialogs": "8.2.0",
|
|
32
|
+
"@progress/kendo-react-intl": "8.2.0",
|
|
33
|
+
"@progress/kendo-react-labels": "8.2.0",
|
|
34
|
+
"@progress/kendo-react-popup": "8.2.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,16 +5,16 @@
|
|
|
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 W=require("react"),C=require("prop-types"),
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=require("react"),C=require("prop-types"),l=require("@progress/kendo-react-common"),h=require("../messages/index.js"),Y=require("@progress/kendo-react-intl"),r=require("./range-raducer.js"),F=require("../package-metadata.js");function J(n){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const d in n)if(d!=="default"){const e=Object.getOwnPropertyDescriptor(n,d);Object.defineProperty(s,d,e.get?e:{enumerable:!0,get:()=>n[d]})}}return s.default=n,Object.freeze(s)}const a=J(W),Q=(n,s,d)=>{const[e,i]=a.useState(n),m=a.useCallback(g=>{const v=r.rangeReducer(s.state||e,{...g,...s});d&&d(v,g.event),i(v)},[s,d]);return[e,m]},S=l.createPropsContext(),x=a.forwardRef((n,s)=>{l.validatePackage(F.packageMetadata);const d=l.usePropsContext(S,n),e={step:k.step,largeStep:k.largeStep,defaultValue:k.defaultValue,vertical:k.vertical,disabled:k.disabled,...d},i=a.useRef(null),m=a.useRef(null),g=a.useRef(null),v=a.useRef(null),D=a.useRef(null),w=a.useCallback(()=>{v.current&&v.current.focus()},[v]);a.useImperativeHandle(i,()=>({element:m.current,focus:w,props:e})),a.useImperativeHandle(s,()=>i.current);const f=a.useMemo(()=>e.min,[e.min]),y=a.useMemo(()=>e.max,[e.max]),K=a.useMemo(()=>e.step!==void 0?e.step:k.step,[e.step,k.step]),$=a.useMemo(()=>e.largeStep!==void 0?e.largeStep:k.largeStep,[e.largeStep,k.largeStep]),u=l.useDir(m,e.dir),M=(t,p)=>{e.onChange&&i.current&&e.onChange.call(void 0,{value:t,target:i.current,syntheticEvent:p})},[O,_]=a.useState(""),[N,c]=Q(e.defaultValue||k.defaultValue,{min:f,max:y,step:K,largeStep:$,state:e.value},M),o=a.useMemo(()=>e.value||N,[e.value,N]),L=a.useRef(null),T=a.useRef(null),A=a.useMemo(()=>(o.start-f)/(y-f)*100,[o.start,f,y]),R=a.useMemo(()=>(o.end-f)/(y-f)*100,[o.end,f,y]),P=a.useMemo(()=>e.vertical?{paddingTop:0,height:"100%"}:{},[e.vertical]),z=a.useMemo(()=>e.vertical?{marginTop:"0.5rem",marginBottom:"0.5rem"}:{marginLeft:"0.5rem",marginRight:"0.5rem"},[e.vertical]),G=Y.useLocalization(),I=a.useCallback(t=>{if(!T.current)return;const p=T.current.getBoundingClientRect(),b=e.vertical?p.bottom-t.clientY:u==="rtl"?p.right-t.clientX:t.clientX-p.left,E=e.vertical?p.height:p.width,X=b/E;return f+X*(y-f)},[T,e.vertical,u,f,y,N.start,N.end,e.value&&e.value.start,e.value&&e.value.end]),V=a.useCallback(t=>t<=o.start?"start":t>=o.end?"end":2*t<o.end+o.start?"start":"end",[N.start,N.end,e.value&&e.value.start,e.value&&e.value.end]),q=a.useCallback(t=>{switch(t.keyCode){case l.Keys.right:t.preventDefault(),c({type:u==="rtl"?r.RANGE_ACTION.decrease:r.RANGE_ACTION.increase,key:"start",event:t});break;case l.Keys.up:t.preventDefault(),c({type:r.RANGE_ACTION.increase,key:"start",event:t});break;case l.Keys.left:t.preventDefault(),c({type:u==="rtl"?r.RANGE_ACTION.increase:r.RANGE_ACTION.decrease,key:"start",event:t});break;case l.Keys.down:t.preventDefault(),c({type:r.RANGE_ACTION.decrease,key:"start",event:t});break;case l.Keys.home:t.preventDefault(),c({type:r.RANGE_ACTION.min,key:"start",event:t});break;case l.Keys.end:t.preventDefault(),c({type:r.RANGE_ACTION.max,key:"start",event:t});break;case l.Keys.pageDown:t.preventDefault(),c({type:u==="rtl"?r.RANGE_ACTION.increaseLarge:r.RANGE_ACTION.decreaseLarge,key:"start",event:t});break;case l.Keys.pageUp:t.preventDefault(),c({type:u==="rtl"?r.RANGE_ACTION.decreaseLarge:r.RANGE_ACTION.increaseLarge,key:"start",event:t});break}},[c]),j=a.useCallback(t=>{switch(t.keyCode){case l.Keys.right:t.preventDefault(),c({type:u==="rtl"?r.RANGE_ACTION.decrease:r.RANGE_ACTION.increase,key:"end",event:t});break;case l.Keys.up:t.preventDefault(),c({type:r.RANGE_ACTION.increase,key:"end",event:t});break;case l.Keys.left:t.preventDefault(),c({type:u==="rtl"?r.RANGE_ACTION.increase:r.RANGE_ACTION.decrease,key:"end",event:t});break;case l.Keys.down:t.preventDefault(),c({type:r.RANGE_ACTION.decrease,key:"end",event:t});break;case l.Keys.home:t.preventDefault(),c({type:r.RANGE_ACTION.min,key:"end",event:t});break;case l.Keys.end:t.preventDefault(),c({type:r.RANGE_ACTION.max,key:"end",event:t});break;case l.Keys.pageDown:t.preventDefault(),c({type:u==="rtl"?r.RANGE_ACTION.increaseLarge:r.RANGE_ACTION.decreaseLarge,key:"end",event:t});break;case l.Keys.pageUp:t.preventDefault(),c({type:u==="rtl"?r.RANGE_ACTION.decreaseLarge:r.RANGE_ACTION.increaseLarge,key:"end",event:t});break}},[c,u]),H=a.useCallback(t=>{const p=I(t),b=V(p);_(b),b==="end"?D.current.focus():v.current.focus();const E=b==="end"?r.RANGE_ACTION.end:r.RANGE_ACTION.start;c({type:E,payload:p,event:t})},[e.vertical,f,y,c]),B=t=>{const p=I(t),b=O==="end"?r.RANGE_ACTION.end:r.RANGE_ACTION.start;c({type:b,payload:p,event:t})},U=t=>{const p=I(t),b=O==="end"?r.RANGE_ACTION.end:r.RANGE_ACTION.start;c({type:b,payload:p,event:t}),_("")};return l.useDraggable(T,{onPress:H,onDrag:B,onRelease:U},{autoScroll:!1}),a.createElement("div",{id:e.id,style:e.style,ref:m,dir:u,className:l.classNames("k-slider",{"k-rtl":u==="rtl","k-disabled":e.disabled,"k-slider-vertical":e.vertical,"k-slider-horizontal":!e.vertical},e.className)},a.createElement("div",{ref:T,className:"k-slider-track-wrap",style:{flexGrow:1,position:"relative",touchAction:"none",...z}},e.children&&a.createElement("ul",{className:"k-reset k-slider-items",style:{...P}},a.Children.map(e.children,(t,p)=>t&&a.cloneElement(t,{position:100*(t.props.position-e.min)/(e.max-e.min),vertical:e.vertical,firstTick:p===0,lastTick:p===a.Children.count(e.children)-1},t.props.children))),a.createElement("div",{ref:L,className:"k-slider-track",style:e.vertical?{bottom:0,height:"100%"}:{[u==="rtl"?"right":"left"]:0,width:"100%"}},A!==null&&R!==null&&a.createElement("div",{"data-selection":!0,ref:g,title:`${o.start} - ${o.end}`,className:"k-slider-selection",style:e.vertical?{height:R-A+"%",bottom:A+"%"}:{[u==="rtl"?"right":"left"]:A+"%",width:R-A+"%"}}),a.createElement("span",{ref:v,role:"slider",tabIndex:l.getTabIndex(e.startTabIndex,e.disabled,void 0),"aria-valuemin":f,"aria-valuemax":Math.max(y,o.end),"aria-valuenow":o.start,"aria-disabled":e.disabled?"true":void 0,"aria-valuetext":`${o.start} - ${o.end}`,className:"k-draghandle k-draghandle-start",title:G.toLanguageString(h.sliderDragTitle,h.messages[h.sliderDragTitle]),style:e.vertical?{bottom:"calc("+A+"%)",zIndex:1}:u==="rtl"?{right:"calc("+A+"% - 13px)",zIndex:1}:{left:"calc("+A+"%)",zIndex:1},onKeyDown:q}),a.createElement("span",{ref:D,role:"slider",tabIndex:l.getTabIndex(e.endTabIndex,e.disabled,void 0),"aria-valuemin":Math.min(f,o.start),"aria-valuemax":y,"aria-valuenow":o.end,"aria-disabled":e.disabled?"true":void 0,"aria-valuetext":`${o.start} - ${o.end}`,className:"k-draghandle k-draghandle-end",title:G.toLanguageString(h.sliderDragTitle,h.messages[h.sliderDragTitle]),style:e.vertical?{bottom:"calc("+R+"%)",zIndex:1}:u==="rtl"?{right:"calc("+R+"% - 13px)",zIndex:1}:{left:"calc("+R+"%)",zIndex:1},onKeyDown:j}))))}),Z={value:(n,s,d)=>{if(n.value){const e=n.value.start,i=n.value.end,m=n.min,g=n.max;if(e>i||e>g||e<m||i>g||i<m||i<e)return new Error(`Invalid prop + ${s} supplied to ${d}.
|
|
9
9
|
The { start, end } value must be between the min & max value and { start, end } must be start < end.
|
|
10
|
-
`)}return null},defaultValue:(
|
|
10
|
+
`)}return null},defaultValue:(n,s,d)=>{if(n.defaultValue){const e=n.defaultValue.start,i=n.defaultValue.end,m=n.min,g=n.max;if(e>i||e>g||e<m||i>g||i<m||i<e)return new Error(`Invalid prop + ${s} supplied to ${d}.
|
|
11
11
|
The { start, end } value must be between the min & max value and { start, end } must be start < end.
|
|
12
|
-
`)}return null},onChange:C.func,step:C.number,min:(
|
|
13
|
-
${
|
|
14
|
-
`):e&&
|
|
15
|
-
${
|
|
16
|
-
`):null},max:(
|
|
17
|
-
${
|
|
18
|
-
`):e&&m<=
|
|
19
|
-
${
|
|
20
|
-
`):null},vertical:C.bool,disabled:C.bool,dir:C.oneOf(["ltr","rtl"])},
|
|
12
|
+
`)}return null},onChange:C.func,step:C.number,min:(n,s,d)=>{const e=n[s],i=n.min,m=n.max;return i===void 0?new Error(`Invalid prop + ${s} supplied to ${d}.
|
|
13
|
+
${s} value can not be undefined.
|
|
14
|
+
`):e&&i>=m?new Error(`Invalid prop + ${s} supplied to ${d}.
|
|
15
|
+
${s} value can not be equal to or bigger than the max value.
|
|
16
|
+
`):null},max:(n,s,d)=>{const e=n[s],i=n.min,m=n.max;return m===void 0?new Error(`Invalid prop + ${s} supplied to ${d}.
|
|
17
|
+
${s} value can not be undefined.
|
|
18
|
+
`):e&&m<=i?new Error(`Invalid prop + ${s} supplied to ${d}.
|
|
19
|
+
${s} value can not be equal to or smaller than the min value.
|
|
20
|
+
`):null},vertical:C.bool,disabled:C.bool,dir:C.oneOf(["ltr","rtl"])},k={step:1,largeStep:10,defaultValue:{start:0,end:0},vertical:!1,disabled:!1};x.displayName="KendoReactRangeSlider";x.propTypes=Z;exports.RangeSlider=x;exports.RangeSliderPropsContext=S;
|