@progress/kendo-react-inputs 16.1.0-develop.9 → 16.2.0-develop.1
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/interfaces/CheckboxProps.d.ts +1 -1
- package/colors/interfaces/ColorGradientProps.d.ts +1 -1
- package/colors/interfaces/ColorPaletteProps.d.ts +1 -1
- package/colors/interfaces/ColorPickerProps.d.ts +1 -1
- package/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/input/Input.d.ts +1 -1
- package/maskedtextbox/MaskedTextBoxProps.d.ts +1 -1
- package/numerictextbox/interfaces/NumericTextBoxProps.d.ts +1 -1
- package/numerictextbox/utils/index.d.ts +4 -0
- package/numerictextbox/utils/index.js +1 -1
- package/numerictextbox/utils/index.mjs +136 -132
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +11 -11
- package/radiobutton/interfaces/RadioButtonProps.d.ts +1 -1
- package/radiobutton/interfaces/RadioGroupProps.d.ts +1 -1
- package/range-slider/RangeSlider.d.ts +1 -1
- package/textarea/interfaces/TextAreaProps.d.ts +1 -1
package/input/Input.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElem
|
|
|
34
34
|
*/
|
|
35
35
|
defaultValue?: string | string[];
|
|
36
36
|
/**
|
|
37
|
-
* Identifies the element(s) which will describe the component, similar to [HTML aria-describedby attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/
|
|
37
|
+
* Identifies the element(s) which will describe the component, similar to [HTML aria-describedby attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-describedby).
|
|
38
38
|
* For example these elements could contain error or hint message.
|
|
39
39
|
*
|
|
40
40
|
* @remarks
|
|
@@ -147,7 +147,7 @@ export interface MaskedTextBoxProps extends FormComponentProps {
|
|
|
147
147
|
*/
|
|
148
148
|
suffix?: CustomComponent<any>;
|
|
149
149
|
/**
|
|
150
|
-
* Identifies the element(s) which will describe the component, similar to [HTML aria-describedby attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/
|
|
150
|
+
* Identifies the element(s) which will describe the component, similar to [HTML aria-describedby attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-describedby).
|
|
151
151
|
* For example these elements could contain error or hint message.
|
|
152
152
|
*
|
|
153
153
|
* @remarks
|
|
@@ -102,7 +102,7 @@ export interface NumericTextBoxProps extends FormComponentProps, Omit<React.HTML
|
|
|
102
102
|
*/
|
|
103
103
|
suffix?: CustomComponent<any>;
|
|
104
104
|
/**
|
|
105
|
-
* Identifies the element(s) which will describe the component, similar to [HTML aria-describedby attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/
|
|
105
|
+
* Identifies the element(s) which will describe the component, similar to [HTML aria-describedby attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-describedby).
|
|
106
106
|
* For example these elements could contain error or hint message.
|
|
107
107
|
*
|
|
108
108
|
* @remarks
|
|
@@ -27,6 +27,10 @@ export declare const fractionLength: (value: number) => number;
|
|
|
27
27
|
* @hidden
|
|
28
28
|
*/
|
|
29
29
|
export declare const limitPrecision: (precision: number) => number;
|
|
30
|
+
/**
|
|
31
|
+
* @hidden
|
|
32
|
+
*/
|
|
33
|
+
export declare const significantDigitsCount: (looseValue: string, decimalSymbol: string, maxFractionDigits: number) => number;
|
|
30
34
|
/**
|
|
31
35
|
* @hidden
|
|
32
36
|
*/
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=11111111111111e-7,he=.31111111111111117,Ie=1,ee=1,ne=0,m=/\d/,te=15,Ne=()=>({eventValue:null,prevLooseValue:"",currentLooseValue:"",focused:!1,selectionStart:void 0,selectionEnd:void 0,decimalSelect:!1,valueIsCorrected:!1,valueIsOutOfRange:!1}),Ce=(n,t)=>n!==void 0?n:t,x=(n,t,r)=>n==null?"":typeof n=="string"?n:r.formatNumber(n,t),$=n=>(String(n).split(".")[1]||"").length,re=(n,t)=>Math.max($(n),$(t)),se=n=>Math.min(n,te),oe=(n,t,r)=>{const e=n.indexOf(t),i=e===-1?n:n.substring(0,e),s=e===-1?"":n.substring(e+1),l=i.replace(/\D/g,""),o=s.replace(/\D/g,"").substring(0,r);return(l+o.replace(/0+$/,"")).replace(/^0+/,"").length},U=(n,t)=>{const r=se(t);return parseFloat(n.toFixed(r))},De=(n,t,r,e,i,s,l)=>{const o=re(n||0,r||0),c=W(U((n||0)+(r||0),o),e,i);t.eventValue=c,t.currentLooseValue=x(c,s,l),t.selectionStart=t.selectionEnd=N(t.currentLooseValue,m)},Pe=(n,t,r,e,i,s,l)=>{const o=re(n||0,r||0),c=W(U((n||0)-(r||0),o),e,i);t.eventValue=c,t.currentLooseValue=x(c,s,l),t.selectionStart=t.selectionEnd=N(t.currentLooseValue,m)},W=(n,t,r)=>n==null?n:!(n>1||n<1||n===1)||r!==void 0&&t!==void 0&&r<t?null:(r!==void 0&&n>r&&(n=r),t!==void 0&&n<t&&(n=t),n),ie=(n,t)=>{const r=t.findIndex(([i,s])=>!!s&&n.indexOf(s)===n.length-s.length);if(r===-1)return-1;const e=t[r][1];return n.length-e.length},ue=(n,t)=>{const r=t.findIndex(([i,s])=>!!i&&n.indexOf(i)===0);return r===-1?-1:t[r][0].length},ce=(n,t,r)=>{const e=ie(n,t);if(e!==-1&&r.selectionStart>e){r.selectionStart=r.selectionEnd=e;return}r.selectionStart>n.length&&(r.selectionStart=r.selectionEnd=n.length);const i=ue(n,t);i!==-1&&r.selectionStart<i&&(r.selectionStart=r.selectionEnd=i),r.selectionStart===-1&&(r.selectionStart=r.selectionEnd=0)},p=(n,t,r,e)=>{n.selectionStart=n.selectionEnd=t,ce(r,e,n)},E=(n,t,r,e)=>{n.eventValue=e.parseNumber(n.prevLooseValue,t),n.currentLooseValue=n.prevLooseValue,n.valueIsCorrected=!0,p(n,n.selectionStart,n.currentLooseValue,r)},B=(n,t,r)=>t.split(n).length!==r.split(n).length&&t.length===r.length+n.length,le=(n,t)=>{const r=String(n.currentLooseValue),e=String(n.prevLooseValue);return B(t.minusSign,r,e)||B("-",r,e)||B("−",r,e)},ae=(n,t)=>{const r=String(n.currentLooseValue),e=String(n.prevLooseValue);return r.indexOf(t.minusSign)===-1&&e.indexOf(t.minusSign)!==-1},de=(n,t)=>String(n.currentLooseValue).split(t.decimal).length>2,ge=(n,t)=>{const r=t.formatNumber(v,n),e=t.formatNumber(-v,n),i=t.formatNumber(ne,n),s=t.formatNumber(ee,n),l=O(r),o=O(e),c=O(i),a=O(s),C=R(r),D=R(e),b=R(i),L=R(s);return{positiveInfo:[l,C],negativeInfo:[o,D],zeroInfo:[c,b],oneInfo:[a,L]}},fe=(n,t)=>{const r=t.formatNumber(v,n),e=t.formatNumber(-v,n),i=t.formatNumber(ne,n),s=t.formatNumber(ee,n),l=t.numberSymbols(),o=new RegExp(`[\\d\\${l.decimal}${l.group}]`,"g");return[r,e,i,s].map(a=>a.replace(o,"")).join("").split("").filter((a,C,D)=>D.indexOf(a)===C).join("")},T=(n,t)=>{const r=n.indexOf(t.decimal);return r>-1?r:N(n,m)},y=n=>n.split("").reverse().join(""),N=(n,t)=>n.length-y(n).search(t),O=n=>n.split(n[n.search(m)])[0],R=n=>{const t=y(n);return y(t.split(t[t.search(m)])[0])},S=(n,t)=>n.search(t),j=(n,t)=>{const r=n.indexOf(t);return r>-1?n.length-r-1:0},G=(n,t,r,e,i)=>{const s=n.replace(i,"")[0]==="0",l=t.replace(i,"")[0]==="0";if(s&&!l)return r-1;if(l&&e)return r+1;let o=0;for(let a=0;a<r;a++)m.test(n.charAt(a))&&o++;let c=0;for(;o>0&&t.length>c;)m.test(t.charAt(c))&&o--,c++;return c},Ee=(n,t,r)=>{const e={...n},{prevLooseValue:i}=e,s=r.numberSymbols(),l=fe(t,r),o=String(e.currentLooseValue),c=String(i),a=new RegExp(`[^\\d\\${s.decimal}]`,"g"),C=new RegExp(`[^\\d\\${s.decimal}\\${s.group}]`,"g"),D=new RegExp(`[\\d\\${s.decimal}\\${s.group}]`),b=o.replace(a,""),L=S(o,m),P=L===-1?-1:N(o,m),me=o.indexOf(s.decimal),X=(o.substring(0,L)+o.substring(L,P).replace(C,"")+o.substring(P,o.length)).split("").filter(V=>l.indexOf(V)!==-1||V.search(D)!==-1).join(""),Z=r.formatNumber(he,t).replace(a,""),k=Z.indexOf(s.decimal),h=k>-1?Z.length-k-1:0,q=r.formatNumber(Ie,t).replace(a,""),H=q.indexOf(s.decimal),M=H>-1?q.length-H-1:0,{positiveInfo:Ve,negativeInfo:pe,zeroInfo:xe,oneInfo:be}=ge(t,r),d=[Ve,pe,xe,be],Le=d.findIndex(V=>V.findIndex(I=>!!I)!==-1)!==1,F=o.length>0&&o.length<c.length,J=typeof t=="string"&&t[0]==="p"&&o&&o.indexOf(s.percentSign)===-1;if(!e.isPaste){if(o==="")return e.eventValue=null,e.currentLooseValue="",e;if(e.currentLooseValue===s.minusSign&&r.formatNumber(-0,t)!==c)return e.eventValue=null,e.currentLooseValue=s.minusSign,p(e,e.selectionStart,e.currentLooseValue,d),e;if(e.currentLooseValue===s.decimal){e.eventValue=0;const f=x(e.eventValue,t,r);if(M===0&&h>0){const u=N(f,m);e.currentLooseValue=f.substring(0,u)+s.decimal+f.substring(u)}else e.currentLooseValue=f;return p(e,T(e.currentLooseValue,s)+1,e.currentLooseValue,d),e}if(le(e,s)){const f=r.parseNumber(i,t);if(f===null)return e.eventValue=null,e.currentLooseValue=s.minusSign,p(e,e.selectionStart,e.currentLooseValue,d),e;e.eventValue=-f,e.currentLooseValue=x(e.eventValue,t,r);const u=S(e.currentLooseValue,m),g=S(c,m);return p(e,e.selectionEnd-1+(u-g),e.currentLooseValue,d),e}if(ae(e,s))return e.eventValue=r.parseNumber(e.currentLooseValue,t),p(e,e.selectionStart,e.currentLooseValue,d),e;if(de(e,s))return E(e,t,d,r),e;if(J)return e.eventValue=r.parseNumber(o,t)/100,e.currentLooseValue=x(e.eventValue,t,r),e;if(oe(o,s.decimal,h)>te||b!==o&&o&&Le&&d.findIndex(([u,g])=>{const A=o.indexOf(u),_=o.indexOf(g),K=A===0,Q=_===o.length-g.length,Y=A+u.length!==L&&L!==-1&&o[A+u.length]!==s.decimal,w=_!==P&&P!==-1&&o[_-1]!==s.decimal;return u&&g?Y||w?!1:K&&Q:u?Y?!1:K:g?w?!1:Q:!1})===-1||o.indexOf(s.percentSign)>-1&&(typeof t!="string"||!t.startsWith("p")))return E(e,t,d,r),e;if(b[b.length-1]===s.decimal&&h>0)return e.eventValue=r.parseNumber(o,t),e.currentLooseValue=X,e;if(e.currentLooseValue&&i&&(l+s.decimal+s.group).split("").findIndex(u=>o.split("").filter(g=>g===u).length<c.split("").filter(g=>g===u).length&&o.length+1===c.length?!(u===s.decimal&&j(c.replace(a,""),s.decimal)===0):!1)>-1)return e.eventValue=r.parseNumber(n.prevLooseValue,t),e.currentLooseValue=n.prevLooseValue,e;const I=j(b,s.decimal),z=b[b.length-1]==="0";if(F&&z&&I<M)return e.eventValue=r.parseNumber(e.currentLooseValue,t),e.currentLooseValue=x(e.eventValue,t,r),e;if(I>0){const f=o.substring(0,me);if(z&&(!f||c.indexOf(f)!==0)){e.eventValue=r.parseNumber(e.currentLooseValue,t);const u=x(e.eventValue,t,r);return p(e,G(o,u,e.selectionEnd,F,a),u,d),e.currentLooseValue=u,e}if(I>h){const u=o.indexOf(s.decimal),g=o.substring(0,u)+o.substring(u,u+1+h)+o.substring(P,String(e.currentLooseValue).length);return e.eventValue=r.parseNumber(g,t),e.currentLooseValue=g,p(e,e.selectionStart,g,d),e}if(M!==h&&I<=h&&z)return e.eventValue=r.parseNumber(e.currentLooseValue,t),e.currentLooseValue=X,e;if(I<M)return e.eventValue=r.parseNumber(e.currentLooseValue,t),e.currentLooseValue=x(e.eventValue,t,r),e}}if(e.eventValue=r.parseNumber(e.currentLooseValue,t),J&&(e.eventValue=e.eventValue/100),typeof e.eventValue=="number"){const V=x(e.eventValue,t,r);o.length===1?p(e,T(V,s),V,d):p(e,G(o,V,e.selectionEnd,F,a),V,d),e.currentLooseValue=V}else e.currentLooseValue=x(r.parseNumber(b),t,r);return e};exports.changeBasedSelection=G;exports.decreaseValue=Pe;exports.formatValue=x;exports.fractionLength=$;exports.getDecimalCount=j;exports.getFirstNumberIndex=S;exports.getFormatPrefixSufix=ge;exports.getFormatSymbols=fe;exports.getInitialPosition=T;exports.getInitialState=Ne;exports.getLastNumberIndex=N;exports.getMaxCursorPosition=ie;exports.getMinCursorPosition=ue;exports.getPrefix=O;exports.getStateOrPropsValue=Ce;exports.getSuffix=R;exports.increaseValue=De;exports.isDecimalDuplicated=de;exports.isMinusSymbolAdded=le;exports.isMinusSymbolRemoved=ae;exports.limitPrecision=se;exports.rangeSelection=ce;exports.rangeValue=W;exports.reverseString=y;exports.sanitizeNumber=Ee;exports.setInvalid=E;exports.setSelection=p;exports.significantDigitsCount=oe;exports.toFixedPrecision=U;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
const
|
|
8
|
+
const v = 11111111111111e-7, ae = 0.31111111111111117, de = 1, Y = 1, w = 0, m = /\d/, ee = 15, Ne = () => ({
|
|
9
9
|
eventValue: null,
|
|
10
10
|
prevLooseValue: "",
|
|
11
11
|
currentLooseValue: "",
|
|
@@ -15,173 +15,176 @@ const y = 11111111111111e-7, ae = 0.31111111111111117, de = 1, Y = 1, w = 0, m =
|
|
|
15
15
|
decimalSelect: !1,
|
|
16
16
|
valueIsCorrected: !1,
|
|
17
17
|
valueIsOutOfRange: !1
|
|
18
|
-
}),
|
|
19
|
-
const
|
|
20
|
-
return
|
|
21
|
-
},
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
const
|
|
18
|
+
}), Ce = (n, t) => n !== void 0 ? n : t, x = (n, t, r) => n == null ? "" : typeof n == "string" ? n : r.formatNumber(n, t), H = (n) => (String(n).split(".")[1] || "").length, ne = (n, t) => Math.max(H(n), H(t)), ge = (n) => Math.min(n, ee), fe = (n, t, r) => {
|
|
19
|
+
const e = n.indexOf(t), u = e === -1 ? n : n.substring(0, e), s = e === -1 ? "" : n.substring(e + 1), l = u.replace(/\D/g, ""), o = s.replace(/\D/g, "").substring(0, r);
|
|
20
|
+
return (l + o.replace(/0+$/, "")).replace(/^0+/, "").length;
|
|
21
|
+
}, te = (n, t) => {
|
|
22
|
+
const r = ge(t);
|
|
23
|
+
return parseFloat(n.toFixed(r));
|
|
24
|
+
}, De = (n, t, r, e, u, s, l) => {
|
|
25
|
+
const o = ne(n || 0, r || 0), c = re(te((n || 0) + (r || 0), o), e, u);
|
|
26
|
+
t.eventValue = c, t.currentLooseValue = x(c, s, l), t.selectionStart = t.selectionEnd = E(t.currentLooseValue, m);
|
|
27
|
+
}, Ee = (n, t, r, e, u, s, l) => {
|
|
28
|
+
const o = ne(n || 0, r || 0), c = re(te((n || 0) - (r || 0), o), e, u);
|
|
29
|
+
t.eventValue = c, t.currentLooseValue = x(c, s, l), t.selectionStart = t.selectionEnd = E(t.currentLooseValue, m);
|
|
30
|
+
}, re = (n, t, r) => n == null ? n : !(n > 1 || n < 1 || n === 1) || r !== void 0 && t !== void 0 && r < t ? null : (r !== void 0 && n > r && (n = r), t !== void 0 && n < t && (n = t), n), me = (n, t) => {
|
|
31
|
+
const r = t.findIndex(([u, s]) => !!s && n.indexOf(s) === n.length - s.length);
|
|
29
32
|
if (r === -1)
|
|
30
33
|
return -1;
|
|
31
|
-
const e =
|
|
32
|
-
return
|
|
33
|
-
},
|
|
34
|
-
const r =
|
|
35
|
-
return r === -1 ? -1 :
|
|
36
|
-
},
|
|
37
|
-
const e =
|
|
34
|
+
const e = t[r][1];
|
|
35
|
+
return n.length - e.length;
|
|
36
|
+
}, Ve = (n, t) => {
|
|
37
|
+
const r = t.findIndex(([u, s]) => !!u && n.indexOf(u) === 0);
|
|
38
|
+
return r === -1 ? -1 : t[r][0].length;
|
|
39
|
+
}, pe = (n, t, r) => {
|
|
40
|
+
const e = me(n, t);
|
|
38
41
|
if (e !== -1 && r.selectionStart > e) {
|
|
39
42
|
r.selectionStart = r.selectionEnd = e;
|
|
40
43
|
return;
|
|
41
44
|
}
|
|
42
|
-
r.selectionStart >
|
|
43
|
-
const u =
|
|
45
|
+
r.selectionStart > n.length && (r.selectionStart = r.selectionEnd = n.length);
|
|
46
|
+
const u = Ve(n, t);
|
|
44
47
|
u !== -1 && r.selectionStart < u && (r.selectionStart = r.selectionEnd = u), r.selectionStart === -1 && (r.selectionStart = r.selectionEnd = 0);
|
|
45
|
-
}, p = (
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
const r = String(
|
|
51
|
-
return
|
|
52
|
-
},
|
|
53
|
-
const r = String(
|
|
54
|
-
return r.indexOf(
|
|
55
|
-
},
|
|
56
|
-
const r =
|
|
48
|
+
}, p = (n, t, r, e) => {
|
|
49
|
+
n.selectionStart = n.selectionEnd = t, pe(r, e, n);
|
|
50
|
+
}, P = (n, t, r, e) => {
|
|
51
|
+
n.eventValue = e.parseNumber(n.prevLooseValue, t), n.currentLooseValue = n.prevLooseValue, n.valueIsCorrected = !0, p(n, n.selectionStart, n.currentLooseValue, r);
|
|
52
|
+
}, _ = (n, t, r) => t.split(n).length !== r.split(n).length && t.length === r.length + n.length, xe = (n, t) => {
|
|
53
|
+
const r = String(n.currentLooseValue), e = String(n.prevLooseValue);
|
|
54
|
+
return _(t.minusSign, r, e) || _("-", r, e) || _("−", r, e);
|
|
55
|
+
}, Le = (n, t) => {
|
|
56
|
+
const r = String(n.currentLooseValue), e = String(n.prevLooseValue);
|
|
57
|
+
return r.indexOf(t.minusSign) === -1 && e.indexOf(t.minusSign) !== -1;
|
|
58
|
+
}, be = (n, t) => String(n.currentLooseValue).split(t.decimal).length > 2, he = (n, t) => {
|
|
59
|
+
const r = t.formatNumber(v, n), e = t.formatNumber(-v, n), u = t.formatNumber(w, n), s = t.formatNumber(Y, n), l = R(r), o = R(e), c = R(u), a = R(s), N = M(r), C = M(e), L = M(u), b = M(s);
|
|
57
60
|
return {
|
|
58
|
-
positiveInfo: [
|
|
59
|
-
negativeInfo: [
|
|
60
|
-
zeroInfo: [
|
|
61
|
-
oneInfo: [
|
|
61
|
+
positiveInfo: [l, N],
|
|
62
|
+
negativeInfo: [o, C],
|
|
63
|
+
zeroInfo: [c, L],
|
|
64
|
+
oneInfo: [a, b]
|
|
62
65
|
};
|
|
63
|
-
},
|
|
64
|
-
const r =
|
|
65
|
-
return [r, e, u,
|
|
66
|
-
}, J = (
|
|
67
|
-
const r =
|
|
68
|
-
return r > -1 ? r :
|
|
69
|
-
}, B = (
|
|
70
|
-
const
|
|
71
|
-
return B(
|
|
72
|
-
},
|
|
73
|
-
const r =
|
|
74
|
-
return r > -1 ?
|
|
75
|
-
}, Q = (
|
|
76
|
-
const
|
|
77
|
-
if (
|
|
66
|
+
}, Ie = (n, t) => {
|
|
67
|
+
const r = t.formatNumber(v, n), e = t.formatNumber(-v, n), u = t.formatNumber(w, n), s = t.formatNumber(Y, n), l = t.numberSymbols(), o = new RegExp(`[\\d\\${l.decimal}${l.group}]`, "g");
|
|
68
|
+
return [r, e, u, s].map((a) => a.replace(o, "")).join("").split("").filter((a, N, C) => C.indexOf(a) === N).join("");
|
|
69
|
+
}, J = (n, t) => {
|
|
70
|
+
const r = n.indexOf(t.decimal);
|
|
71
|
+
return r > -1 ? r : E(n, m);
|
|
72
|
+
}, B = (n) => n.split("").reverse().join(""), E = (n, t) => n.length - B(n).search(t), R = (n) => n.split(n[n.search(m)])[0], M = (n) => {
|
|
73
|
+
const t = B(n);
|
|
74
|
+
return B(t.split(t[t.search(m)])[0]);
|
|
75
|
+
}, $ = (n, t) => n.search(t), K = (n, t) => {
|
|
76
|
+
const r = n.indexOf(t);
|
|
77
|
+
return r > -1 ? n.length - r - 1 : 0;
|
|
78
|
+
}, Q = (n, t, r, e, u) => {
|
|
79
|
+
const s = n.replace(u, "")[0] === "0", l = t.replace(u, "")[0] === "0";
|
|
80
|
+
if (s && !l)
|
|
78
81
|
return r - 1;
|
|
79
|
-
if (
|
|
82
|
+
if (l && e)
|
|
80
83
|
return r + 1;
|
|
81
|
-
let
|
|
82
|
-
for (let
|
|
83
|
-
m.test(
|
|
84
|
-
let
|
|
85
|
-
for (;
|
|
86
|
-
m.test(
|
|
87
|
-
return
|
|
88
|
-
}, Oe = (
|
|
89
|
-
const e = { ...
|
|
84
|
+
let o = 0;
|
|
85
|
+
for (let a = 0; a < r; a++)
|
|
86
|
+
m.test(n.charAt(a)) && o++;
|
|
87
|
+
let c = 0;
|
|
88
|
+
for (; o > 0 && t.length > c; )
|
|
89
|
+
m.test(t.charAt(c)) && o--, c++;
|
|
90
|
+
return c;
|
|
91
|
+
}, Oe = (n, t, r) => {
|
|
92
|
+
const e = { ...n }, { prevLooseValue: u } = e, s = r.numberSymbols(), l = Ie(t, r), o = String(e.currentLooseValue), c = String(u), a = new RegExp(`[^\\d\\${s.decimal}]`, "g"), N = new RegExp(`[^\\d\\${s.decimal}\\${s.group}]`, "g"), C = new RegExp(`[\\d\\${s.decimal}\\${s.group}]`), L = o.replace(a, ""), b = $(o, m), D = b === -1 ? -1 : E(o, m), se = o.indexOf(s.decimal), S = (o.substring(0, b) + o.substring(b, D).replace(N, "") + o.substring(D, o.length)).split("").filter((V) => l.indexOf(V) !== -1 || V.search(C) !== -1).join(""), T = r.formatNumber(ae, t).replace(a, ""), G = T.indexOf(s.decimal), h = G > -1 ? T.length - G - 1 : 0, U = r.formatNumber(de, t).replace(a, ""), j = U.indexOf(s.decimal), O = j > -1 ? U.length - j - 1 : 0, { positiveInfo: oe, negativeInfo: ue, zeroInfo: ie, oneInfo: ce } = he(t, r), d = [oe, ue, ie, ce], le = d.findIndex((V) => V.findIndex((I) => !!I) !== -1) !== 1, y = o.length > 0 && o.length < c.length, W = typeof t == "string" && t[0] === "p" && o && o.indexOf(s.percentSign) === -1;
|
|
90
93
|
if (!e.isPaste) {
|
|
91
|
-
if (
|
|
94
|
+
if (o === "")
|
|
92
95
|
return e.eventValue = null, e.currentLooseValue = "", e;
|
|
93
|
-
if (e.currentLooseValue ===
|
|
94
|
-
return e.eventValue = null, e.currentLooseValue =
|
|
95
|
-
if (e.currentLooseValue ===
|
|
96
|
+
if (e.currentLooseValue === s.minusSign && r.formatNumber(-0, t) !== c)
|
|
97
|
+
return e.eventValue = null, e.currentLooseValue = s.minusSign, p(e, e.selectionStart, e.currentLooseValue, d), e;
|
|
98
|
+
if (e.currentLooseValue === s.decimal) {
|
|
96
99
|
e.eventValue = 0;
|
|
97
|
-
const f = x(e.eventValue,
|
|
98
|
-
if (
|
|
99
|
-
const i =
|
|
100
|
-
e.currentLooseValue = f.substring(0, i) +
|
|
100
|
+
const f = x(e.eventValue, t, r);
|
|
101
|
+
if (O === 0 && h > 0) {
|
|
102
|
+
const i = E(f, m);
|
|
103
|
+
e.currentLooseValue = f.substring(0, i) + s.decimal + f.substring(i);
|
|
101
104
|
} else
|
|
102
105
|
e.currentLooseValue = f;
|
|
103
106
|
return p(
|
|
104
107
|
e,
|
|
105
|
-
J(e.currentLooseValue,
|
|
108
|
+
J(e.currentLooseValue, s) + 1,
|
|
106
109
|
e.currentLooseValue,
|
|
107
|
-
|
|
110
|
+
d
|
|
108
111
|
), e;
|
|
109
112
|
}
|
|
110
|
-
if (
|
|
111
|
-
const f = r.parseNumber(u,
|
|
113
|
+
if (xe(e, s)) {
|
|
114
|
+
const f = r.parseNumber(u, t);
|
|
112
115
|
if (f === null)
|
|
113
|
-
return e.eventValue = null, e.currentLooseValue =
|
|
114
|
-
e.eventValue = -f, e.currentLooseValue = x(e.eventValue,
|
|
115
|
-
const i =
|
|
116
|
+
return e.eventValue = null, e.currentLooseValue = s.minusSign, p(e, e.selectionStart, e.currentLooseValue, d), e;
|
|
117
|
+
e.eventValue = -f, e.currentLooseValue = x(e.eventValue, t, r);
|
|
118
|
+
const i = $(e.currentLooseValue, m), g = $(c, m);
|
|
116
119
|
return p(
|
|
117
120
|
e,
|
|
118
121
|
e.selectionEnd - 1 + (i - g),
|
|
119
122
|
e.currentLooseValue,
|
|
120
|
-
|
|
123
|
+
d
|
|
121
124
|
), e;
|
|
122
125
|
}
|
|
123
|
-
if (
|
|
124
|
-
return e.eventValue = r.parseNumber(e.currentLooseValue,
|
|
125
|
-
if (
|
|
126
|
-
return
|
|
126
|
+
if (Le(e, s))
|
|
127
|
+
return e.eventValue = r.parseNumber(e.currentLooseValue, t), p(e, e.selectionStart, e.currentLooseValue, d), e;
|
|
128
|
+
if (be(e, s))
|
|
129
|
+
return P(e, t, d, r), e;
|
|
127
130
|
if (W)
|
|
128
|
-
return e.eventValue = r.parseNumber(
|
|
129
|
-
if (
|
|
130
|
-
const z =
|
|
131
|
+
return e.eventValue = r.parseNumber(o, t) / 100, e.currentLooseValue = x(e.eventValue, t, r), e;
|
|
132
|
+
if (fe(o, s.decimal, h) > ee || L !== o && o && le && d.findIndex(([i, g]) => {
|
|
133
|
+
const z = o.indexOf(i), A = o.indexOf(g), X = z === 0, Z = A === o.length - g.length, k = z + i.length !== b && b !== -1 && o[z + i.length] !== s.decimal, q = A !== D && D !== -1 && o[A - 1] !== s.decimal;
|
|
131
134
|
return i && g ? k || q ? !1 : X && Z : i ? k ? !1 : X : g ? q ? !1 : Z : !1;
|
|
132
|
-
}) === -1 ||
|
|
133
|
-
return
|
|
134
|
-
if (L[L.length - 1] ===
|
|
135
|
-
return e.eventValue = r.parseNumber(
|
|
136
|
-
if (e.currentLooseValue && u && (
|
|
137
|
-
return e.eventValue = r.parseNumber(
|
|
138
|
-
const
|
|
139
|
-
if (
|
|
140
|
-
return e.eventValue = r.parseNumber(e.currentLooseValue,
|
|
141
|
-
if (
|
|
142
|
-
const f =
|
|
143
|
-
if (F && (!f ||
|
|
144
|
-
e.eventValue = r.parseNumber(e.currentLooseValue,
|
|
145
|
-
const i = x(e.eventValue,
|
|
135
|
+
}) === -1 || o.indexOf(s.percentSign) > -1 && (typeof t != "string" || !t.startsWith("p")))
|
|
136
|
+
return P(e, t, d, r), e;
|
|
137
|
+
if (L[L.length - 1] === s.decimal && h > 0)
|
|
138
|
+
return e.eventValue = r.parseNumber(o, t), e.currentLooseValue = S, e;
|
|
139
|
+
if (e.currentLooseValue && u && (l + s.decimal + s.group).split("").findIndex((i) => o.split("").filter((g) => g === i).length < c.split("").filter((g) => g === i).length && o.length + 1 === c.length ? !(i === s.decimal && K(c.replace(a, ""), s.decimal) === 0) : !1) > -1)
|
|
140
|
+
return e.eventValue = r.parseNumber(n.prevLooseValue, t), e.currentLooseValue = n.prevLooseValue, e;
|
|
141
|
+
const I = K(L, s.decimal), F = L[L.length - 1] === "0";
|
|
142
|
+
if (y && F && I < O)
|
|
143
|
+
return e.eventValue = r.parseNumber(e.currentLooseValue, t), e.currentLooseValue = x(e.eventValue, t, r), e;
|
|
144
|
+
if (I > 0) {
|
|
145
|
+
const f = o.substring(0, se);
|
|
146
|
+
if (F && (!f || c.indexOf(f) !== 0)) {
|
|
147
|
+
e.eventValue = r.parseNumber(e.currentLooseValue, t);
|
|
148
|
+
const i = x(e.eventValue, t, r);
|
|
146
149
|
return p(
|
|
147
150
|
e,
|
|
148
151
|
Q(
|
|
149
|
-
|
|
152
|
+
o,
|
|
150
153
|
i,
|
|
151
154
|
e.selectionEnd,
|
|
152
|
-
|
|
153
|
-
|
|
155
|
+
y,
|
|
156
|
+
a
|
|
154
157
|
),
|
|
155
158
|
i,
|
|
156
|
-
|
|
159
|
+
d
|
|
157
160
|
), e.currentLooseValue = i, e;
|
|
158
161
|
}
|
|
159
|
-
if (
|
|
160
|
-
const i =
|
|
161
|
-
return e.eventValue = r.parseNumber(g,
|
|
162
|
+
if (I > h) {
|
|
163
|
+
const i = o.indexOf(s.decimal), g = o.substring(0, i) + o.substring(i, i + 1 + h) + o.substring(D, String(e.currentLooseValue).length);
|
|
164
|
+
return e.eventValue = r.parseNumber(g, t), e.currentLooseValue = g, p(e, e.selectionStart, g, d), e;
|
|
162
165
|
}
|
|
163
|
-
if (
|
|
164
|
-
return e.eventValue = r.parseNumber(e.currentLooseValue,
|
|
165
|
-
if (
|
|
166
|
-
return e.eventValue = r.parseNumber(e.currentLooseValue,
|
|
166
|
+
if (O !== h && I <= h && F)
|
|
167
|
+
return e.eventValue = r.parseNumber(e.currentLooseValue, t), e.currentLooseValue = S, e;
|
|
168
|
+
if (I < O)
|
|
169
|
+
return e.eventValue = r.parseNumber(e.currentLooseValue, t), e.currentLooseValue = x(e.eventValue, t, r), e;
|
|
167
170
|
}
|
|
168
171
|
}
|
|
169
|
-
if (e.eventValue = r.parseNumber(e.currentLooseValue,
|
|
170
|
-
const V = x(e.eventValue,
|
|
171
|
-
|
|
172
|
+
if (e.eventValue = r.parseNumber(e.currentLooseValue, t), W && (e.eventValue = e.eventValue / 100), typeof e.eventValue == "number") {
|
|
173
|
+
const V = x(e.eventValue, t, r);
|
|
174
|
+
o.length === 1 ? p(e, J(V, s), V, d) : p(
|
|
172
175
|
e,
|
|
173
176
|
Q(
|
|
174
|
-
|
|
177
|
+
o,
|
|
175
178
|
V,
|
|
176
179
|
e.selectionEnd,
|
|
177
|
-
|
|
178
|
-
|
|
180
|
+
y,
|
|
181
|
+
a
|
|
179
182
|
),
|
|
180
183
|
V,
|
|
181
|
-
|
|
184
|
+
d
|
|
182
185
|
), e.currentLooseValue = V;
|
|
183
186
|
} else
|
|
184
|
-
e.currentLooseValue = x(r.parseNumber(L),
|
|
187
|
+
e.currentLooseValue = x(r.parseNumber(L), t, r);
|
|
185
188
|
return e;
|
|
186
189
|
};
|
|
187
190
|
export {
|
|
@@ -190,27 +193,28 @@ export {
|
|
|
190
193
|
x as formatValue,
|
|
191
194
|
H as fractionLength,
|
|
192
195
|
K as getDecimalCount,
|
|
193
|
-
|
|
196
|
+
$ as getFirstNumberIndex,
|
|
194
197
|
he as getFormatPrefixSufix,
|
|
195
|
-
|
|
198
|
+
Ie as getFormatSymbols,
|
|
196
199
|
J as getInitialPosition,
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
200
|
+
Ne as getInitialState,
|
|
201
|
+
E as getLastNumberIndex,
|
|
202
|
+
me as getMaxCursorPosition,
|
|
203
|
+
Ve as getMinCursorPosition,
|
|
204
|
+
R as getPrefix,
|
|
205
|
+
Ce as getStateOrPropsValue,
|
|
203
206
|
M as getSuffix,
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
207
|
+
De as increaseValue,
|
|
208
|
+
be as isDecimalDuplicated,
|
|
209
|
+
xe as isMinusSymbolAdded,
|
|
210
|
+
Le as isMinusSymbolRemoved,
|
|
208
211
|
ge as limitPrecision,
|
|
209
|
-
|
|
212
|
+
pe as rangeSelection,
|
|
210
213
|
re as rangeValue,
|
|
211
214
|
B as reverseString,
|
|
212
215
|
Oe as sanitizeNumber,
|
|
213
|
-
|
|
216
|
+
P as setInvalid,
|
|
214
217
|
p as setSelection,
|
|
218
|
+
fe as significantDigitsCount,
|
|
215
219
|
te as toFixedPrecision
|
|
216
220
|
};
|
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: 1789024170,version:"16.2.0-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"});exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -7,7 +7,7 @@ export const packageMetadata = Object.freeze({
|
|
|
7
7
|
productName: 'KendoReact',
|
|
8
8
|
productCode: 'KENDOUIREACT',
|
|
9
9
|
productCodes: ['KENDOUIREACT'],
|
|
10
|
-
publishDate:
|
|
11
|
-
version: '16.
|
|
10
|
+
publishDate: 1789024170,
|
|
11
|
+
version: '16.2.0-develop.1',
|
|
12
12
|
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/components/my-license/'
|
|
13
13
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-inputs",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.2.0-develop.1",
|
|
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,17 +25,17 @@
|
|
|
25
25
|
},
|
|
26
26
|
"sideEffects": false,
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@progress/kendo-drawing": "^1.
|
|
28
|
+
"@progress/kendo-drawing": "^1.25.5",
|
|
29
29
|
"@progress/kendo-inputs-common": "^3.1.0",
|
|
30
30
|
"@progress/kendo-licensing": "^1.7.2",
|
|
31
|
-
"@progress/kendo-react-animation": "16.
|
|
32
|
-
"@progress/kendo-react-buttons": "16.
|
|
33
|
-
"@progress/kendo-react-common": "16.
|
|
34
|
-
"@progress/kendo-react-dialogs": "16.
|
|
35
|
-
"@progress/kendo-react-layout": "16.
|
|
36
|
-
"@progress/kendo-react-intl": "16.
|
|
37
|
-
"@progress/kendo-react-labels": "16.
|
|
38
|
-
"@progress/kendo-react-popup": "16.
|
|
31
|
+
"@progress/kendo-react-animation": "16.2.0-develop.1",
|
|
32
|
+
"@progress/kendo-react-buttons": "16.2.0-develop.1",
|
|
33
|
+
"@progress/kendo-react-common": "16.2.0-develop.1",
|
|
34
|
+
"@progress/kendo-react-dialogs": "16.2.0-develop.1",
|
|
35
|
+
"@progress/kendo-react-layout": "16.2.0-develop.1",
|
|
36
|
+
"@progress/kendo-react-intl": "16.2.0-develop.1",
|
|
37
|
+
"@progress/kendo-react-labels": "16.2.0-develop.1",
|
|
38
|
+
"@progress/kendo-react-popup": "16.2.0-develop.1",
|
|
39
39
|
"@progress/kendo-svg-icons": "^4.9.0 || ^5.0.0",
|
|
40
40
|
"react": "^18.0.0 || ^19.0.0",
|
|
41
41
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"package": {
|
|
103
103
|
"productName": "KendoReact",
|
|
104
104
|
"productCode": "KENDOUIREACT",
|
|
105
|
-
"publishDate":
|
|
105
|
+
"publishDate": 1789024170,
|
|
106
106
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
107
107
|
}
|
|
108
108
|
},
|
|
@@ -18,7 +18,7 @@ type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
|
18
18
|
*/
|
|
19
19
|
export interface RadioButtonProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'onChange' | 'onFocus' | 'onBlur'> {
|
|
20
20
|
/**
|
|
21
|
-
* Identifies the element(s) which will describe the component, similar to [HTML aria-describedby attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/
|
|
21
|
+
* Identifies the element(s) which will describe the component, similar to [HTML aria-describedby attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-describedby).
|
|
22
22
|
* For example these elements could contain error or hint message.
|
|
23
23
|
*
|
|
24
24
|
* @remarks
|
|
@@ -14,7 +14,7 @@ import { HTMLAttributes } from 'react';
|
|
|
14
14
|
*/
|
|
15
15
|
export interface RadioGroupProps {
|
|
16
16
|
/**
|
|
17
|
-
* Identifies the element(s) which will describe the component, similar to [HTML aria-describedby attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/
|
|
17
|
+
* Identifies the element(s) which will describe the component, similar to [HTML aria-describedby attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-describedby).
|
|
18
18
|
* For example these elements could contain error or hint message.
|
|
19
19
|
*
|
|
20
20
|
* @remarks
|
|
@@ -96,7 +96,7 @@ export interface RangeSliderProps extends FormComponentProps {
|
|
|
96
96
|
*/
|
|
97
97
|
endTabIndex?: number;
|
|
98
98
|
/**
|
|
99
|
-
* Identifies the element(s) which will describe the component, similar to [HTML aria-describedby attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/
|
|
99
|
+
* Identifies the element(s) which will describe the component, similar to [HTML aria-describedby attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-describedby).
|
|
100
100
|
* For example these elements could contain error or hint message.
|
|
101
101
|
*
|
|
102
102
|
* @remarks
|
|
@@ -18,7 +18,7 @@ type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
|
18
18
|
*/
|
|
19
19
|
export interface TextAreaProps extends FormComponentProps, Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'defaultValue' | 'onChange' | 'onFocus' | 'onBlur' | 'prefix'> {
|
|
20
20
|
/**
|
|
21
|
-
* Identifies the element(s) which will describe the component, similar to [HTML aria-describedby attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/
|
|
21
|
+
* Identifies the element(s) which will describe the component, similar to [HTML aria-describedby attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-describedby).
|
|
22
22
|
* For example these elements could contain error or hint message.
|
|
23
23
|
*
|
|
24
24
|
* @remarks
|