@progress/kendo-react-inputs 13.4.0-develop.3 → 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 +1 -1
- package/checkbox/interfaces/CheckboxProps.d.ts +1 -1
- package/colors/ColorInput.d.ts +1 -1
- package/colors/ColorPicker.js +1 -1
- package/colors/ColorPicker.mjs +1 -1
- package/colors/FlatColorPicker.d.ts +1 -1
- 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/maskedtextbox/MaskedTextBox.d.ts +1 -1
- package/maskedtextbox/MaskedTextBox.js +1 -1
- package/maskedtextbox/MaskedTextBox.mjs +1 -1
- package/maskedtextbox/MaskedTextBoxProps.d.ts +1 -1
- package/numerictextbox/NumericTextBox.js +1 -1
- package/numerictextbox/NumericTextBox.mjs +34 -34
- 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/signature/Signature.js +1 -1
- package/signature/Signature.mjs +1 -1
- package/signature/interfaces/SignatureProps.d.ts +1 -1
- package/switch/Switch.d.ts +2 -2
- package/textarea/TextArea.js +1 -1
- package/textarea/TextArea.mjs +1 -1
- 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 +1 -1
|
@@ -58,7 +58,7 @@ export declare class MaskedTextBoxWithoutContext extends React.Component<MaskedT
|
|
|
58
58
|
validityStyles: PropTypes.Requireable<boolean>;
|
|
59
59
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
60
60
|
size: PropTypes.Requireable<"small" | "medium" | "large" | undefined>;
|
|
61
|
-
rounded: PropTypes.Requireable<"small" | "medium" | "large" | "full" | undefined>;
|
|
61
|
+
rounded: PropTypes.Requireable<"small" | "none" | "medium" | "large" | "full" | undefined>;
|
|
62
62
|
fillMode: PropTypes.Requireable<"flat" | "solid" | "outline" | undefined>;
|
|
63
63
|
autoFocus: PropTypes.Requireable<boolean>;
|
|
64
64
|
inputAttributes: PropTypes.Requireable<object>;
|
|
@@ -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 O=require("react"),e=require("prop-types"),M=require("./masking.service.js"),h=require("./utils.js"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react"),e=require("prop-types"),M=require("./masking.service.js"),h=require("./utils.js"),l=require("@progress/kendo-react-common"),E=require("@progress/kendo-react-labels");function V(u){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(u){for(const s in u)if(s!=="default"){const i=Object.getOwnPropertyDescriptor(u,s);Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>u[s]})}}return t.default=u,Object.freeze(t)}const p=V(O),n=class n extends p.Component{constructor(){super(...arguments),this.state={},this._inputId=`k_${this.props.id}`,this._service=new M.MaskingService,this._isPasted=!1,this._selection=[null,null],this._input=null,this.focus=()=>{this._input&&this._input.focus()},this.pasteHandler=t=>{const{selectionStart:s,selectionEnd:i}=t.target;i!==s&&(this._isPasted=!0,this._selection=[s||0,i||0])},this.onChangeHandler=t=>{const s=t.currentTarget,i=s.value,a=this._selection[0]||0,o=this._selection[1]||0;if(!this.props.mask){this._isPasted=!1,this._selection=[null,null],this.triggerOnChange(i,t);return}const r=this.value;let d;if(this._isPasted){this._isPasted=!1;const c=r.length-o,v=i.length-c;d=this._service.maskInRange(i.slice(a,v),r,a,o)}else d=this._service.maskInput(i,r,s.selectionStart||0);this._selection=[d.selection,d.selection],this.triggerOnChange(d.value,t)},this.focusHandler=t=>{this.state.focused||(this.setState({focused:!0}),this.props.onFocus&&this.props.onFocus.call(void 0,{target:this,syntheticEvent:t,nativeEvent:t.nativeEvent}))},this.blurHandler=t=>{this.state.focused&&(this.setState({focused:!1}),this.props.onBlur&&this.props.onBlur.call(void 0,{target:this,syntheticEvent:t,nativeEvent:t.nativeEvent}))},this.setValidity=()=>{this.element&&this.element.setCustomValidity(this.validity.valid?"":this.props.validationMessage||"")}}get element(){return this._input}get value(){return this._valueDuringOnChange!==void 0?this._valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value!==void 0?this.state.value:this.props.defaultValue!==void 0?this.props.defaultValue:""}get rawValue(){return this._service.rawValue(this.value)}get validity(){const t=this.value,s=this._service.validationValue(t),i=this.props.validationMessage!==void 0,a=this.props.valid!==void 0?this.props.valid:(!this.required||!!s)&&(!this.props.maskValidation||!this.props.prompt||t.indexOf(this.props.prompt)===-1);return{customError:i,valid:a,valueMissing:!s}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:n.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:!1}get name(){return this.props.name}componentDidUpdate(t,s){if(this.element&&this.state.focused&&s.focused){let[i,a]=this._selection;const o=t.selection,r=this.props.selection;(!o&&r||o&&r&&(o.start!==r.start||o.end!==r.end))&&(i=r.start,a=r.end),i!==null&&a!==null&&this.element.setSelectionRange(i,a)}h.maskingChanged(t,this.props)&&this.updateService(),this.setValidity()}componentDidMount(){this.updateService(),this.setValidity()}render(){const{size:t=n.defaultProps.size,fillMode:s=n.defaultProps.fillMode,rounded:i=n.defaultProps.rounded,autoFocus:a=n.defaultProps.autoFocus,prefix:o=n.defaultProps.prefix,suffix:r=n.defaultProps.suffix,inputAttributes:d,unstyled:c,className:v}=this.props,g=this.props.id||this._inputId,m=!this.validityStyles||this.validity.valid,b=this.props.style||{},C=c&&c.uMaskedTextBox,[_]=l.useCustomComponent(o),[P]=l.useCustomComponent(r),y=p.createElement("span",{dir:this.props.dir,className:l.classNames("k-input","k-maskedtextbox",{[`k-input-${l.kendoThemeMaps.sizeMap[t]||t}`]:t,[`k-input-${s}`]:s,[`k-rounded-${l.kendoThemeMaps.roundedMap[i]||i}`]:i,"k-invalid":!m,"k-disabled":this.props.disabled},v),style:this.props.label?b:{width:this.props.width,...b}},p.createElement(_,null),p.createElement("input",{type:"text",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",autoFocus:a,spellCheck:!1,className:l.classNames(l.uMaskedTextBox.inputInner({c:C})),value:this.value,id:g,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,"aria-placeholder":this.props.mask,"aria-required":this.props.required,name:this.props.name,tabIndex:l.getTabIndex(this.props.tabIndex,this.props.disabled,!0),accessKey:this.props.accessKey,title:this.props.title,disabled:this.props.disabled||void 0,readOnly:this.props.readonly||void 0,placeholder:this.props.placeholder,ref:S=>{this._input=S},onChange:this.onChangeHandler,onPaste:this.pasteHandler,onFocus:this.focusHandler,onBlur:this.blurHandler,onDragStart:h.returnFalse,onDrop:h.returnFalse,...d}),p.createElement(P,null));return this.props.label?p.createElement(E.FloatingLabel,{label:this.props.label,editorId:g,editorValue:this.value,editorValid:m,editorDisabled:this.props.disabled,editorPlaceholder:this.props.placeholder,children:y,style:{width:this.props.width},dir:this.props.dir}):y}triggerOnChange(t,s){if(this.setState({value:t}),this.props.onChange){this._valueDuringOnChange=t;const i={syntheticEvent:s,nativeEvent:s.nativeEvent,selectionStart:this._selection[0],selectionEnd:this._selection[1],target:this,value:this.value};this.props.onChange.call(void 0,i),this._valueDuringOnChange=void 0}}updateService(t){const s=Object.assign({includeLiterals:this.props.includeLiterals,mask:this.props.mask,prompt:this.props.prompt,promptPlaceholder:this.props.promptPlaceholder,rules:this.rules},t);this._service.update(s)}get rules(){return Object.assign({},h.defaultRules,this.props.rules)}};n.displayName="MaskedTextBox",n.propTypes={value:e.string,defaultValue:e.string,placeholder:e.string,title:e.string,dir:e.string,id:e.string,style:e.object,className:e.string,prefix:e.any,suffix:e.any,ariaLabelledBy:e.string,ariaDescribedBy:e.string,width:e.oneOfType([e.string,e.number]),tabIndex:e.number,accessKey:e.string,disabled:e.bool,readonly:e.bool,prompt:e.string,promptPlaceholder:e.string,includeLiterals:e.bool,maskValidation:e.bool,mask:e.string,rules:function(t,s,i){const a=t.rules;return a!==void 0&&!Object.entries(a).some(r=>typeof r!="string"||!(a[r]instanceof RegExp))?new Error("Invalid prop `"+s+"` supplied to `"+i+"`. Validation failed."):null},selection:e.shape({start:e.number.isRequired,end:e.number.isRequired}),name:e.string,label:e.node,validationMessage:e.string,required:e.bool,valid:e.bool,validityStyles:e.bool,onChange:e.func,size:e.oneOf(["small","medium","large"]),rounded:e.oneOf(["small","medium","large","full","none"]),fillMode:e.oneOf(["solid","flat","outline"]),autoFocus:e.bool,inputAttributes:e.object},n.defaultProps={prompt:"_",promptPlaceholder:" ",includeLiterals:!1,maskValidation:!0,rules:h.defaultRules,validityStyles:!0,prefix:t=>null,suffix:t=>null,size:void 0,rounded:void 0,fillMode:void 0,autoFocus:!1};let f=n;const k=l.createPropsContext(),x=l.withIdHOC(l.withPropsContext(k,l.withUnstyledHOC(f)));x.displayName="KendoReactMaskedTextBox";exports.MaskedTextBox=x;exports.MaskedTextBoxPropsContext=k;exports.MaskedTextBoxWithoutContext=f;
|
|
@@ -291,7 +291,7 @@ l.displayName = "MaskedTextBox", l.propTypes = {
|
|
|
291
291
|
validityStyles: e.bool,
|
|
292
292
|
onChange: e.func,
|
|
293
293
|
size: e.oneOf(["small", "medium", "large"]),
|
|
294
|
-
rounded: e.oneOf(["small", "medium", "large", "full"]),
|
|
294
|
+
rounded: e.oneOf(["small", "medium", "large", "full", "none"]),
|
|
295
295
|
fillMode: e.oneOf(["solid", "flat", "outline"]),
|
|
296
296
|
autoFocus: e.bool,
|
|
297
297
|
inputAttributes: e.object
|
|
@@ -240,7 +240,7 @@ export interface MaskedTextBoxProps extends FormComponentProps {
|
|
|
240
240
|
* <MaskedTextBox rounded="full" />
|
|
241
241
|
* ```
|
|
242
242
|
*/
|
|
243
|
-
rounded?: 'small' | 'medium' | 'large' | 'full';
|
|
243
|
+
rounded?: 'small' | 'medium' | 'large' | 'full' | 'none';
|
|
244
244
|
/**
|
|
245
245
|
* Configures the `fillMode` of the MaskedTextBox.
|
|
246
246
|
*
|
|
@@ -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 we=require("react"),t=require("prop-types"),fe=require("@progress/kendo-react-intl"),i=require("@progress/kendo-react-common"),be=require("@progress/kendo-svg-icons"),Ke=require("@progress/kendo-react-labels"),g=require("../messages/index.js"),u=require("./utils/index.js"),pe=require("@progress/kendo-react-buttons");function $e(m){const L=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(m){for(const v in m)if(v!=="default"){const R=Object.getOwnPropertyDescriptor(m,v);Object.defineProperty(L,v,R.get?R:{enumerable:!0,get:()=>m[v]})}}return L.default=m,Object.freeze(L)}const n=$e(we),Ue="Please enter a valid value!",ge=i.createPropsContext(),Q=n.forwardRef((m,L)=>{const v=i.usePropsContext(ge,m),{className:R,value:C,defaultValue:ve,format:s,width:X,tabIndex:ye,accessKey:Ve,title:ke,placeholder:Z,min:f,max:b,dir:ee,name:G,label:B,id:Ce,ariaDescribedBy:Se,ariaLabelledBy:Ee,ariaLabel:xe,inputType:Oe,readOnly:y,validationMessage:H,children:he,touched:We,visited:Ye,modified:Je,style:te,inputStyle:Ie,valid:w,step:S=c.step,spinners:Le=c.spinners,disabled:l=c.disabled,required:q=c.required,validityStyles:ne=c.validityStyles,prefix:Pe=c.prefix,suffix:De=c.suffix,onChange:h=c.onChange,onFocus:re=c.onFocus,onBlur:ae=c.onBlur,rangeOnEnter:se=c.rangeOnEnter,size:P=c.size,rounded:K=c.rounded,fillMode:M=c.fillMode,autoFocus:Ne=c.autoFocus,inputAttributes:Re,...ue}=v,Be=i.useId(),oe=Ce||Be,o=fe.useInternationalization(),T=fe.useLocalization(),a=n.useRef(null),F=n.useRef(void 0),[qe,I]=n.useState(!1),d=n.useRef(u.getInitialState()),j=n.useRef(!1),$=n.useRef(void 0),D=n.useRef(ve),N=u.formatValue(d.current.focused&&!l?d.current.currentLooseValue:u.getStateOrPropsValue(C,D.current),s,o);$.current=N;const[Me]=i.useCustomComponent(Pe),[Te]=i.useCustomComponent(De);n.useEffect(()=>{a.current&&a.current.setCustomValidity&&a.current.setCustomValidity(_().valid?"":H||Ue)});const le=n.useCallback(()=>{a.current&&a.current.focus()},[]),z=n.useCallback(()=>F.current!==void 0?F.current:u.getStateOrPropsValue(C,D.current),[C]),ce=n.useCallback(()=>G,[G]),A=n.useCallback(()=>q,[q]),_=n.useCallback(()=>{const r=H!==void 0,e=z(),x=w!==void 0?w:!d.current.valueIsOutOfRange&&(!A()||e!=null);return{customError:r,valid:x,valueMissing:e==null}},[H,w,z,A]),U=n.useCallback(()=>ne,[ne]),ie=n.useCallback(()=>v,[v]),E=n.useCallback(()=>{const r={element:a.current,focus:le};return Object.defineProperty(r,"name",{get:ce}),Object.defineProperty(r,"value",{get:z}),Object.defineProperty(r,"validity",{get:_}),Object.defineProperty(r,"validityStyles",{get:U}),Object.defineProperty(r,"required",{get:A}),Object.defineProperty(r,"props",{get:ie}),r},[ce,z,_,U,A,le,ie]);n.useImperativeHandle(L,E);const V=n.useCallback(()=>({eventValue:u.getStateOrPropsValue(C,D.current),prevLooseValue:$.current,currentLooseValue:a.current.value,selectionStart:a.current.selectionStart,selectionEnd:a.current.selectionEnd,decimalSelect:!1,valueIsCorrected:!1,valueIsOutOfRange:!1,isPaste:j.current,focused:d.current.focused}),[C]),k=n.useCallback((r,e)=>{if(l)return;F.current=e.eventValue,D.current=e.eventValue;const x=u.formatValue(u.rangeValue(e.eventValue,f,b),s,o),p=u.rangeValue(o.parseNumber(x,s),f,b);p!==e.eventValue&&(e.valueIsOutOfRange=!0,e.eventValue=p,D.current=p),C!==e.eventValue&&i.dispatchEvent(h,r,E(),{value:e.eventValue}),F.current=void 0,d.current=e,I(J=>!J)},[C,h,l,I,E]),Fe=n.useCallback(r=>{const e=V();j.current=!1,k(r,u.sanitizeNumber(e,s,o))},[s,h,o,k,V]),je=n.useCallback(r=>{if(y||l)return;let e=V();const x=o.parseNumber(String(e.currentLooseValue),s);if(e.selectionEnd>e.selectionStart&&e.selectionEnd-e.selectionStart===String(e.currentLooseValue).length){const p=o.numberSymbols(),O=p&&r.key===p.minusSign,J=p&&r.key===p.decimal;j.current=!O&&!J;return}switch(r.keyCode){case 38:u.increaseValue(x,e,S,f,b,s,o);break;case 40:u.decreaseValue(x,e,S,f,b,s,o);break;case 13:{if(se===!1)return;const p=u.formatValue(u.rangeValue(x,f,b),s,o),O=u.rangeValue(o.parseNumber(p,s),f,b);e.eventValue=O,e.currentLooseValue=u.formatValue(O,s,o),e.selectionStart=e.selectionEnd=e.currentLooseValue.length;break}case 110:{const p=a.current,O=o.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,o));break}default:return}r.preventDefault(),k(r,e)},[s,f,b,S,h,se,k,V]),ze=n.useCallback(()=>{j.current=!0},[]),W=n.useCallback(r=>{if(y||l)return;const e=V();u.increaseValue(o.parseNumber(String(e.currentLooseValue),s),e,S,f,b,s,o),k(r,e)},[s,f,b,S,h,y,l,k,V]),Y=n.useCallback(r=>{if(y||l)return;const e=V();u.decreaseValue(o.parseNumber(String(e.currentLooseValue),s),e,S,f,b,s,o),k(r,e)},[s,f,b,S,h,y,l,k,V]),Ae=n.useCallback(r=>{const e=i.getActiveElement(document);!document||e!==a.current||!a.current||y||l||(r.nativeEvent.deltaY<0&&W(r),r.nativeEvent.deltaY>0&&Y(r))},[W,Y,l,y]),_e=n.useCallback(r=>{d.current.currentLooseValue=$.current,d.current.focused=!0,i.dispatchEvent(re,r,E(),{}),I(e=>!e)},[re,I,E]),Ge=n.useCallback(r=>{d.current=u.getInitialState(),i.dispatchEvent(ae,r,E(),{}),I(e=>!e)},[ae,I,E]),He=n.useCallback(r=>{if(document&&a.current){const e=i.getActiveElement(document);r.preventDefault(),e!==a.current&&a.current.focus()}},[]);i.useIsomorphicLayoutEffect(()=>{a.current&&a.current.type!=="number"&&d.current.selectionStart!==void 0&&d.current.selectionEnd!==void 0&&(a.current.selectionStart=d.current.selectionStart,a.current.selectionEnd=d.current.selectionEnd,d.current.selectionStart=void 0,d.current.selectionEnd=void 0)},[qe]);const de=!U()||_().valid,me=n.createElement("span",{dir:ee,style:B?te:{width:X,...te},className:i.classNames("k-input","k-numerictextbox",{[`k-input-${i.kendoThemeMaps.sizeMap[P]||P}`]:P,[`k-input-${M}`]:M,[`k-rounded-${i.kendoThemeMaps.roundedMap[K]||K}`]:K,"k-invalid":!de,"k-required":q,"k-disabled":l},R),"aria-disabled":l?"true":void 0,...B?{}:ue},n.createElement(Me,null),n.createElement("input",{role:"spinbutton",value:N===null?"":N,tabIndex:i.getTabIndex(ye,l),accessKey:Ve,disabled:l,title:ke,"aria-disabled":l?"true":void 0,"aria-valuemin":f,"aria-valuemax":b,"aria-label":xe,"aria-labelledby":Ee,"aria-describedby":Se,"aria-required":q,placeholder:Z,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoFocus:Ne,type:Oe||"tel",className:"k-input-inner",id:oe,name:G,readOnly:y,style:Ie,onChange:Fe,onFocus:_e,onBlur:Ge,onKeyDown:je,onPaste:ze,onWheel:Ae,ref:a,...Re}),n.createElement(Te,null),he,Le&&n.createElement("span",{className:"k-input-spinner k-spin-button",onMouseDown:He},n.createElement(pe.Button,{tabIndex:-1,type:"button",icon:"caret-alt-up",svgIcon:be.caretAltUpIcon,fillMode:M,size:P,className:"k-spinner-increase","aria-label":T.toLanguageString(g.numericIncreaseValue,g.messages[g.numericIncreaseValue]),title:T.toLanguageString(g.numericIncreaseValue,g.messages[g.numericIncreaseValue]),onClick:W}),n.createElement(pe.Button,{tabIndex:-1,type:"button",icon:"caret-alt-down",svgIcon:be.caretAltDownIcon,fillMode:M,size:P,className:"k-spinner-decrease","aria-label":T.toLanguageString(g.numericDecreaseValue,g.messages[g.numericDecreaseValue]),title:T.toLanguageString(g.numericDecreaseValue,g.messages[g.numericDecreaseValue]),onClick:Y})));return B?n.createElement(Ke.FloatingLabel,{label:B,editorId:oe,editorValue:N===null?"":N,editorValid:de,editorDisabled:l,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(["small","medium","large"]),rounded:t.oneOf(["small","medium","large","full"]),fillMode:t.oneOf(["solid","flat","outline"]),inputAttributes:t.object};const c={prefix:m=>null,suffix:m=>null,step:1,spinners:!0,disabled:!1,required:!1,validityStyles:!0,rangeOnEnter:!0,autoFocus:!1,onChange:m=>{},onFocus:m=>{},onBlur:m=>{},size:void 0,rounded:void 0,fillMode:void 0};Q.displayName="KendoNumericTextBox";exports.NumericTextBox=Q;exports.NumericTextBoxPropsContext=ge;
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const we=require("react"),t=require("prop-types"),fe=require("@progress/kendo-react-intl"),i=require("@progress/kendo-react-common"),be=require("@progress/kendo-svg-icons"),Ke=require("@progress/kendo-react-labels"),g=require("../messages/index.js"),u=require("./utils/index.js"),pe=require("@progress/kendo-react-buttons");function $e(m){const L=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(m){for(const v in m)if(v!=="default"){const R=Object.getOwnPropertyDescriptor(m,v);Object.defineProperty(L,v,R.get?R:{enumerable:!0,get:()=>m[v]})}}return L.default=m,Object.freeze(L)}const n=$e(we),Ue="Please enter a valid value!",ge=i.createPropsContext(),Q=n.forwardRef((m,L)=>{const v=i.usePropsContext(ge,m),{className:R,value:C,defaultValue:ve,format:s,width:X,tabIndex:ye,accessKey:Ve,title:ke,placeholder:Z,min:f,max:b,dir:ee,name:G,label:B,id:Ce,ariaDescribedBy:Se,ariaLabelledBy:Ee,ariaLabel:xe,inputType:Oe,readOnly:y,validationMessage:H,children:he,touched:We,visited:Ye,modified:Je,style:te,inputStyle:Ie,valid:w,step:S=c.step,spinners:Le=c.spinners,disabled:l=c.disabled,required:q=c.required,validityStyles:ne=c.validityStyles,prefix:Pe=c.prefix,suffix:De=c.suffix,onChange:h=c.onChange,onFocus:re=c.onFocus,onBlur:ae=c.onBlur,rangeOnEnter:se=c.rangeOnEnter,size:P=c.size,rounded:K=c.rounded,fillMode:M=c.fillMode,autoFocus:Ne=c.autoFocus,inputAttributes:Re,...ue}=v,Be=i.useId(),oe=Ce||Be,o=fe.useInternationalization(),T=fe.useLocalization(),a=n.useRef(null),F=n.useRef(void 0),[qe,I]=n.useState(!1),d=n.useRef(u.getInitialState()),j=n.useRef(!1),$=n.useRef(void 0),D=n.useRef(ve),N=u.formatValue(d.current.focused&&!l?d.current.currentLooseValue:u.getStateOrPropsValue(C,D.current),s,o);$.current=N;const[Me]=i.useCustomComponent(Pe),[Te]=i.useCustomComponent(De);n.useEffect(()=>{a.current&&a.current.setCustomValidity&&a.current.setCustomValidity(_().valid?"":H||Ue)});const le=n.useCallback(()=>{a.current&&a.current.focus()},[]),z=n.useCallback(()=>F.current!==void 0?F.current:u.getStateOrPropsValue(C,D.current),[C]),ce=n.useCallback(()=>G,[G]),A=n.useCallback(()=>q,[q]),_=n.useCallback(()=>{const r=H!==void 0,e=z(),x=w!==void 0?w:!d.current.valueIsOutOfRange&&(!A()||e!=null);return{customError:r,valid:x,valueMissing:e==null}},[H,w,z,A]),U=n.useCallback(()=>ne,[ne]),ie=n.useCallback(()=>v,[v]),E=n.useCallback(()=>{const r={element:a.current,focus:le};return Object.defineProperty(r,"name",{get:ce}),Object.defineProperty(r,"value",{get:z}),Object.defineProperty(r,"validity",{get:_}),Object.defineProperty(r,"validityStyles",{get:U}),Object.defineProperty(r,"required",{get:A}),Object.defineProperty(r,"props",{get:ie}),r},[ce,z,_,U,A,le,ie]);n.useImperativeHandle(L,E);const V=n.useCallback(()=>({eventValue:u.getStateOrPropsValue(C,D.current),prevLooseValue:$.current,currentLooseValue:a.current.value,selectionStart:a.current.selectionStart,selectionEnd:a.current.selectionEnd,decimalSelect:!1,valueIsCorrected:!1,valueIsOutOfRange:!1,isPaste:j.current,focused:d.current.focused}),[C]),k=n.useCallback((r,e)=>{if(l)return;F.current=e.eventValue,D.current=e.eventValue;const x=u.formatValue(u.rangeValue(e.eventValue,f,b),s,o),p=u.rangeValue(o.parseNumber(x,s),f,b);p!==e.eventValue&&(e.valueIsOutOfRange=!0,e.eventValue=p,D.current=p),C!==e.eventValue&&i.dispatchEvent(h,r,E(),{value:e.eventValue}),F.current=void 0,d.current=e,I(J=>!J)},[C,h,l,I,E]),Fe=n.useCallback(r=>{const e=V();j.current=!1,k(r,u.sanitizeNumber(e,s,o))},[s,h,o,k,V]),je=n.useCallback(r=>{if(y||l)return;let e=V();const x=o.parseNumber(String(e.currentLooseValue),s);if(e.selectionEnd>e.selectionStart&&e.selectionEnd-e.selectionStart===String(e.currentLooseValue).length){const p=o.numberSymbols(),O=p&&r.key===p.minusSign,J=p&&r.key===p.decimal;j.current=!O&&!J;return}switch(r.keyCode){case 38:u.increaseValue(x,e,S,f,b,s,o);break;case 40:u.decreaseValue(x,e,S,f,b,s,o);break;case 13:{if(se===!1)return;const p=u.formatValue(u.rangeValue(x,f,b),s,o),O=u.rangeValue(o.parseNumber(p,s),f,b);e.eventValue=O,e.currentLooseValue=u.formatValue(O,s,o),e.selectionStart=e.selectionEnd=e.currentLooseValue.length;break}case 110:{const p=a.current,O=o.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,o));break}default:return}r.preventDefault(),k(r,e)},[s,f,b,S,h,se,k,V]),ze=n.useCallback(()=>{j.current=!0},[]),W=n.useCallback(r=>{if(y||l)return;const e=V();u.increaseValue(o.parseNumber(String(e.currentLooseValue),s),e,S,f,b,s,o),k(r,e)},[s,f,b,S,h,y,l,k,V]),Y=n.useCallback(r=>{if(y||l)return;const e=V();u.decreaseValue(o.parseNumber(String(e.currentLooseValue),s),e,S,f,b,s,o),k(r,e)},[s,f,b,S,h,y,l,k,V]),Ae=n.useCallback(r=>{const e=i.getActiveElement(document);!document||e!==a.current||!a.current||y||l||(r.nativeEvent.deltaY<0&&W(r),r.nativeEvent.deltaY>0&&Y(r))},[W,Y,l,y]),_e=n.useCallback(r=>{d.current.currentLooseValue=$.current,d.current.focused=!0,i.dispatchEvent(re,r,E(),{}),I(e=>!e)},[re,I,E]),Ge=n.useCallback(r=>{d.current=u.getInitialState(),i.dispatchEvent(ae,r,E(),{}),I(e=>!e)},[ae,I,E]),He=n.useCallback(r=>{if(document&&a.current){const e=i.getActiveElement(document);r.preventDefault(),e!==a.current&&a.current.focus()}},[]);i.useIsomorphicLayoutEffect(()=>{a.current&&a.current.type!=="number"&&d.current.selectionStart!==void 0&&d.current.selectionEnd!==void 0&&(a.current.selectionStart=d.current.selectionStart,a.current.selectionEnd=d.current.selectionEnd,d.current.selectionStart=void 0,d.current.selectionEnd=void 0)},[qe]);const de=!U()||_().valid,me=n.createElement("span",{dir:ee,style:B?te:{width:X,...te},className:i.classNames("k-input","k-numerictextbox",{[`k-input-${i.kendoThemeMaps.sizeMap[P]||P}`]:P,[`k-input-${M}`]:M,[`k-rounded-${i.kendoThemeMaps.roundedMap[K]||K}`]:K,"k-invalid":!de,"k-required":q,"k-disabled":l},R),"aria-disabled":l?"true":void 0,...B?{}:ue},n.createElement(Me,null),n.createElement("input",{role:"spinbutton",value:N===null?"":N,tabIndex:i.getTabIndex(ye,l),accessKey:Ve,disabled:l,title:ke,"aria-disabled":l?"true":void 0,"aria-valuemin":f,"aria-valuemax":b,"aria-label":xe,"aria-labelledby":Ee,"aria-describedby":Se,"aria-required":q,placeholder:Z,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoFocus:Ne,type:Oe||"tel",className:"k-input-inner",id:oe,name:G,readOnly:y,style:Ie,onChange:Fe,onFocus:_e,onBlur:Ge,onKeyDown:je,onPaste:ze,onWheel:Ae,ref:a,...Re}),n.createElement(Te,null),he,Le&&n.createElement("span",{className:"k-input-spinner k-spin-button",onMouseDown:He},n.createElement(pe.Button,{tabIndex:-1,type:"button",icon:"caret-alt-up",svgIcon:be.caretAltUpIcon,fillMode:M,size:P,className:"k-spinner-increase","aria-label":T.toLanguageString(g.numericIncreaseValue,g.messages[g.numericIncreaseValue]),title:T.toLanguageString(g.numericIncreaseValue,g.messages[g.numericIncreaseValue]),onClick:W}),n.createElement(pe.Button,{tabIndex:-1,type:"button",icon:"caret-alt-down",svgIcon:be.caretAltDownIcon,fillMode:M,size:P,className:"k-spinner-decrease","aria-label":T.toLanguageString(g.numericDecreaseValue,g.messages[g.numericDecreaseValue]),title:T.toLanguageString(g.numericDecreaseValue,g.messages[g.numericDecreaseValue]),onClick:Y})));return B?n.createElement(Ke.FloatingLabel,{label:B,editorId:oe,editorValue:N===null?"":N,editorValid:de,editorDisabled:l,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(["small","medium","large"]),rounded:t.oneOf(["small","medium","large","full","none"]),fillMode:t.oneOf(["solid","flat","outline"]),inputAttributes:t.object};const c={prefix:m=>null,suffix:m=>null,step:1,spinners:!0,disabled:!1,required:!1,validityStyles:!0,rangeOnEnter:!0,autoFocus:!1,onChange:m=>{},onFocus:m=>{},onBlur:m=>{},size:void 0,rounded:void 0,fillMode:void 0};Q.displayName="KendoNumericTextBox";exports.NumericTextBox=Q;exports.NumericTextBoxPropsContext=ge;
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
import * as r from "react";
|
|
9
9
|
import t from "prop-types";
|
|
10
10
|
import { useInternationalization as Xe, useLocalization as Ze } from "@progress/kendo-react-intl";
|
|
11
|
-
import { createPropsContext as et, usePropsContext as tt, useId as rt, useCustomComponent as pe, dispatchEvent as Q, getActiveElement as be, useIsomorphicLayoutEffect as nt, classNames as at, kendoThemeMaps as ge, getTabIndex as
|
|
12
|
-
import { caretAltUpIcon as
|
|
11
|
+
import { createPropsContext as et, usePropsContext as tt, useId as rt, useCustomComponent as pe, dispatchEvent as Q, getActiveElement as be, useIsomorphicLayoutEffect as nt, classNames as at, kendoThemeMaps as ge, getTabIndex as ot } from "@progress/kendo-react-common";
|
|
12
|
+
import { caretAltUpIcon as st, caretAltDownIcon as lt } from "@progress/kendo-svg-icons";
|
|
13
13
|
import { FloatingLabel as ut } from "@progress/kendo-react-labels";
|
|
14
14
|
import { numericIncreaseValue as T, messages as z, numericDecreaseValue as q } from "../messages/index.mjs";
|
|
15
15
|
import { getInitialState as ve, formatValue as A, getStateOrPropsValue as X, rangeValue as G, sanitizeNumber as ye, decreaseValue as Ve, increaseValue as ke } from "./utils/index.mjs";
|
|
@@ -23,7 +23,7 @@ const it = "Please enter a valid value!", ct = et(), Ee = r.forwardRef(
|
|
|
23
23
|
className: xe,
|
|
24
24
|
value: g,
|
|
25
25
|
defaultValue: he,
|
|
26
|
-
format:
|
|
26
|
+
format: o,
|
|
27
27
|
width: Z,
|
|
28
28
|
tabIndex: Ie,
|
|
29
29
|
accessKey: Oe,
|
|
@@ -58,18 +58,18 @@ const it = "Please enter a valid value!", ct = et(), Ee = r.forwardRef(
|
|
|
58
58
|
suffix: qe = u.suffix,
|
|
59
59
|
onChange: E = u.onChange,
|
|
60
60
|
onFocus: ae = u.onFocus,
|
|
61
|
-
onBlur:
|
|
62
|
-
rangeOnEnter:
|
|
61
|
+
onBlur: oe = u.onBlur,
|
|
62
|
+
rangeOnEnter: se = u.rangeOnEnter,
|
|
63
63
|
size: x = u.size,
|
|
64
64
|
rounded: w = u.rounded,
|
|
65
65
|
fillMode: P = u.fillMode,
|
|
66
66
|
autoFocus: Ae = u.autoFocus,
|
|
67
67
|
inputAttributes: Ge,
|
|
68
68
|
...le
|
|
69
|
-
} = _, _e = rt(), ue = Pe || _e,
|
|
69
|
+
} = _, _e = rt(), ue = Pe || _e, s = Xe(), N = Ze(), a = r.useRef(null), D = r.useRef(void 0), [je, S] = r.useState(!1), i = r.useRef(ve()), R = r.useRef(!1), U = r.useRef(void 0), h = r.useRef(he), I = A(
|
|
70
70
|
i.current.focused && !l ? i.current.currentLooseValue : X(g, h.current),
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
o,
|
|
72
|
+
s
|
|
73
73
|
);
|
|
74
74
|
U.current = I;
|
|
75
75
|
const [He] = pe(ze), [Ke] = pe(qe);
|
|
@@ -111,7 +111,7 @@ const it = "Please enter a valid value!", ct = et(), Ee = r.forwardRef(
|
|
|
111
111
|
if (l)
|
|
112
112
|
return;
|
|
113
113
|
D.current = e.eventValue, h.current = e.eventValue;
|
|
114
|
-
const V = A(G(e.eventValue, c, d),
|
|
114
|
+
const V = A(G(e.eventValue, c, d), o, s), m = G(s.parseNumber(V, o), c, d);
|
|
115
115
|
m !== e.eventValue && (e.valueIsOutOfRange = !0, e.eventValue = m, h.current = m), g !== e.eventValue && Q(E, n, y(), {
|
|
116
116
|
value: e.eventValue
|
|
117
117
|
}), D.current = void 0, i.current = e, S((J) => !J);
|
|
@@ -120,37 +120,37 @@ const it = "Please enter a valid value!", ct = et(), Ee = r.forwardRef(
|
|
|
120
120
|
), we = r.useCallback(
|
|
121
121
|
(n) => {
|
|
122
122
|
const e = p();
|
|
123
|
-
R.current = !1, b(n, ye(e,
|
|
123
|
+
R.current = !1, b(n, ye(e, o, s));
|
|
124
124
|
},
|
|
125
|
-
[
|
|
125
|
+
[o, E, s, b, p]
|
|
126
126
|
), Ue = r.useCallback(
|
|
127
127
|
(n) => {
|
|
128
128
|
if (f || l)
|
|
129
129
|
return;
|
|
130
130
|
let e = p();
|
|
131
|
-
const V =
|
|
131
|
+
const V = s.parseNumber(String(e.currentLooseValue), o);
|
|
132
132
|
if (e.selectionEnd > e.selectionStart && e.selectionEnd - e.selectionStart === String(e.currentLooseValue).length) {
|
|
133
|
-
const m =
|
|
133
|
+
const m = s.numberSymbols(), k = m && n.key === m.minusSign, J = m && n.key === m.decimal;
|
|
134
134
|
R.current = !k && !J;
|
|
135
135
|
return;
|
|
136
136
|
}
|
|
137
137
|
switch (n.keyCode) {
|
|
138
138
|
case 38:
|
|
139
|
-
ke(V, e, v, c, d,
|
|
139
|
+
ke(V, e, v, c, d, o, s);
|
|
140
140
|
break;
|
|
141
141
|
case 40:
|
|
142
|
-
Ve(V, e, v, c, d,
|
|
142
|
+
Ve(V, e, v, c, d, o, s);
|
|
143
143
|
break;
|
|
144
144
|
case 13: {
|
|
145
|
-
if (
|
|
145
|
+
if (se === !1)
|
|
146
146
|
return;
|
|
147
|
-
const m = A(G(V, c, d),
|
|
148
|
-
e.eventValue = k, e.currentLooseValue = A(k,
|
|
147
|
+
const m = A(G(V, c, d), o, s), k = G(s.parseNumber(m, o), c, d);
|
|
148
|
+
e.eventValue = k, e.currentLooseValue = A(k, o, s), e.selectionStart = e.selectionEnd = e.currentLooseValue.length;
|
|
149
149
|
break;
|
|
150
150
|
}
|
|
151
151
|
case 110: {
|
|
152
|
-
const m = a.current, k =
|
|
153
|
-
m && (e.currentLooseValue = e.currentLooseValue.slice(0, e.selectionStart) + k.decimal + e.currentLooseValue.slice(e.selectionEnd), e.selectionStart = e.selectionEnd = e.selectionStart + 1, e = ye(e,
|
|
152
|
+
const m = a.current, k = s.numberSymbols();
|
|
153
|
+
m && (e.currentLooseValue = e.currentLooseValue.slice(0, e.selectionStart) + k.decimal + e.currentLooseValue.slice(e.selectionEnd), e.selectionStart = e.selectionEnd = e.selectionStart + 1, e = ye(e, o, s));
|
|
154
154
|
break;
|
|
155
155
|
}
|
|
156
156
|
default:
|
|
@@ -158,7 +158,7 @@ const it = "Please enter a valid value!", ct = et(), Ee = r.forwardRef(
|
|
|
158
158
|
}
|
|
159
159
|
n.preventDefault(), b(n, e);
|
|
160
160
|
},
|
|
161
|
-
[
|
|
161
|
+
[o, c, d, v, E, se, b, p]
|
|
162
162
|
), $e = r.useCallback(() => {
|
|
163
163
|
R.current = !0;
|
|
164
164
|
}, []), W = r.useCallback(
|
|
@@ -167,32 +167,32 @@ const it = "Please enter a valid value!", ct = et(), Ee = r.forwardRef(
|
|
|
167
167
|
return;
|
|
168
168
|
const e = p();
|
|
169
169
|
ke(
|
|
170
|
-
|
|
170
|
+
s.parseNumber(String(e.currentLooseValue), o),
|
|
171
171
|
e,
|
|
172
172
|
v,
|
|
173
173
|
c,
|
|
174
174
|
d,
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
o,
|
|
176
|
+
s
|
|
177
177
|
), b(n, e);
|
|
178
178
|
},
|
|
179
|
-
[
|
|
179
|
+
[o, c, d, v, E, f, l, b, p]
|
|
180
180
|
), Y = r.useCallback(
|
|
181
181
|
(n) => {
|
|
182
182
|
if (f || l)
|
|
183
183
|
return;
|
|
184
184
|
const e = p();
|
|
185
185
|
Ve(
|
|
186
|
-
|
|
186
|
+
s.parseNumber(String(e.currentLooseValue), o),
|
|
187
187
|
e,
|
|
188
188
|
v,
|
|
189
189
|
c,
|
|
190
190
|
d,
|
|
191
|
-
|
|
192
|
-
|
|
191
|
+
o,
|
|
192
|
+
s
|
|
193
193
|
), b(n, e);
|
|
194
194
|
},
|
|
195
|
-
[
|
|
195
|
+
[o, c, d, v, E, f, l, b, p]
|
|
196
196
|
), We = r.useCallback(
|
|
197
197
|
(n) => {
|
|
198
198
|
const e = be(document);
|
|
@@ -206,9 +206,9 @@ const it = "Please enter a valid value!", ct = et(), Ee = r.forwardRef(
|
|
|
206
206
|
[ae, S, y]
|
|
207
207
|
), Je = r.useCallback(
|
|
208
208
|
(n) => {
|
|
209
|
-
i.current = ve(), Q(
|
|
209
|
+
i.current = ve(), Q(oe, n, y(), {}), S((e) => !e);
|
|
210
210
|
},
|
|
211
|
-
[
|
|
211
|
+
[oe, S, y]
|
|
212
212
|
), Qe = r.useCallback((n) => {
|
|
213
213
|
if (document && a.current) {
|
|
214
214
|
const e = be(document);
|
|
@@ -245,7 +245,7 @@ const it = "Please enter a valid value!", ct = et(), Ee = r.forwardRef(
|
|
|
245
245
|
{
|
|
246
246
|
role: "spinbutton",
|
|
247
247
|
value: I === null ? "" : I,
|
|
248
|
-
tabIndex:
|
|
248
|
+
tabIndex: ot(Ie, l),
|
|
249
249
|
accessKey: Oe,
|
|
250
250
|
disabled: l,
|
|
251
251
|
title: Le,
|
|
@@ -285,7 +285,7 @@ const it = "Please enter a valid value!", ct = et(), Ee = r.forwardRef(
|
|
|
285
285
|
tabIndex: -1,
|
|
286
286
|
type: "button",
|
|
287
287
|
icon: "caret-alt-up",
|
|
288
|
-
svgIcon:
|
|
288
|
+
svgIcon: st,
|
|
289
289
|
fillMode: P,
|
|
290
290
|
size: x,
|
|
291
291
|
className: "k-spinner-increase",
|
|
@@ -378,7 +378,7 @@ Ee.propTypes = {
|
|
|
378
378
|
onFocus: t.func,
|
|
379
379
|
onBlur: t.func,
|
|
380
380
|
size: t.oneOf(["small", "medium", "large"]),
|
|
381
|
-
rounded: t.oneOf(["small", "medium", "large", "full"]),
|
|
381
|
+
rounded: t.oneOf(["small", "medium", "large", "full", "none"]),
|
|
382
382
|
fillMode: t.oneOf(["solid", "flat", "outline"]),
|
|
383
383
|
inputAttributes: t.object
|
|
384
384
|
};
|
|
@@ -174,7 +174,7 @@ export interface NumericTextBoxProps extends FormComponentProps, Omit<React.HTML
|
|
|
174
174
|
* <NumericTextBox rounded="full" />
|
|
175
175
|
* ```
|
|
176
176
|
*/
|
|
177
|
-
rounded?: 'small' | 'medium' | 'large' | 'full';
|
|
177
|
+
rounded?: 'small' | 'medium' | 'large' | 'full' | 'none';
|
|
178
178
|
/**
|
|
179
179
|
* Configures the `fillMode` of the NumericTextBox.
|
|
180
180
|
*
|
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: 1770362866,version:"13.4.0-develop.4",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"});exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -8,6 +8,6 @@ export const packageMetadata = Object.freeze({
|
|
|
8
8
|
productCode: 'KENDOUIREACT',
|
|
9
9
|
productCodes: ['KENDOUIREACT'],
|
|
10
10
|
publishDate: 0,
|
|
11
|
-
version: '13.4.0-develop.
|
|
11
|
+
version: '13.4.0-develop.4',
|
|
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": "13.4.0-develop.
|
|
3
|
+
"version": "13.4.0-develop.4",
|
|
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.21.2",
|
|
29
29
|
"@progress/kendo-inputs-common": "^3.1.0",
|
|
30
30
|
"@progress/kendo-licensing": "^1.7.2",
|
|
31
|
-
"@progress/kendo-react-animation": "13.4.0-develop.
|
|
32
|
-
"@progress/kendo-react-buttons": "13.4.0-develop.
|
|
33
|
-
"@progress/kendo-react-common": "13.4.0-develop.
|
|
34
|
-
"@progress/kendo-react-dialogs": "13.4.0-develop.
|
|
35
|
-
"@progress/kendo-react-layout": "13.4.0-develop.
|
|
36
|
-
"@progress/kendo-react-intl": "13.4.0-develop.
|
|
37
|
-
"@progress/kendo-react-labels": "13.4.0-develop.
|
|
38
|
-
"@progress/kendo-react-popup": "13.4.0-develop.
|
|
31
|
+
"@progress/kendo-react-animation": "13.4.0-develop.4",
|
|
32
|
+
"@progress/kendo-react-buttons": "13.4.0-develop.4",
|
|
33
|
+
"@progress/kendo-react-common": "13.4.0-develop.4",
|
|
34
|
+
"@progress/kendo-react-dialogs": "13.4.0-develop.4",
|
|
35
|
+
"@progress/kendo-react-layout": "13.4.0-develop.4",
|
|
36
|
+
"@progress/kendo-react-intl": "13.4.0-develop.4",
|
|
37
|
+
"@progress/kendo-react-labels": "13.4.0-develop.4",
|
|
38
|
+
"@progress/kendo-react-popup": "13.4.0-develop.4",
|
|
39
39
|
"@progress/kendo-svg-icons": "^4.0.0",
|
|
40
40
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
41
41
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"package": {
|
|
83
83
|
"productName": "KendoReact",
|
|
84
84
|
"productCode": "KENDOUIREACT",
|
|
85
|
-
"publishDate":
|
|
85
|
+
"publishDate": 1770362866,
|
|
86
86
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
87
87
|
}
|
|
88
88
|
},
|
package/signature/Signature.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 ze=require("@progress/kendo-inputs-common"),_=require("@progress/kendo-react-buttons"),a=require("@progress/kendo-react-common"),Oe=require("@progress/kendo-react-dialogs"),Ee=require("@progress/kendo-react-intl"),r=require("prop-types"),xe=require("react"),p=require("../messages/index.js"),ne=require("../package-metadata.js"),Me=require("./utils/index.js"),N=require("@progress/kendo-svg-icons");function we(c){const k=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const g in c)if(g!=="default"){const v=Object.getOwnPropertyDescriptor(c,g);Object.defineProperty(k,g,v.get?v:{enumerable:!0,get:()=>c[g]})}}return k.default=c,Object.freeze(k)}const n=we(xe),Ie=250,Le=84,ae=3,re=2,Pe="#000000",qe="#ffffff",oe=c=>c!==void 0,se=a.createPropsContext(),E=n.forwardRef((c,k)=>{const g=!a.validatePackage(ne.packageMetadata,{component:"Signature"}),v=a.getLicenseMessage(ne.packageMetadata),F=a.usePropsContext(se,c),e=n.useMemo(()=>({strokeWidth:l.strokeWidth,smooth:l.smooth,popupScale:l.popupScale,exportScale:l.exportScale,maximizable:l.maximizable,disabled:l.disabled,required:l.required,validityStyles:l.validityStyles,onChange:l.onChange,onFocus:l.onFocus,onBlur:l.onBlur,onOpen:l.onOpen,onClose:l.onClose,size:l.size,rounded:l.rounded,fillMode:l.fillMode,...F}),[F]),x=Ee.useLocalization(),d=n.useRef(null),y=n.useRef(null),j=n.useRef(null),W=n.useRef(null),M=n.useRef(null),[s,ie]=n.useState(),[h,G]=n.useState(!1),[w,A]=n.useState(!1),[C,V]=n.useState(),[le,ce]=n.useState(),U=oe(e.value)?e.value:C,[ue,de]=n.useState(!1),b=oe(e.open),f=b?e.open:ue,me=e.maximized||w||!e.maximizable||e.disabled,pe=!(e.maximized&&!w),ge=!(!(e.value||C)||w||e.readOnly||e.disabled),H=x.toLanguageString(p.signatureMaximize,p.messages[p.signatureMaximize]),$=x.toLanguageString(p.signatureMinimize,p.messages[p.signatureMinimize]),K=x.toLanguageString(p.signatureClear,p.messages[p.signatureClear]),I=e.popupScale||ae,L=e.exportScale||re,P=t=>{V(t),e.onChange&&e.onChange({value:t})},fe=t=>{s==null||s.loadImage(t.value),P(t.value)};n.useEffect(()=>{e.value!==C&&(V(e.value),s==null||s.loadImage(e.value))},[e.value]);const ke=()=>{s==null||s.clear(),P()},S=n.useCallback(t=>{b||de(t)},[b]),be=t=>{var o,i;Z(t),(i=((o=M.current)==null?void 0:o.element)||y.current)==null||i.focus()},q=n.useCallback(()=>{let t=Pe;return!e.color&&typeof document!="undefined"&&d.current&&(t=getComputedStyle(d.current).color),e.color||t},[e.color]),D=n.useCallback(()=>{let t=qe;return!e.backgroundColor&&typeof document!="undefined"&&d.current&&(t=getComputedStyle(d.current).backgroundColor),e.backgroundColor||t},[e.backgroundColor]),X=()=>({scale:e.maximized?e.popupScale:1,color:q(),backgroundColor:D(),strokeWidth:e.strokeWidth,smooth:e.smooth,readonly:e.readOnly}),J=async t=>{const{width:o,height:i}=t;return await(s==null?void 0:s.exportImage({width:o*L,height:i*L}))};n.useEffect(()=>{const t=y.current,o=new ze.SignaturePad(t,X());return U&&o.loadImage(U),ie(o),()=>o.destroy()},[]),n.useEffect(()=>{s==null||s.setOptions({onChange:async()=>P(await J(ee())),onDraw:()=>A(!0),onDrawEnd:()=>A(!1)})},[s]),a.useIsomorphicLayoutEffect(()=>s==null?void 0:s.setOptions(X()),[e.readOnly,e.color,e.backgroundColor,e.strokeWidth,e.smooth]),n.useEffect(()=>{var i,u;const t=(u=(i=j.current)==null?void 0:i.element)==null?void 0:u.querySelector(".k-overlay");if(!t)return;const o=()=>S(!1);return t.addEventListener("click",o),()=>t.removeEventListener("click",o)},[f]),n.useEffect(()=>{if(!f||typeof document=="undefined")return;const t=o=>{var i,u;o.key==="Escape"&&(S(!1),(u=(i=M.current)==null?void 0:i.element)==null||u.focus())};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[f]),n.useEffect(()=>{var t,o;e.maximized&&((o=(t=W.current)==null?void 0:t.element)==null||o.focus())},[]);const R=n.useCallback(()=>{var t;return(t=y.current)==null?void 0:t.focus()},[]),z=n.useCallback(()=>e.value,[e.value]),Q=n.useCallback(()=>e.name,[e.name]),O=n.useCallback(()=>e.required,[e.required]),T=n.useCallback(()=>{const t=e.validationMessage!==void 0,i=!z(),u=e.valid!==void 0?e.valid:!O()||!i;return{customError:t,valid:u,valueMissing:i}},[e.validationMessage,e.valid,z,O]),B=n.useCallback(()=>e.validityStyles,[e.validityStyles]),Y=n.useCallback(()=>e,[e]),m=n.useCallback(()=>{const t={element:d.current,focus:R};return Object.defineProperty(t,"name",{get:Q}),Object.defineProperty(t,"value",{get:z}),Object.defineProperty(t,"validity",{get:T}),Object.defineProperty(t,"validityStyles",{get:B}),Object.defineProperty(t,"required",{get:O}),Object.defineProperty(t,"props",{get:Y}),Object.defineProperty(t,"color",{get:q}),Object.defineProperty(t,"backgroundColor",{get:D}),t},[Q,z,T,B,O,R,Y,q,D]);n.useImperativeHandle(k,m);const ve=n.useCallback(t=>{h||e.maximized||(G(!0),a.dispatchEvent(e.onFocus,t,m(),{}))},[h,e.onFocus,m]),ye=n.useCallback(t=>{Me.hasParent(t.relatedTarget,d.current)||(G(!1),a.dispatchEvent(e.onBlur,t,m(),{}))},[h,e.onBlur,m]),he=n.useCallback(async t=>{ce(await J(te())),S(!0),a.dispatchEvent(e.onOpen,t,m(),{})},[f,b,e.onOpen,e.value,C,m]),Z=n.useCallback(t=>{S(!1),a.dispatchEvent(e.onClose,t,m(),{})},[f,b,e.onClose,m]),Ce=()=>{ke(),R()},ee=()=>{var i,u;const t=e.width||((i=d.current)==null?void 0:i.offsetWidth)||Ie,o=e.height||((u=d.current)==null?void 0:u.offsetHeight)||Le;return{width:t,height:o}},te=()=>{const{width:t,height:o}=ee();return{width:t*I,height:o*I}},Se=!B()||T().valid;return n.createElement("div",{ref:d,dir:e.dir,style:{width:e.width,height:e.height,...e.style},className:a.classNames("k-input","k-signature",{"k-signature-maximized":e.maximized,[`k-signature-${a.kendoThemeMaps.sizeMap[e.size]||e.size}`]:e.size,[`k-signature-${e.fillMode}`]:e.fillMode,[`k-input-${e.fillMode}`]:e.fillMode,[`k-rounded-${a.kendoThemeMaps.roundedMap[e.rounded]||e.rounded}`]:e.rounded,"k-invalid":!Se,"k-required":e.required,"k-disabled":e.disabled,"k-focus":h},e.className),onFocus:ve,onBlur:ye},n.createElement("div",{className:"k-signature-canvas",ref:y,tabIndex:a.getTabIndex(e.tabIndex,e.disabled),role:"img",id:e.id,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledBy,"aria-describedby":e.ariaDescribedBy,"aria-disabled":e.disabled?"true":void 0,style:e.inputStyle}),n.createElement("div",{className:"k-signature-actions k-signature-actions-top"},n.createElement(_.Button,{type:"button",className:a.classNames("k-signature-action","k-signature-maximize",{"k-hidden":e.disabled||me}),ref:M,icon:"hyperlink-open",svgIcon:N.hyperlinkOpenIcon,size:e.size,rounded:e.rounded,fillMode:"flat",onClick:he,"aria-label":H,title:H}),n.createElement(_.Button,{type:"button",className:a.classNames("k-signature-action","k-signature-minimize","k-rotate-180",{"k-hidden":e.disabled||pe}),ref:W,icon:"hyperlink-open",svgIcon:N.hyperlinkOpenIcon,size:e.size,rounded:e.rounded,fillMode:"flat",onClick:Z,"aria-label":$,title:$})),!e.hideLine&&n.createElement("div",{className:"k-signature-line",style:{zIndex:2,pointerEvents:"none"}}),n.createElement("div",{className:"k-signature-actions k-signature-actions-bottom"},ge&&n.createElement(_.Button,{type:"button",className:"k-signature-action k-signature-clear",icon:"x",svgIcon:N.xIcon,size:e.size,rounded:e.rounded,fillMode:"flat",onClick:Ce,"aria-label":K,title:K})),f&&n.createElement(Oe.Dialog,{ref:j},n.createElement(E,{...e,...te(),value:le,maximized:!0,exportScale:1/I*L,open:!1,onChange:fe,onClose:be})),g&&n.createElement(a.WatermarkOverlay,{message:v}))});E.propTypes={value:r.string,width:r.number,height:r.number,tabIndex:r.number,dir:r.string,ariaDescribedBy:r.string,ariaLabelledBy:r.string,ariaLabel:r.string,readOnly:r.bool,disabled:r.bool,validationMessage:r.string,required:r.bool,onChange:r.func,onFocus:r.func,onBlur:r.func,onOpen:r.func,onClose:r.func,size:r.oneOf(["small","medium","large"]),rounded:r.oneOf(["small","medium","large"]),fillMode:r.oneOf(["solid","flat","outline"])};const l={strokeWidth:1,smooth:!1,popupScale:ae,exportScale:re,maximizable:!0,disabled:!1,required:!1,validityStyles:!0,onChange:c=>a.noop,onFocus:c=>a.noop,onBlur:c=>a.noop,onOpen:c=>a.noop,onClose:c=>a.noop,size:void 0,rounded:void 0,fillMode:void 0};E.displayName="KendoSignature";exports.Signature=E;exports.SignaturePropsContext=se;
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ze=require("@progress/kendo-inputs-common"),_=require("@progress/kendo-react-buttons"),a=require("@progress/kendo-react-common"),Oe=require("@progress/kendo-react-dialogs"),Ee=require("@progress/kendo-react-intl"),r=require("prop-types"),xe=require("react"),p=require("../messages/index.js"),ne=require("../package-metadata.js"),Me=require("./utils/index.js"),N=require("@progress/kendo-svg-icons");function we(c){const k=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const g in c)if(g!=="default"){const v=Object.getOwnPropertyDescriptor(c,g);Object.defineProperty(k,g,v.get?v:{enumerable:!0,get:()=>c[g]})}}return k.default=c,Object.freeze(k)}const n=we(xe),Ie=250,Le=84,ae=3,re=2,Pe="#000000",qe="#ffffff",oe=c=>c!==void 0,se=a.createPropsContext(),E=n.forwardRef((c,k)=>{const g=!a.validatePackage(ne.packageMetadata,{component:"Signature"}),v=a.getLicenseMessage(ne.packageMetadata),F=a.usePropsContext(se,c),e=n.useMemo(()=>({strokeWidth:l.strokeWidth,smooth:l.smooth,popupScale:l.popupScale,exportScale:l.exportScale,maximizable:l.maximizable,disabled:l.disabled,required:l.required,validityStyles:l.validityStyles,onChange:l.onChange,onFocus:l.onFocus,onBlur:l.onBlur,onOpen:l.onOpen,onClose:l.onClose,size:l.size,rounded:l.rounded,fillMode:l.fillMode,...F}),[F]),x=Ee.useLocalization(),d=n.useRef(null),y=n.useRef(null),j=n.useRef(null),W=n.useRef(null),M=n.useRef(null),[s,ie]=n.useState(),[h,G]=n.useState(!1),[w,A]=n.useState(!1),[C,V]=n.useState(),[le,ce]=n.useState(),U=oe(e.value)?e.value:C,[ue,de]=n.useState(!1),b=oe(e.open),f=b?e.open:ue,me=e.maximized||w||!e.maximizable||e.disabled,pe=!(e.maximized&&!w),ge=!(!(e.value||C)||w||e.readOnly||e.disabled),H=x.toLanguageString(p.signatureMaximize,p.messages[p.signatureMaximize]),$=x.toLanguageString(p.signatureMinimize,p.messages[p.signatureMinimize]),K=x.toLanguageString(p.signatureClear,p.messages[p.signatureClear]),I=e.popupScale||ae,L=e.exportScale||re,P=t=>{V(t),e.onChange&&e.onChange({value:t})},fe=t=>{s==null||s.loadImage(t.value),P(t.value)};n.useEffect(()=>{e.value!==C&&(V(e.value),s==null||s.loadImage(e.value))},[e.value]);const ke=()=>{s==null||s.clear(),P()},S=n.useCallback(t=>{b||de(t)},[b]),be=t=>{var o,i;Z(t),(i=((o=M.current)==null?void 0:o.element)||y.current)==null||i.focus()},q=n.useCallback(()=>{let t=Pe;return!e.color&&typeof document!="undefined"&&d.current&&(t=getComputedStyle(d.current).color),e.color||t},[e.color]),D=n.useCallback(()=>{let t=qe;return!e.backgroundColor&&typeof document!="undefined"&&d.current&&(t=getComputedStyle(d.current).backgroundColor),e.backgroundColor||t},[e.backgroundColor]),X=()=>({scale:e.maximized?e.popupScale:1,color:q(),backgroundColor:D(),strokeWidth:e.strokeWidth,smooth:e.smooth,readonly:e.readOnly}),J=async t=>{const{width:o,height:i}=t;return await(s==null?void 0:s.exportImage({width:o*L,height:i*L}))};n.useEffect(()=>{const t=y.current,o=new ze.SignaturePad(t,X());return U&&o.loadImage(U),ie(o),()=>o.destroy()},[]),n.useEffect(()=>{s==null||s.setOptions({onChange:async()=>P(await J(ee())),onDraw:()=>A(!0),onDrawEnd:()=>A(!1)})},[s]),a.useIsomorphicLayoutEffect(()=>s==null?void 0:s.setOptions(X()),[e.readOnly,e.color,e.backgroundColor,e.strokeWidth,e.smooth]),n.useEffect(()=>{var i,u;const t=(u=(i=j.current)==null?void 0:i.element)==null?void 0:u.querySelector(".k-overlay");if(!t)return;const o=()=>S(!1);return t.addEventListener("click",o),()=>t.removeEventListener("click",o)},[f]),n.useEffect(()=>{if(!f||typeof document=="undefined")return;const t=o=>{var i,u;o.key==="Escape"&&(S(!1),(u=(i=M.current)==null?void 0:i.element)==null||u.focus())};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[f]),n.useEffect(()=>{var t,o;e.maximized&&((o=(t=W.current)==null?void 0:t.element)==null||o.focus())},[]);const R=n.useCallback(()=>{var t;return(t=y.current)==null?void 0:t.focus()},[]),z=n.useCallback(()=>e.value,[e.value]),Q=n.useCallback(()=>e.name,[e.name]),O=n.useCallback(()=>e.required,[e.required]),T=n.useCallback(()=>{const t=e.validationMessage!==void 0,i=!z(),u=e.valid!==void 0?e.valid:!O()||!i;return{customError:t,valid:u,valueMissing:i}},[e.validationMessage,e.valid,z,O]),B=n.useCallback(()=>e.validityStyles,[e.validityStyles]),Y=n.useCallback(()=>e,[e]),m=n.useCallback(()=>{const t={element:d.current,focus:R};return Object.defineProperty(t,"name",{get:Q}),Object.defineProperty(t,"value",{get:z}),Object.defineProperty(t,"validity",{get:T}),Object.defineProperty(t,"validityStyles",{get:B}),Object.defineProperty(t,"required",{get:O}),Object.defineProperty(t,"props",{get:Y}),Object.defineProperty(t,"color",{get:q}),Object.defineProperty(t,"backgroundColor",{get:D}),t},[Q,z,T,B,O,R,Y,q,D]);n.useImperativeHandle(k,m);const ve=n.useCallback(t=>{h||e.maximized||(G(!0),a.dispatchEvent(e.onFocus,t,m(),{}))},[h,e.onFocus,m]),ye=n.useCallback(t=>{Me.hasParent(t.relatedTarget,d.current)||(G(!1),a.dispatchEvent(e.onBlur,t,m(),{}))},[h,e.onBlur,m]),he=n.useCallback(async t=>{ce(await J(te())),S(!0),a.dispatchEvent(e.onOpen,t,m(),{})},[f,b,e.onOpen,e.value,C,m]),Z=n.useCallback(t=>{S(!1),a.dispatchEvent(e.onClose,t,m(),{})},[f,b,e.onClose,m]),Ce=()=>{ke(),R()},ee=()=>{var i,u;const t=e.width||((i=d.current)==null?void 0:i.offsetWidth)||Ie,o=e.height||((u=d.current)==null?void 0:u.offsetHeight)||Le;return{width:t,height:o}},te=()=>{const{width:t,height:o}=ee();return{width:t*I,height:o*I}},Se=!B()||T().valid;return n.createElement("div",{ref:d,dir:e.dir,style:{width:e.width,height:e.height,...e.style},className:a.classNames("k-input","k-signature",{"k-signature-maximized":e.maximized,[`k-signature-${a.kendoThemeMaps.sizeMap[e.size]||e.size}`]:e.size,[`k-signature-${e.fillMode}`]:e.fillMode,[`k-input-${e.fillMode}`]:e.fillMode,[`k-rounded-${a.kendoThemeMaps.roundedMap[e.rounded]||e.rounded}`]:e.rounded,"k-invalid":!Se,"k-required":e.required,"k-disabled":e.disabled,"k-focus":h},e.className),onFocus:ve,onBlur:ye},n.createElement("div",{className:"k-signature-canvas",ref:y,tabIndex:a.getTabIndex(e.tabIndex,e.disabled),role:"img",id:e.id,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledBy,"aria-describedby":e.ariaDescribedBy,"aria-disabled":e.disabled?"true":void 0,style:e.inputStyle}),n.createElement("div",{className:"k-signature-actions k-signature-actions-top"},n.createElement(_.Button,{type:"button",className:a.classNames("k-signature-action","k-signature-maximize",{"k-hidden":e.disabled||me}),ref:M,icon:"hyperlink-open",svgIcon:N.hyperlinkOpenIcon,size:e.size,rounded:e.rounded,fillMode:"flat",onClick:he,"aria-label":H,title:H}),n.createElement(_.Button,{type:"button",className:a.classNames("k-signature-action","k-signature-minimize","k-rotate-180",{"k-hidden":e.disabled||pe}),ref:W,icon:"hyperlink-open",svgIcon:N.hyperlinkOpenIcon,size:e.size,rounded:e.rounded,fillMode:"flat",onClick:Z,"aria-label":$,title:$})),!e.hideLine&&n.createElement("div",{className:"k-signature-line",style:{zIndex:2,pointerEvents:"none"}}),n.createElement("div",{className:"k-signature-actions k-signature-actions-bottom"},ge&&n.createElement(_.Button,{type:"button",className:"k-signature-action k-signature-clear",icon:"x",svgIcon:N.xIcon,size:e.size,rounded:e.rounded,fillMode:"flat",onClick:Ce,"aria-label":K,title:K})),f&&n.createElement(Oe.Dialog,{ref:j},n.createElement(E,{...e,...te(),value:le,maximized:!0,exportScale:1/I*L,open:!1,onChange:fe,onClose:be})),g&&n.createElement(a.WatermarkOverlay,{message:v}))});E.propTypes={value:r.string,width:r.number,height:r.number,tabIndex:r.number,dir:r.string,ariaDescribedBy:r.string,ariaLabelledBy:r.string,ariaLabel:r.string,readOnly:r.bool,disabled:r.bool,validationMessage:r.string,required:r.bool,onChange:r.func,onFocus:r.func,onBlur:r.func,onOpen:r.func,onClose:r.func,size:r.oneOf(["small","medium","large"]),rounded:r.oneOf(["small","medium","large","none"]),fillMode:r.oneOf(["solid","flat","outline"])};const l={strokeWidth:1,smooth:!1,popupScale:ae,exportScale:re,maximizable:!0,disabled:!1,required:!1,validityStyles:!0,onChange:c=>a.noop,onFocus:c=>a.noop,onBlur:c=>a.noop,onOpen:c=>a.noop,onClose:c=>a.noop,size:void 0,rounded:void 0,fillMode:void 0};E.displayName="KendoSignature";exports.Signature=E;exports.SignaturePropsContext=se;
|
package/signature/Signature.mjs
CHANGED
|
@@ -297,7 +297,7 @@ _.propTypes = {
|
|
|
297
297
|
onOpen: a.func,
|
|
298
298
|
onClose: a.func,
|
|
299
299
|
size: a.oneOf(["small", "medium", "large"]),
|
|
300
|
-
rounded: a.oneOf(["small", "medium", "large"]),
|
|
300
|
+
rounded: a.oneOf(["small", "medium", "large", "none"]),
|
|
301
301
|
fillMode: a.oneOf(["solid", "flat", "outline"])
|
|
302
302
|
};
|
|
303
303
|
const s = {
|
|
@@ -153,7 +153,7 @@ export interface SignatureProps extends FormComponentProps {
|
|
|
153
153
|
* <Signature rounded="medium" />
|
|
154
154
|
* ```
|
|
155
155
|
*/
|
|
156
|
-
rounded?: 'small' | 'medium' | 'large';
|
|
156
|
+
rounded?: 'small' | 'medium' | 'large' | 'none';
|
|
157
157
|
/**
|
|
158
158
|
* Configures the fill mode of the Signature.
|
|
159
159
|
*
|
package/switch/Switch.d.ts
CHANGED
|
@@ -125,7 +125,7 @@ export interface SwitchProps extends ToggleBaseProps, FormComponentProps {
|
|
|
125
125
|
* <Switch trackRounded="medium" />
|
|
126
126
|
* ```
|
|
127
127
|
*/
|
|
128
|
-
trackRounded?: 'small' | 'medium' | 'large' | 'full';
|
|
128
|
+
trackRounded?: 'small' | 'medium' | 'large' | 'full' | 'none';
|
|
129
129
|
/**
|
|
130
130
|
* Configures the `thumbRounded` property of the Switch.
|
|
131
131
|
*
|
|
@@ -142,7 +142,7 @@ export interface SwitchProps extends ToggleBaseProps, FormComponentProps {
|
|
|
142
142
|
* <Switch thumbRounded="full" />
|
|
143
143
|
* ```
|
|
144
144
|
*/
|
|
145
|
-
thumbRounded?: 'small' | 'medium' | 'large' | 'full';
|
|
145
|
+
thumbRounded?: 'small' | 'medium' | 'large' | 'full' | 'none';
|
|
146
146
|
/**
|
|
147
147
|
* Identifies the element(s) which will describe the component.
|
|
148
148
|
* For example these elements could contain error or hint message.
|
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
|
@@ -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
|
@@ -103,7 +103,7 @@ const _ = e.forwardRef((t, C) => {
|
|
|
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
|