@progress/kendo-react-inputs 9.1.1-develop.4 → 9.2.0-develop.2

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/index.d.mts CHANGED
@@ -1783,6 +1783,11 @@ export declare interface MaskedTextBoxProps extends FormComponentProps {
1783
1783
  * @hidden
1784
1784
  */
1785
1785
  unstyled?: InputsClassStructure;
1786
+ /**
1787
+ * Sets the HTML attributes of the inner focusable input element.
1788
+ * Attributes which are essential for certain component functionalities cannot be changed.
1789
+ */
1790
+ inputAttributes?: React.InputHTMLAttributes<HTMLInputElement>;
1786
1791
  }
1787
1792
 
1788
1793
  /**
@@ -1846,6 +1851,7 @@ export declare class MaskedTextBoxWithoutContext extends React_2.Component<Maske
1846
1851
  rounded: PropTypes.Requireable<"small" | "large" | "medium" | "full" | null | undefined>;
1847
1852
  fillMode: PropTypes.Requireable<"flat" | "solid" | "outline" | null | undefined>;
1848
1853
  autoFocus: PropTypes.Requireable<boolean>;
1854
+ inputAttributes: PropTypes.Requireable<object>;
1849
1855
  };
1850
1856
  /**
1851
1857
  * @hidden
@@ -2221,6 +2227,11 @@ export declare interface NumericTextBoxProps extends FormComponentProps, Omit<Re
2221
2227
  * Represents the `autoFocus` HTML attribute that will be applied to the input element of the NumericTextBox. (Defaults to `false`)
2222
2228
  */
2223
2229
  autoFocus?: boolean;
2230
+ /**
2231
+ * Sets the HTML attributes of the inner focusable input element.
2232
+ * Attributes which are essential for certain component functionalities cannot be changed.
2233
+ */
2234
+ inputAttributes?: React.InputHTMLAttributes<HTMLInputElement>;
2224
2235
  }
2225
2236
 
2226
2237
  /**
@@ -4192,6 +4203,11 @@ export declare interface TextAreaProps extends FormComponentProps, Omit_5<React.
4192
4203
  * Represents the `autoFocus` HTML attribute that will be applied to the input element of the TextArea. (Defaults to `false`)
4193
4204
  */
4194
4205
  autoFocus?: boolean;
4206
+ /**
4207
+ * Sets the HTML attributes of the inner focusable input element.
4208
+ * Attributes which are essential for certain component functionalities cannot be changed.
4209
+ */
4210
+ inputAttributes?: React.InputHTMLAttributes<HTMLInputElement>;
4195
4211
  }
4196
4212
 
4197
4213
  /**
@@ -4286,6 +4302,11 @@ export declare interface TextBoxProps extends Omit<React_2.InputHTMLAttributes<H
4286
4302
  * @hidden
4287
4303
  */
4288
4304
  unstyled?: InputsClassStructure;
4305
+ /**
4306
+ * Sets the HTML attributes of the inner focusable input element.
4307
+ * Attributes which are essential for certain component functionalities cannot be changed.
4308
+ */
4309
+ inputAttributes?: React_2.InputHTMLAttributes<HTMLInputElement>;
4289
4310
  }
4290
4311
 
4291
4312
  /**
package/index.d.ts CHANGED
@@ -1783,6 +1783,11 @@ export declare interface MaskedTextBoxProps extends FormComponentProps {
1783
1783
  * @hidden
1784
1784
  */
1785
1785
  unstyled?: InputsClassStructure;
1786
+ /**
1787
+ * Sets the HTML attributes of the inner focusable input element.
1788
+ * Attributes which are essential for certain component functionalities cannot be changed.
1789
+ */
1790
+ inputAttributes?: React.InputHTMLAttributes<HTMLInputElement>;
1786
1791
  }
1787
1792
 
1788
1793
  /**
@@ -1846,6 +1851,7 @@ export declare class MaskedTextBoxWithoutContext extends React_2.Component<Maske
1846
1851
  rounded: PropTypes.Requireable<"small" | "large" | "medium" | "full" | null | undefined>;
1847
1852
  fillMode: PropTypes.Requireable<"flat" | "solid" | "outline" | null | undefined>;
1848
1853
  autoFocus: PropTypes.Requireable<boolean>;
1854
+ inputAttributes: PropTypes.Requireable<object>;
1849
1855
  };
1850
1856
  /**
1851
1857
  * @hidden
@@ -2221,6 +2227,11 @@ export declare interface NumericTextBoxProps extends FormComponentProps, Omit<Re
2221
2227
  * Represents the `autoFocus` HTML attribute that will be applied to the input element of the NumericTextBox. (Defaults to `false`)
2222
2228
  */
2223
2229
  autoFocus?: boolean;
2230
+ /**
2231
+ * Sets the HTML attributes of the inner focusable input element.
2232
+ * Attributes which are essential for certain component functionalities cannot be changed.
2233
+ */
2234
+ inputAttributes?: React.InputHTMLAttributes<HTMLInputElement>;
2224
2235
  }
2225
2236
 
2226
2237
  /**
@@ -4192,6 +4203,11 @@ export declare interface TextAreaProps extends FormComponentProps, Omit_5<React.
4192
4203
  * Represents the `autoFocus` HTML attribute that will be applied to the input element of the TextArea. (Defaults to `false`)
4193
4204
  */
4194
4205
  autoFocus?: boolean;
4206
+ /**
4207
+ * Sets the HTML attributes of the inner focusable input element.
4208
+ * Attributes which are essential for certain component functionalities cannot be changed.
4209
+ */
4210
+ inputAttributes?: React.InputHTMLAttributes<HTMLInputElement>;
4195
4211
  }
4196
4212
 
4197
4213
  /**
@@ -4286,6 +4302,11 @@ export declare interface TextBoxProps extends Omit<React_2.InputHTMLAttributes<H
4286
4302
  * @hidden
4287
4303
  */
4288
4304
  unstyled?: InputsClassStructure;
4305
+ /**
4306
+ * Sets the HTML attributes of the inner focusable input element.
4307
+ * Attributes which are essential for certain component functionalities cannot be changed.
4308
+ */
4309
+ inputAttributes?: React_2.InputHTMLAttributes<HTMLInputElement>;
4289
4310
  }
4290
4311
 
4291
4312
  /**
@@ -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 S=require("react"),e=require("prop-types"),O=require("./masking.service.js"),h=require("./utils.js"),n=require("@progress/kendo-react-common"),M=require("@progress/kendo-react-labels"),E=require("../package-metadata.js");function V(c){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const t in c)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(c,t);Object.defineProperty(s,t,i.get?i:{enumerable:!0,get:()=>c[t]})}}return s.default=c,Object.freeze(s)}const u=V(S),l=class l extends u.Component{constructor(s){super(s),this.state={},this._inputId=`k_${this.props.id}`,this._service=new O.MaskingService,this._isPasted=!1,this._selection=[null,null],this._input=null,this.focus=()=>{this._input&&this._input.focus()},this.pasteHandler=t=>{const{selectionStart:i,selectionEnd:a}=t.target;a!==i&&(this._isPasted=!0,this._selection=[i||0,a||0])},this.onChangeHandler=t=>{const i=t.currentTarget,a=i.value,o=this._selection[0]||0,r=this._selection[1]||0;if(!this.props.mask){this._isPasted=!1,this._selection=[null,null],this.triggerOnChange(a,t);return}const p=this.value;let d;if(this._isPasted){this._isPasted=!1;const f=p.length-r,v=a.length-f;d=this._service.maskInRange(a.slice(o,v),p,o,r)}else d=this._service.maskInput(a,p,i.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||"")},n.validatePackage(E.packageMetadata)}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 s=this.value,t=this._service.validationValue(s),i=this.props.validationMessage!==void 0,a=this.props.valid!==void 0?this.props.valid:(!this.required||!!t)&&(!this.props.maskValidation||!this.props.prompt||s.indexOf(this.props.prompt)===-1);return{customError:i,valid:a,valueMissing:!t}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:l.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:!1}get name(){return this.props.name}componentDidUpdate(s,t){if(this.element&&this.state.focused&&t.focused){let[i,a]=this._selection;const o=s.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(s,this.props)&&this.updateService(),this.setValidity()}componentDidMount(){this.updateService(),this.setValidity()}render(){const{size:s=l.defaultProps.size,fillMode:t=l.defaultProps.fillMode,rounded:i=l.defaultProps.rounded,autoFocus:a=l.defaultProps.autoFocus,unstyled:o,className:r}=this.props,p=this.props.id||this._inputId,d=!this.validityStyles||this.validity.valid,f=this.props.style||{},v=o&&o.uMaskedTextBox,{prefix:x=l.defaultProps.prefix,suffix:C=l.defaultProps.suffix}=this.props,[P]=n.useCustomComponent(x),[_]=n.useCustomComponent(C),m=u.createElement("span",{dir:this.props.dir,className:n.classNames(n.uMaskedTextBox.wrapper({c:v,invalid:!d,disabled:this.props.disabled,size:s,fillMode:t,rounded:i}),r),style:this.props.label?f:{width:this.props.width,...f}},u.createElement(P,null),u.createElement("input",{type:"text",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",autoFocus:a,spellCheck:!1,className:n.classNames(n.uMaskedTextBox.inputInner({c:v})),value:this.value,id:p,"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:n.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:k=>this._input=k,onChange:this.onChangeHandler,onPaste:this.pasteHandler,onFocus:this.focusHandler,onBlur:this.blurHandler,onDragStart:h.returnFalse,onDrop:h.returnFalse}),u.createElement(_,null));return this.props.label?u.createElement(M.FloatingLabel,{label:this.props.label,editorId:p,editorValue:this.value,editorValid:d,editorDisabled:this.props.disabled,editorPlaceholder:this.props.placeholder,children:m,style:{width:this.props.width},dir:this.props.dir}):m}triggerOnChange(s,t){if(this.setState({value:s}),this.props.onChange){this._valueDuringOnChange=s;const i={syntheticEvent:t,nativeEvent:t.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(s){const t=Object.assign({includeLiterals:this.props.includeLiterals,mask:this.props.mask,prompt:this.props.prompt,promptPlaceholder:this.props.promptPlaceholder,rules:this.rules},s);this._service.update(t)}get rules(){return Object.assign({},h.defaultRules,this.props.rules)}};l.displayName="MaskedTextBox",l.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(s,t,i){const a=s.rules;return a!==void 0&&!Object.entries(a).some(r=>typeof r!="string"||!(a[r]instanceof RegExp))?new Error("Invalid prop `"+t+"` supplied to `"+i+"`. Validation failed."):null},selection:e.shape({start:e.number.isRequired,end:e.number.isRequired}),name:e.string,label:e.string,validationMessage:e.string,required:e.bool,valid:e.bool,validityStyles:e.bool,onChange:e.func,size:e.oneOf([null,"small","medium","large"]),rounded:e.oneOf([null,"small","medium","large","full"]),fillMode:e.oneOf([null,"solid","flat","outline"]),autoFocus:e.bool},l.defaultProps={prompt:"_",promptPlaceholder:" ",includeLiterals:!1,maskValidation:!0,rules:h.defaultRules,validityStyles:!0,prefix:s=>null,suffix:s=>null,size:"medium",rounded:"medium",fillMode:"solid",autoFocus:!1};let g=l;const y=n.createPropsContext(),b=n.withIdHOC(n.withPropsContext(y,n.withUnstyledHOC(g)));b.displayName="KendoReactMaskedTextBox";exports.MaskedTextBox=b;exports.MaskedTextBoxPropsContext=y;exports.MaskedTextBoxWithoutContext=g;
8
+ "use client";"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"),n=require("@progress/kendo-react-common"),E=require("@progress/kendo-react-labels"),V=require("../package-metadata.js");function q(p){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(p){for(const t in p)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(p,t);Object.defineProperty(s,t,i.get?i:{enumerable:!0,get:()=>p[t]})}}return s.default=p,Object.freeze(s)}const u=q(O),l=class l extends u.Component{constructor(s){super(s),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:i,selectionEnd:a}=t.target;a!==i&&(this._isPasted=!0,this._selection=[i||0,a||0])},this.onChangeHandler=t=>{const i=t.currentTarget,a=i.value,o=this._selection[0]||0,r=this._selection[1]||0;if(!this.props.mask){this._isPasted=!1,this._selection=[null,null],this.triggerOnChange(a,t);return}const c=this.value;let d;if(this._isPasted){this._isPasted=!1;const g=c.length-r,f=a.length-g;d=this._service.maskInRange(a.slice(o,f),c,o,r)}else d=this._service.maskInput(a,c,i.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||"")},n.validatePackage(V.packageMetadata)}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 s=this.value,t=this._service.validationValue(s),i=this.props.validationMessage!==void 0,a=this.props.valid!==void 0?this.props.valid:(!this.required||!!t)&&(!this.props.maskValidation||!this.props.prompt||s.indexOf(this.props.prompt)===-1);return{customError:i,valid:a,valueMissing:!t}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:l.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:!1}get name(){return this.props.name}componentDidUpdate(s,t){if(this.element&&this.state.focused&&t.focused){let[i,a]=this._selection;const o=s.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(s,this.props)&&this.updateService(),this.setValidity()}componentDidMount(){this.updateService(),this.setValidity()}render(){const{size:s=l.defaultProps.size,fillMode:t=l.defaultProps.fillMode,rounded:i=l.defaultProps.rounded,autoFocus:a=l.defaultProps.autoFocus,prefix:o=l.defaultProps.prefix,suffix:r=l.defaultProps.suffix,inputAttributes:c,unstyled:d,className:g}=this.props,f=this.props.id||this._inputId,m=!this.validityStyles||this.validity.valid,b=this.props.style||{},y=d&&d.uMaskedTextBox,[_]=n.useCustomComponent(o),[k]=n.useCustomComponent(r),x=u.createElement("span",{dir:this.props.dir,className:n.classNames(n.uMaskedTextBox.wrapper({c:y,invalid:!m,disabled:this.props.disabled,size:s,fillMode:t,rounded:i}),g),style:this.props.label?b:{width:this.props.width,...b}},u.createElement(_,null),u.createElement("input",{type:"text",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",autoFocus:a,spellCheck:!1,className:n.classNames(n.uMaskedTextBox.inputInner({c:y})),value:this.value,id:f,"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:n.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,...c}),u.createElement(k,null));return this.props.label?u.createElement(E.FloatingLabel,{label:this.props.label,editorId:f,editorValue:this.value,editorValid:m,editorDisabled:this.props.disabled,editorPlaceholder:this.props.placeholder,children:x,style:{width:this.props.width},dir:this.props.dir}):x}triggerOnChange(s,t){if(this.setState({value:s}),this.props.onChange){this._valueDuringOnChange=s;const i={syntheticEvent:t,nativeEvent:t.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(s){const t=Object.assign({includeLiterals:this.props.includeLiterals,mask:this.props.mask,prompt:this.props.prompt,promptPlaceholder:this.props.promptPlaceholder,rules:this.rules},s);this._service.update(t)}get rules(){return Object.assign({},h.defaultRules,this.props.rules)}};l.displayName="MaskedTextBox",l.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(s,t,i){const a=s.rules;return a!==void 0&&!Object.entries(a).some(r=>typeof r!="string"||!(a[r]instanceof RegExp))?new Error("Invalid prop `"+t+"` supplied to `"+i+"`. Validation failed."):null},selection:e.shape({start:e.number.isRequired,end:e.number.isRequired}),name:e.string,label:e.string,validationMessage:e.string,required:e.bool,valid:e.bool,validityStyles:e.bool,onChange:e.func,size:e.oneOf([null,"small","medium","large"]),rounded:e.oneOf([null,"small","medium","large","full"]),fillMode:e.oneOf([null,"solid","flat","outline"]),autoFocus:e.bool,inputAttributes:e.object},l.defaultProps={prompt:"_",promptPlaceholder:" ",includeLiterals:!1,maskValidation:!0,rules:h.defaultRules,validityStyles:!0,prefix:s=>null,suffix:s=>null,size:"medium",rounded:"medium",fillMode:"solid",autoFocus:!1};let v=l;const C=n.createPropsContext(),P=n.withIdHOC(n.withPropsContext(C,n.withUnstyledHOC(v)));P.displayName="KendoReactMaskedTextBox";exports.MaskedTextBox=P;exports.MaskedTextBoxPropsContext=C;exports.MaskedTextBoxWithoutContext=v;
@@ -6,16 +6,16 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import * as d from "react";
9
+ import * as p from "react";
10
10
  import e from "prop-types";
11
- import { MaskingService as k } from "./masking.service.mjs";
12
- import { defaultRules as v, maskingChanged as E, returnFalse as m } from "./utils.mjs";
13
- import { validatePackage as O, useCustomComponent as g, classNames as y, uMaskedTextBox as b, getTabIndex as V, createPropsContext as w, withIdHOC as I, withPropsContext as M, withUnstyledHOC as D } from "@progress/kendo-react-common";
14
- import { FloatingLabel as H } from "@progress/kendo-react-labels";
15
- import { packageMetadata as q } from "../package-metadata.mjs";
16
- const l = class l extends d.Component {
11
+ import { MaskingService as E } from "./masking.service.mjs";
12
+ import { defaultRules as y, maskingChanged as O, returnFalse as b } from "./utils.mjs";
13
+ import { validatePackage as V, useCustomComponent as P, classNames as _, uMaskedTextBox as C, getTabIndex as w, createPropsContext as I, withIdHOC as M, withPropsContext as D, withUnstyledHOC as H } from "@progress/kendo-react-common";
14
+ import { FloatingLabel as q } from "@progress/kendo-react-labels";
15
+ import { packageMetadata as B } from "../package-metadata.mjs";
16
+ const l = class l extends p.Component {
17
17
  constructor(i) {
18
- super(i), this.state = {}, this._inputId = `k_${this.props.id}`, this._service = new k(), this._isPasted = !1, this._selection = [null, null], this._input = null, this.focus = () => {
18
+ super(i), this.state = {}, this._inputId = `k_${this.props.id}`, this._service = new E(), this._isPasted = !1, this._selection = [null, null], this._input = null, this.focus = () => {
19
19
  this._input && this._input.focus();
20
20
  }, this.pasteHandler = (t) => {
21
21
  const { selectionStart: r, selectionEnd: s } = t.target;
@@ -26,14 +26,14 @@ const l = class l extends d.Component {
26
26
  this._isPasted = !1, this._selection = [null, null], this.triggerOnChange(s, t);
27
27
  return;
28
28
  }
29
- const p = this.value;
29
+ const d = this.value;
30
30
  let n;
31
31
  if (this._isPasted) {
32
32
  this._isPasted = !1;
33
- const u = p.length - a, h = s.length - u;
34
- n = this._service.maskInRange(s.slice(o, h), p, o, a);
33
+ const h = d.length - a, u = s.length - h;
34
+ n = this._service.maskInRange(s.slice(o, u), d, o, a);
35
35
  } else
36
- n = this._service.maskInput(s, p, r.selectionStart || 0);
36
+ n = this._service.maskInput(s, d, r.selectionStart || 0);
37
37
  this._selection = [n.selection, n.selection], this.triggerOnChange(n.value, t);
38
38
  }, this.focusHandler = (t) => {
39
39
  this.state.focused || (this.setState({ focused: !0 }), this.props.onFocus && this.props.onFocus.call(void 0, {
@@ -49,7 +49,7 @@ const l = class l extends d.Component {
49
49
  }));
50
50
  }, this.setValidity = () => {
51
51
  this.element && this.element.setCustomValidity(this.validity.valid ? "" : this.props.validationMessage || "");
52
- }, O(q);
52
+ }, V(B);
53
53
  }
54
54
  /**
55
55
  * Gets the element of the MaskedTextBox.
@@ -135,7 +135,7 @@ const l = class l extends d.Component {
135
135
  const o = i.selection, a = this.props.selection;
136
136
  (!o && a || o && a && (o.start !== a.start || o.end !== a.end)) && (r = a.start, s = a.end), r !== null && s !== null && this.element.setSelectionRange(r, s);
137
137
  }
138
- E(i, this.props) && this.updateService(), this.setValidity();
138
+ O(i, this.props) && this.updateService(), this.setValidity();
139
139
  }
140
140
  /**
141
141
  * @hidden
@@ -152,30 +152,30 @@ const l = class l extends d.Component {
152
152
  fillMode: t = l.defaultProps.fillMode,
153
153
  rounded: r = l.defaultProps.rounded,
154
154
  autoFocus: s = l.defaultProps.autoFocus,
155
- unstyled: o,
156
- className: a
157
- } = this.props, p = this.props.id || this._inputId, n = !this.validityStyles || this.validity.valid, u = this.props.style || {}, h = o && o.uMaskedTextBox, {
158
- prefix: P = l.defaultProps.prefix,
159
- suffix: _ = l.defaultProps.suffix
160
- } = this.props, [C] = g(P), [x] = g(_), f = /* @__PURE__ */ d.createElement(
155
+ prefix: o = l.defaultProps.prefix,
156
+ suffix: a = l.defaultProps.suffix,
157
+ inputAttributes: d,
158
+ unstyled: n,
159
+ className: h
160
+ } = this.props, u = this.props.id || this._inputId, f = !this.validityStyles || this.validity.valid, v = this.props.style || {}, m = n && n.uMaskedTextBox, [x] = P(o), [S] = P(a), g = /* @__PURE__ */ p.createElement(
161
161
  "span",
162
162
  {
163
163
  dir: this.props.dir,
164
- className: y(
165
- b.wrapper({
166
- c: h,
167
- invalid: !n,
164
+ className: _(
165
+ C.wrapper({
166
+ c: m,
167
+ invalid: !f,
168
168
  disabled: this.props.disabled,
169
169
  size: i,
170
170
  fillMode: t,
171
171
  rounded: r
172
172
  }),
173
- a
173
+ h
174
174
  ),
175
- style: this.props.label ? u : { width: this.props.width, ...u }
175
+ style: this.props.label ? v : { width: this.props.width, ...v }
176
176
  },
177
- /* @__PURE__ */ d.createElement(C, null),
178
- /* @__PURE__ */ d.createElement(
177
+ /* @__PURE__ */ p.createElement(x, null),
178
+ /* @__PURE__ */ p.createElement(
179
179
  "input",
180
180
  {
181
181
  type: "text",
@@ -184,45 +184,46 @@ const l = class l extends d.Component {
184
184
  autoCapitalize: "off",
185
185
  autoFocus: s,
186
186
  spellCheck: !1,
187
- className: y(b.inputInner({ c: h })),
187
+ className: _(C.inputInner({ c: m })),
188
188
  value: this.value,
189
- id: p,
189
+ id: u,
190
190
  "aria-labelledby": this.props.ariaLabelledBy,
191
191
  "aria-describedby": this.props.ariaDescribedBy,
192
192
  "aria-placeholder": this.props.mask,
193
193
  "aria-required": this.props.required,
194
194
  name: this.props.name,
195
- tabIndex: V(this.props.tabIndex, this.props.disabled, !0),
195
+ tabIndex: w(this.props.tabIndex, this.props.disabled, !0),
196
196
  accessKey: this.props.accessKey,
197
197
  title: this.props.title,
198
198
  disabled: this.props.disabled || void 0,
199
199
  readOnly: this.props.readonly || void 0,
200
200
  placeholder: this.props.placeholder,
201
- ref: (S) => this._input = S,
201
+ ref: (k) => this._input = k,
202
202
  onChange: this.onChangeHandler,
203
203
  onPaste: this.pasteHandler,
204
204
  onFocus: this.focusHandler,
205
205
  onBlur: this.blurHandler,
206
- onDragStart: m,
207
- onDrop: m
206
+ onDragStart: b,
207
+ onDrop: b,
208
+ ...d
208
209
  }
209
210
  ),
210
- /* @__PURE__ */ d.createElement(x, null)
211
+ /* @__PURE__ */ p.createElement(S, null)
211
212
  );
212
- return this.props.label ? /* @__PURE__ */ d.createElement(
213
- H,
213
+ return this.props.label ? /* @__PURE__ */ p.createElement(
214
+ q,
214
215
  {
215
216
  label: this.props.label,
216
- editorId: p,
217
+ editorId: u,
217
218
  editorValue: this.value,
218
- editorValid: n,
219
+ editorValid: f,
219
220
  editorDisabled: this.props.disabled,
220
221
  editorPlaceholder: this.props.placeholder,
221
- children: f,
222
+ children: g,
222
223
  style: { width: this.props.width },
223
224
  dir: this.props.dir
224
225
  }
225
- ) : f;
226
+ ) : g;
226
227
  }
227
228
  triggerOnChange(i, t) {
228
229
  if (this.setState({
@@ -254,7 +255,7 @@ const l = class l extends d.Component {
254
255
  this._service.update(t);
255
256
  }
256
257
  get rules() {
257
- return Object.assign({}, v, this.props.rules);
258
+ return Object.assign({}, y, this.props.rules);
258
259
  }
259
260
  };
260
261
  l.displayName = "MaskedTextBox", l.propTypes = {
@@ -300,13 +301,14 @@ l.displayName = "MaskedTextBox", l.propTypes = {
300
301
  size: e.oneOf([null, "small", "medium", "large"]),
301
302
  rounded: e.oneOf([null, "small", "medium", "large", "full"]),
302
303
  fillMode: e.oneOf([null, "solid", "flat", "outline"]),
303
- autoFocus: e.bool
304
+ autoFocus: e.bool,
305
+ inputAttributes: e.object
304
306
  }, l.defaultProps = {
305
307
  prompt: "_",
306
308
  promptPlaceholder: " ",
307
309
  includeLiterals: !1,
308
310
  maskValidation: !0,
309
- rules: v,
311
+ rules: y,
310
312
  validityStyles: !0,
311
313
  prefix: (i) => null,
312
314
  suffix: (i) => null,
@@ -316,15 +318,15 @@ l.displayName = "MaskedTextBox", l.propTypes = {
316
318
  autoFocus: !1
317
319
  };
318
320
  let c = l;
319
- const B = w(), F = I(
320
- M(
321
- B,
322
- D(c)
321
+ const F = I(), R = M(
322
+ D(
323
+ F,
324
+ H(c)
323
325
  )
324
326
  );
325
- F.displayName = "KendoReactMaskedTextBox";
327
+ R.displayName = "KendoReactMaskedTextBox";
326
328
  export {
327
- F as MaskedTextBox,
328
- B as MaskedTextBoxPropsContext,
329
+ R as MaskedTextBox,
330
+ F as MaskedTextBoxPropsContext,
329
331
  c as MaskedTextBoxWithoutContext
330
332
  };
@@ -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 He=require("react"),t=require("prop-types"),fe=require("@progress/kendo-react-intl"),o=require("@progress/kendo-react-common"),be=require("@progress/kendo-svg-icons"),we=require("@progress/kendo-react-labels"),Ke=require("../package-metadata.js"),g=require("../messages/index.js"),s=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 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=$e(He),Ue="Please enter a valid value!",ge=o.createPropsContext(),Q=n.forwardRef((m,L)=>{o.validatePackage(Ke.packageMetadata);const v=o.usePropsContext(ge,m),{className:N,value:k,defaultValue:ve,format:u,width:X,tabIndex:ye,accessKey:Ve,title:ke,placeholder:Z,min:f,max:b,dir:ee,name:G,label:R,id:Ce,ariaDescribedBy:Se,ariaLabelledBy:Ee,ariaLabel:xe,inputType:Oe,readOnly:C,validationMessage:A,children:Ie,style:te,inputStyle:he,valid:H,step:S=i.step,spinners:Le=i.spinners,disabled:c=i.disabled,required:q=i.required,validityStyles:ne=i.validityStyles,prefix:Pe=i.prefix,suffix:De=i.suffix,onChange:I=i.onChange,onFocus:re=i.onFocus,onBlur:ae=i.onBlur,rangeOnEnter:ue=i.rangeOnEnter,size:w=i.size,rounded:K=i.rounded,fillMode:B=i.fillMode,autoFocus:Ne=i.autoFocus,...se}=v,Re=o.useId(),le=Ce||Re,l=fe.useInternationalization(),M=fe.useLocalization(),a=n.useRef(null),T=n.useRef(),[qe,h]=n.useState(!1),d=n.useRef(s.getInitialState()),F=n.useRef(!1),$=n.useRef(),P=n.useRef(ve),D=s.formatValue(d.current.focused&&!c?d.current.currentLooseValue:s.getStateOrPropsValue(k,P.current),u,l);$.current=D;const[Be]=o.useCustomComponent(Pe),[Me]=o.useCustomComponent(De);n.useEffect(()=>{a.current&&a.current.setCustomValidity&&a.current.setCustomValidity(_().valid?"":A||Ue)});const oe=n.useCallback(()=>{a.current&&a.current.focus()},[]),j=n.useCallback(()=>T.current!==void 0?T.current:s.getStateOrPropsValue(k,P.current),[k]),ce=n.useCallback(()=>G,[G]),z=n.useCallback(()=>q,[q]),_=n.useCallback(()=>{const r=A!==void 0,e=j(),x=H!==void 0?H:!d.current.valueIsOutOfRange&&(!z()||e!=null);return{customError:r,valid:x,valueMissing:e==null}},[A,H,j,z]),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:j}),Object.defineProperty(r,"validity",{get:_}),Object.defineProperty(r,"validityStyles",{get:U}),Object.defineProperty(r,"required",{get:z}),Object.defineProperty(r,"props",{get:ie}),r},[ce,j,_,U,z,oe,ie]);n.useImperativeHandle(L,E);const y=n.useCallback(()=>({eventValue:s.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:F.current,focused:d.current.focused}),[k]),V=n.useCallback((r,e)=>{if(c)return;T.current=e.eventValue,P.current=e.eventValue;const x=s.formatValue(s.rangeValue(e.eventValue,f,b),u,l),p=s.rangeValue(l.parseNumber(x,u),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}),T.current=void 0,d.current=e,h(J=>!J)},[k,I,c,h,E]),Te=n.useCallback(r=>{const e=y();F.current=!1,V(r,s.sanitizeNumber(e,u,l))},[u,I,l,V,y]),Fe=n.useCallback(r=>{let e=y();const x=l.parseNumber(String(e.currentLooseValue),u);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;F.current=!O&&!J;return}switch(r.keyCode){case 38:s.increaseValue(x,e,S,f,b,u,l);break;case 40:s.decreaseValue(x,e,S,f,b,u,l);break;case 13:{if(ue===!1)return;const p=s.formatValue(s.rangeValue(x,f,b),u,l),O=s.rangeValue(l.parseNumber(p,u),f,b);e.eventValue=O,e.currentLooseValue=s.formatValue(O,u,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=s.sanitizeNumber(e,u,l));break}default:return}r.preventDefault(),V(r,e)},[u,f,b,S,I,ue,V,y]),je=n.useCallback(()=>{F.current=!0},[]),W=n.useCallback(r=>{if(C||c)return;const e=y();s.increaseValue(l.parseNumber(String(e.currentLooseValue),u),e,S,f,b,u,l),V(r,e)},[u,f,b,S,I,C,c,V,y]),Y=n.useCallback(r=>{if(C||c)return;const e=y();s.decreaseValue(l.parseNumber(String(e.currentLooseValue),u),e,S,f,b,u,l),V(r,e)},[u,f,b,S,I,C,c,V,y]),ze=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]),_e=n.useCallback(r=>{d.current.currentLooseValue=$.current,d.current.focused=!0,o.dispatchEvent(re,r,E(),{}),h(e=>!e)},[re,h,E]),Ge=n.useCallback(r=>{d.current=s.getInitialState(),o.dispatchEvent(ae,r,E(),{}),h(e=>!e)},[ae,h,E]),Ae=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"&&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: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":q,"k-disabled":c},N),"aria-disabled":c?"true":void 0,...R?{}:se},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,"aria-required":q,placeholder:Z,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoFocus:Ne,type:Oe||"tel",className:"k-input-inner",id:le,name:G,readOnly:C,style:he,onChange:Te,onFocus:_e,onBlur:Ge,onKeyDown:Fe,onPaste:je,onWheel:ze,ref:a}),n.createElement(Me,null),Ie,Le&&n.createElement("span",{className:"k-input-spinner k-spin-button",onMouseDown:Ae},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(we.FloatingLabel,{label:R,editorId:le,editorValue:D===null?"":D,editorValid:de,editorDisabled:c,editorPlaceholder:Z,children:me,style:{width:X},dir:ee,...se}):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 i={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:"medium",rounded:"medium",fillMode:"solid"};Q.displayName="KendoNumericTextBox";exports.NumericTextBox=Q;exports.NumericTextBoxPropsContext=ge;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const we=require("react"),t=require("prop-types"),fe=require("@progress/kendo-react-intl"),o=require("@progress/kendo-react-common"),be=require("@progress/kendo-svg-icons"),Ke=require("@progress/kendo-react-labels"),$e=require("../package-metadata.js"),g=require("../messages/index.js"),s=require("./utils/index.js"),pe=require("@progress/kendo-react-buttons");function Ue(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=Ue(we),We="Please enter a valid value!",ge=o.createPropsContext(),Q=n.forwardRef((m,L)=>{o.validatePackage($e.packageMetadata);const v=o.usePropsContext(ge,m),{className:N,value:k,defaultValue:ve,format:u,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:he,touched:Ye,visited:Je,modified:Qe,style:te,inputStyle:Ie,valid:H,step:S=i.step,spinners:Le=i.spinners,disabled:c=i.disabled,required:q=i.required,validityStyles:ne=i.validityStyles,prefix:Pe=i.prefix,suffix:De=i.suffix,onChange:h=i.onChange,onFocus:re=i.onFocus,onBlur:ae=i.onBlur,rangeOnEnter:ue=i.rangeOnEnter,size:w=i.size,rounded:K=i.rounded,fillMode:B=i.fillMode,autoFocus:Ne=i.autoFocus,inputAttributes:Re,...se}=v,qe=o.useId(),le=Ce||qe,l=fe.useInternationalization(),M=fe.useLocalization(),a=n.useRef(null),T=n.useRef(),[Be,I]=n.useState(!1),d=n.useRef(s.getInitialState()),F=n.useRef(!1),$=n.useRef(),P=n.useRef(ve),D=s.formatValue(d.current.focused&&!c?d.current.currentLooseValue:s.getStateOrPropsValue(k,P.current),u,l);$.current=D;const[Me]=o.useCustomComponent(Pe),[Te]=o.useCustomComponent(De);n.useEffect(()=>{a.current&&a.current.setCustomValidity&&a.current.setCustomValidity(A().valid?"":G||We)});const oe=n.useCallback(()=>{a.current&&a.current.focus()},[]),j=n.useCallback(()=>T.current!==void 0?T.current:s.getStateOrPropsValue(k,P.current),[k]),ce=n.useCallback(()=>_,[_]),z=n.useCallback(()=>q,[q]),A=n.useCallback(()=>{const r=G!==void 0,e=j(),x=H!==void 0?H:!d.current.valueIsOutOfRange&&(!z()||e!=null);return{customError:r,valid:x,valueMissing:e==null}},[G,H,j,z]),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:j}),Object.defineProperty(r,"validity",{get:A}),Object.defineProperty(r,"validityStyles",{get:U}),Object.defineProperty(r,"required",{get:z}),Object.defineProperty(r,"props",{get:ie}),r},[ce,j,A,U,z,oe,ie]);n.useImperativeHandle(L,E);const y=n.useCallback(()=>({eventValue:s.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:F.current,focused:d.current.focused}),[k]),V=n.useCallback((r,e)=>{if(c)return;T.current=e.eventValue,P.current=e.eventValue;const x=s.formatValue(s.rangeValue(e.eventValue,f,b),u,l),p=s.rangeValue(l.parseNumber(x,u),f,b);p!==e.eventValue&&(e.valueIsOutOfRange=!0,e.eventValue=p,P.current=p),k!==e.eventValue&&o.dispatchEvent(h,r,E(),{value:e.eventValue}),T.current=void 0,d.current=e,I(J=>!J)},[k,h,c,I,E]),Fe=n.useCallback(r=>{const e=y();F.current=!1,V(r,s.sanitizeNumber(e,u,l))},[u,h,l,V,y]),je=n.useCallback(r=>{let e=y();const x=l.parseNumber(String(e.currentLooseValue),u);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;F.current=!O&&!J;return}switch(r.keyCode){case 38:s.increaseValue(x,e,S,f,b,u,l);break;case 40:s.decreaseValue(x,e,S,f,b,u,l);break;case 13:{if(ue===!1)return;const p=s.formatValue(s.rangeValue(x,f,b),u,l),O=s.rangeValue(l.parseNumber(p,u),f,b);e.eventValue=O,e.currentLooseValue=s.formatValue(O,u,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=s.sanitizeNumber(e,u,l));break}default:return}r.preventDefault(),V(r,e)},[u,f,b,S,h,ue,V,y]),ze=n.useCallback(()=>{F.current=!0},[]),W=n.useCallback(r=>{if(C||c)return;const e=y();s.increaseValue(l.parseNumber(String(e.currentLooseValue),u),e,S,f,b,u,l),V(r,e)},[u,f,b,S,h,C,c,V,y]),Y=n.useCallback(r=>{if(C||c)return;const e=y();s.decreaseValue(l.parseNumber(String(e.currentLooseValue),u),e,S,f,b,u,l),V(r,e)},[u,f,b,S,h,C,c,V,y]),Ae=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]),_e=n.useCallback(r=>{d.current.currentLooseValue=$.current,d.current.focused=!0,o.dispatchEvent(re,r,E(),{}),I(e=>!e)},[re,I,E]),Ge=n.useCallback(r=>{d.current=s.getInitialState(),o.dispatchEvent(ae,r,E(),{}),I(e=>!e)},[ae,I,E]),He=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"&&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)},[Be]);const de=!U()||A().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":q,"k-disabled":c},N),"aria-disabled":c?"true":void 0,...R?{}:se},n.createElement(Me,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,"aria-required":q,placeholder:Z,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoFocus:Ne,type:Oe||"tel",className:"k-input-inner",id:le,name:_,readOnly:C,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,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(Ke.FloatingLabel,{label:R,editorId:le,editorValue:D===null?"":D,editorValid:de,editorDisabled:c,editorPlaceholder:Z,children:me,style:{width:X},dir:ee,...se}):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"]),inputAttributes:t.object};const i={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:"medium",rounded:"medium",fillMode:"solid"};Q.displayName="KendoNumericTextBox";exports.NumericTextBox=Q;exports.NumericTextBoxPropsContext=ge;