@progress/kendo-react-inputs 13.3.0-develop.9 → 13.4.0-develop.1
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.d.ts +49 -0
- package/checkbox/Checkbox.js +1 -1
- package/checkbox/Checkbox.mjs +35 -36
- package/checkbox/interfaces/CheckboxBlurEvent.d.ts +14 -0
- package/checkbox/interfaces/CheckboxChangeEvent.d.ts +18 -0
- package/checkbox/interfaces/CheckboxFocusEvent.d.ts +14 -0
- package/checkbox/interfaces/CheckboxProps.d.ts +148 -0
- package/colors/ColorContrastLabels.d.ts +22 -0
- package/colors/ColorContrastSvg.d.ts +25 -0
- package/colors/ColorGradient.d.ts +215 -0
- package/colors/ColorGradient.js +1 -1
- package/colors/ColorGradient.mjs +20 -19
- package/colors/ColorInput.d.ts +40 -0
- package/colors/ColorInput.js +1 -1
- package/colors/ColorInput.mjs +20 -16
- package/colors/ColorPalette.d.ts +129 -0
- package/colors/ColorPalette.js +1 -1
- package/colors/ColorPalette.mjs +7 -7
- package/colors/ColorPicker.d.ts +34 -0
- package/colors/ColorPicker.js +1 -1
- package/colors/ColorPicker.mjs +96 -94
- package/colors/FlatColorPicker.d.ts +189 -0
- package/colors/FlatColorPicker.js +1 -1
- package/colors/FlatColorPicker.mjs +41 -40
- package/colors/HexInput.d.ts +39 -0
- package/colors/HexInput.js +1 -1
- package/colors/HexInput.mjs +2 -1
- package/colors/Picker.d.ts +13 -0
- package/colors/interfaces/ColorGradientChangeEvent.d.ts +18 -0
- package/colors/interfaces/ColorGradientProps.d.ts +160 -0
- package/colors/interfaces/ColorPaletteChangeEvent.d.ts +22 -0
- package/colors/interfaces/ColorPaletteProps.d.ts +116 -0
- package/colors/interfaces/ColorPickerActiveColorClick.d.ts +29 -0
- package/colors/interfaces/ColorPickerBlurEvent.d.ts +20 -0
- package/colors/interfaces/ColorPickerChangeEvent.d.ts +29 -0
- package/colors/interfaces/ColorPickerFocusEvent.d.ts +20 -0
- package/colors/interfaces/ColorPickerGradientSettings.d.ts +29 -0
- package/colors/interfaces/ColorPickerPaletteSettings.d.ts +39 -0
- package/colors/interfaces/ColorPickerPopupSettings.d.ts +21 -0
- package/colors/interfaces/ColorPickerProps.d.ts +242 -0
- package/colors/interfaces/ColorPickerView.d.ts +17 -0
- package/colors/interfaces/PickerPopupSettings.d.ts +29 -0
- package/colors/interfaces/PickerProps.d.ts +57 -0
- package/colors/models/hsva.d.ts +16 -0
- package/colors/models/output-format.d.ts +11 -0
- package/colors/models/palette-presets.d.ts +60 -0
- package/colors/models/rgb.d.ts +15 -0
- package/colors/models/rgba.d.ts +16 -0
- package/colors/models/table-cell.d.ts +14 -0
- package/colors/models/tile-size.d.ts +18 -0
- package/colors/utils/color-cache.d.ts +37 -0
- package/colors/utils/color-palette.service.d.ts +19 -0
- package/colors/utils/color-parser.d.ts +72 -0
- package/colors/utils/color-parser.js +1 -1
- package/colors/utils/color-parser.mjs +1 -1
- package/colors/utils/misc.d.ts +23 -0
- package/colors/utils/svg-calc.d.ts +69 -0
- package/common/AdaptiveMode.d.ts +21 -0
- package/common/SliderTooltip.d.ts +25 -0
- package/common/SwitchController.d.ts +38 -0
- package/common/SwitchModel.d.ts +14 -0
- package/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/index.d.mts +72 -5128
- package/index.d.ts +72 -5128
- package/input/Input.d.ts +119 -0
- package/input/Input.js +1 -1
- package/input/Input.mjs +45 -43
- package/input/InputClearValue.d.ts +28 -0
- package/input/InputPrefix.d.ts +30 -0
- package/input/InputSeparator.d.ts +30 -0
- package/input/InputSuffix.d.ts +32 -0
- package/input/InputValidationIcon.d.ts +21 -0
- package/input/interfaces/InputChangeEvent.d.ts +18 -0
- package/interfaces/Direction.d.ts +8 -0
- package/interfaces/ToggleBaseProps.d.ts +24 -0
- package/maskedtextbox/MaskedTextBox.d.ts +224 -0
- package/maskedtextbox/MaskedTextBox.js +1 -1
- package/maskedtextbox/MaskedTextBox.mjs +80 -79
- package/maskedtextbox/MaskedTextBoxProps.d.ts +273 -0
- package/maskedtextbox/masking.service.d.ts +48 -0
- package/maskedtextbox/masking.service.mjs +9 -9
- package/maskedtextbox/parsing/combinators.d.ts +16 -0
- package/maskedtextbox/parsing/parsers.d.ts +54 -0
- package/maskedtextbox/parsing/result.d.ts +30 -0
- package/maskedtextbox/parsing/stream.d.ts +29 -0
- package/maskedtextbox/utils.d.ts +23 -0
- package/messages/index.d.ts +177 -0
- package/numerictextbox/NumericTextBox.d.ts +21 -0
- package/numerictextbox/NumericTextBox.js +1 -1
- package/numerictextbox/NumericTextBox.mjs +161 -161
- package/numerictextbox/interfaces/NumericTextBoxBlurEvent.d.ts +14 -0
- package/numerictextbox/interfaces/NumericTextBoxChangeEvent.d.ts +18 -0
- package/numerictextbox/interfaces/NumericTextBoxFocusEvent.d.ts +14 -0
- package/numerictextbox/interfaces/NumericTextBoxHandle.d.ts +46 -0
- package/numerictextbox/interfaces/NumericTextBoxProps.d.ts +212 -0
- package/numerictextbox/interfaces/NumericTextBoxState.d.ts +22 -0
- package/numerictextbox/utils/index.d.ts +126 -0
- package/package-metadata.d.ts +12 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +10 -16
- package/package.json +10 -10
- package/radiobutton/RadioButton.d.ts +36 -0
- package/radiobutton/RadioButton.js +1 -1
- package/radiobutton/RadioButton.mjs +8 -8
- package/radiobutton/RadioGroup.d.ts +36 -0
- package/radiobutton/interfaces/RadioButtonBlurEvent.d.ts +14 -0
- package/radiobutton/interfaces/RadioButtonChangeEvent.d.ts +18 -0
- package/radiobutton/interfaces/RadioButtonFocusEvent.d.ts +14 -0
- package/radiobutton/interfaces/RadioButtonProps.d.ts +107 -0
- package/radiobutton/interfaces/RadioGroupChangeEvent.d.ts +18 -0
- package/radiobutton/interfaces/RadioGroupFocusEvent.d.ts +14 -0
- package/radiobutton/interfaces/RadioGroupProps.d.ts +178 -0
- package/range-slider/RangeSlider.d.ts +152 -0
- package/range-slider/range-raducer.d.ts +46 -0
- package/rating/Rating.d.ts +302 -0
- package/rating/Rating.mjs +3 -3
- package/rating/RatingItem.d.ts +111 -0
- package/rating/models/index.d.ts +91 -0
- package/rating/rating-reducer.d.ts +39 -0
- package/rating/utils/index.d.ts +31 -0
- package/signature/Signature.d.ts +21 -0
- package/signature/Signature.js +1 -1
- package/signature/Signature.mjs +26 -23
- package/signature/interfaces/SignatureBlurEvent.d.ts +14 -0
- package/signature/interfaces/SignatureChangeEvent.d.ts +18 -0
- package/signature/interfaces/SignatureCloseEvent.d.ts +14 -0
- package/signature/interfaces/SignatureFocusEvent.d.ts +14 -0
- package/signature/interfaces/SignatureHandle.d.ts +49 -0
- package/signature/interfaces/SignatureOpenEvent.d.ts +14 -0
- package/signature/interfaces/SignatureProps.d.ts +324 -0
- package/signature/interfaces/index.d.ts +14 -0
- package/signature/utils/index.d.ts +11 -0
- package/slider/Slider.d.ts +288 -0
- package/slider/Slider.mjs +9 -9
- package/slider/SliderLabel.d.ts +51 -0
- package/switch/Switch.d.ts +397 -0
- package/switch/Switch.js +1 -1
- package/switch/Switch.mjs +29 -22
- package/textarea/TextArea.d.ts +40 -0
- package/textarea/TextArea.js +1 -1
- package/textarea/TextArea.mjs +41 -41
- package/textarea/interfaces/TextAreaBlurEvent.d.ts +14 -0
- package/textarea/interfaces/TextAreaChangeEvent.d.ts +18 -0
- package/textarea/interfaces/TextAreaFocusEvent.d.ts +14 -0
- package/textarea/interfaces/TextAreaProps.d.ts +199 -0
- package/textbox/Textbox.d.ts +99 -0
- package/textbox/Textbox.js +1 -1
- package/textbox/Textbox.mjs +70 -66
- package/utils.d.ts +11 -0
package/textarea/TextArea.mjs
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as t from "react";
|
|
9
9
|
import e from "prop-types";
|
|
10
|
-
import { createPropsContext as be, usePropsContext as xe, useCustomComponent as B, useId as
|
|
10
|
+
import { createPropsContext as be, usePropsContext as xe, useCustomComponent as B, useId as ve, useDir as ge, useIsomorphicLayoutEffect as he, dispatchEvent as C, getTabIndex as ye, classNames as N, kendoThemeMaps as H } from "@progress/kendo-react-common";
|
|
11
11
|
const ke = be(), R = t.forwardRef(($, q) => {
|
|
12
12
|
const i = xe(ke, $), {
|
|
13
13
|
size: m = n.size,
|
|
@@ -22,7 +22,7 @@ const ke = be(), R = t.forwardRef(($, q) => {
|
|
|
22
22
|
autoSize: u,
|
|
23
23
|
className: J,
|
|
24
24
|
defaultValue: Q,
|
|
25
|
-
disabled:
|
|
25
|
+
disabled: o,
|
|
26
26
|
readOnly: U,
|
|
27
27
|
required: d,
|
|
28
28
|
rows: W,
|
|
@@ -35,14 +35,14 @@ const ke = be(), R = t.forwardRef(($, q) => {
|
|
|
35
35
|
valid: w,
|
|
36
36
|
validationMessage: S,
|
|
37
37
|
validityStyles: F,
|
|
38
|
-
onChange:
|
|
39
|
-
onFocus:
|
|
38
|
+
onChange: v,
|
|
39
|
+
onFocus: g,
|
|
40
40
|
onBlur: h,
|
|
41
41
|
// Removed to support direct use in Form Field component
|
|
42
42
|
visited: Ce,
|
|
43
43
|
touched: ze,
|
|
44
44
|
modified: we,
|
|
45
|
-
resizable:
|
|
45
|
+
resizable: l,
|
|
46
46
|
inputAttributes: te,
|
|
47
47
|
textareaStyle: I,
|
|
48
48
|
...ae
|
|
@@ -50,7 +50,7 @@ const ke = be(), R = t.forwardRef(($, q) => {
|
|
|
50
50
|
a.current && a.current.focus();
|
|
51
51
|
}, []), T = t.useCallback(() => {
|
|
52
52
|
a.current && a.current.blur();
|
|
53
|
-
}, []), [E, M] = t.useState(Q), [
|
|
53
|
+
}, []), [E, M] = t.useState(Q), [oe, P] = t.useState(!1), [re, se] = B(L), [le, ne] = B(j), c = x !== void 0, f = c ? x : E, s = t.useCallback(() => ({
|
|
54
54
|
element: a,
|
|
55
55
|
focus: O,
|
|
56
56
|
blur: T,
|
|
@@ -61,69 +61,69 @@ const ke = be(), R = t.forwardRef(($, q) => {
|
|
|
61
61
|
return a.current && a.current.name;
|
|
62
62
|
}
|
|
63
63
|
}), [T, O, f]);
|
|
64
|
-
t.useImperativeHandle(q,
|
|
65
|
-
const [V, A] = t.useState("auto"), ie =
|
|
64
|
+
t.useImperativeHandle(q, s);
|
|
65
|
+
const [V, A] = t.useState("auto"), ie = ve(), ue = ge(a, i.dir), y = w !== void 0 ? w : d ? !!f : !0;
|
|
66
66
|
t.useEffect(() => {
|
|
67
67
|
a.current && a.current.setCustomValidity && a.current.setCustomValidity(y ? "" : S || "");
|
|
68
68
|
}, [y, S]), he(() => {
|
|
69
69
|
a.current && A(`${a.current.scrollHeight}px`);
|
|
70
70
|
}, [f]);
|
|
71
71
|
const de = t.useCallback(
|
|
72
|
-
(
|
|
73
|
-
const k =
|
|
74
|
-
A("auto"), !c && !
|
|
75
|
-
|
|
76
|
-
|
|
72
|
+
(r) => {
|
|
73
|
+
const k = r.target.value;
|
|
74
|
+
A("auto"), !c && !o && M(k), v && !o && C(
|
|
75
|
+
v,
|
|
76
|
+
r,
|
|
77
77
|
{
|
|
78
|
-
...
|
|
78
|
+
...s(),
|
|
79
79
|
value: k
|
|
80
80
|
},
|
|
81
81
|
{ value: k }
|
|
82
82
|
);
|
|
83
83
|
},
|
|
84
|
-
[M,
|
|
84
|
+
[M, v, o, c]
|
|
85
85
|
), ce = t.useCallback(
|
|
86
|
-
(
|
|
87
|
-
P(!0),
|
|
86
|
+
(r) => {
|
|
87
|
+
P(!0), g && !o && C(g, r, s(), void 0);
|
|
88
88
|
},
|
|
89
|
-
[
|
|
89
|
+
[g, o, s]
|
|
90
90
|
), fe = t.useCallback(
|
|
91
|
-
(
|
|
92
|
-
P(!1), h && !
|
|
91
|
+
(r) => {
|
|
92
|
+
P(!1), h && !o && C(h, r, s(), void 0);
|
|
93
93
|
},
|
|
94
|
-
[h,
|
|
94
|
+
[h, o, s]
|
|
95
95
|
), me = t.useMemo(() => {
|
|
96
|
-
let
|
|
97
|
-
return u ?
|
|
96
|
+
let r = {};
|
|
97
|
+
return u ? r = {
|
|
98
98
|
resize: "none",
|
|
99
99
|
overflow: "hidden",
|
|
100
100
|
height: V
|
|
101
|
-
} :
|
|
102
|
-
...
|
|
101
|
+
} : l && (r = { resize: l }), {
|
|
102
|
+
...r,
|
|
103
103
|
...I
|
|
104
104
|
};
|
|
105
|
-
}, [u,
|
|
105
|
+
}, [u, l, V, I]), pe = {
|
|
106
106
|
id: X || ie,
|
|
107
107
|
role: "textbox",
|
|
108
108
|
name: Y,
|
|
109
109
|
className: N("k-input-inner", "!k-overflow-auto", {
|
|
110
|
-
"k-resize": !u &&
|
|
111
|
-
"k-resize-none": u ||
|
|
110
|
+
"k-resize": !u && l !== "none",
|
|
111
|
+
"k-resize-none": u || l === "none",
|
|
112
112
|
"!k-flex-none": b === "vertical"
|
|
113
113
|
}),
|
|
114
114
|
ref: a,
|
|
115
|
-
disabled:
|
|
115
|
+
disabled: o,
|
|
116
116
|
rows: W,
|
|
117
117
|
placeholder: Z,
|
|
118
118
|
readOnly: U,
|
|
119
119
|
required: d,
|
|
120
|
-
tabIndex: ye(ee,
|
|
120
|
+
tabIndex: ye(ee, o),
|
|
121
121
|
autoFocus: D,
|
|
122
122
|
style: me,
|
|
123
123
|
"aria-labelledby": G,
|
|
124
124
|
"aria-describedby": K,
|
|
125
125
|
"aria-multiline": !0,
|
|
126
|
-
"aria-disabled":
|
|
126
|
+
"aria-disabled": o || void 0,
|
|
127
127
|
"aria-required": d,
|
|
128
128
|
value: c ? x : E,
|
|
129
129
|
...Object.assign({}, ae, te),
|
|
@@ -143,8 +143,8 @@ const ke = be(), R = t.forwardRef(($, q) => {
|
|
|
143
143
|
[`k-rounded-${H.roundedMap[p] || p}`]: p,
|
|
144
144
|
"k-invalid": !(y || F !== void 0 || F === !0),
|
|
145
145
|
"k-required": d,
|
|
146
|
-
"k-disabled":
|
|
147
|
-
"k-focus":
|
|
146
|
+
"k-disabled": o,
|
|
147
|
+
"k-focus": oe,
|
|
148
148
|
"!k-flex-col": b === "vertical",
|
|
149
149
|
"!k-flex-row": b === "horizontal"
|
|
150
150
|
},
|
|
@@ -153,9 +153,9 @@ const ke = be(), R = t.forwardRef(($, q) => {
|
|
|
153
153
|
style: _,
|
|
154
154
|
dir: ue
|
|
155
155
|
},
|
|
156
|
-
i.prefix && /* @__PURE__ */ t.createElement(
|
|
156
|
+
i.prefix && /* @__PURE__ */ t.createElement(re, { ...se }),
|
|
157
157
|
/* @__PURE__ */ t.createElement("textarea", { ...pe }),
|
|
158
|
-
i.suffix && /* @__PURE__ */ t.createElement(
|
|
158
|
+
i.suffix && /* @__PURE__ */ t.createElement(le, { ...ne })
|
|
159
159
|
);
|
|
160
160
|
});
|
|
161
161
|
R.propTypes = {
|
|
@@ -177,17 +177,17 @@ R.propTypes = {
|
|
|
177
177
|
onChange: e.func,
|
|
178
178
|
onFocus: e.func,
|
|
179
179
|
onBlur: e.func,
|
|
180
|
-
size: e.oneOf([
|
|
181
|
-
rounded: e.oneOf([
|
|
182
|
-
fillMode: e.oneOf([
|
|
180
|
+
size: e.oneOf(["small", "medium", "large"]),
|
|
181
|
+
rounded: e.oneOf(["small", "medium", "large", "full"]),
|
|
182
|
+
fillMode: e.oneOf(["solid", "flat", "outline"]),
|
|
183
183
|
resizable: e.oneOf(["none", "both", "horizontal", "vertical"]),
|
|
184
184
|
autoFocus: e.bool,
|
|
185
185
|
flow: e.oneOf(["vertical", "horizontal"])
|
|
186
186
|
};
|
|
187
187
|
const n = {
|
|
188
|
-
size:
|
|
189
|
-
rounded:
|
|
190
|
-
fillMode:
|
|
188
|
+
size: void 0,
|
|
189
|
+
rounded: void 0,
|
|
190
|
+
fillMode: void 0,
|
|
191
191
|
autoFocus: !1,
|
|
192
192
|
flow: "horizontal"
|
|
193
193
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { TextAreaHandle } from './../TextArea.js';
|
|
9
|
+
import { BaseEvent } from '@progress/kendo-react-common';
|
|
10
|
+
/**
|
|
11
|
+
* The arguments for the `onBlur` TextArea event.
|
|
12
|
+
*/
|
|
13
|
+
export interface TextAreaBlurEvent extends BaseEvent<TextAreaHandle> {
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { TextAreaHandle } from './../TextArea.js';
|
|
9
|
+
import { BaseEvent } from '@progress/kendo-react-common';
|
|
10
|
+
/**
|
|
11
|
+
* The arguments for the `onChange` TextArea event.
|
|
12
|
+
*/
|
|
13
|
+
export interface TextAreaChangeEvent extends BaseEvent<TextAreaHandle> {
|
|
14
|
+
/**
|
|
15
|
+
* The new value of the TextArea.
|
|
16
|
+
*/
|
|
17
|
+
value: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { TextAreaHandle } from './../TextArea.js';
|
|
9
|
+
import { BaseEvent } from '@progress/kendo-react-common';
|
|
10
|
+
/**
|
|
11
|
+
* The arguments for the `onFocus` TextArea event.
|
|
12
|
+
*/
|
|
13
|
+
export interface TextAreaFocusEvent extends BaseEvent<TextAreaHandle> {
|
|
14
|
+
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { CustomComponent, FormComponentProps } from '@progress/kendo-react-common';
|
|
9
|
+
import { TextAreaBlurEvent } from './TextAreaBlurEvent.js';
|
|
10
|
+
import { TextAreaChangeEvent } from './TextAreaChangeEvent.js';
|
|
11
|
+
import { TextAreaFocusEvent } from './TextAreaFocusEvent.js';
|
|
12
|
+
/**
|
|
13
|
+
* @hidden
|
|
14
|
+
*/
|
|
15
|
+
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
16
|
+
/**
|
|
17
|
+
* Represents the props of the [KendoReact TextArea component](https://www.telerik.com/kendo-react-ui/components/inputs/textarea).
|
|
18
|
+
*/
|
|
19
|
+
export interface TextAreaProps extends FormComponentProps, Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'defaultValue' | 'onChange' | 'onFocus' | 'onBlur' | 'prefix'> {
|
|
20
|
+
/**
|
|
21
|
+
* Identifies the element(s) which will describe the component, similar to [HTML aria-describedby attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-describedby_attribute).
|
|
22
|
+
* For example these elements could contain error or hint message.
|
|
23
|
+
*/
|
|
24
|
+
ariaDescribedBy?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Identifies the element(s) which will label the component.
|
|
27
|
+
*/
|
|
28
|
+
ariaLabelledBy?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Specifies if the textarea element will resize its height automatically ([see example](https://www.telerik.com/kendo-react-ui/components/inputs/textarea/sizing)).
|
|
31
|
+
* Defaults to `false`.
|
|
32
|
+
*
|
|
33
|
+
* Setting the value of the prop to `true` will make the TextArea component to ignore the resize behavior of the `resizable` prop.
|
|
34
|
+
*/
|
|
35
|
+
autoSize?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Specifies a list of CSS classes that will be added to the TextArea.
|
|
38
|
+
*/
|
|
39
|
+
className?: string;
|
|
40
|
+
/**
|
|
41
|
+
* The default value of the TextArea ([see example](https://www.telerik.com/kendo-react-ui/components/inputs/textarea/default_state)).
|
|
42
|
+
*/
|
|
43
|
+
defaultValue?: string | string[] | number;
|
|
44
|
+
/**
|
|
45
|
+
* Represents the `dir` HTML attribute.
|
|
46
|
+
*/
|
|
47
|
+
dir?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Specifies if the TextArea is disabled ([see example](https://www.telerik.com/kendo-react-ui/components/inputs/textarea/disabled)).
|
|
50
|
+
*/
|
|
51
|
+
disabled?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Sets the read-only state of the TextArea.
|
|
54
|
+
*/
|
|
55
|
+
readOnly?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Specifies an exact height size for the TextArea to take ([see example](https://www.telerik.com/kendo-react-ui/components/inputs/textarea/sizing)).
|
|
58
|
+
*/
|
|
59
|
+
rows?: number;
|
|
60
|
+
/**
|
|
61
|
+
* Sets the `id` of the TextArea.
|
|
62
|
+
*/
|
|
63
|
+
id?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Specifies the `name` property of the `textarea` DOM element.
|
|
66
|
+
*
|
|
67
|
+
* This property is part of the [FormComponentProps](https://www.telerik.com/kendo-react-ui/components/common/api/formcomponentprops) interface.
|
|
68
|
+
*/
|
|
69
|
+
name?: string;
|
|
70
|
+
/**
|
|
71
|
+
* The hint that is displayed when the TextArea is empty.
|
|
72
|
+
*/
|
|
73
|
+
placeholder?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Sets additional CSS styles to the TextArea.
|
|
76
|
+
*/
|
|
77
|
+
style?: React.CSSProperties;
|
|
78
|
+
/**
|
|
79
|
+
* Sets the `tabIndex` property of the TextArea.
|
|
80
|
+
* Defaults to `0`.
|
|
81
|
+
*/
|
|
82
|
+
tabIndex?: number;
|
|
83
|
+
/**
|
|
84
|
+
* Sets the value to be submitted ([see example](https://www.telerik.com/kendo-react-ui/components/inputs/textarea/controlled_mode)).
|
|
85
|
+
*/
|
|
86
|
+
value?: string | string[] | number;
|
|
87
|
+
/**
|
|
88
|
+
* The event handler that will be fired when the changes the selected value.
|
|
89
|
+
*/
|
|
90
|
+
onChange?: (event: TextAreaChangeEvent) => void;
|
|
91
|
+
/**
|
|
92
|
+
* The event handler that will be fired when TextArea is focused.
|
|
93
|
+
*/
|
|
94
|
+
onFocus?: (event: TextAreaFocusEvent) => void;
|
|
95
|
+
/**
|
|
96
|
+
* The event handler that will be fired when TextArea is blurred.
|
|
97
|
+
*/
|
|
98
|
+
onBlur?: (event: TextAreaBlurEvent) => void;
|
|
99
|
+
/**
|
|
100
|
+
* Configures the `size` of the TextArea.
|
|
101
|
+
*
|
|
102
|
+
* The available options are:
|
|
103
|
+
* - small
|
|
104
|
+
* - medium
|
|
105
|
+
* - large
|
|
106
|
+
*
|
|
107
|
+
* @default undefined (theme-controlled)
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```tsx
|
|
111
|
+
* <TextArea size="large" />
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
size?: 'small' | 'medium' | 'large';
|
|
115
|
+
/**
|
|
116
|
+
* Configures the `roundness` of the TextArea.
|
|
117
|
+
*
|
|
118
|
+
* The available options are:
|
|
119
|
+
* - small
|
|
120
|
+
* - medium
|
|
121
|
+
* - large
|
|
122
|
+
* - full
|
|
123
|
+
*
|
|
124
|
+
* @default undefined (theme-controlled)
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```tsx
|
|
128
|
+
* <TextArea rounded="full" />
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
131
|
+
rounded?: 'small' | 'medium' | 'large' | 'full';
|
|
132
|
+
/**
|
|
133
|
+
* Configures the `fillMode` of the TextArea.
|
|
134
|
+
*
|
|
135
|
+
* The available options are:
|
|
136
|
+
* - solid
|
|
137
|
+
* - outline
|
|
138
|
+
* - flat
|
|
139
|
+
*
|
|
140
|
+
* @default undefined (theme-controlled)
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* ```tsx
|
|
144
|
+
* <TextArea fillMode="outline" />
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
147
|
+
fillMode?: 'solid' | 'flat' | 'outline';
|
|
148
|
+
/**
|
|
149
|
+
* Sets a custom prefix to the TextArea component.
|
|
150
|
+
*/
|
|
151
|
+
prefix?: CustomComponent<any>;
|
|
152
|
+
/**
|
|
153
|
+
* Sets a custom suffix to the TextArea component.
|
|
154
|
+
*/
|
|
155
|
+
suffix?: CustomComponent<any>;
|
|
156
|
+
/**
|
|
157
|
+
* Defines the resize behavior of the TextArea.
|
|
158
|
+
* The available options are:
|
|
159
|
+
* - none — The TextArea cannot be resized.
|
|
160
|
+
* - vertical — The TextArea can be resized vertically.
|
|
161
|
+
* - horizontal — The TextArea can be resized horizontally.
|
|
162
|
+
* - both(default) — The TextArea can be resized both vertically and horizontally.
|
|
163
|
+
*
|
|
164
|
+
*
|
|
165
|
+
* To be able to resize the TextArea, you should not set the `autoSize` property to `true`.
|
|
166
|
+
* To be able to resize the component horizontally, add the following inline style to the TextArea:
|
|
167
|
+
*
|
|
168
|
+
* ```html
|
|
169
|
+
* <TextArea resizable='horizontal' style={{width: 'auto'}} />
|
|
170
|
+
* ```
|
|
171
|
+
*/
|
|
172
|
+
resizable?: 'none' | 'vertical' | 'horizontal' | 'both';
|
|
173
|
+
/**
|
|
174
|
+
* Represents the `autoFocus` HTML attribute that will be applied to the input element of the TextArea. (Defaults to `false`)
|
|
175
|
+
*/
|
|
176
|
+
autoFocus?: boolean;
|
|
177
|
+
/**
|
|
178
|
+
* Sets the HTML attributes of the inner focusable input element.
|
|
179
|
+
* Attributes which are essential for certain component functionalities cannot be changed.
|
|
180
|
+
*/
|
|
181
|
+
inputAttributes?: React.InputHTMLAttributes<HTMLInputElement>;
|
|
182
|
+
/**
|
|
183
|
+
* Configures the orientation/flow of the TextArea layout when using prefix or suffix.
|
|
184
|
+
*
|
|
185
|
+
* The available options are:
|
|
186
|
+
* - horizontal — Prefix and suffix are positioned to the left and right of the textarea(default).
|
|
187
|
+
* - vertical — Prefix and suffix are positioned above and below the textarea.
|
|
188
|
+
*
|
|
189
|
+
* @default `horizontal`
|
|
190
|
+
*/
|
|
191
|
+
flow?: 'horizontal' | 'vertical';
|
|
192
|
+
/**
|
|
193
|
+
* Sets custom styles to the native textarea element
|
|
194
|
+
*
|
|
195
|
+
* @hidden
|
|
196
|
+
*/
|
|
197
|
+
textareaStyle?: React.CSSProperties;
|
|
198
|
+
}
|
|
199
|
+
export {};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { BaseEvent, CustomComponent, InputsClassStructure } from '@progress/kendo-react-common';
|
|
9
|
+
import * as React from 'react';
|
|
10
|
+
export interface TextBoxChangeEvent extends BaseEvent<TextBoxHandle> {
|
|
11
|
+
/**
|
|
12
|
+
* The original React change event.
|
|
13
|
+
*/
|
|
14
|
+
syntheticEvent: React.ChangeEvent<HTMLInputElement>;
|
|
15
|
+
/**
|
|
16
|
+
* The current value of the TextBox component.
|
|
17
|
+
*/
|
|
18
|
+
value: React.InputHTMLAttributes<HTMLInputElement>['value'];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Represents the properties of the KendoReact [TextBox](https://www.telerik.com/kendo-react-ui/components/inputs/api/textbox) component
|
|
22
|
+
*/
|
|
23
|
+
export interface TextBoxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix' | 'onChange'> {
|
|
24
|
+
/**
|
|
25
|
+
* Configures the `size` of the TextBox.
|
|
26
|
+
*
|
|
27
|
+
* The available options are:
|
|
28
|
+
* - small
|
|
29
|
+
* - medium
|
|
30
|
+
* - large
|
|
31
|
+
*
|
|
32
|
+
* @default `medium`
|
|
33
|
+
*/
|
|
34
|
+
size?: 'small' | 'medium' | 'large';
|
|
35
|
+
/**
|
|
36
|
+
* Configures the `roundness` of the TextBox.
|
|
37
|
+
*
|
|
38
|
+
* The available options are:
|
|
39
|
+
* - small
|
|
40
|
+
* - medium
|
|
41
|
+
* - large
|
|
42
|
+
* - full
|
|
43
|
+
*
|
|
44
|
+
* @default `medium`
|
|
45
|
+
*/
|
|
46
|
+
rounded?: 'small' | 'medium' | 'large' | 'full';
|
|
47
|
+
/**
|
|
48
|
+
* Configures the `fillMode` of the TextBox.
|
|
49
|
+
*
|
|
50
|
+
* The available options are:
|
|
51
|
+
* - solid
|
|
52
|
+
* - outline
|
|
53
|
+
* - flat
|
|
54
|
+
*
|
|
55
|
+
* @default `solid`
|
|
56
|
+
*/
|
|
57
|
+
fillMode?: 'solid' | 'flat' | 'outline';
|
|
58
|
+
/**
|
|
59
|
+
* The `onChange` callback of the `input` element inside the TextBox.
|
|
60
|
+
*/
|
|
61
|
+
onChange?: (event: TextBoxChangeEvent) => void;
|
|
62
|
+
/**
|
|
63
|
+
* Indicates if the component is in `valid` state
|
|
64
|
+
*/
|
|
65
|
+
valid?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Sets a custom prefix to the TextBox component.
|
|
68
|
+
*/
|
|
69
|
+
prefix?: CustomComponent<any>;
|
|
70
|
+
/**
|
|
71
|
+
* Sets a custom suffix to the TextBox component.
|
|
72
|
+
*/
|
|
73
|
+
suffix?: CustomComponent<any>;
|
|
74
|
+
/**
|
|
75
|
+
* Represents the `autoFocus` HTML attribute that will be applied to the input element of the TextBox. (Defaults to `false`)
|
|
76
|
+
*/
|
|
77
|
+
autoFocus?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* @hidden
|
|
80
|
+
*/
|
|
81
|
+
unstyled?: InputsClassStructure;
|
|
82
|
+
/**
|
|
83
|
+
* Sets the HTML attributes of the inner focusable input element.
|
|
84
|
+
* Attributes which are essential for certain component functionalities cannot be changed.
|
|
85
|
+
*/
|
|
86
|
+
inputAttributes?: React.InputHTMLAttributes<HTMLInputElement>;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Represent the `ref` of the TextBox component.
|
|
90
|
+
*/
|
|
91
|
+
export type TextBoxHandle = {
|
|
92
|
+
element: HTMLInputElement | null;
|
|
93
|
+
value: TextBoxProps['value'];
|
|
94
|
+
name?: string | null;
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Represents the [KendoReact TextBox component](https://www.telerik.com/kendo-react-ui/components/inputs/textbox).
|
|
98
|
+
*/
|
|
99
|
+
export declare const TextBox: React.ForwardRefExoticComponent<TextBoxProps & React.RefAttributes<TextBoxHandle | null>>;
|
package/textbox/Textbox.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("react"),l=require("prop-types"),o=require("@progress/kendo-react-common");function D(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,a.get?a:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const t=D(A),m=t.forwardRef((e,r)=>{const n=t.useRef(null),a=t.useRef(null),i=t.useRef(void 0),v=o.useUnstyled(),y=v&&v.uTextBox,C=t.useCallback(()=>{var u;return i.current!==void 0?i.current:(u=n.current)==null?void 0:u.value},[]);t.useImperativeHandle(a,()=>({get element(){return n.current},get name(){return n.current&&n.current.name},get value(){return C()}})),t.useImperativeHandle(r,()=>a.current);const{size:c=s.size,fillMode:f=s.fillMode,rounded:d=s.rounded,autoFocus:h=s.autoFocus,inputAttributes:k,className:g,dir:_,style:p,prefix:B=s.prefix,suffix:M=s.suffix,valid:I,onFocus:F,onBlur:S,modified:$,touched:w,visited:H,validationMessage:G,autoSize:K,textareaStyle:U,...T}=e,[O]=o.useCustomComponent(B),[R]=o.useCustomComponent(M),[x,b]=t.useState(!1),q=u=>{b(!0)},z=u=>{b(!1)},N=t.useCallback(u=>{i.current=u.target.value,e.onChange&&e.onChange.call(void 0,{syntheticEvent:u,nativeEvent:u.nativeEvent,value:u.target.value,target:a.current}),i.current=void 0},[e.onChange]),{onFocus:j,onBlur:E}=o.useAsyncFocusBlur({onFocus:q,onBlur:z,onSyncFocus:F,onSyncBlur:S}),P=t.useMemo(()=>o.classNames("k-input","k-textbox",{[`k-input-${o.kendoThemeMaps.sizeMap[c]||c}`]:c,[`k-input-${f}`]:f,[`k-rounded-${o.kendoThemeMaps.roundedMap[d]||d}`]:d,"k-focus":x,"k-required":e.required,"k-disabled":e.disabled,"k-invalid":e.valid===!1},g),[g,f,x,e.disabled,e.required,e.valid,d,c]);return t.createElement("span",{style:p,dir:_,className:P,onFocus:j,onBlur:E},t.createElement(O,null),t.createElement("input",{ref:n,className:o.classNames(o.uTextBox.inputInner({c:y})),autoFocus:h,...Object.assign({},T,k),"aria-required":e.required,onChange:N}),t.createElement(R,null))}),s={prefix:e=>null,suffix:e=>null,size:void 0,rounded:void 0,fillMode:void 0,autoFocus:!1};m.propTypes={size:l.oneOf(["small","medium","large"]),rounded:l.oneOf(["small","medium","large","full"]),fillMode:l.oneOf(["solid","flat","outline"]),autoFocus:l.bool,inputAttributes:l.object};m.displayName="KendoReactTextBoxComponent";exports.TextBox=m;
|