@progress/kendo-react-inputs 16.2.0-develop.2 → 16.2.0-develop.21
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/EULA.pdf +0 -0
- package/EULA.rtf +2730 -0
- package/EULA.txt +292 -0
- package/colors/ColorContrastSvg.js +1 -1
- package/colors/ColorContrastSvg.mjs +25 -23
- package/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +10 -15
- package/rating/Rating.js +1 -1
- package/rating/Rating.mjs +1 -1
- package/textarea/TextArea.js +1 -1
- package/textarea/TextArea.mjs +149 -132
package/package-metadata.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 e=Object.freeze({name:"@progress/kendo-react-inputs",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-inputs",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1791363726,version:"16.2.0-develop.21",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"});exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -7,7 +7,7 @@ export const packageMetadata = Object.freeze({
|
|
|
7
7
|
productName: 'KendoReact',
|
|
8
8
|
productCode: 'KENDOUIREACT',
|
|
9
9
|
productCodes: ['KENDOUIREACT'],
|
|
10
|
-
publishDate:
|
|
11
|
-
version: '16.2.0-develop.
|
|
10
|
+
publishDate: 1791363726,
|
|
11
|
+
version: '16.2.0-develop.21',
|
|
12
12
|
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/components/my-license/'
|
|
13
13
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-inputs",
|
|
3
|
-
"version": "16.2.0-develop.
|
|
3
|
+
"version": "16.2.0-develop.21",
|
|
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",
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
"@progress/kendo-drawing": "^1.25.5",
|
|
29
29
|
"@progress/kendo-inputs-common": "^3.1.0",
|
|
30
30
|
"@progress/kendo-licensing": "^1.7.2",
|
|
31
|
-
"@progress/kendo-react-animation": "16.2.0-develop.
|
|
32
|
-
"@progress/kendo-react-buttons": "16.2.0-develop.
|
|
33
|
-
"@progress/kendo-react-common": "16.2.0-develop.
|
|
34
|
-
"@progress/kendo-react-dialogs": "16.2.0-develop.
|
|
35
|
-
"@progress/kendo-react-layout": "16.2.0-develop.
|
|
36
|
-
"@progress/kendo-react-intl": "16.2.0-develop.
|
|
37
|
-
"@progress/kendo-react-labels": "16.2.0-develop.
|
|
38
|
-
"@progress/kendo-react-popup": "16.2.0-develop.
|
|
31
|
+
"@progress/kendo-react-animation": "16.2.0-develop.21",
|
|
32
|
+
"@progress/kendo-react-buttons": "16.2.0-develop.21",
|
|
33
|
+
"@progress/kendo-react-common": "16.2.0-develop.21",
|
|
34
|
+
"@progress/kendo-react-dialogs": "16.2.0-develop.21",
|
|
35
|
+
"@progress/kendo-react-layout": "16.2.0-develop.21",
|
|
36
|
+
"@progress/kendo-react-intl": "16.2.0-develop.21",
|
|
37
|
+
"@progress/kendo-react-labels": "16.2.0-develop.21",
|
|
38
|
+
"@progress/kendo-react-popup": "16.2.0-develop.21",
|
|
39
39
|
"@progress/kendo-svg-icons": "^4.9.0 || ^5.0.0",
|
|
40
40
|
"react": "^18.0.0 || ^19.0.0",
|
|
41
41
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"package": {
|
|
103
103
|
"productName": "KendoReact",
|
|
104
104
|
"productCode": "KENDOUIREACT",
|
|
105
|
-
"publishDate":
|
|
105
|
+
"publishDate": 1791363726,
|
|
106
106
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
107
107
|
}
|
|
108
108
|
},
|
|
@@ -112,10 +112,5 @@
|
|
|
112
112
|
},
|
|
113
113
|
"publishConfig": {
|
|
114
114
|
"access": "public"
|
|
115
|
-
},
|
|
116
|
-
"peerDependenciesMeta": {
|
|
117
|
-
"@progress/kendo-svg-icons": {
|
|
118
|
-
"optional": true
|
|
119
|
-
}
|
|
120
115
|
}
|
|
121
116
|
}
|
package/rating/Rating.js
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
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const X=require("react"),m=require("prop-types"),l=require("@progress/kendo-react-common"),J=require("./RatingItem.js"),c=require("./rating-reducer.js"),u=require("./utils/index.js");function Q(n){const p=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const d in n)if(d!=="default"){const e=Object.getOwnPropertyDescriptor(n,d);Object.defineProperty(p,d,e.get?e:{enumerable:!0,get:()=>n[d]})}}return p.default=n,Object.freeze(p)}const a=Q(X),P={name:"star",content:'<path d="m22.762 10.668-4.557 3.931 1.389 5.88a1.661 1.661 0 0 1-2.481 1.805L12 19.138l-5.116 3.146a1.661 1.661 0 0 1-2.478-1.805l1.394-5.88-4.557-3.931a1.667 1.667 0 0 1 .943-2.921l5.974-.482 2.304-5.577a1.656 1.656 0 0 1 3.065 0l2.304 5.577 5.973.482a1.667 1.667 0 0 1 .95 2.922z" />',viewBox:"0 0 24 24"},S={name:"star
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const X=require("react"),m=require("prop-types"),l=require("@progress/kendo-react-common"),J=require("./RatingItem.js"),c=require("./rating-reducer.js"),u=require("./utils/index.js");function Q(n){const p=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const d in n)if(d!=="default"){const e=Object.getOwnPropertyDescriptor(n,d);Object.defineProperty(p,d,e.get?e:{enumerable:!0,get:()=>n[d]})}}return p.default=n,Object.freeze(p)}const a=Q(X),P={name:"star",content:'<path d="m22.762 10.668-4.557 3.931 1.389 5.88a1.661 1.661 0 0 1-2.481 1.805L12 19.138l-5.116 3.146a1.661 1.661 0 0 1-2.478-1.805l1.394-5.88-4.557-3.931a1.667 1.667 0 0 1 .943-2.921l5.974-.482 2.304-5.577a1.656 1.656 0 0 1 3.065 0l2.304 5.577 5.973.482a1.667 1.667 0 0 1 .95 2.922z" />',viewBox:"0 0 24 24"},S={name:"star",content:'<path d="M23.065 8.95a1.44 1.44 0 0 0-1.267-1l-6.101-.493-2.351-5.691a1.454 1.454 0 0 0-2.691 0L8.304 7.454l-6.101.496A1.44 1.44 0 0 0 .936 8.951a1.46 1.46 0 0 0 .433 1.562l4.657 4.011-1.417 5.998a1.46 1.46 0 0 0 .567 1.52 1.43 1.43 0 0 0 1.61.061L12 18.898l5.222 3.211a1.43 1.43 0 0 0 1.611-.061 1.46 1.46 0 0 0 .566-1.52l-1.417-5.998 4.65-4.016a1.46 1.46 0 0 0 .433-1.564m-1.229.644-4.929 4.253a.61.61 0 0 0-.195.599l1.506 6.357a.24.24 0 0 1-.096.261.23.23 0 0 1-.262.009l-5.541-3.404a.61.61 0 0 0-.636 0l-5.54 3.403a.23.23 0 0 1-.263-.01.24.24 0 0 1-.101-.26l1.506-6.358a.61.61 0 0 0-.194-.598l-4.93-4.253a.24.24 0 0 1-.074-.269.23.23 0 0 1 .21-.167l6.471-.522a.61.61 0 0 0 .513-.373l2.493-6.035a.238.238 0 0 1 .444 0l2.494 6.035a.61.61 0 0 0 .512.373l6.472.522a.23.23 0 0 1 .21.167.24.24 0 0 1-.068.269z" />',viewBox:"0 0 24 24"},B=(n,p,d)=>{const[e,g]=a.useState(n);return[e,i=>{const O=c.ratingReducer(p.state||e,{...i,...p});d&&d(O,i.event),g(O)}]},z=l.createPropsContext(),_=a.forwardRef((n,p)=>{const d=l.usePropsContext(z,n),e={dir:s.dir,min:s.min,max:s.max,step:s.step,item:s.item,defaultValue:s.defaultValue,readonly:s.readonly,disabled:s.disabled,selection:s.selection,precision:s.precision,...d},g=a.useRef(null),A=a.useRef(null),i=l.useDir(A,e.dir);a.useImperativeHandle(g,()=>({element:A.current,props:e})),a.useImperativeHandle(p,()=>g.current),l.useWebMcpRegister("rating",g,e,e.webMcp);const O=a.useCallback((t,o)=>{e.onChange&&g.current&&e.onChange.call(void 0,{value:t,target:g.current,syntheticEvent:o})},[e.onChange]),h=a.useMemo(()=>e.min!==void 0?e.min:s.min,[e.min]),R=a.useMemo(()=>e.max!==void 0?e.max:s.max,[e.max]),I=a.useMemo(()=>e.precision||s.precision,[e.precision]),r=a.useMemo(()=>e.step!==void 0?e.step:s.step,[e.step]),C=a.useMemo(()=>e.readonly||s.readonly,[e.readonly]),N=a.useMemo(()=>e.disabled||s.disabled,[e.disabled]),F=a.useMemo(()=>e.item||s.item,[e.item]),[w,f]=B(e.defaultValue!==void 0?e.defaultValue:s.defaultValue,{state:e.value,min:h,max:R,step:I==="half"?r/2:r},O),[V,D]=B(null,{state:e.value,min:h,max:R,step:I==="half"?r/2:r,precision:I}),v=a.useMemo(()=>e.value!==void 0?e.value:w,[e.value,w]),T=a.useMemo(()=>V,[V]),E=a.useMemo(()=>e.selection||s.selection,[e.selection]),x=a.useMemo(()=>r/(I==="half"?2:1),[r,I]),H=a.useCallback(t=>{if(!(!t.target||!t.target.element||C||N)){if(I==="half"){const o=t.target.element.getBoundingClientRect(),k=u.calcIsFirstHalf(i||"ltr",o,t.syntheticEvent.clientX)?u.toRound(t.target.value-r/2,x):t.target.value;f({type:c.RATING_ACTION.select,payload:k,event:t.syntheticEvent})}else f({type:c.RATING_ACTION.select,payload:t.target.value,event:t.syntheticEvent});if(e.onClick){const o={value:v,target:g.current,syntheticEvent:t.syntheticEvent};e.onClick.call(void 0,o)}}},[e.onClick,f,v]),K=a.useCallback(t=>{if(!(C||N)){switch(t.keyCode){case l.Keys.right:t.preventDefault(),f({type:i==="rtl"?c.RATING_ACTION.decrease:c.RATING_ACTION.increase,event:t});break;case l.Keys.left:t.preventDefault(),f({type:i==="rtl"?c.RATING_ACTION.increase:c.RATING_ACTION.decrease,event:t});break;case l.Keys.home:t.preventDefault(),f({type:i==="rtl"?c.RATING_ACTION.min:c.RATING_ACTION.max,event:t});break;case l.Keys.end:t.preventDefault(),f({type:i==="rtl"?c.RATING_ACTION.max:c.RATING_ACTION.min,event:t});break;case l.Keys.esc:t.preventDefault(),f({type:c.RATING_ACTION.deselect,event:t});break}e.onKeyDown&&e.onKeyDown.call(void 0,{value:v,target:g.current,syntheticEvent:t})}},[e.onKeyDown,f,v]),W=a.useCallback(t=>{if(e.onFocus){const o={target:g.current,syntheticEvent:t};e.onFocus.call(void 0,o)}},[e.onFocus]),$=a.useCallback(t=>{if(e.onBlur){const o={target:g.current,syntheticEvent:t};e.onBlur.call(void 0,o)}},[e.onBlur]),q=a.useCallback(t=>{if(!(!t.target||!t.target.element))if(I==="half"){const o=t.target.element.getBoundingClientRect(),k=u.calcIsFirstHalf(i||"ltr",o,t.syntheticEvent.clientX)?t.target.value-r/2:t.target.value;D({type:c.RATING_ACTION.select,payload:k,event:t.syntheticEvent})}else D({type:c.RATING_ACTION.select,payload:t.target.value,event:t.syntheticEvent})},[I,r,i]),L=a.useCallback(t=>{D({type:c.RATING_ACTION.reset,event:t.syntheticEvent})},[]),G=[],j=u.getRemainder(u.toRound(R-h,x),r);for(let t=h||r;t<=R;t=u.toRound(t+r,x)){const o=u.toRound(t+j,x),y=I==="half"?u.isHalf(o,T!==null?T:v!==null?v:0,r):!1,k=u.isSelected(o,v,r,E),M=u.isSelected(o,T!==null?T:v,r,E),b=u.isSelected(o,T,r,E);G.push(a.createElement(F,{key:o,value:o,dir:i,title:String(y?u.toRound(o-r/2,x):o),icon:e.icon,svgIcon:e.svgIcon,half:y,selected:k||M,hovered:b,onClick:H,onMouseMove:q,onMouseLeave:L},y&&a.createElement("span",{className:"k-rating-precision-complement"},!(e.icon||e.svgIconOutline)&&a.createElement(l.IconWrap,{name:"star",icon:S,style:{clipPath:`${i==="rtl"?"inset(0 50% 0 0)":"inset(0 0 0 50%)"}`},size:"xlarge"}),(e.icon||e.svgIconOutline)&&a.createElement(l.IconWrap,{name:l.toIconName(`${e.icon}-outline`),icon:e.svgIconOutline,size:"xlarge"})),y&&a.createElement("span",{className:"k-rating-precision-part"},!(e.icon||e.svgIcon)&&a.createElement(l.IconWrap,{name:"star",icon:P,style:{clipPath:`${i==="rtl"?"inset(0 0 0 50%)":"inset(0 50% 0 0)"}`},size:"xlarge"}),(e.icon||e.svgIcon)&&a.createElement(l.IconWrap,{name:e.icon?l.toIconName(e.icon):void 0,icon:e.svgIcon,size:"xlarge"})),y&&a.createElement("span",{style:{width:"24px",height:"24px",display:"block"}}),!y&&!(e.icon||e.svgIcon)&&(b||M&&!b)&&a.createElement(l.IconWrap,{name:"star",icon:P,size:"xlarge"})||!(e.icon||e.svgIcon)&&!b&&!M&&a.createElement(l.IconWrap,{name:"star",icon:S,size:"xlarge"})||(e.icon||e.svgIcon)&&(b||M&&!b)&&a.createElement(l.IconWrap,{name:e.icon,icon:e.svgIcon,size:"xlarge"})||(e.icon||e.svgIcon)&&!b&&a.createElement(l.IconWrap,{name:l.toIconName(`${e.icon}-outline`),icon:e.svgIconOutline,size:"xlarge"})))}return a.createElement("span",{id:e.id,style:e.style,ref:A,role:"slider",dir:i,tabIndex:l.getTabIndex(e.tabIndex,e.disabled,void 0),className:l.classNames("k-rating",{"k-rtl":i==="rtl","k-readonly":C,"k-disabled":N},e.className),onKeyDown:K,onFocus:W,onBlur:$,"aria-valuemin":h,"aria-valuemax":R,"aria-valuenow":v!==null?v:void 0,"aria-disabled":N?"true":void 0,"aria-readonly":C?"true":void 0,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledBy,"aria-describedby":e.ariaDescribedBy},a.createElement("input",{type:"hidden",id:"rating",readOnly:C,disabled:N}),a.createElement("span",{className:"k-rating-container"},G),e.label&&a.createElement("span",{className:"k-rating-label"},e.label))}),U={id:m.string,dir:m.oneOf(["ltr","rtl"]),selection:m.oneOf(["continues","single"]),precision:m.oneOf(["item","half"]),value:(n,p,d)=>n.value&&n.min&&n.max&&n.step&&!(n.precision==="half"?u.isCorrectValue(n.min,n.max,n.step/2,n.value):u.isCorrectValue(n.min,n.max,n.step,n.value))&&n.precision==="half"?new Error(`Invalid prop + ${p} supplied to ${d}.
|
|
9
9
|
The value of the { value } property is not correct, please check your values.
|
|
10
10
|
`):null,defaultValue:m.number,min:m.number,max:m.number,step:(n,p,d)=>n.step!==void 0&&n.step<=0?new Error(`Invalid prop + ${p} supplied to ${d}.
|
|
11
11
|
The value of the { step } property is cannot be equal or less than "0", please check your values.
|
package/rating/Rating.mjs
CHANGED
|
@@ -16,7 +16,7 @@ const S = {
|
|
|
16
16
|
content: '<path d="m22.762 10.668-4.557 3.931 1.389 5.88a1.661 1.661 0 0 1-2.481 1.805L12 19.138l-5.116 3.146a1.661 1.661 0 0 1-2.478-1.805l1.394-5.88-4.557-3.931a1.667 1.667 0 0 1 .943-2.921l5.974-.482 2.304-5.577a1.656 1.656 0 0 1 3.065 0l2.304 5.577 5.973.482a1.667 1.667 0 0 1 .95 2.922z" />',
|
|
17
17
|
viewBox: "0 0 24 24"
|
|
18
18
|
}, A = {
|
|
19
|
-
name: "star
|
|
19
|
+
name: "star",
|
|
20
20
|
content: '<path d="M23.065 8.95a1.44 1.44 0 0 0-1.267-1l-6.101-.493-2.351-5.691a1.454 1.454 0 0 0-2.691 0L8.304 7.454l-6.101.496A1.44 1.44 0 0 0 .936 8.951a1.46 1.46 0 0 0 .433 1.562l4.657 4.011-1.417 5.998a1.46 1.46 0 0 0 .567 1.52 1.43 1.43 0 0 0 1.61.061L12 18.898l5.222 3.211a1.43 1.43 0 0 0 1.611-.061 1.46 1.46 0 0 0 .566-1.52l-1.417-5.998 4.65-4.016a1.46 1.46 0 0 0 .433-1.564m-1.229.644-4.929 4.253a.61.61 0 0 0-.195.599l1.506 6.357a.24.24 0 0 1-.096.261.23.23 0 0 1-.262.009l-5.541-3.404a.61.61 0 0 0-.636 0l-5.54 3.403a.23.23 0 0 1-.263-.01.24.24 0 0 1-.101-.26l1.506-6.358a.61.61 0 0 0-.194-.598l-4.93-4.253a.24.24 0 0 1-.074-.269.23.23 0 0 1 .21-.167l6.471-.522a.61.61 0 0 0 .513-.373l2.493-6.035a.238.238 0 0 1 .444 0l2.494 6.035a.61.61 0 0 0 .512.373l6.472.522a.23.23 0 0 1 .21.167.24.24 0 0 1-.068.269z" />',
|
|
21
21
|
viewBox: "0 0 24 24"
|
|
22
22
|
}, W = (n, v, g) => {
|
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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ze=require("react"),e=require("prop-types"),r=require("@progress/kendo-react-common");function Oe(i){const m=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const s in i)if(s!=="default"){const c=Object.getOwnPropertyDescriptor(i,s);Object.defineProperty(m,s,c.get?c:{enumerable:!0,get:()=>i[s]})}}return m.default=i,Object.freeze(m)}const t=Oe(ze),X=r.createPropsContext(),S=t.forwardRef((i,m)=>{const s=r.usePropsContext(X,i),{size:c=g.size,rounded:C=g.rounded,fillMode:F=g.fillMode,autoFocus:Y=g.autoFocus,flow:T=g.flow,prefix:Z=null,suffix:ee=null,ariaDescribedBy:te,ariaLabelledBy:oe,autoSize:d,className:ne,defaultValue:re,disabled:a,readOnly:se,required:v,rows:ae,id:H,name:I,placeholder:le,style:ie,tabIndex:ue,value:z,valid:V,validationMessage:N,validityStyles:A,onChange:O,onFocus:P,onBlur:w,visited:Pe,touched:we,modified:Ee,resizable:b,inputAttributes:h,textareaStyle:f,...ce}=s,o=t.useRef(null),B=t.useCallback(()=>{o.current&&o.current.focus()},[]),R=t.useCallback(()=>{o.current&&o.current.blur()},[]),[j,q]=t.useState(re),[de,L]=t.useState(!1),[fe,pe]=r.useCustomComponent(Z),[me,be]=r.useCustomComponent(ee),x=z!==void 0,y=x?z:j,D=I||H,u=t.useCallback(()=>({element:o,focus:B,blur:R,get value(){return y},get name(){return o.current&&o.current.name}}),[R,B,y]);t.useImperativeHandle(m,u);const $=t.useRef(null);t.useImperativeHandle($,u),r.useWebMcpRegister("textarea",$,s,s.webMcp);const[K,he]=t.useState("auto"),ge=r.useId(),ve=r.useDir(o,s.dir),E=V!==void 0?V:v?!!y:!0;t.useEffect(()=>{o.current&&o.current.setCustomValidity&&o.current.setCustomValidity(E?"":N||"")},[E,N]),r.useIsomorphicLayoutEffect(()=>{var G,J;const n=o.current;if(!n||!d||((J=(G=h==null?void 0:h.style)==null?void 0:G.height)!=null?J:f==null?void 0:f.height)!==void 0)return;const W=[];let l=n.parentElement;for(;l;)(l.scrollHeight>l.clientHeight||l.scrollWidth>l.clientWidth)&&W.push({node:l,top:l.scrollTop,left:l.scrollLeft}),l=l.parentElement;n.style.height="auto";const _=`${n.scrollHeight}px`;n.style.height=_;for(const{node:k,top:Q,left:U}of W)k.scrollTop!==Q&&(k.scrollTop=Q),k.scrollLeft!==U&&(k.scrollLeft=U);he(_)},[y,d,f,h]);const M=t.useCallback(n=>{const p=n.target.value;!x&&!a&&q(p),O&&!a&&r.dispatchEvent(O,n,{...u(),value:p},{value:p})},[q,O,a,x]),xe=t.useCallback(n=>{L(!0),P&&!a&&r.dispatchEvent(P,n,u(),void 0)},[P,a,u]),ye=t.useCallback(n=>{L(!1),w&&!a&&r.dispatchEvent(w,n,u(),void 0)},[w,a,u]),ke=t.useCallback(n=>{o.current&&(o.current.value=n);const p={target:o.current,currentTarget:o.current};M(p)},[M]);r.useKendoPaste(o,{fieldName:D,onValueChange:ke,enabled:!!D});const Ce=t.useMemo(()=>{let n={};return d?n={resize:"none",overflow:"hidden",height:K}:b&&(n={resize:b}),{...n,...f}},[d,b,K,f]),Te={id:H||ge,name:I,className:r.classNames("k-input-inner","!k-overflow-auto",{"k-resize":!d&&b!=="none","k-resize-none":d||b==="none","!k-flex-none":T==="vertical"}),ref:o,disabled:a,rows:ae,placeholder:le,readOnly:se,required:v,tabIndex:r.getTabIndex(ue,a),autoFocus:Y,style:Ce,"aria-labelledby":oe,"aria-describedby":te,"aria-required":v,value:x?z:j,...Object.assign({},ce,h),onChange:M,onFocus:xe,onBlur:ye};return t.createElement("span",{className:r.classNames("k-input","k-textarea",{[`k-input-${r.kendoThemeMaps.sizeMap[c]||c}`]:c,[`k-input-${F}`]:F,[`k-rounded-${r.kendoThemeMaps.roundedMap[C]||C}`]:C,"k-invalid":!(E||A!==void 0||A===!0),"k-required":v,"k-disabled":a,"k-focus":de,"!k-flex-col":T==="vertical","!k-flex-row":T==="horizontal"},ne),style:ie,dir:ve},s.prefix&&t.createElement(fe,{...pe}),t.createElement("textarea",{...Te}),s.suffix&&t.createElement(me,{...be}))});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 g={size:void 0,rounded:void 0,fillMode:void 0,autoFocus:!1,flow:"horizontal"};S.displayName="KendoTextArea";exports.TextArea=S;exports.TextAreaPropsContext=X;
|
package/textarea/TextArea.mjs
CHANGED
|
@@ -7,173 +7,190 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as t from "react";
|
|
9
9
|
import e from "prop-types";
|
|
10
|
-
import { usePropsContext as
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
size:
|
|
14
|
-
rounded:
|
|
15
|
-
fillMode:
|
|
16
|
-
autoFocus:
|
|
17
|
-
flow:
|
|
18
|
-
prefix:
|
|
19
|
-
suffix:
|
|
20
|
-
ariaDescribedBy:
|
|
21
|
-
ariaLabelledBy:
|
|
22
|
-
autoSize:
|
|
23
|
-
className:
|
|
24
|
-
defaultValue:
|
|
25
|
-
disabled:
|
|
26
|
-
readOnly:
|
|
27
|
-
required:
|
|
28
|
-
rows:
|
|
29
|
-
id:
|
|
30
|
-
name:
|
|
31
|
-
placeholder:
|
|
32
|
-
style:
|
|
33
|
-
tabIndex:
|
|
34
|
-
value:
|
|
35
|
-
valid:
|
|
36
|
-
validationMessage:
|
|
37
|
-
validityStyles:
|
|
38
|
-
onChange:
|
|
39
|
-
onFocus:
|
|
40
|
-
onBlur:
|
|
10
|
+
import { usePropsContext as Ee, useCustomComponent as Q, useWebMcpRegister as Pe, useId as Fe, useDir as He, useIsomorphicLayoutEffect as Ie, dispatchEvent as P, useKendoPaste as Me, getTabIndex as Ve, classNames as U, kendoThemeMaps as X, createPropsContext as Oe } from "@progress/kendo-react-common";
|
|
11
|
+
const Be = Oe(), Y = t.forwardRef((Z, _) => {
|
|
12
|
+
const a = Ee(Be, Z), {
|
|
13
|
+
size: v = m.size,
|
|
14
|
+
rounded: x = m.rounded,
|
|
15
|
+
fillMode: F = m.fillMode,
|
|
16
|
+
autoFocus: ee = m.autoFocus,
|
|
17
|
+
flow: y = m.flow,
|
|
18
|
+
prefix: te = null,
|
|
19
|
+
suffix: oe = null,
|
|
20
|
+
ariaDescribedBy: re,
|
|
21
|
+
ariaLabelledBy: le,
|
|
22
|
+
autoSize: i,
|
|
23
|
+
className: ne,
|
|
24
|
+
defaultValue: se,
|
|
25
|
+
disabled: l,
|
|
26
|
+
readOnly: ae,
|
|
27
|
+
required: p,
|
|
28
|
+
rows: ie,
|
|
29
|
+
id: H,
|
|
30
|
+
name: I,
|
|
31
|
+
placeholder: ue,
|
|
32
|
+
style: ce,
|
|
33
|
+
tabIndex: de,
|
|
34
|
+
value: k,
|
|
35
|
+
valid: M,
|
|
36
|
+
validationMessage: V,
|
|
37
|
+
validityStyles: O,
|
|
38
|
+
onChange: C,
|
|
39
|
+
onFocus: z,
|
|
40
|
+
onBlur: w,
|
|
41
41
|
// Removed to support direct use in Form Field component
|
|
42
|
-
visited:
|
|
43
|
-
touched:
|
|
44
|
-
modified:
|
|
45
|
-
resizable:
|
|
46
|
-
inputAttributes:
|
|
47
|
-
textareaStyle:
|
|
48
|
-
...
|
|
49
|
-
} =
|
|
50
|
-
|
|
51
|
-
}, []),
|
|
52
|
-
|
|
53
|
-
}, []), [
|
|
54
|
-
element:
|
|
55
|
-
focus:
|
|
56
|
-
blur:
|
|
42
|
+
visited: Se,
|
|
43
|
+
touched: Ne,
|
|
44
|
+
modified: Ae,
|
|
45
|
+
resizable: d,
|
|
46
|
+
inputAttributes: f,
|
|
47
|
+
textareaStyle: u,
|
|
48
|
+
...fe
|
|
49
|
+
} = a, o = t.useRef(null), B = t.useCallback(() => {
|
|
50
|
+
o.current && o.current.focus();
|
|
51
|
+
}, []), S = t.useCallback(() => {
|
|
52
|
+
o.current && o.current.blur();
|
|
53
|
+
}, []), [N, A] = t.useState(se), [me, R] = t.useState(!1), [pe, he] = Q(te), [be, ge] = Q(oe), h = k !== void 0, b = h ? k : N, L = I || H, s = t.useCallback(() => ({
|
|
54
|
+
element: o,
|
|
55
|
+
focus: B,
|
|
56
|
+
blur: S,
|
|
57
57
|
get value() {
|
|
58
|
-
return
|
|
58
|
+
return b;
|
|
59
59
|
},
|
|
60
60
|
get name() {
|
|
61
|
-
return
|
|
61
|
+
return o.current && o.current.name;
|
|
62
62
|
}
|
|
63
|
-
}), [
|
|
64
|
-
t.useImperativeHandle(
|
|
65
|
-
const
|
|
66
|
-
t.useImperativeHandle(
|
|
67
|
-
const [
|
|
63
|
+
}), [S, B, b]);
|
|
64
|
+
t.useImperativeHandle(_, s);
|
|
65
|
+
const $ = t.useRef(null);
|
|
66
|
+
t.useImperativeHandle($, s), Pe("textarea", $, a, a.webMcp);
|
|
67
|
+
const [q, ve] = t.useState("auto"), xe = Fe(), ye = He(o, a.dir), T = M !== void 0 ? M : p ? !!b : !0;
|
|
68
68
|
t.useEffect(() => {
|
|
69
|
-
|
|
70
|
-
}, [
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
o.current && o.current.setCustomValidity && o.current.setCustomValidity(T ? "" : V || "");
|
|
70
|
+
}, [T, V]), Ie(() => {
|
|
71
|
+
var W, j;
|
|
72
|
+
const r = o.current;
|
|
73
|
+
if (!r || !i || ((j = (W = f == null ? void 0 : f.style) == null ? void 0 : W.height) != null ? j : u == null ? void 0 : u.height) !== void 0)
|
|
74
|
+
return;
|
|
75
|
+
const D = [];
|
|
76
|
+
let n = r.parentElement;
|
|
77
|
+
for (; n; )
|
|
78
|
+
(n.scrollHeight > n.clientHeight || n.scrollWidth > n.clientWidth) && D.push({
|
|
79
|
+
node: n,
|
|
80
|
+
top: n.scrollTop,
|
|
81
|
+
left: n.scrollLeft
|
|
82
|
+
}), n = n.parentElement;
|
|
83
|
+
r.style.height = "auto";
|
|
84
|
+
const K = `${r.scrollHeight}px`;
|
|
85
|
+
r.style.height = K;
|
|
86
|
+
for (const { node: g, top: G, left: J } of D)
|
|
87
|
+
g.scrollTop !== G && (g.scrollTop = G), g.scrollLeft !== J && (g.scrollLeft = J);
|
|
88
|
+
ve(K);
|
|
89
|
+
}, [b, i, u, f]);
|
|
90
|
+
const E = t.useCallback(
|
|
74
91
|
(r) => {
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
92
|
+
const c = r.target.value;
|
|
93
|
+
!h && !l && A(c), C && !l && P(
|
|
94
|
+
C,
|
|
78
95
|
r,
|
|
79
96
|
{
|
|
80
|
-
...
|
|
81
|
-
value:
|
|
97
|
+
...s(),
|
|
98
|
+
value: c
|
|
82
99
|
},
|
|
83
|
-
{ value:
|
|
100
|
+
{ value: c }
|
|
84
101
|
);
|
|
85
102
|
},
|
|
86
|
-
[
|
|
87
|
-
),
|
|
103
|
+
[A, C, l, h]
|
|
104
|
+
), ke = t.useCallback(
|
|
88
105
|
(r) => {
|
|
89
|
-
|
|
106
|
+
R(!0), z && !l && P(z, r, s(), void 0);
|
|
90
107
|
},
|
|
91
|
-
[
|
|
92
|
-
),
|
|
108
|
+
[z, l, s]
|
|
109
|
+
), Ce = t.useCallback(
|
|
93
110
|
(r) => {
|
|
94
|
-
|
|
111
|
+
R(!1), w && !l && P(w, r, s(), void 0);
|
|
95
112
|
},
|
|
96
|
-
[
|
|
97
|
-
),
|
|
113
|
+
[w, l, s]
|
|
114
|
+
), ze = t.useCallback(
|
|
98
115
|
(r) => {
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
target:
|
|
102
|
-
currentTarget:
|
|
116
|
+
o.current && (o.current.value = r);
|
|
117
|
+
const c = {
|
|
118
|
+
target: o.current,
|
|
119
|
+
currentTarget: o.current
|
|
103
120
|
};
|
|
104
|
-
|
|
121
|
+
E(c);
|
|
105
122
|
},
|
|
106
|
-
[
|
|
123
|
+
[E]
|
|
107
124
|
);
|
|
108
|
-
|
|
109
|
-
fieldName:
|
|
110
|
-
onValueChange:
|
|
111
|
-
enabled: !!
|
|
125
|
+
Me(o, {
|
|
126
|
+
fieldName: L,
|
|
127
|
+
onValueChange: ze,
|
|
128
|
+
enabled: !!L
|
|
112
129
|
});
|
|
113
|
-
const
|
|
130
|
+
const we = t.useMemo(() => {
|
|
114
131
|
let r = {};
|
|
115
|
-
return
|
|
132
|
+
return i ? r = {
|
|
116
133
|
resize: "none",
|
|
117
134
|
overflow: "hidden",
|
|
118
|
-
height:
|
|
119
|
-
} :
|
|
135
|
+
height: q
|
|
136
|
+
} : d && (r = { resize: d }), {
|
|
120
137
|
...r,
|
|
121
|
-
...
|
|
138
|
+
...u
|
|
122
139
|
};
|
|
123
|
-
}, [
|
|
124
|
-
id:
|
|
125
|
-
name:
|
|
126
|
-
className:
|
|
127
|
-
"k-resize": !
|
|
128
|
-
"k-resize-none":
|
|
129
|
-
"!k-flex-none":
|
|
140
|
+
}, [i, d, q, u]), Te = {
|
|
141
|
+
id: H || xe,
|
|
142
|
+
name: I,
|
|
143
|
+
className: U("k-input-inner", "!k-overflow-auto", {
|
|
144
|
+
"k-resize": !i && d !== "none",
|
|
145
|
+
"k-resize-none": i || d === "none",
|
|
146
|
+
"!k-flex-none": y === "vertical"
|
|
130
147
|
}),
|
|
131
|
-
ref:
|
|
132
|
-
disabled:
|
|
133
|
-
rows:
|
|
134
|
-
placeholder:
|
|
135
|
-
readOnly:
|
|
136
|
-
required:
|
|
137
|
-
tabIndex:
|
|
138
|
-
autoFocus:
|
|
139
|
-
style:
|
|
140
|
-
"aria-labelledby":
|
|
141
|
-
"aria-describedby":
|
|
142
|
-
"aria-required":
|
|
143
|
-
value:
|
|
144
|
-
...Object.assign({},
|
|
145
|
-
onChange:
|
|
146
|
-
onFocus:
|
|
147
|
-
onBlur:
|
|
148
|
+
ref: o,
|
|
149
|
+
disabled: l,
|
|
150
|
+
rows: ie,
|
|
151
|
+
placeholder: ue,
|
|
152
|
+
readOnly: ae,
|
|
153
|
+
required: p,
|
|
154
|
+
tabIndex: Ve(de, l),
|
|
155
|
+
autoFocus: ee,
|
|
156
|
+
style: we,
|
|
157
|
+
"aria-labelledby": le,
|
|
158
|
+
"aria-describedby": re,
|
|
159
|
+
"aria-required": p,
|
|
160
|
+
value: h ? k : N,
|
|
161
|
+
...Object.assign({}, fe, f),
|
|
162
|
+
onChange: E,
|
|
163
|
+
onFocus: ke,
|
|
164
|
+
onBlur: Ce
|
|
148
165
|
};
|
|
149
166
|
return /* @__PURE__ */ t.createElement(
|
|
150
167
|
"span",
|
|
151
168
|
{
|
|
152
|
-
className:
|
|
169
|
+
className: U(
|
|
153
170
|
"k-input",
|
|
154
171
|
"k-textarea",
|
|
155
172
|
{
|
|
156
|
-
[`k-input-${
|
|
157
|
-
[`k-input-${
|
|
158
|
-
[`k-rounded-${
|
|
159
|
-
"k-invalid": !(
|
|
160
|
-
"k-required":
|
|
161
|
-
"k-disabled":
|
|
162
|
-
"k-focus":
|
|
163
|
-
"!k-flex-col":
|
|
164
|
-
"!k-flex-row":
|
|
173
|
+
[`k-input-${X.sizeMap[v] || v}`]: v,
|
|
174
|
+
[`k-input-${F}`]: F,
|
|
175
|
+
[`k-rounded-${X.roundedMap[x] || x}`]: x,
|
|
176
|
+
"k-invalid": !(T || O !== void 0 || O === !0),
|
|
177
|
+
"k-required": p,
|
|
178
|
+
"k-disabled": l,
|
|
179
|
+
"k-focus": me,
|
|
180
|
+
"!k-flex-col": y === "vertical",
|
|
181
|
+
"!k-flex-row": y === "horizontal"
|
|
165
182
|
},
|
|
166
|
-
|
|
183
|
+
ne
|
|
167
184
|
),
|
|
168
|
-
style:
|
|
169
|
-
dir:
|
|
185
|
+
style: ce,
|
|
186
|
+
dir: ye
|
|
170
187
|
},
|
|
171
|
-
|
|
172
|
-
/* @__PURE__ */ t.createElement("textarea", { ...
|
|
173
|
-
|
|
188
|
+
a.prefix && /* @__PURE__ */ t.createElement(pe, { ...he }),
|
|
189
|
+
/* @__PURE__ */ t.createElement("textarea", { ...Te }),
|
|
190
|
+
a.suffix && /* @__PURE__ */ t.createElement(be, { ...ge })
|
|
174
191
|
);
|
|
175
192
|
});
|
|
176
|
-
|
|
193
|
+
Y.propTypes = {
|
|
177
194
|
ariaDescribedBy: e.string,
|
|
178
195
|
ariaLabelledBy: e.string,
|
|
179
196
|
autoSize: e.bool,
|
|
@@ -199,15 +216,15 @@ L.propTypes = {
|
|
|
199
216
|
autoFocus: e.bool,
|
|
200
217
|
flow: e.oneOf(["vertical", "horizontal"])
|
|
201
218
|
};
|
|
202
|
-
const
|
|
219
|
+
const m = {
|
|
203
220
|
size: void 0,
|
|
204
221
|
rounded: void 0,
|
|
205
222
|
fillMode: void 0,
|
|
206
223
|
autoFocus: !1,
|
|
207
224
|
flow: "horizontal"
|
|
208
225
|
};
|
|
209
|
-
|
|
226
|
+
Y.displayName = "KendoTextArea";
|
|
210
227
|
export {
|
|
211
|
-
|
|
212
|
-
|
|
228
|
+
Y as TextArea,
|
|
229
|
+
Be as TextAreaPropsContext
|
|
213
230
|
};
|