@progress/kendo-react-inputs 8.3.0-develop.3 → 8.3.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/index.d.mts CHANGED
@@ -15,6 +15,7 @@ import { HTMLAttributes } from 'react';
15
15
  import { IconHandle } from '@progress/kendo-react-common';
16
16
  import { IconProps } from '@progress/kendo-react-common';
17
17
  import { JSX as JSX_2 } from 'react/jsx-runtime';
18
+ import { MaskedTextBoxClassStructure } from '@progress/kendo-react-common';
18
19
  import { NumberFormatOptions } from '@progress/kendo-react-intl';
19
20
  import { PopupAnimation } from '@progress/kendo-react-popup';
20
21
  import PropTypes from 'prop-types';
@@ -1306,7 +1307,7 @@ export declare const InputPrefix: React_2.ForwardRefExoticComponent<React_2.HTML
1306
1307
  /**
1307
1308
  * Sets the `orientation` property of the `InputPrefix` component.
1308
1309
  */
1309
- orientation?: "horizontal" | "vertical" | undefined;
1310
+ orientation?: "vertical" | "horizontal" | undefined;
1310
1311
  } & React_2.RefAttributes<InputPrefixHandle>>;
1311
1312
 
1312
1313
  /**
@@ -1385,7 +1386,7 @@ export declare const InputSeparator: React_2.ForwardRefExoticComponent<React_2.H
1385
1386
  /**
1386
1387
  * Sets the `orientation` property of the `InputSeparator` component.
1387
1388
  */
1388
- orientation?: "horizontal" | "vertical" | undefined;
1389
+ orientation?: "vertical" | "horizontal" | undefined;
1389
1390
  } & React_2.RefAttributes<InputSeparatorHandle>>;
1390
1391
 
1391
1392
  /**
@@ -1457,7 +1458,7 @@ export declare const InputSuffix: React_2.ForwardRefExoticComponent<React_2.HTML
1457
1458
  /**
1458
1459
  * Sets the `orientation` property of the `InputSuffix` component.
1459
1460
  */
1460
- orientation?: "horizontal" | "vertical" | undefined;
1461
+ orientation?: "vertical" | "horizontal" | undefined;
1461
1462
  } & React_2.RefAttributes<InputSuffixHandle>>;
1462
1463
 
1463
1464
  /**
@@ -1847,6 +1848,10 @@ export declare interface MaskedTextBoxProps extends FormComponentProps {
1847
1848
  * Represents the `autoFocus` HTML attribute that will be applied to the input element of the MaskedTextBox. (Defaults to `false`)
1848
1849
  */
1849
1850
  autoFocus?: boolean;
1851
+ /**
1852
+ * @hidden
1853
+ */
1854
+ unstyled?: MaskedTextBoxClassStructure;
1850
1855
  }
1851
1856
 
1852
1857
  /**
package/index.d.ts CHANGED
@@ -15,6 +15,7 @@ import { HTMLAttributes } from 'react';
15
15
  import { IconHandle } from '@progress/kendo-react-common';
16
16
  import { IconProps } from '@progress/kendo-react-common';
17
17
  import { JSX as JSX_2 } from 'react/jsx-runtime';
18
+ import { MaskedTextBoxClassStructure } from '@progress/kendo-react-common';
18
19
  import { NumberFormatOptions } from '@progress/kendo-react-intl';
19
20
  import { PopupAnimation } from '@progress/kendo-react-popup';
20
21
  import PropTypes from 'prop-types';
@@ -1306,7 +1307,7 @@ export declare const InputPrefix: React_2.ForwardRefExoticComponent<React_2.HTML
1306
1307
  /**
1307
1308
  * Sets the `orientation` property of the `InputPrefix` component.
1308
1309
  */
1309
- orientation?: "horizontal" | "vertical" | undefined;
1310
+ orientation?: "vertical" | "horizontal" | undefined;
1310
1311
  } & React_2.RefAttributes<InputPrefixHandle>>;
1311
1312
 
1312
1313
  /**
@@ -1385,7 +1386,7 @@ export declare const InputSeparator: React_2.ForwardRefExoticComponent<React_2.H
1385
1386
  /**
1386
1387
  * Sets the `orientation` property of the `InputSeparator` component.
1387
1388
  */
1388
- orientation?: "horizontal" | "vertical" | undefined;
1389
+ orientation?: "vertical" | "horizontal" | undefined;
1389
1390
  } & React_2.RefAttributes<InputSeparatorHandle>>;
1390
1391
 
1391
1392
  /**
@@ -1457,7 +1458,7 @@ export declare const InputSuffix: React_2.ForwardRefExoticComponent<React_2.HTML
1457
1458
  /**
1458
1459
  * Sets the `orientation` property of the `InputSuffix` component.
1459
1460
  */
1460
- orientation?: "horizontal" | "vertical" | undefined;
1461
+ orientation?: "vertical" | "horizontal" | undefined;
1461
1462
  } & React_2.RefAttributes<InputSuffixHandle>>;
1462
1463
 
1463
1464
  /**
@@ -1847,6 +1848,10 @@ export declare interface MaskedTextBoxProps extends FormComponentProps {
1847
1848
  * Represents the `autoFocus` HTML attribute that will be applied to the input element of the MaskedTextBox. (Defaults to `false`)
1848
1849
  */
1849
1850
  autoFocus?: boolean;
1851
+ /**
1852
+ * @hidden
1853
+ */
1854
+ unstyled?: MaskedTextBoxClassStructure;
1850
1855
  }
1851
1856
 
1852
1857
  /**
@@ -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 x=require("react"),e=require("prop-types"),C=require("./masking.service.js"),c=require("./utils.js"),o=require("@progress/kendo-react-common"),_=require("@progress/kendo-react-labels"),S=require("../package-metadata.js");function O(h){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(h){for(const t in h)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(h,t);Object.defineProperty(s,t,i.get?i:{enumerable:!0,get:()=>h[t]})}}return s.default=h,Object.freeze(s)}const u=O(x),l=class l extends u.Component{constructor(s){super(s),this.state={},this._inputId=`k-${this.props.id}`,this._service=new C.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:r}=t.target;r!==i&&(this._isPasted=!0,this._selection=[i||0,r||0])},this.onChangeHandler=t=>{const i=t.currentTarget,r=i.value,n=this._selection[0]||0,a=this._selection[1]||0;if(!this.props.mask){this._isPasted=!1,this._selection=[null,null],this.triggerOnChange(r,t);return}const p=this.value;let d;if(this._isPasted){this._isPasted=!1;const v=p.length-a,g=r.length-v;d=this._service.maskInRange(r.slice(n,g),p,n,a)}else d=this._service.maskInput(r,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||"")},o.validatePackage(S.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,r=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:r,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:l.defaultProps.required}get name(){return this.props.name}componentDidUpdate(s,t){if(this.element&&this.state.focused&&t.focused){let[i,r]=this._selection;const n=s.selection,a=this.props.selection;(!n&&a||n&&a&&(n.start!==a.start||n.end!==a.end))&&(i=a.start,r=a.end),i!==null&&r!==null&&this.element.setSelectionRange(i,r)}c.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:r=l.defaultProps.autoFocus}=this.props,n=this.props.id||this._inputId,a=!this.validityStyles||this.validity.valid,p=this.props.style||{},{prefix:d=l.defaultProps.prefix,suffix:v=l.defaultProps.suffix}=this.props,[g]=o.useCustomComponent(d),[k]=o.useCustomComponent(v),m=u.createElement("span",{dir:this.props.dir,className:o.classNames("k-maskedtextbox k-input",{[`k-input-${o.kendoThemeMaps.sizeMap[s]||s}`]:s,[`k-input-${t}`]:t,[`k-rounded-${o.kendoThemeMaps.roundedMap[i]||i}`]:i,"k-invalid":!a,"k-required":this.required,"k-disabled":this.props.disabled},this.props.className),style:this.props.label?p:{width:this.props.width,...p}},u.createElement(g,null),u.createElement("input",{type:"text",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",autoFocus:r,spellCheck:!1,className:"k-input-inner",value:this.value,id:n,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,"aria-placeholder":this.props.mask,name:this.props.name,tabIndex:o.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:P=>this._input=P,onChange:this.onChangeHandler,onPaste:this.pasteHandler,onFocus:this.focusHandler,onBlur:this.blurHandler,onDragStart:c.returnFalse,onDrop:c.returnFalse}),u.createElement(k,null));return this.props.label?u.createElement(_.FloatingLabel,{label:this.props.label,editorId:n,editorValue:this.value,editorValid:a,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({},c.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 r=s.rules;return r!==void 0&&!Object.entries(r).some(a=>typeof a!="string"||!(r[a]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:c.defaultRules,required:!1,validityStyles:!0,prefix:s=>null,suffix:s=>null,size:"medium",rounded:"medium",fillMode:"solid",autoFocus:!1};let f=l;const y=o.createPropsContext(),b=o.withIdHOC(o.withPropsContext(y,f));b.displayName="KendoReactMaskedTextBox";exports.MaskedTextBox=b;exports.MaskedTextBoxPropsContext=y;exports.MaskedTextBoxWithoutContext=f;
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"),o=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 p=V(S),l=class l extends p.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,n=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 u=this.value;let d;if(this._isPasted){this._isPasted=!1;const f=u.length-r,v=a.length-f;d=this._service.maskInRange(a.slice(n,v),u,n,r)}else d=this._service.maskInput(a,u,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||"")},o.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:l.defaultProps.required}get name(){return this.props.name}componentDidUpdate(s,t){if(this.element&&this.state.focused&&t.focused){let[i,a]=this._selection;const n=s.selection,r=this.props.selection;(!n&&r||n&&r&&(n.start!==r.start||n.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:n,className:r}=this.props,u=this.props.id||this._inputId,d=!this.validityStyles||this.validity.valid,f=this.props.style||{},v=n&&n.uMaskedTextBox,{prefix:x=l.defaultProps.prefix,suffix:P=l.defaultProps.suffix}=this.props,[C]=o.useCustomComponent(x),[k]=o.useCustomComponent(P),m=p.createElement("span",{dir:this.props.dir,className:o.classNames(o.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}},p.createElement(C,null),p.createElement("input",{type:"text",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",autoFocus:a,spellCheck:!1,className:o.classNames(o.uMaskedTextBox.input({c:v})),value:this.value,id:u,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,"aria-placeholder":this.props.mask,name:this.props.name,tabIndex:o.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:_=>this._input=_,onChange:this.onChangeHandler,onPaste:this.pasteHandler,onFocus:this.focusHandler,onBlur:this.blurHandler,onDragStart:h.returnFalse,onDrop:h.returnFalse}),p.createElement(k,null));return this.props.label?p.createElement(M.FloatingLabel,{label:this.props.label,editorId:u,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,required:!1,validityStyles:!0,prefix:s=>null,suffix:s=>null,size:"medium",rounded:"medium",fillMode:"solid",autoFocus:!1};let g=l;const y=o.createPropsContext(),b=o.withIdHOC(o.withPropsContext(y,o.withUnstyledHOC(g)));b.displayName="KendoReactMaskedTextBox";exports.MaskedTextBox=b;exports.MaskedTextBoxPropsContext=y;exports.MaskedTextBoxWithoutContext=g;
@@ -8,32 +8,32 @@
8
8
  "use client";
9
9
  import * as d from "react";
10
10
  import e from "prop-types";
11
- import { MaskingService as P } from "./masking.service.mjs";
12
- import { defaultRules as v, maskingChanged as _, returnFalse as m } from "./utils.mjs";
13
- import { validatePackage as C, useCustomComponent as g, classNames as S, kendoThemeMaps as y, getTabIndex as x, createPropsContext as E, withIdHOC as V, withPropsContext as O } from "@progress/kendo-react-common";
14
- import { FloatingLabel as M } from "@progress/kendo-react-labels";
15
- import { packageMetadata as I } from "../package-metadata.mjs";
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 M, withPropsContext as I, 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
16
  const l = class l extends d.Component {
17
- constructor(s) {
18
- super(s), this.state = {}, this._inputId = `k-${this.props.id}`, this._service = new P(), this._isPasted = !1, this._selection = [null, null], this._input = null, this.focus = () => {
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 = () => {
19
19
  this._input && this._input.focus();
20
20
  }, this.pasteHandler = (t) => {
21
- const { selectionStart: i, selectionEnd: r } = t.target;
22
- r !== i && (this._isPasted = !0, this._selection = [i || 0, r || 0]);
21
+ const { selectionStart: r, selectionEnd: s } = t.target;
22
+ s !== r && (this._isPasted = !0, this._selection = [r || 0, s || 0]);
23
23
  }, this.onChangeHandler = (t) => {
24
- const i = t.currentTarget, r = i.value, o = this._selection[0] || 0, a = this._selection[1] || 0;
24
+ const r = t.currentTarget, s = r.value, o = this._selection[0] || 0, a = this._selection[1] || 0;
25
25
  if (!this.props.mask) {
26
- this._isPasted = !1, this._selection = [null, null], this.triggerOnChange(r, t);
26
+ this._isPasted = !1, this._selection = [null, null], this.triggerOnChange(s, t);
27
27
  return;
28
28
  }
29
29
  const p = this.value;
30
30
  let n;
31
31
  if (this._isPasted) {
32
32
  this._isPasted = !1;
33
- const u = p.length - a, h = r.length - u;
34
- n = this._service.maskInRange(r.slice(o, h), p, o, a);
33
+ const u = p.length - a, h = s.length - u;
34
+ n = this._service.maskInRange(s.slice(o, h), p, o, a);
35
35
  } else
36
- n = this._service.maskInput(r, p, i.selectionStart || 0);
36
+ n = this._service.maskInput(s, p, 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, {
@@ -51,7 +51,7 @@ const l = class l extends d.Component {
51
51
  this.element && this.element.setCustomValidity(
52
52
  this.validity.valid ? "" : this.props.validationMessage || ""
53
53
  );
54
- }, C(I);
54
+ }, O(q);
55
55
  }
56
56
  /**
57
57
  * Gets the element of the MaskedTextBox.
@@ -103,10 +103,10 @@ const l = class l extends d.Component {
103
103
  * Represents the validity state into which the MaskedTextBox is set.
104
104
  */
105
105
  get validity() {
106
- const s = this.value, t = this._service.validationValue(s), i = this.props.validationMessage !== void 0, r = this.props.valid !== void 0 ? this.props.valid : (!this.required || !!t) && (!this.props.maskValidation || !this.props.prompt || s.indexOf(this.props.prompt) === -1);
106
+ const i = this.value, t = this._service.validationValue(i), r = this.props.validationMessage !== void 0, s = this.props.valid !== void 0 ? this.props.valid : (!this.required || !!t) && (!this.props.maskValidation || !this.props.prompt || i.indexOf(this.props.prompt) === -1);
107
107
  return {
108
- customError: i,
109
- valid: r,
108
+ customError: r,
109
+ valid: s,
110
110
  valueMissing: !t
111
111
  };
112
112
  }
@@ -131,13 +131,13 @@ const l = class l extends d.Component {
131
131
  /**
132
132
  * @hidden
133
133
  */
134
- componentDidUpdate(s, t) {
134
+ componentDidUpdate(i, t) {
135
135
  if (this.element && this.state.focused && t.focused) {
136
- let [i, r] = this._selection;
137
- const o = s.selection, a = this.props.selection;
138
- (!o && a || o && a && (o.start !== a.start || o.end !== a.end)) && (i = a.start, r = a.end), i !== null && r !== null && this.element.setSelectionRange(i, r);
136
+ let [r, s] = this._selection;
137
+ const o = i.selection, a = this.props.selection;
138
+ (!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);
139
139
  }
140
- _(s, this.props) && this.updateService(), this.setValidity();
140
+ E(i, this.props) && this.updateService(), this.setValidity();
141
141
  }
142
142
  /**
143
143
  * @hidden
@@ -150,32 +150,32 @@ const l = class l extends d.Component {
150
150
  */
151
151
  render() {
152
152
  const {
153
- size: s = l.defaultProps.size,
153
+ size: i = l.defaultProps.size,
154
154
  fillMode: t = l.defaultProps.fillMode,
155
- rounded: i = l.defaultProps.rounded,
156
- autoFocus: r = l.defaultProps.autoFocus
157
- } = this.props, o = this.props.id || this._inputId, a = !this.validityStyles || this.validity.valid, p = this.props.style || {}, {
158
- prefix: n = l.defaultProps.prefix,
159
- suffix: u = l.defaultProps.suffix
160
- } = this.props, [h] = g(n), [b] = g(u), f = /* @__PURE__ */ d.createElement(
155
+ rounded: r = l.defaultProps.rounded,
156
+ autoFocus: s = l.defaultProps.autoFocus,
157
+ unstyled: o,
158
+ className: a
159
+ } = this.props, p = this.props.id || this._inputId, n = !this.validityStyles || this.validity.valid, u = this.props.style || {}, h = o && o.uMaskedTextBox, {
160
+ prefix: P = l.defaultProps.prefix,
161
+ suffix: C = l.defaultProps.suffix
162
+ } = this.props, [_] = g(P), [x] = g(C), f = /* @__PURE__ */ d.createElement(
161
163
  "span",
162
164
  {
163
165
  dir: this.props.dir,
164
- className: S(
165
- "k-maskedtextbox k-input",
166
+ className: y(b.wrapper(
166
167
  {
167
- [`k-input-${y.sizeMap[s] || s}`]: s,
168
- [`k-input-${t}`]: t,
169
- [`k-rounded-${y.roundedMap[i] || i}`]: i,
170
- "k-invalid": !a,
171
- "k-required": this.required,
172
- "k-disabled": this.props.disabled
173
- },
174
- this.props.className
175
- ),
176
- style: this.props.label ? p : { width: this.props.width, ...p }
168
+ c: h,
169
+ invalid: !n,
170
+ disabled: this.props.disabled,
171
+ size: i,
172
+ fillMode: t,
173
+ rounded: r
174
+ }
175
+ ), a),
176
+ style: this.props.label ? u : { width: this.props.width, ...u }
177
177
  },
178
- /* @__PURE__ */ d.createElement(h, null),
178
+ /* @__PURE__ */ d.createElement(_, null),
179
179
  /* @__PURE__ */ d.createElement(
180
180
  "input",
181
181
  {
@@ -183,22 +183,22 @@ const l = class l extends d.Component {
183
183
  autoComplete: "off",
184
184
  autoCorrect: "off",
185
185
  autoCapitalize: "off",
186
- autoFocus: r,
186
+ autoFocus: s,
187
187
  spellCheck: !1,
188
- className: "k-input-inner",
188
+ className: y(b.input({ c: h })),
189
189
  value: this.value,
190
- id: o,
190
+ id: p,
191
191
  "aria-labelledby": this.props.ariaLabelledBy,
192
192
  "aria-describedby": this.props.ariaDescribedBy,
193
193
  "aria-placeholder": this.props.mask,
194
194
  name: this.props.name,
195
- tabIndex: x(this.props.tabIndex, this.props.disabled, !0),
195
+ tabIndex: V(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: (k) => this._input = k,
201
+ ref: (S) => this._input = S,
202
202
  onChange: this.onChangeHandler,
203
203
  onPaste: this.pasteHandler,
204
204
  onFocus: this.focusHandler,
@@ -207,15 +207,15 @@ const l = class l extends d.Component {
207
207
  onDrop: m
208
208
  }
209
209
  ),
210
- /* @__PURE__ */ d.createElement(b, null)
210
+ /* @__PURE__ */ d.createElement(x, null)
211
211
  );
212
212
  return this.props.label ? /* @__PURE__ */ d.createElement(
213
- M,
213
+ H,
214
214
  {
215
215
  label: this.props.label,
216
- editorId: o,
216
+ editorId: p,
217
217
  editorValue: this.value,
218
- editorValid: a,
218
+ editorValid: n,
219
219
  editorDisabled: this.props.disabled,
220
220
  editorPlaceholder: this.props.placeholder,
221
221
  children: f,
@@ -224,12 +224,12 @@ const l = class l extends d.Component {
224
224
  }
225
225
  ) : f;
226
226
  }
227
- triggerOnChange(s, t) {
227
+ triggerOnChange(i, t) {
228
228
  if (this.setState({
229
- value: s
229
+ value: i
230
230
  }), this.props.onChange) {
231
- this._valueDuringOnChange = s;
232
- const i = {
231
+ this._valueDuringOnChange = i;
232
+ const r = {
233
233
  syntheticEvent: t,
234
234
  nativeEvent: t.nativeEvent,
235
235
  selectionStart: this._selection[0],
@@ -237,17 +237,17 @@ const l = class l extends d.Component {
237
237
  target: this,
238
238
  value: this.value
239
239
  };
240
- this.props.onChange.call(void 0, i), this._valueDuringOnChange = void 0;
240
+ this.props.onChange.call(void 0, r), this._valueDuringOnChange = void 0;
241
241
  }
242
242
  }
243
- updateService(s) {
243
+ updateService(i) {
244
244
  const t = Object.assign({
245
245
  includeLiterals: this.props.includeLiterals,
246
246
  mask: this.props.mask,
247
247
  prompt: this.props.prompt,
248
248
  promptPlaceholder: this.props.promptPlaceholder,
249
249
  rules: this.rules
250
- }, s);
250
+ }, i);
251
251
  this._service.update(t);
252
252
  }
253
253
  get rules() {
@@ -280,10 +280,10 @@ l.displayName = "MaskedTextBox", l.propTypes = {
280
280
  includeLiterals: e.bool,
281
281
  maskValidation: e.bool,
282
282
  mask: e.string,
283
- rules: function(s, t, i) {
284
- const r = s.rules;
285
- return r !== void 0 && !Object.entries(r).some((a) => typeof a != "string" || !(r[a] instanceof RegExp)) ? new Error(
286
- "Invalid prop `" + t + "` supplied to `" + i + "`. Validation failed."
283
+ rules: function(i, t, r) {
284
+ const s = i.rules;
285
+ return s !== void 0 && !Object.entries(s).some((a) => typeof a != "string" || !(s[a] instanceof RegExp)) ? new Error(
286
+ "Invalid prop `" + t + "` supplied to `" + r + "`. Validation failed."
287
287
  ) : null;
288
288
  },
289
289
  selection: e.shape({
@@ -309,18 +309,18 @@ l.displayName = "MaskedTextBox", l.propTypes = {
309
309
  rules: v,
310
310
  required: !1,
311
311
  validityStyles: !0,
312
- prefix: (s) => null,
313
- suffix: (s) => null,
312
+ prefix: (i) => null,
313
+ suffix: (i) => null,
314
314
  size: "medium",
315
315
  rounded: "medium",
316
316
  fillMode: "solid",
317
317
  autoFocus: !1
318
318
  };
319
319
  let c = l;
320
- const q = E(), w = V(O(q, c));
321
- w.displayName = "KendoReactMaskedTextBox";
320
+ const B = w(), F = M(I(B, D(c)));
321
+ F.displayName = "KendoReactMaskedTextBox";
322
322
  export {
323
- w as MaskedTextBox,
324
- q as MaskedTextBoxPropsContext,
323
+ F as MaskedTextBox,
324
+ B as MaskedTextBoxPropsContext,
325
325
  c as MaskedTextBoxWithoutContext
326
326
  };
@@ -10,7 +10,7 @@ const e = {
10
10
  name: "@progress/kendo-react-inputs",
11
11
  productName: "KendoReact",
12
12
  productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
13
- publishDate: 1723443260,
13
+ publishDate: 1723622340,
14
14
  version: "",
15
15
  licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
16
16
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-inputs",
3
- "version": "8.3.0-develop.3",
3
+ "version": "8.3.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",
@@ -25,13 +25,13 @@
25
25
  "@progress/kendo-drawing": "^1.20.1",
26
26
  "@progress/kendo-inputs-common": "^3.1.0",
27
27
  "@progress/kendo-licensing": "^1.3.4",
28
- "@progress/kendo-react-animation": "8.3.0-develop.3",
29
- "@progress/kendo-react-buttons": "8.3.0-develop.3",
30
- "@progress/kendo-react-common": "8.3.0-develop.3",
31
- "@progress/kendo-react-dialogs": "8.3.0-develop.3",
32
- "@progress/kendo-react-intl": "8.3.0-develop.3",
33
- "@progress/kendo-react-labels": "8.3.0-develop.3",
34
- "@progress/kendo-react-popup": "8.3.0-develop.3",
28
+ "@progress/kendo-react-animation": "8.3.0-develop.4",
29
+ "@progress/kendo-react-buttons": "8.3.0-develop.4",
30
+ "@progress/kendo-react-common": "8.3.0-develop.4",
31
+ "@progress/kendo-react-dialogs": "8.3.0-develop.4",
32
+ "@progress/kendo-react-intl": "8.3.0-develop.4",
33
+ "@progress/kendo-react-labels": "8.3.0-develop.4",
34
+ "@progress/kendo-react-popup": "8.3.0-develop.4",
35
35
  "@progress/kendo-svg-icons": "^3.0.0",
36
36
  "react": "^16.8.2 || ^17.0.0 || ^18.0.0",
37
37
  "react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
@@ -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 D=require("react"),t=require("prop-types"),a=require("@progress/kendo-react-common"),w=require("../package-metadata.js");function _(n){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const l in n)if(l!=="default"){const r=Object.getOwnPropertyDescriptor(n,l);Object.defineProperty(s,l,r.get?r:{enumerable:!0,get:()=>n[l]})}}return s.default=n,Object.freeze(s)}const e=_(D),E=a.createPropsContext(),g=e.forwardRef((n,s)=>{a.validatePackage(w.packageMetadata);const l=a.usePropsContext(E,n),{ariaDescribedBy:r,checked:k,children:h,className:x,disabled:o,id:v,size:d=H.size,label:m,labelPlacement:F,name:I,style:N,tabIndex:O,value:b,valid:j,onChange:y,onFocus:p,onBlur:f,...z}=l,i=e.useRef(null),C=e.useCallback(()=>{i.current&&i.current.focus()},[]),u=e.useCallback(()=>({element:i.current,focus:C}),[C]);e.useImperativeHandle(s,u);const P=a.useId(),M=e.useCallback(c=>{a.dispatchEvent(y,c,u(),{value:b})},[y,b,o]),T=e.useCallback(c=>{p&&!o&&a.dispatchEvent(p,c,u(),void 0)},[p,o]),S=e.useCallback(c=>{f&&!o&&a.dispatchEvent(f,c,u(),void 0)},[f,o]),q={type:"radio",id:v||P,name:I,className:a.classNames("k-radio",{[`k-radio-${a.kendoThemeMaps.sizeMap[d]||d}`]:d,"k-invalid":j===!1,"k-checked":k},x),ref:i,disabled:o,tabIndex:a.getTabIndex(O,o),checked:k,style:N,"aria-describedby":r,value:b,onChange:M,onFocus:T,onBlur:S,...z},B=e.createElement(e.Fragment,null,m!==void 0?e.createElement("label",{className:"k-radio-label",htmlFor:v||P,style:{userSelect:"none"},"aria-label":m},m):null),R=e.createElement("span",{className:"k-radio-wrap"},e.createElement("input",{...q}));return F==="before"?e.createElement(e.Fragment,null,B,R,h):e.createElement(e.Fragment,null,R,B,h)});g.propTypes={ariaDescribedBy:t.string,checked:t.bool,className:t.string,disabled:t.bool,id:t.string,size:t.oneOf([null,"small","medium","large"]),label:t.string,labelPlacement:t.string,name:t.string,style:t.object,tabIndex:t.number,value:t.any,valid:t.bool,onChange:t.func,onFocus:t.func,onBlur:t.func};const H={size:"medium"};g.displayName="KendoRadioButton";exports.RadioButton=g;exports.RadioButtonPropsContext=E;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react"),t=require("prop-types"),a=require("@progress/kendo-react-common"),H=require("../package-metadata.js");function K(n){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const s in n)if(s!=="default"){const r=Object.getOwnPropertyDescriptor(n,s);Object.defineProperty(l,s,r.get?r:{enumerable:!0,get:()=>n[s]})}}return l.default=n,Object.freeze(l)}const e=K(_),N=a.createPropsContext(),g=e.forwardRef((n,l)=>{a.validatePackage(H.packageMetadata);const s=a.usePropsContext(N,n),{ariaDescribedBy:r,checked:y,children:v,className:x,disabled:o,id:B,size:F=L.size,label:d,labelPlacement:I,name:O,style:j,tabIndex:z,value:m,valid:S,onChange:h,onFocus:b,onBlur:p,...T}=s,C=a.useUnstyled(),f=C&&C.uRadioButton,u=e.useRef(null),R=e.useCallback(()=>{u.current&&u.current.focus()},[]),i=e.useCallback(()=>({element:u.current,focus:R}),[R]);e.useImperativeHandle(l,i);const P=a.useId(),q=e.useCallback(c=>{a.dispatchEvent(h,c,i(),{value:m})},[h,m,o]),D=e.useCallback(c=>{b&&!o&&a.dispatchEvent(b,c,i(),void 0)},[b,o]),M=e.useCallback(c=>{p&&!o&&a.dispatchEvent(p,c,i(),void 0)},[p,o]),w={type:"radio",id:B||P,name:O,className:a.classNames(a.uRadioButton.input({c:f,size:F,invalid:S===!1,checked:y}),x),ref:u,disabled:o,tabIndex:a.getTabIndex(z,o),checked:y,style:j,"aria-describedby":r,value:m,onChange:q,onFocus:D,onBlur:M,...T},k=e.createElement(e.Fragment,null,d!==void 0?e.createElement("label",{className:a.classNames(a.uRadioButton.label({c:f})),htmlFor:B||P,style:{userSelect:"none"},"aria-label":d},d):null),E=e.createElement("span",{className:a.classNames(a.uRadioButton.wrap({c:f}))},e.createElement("input",{...w}));return I==="before"?e.createElement(e.Fragment,null,k,E,v):e.createElement(e.Fragment,null,E,k,v)});g.propTypes={ariaDescribedBy:t.string,checked:t.bool,className:t.string,disabled:t.bool,id:t.string,size:t.oneOf([null,"small","medium","large"]),label:t.string,labelPlacement:t.string,name:t.string,style:t.object,tabIndex:t.number,value:t.any,valid:t.bool,onChange:t.func,onFocus:t.func,onBlur:t.func};const L={size:"medium"};g.displayName="KendoRadioButton";exports.RadioButton=g;exports.RadioButtonPropsContext=N;