@progress/kendo-react-inputs 7.4.0-develop.9 → 7.5.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/colors/ColorInput.js +1 -1
- package/colors/ColorInput.mjs +40 -41
- package/colors/ColorPalette.js +1 -1
- package/colors/ColorPalette.mjs +1 -1
- package/colors/FlatColorPicker.js +1 -1
- package/colors/FlatColorPicker.mjs +71 -71
- package/colors/Picker.js +1 -1
- package/colors/Picker.mjs +15 -14
- package/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/index.d.mts +32 -2
- package/index.d.ts +32 -2
- package/numerictextbox/utils/index.js +1 -1
- package/numerictextbox/utils/index.mjs +106 -106
- package/package-metadata.mjs +1 -1
- package/package.json +8 -8
- package/radiobutton/RadioButton.js +1 -1
- package/radiobutton/RadioButton.mjs +36 -35
- package/radiobutton/RadioGroup.js +1 -1
- package/radiobutton/RadioGroup.mjs +1 -1
- package/range-slider/RangeSlider.js +7 -7
- package/range-slider/RangeSlider.mjs +62 -60
- package/signature/Signature.js +1 -1
- package/signature/Signature.mjs +80 -79
- package/slider/Slider.js +1 -1
- package/slider/Slider.mjs +27 -25
- package/slider/SliderLabel.js +1 -1
- package/slider/SliderLabel.mjs +13 -18
- package/switch/Switch.js +1 -1
- package/switch/Switch.mjs +37 -38
- package/textarea/TextArea.js +1 -1
- package/textarea/TextArea.mjs +78 -76
package/index.d.mts
CHANGED
|
@@ -1071,7 +1071,7 @@ export declare interface FlatColorPickerChangeEvent {
|
|
|
1071
1071
|
/**
|
|
1072
1072
|
* The current value of the FlatColorPicker.
|
|
1073
1073
|
*/
|
|
1074
|
-
value: string;
|
|
1074
|
+
value: string | undefined;
|
|
1075
1075
|
/**
|
|
1076
1076
|
* A React Synthetic Event.
|
|
1077
1077
|
*/
|
|
@@ -1101,7 +1101,7 @@ export declare interface FlatColorPickerHandle {
|
|
|
1101
1101
|
/**
|
|
1102
1102
|
* The current value of the FlatColorPicker.
|
|
1103
1103
|
*/
|
|
1104
|
-
value: string;
|
|
1104
|
+
value: string | undefined;
|
|
1105
1105
|
}
|
|
1106
1106
|
|
|
1107
1107
|
/**
|
|
@@ -3517,6 +3517,16 @@ export declare interface SliderLabelProps {
|
|
|
3517
3517
|
* @hidden
|
|
3518
3518
|
*/
|
|
3519
3519
|
vertical?: boolean;
|
|
3520
|
+
/**
|
|
3521
|
+
* @hidden
|
|
3522
|
+
* Used to identify if a tick is first.
|
|
3523
|
+
*/
|
|
3524
|
+
firstTick?: boolean;
|
|
3525
|
+
/**
|
|
3526
|
+
* @hidden
|
|
3527
|
+
* Used to identify if a tick is last.
|
|
3528
|
+
*/
|
|
3529
|
+
lastTick?: boolean;
|
|
3520
3530
|
}
|
|
3521
3531
|
|
|
3522
3532
|
/**
|
|
@@ -4048,6 +4058,8 @@ export declare interface TextAreaProps extends FormComponentProps, Omit_5<React.
|
|
|
4048
4058
|
/**
|
|
4049
4059
|
* Specifies if the textarea element will resize its height automatically ([see example]({% slug sizing_textarea %})).
|
|
4050
4060
|
* Defaults to `false`.
|
|
4061
|
+
*
|
|
4062
|
+
* Setting the value of the prop to `true` will make the TextArea component to ignore the resize behavior of the `resizable` prop.
|
|
4051
4063
|
*/
|
|
4052
4064
|
autoSize?: boolean;
|
|
4053
4065
|
/**
|
|
@@ -4158,6 +4170,24 @@ export declare interface TextAreaProps extends FormComponentProps, Omit_5<React.
|
|
|
4158
4170
|
* Sets a custom suffix to the TextArea component.
|
|
4159
4171
|
*/
|
|
4160
4172
|
suffix?: CustomComponent<any>;
|
|
4173
|
+
/**
|
|
4174
|
+
* Defines the resize behavior of the TextArea.
|
|
4175
|
+
* The available options are:
|
|
4176
|
+
* - none — The TextArea cannot be resized.
|
|
4177
|
+
* - vertical — The TextArea can be resized vertically.
|
|
4178
|
+
* - horizontal — The TextArea can be resized horizontally.
|
|
4179
|
+
* - both — The TextArea can be resized both vertically and horizontally.
|
|
4180
|
+
*
|
|
4181
|
+
* @default `both`
|
|
4182
|
+
*
|
|
4183
|
+
* To be able to resize the TextArea, you should not set the `autoSize` property to `true`.
|
|
4184
|
+
* To be able to resize the component horizontally, add the following inline style to the TextArea:
|
|
4185
|
+
*
|
|
4186
|
+
* ```jsx
|
|
4187
|
+
* <TextArea resizable='horizontal' style={{width: 'auto'}} />
|
|
4188
|
+
* ```
|
|
4189
|
+
*/
|
|
4190
|
+
resizable?: 'none' | 'vertical' | 'horizontal' | 'both';
|
|
4161
4191
|
}
|
|
4162
4192
|
|
|
4163
4193
|
/**
|
package/index.d.ts
CHANGED
|
@@ -1071,7 +1071,7 @@ export declare interface FlatColorPickerChangeEvent {
|
|
|
1071
1071
|
/**
|
|
1072
1072
|
* The current value of the FlatColorPicker.
|
|
1073
1073
|
*/
|
|
1074
|
-
value: string;
|
|
1074
|
+
value: string | undefined;
|
|
1075
1075
|
/**
|
|
1076
1076
|
* A React Synthetic Event.
|
|
1077
1077
|
*/
|
|
@@ -1101,7 +1101,7 @@ export declare interface FlatColorPickerHandle {
|
|
|
1101
1101
|
/**
|
|
1102
1102
|
* The current value of the FlatColorPicker.
|
|
1103
1103
|
*/
|
|
1104
|
-
value: string;
|
|
1104
|
+
value: string | undefined;
|
|
1105
1105
|
}
|
|
1106
1106
|
|
|
1107
1107
|
/**
|
|
@@ -3517,6 +3517,16 @@ export declare interface SliderLabelProps {
|
|
|
3517
3517
|
* @hidden
|
|
3518
3518
|
*/
|
|
3519
3519
|
vertical?: boolean;
|
|
3520
|
+
/**
|
|
3521
|
+
* @hidden
|
|
3522
|
+
* Used to identify if a tick is first.
|
|
3523
|
+
*/
|
|
3524
|
+
firstTick?: boolean;
|
|
3525
|
+
/**
|
|
3526
|
+
* @hidden
|
|
3527
|
+
* Used to identify if a tick is last.
|
|
3528
|
+
*/
|
|
3529
|
+
lastTick?: boolean;
|
|
3520
3530
|
}
|
|
3521
3531
|
|
|
3522
3532
|
/**
|
|
@@ -4048,6 +4058,8 @@ export declare interface TextAreaProps extends FormComponentProps, Omit_5<React.
|
|
|
4048
4058
|
/**
|
|
4049
4059
|
* Specifies if the textarea element will resize its height automatically ([see example]({% slug sizing_textarea %})).
|
|
4050
4060
|
* Defaults to `false`.
|
|
4061
|
+
*
|
|
4062
|
+
* Setting the value of the prop to `true` will make the TextArea component to ignore the resize behavior of the `resizable` prop.
|
|
4051
4063
|
*/
|
|
4052
4064
|
autoSize?: boolean;
|
|
4053
4065
|
/**
|
|
@@ -4158,6 +4170,24 @@ export declare interface TextAreaProps extends FormComponentProps, Omit_5<React.
|
|
|
4158
4170
|
* Sets a custom suffix to the TextArea component.
|
|
4159
4171
|
*/
|
|
4160
4172
|
suffix?: CustomComponent<any>;
|
|
4173
|
+
/**
|
|
4174
|
+
* Defines the resize behavior of the TextArea.
|
|
4175
|
+
* The available options are:
|
|
4176
|
+
* - none — The TextArea cannot be resized.
|
|
4177
|
+
* - vertical — The TextArea can be resized vertically.
|
|
4178
|
+
* - horizontal — The TextArea can be resized horizontally.
|
|
4179
|
+
* - both — The TextArea can be resized both vertically and horizontally.
|
|
4180
|
+
*
|
|
4181
|
+
* @default `both`
|
|
4182
|
+
*
|
|
4183
|
+
* To be able to resize the TextArea, you should not set the `autoSize` property to `true`.
|
|
4184
|
+
* To be able to resize the component horizontally, add the following inline style to the TextArea:
|
|
4185
|
+
*
|
|
4186
|
+
* ```jsx
|
|
4187
|
+
* <TextArea resizable='horizontal' style={{width: 'auto'}} />
|
|
4188
|
+
* ```
|
|
4189
|
+
*/
|
|
4190
|
+
resizable?: 'none' | 'vertical' | 'horizontal' | 'both';
|
|
4161
4191
|
}
|
|
4162
4192
|
|
|
4163
4193
|
/**
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=11111111111111e-7,Le=.31111111111111117,he=1,ee=1,ne=0,V=/\d/,te=15,Ie=()=>({eventValue:null,prevLooseValue:"",currentLooseValue:"",focused:!1,selectionStart:void 0,selectionEnd:void 0,decimalSelect:!1,valueIsCorrected:!1,valueIsOutOfRange:!1}),Ne=(t,n)=>t!==void 0?t:n,m=(t,n,r)=>t===null&&t===void 0?"":typeof t=="string"?t:r.formatNumber(t,n),$=t=>(String(t).split(".")[1]||"").length,re=(t,n)=>Math.max($(t),$(n)),oe=t=>Math.min(t,te),U=(t,n)=>{const r=oe(n);return parseFloat(t.toFixed(r))},Ce=(t,n,r,e,u,o,a)=>{const s=re(t||0,r||0),l=X(U((t||0)+(r||0),s),e,u);n.eventValue=l,n.currentLooseValue=m(l,o,a),n.selectionStart=n.selectionEnd=N(n.currentLooseValue,V)},Pe=(t,n,r,e,u,o,a)=>{const s=re(t||0,r||0),l=X(U((t||0)-(r||0),s),e,u);n.eventValue=l,n.currentLooseValue=m(l,o,a),n.selectionStart=n.selectionEnd=N(n.currentLooseValue,V)},X=(t,n,r)=>t==null?t:!(t>1||t<1||t===1)||r!==void 0&&n!==void 0&&r<n?null:(r!==void 0&&t>r&&(t=r),n!==void 0&&t<n&&(t=n),t),se=(t,n)=>{const r=n.findIndex(([u,o])=>!!o&&t.indexOf(o)===t.length-o.length);if(r===-1)return-1;const e=n[r][1];return t.length-e.length},ue=(t,n)=>{const r=n.findIndex(([u,o])=>!!u&&t.indexOf(u)===0);return r===-1?-1:n[r][0].length},ie=(t,n,r)=>{const e=se(t,n);if(e!==-1&&r.selectionStart>e){r.selectionStart=r.selectionEnd=e;return}r.selectionStart>t.length&&(r.selectionStart=r.selectionEnd=t.length);const u=ue(t,n);u!==-1&&r.selectionStart<u&&(r.selectionStart=r.selectionEnd=u),r.selectionStart===-1&&(r.selectionStart=r.selectionEnd=0)},x=(t,n,r,e)=>{t.selectionStart=t.selectionEnd=n,ie(r,e,t)},M=(t,n,r,e)=>{t.eventValue=e.parseNumber(t.prevLooseValue,n),t.currentLooseValue=t.prevLooseValue,t.valueIsCorrected=!0,x(t,t.selectionStart,t.currentLooseValue,r)},T=(t,n,r)=>n.split(t).length!==r.split(t).length&&n.length===r.length+t.length,le=(t,n)=>{const r=String(t.currentLooseValue),e=String(t.prevLooseValue);return T(n.minusSign,r,e)||T("-",r,e)||T("−",r,e)},ce=(t,n)=>{const r=String(t.currentLooseValue),e=String(t.prevLooseValue);return r.indexOf(n.minusSign)===-1&&e.indexOf(n.minusSign)!==-1},ae=(t,n)=>String(t.currentLooseValue).split(n.decimal).length>2,de=(t,n)=>{const r=n.formatNumber(S,t),e=n.formatNumber(-S,t),u=n.formatNumber(ne,t),o=n.formatNumber(ee,t),a=O(r),s=O(e),l=O(u),c=O(o),C=D(r),P=D(e),b=D(u),L=D(o);return{positiveInfo:[a,C],negativeInfo:[s,P],zeroInfo:[l,b],oneInfo:[c,L]}},ge=(t,n)=>{const r=n.formatNumber(S,t),e=n.formatNumber(-S,t),u=n.formatNumber(ne,t),o=n.formatNumber(ee,t),a=n.numberSymbols(),s=new RegExp(`[\\d\\${a.decimal}${a.group}]`,"g");return[r,e,u,o].map(c=>c.replace(s,"")).join("").split("").filter((c,C,P)=>P.indexOf(c)===C).join("")},y=(t,n)=>{const r=t.indexOf(n.decimal);return r>-1?r:N(t,V)},F=t=>t.split("").reverse().join(""),N=(t,n)=>t.length-F(t).search(n),O=t=>t.split(t[t.search(V)])[0],D=t=>{const n=F(t);return F(n.split(n[n.search(V)])[0])},v=(t,n)=>t.search(n),j=(t,n)=>{const r=t.indexOf(n);return r>-1?t.length-r-1:0},G=(t,n,r,e,u)=>{const o=t.replace(u,"")[0]==="0",a=n.replace(u,"")[0]==="0";if(o&&!a)return r-1;if(a&&e)return r+1;let s=0;for(let c=0;c<r;c++)V.test(t.charAt(c))&&s++;let l=0;for(;s>0&&n.length>l;)V.test(n.charAt(l))&&s--,l++;return l},Ee=(t,n,r)=>{const e={...t},{prevLooseValue:u}=e,o=r.numberSymbols(),a=ge(n,r),s=String(e.currentLooseValue),l=String(u),c=new RegExp(`[^\\d\\${o.decimal}]`,"g"),C=new RegExp(`[^\\d\\${o.decimal}\\${o.group}]`,"g"),P=new RegExp(`[\\d\\${o.decimal}\\${o.group}]`),b=s.replace(c,""),L=v(s,V),E=L===-1?-1:N(s,V),fe=s.indexOf(o.decimal),Z=(s.substring(0,L)+s.substring(L,E).replace(C,"")+s.substring(E,s.length)).split("").filter(p=>a.indexOf(p)!==-1||p.search(P)!==-1).join(""),W=r.formatNumber(Le,n).replace(c,""),k=W.indexOf(o.decimal),I=k>-1?W.length-k-1:0,q=r.formatNumber(he,n).replace(c,""),H=q.indexOf(o.decimal),R=H>-1?q.length-H-1:0,{positiveInfo:me,negativeInfo:Ve,zeroInfo:pe,oneInfo:xe}=de(n,r),g=[me,Ve,pe,xe],be=g.findIndex(p=>p.findIndex(h=>!!h)!==-1)!==1,z=s.length>0&&s.length<l.length,J=typeof n=="string"&&n[0]==="p"&&s&&s.indexOf(o.percentSign)===-1;if(!e.isPaste){if(s==="")return e.eventValue=null,e.currentLooseValue="",e;if(e.currentLooseValue===o.minusSign&&r.formatNumber(-0,n)!==l)return e.eventValue=-0,e.currentLooseValue=m(e.eventValue,n,r),x(e,y(e.currentLooseValue,o),e.currentLooseValue,g),e;if(e.currentLooseValue===o.decimal){e.eventValue=0;const f=m(e.eventValue,n,r);if(R===0&&I>0){const i=N(f,V);e.currentLooseValue=f.substring(0,i)+o.decimal+f.substring(i)}else e.currentLooseValue=f;return x(e,y(e.currentLooseValue,o)+1,e.currentLooseValue,g),e}if(le(e,o)){const f=r.parseNumber(u,n);e.eventValue=-(f!==null?f:0),e.currentLooseValue=m(e.eventValue,n,r);const i=v(e.currentLooseValue,V),d=v(l,V);return x(e,e.selectionEnd-1+(i-d),e.currentLooseValue,g),e}if(ce(e,o))return e.eventValue=r.parseNumber(e.currentLooseValue,n),x(e,e.selectionStart,e.currentLooseValue,g),e;if(ae(e,o))return M(e,n,g,r),e;if(J)return e.eventValue=r.parseNumber(s,n)/100,e.currentLooseValue=m(e.eventValue,n,r),e;if(String(e.currentLooseValue).replace(/[^\d]/g,"").length>te||b!==s&&s&&be&&g.findIndex(([i,d])=>{const _=s.indexOf(i),B=s.indexOf(d),K=_===0,Q=B===s.length-d.length,Y=_+i.length!==L&&L!==-1&&s[_+i.length]!==o.decimal,w=B!==E&&E!==-1&&s[B-1]!==o.decimal;return i&&d?Y||w?!1:K&&Q:i?Y?!1:K:d?w?!1:Q:!1})===-1)return M(e,n,g,r),e;if(b[b.length-1]===o.decimal&&I>0)return e.eventValue=r.parseNumber(s,n),e.currentLooseValue=Z,e;if(e.currentLooseValue&&u&&(a+o.decimal+o.group).split("").findIndex(i=>s.split("").filter(d=>d===i).length<l.split("").filter(d=>d===i).length&&s.length+1===l.length?!(i===o.decimal&&j(l.replace(c,""),o.decimal)===0):!1)>-1)return e.eventValue=r.parseNumber(t.prevLooseValue,n),e.currentLooseValue=t.prevLooseValue,e;const h=j(b,o.decimal),A=b[b.length-1]==="0";if(z&&A&&h<R)return e.eventValue=r.parseNumber(e.currentLooseValue,n),e.currentLooseValue=m(e.eventValue,n,r),e;if(h>0){const f=s.substring(0,fe);if(A&&(!f||l.indexOf(f)!==0)){e.eventValue=r.parseNumber(e.currentLooseValue,n);const i=m(e.eventValue,n,r);return x(e,G(s,i,e.selectionEnd,z,c),i,g),e.currentLooseValue=i,e}if(h>I){const i=s.indexOf(o.decimal),d=s.substring(0,i)+s.substring(i,i+1+I)+s.substring(E,String(e.currentLooseValue).length);return e.eventValue=r.parseNumber(d,n),e.currentLooseValue=d,x(e,e.selectionStart,d,g),e}if(R!==I&&h<=I&&A)return e.eventValue=r.parseNumber(e.currentLooseValue,n),e.currentLooseValue=Z,e;if(h<R)return e.eventValue=r.parseNumber(e.currentLooseValue,n),e.currentLooseValue=m(e.eventValue,n,r),e}}if(e.eventValue=r.parseNumber(e.currentLooseValue,n),J&&(e.eventValue=e.eventValue/100),typeof e.eventValue=="number"){const p=m(e.eventValue,n,r);s.length===1?x(e,y(p,o),p,g):x(e,G(s,p,e.selectionEnd,z,c),p,g),e.currentLooseValue=p}else e.currentLooseValue=m(r.parseNumber(b),n,r);return e};exports.changeBasedSelection=G;exports.decreaseValue=Pe;exports.formatValue=m;exports.fractionLength=$;exports.getDecimalCount=j;exports.getFirstNumberIndex=v;exports.getFormatPrefixSufix=de;exports.getFormatSymbols=ge;exports.getInitialPosition=y;exports.getInitialState=Ie;exports.getLastNumberIndex=N;exports.getMaxCursorPosition=se;exports.getMinCursorPosition=ue;exports.getPrefix=O;exports.getStateOrPropsValue=Ne;exports.getSuffix=D;exports.increaseValue=Ce;exports.isDecimalDuplicated=ae;exports.isMinusSymbolAdded=le;exports.isMinusSymbolRemoved=ce;exports.limitPrecision=oe;exports.rangeSelection=ie;exports.rangeValue=X;exports.reverseString=F;exports.sanitizeNumber=Ee;exports.setInvalid=M;exports.setSelection=x;exports.toFixedPrecision=U;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
const
|
|
9
|
+
const M = 11111111111111e-7, ae = 0.31111111111111117, de = 1, Y = 1, w = 0, m = /\d/, ee = 15, Ie = () => ({
|
|
10
10
|
eventValue: null,
|
|
11
11
|
prevLooseValue: "",
|
|
12
12
|
currentLooseValue: "",
|
|
@@ -16,203 +16,203 @@ const v = 11111111111111e-7, ie = 0.31111111111111117, ae = 1, Q = 1, Y = 0, V =
|
|
|
16
16
|
decimalSelect: !1,
|
|
17
17
|
valueIsCorrected: !1,
|
|
18
18
|
valueIsOutOfRange: !1
|
|
19
|
-
}),
|
|
20
|
-
const r =
|
|
19
|
+
}), Ne = (t, n) => t !== void 0 ? t : n, p = (t, n, r) => t === null && t === void 0 ? "" : typeof t == "string" ? t : r.formatNumber(t, n), J = (t) => (String(t).split(".")[1] || "").length, ne = (t, n) => Math.max(J(t), J(n)), ge = (t) => Math.min(t, ee), te = (t, n) => {
|
|
20
|
+
const r = ge(n);
|
|
21
21
|
return parseFloat(t.toFixed(r));
|
|
22
|
-
},
|
|
23
|
-
const
|
|
24
|
-
n.eventValue =
|
|
25
|
-
}, Ee = (t, n, r, e, u,
|
|
26
|
-
const
|
|
27
|
-
n.eventValue =
|
|
28
|
-
},
|
|
29
|
-
const r = n.findIndex(([u,
|
|
22
|
+
}, Ce = (t, n, r, e, u, o, a) => {
|
|
23
|
+
const s = ne(t || 0, r || 0), l = re(te((t || 0) + (r || 0), s), e, u);
|
|
24
|
+
n.eventValue = l, n.currentLooseValue = p(l, o, a), n.selectionStart = n.selectionEnd = O(n.currentLooseValue, m);
|
|
25
|
+
}, Ee = (t, n, r, e, u, o, a) => {
|
|
26
|
+
const s = ne(t || 0, r || 0), l = re(te((t || 0) - (r || 0), s), e, u);
|
|
27
|
+
n.eventValue = l, n.currentLooseValue = p(l, o, a), n.selectionStart = n.selectionEnd = O(n.currentLooseValue, m);
|
|
28
|
+
}, re = (t, n, r) => t == null ? t : !(t > 1 || t < 1 || t === 1) || r !== void 0 && n !== void 0 && r < n ? null : (r !== void 0 && t > r && (t = r), n !== void 0 && t < n && (t = n), t), fe = (t, n) => {
|
|
29
|
+
const r = n.findIndex(([u, o]) => !!o && t.indexOf(o) === t.length - o.length);
|
|
30
30
|
if (r === -1)
|
|
31
31
|
return -1;
|
|
32
32
|
const e = n[r][1];
|
|
33
33
|
return t.length - e.length;
|
|
34
|
-
},
|
|
35
|
-
const r = n.findIndex(([u,
|
|
34
|
+
}, me = (t, n) => {
|
|
35
|
+
const r = n.findIndex(([u, o]) => !!u && t.indexOf(u) === 0);
|
|
36
36
|
return r === -1 ? -1 : n[r][0].length;
|
|
37
37
|
}, Ve = (t, n, r) => {
|
|
38
|
-
const e =
|
|
38
|
+
const e = fe(t, n);
|
|
39
39
|
if (e !== -1 && r.selectionStart > e) {
|
|
40
40
|
r.selectionStart = r.selectionEnd = e;
|
|
41
41
|
return;
|
|
42
42
|
}
|
|
43
43
|
r.selectionStart > t.length && (r.selectionStart = r.selectionEnd = t.length);
|
|
44
|
-
const u =
|
|
44
|
+
const u = me(t, n);
|
|
45
45
|
u !== -1 && r.selectionStart < u && (r.selectionStart = r.selectionEnd = u), r.selectionStart === -1 && (r.selectionStart = r.selectionEnd = 0);
|
|
46
46
|
}, L = (t, n, r, e) => {
|
|
47
47
|
t.selectionStart = t.selectionEnd = n, Ve(r, e, t);
|
|
48
48
|
}, A = (t, n, r, e) => {
|
|
49
49
|
t.eventValue = e.parseNumber(t.prevLooseValue, n), t.currentLooseValue = t.prevLooseValue, t.valueIsCorrected = !0, L(t, t.selectionStart, t.currentLooseValue, r);
|
|
50
|
-
},
|
|
50
|
+
}, _ = (t, n, r) => n.split(t).length !== r.split(t).length && n.length === r.length + t.length, pe = (t, n) => {
|
|
51
51
|
const r = String(t.currentLooseValue), e = String(t.prevLooseValue);
|
|
52
|
-
return
|
|
53
|
-
},
|
|
52
|
+
return _(n.minusSign, r, e) || _("-", r, e) || _("−", r, e);
|
|
53
|
+
}, xe = (t, n) => {
|
|
54
54
|
const r = String(t.currentLooseValue), e = String(t.prevLooseValue);
|
|
55
55
|
return r.indexOf(n.minusSign) === -1 && e.indexOf(n.minusSign) !== -1;
|
|
56
|
-
},
|
|
57
|
-
const r = n.formatNumber(
|
|
56
|
+
}, Le = (t, n) => String(t.currentLooseValue).split(n.decimal).length > 2, be = (t, n) => {
|
|
57
|
+
const r = n.formatNumber(M, t), e = n.formatNumber(-M, t), u = n.formatNumber(w, t), o = n.formatNumber(Y, t), a = D(r), s = D(e), l = D(u), i = D(o), N = P(r), C = P(e), x = P(u), b = P(o);
|
|
58
58
|
return {
|
|
59
59
|
positiveInfo: [a, N],
|
|
60
|
-
negativeInfo: [
|
|
61
|
-
zeroInfo: [
|
|
60
|
+
negativeInfo: [s, C],
|
|
61
|
+
zeroInfo: [l, x],
|
|
62
62
|
oneInfo: [i, b]
|
|
63
63
|
};
|
|
64
|
-
},
|
|
65
|
-
const r = n.formatNumber(
|
|
66
|
-
return [r, e, u,
|
|
67
|
-
},
|
|
64
|
+
}, he = (t, n) => {
|
|
65
|
+
const r = n.formatNumber(M, t), e = n.formatNumber(-M, t), u = n.formatNumber(w, t), o = n.formatNumber(Y, t), a = n.numberSymbols(), s = new RegExp(`[\\d\\${a.decimal}${a.group}]`, "g");
|
|
66
|
+
return [r, e, u, o].map((i) => i.replace(s, "")).join("").split("").filter((i, N, C) => C.indexOf(i) === N).join("");
|
|
67
|
+
}, B = (t, n) => {
|
|
68
68
|
const r = t.indexOf(n.decimal);
|
|
69
|
-
return r > -1 ? r :
|
|
70
|
-
},
|
|
71
|
-
const n =
|
|
72
|
-
return
|
|
73
|
-
},
|
|
69
|
+
return r > -1 ? r : O(t, m);
|
|
70
|
+
}, T = (t) => t.split("").reverse().join(""), O = (t, n) => t.length - T(t).search(n), D = (t) => t.split(t[t.search(m)])[0], P = (t) => {
|
|
71
|
+
const n = T(t);
|
|
72
|
+
return T(n.split(n[n.search(m)])[0]);
|
|
73
|
+
}, $ = (t, n) => t.search(n), K = (t, n) => {
|
|
74
74
|
const r = t.indexOf(n);
|
|
75
75
|
return r > -1 ? t.length - r - 1 : 0;
|
|
76
|
-
},
|
|
77
|
-
const
|
|
78
|
-
if (
|
|
76
|
+
}, Q = (t, n, r, e, u) => {
|
|
77
|
+
const o = t.replace(u, "")[0] === "0", a = n.replace(u, "")[0] === "0";
|
|
78
|
+
if (o && !a)
|
|
79
79
|
return r - 1;
|
|
80
80
|
if (a && e)
|
|
81
81
|
return r + 1;
|
|
82
|
-
let
|
|
82
|
+
let s = 0;
|
|
83
83
|
for (let i = 0; i < r; i++)
|
|
84
|
-
|
|
85
|
-
let
|
|
86
|
-
for (;
|
|
87
|
-
|
|
88
|
-
return
|
|
84
|
+
m.test(t.charAt(i)) && s++;
|
|
85
|
+
let l = 0;
|
|
86
|
+
for (; s > 0 && n.length > l; )
|
|
87
|
+
m.test(n.charAt(l)) && s--, l++;
|
|
88
|
+
return l;
|
|
89
89
|
}, Oe = (t, n, r) => {
|
|
90
|
-
const e = { ...t }, { prevLooseValue: u } = e,
|
|
91
|
-
positiveInfo:
|
|
92
|
-
negativeInfo:
|
|
93
|
-
zeroInfo:
|
|
90
|
+
const e = { ...t }, { prevLooseValue: u } = e, o = r.numberSymbols(), a = he(n, r), s = String(e.currentLooseValue), l = String(u), i = new RegExp(`[^\\d\\${o.decimal}]`, "g"), N = new RegExp(`[^\\d\\${o.decimal}\\${o.group}]`, "g"), C = new RegExp(`[\\d\\${o.decimal}\\${o.group}]`), x = s.replace(i, ""), b = $(s, m), E = b === -1 ? -1 : O(s, m), oe = s.indexOf(o.decimal), G = (s.substring(0, b) + s.substring(b, E).replace(N, "") + s.substring(E, s.length)).split("").filter((V) => a.indexOf(V) !== -1 || V.search(C) !== -1).join(""), S = r.formatNumber(ae, n).replace(i, ""), U = S.indexOf(o.decimal), I = U > -1 ? S.length - U - 1 : 0, j = r.formatNumber(de, n).replace(i, ""), X = j.indexOf(o.decimal), R = X > -1 ? j.length - X - 1 : 0, {
|
|
91
|
+
positiveInfo: se,
|
|
92
|
+
negativeInfo: ue,
|
|
93
|
+
zeroInfo: ce,
|
|
94
94
|
oneInfo: le
|
|
95
|
-
} =
|
|
95
|
+
} = be(n, r), g = [se, ue, ce, le], ie = g.findIndex((V) => V.findIndex((h) => !!h) !== -1) !== 1, v = s.length > 0 && s.length < l.length, Z = typeof n == "string" && n[0] === "p" && s && s.indexOf(o.percentSign) === -1;
|
|
96
96
|
if (!e.isPaste) {
|
|
97
|
-
if (
|
|
97
|
+
if (s === "")
|
|
98
98
|
return e.eventValue = null, e.currentLooseValue = "", e;
|
|
99
|
-
if (e.currentLooseValue ===
|
|
99
|
+
if (e.currentLooseValue === o.minusSign && r.formatNumber(-0, n) !== l)
|
|
100
100
|
return e.eventValue = -0, e.currentLooseValue = p(e.eventValue, n, r), L(
|
|
101
101
|
e,
|
|
102
|
-
|
|
102
|
+
B(e.currentLooseValue, o),
|
|
103
103
|
e.currentLooseValue,
|
|
104
104
|
g
|
|
105
105
|
), e;
|
|
106
|
-
if (e.currentLooseValue ===
|
|
106
|
+
if (e.currentLooseValue === o.decimal) {
|
|
107
107
|
e.eventValue = 0;
|
|
108
108
|
const f = p(e.eventValue, n, r);
|
|
109
|
-
if (
|
|
110
|
-
const
|
|
111
|
-
e.currentLooseValue = f.substring(0,
|
|
109
|
+
if (R === 0 && I > 0) {
|
|
110
|
+
const c = O(f, m);
|
|
111
|
+
e.currentLooseValue = f.substring(0, c) + o.decimal + f.substring(c);
|
|
112
112
|
} else
|
|
113
113
|
e.currentLooseValue = f;
|
|
114
114
|
return L(
|
|
115
115
|
e,
|
|
116
|
-
|
|
116
|
+
B(e.currentLooseValue, o) + 1,
|
|
117
117
|
e.currentLooseValue,
|
|
118
118
|
g
|
|
119
119
|
), e;
|
|
120
120
|
}
|
|
121
|
-
if (
|
|
121
|
+
if (pe(e, o)) {
|
|
122
122
|
const f = r.parseNumber(u, n);
|
|
123
123
|
e.eventValue = -(f !== null ? f : 0), e.currentLooseValue = p(e.eventValue, n, r);
|
|
124
|
-
const
|
|
124
|
+
const c = $(e.currentLooseValue, m), d = $(l, m);
|
|
125
125
|
return L(
|
|
126
126
|
e,
|
|
127
|
-
e.selectionEnd - 1 + (
|
|
127
|
+
e.selectionEnd - 1 + (c - d),
|
|
128
128
|
e.currentLooseValue,
|
|
129
129
|
g
|
|
130
130
|
), e;
|
|
131
131
|
}
|
|
132
|
-
if (
|
|
132
|
+
if (xe(e, o))
|
|
133
133
|
return e.eventValue = r.parseNumber(e.currentLooseValue, n), L(
|
|
134
134
|
e,
|
|
135
135
|
e.selectionStart,
|
|
136
136
|
e.currentLooseValue,
|
|
137
137
|
g
|
|
138
138
|
), e;
|
|
139
|
-
if (
|
|
139
|
+
if (Le(e, o))
|
|
140
140
|
return A(e, n, g, r), e;
|
|
141
|
-
if (
|
|
142
|
-
return e.eventValue = r.parseNumber(
|
|
143
|
-
if (String(e.currentLooseValue).replace(/[^\d]/g, "").length >
|
|
144
|
-
const F =
|
|
145
|
-
return
|
|
141
|
+
if (Z)
|
|
142
|
+
return e.eventValue = r.parseNumber(s, n) / 100, e.currentLooseValue = p(e.eventValue, n, r), e;
|
|
143
|
+
if (String(e.currentLooseValue).replace(/[^\d]/g, "").length > ee || x !== s && s && ie && g.findIndex(([c, d]) => {
|
|
144
|
+
const F = s.indexOf(c), z = s.indexOf(d), W = F === 0, k = z === s.length - d.length, q = F + c.length !== b && b !== -1 && s[F + c.length] !== o.decimal, H = z !== E && E !== -1 && s[z - 1] !== o.decimal;
|
|
145
|
+
return c && d ? q || H ? !1 : W && k : c ? q ? !1 : W : d ? H ? !1 : k : !1;
|
|
146
146
|
}) === -1)
|
|
147
147
|
return A(e, n, g, r), e;
|
|
148
|
-
if (x[x.length - 1] ===
|
|
149
|
-
return e.eventValue = r.parseNumber(
|
|
150
|
-
if (e.currentLooseValue && u && (a +
|
|
148
|
+
if (x[x.length - 1] === o.decimal && I > 0)
|
|
149
|
+
return e.eventValue = r.parseNumber(s, n), e.currentLooseValue = G, e;
|
|
150
|
+
if (e.currentLooseValue && u && (a + o.decimal + o.group).split("").findIndex((c) => s.split("").filter((d) => d === c).length < l.split("").filter((d) => d === c).length && s.length + 1 === l.length ? !(c === o.decimal && K(l.replace(i, ""), o.decimal) === 0) : !1) > -1)
|
|
151
151
|
return e.eventValue = r.parseNumber(t.prevLooseValue, n), e.currentLooseValue = t.prevLooseValue, e;
|
|
152
|
-
const h =
|
|
153
|
-
if (
|
|
152
|
+
const h = K(x, o.decimal), y = x[x.length - 1] === "0";
|
|
153
|
+
if (v && y && h < R)
|
|
154
154
|
return e.eventValue = r.parseNumber(e.currentLooseValue, n), e.currentLooseValue = p(e.eventValue, n, r), e;
|
|
155
155
|
if (h > 0) {
|
|
156
|
-
const f =
|
|
157
|
-
if (y && (!f ||
|
|
156
|
+
const f = s.substring(0, oe);
|
|
157
|
+
if (y && (!f || l.indexOf(f) !== 0)) {
|
|
158
158
|
e.eventValue = r.parseNumber(e.currentLooseValue, n);
|
|
159
|
-
const
|
|
159
|
+
const c = p(e.eventValue, n, r);
|
|
160
160
|
return L(
|
|
161
161
|
e,
|
|
162
|
-
|
|
163
|
-
|
|
162
|
+
Q(s, c, e.selectionEnd, v, i),
|
|
163
|
+
c,
|
|
164
164
|
g
|
|
165
|
-
), e.currentLooseValue =
|
|
165
|
+
), e.currentLooseValue = c, e;
|
|
166
166
|
}
|
|
167
167
|
if (h > I) {
|
|
168
|
-
const
|
|
168
|
+
const c = s.indexOf(o.decimal), d = s.substring(0, c) + s.substring(c, c + 1 + I) + s.substring(E, String(e.currentLooseValue).length);
|
|
169
169
|
return e.eventValue = r.parseNumber(d, n), e.currentLooseValue = d, L(e, e.selectionStart, d, g), e;
|
|
170
170
|
}
|
|
171
|
-
if (
|
|
172
|
-
return e.eventValue = r.parseNumber(e.currentLooseValue, n), e.currentLooseValue =
|
|
173
|
-
if (h <
|
|
171
|
+
if (R !== I && h <= I && y)
|
|
172
|
+
return e.eventValue = r.parseNumber(e.currentLooseValue, n), e.currentLooseValue = G, e;
|
|
173
|
+
if (h < R)
|
|
174
174
|
return e.eventValue = r.parseNumber(e.currentLooseValue, n), e.currentLooseValue = p(e.eventValue, n, r), e;
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
|
-
if (e.eventValue = r.parseNumber(e.currentLooseValue, n),
|
|
178
|
-
const
|
|
179
|
-
|
|
177
|
+
if (e.eventValue = r.parseNumber(e.currentLooseValue, n), Z && (e.eventValue = e.eventValue / 100), typeof e.eventValue == "number") {
|
|
178
|
+
const V = p(e.eventValue, n, r);
|
|
179
|
+
s.length === 1 ? L(e, B(V, o), V, g) : L(
|
|
180
180
|
e,
|
|
181
|
-
|
|
182
|
-
|
|
181
|
+
Q(s, V, e.selectionEnd, v, i),
|
|
182
|
+
V,
|
|
183
183
|
g
|
|
184
|
-
), e.currentLooseValue =
|
|
184
|
+
), e.currentLooseValue = V;
|
|
185
185
|
} else
|
|
186
186
|
e.currentLooseValue = p(r.parseNumber(x), n, r);
|
|
187
187
|
return e;
|
|
188
188
|
};
|
|
189
189
|
export {
|
|
190
|
-
|
|
190
|
+
Q as changeBasedSelection,
|
|
191
191
|
Ee as decreaseValue,
|
|
192
192
|
p as formatValue,
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
193
|
+
J as fractionLength,
|
|
194
|
+
K as getDecimalCount,
|
|
195
|
+
$ as getFirstNumberIndex,
|
|
196
|
+
be as getFormatPrefixSufix,
|
|
197
|
+
he as getFormatSymbols,
|
|
198
|
+
B as getInitialPosition,
|
|
199
|
+
Ie as getInitialState,
|
|
200
|
+
O as getLastNumberIndex,
|
|
201
|
+
fe as getMaxCursorPosition,
|
|
202
|
+
me as getMinCursorPosition,
|
|
203
|
+
D as getPrefix,
|
|
204
|
+
Ne as getStateOrPropsValue,
|
|
205
|
+
P as getSuffix,
|
|
206
|
+
Ce as increaseValue,
|
|
207
|
+
Le as isDecimalDuplicated,
|
|
208
|
+
pe as isMinusSymbolAdded,
|
|
209
|
+
xe as isMinusSymbolRemoved,
|
|
210
|
+
ge as limitPrecision,
|
|
211
211
|
Ve as rangeSelection,
|
|
212
|
-
|
|
213
|
-
|
|
212
|
+
re as rangeValue,
|
|
213
|
+
T as reverseString,
|
|
214
214
|
Oe as sanitizeNumber,
|
|
215
215
|
A as setInvalid,
|
|
216
216
|
L as setSelection,
|
|
217
|
-
|
|
217
|
+
te as toFixedPrecision
|
|
218
218
|
};
|
package/package-metadata.mjs
CHANGED
|
@@ -10,7 +10,7 @@ const e = {
|
|
|
10
10
|
name: "@progress/kendo-react-inputs",
|
|
11
11
|
productName: "KendoReact",
|
|
12
12
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
13
|
-
publishDate:
|
|
13
|
+
publishDate: 1712850629,
|
|
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": "7.
|
|
3
|
+
"version": "7.5.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,13 +25,13 @@
|
|
|
25
25
|
"@progress/kendo-drawing": "^1.19.0",
|
|
26
26
|
"@progress/kendo-inputs-common": "^3.1.0",
|
|
27
27
|
"@progress/kendo-licensing": "^1.3.4",
|
|
28
|
-
"@progress/kendo-react-animation": "7.
|
|
29
|
-
"@progress/kendo-react-buttons": "7.
|
|
30
|
-
"@progress/kendo-react-common": "7.
|
|
31
|
-
"@progress/kendo-react-dialogs": "7.
|
|
32
|
-
"@progress/kendo-react-intl": "7.
|
|
33
|
-
"@progress/kendo-react-labels": "7.
|
|
34
|
-
"@progress/kendo-react-popup": "7.
|
|
28
|
+
"@progress/kendo-react-animation": "7.5.0-develop.1",
|
|
29
|
+
"@progress/kendo-react-buttons": "7.5.0-develop.1",
|
|
30
|
+
"@progress/kendo-react-common": "7.5.0-develop.1",
|
|
31
|
+
"@progress/kendo-react-dialogs": "7.5.0-develop.1",
|
|
32
|
+
"@progress/kendo-react-intl": "7.5.0-develop.1",
|
|
33
|
+
"@progress/kendo-react-labels": "7.5.0-develop.1",
|
|
34
|
+
"@progress/kendo-react-popup": "7.5.0-develop.1",
|
|
35
35
|
"@progress/kendo-svg-icons": "^2.1.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"),
|
|
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 c=Object.getOwnPropertyDescriptor(n,l);Object.defineProperty(s,l,c.get?c:{enumerable:!0,get:()=>n[l]})}}return s.default=n,Object.freeze(s)}const e=_(D),E=a.createPropsContext(),d=e.forwardRef((n,s)=>{a.validatePackage(w.packageMetadata);const l=a.usePropsContext(E,n),{ariaDescribedBy:c,checked:k,children:h,className:x,disabled:o,id:v,size:m,label:b,labelPlacement:F,name:I,style:N,tabIndex:O,value:p,valid:j,onChange:y,onFocus:f,onBlur:g,...M}=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(),T=e.useCallback(r=>{a.dispatchEvent(y,r,u(),{value:p})},[y,p,o]),z=e.useCallback(r=>{f&&!o&&a.dispatchEvent(f,r,u(),void 0)},[f,o]),S=e.useCallback(r=>{g&&!o&&a.dispatchEvent(g,r,u(),void 0)},[g,o]),q={type:"radio",id:v||P,name:I,className:a.classNames("k-radio",{[`k-radio-${a.kendoThemeMaps.sizeMap[m]||m}`]:m,"k-invalid":j===!1,"k-checked":k},x),ref:i,disabled:o,tabIndex:a.getTabIndex(O,o),checked:k,style:N,"aria-describedby":c,value:p,onChange:T,onFocus:z,onBlur:S,...M},B=e.createElement(e.Fragment,null,b!==void 0?e.createElement("label",{className:"k-radio-label",htmlFor:v||P,style:{userSelect:"none"},"aria-label":b},b):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)});d.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"};d.displayName="KendoRadioButton";d.defaultProps=H;exports.RadioButton=d;exports.RadioButtonPropsContext=E;
|