@progress/kendo-react-inputs 13.4.0-develop.2 → 13.4.0-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 +1 -1
- package/checkbox/Checkbox.mjs +23 -23
- package/checkbox/interfaces/CheckboxProps.d.ts +1 -1
- package/colors/ColorGradient.mjs +4 -4
- package/colors/ColorInput.d.ts +1 -1
- package/colors/ColorPicker.js +1 -1
- package/colors/ColorPicker.mjs +12 -12
- package/colors/FlatColorPicker.d.ts +1 -1
- package/colors/FlatColorPicker.mjs +11 -11
- package/colors/HexInput.d.ts +1 -1
- package/colors/interfaces/ColorGradientProps.d.ts +1 -1
- package/colors/interfaces/ColorPickerProps.d.ts +1 -1
- package/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/index.d.mts +1 -1
- package/index.d.ts +1 -1
- package/input/Input.mjs +13 -13
- package/maskedtextbox/MaskedTextBox.d.ts +1 -1
- package/maskedtextbox/MaskedTextBox.js +1 -1
- package/maskedtextbox/MaskedTextBox.mjs +15 -15
- package/maskedtextbox/MaskedTextBoxProps.d.ts +1 -1
- package/numerictextbox/NumericTextBox.js +1 -1
- package/numerictextbox/NumericTextBox.mjs +40 -40
- package/numerictextbox/interfaces/NumericTextBoxProps.d.ts +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +1 -1
- package/package.json +10 -10
- package/radiobutton/RadioButton.mjs +18 -18
- package/radiobutton/RadioGroup.mjs +15 -15
- package/range-slider/RangeSlider.mjs +15 -15
- package/rating/Rating.mjs +12 -12
- package/rating/RatingItem.mjs +4 -4
- package/signature/Signature.js +1 -1
- package/signature/Signature.mjs +13 -13
- package/signature/interfaces/SignatureProps.d.ts +1 -1
- package/slider/Slider.d.ts +12 -78
- package/slider/Slider.js +1 -1
- package/slider/Slider.mjs +241 -191
- package/switch/Switch.d.ts +11 -126
- package/switch/Switch.js +1 -1
- package/switch/Switch.mjs +187 -209
- package/textarea/TextArea.js +1 -1
- package/textarea/TextArea.mjs +21 -21
- package/textarea/interfaces/TextAreaProps.d.ts +1 -1
- package/textbox/Textbox.d.ts +2 -1
- package/textbox/Textbox.js +1 -1
- package/textbox/Textbox.mjs +19 -19
package/textarea/TextArea.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 me=require("react"),e=require("prop-types"),o=require("@progress/kendo-react-common");function pe(l){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const s in l)if(s!=="default"){const i=Object.getOwnPropertyDescriptor(l,s);Object.defineProperty(c,s,i.get?i:{enumerable:!0,get:()=>l[s]})}}return c.default=l,Object.freeze(c)}const t=pe(me),q=o.createPropsContext(),S=t.forwardRef((l,c)=>{const s=o.usePropsContext(q,l),{size:i=f.size,rounded:x=f.rounded,fillMode:T=f.fillMode,autoFocus:R=f.autoFocus,flow:v=f.flow,prefix:D=null,suffix:H=null,ariaDescribedBy:$,ariaLabelledBy:L,autoSize:m,className:_,defaultValue:K,disabled:r,readOnly:G,required:p,rows:J,id:Q,name:U,placeholder:W,style:X,tabIndex:Y,value:y,valid:P,validationMessage:w,validityStyles:M,onChange:h,onFocus:k,onBlur:C,visited:be,touched:ge,modified:xe,resizable:d,inputAttributes:Z,textareaStyle:E,...ee}=s,a=t.useRef(null),A=t.useCallback(()=>{a.current&&a.current.focus()},[]),F=t.useCallback(()=>{a.current&&a.current.blur()},[]),[I,V]=t.useState(K),[te,B]=t.useState(!1),[oe,ae]=o.useCustomComponent(D),[re,ne]=o.useCustomComponent(H),b=y!==void 0,g=b?y:I,u=t.useCallback(()=>({element:a,focus:A,blur:F,get value(){return g},get name(){return a.current&&a.current.name}}),[F,A,g]);t.useImperativeHandle(c,u);const[N,j]=t.useState("auto"),se=o.useId(),le=o.useDir(a,s.dir),z=P!==void 0?P:p?!!g:!0;t.useEffect(()=>{a.current&&a.current.setCustomValidity&&a.current.setCustomValidity(z?"":w||"")},[z,w]),o.useIsomorphicLayoutEffect(()=>{a.current&&j(`${a.current.scrollHeight}px`)},[g]);const ie=t.useCallback(n=>{const O=n.target.value;j("auto"),!b&&!r&&V(O),h&&!r&&o.dispatchEvent(h,n,{...u(),value:O},{value:O})},[V,h,r,b]),ue=t.useCallback(n=>{B(!0),k&&!r&&o.dispatchEvent(k,n,u(),void 0)},[k,r,u]),ce=t.useCallback(n=>{B(!1),C&&!r&&o.dispatchEvent(C,n,u(),void 0)},[C,r,u]),de=t.useMemo(()=>{let n={};return m?n={resize:"none",overflow:"hidden",height:N}:d&&(n={resize:d}),{...n,...E}},[m,d,N,E]),fe={id:Q||se,role:"textbox",name:U,className:o.classNames("k-input-inner","!k-overflow-auto",{"k-resize":!m&&d!=="none","k-resize-none":m||d==="none","!k-flex-none":v==="vertical"}),ref:a,disabled:r,rows:J,placeholder:W,readOnly:G,required:p,tabIndex:o.getTabIndex(Y,r),autoFocus:R,style:de,"aria-labelledby":L,"aria-describedby":$,"aria-multiline":!0,"aria-disabled":r||void 0,"aria-required":p,value:b?y:I,...Object.assign({},ee,Z),onChange:ie,onFocus:ue,onBlur:ce};return t.createElement("span",{className:o.classNames("k-input","k-textarea",{[`k-input-${o.kendoThemeMaps.sizeMap[i]||i}`]:i,[`k-input-${T}`]:T,[`k-rounded-${o.kendoThemeMaps.roundedMap[x]||x}`]:x,"k-invalid":!(z||M!==void 0||M===!0),"k-required":p,"k-disabled":r,"k-focus":te,"!k-flex-col":v==="vertical","!k-flex-row":v==="horizontal"},_),style:X,dir:le},s.prefix&&t.createElement(oe,{...ae}),t.createElement("textarea",{...fe}),s.suffix&&t.createElement(re,{...ne}))});S.propTypes={ariaDescribedBy:e.string,ariaLabelledBy:e.string,autoSize:e.bool,className:e.string,defaultValue:e.string,dir:e.string,disabled:e.bool,readOnly:e.bool,rows:e.number,id:e.string,name:e.string,placeholder:e.string,style:e.object,tabIndex:e.number,value:e.oneOfType([e.string,e.arrayOf(e.string),e.number]),onChange:e.func,onFocus:e.func,onBlur:e.func,size:e.oneOf(["small","medium","large"]),rounded:e.oneOf(["small","medium","large","full"]),fillMode:e.oneOf(["solid","flat","outline"]),resizable:e.oneOf(["none","both","horizontal","vertical"]),autoFocus:e.bool,flow:e.oneOf(["vertical","horizontal"])};const f={size:void 0,rounded:void 0,fillMode:void 0,autoFocus:!1,flow:"horizontal"};S.displayName="KendoTextArea";exports.TextArea=S;exports.TextAreaPropsContext=q;
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const me=require("react"),e=require("prop-types"),o=require("@progress/kendo-react-common");function pe(l){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const s in l)if(s!=="default"){const i=Object.getOwnPropertyDescriptor(l,s);Object.defineProperty(c,s,i.get?i:{enumerable:!0,get:()=>l[s]})}}return c.default=l,Object.freeze(c)}const t=pe(me),q=o.createPropsContext(),S=t.forwardRef((l,c)=>{const s=o.usePropsContext(q,l),{size:i=f.size,rounded:x=f.rounded,fillMode:T=f.fillMode,autoFocus:R=f.autoFocus,flow:v=f.flow,prefix:D=null,suffix:H=null,ariaDescribedBy:$,ariaLabelledBy:L,autoSize:m,className:_,defaultValue:K,disabled:r,readOnly:G,required:p,rows:J,id:Q,name:U,placeholder:W,style:X,tabIndex:Y,value:y,valid:P,validationMessage:w,validityStyles:M,onChange:h,onFocus:k,onBlur:C,visited:be,touched:ge,modified:xe,resizable:d,inputAttributes:Z,textareaStyle:E,...ee}=s,a=t.useRef(null),A=t.useCallback(()=>{a.current&&a.current.focus()},[]),F=t.useCallback(()=>{a.current&&a.current.blur()},[]),[I,V]=t.useState(K),[te,B]=t.useState(!1),[oe,ae]=o.useCustomComponent(D),[re,ne]=o.useCustomComponent(H),b=y!==void 0,g=b?y:I,u=t.useCallback(()=>({element:a,focus:A,blur:F,get value(){return g},get name(){return a.current&&a.current.name}}),[F,A,g]);t.useImperativeHandle(c,u);const[N,j]=t.useState("auto"),se=o.useId(),le=o.useDir(a,s.dir),z=P!==void 0?P:p?!!g:!0;t.useEffect(()=>{a.current&&a.current.setCustomValidity&&a.current.setCustomValidity(z?"":w||"")},[z,w]),o.useIsomorphicLayoutEffect(()=>{a.current&&j(`${a.current.scrollHeight}px`)},[g]);const ie=t.useCallback(n=>{const O=n.target.value;j("auto"),!b&&!r&&V(O),h&&!r&&o.dispatchEvent(h,n,{...u(),value:O},{value:O})},[V,h,r,b]),ue=t.useCallback(n=>{B(!0),k&&!r&&o.dispatchEvent(k,n,u(),void 0)},[k,r,u]),ce=t.useCallback(n=>{B(!1),C&&!r&&o.dispatchEvent(C,n,u(),void 0)},[C,r,u]),de=t.useMemo(()=>{let n={};return m?n={resize:"none",overflow:"hidden",height:N}:d&&(n={resize:d}),{...n,...E}},[m,d,N,E]),fe={id:Q||se,role:"textbox",name:U,className:o.classNames("k-input-inner","!k-overflow-auto",{"k-resize":!m&&d!=="none","k-resize-none":m||d==="none","!k-flex-none":v==="vertical"}),ref:a,disabled:r,rows:J,placeholder:W,readOnly:G,required:p,tabIndex:o.getTabIndex(Y,r),autoFocus:R,style:de,"aria-labelledby":L,"aria-describedby":$,"aria-multiline":!0,"aria-disabled":r||void 0,"aria-required":p,value:b?y:I,...Object.assign({},ee,Z),onChange:ie,onFocus:ue,onBlur:ce};return t.createElement("span",{className:o.classNames("k-input","k-textarea",{[`k-input-${o.kendoThemeMaps.sizeMap[i]||i}`]:i,[`k-input-${T}`]:T,[`k-rounded-${o.kendoThemeMaps.roundedMap[x]||x}`]:x,"k-invalid":!(z||M!==void 0||M===!0),"k-required":p,"k-disabled":r,"k-focus":te,"!k-flex-col":v==="vertical","!k-flex-row":v==="horizontal"},_),style:X,dir:le},s.prefix&&t.createElement(oe,{...ae}),t.createElement("textarea",{...fe}),s.suffix&&t.createElement(re,{...ne}))});S.propTypes={ariaDescribedBy:e.string,ariaLabelledBy:e.string,autoSize:e.bool,className:e.string,defaultValue:e.string,dir:e.string,disabled:e.bool,readOnly:e.bool,rows:e.number,id:e.string,name:e.string,placeholder:e.string,style:e.object,tabIndex:e.number,value:e.oneOfType([e.string,e.arrayOf(e.string),e.number]),onChange:e.func,onFocus:e.func,onBlur:e.func,size:e.oneOf(["small","medium","large"]),rounded:e.oneOf(["small","medium","large","full","none"]),fillMode:e.oneOf(["solid","flat","outline"]),resizable:e.oneOf(["none","both","horizontal","vertical"]),autoFocus:e.bool,flow:e.oneOf(["vertical","horizontal"])};const f={size:void 0,rounded:void 0,fillMode:void 0,autoFocus:!1,flow:"horizontal"};S.displayName="KendoTextArea";exports.TextArea=S;exports.TextAreaPropsContext=q;
|
package/textarea/TextArea.mjs
CHANGED
|
@@ -17,19 +17,19 @@ const ke = be(), R = t.forwardRef(($, q) => {
|
|
|
17
17
|
flow: b = n.flow,
|
|
18
18
|
prefix: L = null,
|
|
19
19
|
suffix: j = null,
|
|
20
|
-
ariaDescribedBy:
|
|
21
|
-
ariaLabelledBy:
|
|
20
|
+
ariaDescribedBy: _,
|
|
21
|
+
ariaLabelledBy: K,
|
|
22
22
|
autoSize: u,
|
|
23
|
-
className:
|
|
24
|
-
defaultValue:
|
|
23
|
+
className: G,
|
|
24
|
+
defaultValue: J,
|
|
25
25
|
disabled: o,
|
|
26
|
-
readOnly:
|
|
26
|
+
readOnly: Q,
|
|
27
27
|
required: d,
|
|
28
|
-
rows:
|
|
29
|
-
id:
|
|
30
|
-
name:
|
|
31
|
-
placeholder:
|
|
32
|
-
style:
|
|
28
|
+
rows: U,
|
|
29
|
+
id: W,
|
|
30
|
+
name: X,
|
|
31
|
+
placeholder: Y,
|
|
32
|
+
style: Z,
|
|
33
33
|
tabIndex: ee,
|
|
34
34
|
value: x,
|
|
35
35
|
valid: w,
|
|
@@ -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(
|
|
53
|
+
}, []), [E, M] = t.useState(J), [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,
|
|
@@ -103,9 +103,9 @@ const ke = be(), R = t.forwardRef(($, q) => {
|
|
|
103
103
|
...I
|
|
104
104
|
};
|
|
105
105
|
}, [u, l, V, I]), pe = {
|
|
106
|
-
id:
|
|
106
|
+
id: W || ie,
|
|
107
107
|
role: "textbox",
|
|
108
|
-
name:
|
|
108
|
+
name: X,
|
|
109
109
|
className: N("k-input-inner", "!k-overflow-auto", {
|
|
110
110
|
"k-resize": !u && l !== "none",
|
|
111
111
|
"k-resize-none": u || l === "none",
|
|
@@ -113,15 +113,15 @@ const ke = be(), R = t.forwardRef(($, q) => {
|
|
|
113
113
|
}),
|
|
114
114
|
ref: a,
|
|
115
115
|
disabled: o,
|
|
116
|
-
rows:
|
|
117
|
-
placeholder:
|
|
118
|
-
readOnly:
|
|
116
|
+
rows: U,
|
|
117
|
+
placeholder: Y,
|
|
118
|
+
readOnly: Q,
|
|
119
119
|
required: d,
|
|
120
120
|
tabIndex: ye(ee, o),
|
|
121
121
|
autoFocus: D,
|
|
122
122
|
style: me,
|
|
123
|
-
"aria-labelledby":
|
|
124
|
-
"aria-describedby":
|
|
123
|
+
"aria-labelledby": K,
|
|
124
|
+
"aria-describedby": _,
|
|
125
125
|
"aria-multiline": !0,
|
|
126
126
|
"aria-disabled": o || void 0,
|
|
127
127
|
"aria-required": d,
|
|
@@ -148,9 +148,9 @@ const ke = be(), R = t.forwardRef(($, q) => {
|
|
|
148
148
|
"!k-flex-col": b === "vertical",
|
|
149
149
|
"!k-flex-row": b === "horizontal"
|
|
150
150
|
},
|
|
151
|
-
|
|
151
|
+
G
|
|
152
152
|
),
|
|
153
|
-
style:
|
|
153
|
+
style: Z,
|
|
154
154
|
dir: ue
|
|
155
155
|
},
|
|
156
156
|
i.prefix && /* @__PURE__ */ t.createElement(re, { ...se }),
|
|
@@ -178,7 +178,7 @@ R.propTypes = {
|
|
|
178
178
|
onFocus: e.func,
|
|
179
179
|
onBlur: e.func,
|
|
180
180
|
size: e.oneOf(["small", "medium", "large"]),
|
|
181
|
-
rounded: e.oneOf(["small", "medium", "large", "full"]),
|
|
181
|
+
rounded: e.oneOf(["small", "medium", "large", "full", "none"]),
|
|
182
182
|
fillMode: e.oneOf(["solid", "flat", "outline"]),
|
|
183
183
|
resizable: e.oneOf(["none", "both", "horizontal", "vertical"]),
|
|
184
184
|
autoFocus: e.bool,
|
|
@@ -128,7 +128,7 @@ export interface TextAreaProps extends FormComponentProps, Omit<React.TextareaHT
|
|
|
128
128
|
* <TextArea rounded="full" />
|
|
129
129
|
* ```
|
|
130
130
|
*/
|
|
131
|
-
rounded?: 'small' | 'medium' | 'large' | 'full';
|
|
131
|
+
rounded?: 'small' | 'medium' | 'large' | 'full' | 'none';
|
|
132
132
|
/**
|
|
133
133
|
* Configures the `fillMode` of the TextArea.
|
|
134
134
|
*
|
package/textbox/Textbox.d.ts
CHANGED
|
@@ -40,10 +40,11 @@ export interface TextBoxProps extends Omit<React.InputHTMLAttributes<HTMLInputEl
|
|
|
40
40
|
* - medium
|
|
41
41
|
* - large
|
|
42
42
|
* - full
|
|
43
|
+
* - none
|
|
43
44
|
*
|
|
44
45
|
* @default `medium`
|
|
45
46
|
*/
|
|
46
|
-
rounded?: 'small' | 'medium' | 'large' | 'full';
|
|
47
|
+
rounded?: 'small' | 'medium' | 'large' | 'full' | 'none';
|
|
47
48
|
/**
|
|
48
49
|
* Configures the `fillMode` of the TextBox.
|
|
49
50
|
*
|
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 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;
|
|
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","none"]),fillMode:l.oneOf(["solid","flat","outline"]),autoFocus:l.bool,inputAttributes:l.object};m.displayName="KendoReactTextBoxComponent";exports.TextBox=m;
|
package/textbox/Textbox.mjs
CHANGED
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
import * as e from "react";
|
|
9
9
|
import a from "prop-types";
|
|
10
10
|
import { useUnstyled as j, useCustomComponent as x, useAsyncFocusBlur as H, classNames as g, kendoThemeMaps as h, uTextBox as w } from "@progress/kendo-react-common";
|
|
11
|
-
const
|
|
12
|
-
const o = e.useRef(null), i = e.useRef(null),
|
|
11
|
+
const _ = e.forwardRef((t, C) => {
|
|
12
|
+
const o = e.useRef(null), i = e.useRef(null), l = e.useRef(void 0), c = j(), k = c && c.uTextBox, y = e.useCallback(() => {
|
|
13
13
|
var n;
|
|
14
|
-
return
|
|
14
|
+
return l.current !== void 0 ? l.current : (n = o.current) == null ? void 0 : n.value;
|
|
15
15
|
}, []);
|
|
16
16
|
e.useImperativeHandle(i, () => ({
|
|
17
17
|
get element() {
|
|
@@ -21,15 +21,15 @@ const C = e.forwardRef((t, k) => {
|
|
|
21
21
|
return o.current && o.current.name;
|
|
22
22
|
},
|
|
23
23
|
get value() {
|
|
24
|
-
return
|
|
24
|
+
return y();
|
|
25
25
|
}
|
|
26
|
-
})), e.useImperativeHandle(
|
|
26
|
+
})), e.useImperativeHandle(C, () => i.current);
|
|
27
27
|
const {
|
|
28
|
-
size:
|
|
28
|
+
size: s = u.size,
|
|
29
29
|
fillMode: d = u.fillMode,
|
|
30
30
|
rounded: r = u.rounded,
|
|
31
|
-
autoFocus:
|
|
32
|
-
inputAttributes:
|
|
31
|
+
autoFocus: B = u.autoFocus,
|
|
32
|
+
inputAttributes: F,
|
|
33
33
|
className: f,
|
|
34
34
|
dir: b,
|
|
35
35
|
style: M,
|
|
@@ -52,12 +52,12 @@ const C = e.forwardRef((t, k) => {
|
|
|
52
52
|
v(!1);
|
|
53
53
|
}, A = e.useCallback(
|
|
54
54
|
(n) => {
|
|
55
|
-
|
|
55
|
+
l.current = n.target.value, t.onChange && t.onChange.call(void 0, {
|
|
56
56
|
syntheticEvent: n,
|
|
57
57
|
nativeEvent: n.nativeEvent,
|
|
58
58
|
value: n.target.value,
|
|
59
59
|
target: i.current
|
|
60
|
-
}),
|
|
60
|
+
}), l.current = void 0;
|
|
61
61
|
},
|
|
62
62
|
[t.onChange]
|
|
63
63
|
), { onFocus: I, onBlur: P } = H({
|
|
@@ -70,7 +70,7 @@ const C = e.forwardRef((t, k) => {
|
|
|
70
70
|
"k-input",
|
|
71
71
|
"k-textbox",
|
|
72
72
|
{
|
|
73
|
-
[`k-input-${h.sizeMap[
|
|
73
|
+
[`k-input-${h.sizeMap[s] || s}`]: s,
|
|
74
74
|
[`k-input-${d}`]: d,
|
|
75
75
|
[`k-rounded-${h.roundedMap[r] || r}`]: r,
|
|
76
76
|
"k-focus": m,
|
|
@@ -80,15 +80,15 @@ const C = e.forwardRef((t, k) => {
|
|
|
80
80
|
},
|
|
81
81
|
f
|
|
82
82
|
),
|
|
83
|
-
[f, d, m, t.disabled, t.required, t.valid, r,
|
|
83
|
+
[f, d, m, t.disabled, t.required, t.valid, r, s]
|
|
84
84
|
);
|
|
85
85
|
return /* @__PURE__ */ e.createElement("span", { style: M, dir: b, className: $, onFocus: I, onBlur: P }, /* @__PURE__ */ e.createElement(T, null), /* @__PURE__ */ e.createElement(
|
|
86
86
|
"input",
|
|
87
87
|
{
|
|
88
88
|
ref: o,
|
|
89
|
-
className: g(w.inputInner({ c:
|
|
90
|
-
autoFocus:
|
|
91
|
-
...Object.assign({}, R,
|
|
89
|
+
className: g(w.inputInner({ c: k })),
|
|
90
|
+
autoFocus: B,
|
|
91
|
+
...Object.assign({}, R, F),
|
|
92
92
|
"aria-required": t.required,
|
|
93
93
|
onChange: A
|
|
94
94
|
}
|
|
@@ -101,14 +101,14 @@ const C = e.forwardRef((t, k) => {
|
|
|
101
101
|
fillMode: void 0,
|
|
102
102
|
autoFocus: !1
|
|
103
103
|
};
|
|
104
|
-
|
|
104
|
+
_.propTypes = {
|
|
105
105
|
size: a.oneOf(["small", "medium", "large"]),
|
|
106
|
-
rounded: a.oneOf(["small", "medium", "large", "full"]),
|
|
106
|
+
rounded: a.oneOf(["small", "medium", "large", "full", "none"]),
|
|
107
107
|
fillMode: a.oneOf(["solid", "flat", "outline"]),
|
|
108
108
|
autoFocus: a.bool,
|
|
109
109
|
inputAttributes: a.object
|
|
110
110
|
};
|
|
111
|
-
|
|
111
|
+
_.displayName = "KendoReactTextBoxComponent";
|
|
112
112
|
export {
|
|
113
|
-
|
|
113
|
+
_ as TextBox
|
|
114
114
|
};
|