@progress/kendo-react-inputs 14.5.0-develop.8 → 15.0.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/MaskedTextBoxMcpWrapper.d.ts +17 -0
- package/MaskedTextBoxMcpWrapper.js +8 -0
- package/MaskedTextBoxMcpWrapper.mjs +18 -0
- package/README.md +4 -4
- package/checkbox/Checkbox.js +1 -1
- package/checkbox/Checkbox.mjs +64 -64
- package/colors/ColorGradient.js +1 -1
- package/colors/ColorGradient.mjs +74 -72
- package/colors/ColorInput.js +1 -1
- package/colors/ColorInput.mjs +57 -45
- package/colors/ColorPalette.js +1 -1
- package/colors/ColorPalette.mjs +84 -81
- package/colors/ColorPicker.js +1 -1
- package/colors/ColorPicker.mjs +228 -215
- package/colors/FlatColorPicker.js +1 -1
- package/colors/FlatColorPicker.mjs +86 -94
- package/colors/interfaces/ColorPickerProps.d.ts +6 -1
- package/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/index.d.mts +5 -1
- package/index.d.ts +5 -1
- package/index.js +1 -1
- package/index.mjs +92 -89
- package/maskedtextbox/MaskedTextBoxProps.d.ts +6 -1
- package/messages/index.d.ts +55 -0
- package/messages/index.js +1 -1
- package/messages/index.mjs +82 -60
- package/numerictextbox/NumericTextBox.js +1 -1
- package/numerictextbox/NumericTextBox.mjs +215 -213
- package/numerictextbox/interfaces/NumericTextBoxProps.d.ts +6 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +16 -11
- package/radiobutton/RadioButton.js +1 -1
- package/radiobutton/RadioButton.mjs +23 -20
- package/radiobutton/interfaces/RadioButtonProps.d.ts +7 -0
- package/range-slider/RangeSlider.d.ts +14 -1
- package/range-slider/RangeSlider.js +11 -11
- package/range-slider/RangeSlider.mjs +188 -185
- package/rating/Rating.d.ts +6 -1
- package/rating/Rating.js +3 -3
- package/rating/Rating.mjs +83 -76
- package/signature/Signature.js +1 -1
- package/signature/Signature.mjs +127 -129
- package/signature/interfaces/SignatureProps.d.ts +6 -1
- package/slider/Slider.d.ts +6 -1
- package/slider/Slider.js +1 -1
- package/slider/Slider.mjs +155 -150
- package/slider/SliderLabel.js +1 -1
- package/slider/SliderLabel.mjs +3 -2
- package/switch/Switch.d.ts +6 -1
- package/switch/Switch.js +1 -1
- package/switch/Switch.mjs +100 -100
- package/textarea/TextArea.js +1 -1
- package/textarea/TextArea.mjs +101 -101
- package/textarea/interfaces/TextAreaProps.d.ts +6 -1
- package/textbox/Textbox.d.ts +20 -1
- package/textbox/Textbox.js +1 -1
- package/textbox/Textbox.mjs +92 -81
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { CustomComponent, FormComponentProps } from '@progress/kendo-react-common';
|
|
8
|
+
import { CustomComponent, FormComponentProps, WebMcpProps } from '@progress/kendo-react-common';
|
|
9
9
|
import { TextAreaBlurEvent } from './TextAreaBlurEvent';
|
|
10
10
|
import { TextAreaChangeEvent } from './TextAreaChangeEvent';
|
|
11
11
|
import { TextAreaFocusEvent } from './TextAreaFocusEvent';
|
|
@@ -210,5 +210,10 @@ export interface TextAreaProps extends FormComponentProps, Omit<React.TextareaHT
|
|
|
210
210
|
* @hidden
|
|
211
211
|
*/
|
|
212
212
|
textareaStyle?: React.CSSProperties;
|
|
213
|
+
/**
|
|
214
|
+
* Enables Web MCP tool registration for this component.
|
|
215
|
+
* Requires a parent `WebMcpProvider` from `@progress/kendo-react-webmcp`.
|
|
216
|
+
*/
|
|
217
|
+
webMcp?: boolean | WebMcpProps;
|
|
213
218
|
}
|
|
214
219
|
export {};
|
package/textbox/Textbox.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { BaseEvent, CustomComponent, InputsClassStructure } from '@progress/kendo-react-common';
|
|
8
|
+
import { BaseEvent, CustomComponent, InputsClassStructure, WebMcpProps } from '@progress/kendo-react-common';
|
|
9
9
|
import * as React from 'react';
|
|
10
10
|
export interface TextBoxChangeEvent extends BaseEvent<TextBoxHandle> {
|
|
11
11
|
/**
|
|
@@ -91,6 +91,23 @@ export interface TextBoxProps extends Omit<React.InputHTMLAttributes<HTMLInputEl
|
|
|
91
91
|
* This property is related to accessibility.
|
|
92
92
|
*/
|
|
93
93
|
inputAttributes?: React.InputHTMLAttributes<HTMLInputElement>;
|
|
94
|
+
/**
|
|
95
|
+
* Enables Web MCP tool registration for this component.
|
|
96
|
+
* Requires a parent `WebMcpProvider` from `@progress/kendo-react-webmcp`.
|
|
97
|
+
*
|
|
98
|
+
* Pass `true` for defaults or an object for fine-grained control.
|
|
99
|
+
* When absent or `false`, zero webMcp overhead.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```tsx
|
|
103
|
+
* // Boolean — use provider's dataName
|
|
104
|
+
* <TextBox webMcp value={value} onChange={handleChange} />
|
|
105
|
+
*
|
|
106
|
+
* // Config object — override dataName per component
|
|
107
|
+
* <TextBox webMcp={{ dataName: 'firstName' }} value={value} onChange={handleChange} />
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
webMcp?: boolean | WebMcpProps;
|
|
94
111
|
}
|
|
95
112
|
/**
|
|
96
113
|
* Represent the `ref` of the TextBox component.
|
|
@@ -99,6 +116,8 @@ export type TextBoxHandle = {
|
|
|
99
116
|
element: HTMLInputElement | null;
|
|
100
117
|
value: TextBoxProps['value'];
|
|
101
118
|
name?: string | null;
|
|
119
|
+
/** Programmatically set the value. Triggers `onChange` if provided. */
|
|
120
|
+
setValue: (value: string) => void;
|
|
102
121
|
};
|
|
103
122
|
/**
|
|
104
123
|
* Represents the [KendoReact TextBox component](https://www.telerik.com/kendo-react-ui/components/inputs/textbox).
|
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 $=require("react"),l=require("prop-types"),r=require("@progress/kendo-react-common");function H(e){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(s,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return s.default=e,Object.freeze(s)}const n=H($),x=n.forwardRef((e,s)=>{const t=n.useRef(null),a=n.useRef(null),c=n.useRef(void 0),b=r.useUnstyled(),M=b&&b.uTextBox,_=n.useCallback(()=>{var u;return c.current!==void 0?c.current:(u=t.current)==null?void 0:u.value},[]),i=n.useRef(null);n.useImperativeHandle(a,()=>({get element(){return t.current},get name(){return t.current&&t.current.name},get value(){return _()},setValue(g){var k;t.current&&(t.current.value=g);const V={target:t.current,currentTarget:t.current};(k=i.current)==null||k.call(i,V)}})),n.useImperativeHandle(s,()=>a.current),r.useWebMcpRegister("textbox",a,e,e.webMcp);const{size:d=o.size,fillMode:v=o.fillMode,rounded:f=o.rounded,autoFocus:B=o.autoFocus,inputAttributes:T,className:y,dir:F,style:S,prefix:O=o.prefix,suffix:R=o.suffix,valid:G,onFocus:E,onBlur:N,modified:U,touched:W,visited:J,validationMessage:L,autoSize:Q,textareaStyle:X,...p}=e,[q]=r.useCustomComponent(O),[z]=r.useCustomComponent(R),[h,C]=n.useState(!1),P=u=>{C(!0)},j=u=>{C(!1)},m=n.useCallback(u=>{c.current=u.target.value,e.onChange&&e.onChange.call(void 0,{syntheticEvent:u,nativeEvent:u.nativeEvent,value:u.target.value,target:a.current}),c.current=void 0},[e.onChange]);i.current=m;const w=e.name||e.id,A=n.useCallback(u=>{t.current&&(t.current.value=u);const g={target:t.current,currentTarget:t.current};m(g)},[m]);r.useKendoPaste(t,{fieldName:w,onValueChange:A});const{onFocus:D,onBlur:I}=r.useAsyncFocusBlur({onFocus:P,onBlur:j,onSyncFocus:E,onSyncBlur:N}),K=n.useMemo(()=>r.classNames("k-input","k-textbox",{[`k-input-${r.kendoThemeMaps.sizeMap[d]||d}`]:d,[`k-input-${v}`]:v,[`k-rounded-${r.kendoThemeMaps.roundedMap[f]||f}`]:f,"k-focus":h,"k-required":e.required,"k-disabled":e.disabled,"k-invalid":e.valid===!1},y),[y,v,h,e.disabled,e.required,e.valid,f,d]);return n.createElement("span",{style:S,dir:F,className:K,onFocus:D,onBlur:I},n.createElement(q,null),n.createElement("input",{ref:t,className:r.classNames(r.uTextBox.inputInner({c:M})),autoFocus:B,...Object.assign({},p,T),"aria-required":e.required,onChange:m}),n.createElement(z,null))}),o={prefix:e=>null,suffix:e=>null,size:void 0,rounded:void 0,fillMode:void 0,autoFocus:!1};x.propTypes={size:l.oneOf(["small","medium","large"]),rounded:l.oneOf(["small","medium","large","full","none"]),fillMode:l.oneOf(["solid","flat","outline"]),autoFocus:l.bool,inputAttributes:l.object};x.displayName="KendoReactTextBoxComponent";exports.TextBox=x;
|
package/textbox/Textbox.mjs
CHANGED
|
@@ -6,109 +6,120 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as t from "react";
|
|
9
|
-
import
|
|
10
|
-
import { useUnstyled as
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
var
|
|
14
|
-
return
|
|
15
|
-
}, []);
|
|
16
|
-
t.useImperativeHandle(
|
|
9
|
+
import a from "prop-types";
|
|
10
|
+
import { useUnstyled as G, useWebMcpRegister as U, useCustomComponent as y, useKendoPaste as W, useAsyncFocusBlur as J, classNames as C, kendoThemeMaps as k, uTextBox as L } from "@progress/kendo-react-common";
|
|
11
|
+
const B = t.forwardRef((e, F) => {
|
|
12
|
+
const n = t.useRef(null), o = t.useRef(null), s = t.useRef(void 0), v = G(), M = v && v.uTextBox, _ = t.useCallback(() => {
|
|
13
|
+
var u;
|
|
14
|
+
return s.current !== void 0 ? s.current : (u = n.current) == null ? void 0 : u.value;
|
|
15
|
+
}, []), l = t.useRef(null);
|
|
16
|
+
t.useImperativeHandle(o, () => ({
|
|
17
17
|
get element() {
|
|
18
|
-
return
|
|
18
|
+
return n.current;
|
|
19
19
|
},
|
|
20
20
|
get name() {
|
|
21
|
-
return
|
|
21
|
+
return n.current && n.current.name;
|
|
22
22
|
},
|
|
23
23
|
get value() {
|
|
24
|
-
return
|
|
24
|
+
return _();
|
|
25
|
+
},
|
|
26
|
+
setValue(m) {
|
|
27
|
+
var b;
|
|
28
|
+
n.current && (n.current.value = m);
|
|
29
|
+
const D = {
|
|
30
|
+
target: n.current,
|
|
31
|
+
currentTarget: n.current
|
|
32
|
+
};
|
|
33
|
+
(b = l.current) == null || b.call(l, D);
|
|
25
34
|
}
|
|
26
|
-
})), t.useImperativeHandle(
|
|
35
|
+
})), t.useImperativeHandle(F, () => o.current), U("textbox", o, e, e.webMcp);
|
|
27
36
|
const {
|
|
28
|
-
size:
|
|
29
|
-
fillMode:
|
|
30
|
-
rounded:
|
|
31
|
-
autoFocus:
|
|
32
|
-
inputAttributes:
|
|
33
|
-
className:
|
|
34
|
-
dir:
|
|
35
|
-
style:
|
|
36
|
-
prefix:
|
|
37
|
-
suffix:
|
|
38
|
-
valid:
|
|
39
|
-
onFocus:
|
|
40
|
-
onBlur:
|
|
37
|
+
size: c = r.size,
|
|
38
|
+
fillMode: f = r.fillMode,
|
|
39
|
+
rounded: i = r.rounded,
|
|
40
|
+
autoFocus: E = r.autoFocus,
|
|
41
|
+
inputAttributes: T,
|
|
42
|
+
className: x,
|
|
43
|
+
dir: R,
|
|
44
|
+
style: S,
|
|
45
|
+
prefix: z = r.prefix,
|
|
46
|
+
suffix: N = r.suffix,
|
|
47
|
+
valid: Q,
|
|
48
|
+
onFocus: q,
|
|
49
|
+
onBlur: P,
|
|
41
50
|
// Destruct to avoid warning when used inside a form field
|
|
42
|
-
modified:
|
|
43
|
-
touched:
|
|
44
|
-
visited:
|
|
45
|
-
validationMessage:
|
|
46
|
-
autoSize:
|
|
47
|
-
textareaStyle:
|
|
48
|
-
...
|
|
49
|
-
} = e, [p] =
|
|
50
|
-
|
|
51
|
-
},
|
|
52
|
-
|
|
51
|
+
modified: X,
|
|
52
|
+
touched: Y,
|
|
53
|
+
visited: Z,
|
|
54
|
+
validationMessage: ee,
|
|
55
|
+
autoSize: te,
|
|
56
|
+
textareaStyle: ne,
|
|
57
|
+
...O
|
|
58
|
+
} = e, [p] = y(z), [A] = y(N), [g, h] = t.useState(!1), I = (u) => {
|
|
59
|
+
h(!0);
|
|
60
|
+
}, K = (u) => {
|
|
61
|
+
h(!1);
|
|
53
62
|
}, d = t.useCallback(
|
|
54
|
-
(
|
|
55
|
-
|
|
56
|
-
syntheticEvent:
|
|
57
|
-
nativeEvent:
|
|
58
|
-
value:
|
|
59
|
-
target:
|
|
60
|
-
}),
|
|
63
|
+
(u) => {
|
|
64
|
+
s.current = u.target.value, e.onChange && e.onChange.call(void 0, {
|
|
65
|
+
syntheticEvent: u,
|
|
66
|
+
nativeEvent: u.nativeEvent,
|
|
67
|
+
value: u.target.value,
|
|
68
|
+
target: o.current
|
|
69
|
+
}), s.current = void 0;
|
|
61
70
|
},
|
|
62
71
|
[e.onChange]
|
|
63
|
-
)
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
72
|
+
);
|
|
73
|
+
l.current = d;
|
|
74
|
+
const V = e.name || e.id, $ = t.useCallback(
|
|
75
|
+
(u) => {
|
|
76
|
+
n.current && (n.current.value = u);
|
|
77
|
+
const m = {
|
|
78
|
+
target: n.current,
|
|
79
|
+
currentTarget: n.current
|
|
69
80
|
};
|
|
70
|
-
d(
|
|
81
|
+
d(m);
|
|
71
82
|
},
|
|
72
83
|
[d]
|
|
73
84
|
);
|
|
74
|
-
|
|
75
|
-
fieldName:
|
|
76
|
-
onValueChange:
|
|
85
|
+
W(n, {
|
|
86
|
+
fieldName: V,
|
|
87
|
+
onValueChange: $
|
|
77
88
|
});
|
|
78
|
-
const { onFocus:
|
|
79
|
-
onFocus:
|
|
80
|
-
onBlur:
|
|
81
|
-
onSyncFocus:
|
|
82
|
-
onSyncBlur:
|
|
83
|
-
}),
|
|
84
|
-
() =>
|
|
89
|
+
const { onFocus: j, onBlur: w } = J({
|
|
90
|
+
onFocus: I,
|
|
91
|
+
onBlur: K,
|
|
92
|
+
onSyncFocus: q,
|
|
93
|
+
onSyncBlur: P
|
|
94
|
+
}), H = t.useMemo(
|
|
95
|
+
() => C(
|
|
85
96
|
"k-input",
|
|
86
97
|
"k-textbox",
|
|
87
98
|
{
|
|
88
|
-
[`k-input-${
|
|
89
|
-
[`k-input-${
|
|
90
|
-
[`k-rounded-${
|
|
91
|
-
"k-focus":
|
|
99
|
+
[`k-input-${k.sizeMap[c] || c}`]: c,
|
|
100
|
+
[`k-input-${f}`]: f,
|
|
101
|
+
[`k-rounded-${k.roundedMap[i] || i}`]: i,
|
|
102
|
+
"k-focus": g,
|
|
92
103
|
"k-required": e.required,
|
|
93
104
|
"k-disabled": e.disabled,
|
|
94
105
|
"k-invalid": e.valid === !1
|
|
95
106
|
},
|
|
96
|
-
|
|
107
|
+
x
|
|
97
108
|
),
|
|
98
|
-
[
|
|
109
|
+
[x, f, g, e.disabled, e.required, e.valid, i, c]
|
|
99
110
|
);
|
|
100
|
-
return /* @__PURE__ */ t.createElement("span", { style:
|
|
111
|
+
return /* @__PURE__ */ t.createElement("span", { style: S, dir: R, className: H, onFocus: j, onBlur: w }, /* @__PURE__ */ t.createElement(p, null), /* @__PURE__ */ t.createElement(
|
|
101
112
|
"input",
|
|
102
113
|
{
|
|
103
|
-
ref:
|
|
104
|
-
className:
|
|
105
|
-
autoFocus:
|
|
106
|
-
...Object.assign({},
|
|
114
|
+
ref: n,
|
|
115
|
+
className: C(L.inputInner({ c: M })),
|
|
116
|
+
autoFocus: E,
|
|
117
|
+
...Object.assign({}, O, T),
|
|
107
118
|
"aria-required": e.required,
|
|
108
119
|
onChange: d
|
|
109
120
|
}
|
|
110
|
-
), /* @__PURE__ */ t.createElement(
|
|
111
|
-
}),
|
|
121
|
+
), /* @__PURE__ */ t.createElement(A, null));
|
|
122
|
+
}), r = {
|
|
112
123
|
prefix: (e) => null,
|
|
113
124
|
suffix: (e) => null,
|
|
114
125
|
size: void 0,
|
|
@@ -116,14 +127,14 @@ const k = t.forwardRef((e, y) => {
|
|
|
116
127
|
fillMode: void 0,
|
|
117
128
|
autoFocus: !1
|
|
118
129
|
};
|
|
119
|
-
|
|
120
|
-
size:
|
|
121
|
-
rounded:
|
|
122
|
-
fillMode:
|
|
123
|
-
autoFocus:
|
|
124
|
-
inputAttributes:
|
|
130
|
+
B.propTypes = {
|
|
131
|
+
size: a.oneOf(["small", "medium", "large"]),
|
|
132
|
+
rounded: a.oneOf(["small", "medium", "large", "full", "none"]),
|
|
133
|
+
fillMode: a.oneOf(["solid", "flat", "outline"]),
|
|
134
|
+
autoFocus: a.bool,
|
|
135
|
+
inputAttributes: a.object
|
|
125
136
|
};
|
|
126
|
-
|
|
137
|
+
B.displayName = "KendoReactTextBoxComponent";
|
|
127
138
|
export {
|
|
128
|
-
|
|
139
|
+
B as TextBox
|
|
129
140
|
};
|