@progress/kendo-react-inputs 7.2.4-develop.2 → 7.2.4-develop.4
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 +8 -0
- package/checkbox/Checkbox.mjs +214 -0
- package/colors/ColorContrastLabels.js +8 -0
- package/colors/ColorContrastLabels.mjs +24 -0
- package/colors/ColorContrastSvg.js +8 -0
- package/colors/ColorContrastSvg.mjs +52 -0
- package/colors/ColorGradient.js +8 -0
- package/colors/ColorGradient.mjs +293 -0
- package/colors/ColorInput.js +8 -0
- package/colors/ColorInput.mjs +122 -0
- package/colors/ColorPalette.js +8 -0
- package/colors/ColorPalette.mjs +191 -0
- package/colors/ColorPicker.js +8 -0
- package/colors/ColorPicker.mjs +253 -0
- package/colors/FlatColorPicker.js +8 -0
- package/colors/FlatColorPicker.mjs +216 -0
- package/colors/HexInput.js +8 -0
- package/colors/HexInput.mjs +39 -0
- package/colors/Picker.js +8 -0
- package/colors/Picker.mjs +42 -0
- package/colors/models/palette-presets.js +8 -0
- package/colors/models/palette-presets.mjs +61 -0
- package/colors/utils/color-cache.js +8 -0
- package/colors/utils/color-cache.mjs +51 -0
- package/colors/utils/color-palette.service.js +8 -0
- package/colors/utils/color-palette.service.mjs +50 -0
- package/colors/utils/color-parser.js +8 -0
- package/colors/utils/color-parser.mjs +61 -0
- package/colors/utils/misc.js +8 -0
- package/colors/utils/misc.mjs +13 -0
- package/colors/utils/svg-calc.js +8 -0
- package/colors/utils/svg-calc.mjs +36 -0
- package/dist/cdn/js/kendo-react-inputs.js +8 -21
- package/index.d.mts +4275 -5
- package/index.d.ts +4275 -75
- package/index.js +8 -21
- package/index.mjs +97 -5042
- package/input/Input.js +8 -0
- package/input/Input.mjs +185 -0
- package/input/InputClearValue.js +8 -0
- package/input/InputClearValue.mjs +24 -0
- package/input/InputPrefix.js +8 -0
- package/input/InputPrefix.mjs +24 -0
- package/input/InputSeparator.js +8 -0
- package/input/InputSeparator.mjs +24 -0
- package/input/InputSuffix.js +8 -0
- package/input/InputSuffix.mjs +24 -0
- package/input/InputValidationIcon.js +8 -0
- package/input/InputValidationIcon.mjs +15 -0
- package/maskedtextbox/MaskedTextBox.js +8 -0
- package/maskedtextbox/MaskedTextBox.mjs +322 -0
- package/maskedtextbox/masking.service.js +8 -0
- package/maskedtextbox/masking.service.mjs +121 -0
- package/maskedtextbox/parsing/combinators.js +8 -0
- package/maskedtextbox/parsing/combinators.mjs +20 -0
- package/maskedtextbox/parsing/parsers.js +8 -0
- package/maskedtextbox/parsing/parsers.mjs +80 -0
- package/maskedtextbox/parsing/result.js +8 -0
- package/maskedtextbox/parsing/result.mjs +35 -0
- package/maskedtextbox/parsing/stream.js +8 -0
- package/maskedtextbox/parsing/stream.mjs +41 -0
- package/maskedtextbox/utils.js +8 -0
- package/maskedtextbox/utils.mjs +43 -0
- package/messages/index.js +8 -0
- package/messages/index.mjs +77 -0
- package/numerictextbox/NumericTextBox.js +8 -0
- package/numerictextbox/NumericTextBox.mjs +415 -0
- package/numerictextbox/utils/index.js +8 -0
- package/numerictextbox/utils/index.mjs +218 -0
- package/package-metadata.js +8 -0
- package/package-metadata.mjs +19 -0
- package/package.json +8 -8
- package/radiobutton/RadioButton.js +8 -0
- package/radiobutton/RadioButton.mjs +138 -0
- package/radiobutton/RadioGroup.js +8 -0
- package/radiobutton/RadioGroup.mjs +135 -0
- package/range-slider/RangeSlider.js +20 -0
- package/range-slider/RangeSlider.mjs +337 -0
- package/range-slider/range-raducer.js +8 -0
- package/range-slider/range-raducer.mjs +90 -0
- package/rating/Rating.js +12 -0
- package/rating/Rating.mjs +323 -0
- package/rating/RatingItem.js +8 -0
- package/rating/RatingItem.mjs +144 -0
- package/rating/rating-reducer.js +8 -0
- package/rating/rating-reducer.mjs +34 -0
- package/rating/utils/index.js +8 -0
- package/rating/utils/index.mjs +28 -0
- package/signature/Signature.js +8 -0
- package/signature/Signature.mjs +335 -0
- package/signature/utils/index.js +8 -0
- package/signature/utils/index.mjs +17 -0
- package/slider/Slider.js +8 -0
- package/slider/Slider.mjs +223 -0
- package/slider/SliderLabel.js +8 -0
- package/slider/SliderLabel.mjs +39 -0
- package/switch/Switch.js +8 -0
- package/switch/Switch.mjs +228 -0
- package/textarea/TextArea.js +8 -0
- package/textarea/TextArea.mjs +196 -0
- package/textbox/Textbox.js +8 -0
- package/textbox/Textbox.mjs +125 -0
- package/checkbox/Checkbox.d.ts +0 -36
- package/checkbox/interfaces/CheckboxBlurEvent.d.ts +0 -11
- package/checkbox/interfaces/CheckboxChangeEvent.d.ts +0 -15
- package/checkbox/interfaces/CheckboxFocusEvent.d.ts +0 -11
- package/checkbox/interfaces/CheckboxProps.d.ts +0 -126
- package/colors/ColorContrastLabels.d.ts +0 -19
- package/colors/ColorContrastSvg.d.ts +0 -22
- package/colors/ColorGradient.d.ts +0 -191
- package/colors/ColorInput.d.ts +0 -34
- package/colors/ColorPalette.d.ts +0 -127
- package/colors/ColorPicker.d.ts +0 -34
- package/colors/FlatColorPicker.d.ts +0 -139
- package/colors/HexInput.d.ts +0 -33
- package/colors/Picker.d.ts +0 -10
- package/colors/interfaces/ColorGradientChangeEvent.d.ts +0 -15
- package/colors/interfaces/ColorGradientProps.d.ts +0 -101
- package/colors/interfaces/ColorPaletteChangeEvent.d.ts +0 -19
- package/colors/interfaces/ColorPaletteProps.d.ts +0 -87
- package/colors/interfaces/ColorPickerActiveColorClick.d.ts +0 -21
- package/colors/interfaces/ColorPickerBlurEvent.d.ts +0 -17
- package/colors/interfaces/ColorPickerChangeEvent.d.ts +0 -21
- package/colors/interfaces/ColorPickerFocusEvent.d.ts +0 -17
- package/colors/interfaces/ColorPickerGradientSettings.d.ts +0 -22
- package/colors/interfaces/ColorPickerPaletteSettings.d.ts +0 -36
- package/colors/interfaces/ColorPickerPopupSettings.d.ts +0 -18
- package/colors/interfaces/ColorPickerProps.d.ts +0 -165
- package/colors/interfaces/ColorPickerView.d.ts +0 -14
- package/colors/interfaces/PickerPopupSettings.d.ts +0 -22
- package/colors/interfaces/PickerProps.d.ts +0 -46
- package/colors/models/hsva.d.ts +0 -13
- package/colors/models/output-format.d.ts +0 -8
- package/colors/models/palette-presets.d.ts +0 -57
- package/colors/models/rgb.d.ts +0 -12
- package/colors/models/rgba.d.ts +0 -13
- package/colors/models/table-cell.d.ts +0 -11
- package/colors/models/tile-size.d.ts +0 -15
- package/colors/utils/color-cache.d.ts +0 -34
- package/colors/utils/color-palette.service.d.ts +0 -16
- package/colors/utils/color-parser.d.ts +0 -69
- package/colors/utils/misc.d.ts +0 -19
- package/colors/utils/svg-calc.d.ts +0 -66
- package/input/Input.d.ts +0 -171
- package/input/InputClearValue.d.ts +0 -19
- package/input/InputPrefix.d.ts +0 -29
- package/input/InputSeparator.d.ts +0 -29
- package/input/InputSuffix.d.ts +0 -29
- package/input/InputValidationIcon.d.ts +0 -18
- package/input/interfaces/InputChangeEvent.d.ts +0 -15
- package/interfaces/Direction.d.ts +0 -5
- package/interfaces/ToggleBaseProps.d.ts +0 -12
- package/maskedtextbox/MaskedTextBox.d.ts +0 -238
- package/maskedtextbox/MaskedTextBoxProps.d.ts +0 -200
- package/maskedtextbox/masking.service.d.ts +0 -45
- package/maskedtextbox/parsing/combinators.d.ts +0 -13
- package/maskedtextbox/parsing/parsers.d.ts +0 -51
- package/maskedtextbox/parsing/result.d.ts +0 -27
- package/maskedtextbox/parsing/stream.d.ts +0 -26
- package/maskedtextbox/utils.d.ts +0 -20
- package/messages/index.d.ts +0 -169
- package/numerictextbox/NumericTextBox.d.ts +0 -18
- package/numerictextbox/interfaces/NumericTextBoxBlurEvent.d.ts +0 -11
- package/numerictextbox/interfaces/NumericTextBoxChangeEvent.d.ts +0 -15
- package/numerictextbox/interfaces/NumericTextBoxFocusEvent.d.ts +0 -11
- package/numerictextbox/interfaces/NumericTextBoxHandle.d.ts +0 -43
- package/numerictextbox/interfaces/NumericTextBoxProps.d.ts +0 -188
- package/numerictextbox/interfaces/NumericTextBoxState.d.ts +0 -19
- package/numerictextbox/utils/index.d.ts +0 -123
- package/package-metadata.d.ts +0 -9
- package/radiobutton/RadioButton.d.ts +0 -27
- package/radiobutton/RadioGroup.d.ts +0 -27
- package/radiobutton/interfaces/RadioButtonBlurEvent.d.ts +0 -11
- package/radiobutton/interfaces/RadioButtonChangeEvent.d.ts +0 -15
- package/radiobutton/interfaces/RadioButtonFocusEvent.d.ts +0 -11
- package/radiobutton/interfaces/RadioButtonProps.d.ts +0 -101
- package/radiobutton/interfaces/RadioGroupChangeEvent.d.ts +0 -15
- package/radiobutton/interfaces/RadioGroupFocusEvent.d.ts +0 -11
- package/radiobutton/interfaces/RadioGroupProps.d.ts +0 -90
- package/range-slider/RangeSlider.d.ts +0 -142
- package/range-slider/range-raducer.d.ts +0 -40
- package/rating/Rating.d.ts +0 -170
- package/rating/RatingItem.d.ts +0 -108
- package/rating/models/index.d.ts +0 -88
- package/rating/rating-reducer.d.ts +0 -36
- package/rating/utils/index.d.ts +0 -28
- package/signature/Signature.d.ts +0 -18
- package/signature/interfaces/SignatureBlurEvent.d.ts +0 -11
- package/signature/interfaces/SignatureChangeEvent.d.ts +0 -15
- package/signature/interfaces/SignatureCloseEvent.d.ts +0 -11
- package/signature/interfaces/SignatureFocusEvent.d.ts +0 -11
- package/signature/interfaces/SignatureHandle.d.ts +0 -46
- package/signature/interfaces/SignatureOpenEvent.d.ts +0 -11
- package/signature/interfaces/SignatureProps.d.ts +0 -198
- package/signature/interfaces/index.d.ts +0 -11
- package/signature/utils/index.d.ts +0 -8
- package/slider/Slider.d.ts +0 -197
- package/slider/SliderLabel.d.ts +0 -38
- package/switch/Switch.d.ts +0 -294
- package/textarea/TextArea.d.ts +0 -40
- package/textarea/interfaces/TextAreaBlurEvent.d.ts +0 -11
- package/textarea/interfaces/TextAreaChangeEvent.d.ts +0 -15
- package/textarea/interfaces/TextAreaFocusEvent.d.ts +0 -11
- package/textarea/interfaces/TextAreaProps.d.ts +0 -140
- package/textbox/Textbox.d.ts +0 -80
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
const v = 11111111111111e-7, ie = 0.31111111111111117, ae = 1, Q = 1, Y = 0, V = /\d/, w = 15, he = () => ({
|
|
10
|
+
eventValue: null,
|
|
11
|
+
prevLooseValue: "",
|
|
12
|
+
currentLooseValue: "",
|
|
13
|
+
focused: !1,
|
|
14
|
+
selectionStart: void 0,
|
|
15
|
+
selectionEnd: void 0,
|
|
16
|
+
decimalSelect: !1,
|
|
17
|
+
valueIsCorrected: !1,
|
|
18
|
+
valueIsOutOfRange: !1
|
|
19
|
+
}), Ie = (t, n) => t !== void 0 ? t : n, p = (t, n, r) => t === null && t === void 0 ? "" : typeof t == "string" ? t : r.formatNumber(t, n), H = (t) => (String(t).split(".")[1] || "").length, ee = (t, n) => Math.max(H(t), H(n)), de = (t) => Math.min(t, w), ne = (t, n) => {
|
|
20
|
+
const r = de(n);
|
|
21
|
+
return parseFloat(t.toFixed(r));
|
|
22
|
+
}, Ne = (t, n, r, e, u, s, a) => {
|
|
23
|
+
const o = ee(t || 0, r || 0), c = te(ne((t || 0) + (r || 0), o), e, u);
|
|
24
|
+
n.eventValue = c, n.currentLooseValue = p(c, s, a), n.selectionStart = n.selectionEnd = R(n.currentLooseValue, V);
|
|
25
|
+
}, Ee = (t, n, r, e, u, s, a) => {
|
|
26
|
+
const o = ee(t || 0, r || 0), c = te(ne((t || 0) - (r || 0), o), e, u);
|
|
27
|
+
n.eventValue = c, n.currentLooseValue = p(c, s, a), n.selectionStart = n.selectionEnd = R(n.currentLooseValue, V);
|
|
28
|
+
}, te = (t, n, r) => t == null ? t : !(t > 1 || t < 1 || t === 1) || r !== void 0 && n !== void 0 && r < n ? null : (r !== void 0 && t > r && (t = r), n !== void 0 && t < n && (t = n), t), ge = (t, n) => {
|
|
29
|
+
const r = n.findIndex(([u, s]) => !!s && t.indexOf(s) === t.length - s.length);
|
|
30
|
+
if (r === -1)
|
|
31
|
+
return -1;
|
|
32
|
+
const e = n[r][1];
|
|
33
|
+
return t.length - e.length;
|
|
34
|
+
}, fe = (t, n) => {
|
|
35
|
+
const r = n.findIndex(([u, s]) => !!u && t.indexOf(u) === 0);
|
|
36
|
+
return r === -1 ? -1 : n[r][0].length;
|
|
37
|
+
}, Ve = (t, n, r) => {
|
|
38
|
+
const e = ge(t, n);
|
|
39
|
+
if (e !== -1 && r.selectionStart > e) {
|
|
40
|
+
r.selectionStart = r.selectionEnd = e;
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
r.selectionStart > t.length && (r.selectionStart = r.selectionEnd = t.length);
|
|
44
|
+
const u = fe(t, n);
|
|
45
|
+
u !== -1 && r.selectionStart < u && (r.selectionStart = r.selectionEnd = u), r.selectionStart === -1 && (r.selectionStart = r.selectionEnd = 0);
|
|
46
|
+
}, L = (t, n, r, e) => {
|
|
47
|
+
t.selectionStart = t.selectionEnd = n, Ve(r, e, t);
|
|
48
|
+
}, A = (t, n, r, e) => {
|
|
49
|
+
t.eventValue = e.parseNumber(t.prevLooseValue, n), t.currentLooseValue = t.prevLooseValue, t.valueIsCorrected = !0, L(t, t.selectionStart, t.currentLooseValue, r);
|
|
50
|
+
}, me = (t, n) => {
|
|
51
|
+
const r = String(t.currentLooseValue), e = String(t.prevLooseValue);
|
|
52
|
+
return r.split(n.minusSign).length !== e.split(n.minusSign).length && r.length === e.length + n.minusSign.length;
|
|
53
|
+
}, pe = (t, n) => {
|
|
54
|
+
const r = String(t.currentLooseValue), e = String(t.prevLooseValue);
|
|
55
|
+
return r.indexOf(n.minusSign) === -1 && e.indexOf(n.minusSign) !== -1;
|
|
56
|
+
}, xe = (t, n) => String(t.currentLooseValue).split(n.decimal).length > 2, Le = (t, n) => {
|
|
57
|
+
const r = n.formatNumber(v, t), e = n.formatNumber(-v, t), u = n.formatNumber(Y, t), s = n.formatNumber(Q, t), a = P(r), o = P(e), c = P(u), i = P(s), N = M(r), E = M(e), x = M(u), b = M(s);
|
|
58
|
+
return {
|
|
59
|
+
positiveInfo: [a, N],
|
|
60
|
+
negativeInfo: [o, E],
|
|
61
|
+
zeroInfo: [c, x],
|
|
62
|
+
oneInfo: [i, b]
|
|
63
|
+
};
|
|
64
|
+
}, be = (t, n) => {
|
|
65
|
+
const r = n.formatNumber(v, t), e = n.formatNumber(-v, t), u = n.formatNumber(Y, t), s = n.formatNumber(Q, t), a = n.numberSymbols(), o = new RegExp(`[\\d\\${a.decimal}${a.group}]`, "g");
|
|
66
|
+
return [r, e, u, s].map((i) => i.replace(o, "")).join("").split("").filter((i, N, E) => E.indexOf(i) === N).join("");
|
|
67
|
+
}, _ = (t, n) => {
|
|
68
|
+
const r = t.indexOf(n.decimal);
|
|
69
|
+
return r > -1 ? r : R(t, V);
|
|
70
|
+
}, B = (t) => t.split("").reverse().join(""), R = (t, n) => t.length - B(t).search(n), P = (t) => t.split(t[t.search(V)])[0], M = (t) => {
|
|
71
|
+
const n = B(t);
|
|
72
|
+
return B(n.split(n[n.search(V)])[0]);
|
|
73
|
+
}, T = (t, n) => t.search(n), J = (t, n) => {
|
|
74
|
+
const r = t.indexOf(n);
|
|
75
|
+
return r > -1 ? t.length - r - 1 : 0;
|
|
76
|
+
}, K = (t, n, r, e, u) => {
|
|
77
|
+
const s = t.replace(u, "")[0] === "0", a = n.replace(u, "")[0] === "0";
|
|
78
|
+
if (s && !a)
|
|
79
|
+
return r - 1;
|
|
80
|
+
if (a && e)
|
|
81
|
+
return r + 1;
|
|
82
|
+
let o = 0;
|
|
83
|
+
for (let i = 0; i < r; i++)
|
|
84
|
+
V.test(t.charAt(i)) && o++;
|
|
85
|
+
let c = 0;
|
|
86
|
+
for (; o > 0 && n.length > c; )
|
|
87
|
+
V.test(n.charAt(c)) && o--, c++;
|
|
88
|
+
return c;
|
|
89
|
+
}, Oe = (t, n, r) => {
|
|
90
|
+
const e = { ...t }, { prevLooseValue: u } = e, s = r.numberSymbols(), a = be(n, r), o = String(e.currentLooseValue), c = String(u), i = new RegExp(`[^\\d\\${s.decimal}]`, "g"), N = new RegExp(`[^\\d\\${s.decimal}\\${s.group}]`, "g"), E = new RegExp(`[\\d\\${s.decimal}\\${s.group}]`), x = o.replace(i, ""), b = T(o, V), O = b === -1 ? -1 : R(o, V), re = o.indexOf(s.decimal), $ = (o.substring(0, b) + o.substring(b, O).replace(N, "") + o.substring(O, o.length)).split("").filter((m) => a.indexOf(m) !== -1 || m.search(E) !== -1).join(""), G = r.formatNumber(ie, n).replace(i, ""), U = G.indexOf(s.decimal), I = U > -1 ? G.length - U - 1 : 0, j = r.formatNumber(ae, n).replace(i, ""), S = j.indexOf(s.decimal), D = S > -1 ? j.length - S - 1 : 0, {
|
|
91
|
+
positiveInfo: oe,
|
|
92
|
+
negativeInfo: se,
|
|
93
|
+
zeroInfo: ue,
|
|
94
|
+
oneInfo: le
|
|
95
|
+
} = Le(n, r), g = [oe, se, ue, le], ce = g.findIndex((m) => m.findIndex((h) => !!h) !== -1) !== 1, C = o.length > 0 && o.length < c.length, X = typeof n == "string" && n[0] === "p" && o && o.indexOf(s.percentSign) === -1;
|
|
96
|
+
if (!e.isPaste) {
|
|
97
|
+
if (o === "")
|
|
98
|
+
return e.eventValue = null, e.currentLooseValue = "", e;
|
|
99
|
+
if (e.currentLooseValue === s.minusSign && r.formatNumber(-0, n) !== c)
|
|
100
|
+
return e.eventValue = -0, e.currentLooseValue = p(e.eventValue, n, r), L(
|
|
101
|
+
e,
|
|
102
|
+
_(e.currentLooseValue, s),
|
|
103
|
+
e.currentLooseValue,
|
|
104
|
+
g
|
|
105
|
+
), e;
|
|
106
|
+
if (e.currentLooseValue === s.decimal) {
|
|
107
|
+
e.eventValue = 0;
|
|
108
|
+
const f = p(e.eventValue, n, r);
|
|
109
|
+
if (D === 0 && I > 0) {
|
|
110
|
+
const l = R(f, V);
|
|
111
|
+
e.currentLooseValue = f.substring(0, l) + s.decimal + f.substring(l);
|
|
112
|
+
} else
|
|
113
|
+
e.currentLooseValue = f;
|
|
114
|
+
return L(
|
|
115
|
+
e,
|
|
116
|
+
_(e.currentLooseValue, s) + 1,
|
|
117
|
+
e.currentLooseValue,
|
|
118
|
+
g
|
|
119
|
+
), e;
|
|
120
|
+
}
|
|
121
|
+
if (me(e, s)) {
|
|
122
|
+
const f = r.parseNumber(u, n);
|
|
123
|
+
e.eventValue = -(f !== null ? f : 0), e.currentLooseValue = p(e.eventValue, n, r);
|
|
124
|
+
const l = T(e.currentLooseValue, V), d = T(c, V);
|
|
125
|
+
return L(
|
|
126
|
+
e,
|
|
127
|
+
e.selectionEnd - 1 + (l - d),
|
|
128
|
+
e.currentLooseValue,
|
|
129
|
+
g
|
|
130
|
+
), e;
|
|
131
|
+
}
|
|
132
|
+
if (pe(e, s))
|
|
133
|
+
return e.eventValue = r.parseNumber(e.currentLooseValue, n), L(
|
|
134
|
+
e,
|
|
135
|
+
e.selectionStart,
|
|
136
|
+
e.currentLooseValue,
|
|
137
|
+
g
|
|
138
|
+
), e;
|
|
139
|
+
if (xe(e, s))
|
|
140
|
+
return A(e, n, g, r), e;
|
|
141
|
+
if (X)
|
|
142
|
+
return e.eventValue = r.parseNumber(o, n) / 100, e.currentLooseValue = p(e.eventValue, n, r), e;
|
|
143
|
+
if (String(e.currentLooseValue).replace(/[^\d]/g, "").length > w || x !== o && o && ce && g.findIndex(([l, d]) => {
|
|
144
|
+
const F = o.indexOf(l), z = o.indexOf(d), Z = F === 0, W = z === o.length - d.length, k = F + l.length !== b && b !== -1 && o[F + l.length] !== s.decimal, q = z !== O && O !== -1 && o[z - 1] !== s.decimal;
|
|
145
|
+
return l && d ? k || q ? !1 : Z && W : l ? k ? !1 : Z : d ? q ? !1 : W : !1;
|
|
146
|
+
}) === -1)
|
|
147
|
+
return A(e, n, g, r), e;
|
|
148
|
+
if (x[x.length - 1] === s.decimal && I > 0)
|
|
149
|
+
return e.eventValue = r.parseNumber(o, n), e.currentLooseValue = $, e;
|
|
150
|
+
if (e.currentLooseValue && u && (a + s.decimal + s.group).split("").findIndex((l) => o.split("").filter((d) => d === l).length < c.split("").filter((d) => d === l).length && o.length + 1 === c.length ? !(l === s.decimal && J(c.replace(i, ""), s.decimal) === 0) : !1) > -1)
|
|
151
|
+
return e.eventValue = r.parseNumber(t.prevLooseValue, n), e.currentLooseValue = t.prevLooseValue, e;
|
|
152
|
+
const h = J(x, s.decimal), y = x[x.length - 1] === "0";
|
|
153
|
+
if (C && y && h < D)
|
|
154
|
+
return e.eventValue = r.parseNumber(e.currentLooseValue, n), e.currentLooseValue = p(e.eventValue, n, r), e;
|
|
155
|
+
if (h > 0) {
|
|
156
|
+
const f = o.substring(0, re);
|
|
157
|
+
if (y && (!f || c.indexOf(f) !== 0)) {
|
|
158
|
+
e.eventValue = r.parseNumber(e.currentLooseValue, n);
|
|
159
|
+
const l = p(e.eventValue, n, r);
|
|
160
|
+
return L(
|
|
161
|
+
e,
|
|
162
|
+
K(o, l, e.selectionEnd, C, i),
|
|
163
|
+
l,
|
|
164
|
+
g
|
|
165
|
+
), e.currentLooseValue = l, e;
|
|
166
|
+
}
|
|
167
|
+
if (h > I) {
|
|
168
|
+
const l = o.indexOf(s.decimal), d = o.substring(0, l) + o.substring(l, l + 1 + I) + o.substring(O, String(e.currentLooseValue).length);
|
|
169
|
+
return e.eventValue = r.parseNumber(d, n), e.currentLooseValue = d, L(e, e.selectionStart, d, g), e;
|
|
170
|
+
}
|
|
171
|
+
if (D !== I && h <= I && y)
|
|
172
|
+
return e.eventValue = r.parseNumber(e.currentLooseValue, n), e.currentLooseValue = $, e;
|
|
173
|
+
if (h < D)
|
|
174
|
+
return e.eventValue = r.parseNumber(e.currentLooseValue, n), e.currentLooseValue = p(e.eventValue, n, r), e;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
if (e.eventValue = r.parseNumber(e.currentLooseValue, n), X && (e.eventValue = e.eventValue / 100), typeof e.eventValue == "number") {
|
|
178
|
+
const m = p(e.eventValue, n, r);
|
|
179
|
+
o.length === 1 ? L(e, _(m, s), m, g) : L(
|
|
180
|
+
e,
|
|
181
|
+
K(o, m, e.selectionEnd, C, i),
|
|
182
|
+
m,
|
|
183
|
+
g
|
|
184
|
+
), e.currentLooseValue = m;
|
|
185
|
+
} else
|
|
186
|
+
e.currentLooseValue = p(r.parseNumber(x), n, r);
|
|
187
|
+
return e;
|
|
188
|
+
};
|
|
189
|
+
export {
|
|
190
|
+
K as changeBasedSelection,
|
|
191
|
+
Ee as decreaseValue,
|
|
192
|
+
p as formatValue,
|
|
193
|
+
H as fractionLength,
|
|
194
|
+
J as getDecimalCount,
|
|
195
|
+
T as getFirstNumberIndex,
|
|
196
|
+
Le as getFormatPrefixSufix,
|
|
197
|
+
be as getFormatSymbols,
|
|
198
|
+
_ as getInitialPosition,
|
|
199
|
+
he as getInitialState,
|
|
200
|
+
R as getLastNumberIndex,
|
|
201
|
+
ge as getMaxCursorPosition,
|
|
202
|
+
fe as getMinCursorPosition,
|
|
203
|
+
P as getPrefix,
|
|
204
|
+
Ie as getStateOrPropsValue,
|
|
205
|
+
M as getSuffix,
|
|
206
|
+
Ne as increaseValue,
|
|
207
|
+
xe as isDecimalDuplicated,
|
|
208
|
+
me as isMinusSymbolAdded,
|
|
209
|
+
pe as isMinusSymbolRemoved,
|
|
210
|
+
de as limitPrecision,
|
|
211
|
+
Ve as rangeSelection,
|
|
212
|
+
te as rangeValue,
|
|
213
|
+
B as reverseString,
|
|
214
|
+
Oe as sanitizeNumber,
|
|
215
|
+
A as setInvalid,
|
|
216
|
+
L as setSelection,
|
|
217
|
+
ne as toFixedPrecision
|
|
218
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-react-inputs",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};exports.packageMetadata=e;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
const e = {
|
|
10
|
+
name: "@progress/kendo-react-inputs",
|
|
11
|
+
productName: "KendoReact",
|
|
12
|
+
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
13
|
+
publishDate: 1709714020,
|
|
14
|
+
version: "",
|
|
15
|
+
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
e as packageMetadata
|
|
19
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-inputs",
|
|
3
|
-
"version": "7.2.4-develop.
|
|
3
|
+
"version": "7.2.4-develop.4",
|
|
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.19.0",
|
|
26
26
|
"@progress/kendo-inputs-common": "^3.1.0",
|
|
27
27
|
"@progress/kendo-licensing": "^1.3.4",
|
|
28
|
-
"@progress/kendo-react-animation": "7.2.4-develop.
|
|
29
|
-
"@progress/kendo-react-buttons": "7.2.4-develop.
|
|
30
|
-
"@progress/kendo-react-common": "7.2.4-develop.
|
|
31
|
-
"@progress/kendo-react-dialogs": "7.2.4-develop.
|
|
32
|
-
"@progress/kendo-react-intl": "7.2.4-develop.
|
|
33
|
-
"@progress/kendo-react-labels": "7.2.4-develop.
|
|
34
|
-
"@progress/kendo-react-popup": "7.2.4-develop.
|
|
28
|
+
"@progress/kendo-react-animation": "7.2.4-develop.4",
|
|
29
|
+
"@progress/kendo-react-buttons": "7.2.4-develop.4",
|
|
30
|
+
"@progress/kendo-react-common": "7.2.4-develop.4",
|
|
31
|
+
"@progress/kendo-react-dialogs": "7.2.4-develop.4",
|
|
32
|
+
"@progress/kendo-react-intl": "7.2.4-develop.4",
|
|
33
|
+
"@progress/kendo-react-labels": "7.2.4-develop.4",
|
|
34
|
+
"@progress/kendo-react-popup": "7.2.4-develop.4",
|
|
35
35
|
"@progress/kendo-svg-icons": "^2.1.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"
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("react"),e=require("prop-types"),a=require("@progress/kendo-react-common"),_=require("../package-metadata.js");function w(n){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const l in n)if(l!=="default"){const c=Object.getOwnPropertyDescriptor(n,l);Object.defineProperty(s,l,c.get?c:{enumerable:!0,get:()=>n[l]})}}return s.default=n,Object.freeze(s)}const t=w(D),R=a.createPropsContext(),d=t.forwardRef((n,s)=>{a.validatePackage(_.packageMetadata);const l=a.usePropsContext(R,n),{ariaDescribedBy:c,checked:E,children:k,className:x,disabled:o,id:h,size:m,label:b,labelPlacement:F,name:I,style:N,tabIndex:O,value:p,valid:j,onChange:v,onFocus:f,onBlur:g,...M}=l,i=t.useRef(null),y=t.useCallback(()=>{i.current&&i.current.focus()},[]),u=t.useCallback(()=>({element:i.current,focus:y}),[y]);t.useImperativeHandle(s,u);const C=a.useId(),T=t.useCallback(r=>{a.dispatchEvent(v,r,u(),{value:p})},[v,p,o]),z=t.useCallback(r=>{f&&!o&&a.dispatchEvent(f,r,u(),void 0)},[f,o]),S=t.useCallback(r=>{g&&!o&&a.dispatchEvent(g,r,u(),void 0)},[g,o]),q={type:"radio",id:h||C,name:I,className:a.classNames("k-radio",{[`k-radio-${a.kendoThemeMaps.sizeMap[m]||m}`]:m,"k-invalid":j===!1},x),ref:i,disabled:o,tabIndex:a.getTabIndex(O,o),checked:E,style:N,"aria-describedby":c,value:p,onChange:T,onFocus:z,onBlur:S,...M},P=t.createElement(t.Fragment,null,b!==void 0?t.createElement("label",{className:"k-radio-label",htmlFor:h||C,style:{userSelect:"none"},"aria-label":b},b):null),B=t.createElement("input",{...q});return F==="before"?t.createElement(t.Fragment,null,P,B,k):t.createElement(t.Fragment,null,B,P,k)});d.propTypes={ariaDescribedBy:e.string,checked:e.bool,className:e.string,disabled:e.bool,id:e.string,size:e.oneOf([null,"small","medium","large"]),label:e.string,labelPlacement:e.string,name:e.string,style:e.object,tabIndex:e.number,value:e.any,valid:e.bool,onChange:e.func,onFocus:e.func,onBlur:e.func};const H={size:"medium"};d.displayName="KendoRadioButton";d.defaultProps=H;exports.RadioButton=d;exports.RadioButtonPropsContext=R;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as e from "react";
|
|
10
|
+
import a from "prop-types";
|
|
11
|
+
import { createPropsContext as w, validatePackage as K, usePropsContext as L, useId as O, dispatchEvent as u, classNames as S, kendoThemeMaps as $, getTabIndex as q } from "@progress/kendo-react-common";
|
|
12
|
+
import { packageMetadata as A } from "../package-metadata.mjs";
|
|
13
|
+
const G = w(), m = e.forwardRef((C, y) => {
|
|
14
|
+
K(A);
|
|
15
|
+
const B = L(G, C), {
|
|
16
|
+
ariaDescribedBy: P,
|
|
17
|
+
checked: x,
|
|
18
|
+
children: b,
|
|
19
|
+
className: F,
|
|
20
|
+
disabled: n,
|
|
21
|
+
id: p,
|
|
22
|
+
size: s,
|
|
23
|
+
label: r,
|
|
24
|
+
labelPlacement: I,
|
|
25
|
+
name: E,
|
|
26
|
+
style: R,
|
|
27
|
+
tabIndex: N,
|
|
28
|
+
value: c,
|
|
29
|
+
valid: z,
|
|
30
|
+
onChange: f,
|
|
31
|
+
onFocus: i,
|
|
32
|
+
onBlur: d,
|
|
33
|
+
...T
|
|
34
|
+
} = B, l = e.useRef(null), g = e.useCallback(
|
|
35
|
+
() => {
|
|
36
|
+
l.current && l.current.focus();
|
|
37
|
+
},
|
|
38
|
+
[]
|
|
39
|
+
), o = e.useCallback(
|
|
40
|
+
() => ({
|
|
41
|
+
element: l.current,
|
|
42
|
+
focus: g
|
|
43
|
+
}),
|
|
44
|
+
[g]
|
|
45
|
+
);
|
|
46
|
+
e.useImperativeHandle(y, o);
|
|
47
|
+
const h = O(), M = e.useCallback(
|
|
48
|
+
(t) => {
|
|
49
|
+
u(
|
|
50
|
+
f,
|
|
51
|
+
t,
|
|
52
|
+
o(),
|
|
53
|
+
{ value: c }
|
|
54
|
+
);
|
|
55
|
+
},
|
|
56
|
+
[f, c, n]
|
|
57
|
+
), D = e.useCallback(
|
|
58
|
+
(t) => {
|
|
59
|
+
i && !n && u(
|
|
60
|
+
i,
|
|
61
|
+
t,
|
|
62
|
+
o(),
|
|
63
|
+
void 0
|
|
64
|
+
);
|
|
65
|
+
},
|
|
66
|
+
[i, n]
|
|
67
|
+
), H = e.useCallback(
|
|
68
|
+
(t) => {
|
|
69
|
+
d && !n && u(
|
|
70
|
+
d,
|
|
71
|
+
t,
|
|
72
|
+
o(),
|
|
73
|
+
void 0
|
|
74
|
+
);
|
|
75
|
+
},
|
|
76
|
+
[d, n]
|
|
77
|
+
), j = {
|
|
78
|
+
type: "radio",
|
|
79
|
+
id: p || h,
|
|
80
|
+
name: E,
|
|
81
|
+
className: S(
|
|
82
|
+
"k-radio",
|
|
83
|
+
{
|
|
84
|
+
[`k-radio-${$.sizeMap[s] || s}`]: s,
|
|
85
|
+
"k-invalid": z === !1
|
|
86
|
+
},
|
|
87
|
+
F
|
|
88
|
+
),
|
|
89
|
+
ref: l,
|
|
90
|
+
disabled: n,
|
|
91
|
+
tabIndex: q(N, n),
|
|
92
|
+
checked: x,
|
|
93
|
+
style: R,
|
|
94
|
+
"aria-describedby": P,
|
|
95
|
+
value: c,
|
|
96
|
+
onChange: M,
|
|
97
|
+
onFocus: D,
|
|
98
|
+
onBlur: H,
|
|
99
|
+
...T
|
|
100
|
+
}, k = /* @__PURE__ */ e.createElement(e.Fragment, null, r !== void 0 ? /* @__PURE__ */ e.createElement(
|
|
101
|
+
"label",
|
|
102
|
+
{
|
|
103
|
+
className: "k-radio-label",
|
|
104
|
+
htmlFor: p || h,
|
|
105
|
+
style: { userSelect: "none" },
|
|
106
|
+
"aria-label": r
|
|
107
|
+
},
|
|
108
|
+
r
|
|
109
|
+
) : null), v = /* @__PURE__ */ e.createElement("input", { ...j });
|
|
110
|
+
return I === "before" ? /* @__PURE__ */ e.createElement(e.Fragment, null, k, v, b) : /* @__PURE__ */ e.createElement(e.Fragment, null, v, k, b);
|
|
111
|
+
});
|
|
112
|
+
m.propTypes = {
|
|
113
|
+
ariaDescribedBy: a.string,
|
|
114
|
+
checked: a.bool,
|
|
115
|
+
className: a.string,
|
|
116
|
+
disabled: a.bool,
|
|
117
|
+
id: a.string,
|
|
118
|
+
size: a.oneOf([null, "small", "medium", "large"]),
|
|
119
|
+
label: a.string,
|
|
120
|
+
labelPlacement: a.string,
|
|
121
|
+
name: a.string,
|
|
122
|
+
style: a.object,
|
|
123
|
+
tabIndex: a.number,
|
|
124
|
+
value: a.any,
|
|
125
|
+
valid: a.bool,
|
|
126
|
+
onChange: a.func,
|
|
127
|
+
onFocus: a.func,
|
|
128
|
+
onBlur: a.func
|
|
129
|
+
};
|
|
130
|
+
const J = {
|
|
131
|
+
size: "medium"
|
|
132
|
+
};
|
|
133
|
+
m.displayName = "KendoRadioButton";
|
|
134
|
+
m.defaultProps = J;
|
|
135
|
+
export {
|
|
136
|
+
m as RadioButton,
|
|
137
|
+
G as RadioButtonPropsContext
|
|
138
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("react"),e=require("prop-types"),K=require("./RadioButton.js"),s=require("@progress/kendo-react-common"),A=require("../package-metadata.js");function J(l){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const n in l)if(n!=="default"){const d=Object.getOwnPropertyDescriptor(l,n);Object.defineProperty(c,n,d.get?d:{enumerable:!0,get:()=>l[n]})}}return c.default=l,Object.freeze(c)}const t=J(L),E=s.createPropsContext(),u=t.forwardRef((l,c)=>{s.validatePackage(A.packageMetadata);const n=s.usePropsContext(E,l),{id:d,ariaLabelledBy:O,ariaDescribedBy:j,className:B,data:g,defaultValue:G,disabled:o,name:I,labelPlacement:F,layout:b,style:S,value:k,valid:q,item:x=N.item,onChange:m,onFocus:p}=n,i=t.useRef(null),C=t.useCallback(()=>{i.current&&s.focusFirstFocusableChild(i.current)},[]),f=t.useCallback(()=>({element:i.current,focus:C}),[C]);t.useImperativeHandle(c,f);const[D,v]=t.useState(G),h=k!==void 0,y=h?k:D,M=t.useCallback(a=>{let r=a.value;!h&&!o&&v(r),m&&!o&&s.dispatchEvent(m,a.syntheticEvent,f(),{value:r})},[v,m,o]),T=t.useCallback(a=>{p&&!o&&s.dispatchEvent(p,a.syntheticEvent,f(),void 0)},[p,o]),V=s.useId(),z=s.classNames("k-radio-list",{"k-list-horizontal":b==="horizontal","k-list-vertical":b==="vertical"||b===void 0},B),_=s.useRtl(i,n.dir),w=g&&g.map((a,r)=>{const P=y===a.value,H=y==null,R={...a,valid:q,checked:P,disabled:!!(a.disabled||o),labelPlacement:a.labelPlacement?a.labelPlacement:F,tabIndex:a.tabIndex?a.tabIndex:H&&r===0||P?0:-1,index:r,name:I||V,onChange:M,onFocus:T};return t.createElement(x,{className:s.classNames("k-radio-item",{"k-disabled":R.disabled||o}),key:r,role:"none"},t.createElement(K.RadioButton,{...R}))});return t.createElement("ul",{id:d,role:"radiogroup",className:z,ref:i,dir:_,style:S,"aria-labelledby":O,"aria-describedby":j},w)}),N={item:l=>t.createElement("li",{...l})};u.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};u.defaultProps=N;u.displayName="KendoRadioGroup";exports.RadioGroup=u;exports.RadioGroupPropsContext=E;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as t from "react";
|
|
10
|
+
import e from "prop-types";
|
|
11
|
+
import { RadioButton as q } from "./RadioButton.mjs";
|
|
12
|
+
import { createPropsContext as A, validatePackage as J, usePropsContext as Q, focusFirstFocusableChild as U, dispatchEvent as g, useId as W, classNames as P, useRtl as X } from "@progress/kendo-react-common";
|
|
13
|
+
import { packageMetadata as Y } from "../package-metadata.mjs";
|
|
14
|
+
const Z = A(), m = t.forwardRef((r, E) => {
|
|
15
|
+
J(Y);
|
|
16
|
+
const b = Q(Z, r), {
|
|
17
|
+
id: I,
|
|
18
|
+
ariaLabelledBy: N,
|
|
19
|
+
ariaDescribedBy: B,
|
|
20
|
+
className: F,
|
|
21
|
+
data: p,
|
|
22
|
+
defaultValue: x,
|
|
23
|
+
disabled: l,
|
|
24
|
+
name: G,
|
|
25
|
+
labelPlacement: V,
|
|
26
|
+
layout: n,
|
|
27
|
+
style: O,
|
|
28
|
+
value: f,
|
|
29
|
+
valid: j,
|
|
30
|
+
item: z = R.item,
|
|
31
|
+
onChange: c,
|
|
32
|
+
onFocus: i
|
|
33
|
+
} = b, o = t.useRef(null), y = t.useCallback(
|
|
34
|
+
() => {
|
|
35
|
+
o.current && U(o.current);
|
|
36
|
+
},
|
|
37
|
+
[]
|
|
38
|
+
), d = t.useCallback(
|
|
39
|
+
() => ({
|
|
40
|
+
element: o.current,
|
|
41
|
+
focus: y
|
|
42
|
+
}),
|
|
43
|
+
[y]
|
|
44
|
+
);
|
|
45
|
+
t.useImperativeHandle(E, d);
|
|
46
|
+
const [D, C] = t.useState(x), h = f !== void 0, u = h ? f : D, H = t.useCallback(
|
|
47
|
+
(a) => {
|
|
48
|
+
let s = a.value;
|
|
49
|
+
!h && !l && C(s), c && !l && g(
|
|
50
|
+
c,
|
|
51
|
+
a.syntheticEvent,
|
|
52
|
+
d(),
|
|
53
|
+
{ value: s }
|
|
54
|
+
);
|
|
55
|
+
},
|
|
56
|
+
[C, c, l]
|
|
57
|
+
), L = t.useCallback(
|
|
58
|
+
(a) => {
|
|
59
|
+
i && !l && g(
|
|
60
|
+
i,
|
|
61
|
+
a.syntheticEvent,
|
|
62
|
+
d(),
|
|
63
|
+
void 0
|
|
64
|
+
);
|
|
65
|
+
},
|
|
66
|
+
[i, l]
|
|
67
|
+
), S = W(), T = P(
|
|
68
|
+
"k-radio-list",
|
|
69
|
+
{
|
|
70
|
+
"k-list-horizontal": n === "horizontal",
|
|
71
|
+
"k-list-vertical": n === "vertical" || n === void 0
|
|
72
|
+
},
|
|
73
|
+
F
|
|
74
|
+
), w = X(o, b.dir), K = p && p.map((a, s) => {
|
|
75
|
+
const k = u === a.value, M = u == null, v = {
|
|
76
|
+
...a,
|
|
77
|
+
valid: j,
|
|
78
|
+
checked: k,
|
|
79
|
+
disabled: !!(a.disabled || l),
|
|
80
|
+
labelPlacement: a.labelPlacement ? a.labelPlacement : V,
|
|
81
|
+
tabIndex: a.tabIndex ? a.tabIndex : M && s === 0 || k ? 0 : -1,
|
|
82
|
+
index: s,
|
|
83
|
+
name: G || S,
|
|
84
|
+
onChange: H,
|
|
85
|
+
onFocus: L
|
|
86
|
+
};
|
|
87
|
+
return /* @__PURE__ */ t.createElement(
|
|
88
|
+
z,
|
|
89
|
+
{
|
|
90
|
+
className: P("k-radio-item", { "k-disabled": v.disabled || l }),
|
|
91
|
+
key: s,
|
|
92
|
+
role: "none"
|
|
93
|
+
},
|
|
94
|
+
/* @__PURE__ */ t.createElement(q, { ...v })
|
|
95
|
+
);
|
|
96
|
+
});
|
|
97
|
+
return /* @__PURE__ */ t.createElement(
|
|
98
|
+
"ul",
|
|
99
|
+
{
|
|
100
|
+
id: I,
|
|
101
|
+
role: "radiogroup",
|
|
102
|
+
className: T,
|
|
103
|
+
ref: o,
|
|
104
|
+
dir: w,
|
|
105
|
+
style: O,
|
|
106
|
+
"aria-labelledby": N,
|
|
107
|
+
"aria-describedby": B
|
|
108
|
+
},
|
|
109
|
+
K
|
|
110
|
+
);
|
|
111
|
+
}), R = {
|
|
112
|
+
item: (r) => /* @__PURE__ */ t.createElement("li", { ...r })
|
|
113
|
+
};
|
|
114
|
+
m.propTypes = {
|
|
115
|
+
ariaLabelledBy: e.string,
|
|
116
|
+
ariaDescribedBy: e.string,
|
|
117
|
+
className: e.string,
|
|
118
|
+
data: e.arrayOf(e.object),
|
|
119
|
+
defaultValue: e.any,
|
|
120
|
+
dir: e.string,
|
|
121
|
+
disabled: e.bool,
|
|
122
|
+
labelPlacement: e.string,
|
|
123
|
+
layout: e.string,
|
|
124
|
+
name: e.string,
|
|
125
|
+
style: e.object,
|
|
126
|
+
value: e.any,
|
|
127
|
+
onChange: e.func,
|
|
128
|
+
onFocus: e.func
|
|
129
|
+
};
|
|
130
|
+
m.defaultProps = R;
|
|
131
|
+
m.displayName = "KendoRadioGroup";
|
|
132
|
+
export {
|
|
133
|
+
m as RadioGroup,
|
|
134
|
+
Z as RadioGroupPropsContext
|
|
135
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const X=require("react"),I=require("prop-types"),i=require("@progress/kendo-react-common"),R=require("../messages/index.js"),W=require("@progress/kendo-react-intl"),l=require("./range-raducer.js"),Y=require("../package-metadata.js");function F(r){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(n,e,s.get?s:{enumerable:!0,get:()=>r[e]})}}return n.default=r,Object.freeze(n)}const a=F(X),J=(r,n,e)=>{const[s,c]=a.useState(r),u=a.useCallback(m=>{const A=l.rangeReducer(n.state||s,{...m,...n});e&&e(A,m.event),c(A)},[n,e]);return[s,u]},_=i.createPropsContext(),x=a.forwardRef((r,n)=>{i.validatePackage(Y.packageMetadata);const e=i.usePropsContext(_,r),s=a.useRef(null),c=a.useRef(null),u=a.useRef(null),m=a.useRef(null),A=a.useRef(null),G=a.useCallback(()=>{m.current&&m.current.focus()},[m]);a.useImperativeHandle(s,()=>({element:c.current,focus:G,props:e})),a.useImperativeHandle(n,()=>s.current);const p=a.useMemo(()=>e.min,[e.min]),g=a.useMemo(()=>e.max,[e.max]),$=a.useMemo(()=>e.step!==void 0?e.step:T.step,[e.step,T.step]),y=i.useDir(c,e.dir),S=(t,f)=>{e.onChange&&s.current&&e.onChange.call(void 0,{value:t,target:s.current,syntheticEvent:f})},[D,O]=a.useState(""),[k,o]=J(e.defaultValue||T.defaultValue,{min:p,max:g,step:$,state:e.value},S),d=a.useMemo(()=>e.value||k,[e.value,k]),K=a.useRef(null),N=a.useRef(null),b=a.useMemo(()=>(d.start-p)/(g-p)*100,[d.start,p,g]),h=a.useMemo(()=>(d.end-p)/(g-p)*100,[d.end,p,g]),M=a.useMemo(()=>e.vertical?{paddingTop:0,height:"100%"}:{},[e.vertical]),P=a.useMemo(()=>e.vertical?{marginTop:"0.5rem",marginBottom:"0.5rem"}:{marginLeft:"0.5rem",marginRight:"0.5rem"},[e.vertical]),w=W.useLocalization(),C=a.useCallback(t=>{if(!N.current)return;const f=N.current.getBoundingClientRect(),v=e.vertical?f.bottom-t.clientY:y==="rtl"?f.right-t.clientX:t.clientX-f.left,E=e.vertical?f.height:f.width,B=v/E;return p+B*(g-p)},[N,e.vertical,y,p,g,k.start,k.end,e.value&&e.value.start,e.value&&e.value.end]),z=a.useCallback(t=>t<=d.start?"start":t>=d.end?"end":2*t<d.end+d.start?"start":"end",[k.start,k.end,e.value&&e.value.start,e.value&&e.value.end]),q=a.useCallback(t=>{switch(t.keyCode){case i.Keys.right:t.preventDefault(),o({type:y==="rtl"?l.RANGE_ACTION.decrease:l.RANGE_ACTION.increase,key:"start",event:t});break;case i.Keys.up:t.preventDefault(),o({type:l.RANGE_ACTION.increase,key:"start",event:t});break;case i.Keys.left:t.preventDefault(),o({type:y==="rtl"?l.RANGE_ACTION.increase:l.RANGE_ACTION.decrease,key:"start",event:t});break;case i.Keys.down:t.preventDefault(),o({type:l.RANGE_ACTION.decrease,key:"start",event:t});break;case i.Keys.home:t.preventDefault(),o({type:l.RANGE_ACTION.min,key:"start",event:t});break;case i.Keys.end:t.preventDefault(),o({type:l.RANGE_ACTION.max,key:"start",event:t});break}},[o]),V=a.useCallback(t=>{switch(t.keyCode){case i.Keys.right:t.preventDefault(),o({type:y==="rtl"?l.RANGE_ACTION.decrease:l.RANGE_ACTION.increase,key:"end",event:t});break;case i.Keys.up:t.preventDefault(),o({type:l.RANGE_ACTION.increase,key:"end",event:t});break;case i.Keys.left:t.preventDefault(),o({type:y==="rtl"?l.RANGE_ACTION.increase:l.RANGE_ACTION.decrease,key:"end",event:t});break;case i.Keys.down:t.preventDefault(),o({type:l.RANGE_ACTION.decrease,key:"end",event:t});break;case i.Keys.home:t.preventDefault(),o({type:l.RANGE_ACTION.min,key:"end",event:t});break;case i.Keys.end:t.preventDefault(),o({type:l.RANGE_ACTION.max,key:"end",event:t});break}},[o,y]),j=a.useCallback(t=>{const f=C(t),v=z(f);O(v),v==="end"?A.current.focus():m.current.focus();const E=v==="end"?l.RANGE_ACTION.end:l.RANGE_ACTION.start;o({type:E,payload:f,event:t})},[e.vertical,p,g,o]),H=t=>{const f=C(t),v=D==="end"?l.RANGE_ACTION.end:l.RANGE_ACTION.start;o({type:v,payload:f,event:t})},L=t=>{const f=C(t),v=D==="end"?l.RANGE_ACTION.end:l.RANGE_ACTION.start;o({type:v,payload:f,event:t}),O("")};return i.useDraggable(N,{onPress:j,onDrag:H,onRelease:L}),a.createElement("div",{id:e.id,style:e.style,ref:c,dir:y,className:i.classNames("k-slider",{"k-rtl":y==="rtl","k-disabled":e.disabled,"k-slider-vertical":e.vertical,"k-slider-horizontal":!e.vertical},e.className)},a.createElement("div",{ref:N,className:"k-slider-track-wrap",style:{flexGrow:1,position:"relative",touchAction:"none",...P}},e.children&&a.createElement("ul",{className:"k-reset k-slider-items",style:{...M}},a.Children.map(e.children,t=>t&&a.cloneElement(t,{position:100*(t.props.position-e.min)/(e.max-e.min),vertical:e.vertical},t.props.children))),a.createElement("div",{ref:K,className:"k-slider-track",style:e.vertical?{bottom:0,height:"100%"}:{[y==="rtl"?"right":"left"]:0,width:"100%"}},b!==null&&h!==null&&a.createElement("div",{"data-selection":!0,ref:u,title:`${d.start} - ${d.end}`,className:"k-slider-selection",style:e.vertical?{height:h-b+"%",bottom:b+"%"}:{[y==="rtl"?"right":"left"]:b+"%",width:h-b+"%"}}),a.createElement("span",{ref:m,role:"slider",tabIndex:i.getTabIndex(e.startTabIndex,e.disabled,void 0),"aria-valuemin":p,"aria-valuemax":Math.max(g,d.end),"aria-valuenow":d.start,"aria-disabled":e.disabled?"true":void 0,"aria-valuetext":`${d.start} - ${d.end}`,className:"k-draghandle",title:w.toLanguageString(R.sliderDragTitle,R.messages[R.sliderDragTitle]),style:e.vertical?{bottom:"calc("+b+"%)",zIndex:1}:y==="rtl"?{right:"calc("+b+"% - 13px)",zIndex:1}:{left:"calc("+b+"%)",zIndex:1},onKeyDown:q}),a.createElement("span",{ref:A,role:"slider",tabIndex:i.getTabIndex(e.endTabIndex,e.disabled,void 0),"aria-valuemin":Math.min(p,d.start),"aria-valuemax":g,"aria-valuenow":d.end,"aria-disabled":e.disabled?"true":void 0,"aria-valuetext":`${d.start} - ${d.end}`,className:"k-draghandle",title:w.toLanguageString(R.sliderDragTitle,R.messages[R.sliderDragTitle]),style:e.vertical?{bottom:"calc("+h+"%)",zIndex:1}:y==="rtl"?{right:"calc("+h+"% - 13px)",zIndex:1}:{left:"calc("+h+"%)",zIndex:1},onKeyDown:V}))))}),Q={value:(r,n,e)=>{if(r.value){const s=r.value.start,c=r.value.end,u=r.min,m=r.max;if(s>c||s>m||s<u||c>m||c<u||c<s)return new Error(`Invalid prop + ${n} supplied to ${e}.
|
|
9
|
+
The { start, end } value must be between the min & max value and { start, end } must be start < end.
|
|
10
|
+
`)}return null},defaultValue:(r,n,e)=>{if(r.defaultValue){const s=r.defaultValue.start,c=r.defaultValue.end,u=r.min,m=r.max;if(s>c||s>m||s<u||c>m||c<u||c<s)return new Error(`Invalid prop + ${n} supplied to ${e}.
|
|
11
|
+
The { start, end } value must be between the min & max value and { start, end } must be start < end.
|
|
12
|
+
`)}return null},onChange:I.func,step:I.number,min:(r,n,e)=>{const s=r[n],c=r.min,u=r.max;return c===void 0?new Error(`Invalid prop + ${n} supplied to ${e}.
|
|
13
|
+
${n} value can not be undefined.
|
|
14
|
+
`):s&&c>=u?new Error(`Invalid prop + ${n} supplied to ${e}.
|
|
15
|
+
${n} value can not be equal to or bigger than the max value.
|
|
16
|
+
`):null},max:(r,n,e)=>{const s=r[n],c=r.min,u=r.max;return u===void 0?new Error(`Invalid prop + ${n} supplied to ${e}.
|
|
17
|
+
${n} value can not be undefined.
|
|
18
|
+
`):s&&u<=c?new Error(`Invalid prop + ${n} supplied to ${e}.
|
|
19
|
+
${n} value can not be equal to or smaller than the min value.
|
|
20
|
+
`):null},vertical:I.bool,disabled:I.bool,dir:I.oneOf(["ltr","rtl"])},T={step:1,defaultValue:{start:0,end:0},vertical:!1,disabled:!1};x.displayName="KendoReactRangeSlider";x.propTypes=Q;x.defaultProps=T;exports.RangeSlider=x;exports.RangeSliderPropsContext=_;
|