@progress/kendo-react-inputs 8.1.0-develop.21 → 8.1.0-develop.23
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 +87 -90
- package/colors/ColorPicker.js +1 -1
- package/colors/ColorPicker.mjs +53 -54
- package/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/index.d.mts +1 -1
- package/index.d.ts +1 -1
- package/numerictextbox/NumericTextBox.js +1 -1
- package/numerictextbox/NumericTextBox.mjs +194 -194
- package/package-metadata.mjs +1 -1
- package/package.json +8 -8
- package/radiobutton/RadioButton.js +1 -1
- package/radiobutton/RadioButton.mjs +21 -22
- package/radiobutton/RadioGroup.js +1 -1
- package/radiobutton/RadioGroup.mjs +54 -55
- package/range-slider/RangeSlider.js +7 -7
- package/range-slider/RangeSlider.mjs +161 -156
- package/rating/Rating.js +3 -3
- package/rating/Rating.mjs +145 -134
- package/rating/RatingItem.js +1 -1
- package/rating/RatingItem.mjs +40 -41
- package/signature/Signature.js +1 -1
- package/signature/Signature.mjs +151 -133
- package/textarea/TextArea.js +1 -1
- package/textarea/TextArea.mjs +64 -65
- package/textbox/Textbox.js +1 -1
- package/textbox/Textbox.mjs +33 -34
package/index.d.mts
CHANGED
|
@@ -155,7 +155,7 @@ export declare interface CheckboxProps extends ToggleBaseProps, FormComponentPro
|
|
|
155
155
|
/**
|
|
156
156
|
* Sets the label of the Checkbox component ([see example]({% slug labels_checkbox %})).
|
|
157
157
|
*/
|
|
158
|
-
label?:
|
|
158
|
+
label?: React.ReactNode;
|
|
159
159
|
/**
|
|
160
160
|
* Sets the label position of the Checkbox component ([see example]({% slug labels_checkbox %})).
|
|
161
161
|
*/
|
package/index.d.ts
CHANGED
|
@@ -155,7 +155,7 @@ export declare interface CheckboxProps extends ToggleBaseProps, FormComponentPro
|
|
|
155
155
|
/**
|
|
156
156
|
* Sets the label of the Checkbox component ([see example]({% slug labels_checkbox %})).
|
|
157
157
|
*/
|
|
158
|
-
label?:
|
|
158
|
+
label?: React.ReactNode;
|
|
159
159
|
/**
|
|
160
160
|
* Sets the label position of the Checkbox component ([see example]({% slug labels_checkbox %})).
|
|
161
161
|
*/
|
|
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ae=require("react"),t=require("prop-types"),fe=require("@progress/kendo-react-intl"),o=require("@progress/kendo-react-common"),be=require("@progress/kendo-svg-icons"),He=require("@progress/kendo-react-labels"),we=require("../package-metadata.js"),g=require("../messages/index.js"),u=require("./utils/index.js"),pe=require("@progress/kendo-react-buttons");function Ke(m){const L=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(m){for(const v in m)if(v!=="default"){const N=Object.getOwnPropertyDescriptor(m,v);Object.defineProperty(L,v,N.get?N:{enumerable:!0,get:()=>m[v]})}}return L.default=m,Object.freeze(L)}const n=Ke(Ae),$e="Please enter a valid value!",ge=o.createPropsContext(),Q=n.forwardRef((m,L)=>{o.validatePackage(we.packageMetadata);const v=o.usePropsContext(ge,m),{className:N,value:k,defaultValue:ve,format:s,width:X,tabIndex:ye,accessKey:Ve,title:ke,placeholder:Z,min:f,max:b,dir:ee,name:_,label:R,id:Ce,ariaDescribedBy:Se,ariaLabelledBy:Ee,ariaLabel:xe,inputType:Oe,readOnly:C,validationMessage:G,children:Ie,style:te,inputStyle:he,valid:A,step:S=d.step,spinners:Le=d.spinners,disabled:c=d.disabled,required:H=d.required,validityStyles:ne=d.validityStyles,prefix:Pe=d.prefix,suffix:De=d.suffix,onChange:I=d.onChange,onFocus:re=d.onFocus,onBlur:ae=d.onBlur,rangeOnEnter:se=d.rangeOnEnter,size:w=d.size,rounded:K=d.rounded,fillMode:B=d.fillMode,...ue}=v,Ne=o.useId(),le=Ce||Ne,l=fe.useInternationalization(),M=fe.useLocalization(),a=n.useRef(null),q=n.useRef(),[Re,h]=n.useState(!1),i=n.useRef(u.getInitialState()),T=n.useRef(!1),$=n.useRef(),P=n.useRef(ve),D=u.formatValue(i.current.focused&&!c?i.current.currentLooseValue:u.getStateOrPropsValue(k,P.current),s,l);$.current=D;const[Be]=o.useCustomComponent(Pe),[Me]=o.useCustomComponent(De);n.useEffect(()=>{a.current&&a.current.setCustomValidity&&a.current.setCustomValidity(z().valid?"":G||$e)});const oe=n.useCallback(()=>{a.current&&a.current.focus()},[]),F=n.useCallback(()=>q.current!==void 0?q.current:u.getStateOrPropsValue(k,P.current),[k]),ce=n.useCallback(()=>_,[_]),j=n.useCallback(()=>H,[H]),z=n.useCallback(()=>{const r=G!==void 0,e=F(),x=A!==void 0?A:!i.current.valueIsOutOfRange&&(!j()||e!=null);return{customError:r,valid:x,valueMissing:e==null}},[G,A,F,j]),U=n.useCallback(()=>ne,[ne]),ie=n.useCallback(()=>v,[v]),E=n.useCallback(()=>{const r={element:a.current,focus:oe};return Object.defineProperty(r,"name",{get:ce}),Object.defineProperty(r,"value",{get:F}),Object.defineProperty(r,"validity",{get:z}),Object.defineProperty(r,"validityStyles",{get:U}),Object.defineProperty(r,"required",{get:j}),Object.defineProperty(r,"props",{get:ie}),r},[ce,F,z,U,j,oe,ie]);n.useImperativeHandle(L,E);const y=n.useCallback(()=>({eventValue:u.getStateOrPropsValue(k,P.current),prevLooseValue:$.current,currentLooseValue:a.current.value,selectionStart:a.current.selectionStart,selectionEnd:a.current.selectionEnd,decimalSelect:!1,valueIsCorrected:!1,valueIsOutOfRange:!1,isPaste:T.current,focused:i.current.focused}),[k]),V=n.useCallback((r,e)=>{if(c)return;q.current=e.eventValue,P.current=e.eventValue;const x=u.formatValue(u.rangeValue(e.eventValue,f,b),s,l),p=u.rangeValue(l.parseNumber(x,s),f,b);p!==e.eventValue&&(e.valueIsOutOfRange=!0,e.eventValue=p,P.current=p),k!==e.eventValue&&o.dispatchEvent(I,r,E(),{value:e.eventValue}),q.current=void 0,i.current=e,h(J=>!J)},[k,I,c,h,E]),qe=n.useCallback(r=>{const e=y();T.current=!1,V(r,u.sanitizeNumber(e,s,l))},[s,I,l,V,y]),Te=n.useCallback(r=>{let e=y();const x=l.parseNumber(String(e.currentLooseValue),s);if(e.selectionEnd>e.selectionStart&&e.selectionEnd-e.selectionStart===String(e.currentLooseValue).length){const p=l.numberSymbols(),O=p&&r.key===p.minusSign,J=p&&r.key===p.decimal;T.current=!O&&!J;return}switch(r.keyCode){case 38:u.increaseValue(x,e,S,f,b,s,l);break;case 40:u.decreaseValue(x,e,S,f,b,s,l);break;case 13:{if(se===!1)return;const p=u.formatValue(u.rangeValue(x,f,b),s,l),O=u.rangeValue(l.parseNumber(p,s),f,b);e.eventValue=O,e.currentLooseValue=u.formatValue(O,s,l),e.selectionStart=e.selectionEnd=e.currentLooseValue.length;break}case 110:{const p=a.current,O=l.numberSymbols();p&&(e.currentLooseValue=e.currentLooseValue.slice(0,e.selectionStart)+O.decimal+e.currentLooseValue.slice(e.selectionEnd),e.selectionStart=e.selectionEnd=e.selectionStart+1,e=u.sanitizeNumber(e,s,l));break}default:return}r.preventDefault(),V(r,e)},[s,f,b,S,I,se,V,y]),Fe=n.useCallback(()=>{T.current=!0},[]),W=n.useCallback(r=>{if(C||c)return;const e=y();u.increaseValue(l.parseNumber(String(e.currentLooseValue),s),e,S,f,b,s,l),V(r,e)},[s,f,b,S,I,C,c,V,y]),Y=n.useCallback(r=>{if(C||c)return;const e=y();u.decreaseValue(l.parseNumber(String(e.currentLooseValue),s),e,S,f,b,s,l),V(r,e)},[s,f,b,S,I,C,c,V,y]),je=n.useCallback(r=>{const e=o.getActiveElement(document);!document||e!==a.current||!a.current||C||c||(r.nativeEvent.deltaY<0&&W(r),r.nativeEvent.deltaY>0&&Y(r))},[W,Y,c,C]),ze=n.useCallback(r=>{i.current.currentLooseValue=$.current,i.current.focused=!0,o.dispatchEvent(re,r,E(),{}),h(e=>!e)},[re,h,E]),_e=n.useCallback(r=>{i.current=u.getInitialState(),o.dispatchEvent(ae,r,E(),{}),h(e=>!e)},[ae,h,E]),Ge=n.useCallback(r=>{if(document&&a.current){const e=o.getActiveElement(document);r.preventDefault(),e!==a.current&&a.current.focus()}},[]);o.useIsomorphicLayoutEffect(()=>{a.current&&a.current.type!=="number"&&i.current.selectionStart!==void 0&&i.current.selectionEnd!==void 0&&(a.current.selectionStart=i.current.selectionStart,a.current.selectionEnd=i.current.selectionEnd,i.current.selectionStart=void 0,i.current.selectionEnd=void 0)},[Re]);const de=!U()||z().valid,me=n.createElement("span",{dir:ee,style:R?te:{width:X,...te},className:o.classNames("k-input","k-numerictextbox",{[`k-input-${o.kendoThemeMaps.sizeMap[w]||w}`]:w,[`k-input-${B}`]:B,[`k-rounded-${o.kendoThemeMaps.roundedMap[K]||K}`]:K,"k-invalid":!de,"k-required":H,"k-disabled":c},N),"aria-disabled":c?"true":void 0,...R?{}:ue},n.createElement(Be,null),n.createElement("input",{role:"spinbutton",value:D===null?"":D,tabIndex:o.getTabIndex(ye,c),accessKey:Ve,disabled:c,title:ke,"aria-disabled":c?"true":void 0,"aria-valuemin":f,"aria-valuemax":b,"aria-label":xe,"aria-labelledby":Ee,"aria-describedby":Se,placeholder:Z,spellCheck:!1,autoComplete:"off",autoCorrect:"off",type:Oe||"tel",className:"k-input-inner",id:le,name:_,readOnly:C,style:he,onChange:qe,onFocus:ze,onBlur:_e,onKeyDown:Te,onPaste:Fe,onWheel:je,ref:a}),n.createElement(Me,null),Ie,Le&&n.createElement("span",{className:"k-input-spinner k-spin-button",onMouseDown:Ge},n.createElement(pe.Button,{tabIndex:-1,type:"button",icon:"caret-alt-up",svgIcon:be.caretAltUpIcon,rounded:null,fillMode:B,className:"k-spinner-increase","aria-label":M.toLanguageString(g.numericIncreaseValue,g.messages[g.numericIncreaseValue]),title:M.toLanguageString(g.numericIncreaseValue,g.messages[g.numericIncreaseValue]),onClick:W}),n.createElement(pe.Button,{tabIndex:-1,type:"button",icon:"caret-alt-down",svgIcon:be.caretAltDownIcon,rounded:null,fillMode:B,className:"k-spinner-decrease","aria-label":M.toLanguageString(g.numericDecreaseValue,g.messages[g.numericDecreaseValue]),title:M.toLanguageString(g.numericDecreaseValue,g.messages[g.numericDecreaseValue]),onClick:Y})));return R?n.createElement(He.FloatingLabel,{label:R,editorId:le,editorValue:D===null?"":D,editorValid:de,editorDisabled:c,editorPlaceholder:Z,children:me,style:{width:X},dir:ee,...ue}):me});Q.propTypes={value:t.number,defaultValue:t.number,step:t.number,format:t.oneOfType([t.string,t.shape({style:t.oneOf(["decimal","currency","percent","scientific","accounting"]),currency:t.string,currencyDisplay:t.oneOf(["symbol","code","name"]),useGrouping:t.bool,minimumIntegerDigits:t.number,minimumFractionDigits:t.number,maximumFractionDigits:t.number})]),width:t.oneOfType([t.string,t.number]),tabIndex:t.number,accessKey:t.string,title:t.string,placeholder:t.string,min:t.number,max:t.number,spinners:t.bool,disabled:t.bool,readOnly:t.bool,dir:t.string,name:t.string,label:t.string,validationMessage:t.string,required:t.bool,id:t.string,rangeOnEnter:t.bool,ariaLabelledBy:t.string,ariaDescribedBy:t.string,ariaLabel:t.string,onChange:t.func,onFocus:t.func,onBlur:t.func,size:t.oneOf([null,"small","medium","large"]),rounded:t.oneOf([null,"small","medium","large","full"]),fillMode:t.oneOf([null,"solid","flat","outline"])};const d={prefix:m=>null,suffix:m=>null,step:1,spinners:!0,disabled:!1,required:!1,validityStyles:!0,rangeOnEnter:!0,onChange:m=>{},onFocus:m=>{},onBlur:m=>{},size:"medium",rounded:"medium",fillMode:"solid"};Q.displayName="KendoNumericTextBox";exports.NumericTextBox=Q;exports.NumericTextBoxPropsContext=ge;
|