@progress/kendo-react-inputs 15.1.1-develop.2 → 15.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/Checkbox.js +1 -1
- package/checkbox/Checkbox.mjs +25 -25
- package/colors/ColorPicker.js +1 -1
- package/colors/ColorPicker.mjs +123 -123
- package/colors/FlatColorPicker.js +1 -1
- package/colors/FlatColorPicker.mjs +86 -86
- package/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/numerictextbox/NumericTextBox.js +1 -1
- package/numerictextbox/NumericTextBox.mjs +183 -173
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +10 -10
- package/slider/Slider.js +1 -1
- package/slider/Slider.mjs +103 -103
- package/switch/Switch.js +1 -1
- package/switch/Switch.mjs +56 -54
|
@@ -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 Ye=require("react"),t=require("prop-types"),Ve=require("@progress/kendo-react-intl"),l=require("@progress/kendo-react-common"),ye=require("@progress/kendo-svg-icons"),Je=require("@progress/kendo-react-labels"),g=require("../messages/index.js"),s=require("./utils/index.js"),ke=require("@progress/kendo-react-buttons");function Qe(p){const P=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(p){for(const v in p)if(v!=="default"){const M=Object.getOwnPropertyDescriptor(p,v);Object.defineProperty(P,v,M.get?M:{enumerable:!0,get:()=>p[v]})}}return P.default=p,Object.freeze(P)}const n=Qe(Ye),Xe="Please enter a valid value!",Ce=l.createPropsContext(),Z=n.forwardRef((p,P)=>{const v=l.usePropsContext(Ce,p),{className:M,value:h,defaultValue:Se,format:u,width:ee,tabIndex:Ee,accessKey:he,title:xe,placeholder:te,min:f,max:b,dir:I,name:q,label:T,id:ne,ariaDescribedBy:Ie,ariaLabelledBy:Oe,ariaLabel:Le,inputType:Pe,readOnly:C,validationMessage:K,children:Ne,touched:Ze,visited:et,modified:tt,style:re,inputStyle:De,valid:$,step:x=m.step,spinners:U=m.spinners,disabled:c=m.disabled,required:F=m.required,validityStyles:ae=m.validityStyles,prefix:Re=m.prefix,suffix:Be=m.suffix,onChange:O=m.onChange,onFocus:ue=m.onFocus,onBlur:se=m.onBlur,rangeOnEnter:oe=m.rangeOnEnter,size:N=m.size,rounded:W=m.rounded,fillMode:j=m.fillMode,autoFocus:Me=m.autoFocus,inputAttributes:qe,...le}=v,Te=l.useId(),ce=ne||Te,o=Ve.useInternationalization(),z=Ve.useLocalization(),a=n.useRef(null),_=n.useRef(void 0),[Fe,L]=n.useState(!1),d=n.useRef(s.getInitialState()),G=n.useRef(!1),Y=n.useRef(void 0),D=n.useRef(Se),ie=q||ne,R=s.formatValue(d.current.focused&&!c?d.current.currentLooseValue:s.getStateOrPropsValue(h,D.current),u,o);Y.current=R;const[je]=l.useCustomComponent(Re),[ze]=l.useCustomComponent(Be);n.useEffect(()=>{a.current&&a.current.setCustomValidity&&a.current.setCustomValidity(H().valid?"":K||Xe)});const de=n.useCallback(()=>{a.current&&a.current.focus()},[]),A=n.useCallback(()=>_.current!==void 0?_.current:s.getStateOrPropsValue(h,D.current),[h]),me=n.useCallback(()=>q,[q]),w=n.useCallback(()=>F,[F]),H=n.useCallback(()=>{const r=K!==void 0,e=A(),y=$!==void 0?$:!d.current.valueIsOutOfRange&&(!w()||e!=null);return{customError:r,valid:y,valueMissing:e==null}},[K,$,A,w]),J=n.useCallback(()=>ae,[ae]),fe=n.useCallback(()=>v,[v]),S=n.useCallback(()=>{const r={element:a.current,focus:de};return Object.defineProperty(r,"name",{get:me}),Object.defineProperty(r,"value",{get:A}),Object.defineProperty(r,"validity",{get:H}),Object.defineProperty(r,"validityStyles",{get:J}),Object.defineProperty(r,"required",{get:w}),Object.defineProperty(r,"props",{get:fe}),r},[me,A,H,J,w,de,fe]);n.useImperativeHandle(P,S);const be=n.useRef(null);n.useImperativeHandle(be,S),l.useWebMcpRegister("numerictextbox",be,v,v.webMcp);const E=n.useCallback(()=>({eventValue:s.getStateOrPropsValue(h,D.current),prevLooseValue:Y.current,currentLooseValue:a.current.value,selectionStart:a.current.selectionStart,selectionEnd:a.current.selectionEnd,decimalSelect:!1,valueIsCorrected:!1,valueIsOutOfRange:!1,isPaste:G.current,focused:d.current.focused}),[h]),V=n.useCallback((r,e)=>{if(c)return;_.current=e.eventValue,D.current=e.eventValue;const y=s.formatValue(s.rangeValue(e.eventValue,f,b),u,o),i=s.rangeValue(o.parseNumber(y,u),f,b);i!==e.eventValue&&(e.valueIsOutOfRange=!0,e.eventValue=i,D.current=i),h!==e.eventValue&&l.dispatchEvent(O,r,S(),{value:e.eventValue}),_.current=void 0,d.current=e,L(B=>!B)},[h,O,c,L,S]),_e=n.useCallback(r=>{const e=Number(r);if(isNaN(e))return;const y=s.rangeValue(e,f,b),i=s.formatValue(y,u,o),k={...d.current,eventValue:y,currentLooseValue:i,selectionStart:i.length,selectionEnd:i.length},B={target:a.current,currentTarget:a.current};V(B,k)},[f,b,u,o,V]);l.useKendoPaste(a,{fieldName:ie,onValueChange:_e,enabled:!!ie});const Ge=n.useCallback(r=>{const e=E();G.current=!1,V(r,s.sanitizeNumber(e,u,o))},[u,O,o,V,E]),Ae=n.useCallback(r=>{if(C||c)return;let e=E();const y=o.parseNumber(String(e.currentLooseValue),u);if(e.selectionEnd>e.selectionStart&&e.selectionEnd-e.selectionStart===String(e.currentLooseValue).length){const i=o.numberSymbols(),k=i&&r.key===i.minusSign,B=i&&r.key===i.decimal;G.current=!k&&!B;return}switch(r.keyCode){case 38:s.increaseValue(y,e,x,f,b,u,o);break;case 40:s.decreaseValue(y,e,x,f,b,u,o);break;case 13:{if(oe===!1)return;const i=s.formatValue(s.rangeValue(y,f,b),u,o),k=s.rangeValue(o.parseNumber(i,u),f,b);e.eventValue=k,e.currentLooseValue=s.formatValue(k,u,o),e.selectionStart=e.selectionEnd=e.currentLooseValue.length;break}case 110:{const i=a.current,k=o.numberSymbols();i&&(e.currentLooseValue=e.currentLooseValue.slice(0,e.selectionStart)+k.decimal+e.currentLooseValue.slice(e.selectionEnd),e.selectionStart=e.selectionEnd=e.selectionStart+1,e=s.sanitizeNumber(e,u,o));break}default:return}r.preventDefault(),V(r,e)},[u,f,b,x,O,oe,V,E]),we=n.useCallback(()=>{G.current=!0},[]),Q=n.useCallback(r=>{if(C||c)return;const e=E();s.increaseValue(o.parseNumber(String(e.currentLooseValue),u),e,x,f,b,u,o),V(r,e)},[u,f,b,x,O,C,c,V,E]),X=n.useCallback(r=>{if(C||c)return;const e=E();s.decreaseValue(o.parseNumber(String(e.currentLooseValue),u),e,x,f,b,u,o),V(r,e)},[u,f,b,x,O,C,c,V,E]),He=n.useCallback(r=>{const e=l.getActiveElement(document);!document||e!==a.current||!a.current||C||c||(r.nativeEvent.deltaY<0&&Q(r),r.nativeEvent.deltaY>0&&X(r))},[Q,X,c,C]),Ke=n.useCallback(r=>{d.current.currentLooseValue=Y.current,d.current.focused=!0,l.dispatchEvent(ue,r,S(),{}),L(e=>!e)},[ue,L,S]),$e=n.useCallback(r=>{d.current=s.getInitialState(),l.dispatchEvent(se,r,S(),{}),L(e=>!e)},[se,L,S]),Ue=n.useCallback(r=>{if(document&&a.current){const e=l.getActiveElement(document);r.preventDefault(),e!==a.current&&a.current.focus()}},[]);l.useIsomorphicLayoutEffect(()=>{a.current&&a.current.type!=="number"&&d.current.selectionStart!==void 0&&d.current.selectionEnd!==void 0&&(a.current.selectionStart=d.current.selectionStart,a.current.selectionEnd=d.current.selectionEnd,d.current.selectionStart=void 0,d.current.selectionEnd=void 0)},[Fe]);const[We,pe]=n.useState(I);l.useIsomorphicLayoutEffect(()=>{if(I!==void 0)pe(I);else if(a.current&&a.current.parentElement){const r=getComputedStyle(a.current.parentElement).direction;pe(r==="rtl"?"rtl":void 0)}},[I]);const ge=!J()||H().valid,ve=n.createElement("span",{dir:I,style:T?re:{width:ee,...re},className:l.classNames("k-input","k-numerictextbox",{[`k-input-${l.kendoThemeMaps.sizeMap[N]||N}`]:N,[`k-input-${j}`]:j,[`k-rounded-${l.kendoThemeMaps.roundedMap[W]||W}`]:W,"k-invalid":!ge,"k-required":F,"k-disabled":c},M),"aria-disabled":c?"true":void 0,...T?{}:le},n.createElement(je,null),n.createElement("input",{role:"spinbutton",value:R===null?"":R,tabIndex:l.getTabIndex(Ee,c),accessKey:he,disabled:c,title:xe,"aria-disabled":c?"true":void 0,"aria-valuemin":U?f:void 0,"aria-valuemax":U?b:void 0,"aria-label":Le,"aria-labelledby":Oe,"aria-describedby":Ie,"aria-required":F||void 0,placeholder:te,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoFocus:Me,type:Pe||"tel",className:"k-input-inner",id:ce,name:q,readOnly:C,style:De,dir:We,onChange:Ge,onFocus:Ke,onBlur:$e,onKeyDown:Ae,onPaste:we,onWheel:He,ref:a,...qe}),n.createElement(ze,null),Ne,U&&n.createElement("span",{className:"k-input-spinner k-spin-button",onMouseDown:Ue},n.createElement(ke.Button,{tabIndex:-1,type:"button",icon:"chevron-up",svgIcon:ye.chevronUpIcon,fillMode:j,size:N,className:"k-spinner-increase","aria-label":z.toLanguageString(g.numericIncreaseValue,g.messages[g.numericIncreaseValue]),title:z.toLanguageString(g.numericIncreaseValue,g.messages[g.numericIncreaseValue]),onClick:Q}),n.createElement(ke.Button,{tabIndex:-1,type:"button",icon:"chevron-down",svgIcon:ye.chevronDownIcon,fillMode:j,size:N,className:"k-spinner-decrease","aria-label":z.toLanguageString(g.numericDecreaseValue,g.messages[g.numericDecreaseValue]),title:z.toLanguageString(g.numericDecreaseValue,g.messages[g.numericDecreaseValue]),onClick:X})));return T?n.createElement(Je.FloatingLabel,{label:T,editorId:ce,editorValue:R===null?"":R,editorValid:ge,editorDisabled:c,editorPlaceholder:te,children:ve,style:{width:ee},dir:I,...le}):ve});Z.propTypes={value:t.number,defaultValue:t.number,step:t.number,format:t.oneOfType([t.string,t.shape({style:t.oneOf(["decimal","currency","percent","scientific","accounting"]),currency:t.string,currencyDisplay:t.oneOf(["symbol","code","name"]),useGrouping:t.bool,minimumIntegerDigits:t.number,minimumFractionDigits:t.number,maximumFractionDigits:t.number})]),width:t.oneOfType([t.string,t.number]),tabIndex:t.number,accessKey:t.string,title:t.string,placeholder:t.string,min:t.number,max:t.number,spinners:t.bool,disabled:t.bool,readOnly:t.bool,dir:t.string,name:t.string,label:t.string,validationMessage:t.string,required:t.bool,id:t.string,rangeOnEnter:t.bool,ariaLabelledBy:t.string,ariaDescribedBy:t.string,ariaLabel:t.string,onChange:t.func,onFocus:t.func,onBlur:t.func,size:t.oneOf(["small","medium","large"]),rounded:t.oneOf(["small","medium","large","full","none"]),fillMode:t.oneOf(["solid","flat","outline"]),inputAttributes:t.object};const m={prefix:p=>null,suffix:p=>null,step:1,spinners:!0,disabled:!1,required:!1,validityStyles:!0,rangeOnEnter:!0,autoFocus:!1,onChange:p=>{},onFocus:p=>{},onBlur:p=>{},size:void 0,rounded:void 0,fillMode:void 0};Z.displayName="KendoNumericTextBox";exports.NumericTextBox=Z;exports.NumericTextBoxPropsContext=Ce;
|
|
@@ -7,176 +7,176 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as n from "react";
|
|
9
9
|
import t from "prop-types";
|
|
10
|
-
import { useInternationalization as
|
|
11
|
-
import { usePropsContext as
|
|
12
|
-
import { chevronUpIcon as
|
|
13
|
-
import { FloatingLabel as
|
|
14
|
-
import { numericIncreaseValue as
|
|
15
|
-
import { getInitialState as
|
|
16
|
-
import { Button as
|
|
17
|
-
const
|
|
18
|
-
(k,
|
|
19
|
-
const
|
|
20
|
-
|
|
10
|
+
import { useInternationalization as at, useLocalization as ot } from "@progress/kendo-react-intl";
|
|
11
|
+
import { usePropsContext as st, useId as ut, useCustomComponent as Ve, useWebMcpRegister as lt, dispatchEvent as Z, useKendoPaste as it, getActiveElement as Ce, useIsomorphicLayoutEffect as ke, classNames as ct, kendoThemeMaps as Ee, getTabIndex as dt, createPropsContext as mt } from "@progress/kendo-react-common";
|
|
12
|
+
import { chevronUpIcon as ft, chevronDownIcon as pt } from "@progress/kendo-svg-icons";
|
|
13
|
+
import { FloatingLabel as bt } from "@progress/kendo-react-labels";
|
|
14
|
+
import { numericIncreaseValue as H, messages as K, numericDecreaseValue as _ } from "../messages/index.mjs";
|
|
15
|
+
import { getInitialState as he, formatValue as P, getStateOrPropsValue as ee, rangeValue as D, sanitizeNumber as Se, decreaseValue as xe, increaseValue as Ie } from "./utils/index.mjs";
|
|
16
|
+
import { Button as Le } from "@progress/kendo-react-buttons";
|
|
17
|
+
const gt = "Please enter a valid value!", vt = mt(), Oe = n.forwardRef(
|
|
18
|
+
(k, Ne) => {
|
|
19
|
+
const x = st(
|
|
20
|
+
vt,
|
|
21
21
|
k
|
|
22
22
|
), {
|
|
23
|
-
className:
|
|
23
|
+
className: Pe,
|
|
24
24
|
value: V,
|
|
25
|
-
defaultValue:
|
|
25
|
+
defaultValue: De,
|
|
26
26
|
format: o,
|
|
27
|
-
width:
|
|
28
|
-
tabIndex:
|
|
29
|
-
accessKey:
|
|
30
|
-
title:
|
|
31
|
-
placeholder:
|
|
27
|
+
width: te,
|
|
28
|
+
tabIndex: Re,
|
|
29
|
+
accessKey: Fe,
|
|
30
|
+
title: Be,
|
|
31
|
+
placeholder: ne,
|
|
32
32
|
min: d,
|
|
33
33
|
max: m,
|
|
34
|
-
dir:
|
|
34
|
+
dir: E,
|
|
35
35
|
name: R,
|
|
36
|
-
label:
|
|
36
|
+
label: F,
|
|
37
37
|
id: re,
|
|
38
|
-
ariaDescribedBy:
|
|
39
|
-
ariaLabelledBy:
|
|
40
|
-
ariaLabel:
|
|
41
|
-
inputType:
|
|
38
|
+
ariaDescribedBy: Me,
|
|
39
|
+
ariaLabelledBy: Te,
|
|
40
|
+
ariaLabel: ze,
|
|
41
|
+
inputType: qe,
|
|
42
42
|
readOnly: g,
|
|
43
|
-
validationMessage:
|
|
44
|
-
children:
|
|
43
|
+
validationMessage: w,
|
|
44
|
+
children: Ge,
|
|
45
45
|
// Removed to support direct use in Form Field component
|
|
46
|
-
touched:
|
|
47
|
-
visited:
|
|
48
|
-
modified:
|
|
46
|
+
touched: yt,
|
|
47
|
+
visited: Vt,
|
|
48
|
+
modified: Ct,
|
|
49
49
|
style: ae,
|
|
50
|
-
inputStyle:
|
|
51
|
-
valid:
|
|
50
|
+
inputStyle: je,
|
|
51
|
+
valid: U,
|
|
52
52
|
step: C = c.step,
|
|
53
|
-
spinners:
|
|
53
|
+
spinners: W = c.spinners,
|
|
54
54
|
disabled: u = c.disabled,
|
|
55
|
-
required:
|
|
55
|
+
required: B = c.required,
|
|
56
56
|
validityStyles: oe = c.validityStyles,
|
|
57
|
-
prefix:
|
|
58
|
-
suffix:
|
|
57
|
+
prefix: Ae = c.prefix,
|
|
58
|
+
suffix: He = c.suffix,
|
|
59
59
|
onChange: h = c.onChange,
|
|
60
60
|
onFocus: se = c.onFocus,
|
|
61
61
|
onBlur: ue = c.onBlur,
|
|
62
62
|
rangeOnEnter: le = c.rangeOnEnter,
|
|
63
|
-
size:
|
|
64
|
-
rounded:
|
|
65
|
-
fillMode:
|
|
66
|
-
autoFocus:
|
|
67
|
-
inputAttributes:
|
|
63
|
+
size: I = c.size,
|
|
64
|
+
rounded: $ = c.rounded,
|
|
65
|
+
fillMode: M = c.fillMode,
|
|
66
|
+
autoFocus: Ke = c.autoFocus,
|
|
67
|
+
inputAttributes: _e,
|
|
68
68
|
...ie
|
|
69
|
-
} =
|
|
70
|
-
i.current.focused && !u ? i.current.currentLooseValue :
|
|
69
|
+
} = x, we = ut(), ce = re || we, s = at(), T = ot(), a = n.useRef(null), z = n.useRef(void 0), [Ue, S] = n.useState(!1), i = n.useRef(he()), q = n.useRef(!1), Y = n.useRef(void 0), L = n.useRef(De), de = R || re, O = P(
|
|
70
|
+
i.current.focused && !u ? i.current.currentLooseValue : ee(V, L.current),
|
|
71
71
|
o,
|
|
72
72
|
s
|
|
73
73
|
);
|
|
74
|
-
|
|
75
|
-
const [
|
|
74
|
+
Y.current = O;
|
|
75
|
+
const [We] = Ve(Ae), [$e] = Ve(He);
|
|
76
76
|
n.useEffect(() => {
|
|
77
77
|
a.current && a.current.setCustomValidity && a.current.setCustomValidity(
|
|
78
|
-
|
|
78
|
+
A().valid ? "" : w || gt
|
|
79
79
|
);
|
|
80
80
|
});
|
|
81
81
|
const me = n.useCallback(() => {
|
|
82
82
|
a.current && a.current.focus();
|
|
83
|
-
}, []),
|
|
84
|
-
const r =
|
|
83
|
+
}, []), G = n.useCallback(() => z.current !== void 0 ? z.current : ee(V, L.current), [V]), fe = n.useCallback(() => R, [R]), j = n.useCallback(() => B, [B]), A = n.useCallback(() => {
|
|
84
|
+
const r = w !== void 0, e = G(), p = U !== void 0 ? U : !i.current.valueIsOutOfRange && (!j() || e != null);
|
|
85
85
|
return {
|
|
86
86
|
customError: r,
|
|
87
|
-
valid:
|
|
87
|
+
valid: p,
|
|
88
88
|
valueMissing: e == null
|
|
89
89
|
};
|
|
90
|
-
}, [
|
|
90
|
+
}, [w, U, G, j]), J = n.useCallback(() => oe, [oe]), pe = n.useCallback(() => x, [x]), v = n.useCallback(() => {
|
|
91
91
|
const r = {
|
|
92
92
|
element: a.current,
|
|
93
93
|
focus: me
|
|
94
94
|
};
|
|
95
|
-
return Object.defineProperty(r, "name", { get: fe }), Object.defineProperty(r, "value", { get:
|
|
96
|
-
}, [fe,
|
|
97
|
-
n.useImperativeHandle(
|
|
98
|
-
const
|
|
99
|
-
n.useImperativeHandle(
|
|
95
|
+
return Object.defineProperty(r, "name", { get: fe }), Object.defineProperty(r, "value", { get: G }), Object.defineProperty(r, "validity", { get: A }), Object.defineProperty(r, "validityStyles", { get: J }), Object.defineProperty(r, "required", { get: j }), Object.defineProperty(r, "props", { get: pe }), r;
|
|
96
|
+
}, [fe, G, A, J, j, me, pe]);
|
|
97
|
+
n.useImperativeHandle(Ne, v);
|
|
98
|
+
const be = n.useRef(null);
|
|
99
|
+
n.useImperativeHandle(be, v), lt("numerictextbox", be, x, x.webMcp);
|
|
100
100
|
const y = n.useCallback(() => ({
|
|
101
|
-
eventValue:
|
|
102
|
-
prevLooseValue:
|
|
101
|
+
eventValue: ee(V, L.current),
|
|
102
|
+
prevLooseValue: Y.current,
|
|
103
103
|
currentLooseValue: a.current.value,
|
|
104
104
|
selectionStart: a.current.selectionStart,
|
|
105
105
|
selectionEnd: a.current.selectionEnd,
|
|
106
106
|
decimalSelect: !1,
|
|
107
107
|
valueIsCorrected: !1,
|
|
108
108
|
valueIsOutOfRange: !1,
|
|
109
|
-
isPaste:
|
|
109
|
+
isPaste: q.current,
|
|
110
110
|
focused: i.current.focused
|
|
111
111
|
}), [V]), f = n.useCallback(
|
|
112
112
|
(r, e) => {
|
|
113
113
|
if (u)
|
|
114
114
|
return;
|
|
115
|
-
|
|
116
|
-
const
|
|
117
|
-
l !== e.eventValue && (e.valueIsOutOfRange = !0, e.eventValue = l,
|
|
115
|
+
z.current = e.eventValue, L.current = e.eventValue;
|
|
116
|
+
const p = P(D(e.eventValue, d, m), o, s), l = D(s.parseNumber(p, o), d, m);
|
|
117
|
+
l !== e.eventValue && (e.valueIsOutOfRange = !0, e.eventValue = l, L.current = l), V !== e.eventValue && Z(h, r, v(), {
|
|
118
118
|
value: e.eventValue
|
|
119
|
-
}),
|
|
119
|
+
}), z.current = void 0, i.current = e, S((N) => !N);
|
|
120
120
|
},
|
|
121
|
-
[V, h, u,
|
|
122
|
-
),
|
|
121
|
+
[V, h, u, S, v]
|
|
122
|
+
), Ye = n.useCallback(
|
|
123
123
|
(r) => {
|
|
124
124
|
const e = Number(r);
|
|
125
125
|
if (isNaN(e))
|
|
126
126
|
return;
|
|
127
|
-
const
|
|
127
|
+
const p = D(e, d, m), l = P(p, o, s), b = {
|
|
128
128
|
...i.current,
|
|
129
|
-
eventValue:
|
|
129
|
+
eventValue: p,
|
|
130
130
|
currentLooseValue: l,
|
|
131
131
|
selectionStart: l.length,
|
|
132
132
|
selectionEnd: l.length
|
|
133
|
-
},
|
|
133
|
+
}, N = {
|
|
134
134
|
target: a.current,
|
|
135
135
|
currentTarget: a.current
|
|
136
136
|
};
|
|
137
|
-
f(
|
|
137
|
+
f(N, b);
|
|
138
138
|
},
|
|
139
139
|
[d, m, o, s, f]
|
|
140
140
|
);
|
|
141
|
-
|
|
141
|
+
it(a, {
|
|
142
142
|
fieldName: de,
|
|
143
|
-
onValueChange:
|
|
143
|
+
onValueChange: Ye,
|
|
144
144
|
enabled: !!de
|
|
145
145
|
});
|
|
146
|
-
const
|
|
146
|
+
const Je = n.useCallback(
|
|
147
147
|
(r) => {
|
|
148
148
|
const e = y();
|
|
149
|
-
|
|
149
|
+
q.current = !1, f(r, Se(e, o, s));
|
|
150
150
|
},
|
|
151
151
|
[o, h, s, f, y]
|
|
152
|
-
),
|
|
152
|
+
), Qe = n.useCallback(
|
|
153
153
|
(r) => {
|
|
154
154
|
if (g || u)
|
|
155
155
|
return;
|
|
156
156
|
let e = y();
|
|
157
|
-
const
|
|
157
|
+
const p = s.parseNumber(String(e.currentLooseValue), o);
|
|
158
158
|
if (e.selectionEnd > e.selectionStart && e.selectionEnd - e.selectionStart === String(e.currentLooseValue).length) {
|
|
159
|
-
const l = s.numberSymbols(),
|
|
160
|
-
|
|
159
|
+
const l = s.numberSymbols(), b = l && r.key === l.minusSign, N = l && r.key === l.decimal;
|
|
160
|
+
q.current = !b && !N;
|
|
161
161
|
return;
|
|
162
162
|
}
|
|
163
163
|
switch (r.keyCode) {
|
|
164
164
|
case 38:
|
|
165
|
-
|
|
165
|
+
Ie(p, e, C, d, m, o, s);
|
|
166
166
|
break;
|
|
167
167
|
case 40:
|
|
168
|
-
|
|
168
|
+
xe(p, e, C, d, m, o, s);
|
|
169
169
|
break;
|
|
170
170
|
case 13: {
|
|
171
171
|
if (le === !1)
|
|
172
172
|
return;
|
|
173
|
-
const l =
|
|
174
|
-
e.eventValue =
|
|
173
|
+
const l = P(D(p, d, m), o, s), b = D(s.parseNumber(l, o), d, m);
|
|
174
|
+
e.eventValue = b, e.currentLooseValue = P(b, o, s), e.selectionStart = e.selectionEnd = e.currentLooseValue.length;
|
|
175
175
|
break;
|
|
176
176
|
}
|
|
177
177
|
case 110: {
|
|
178
|
-
const l = a.current,
|
|
179
|
-
l && (e.currentLooseValue = e.currentLooseValue.slice(0, e.selectionStart) +
|
|
178
|
+
const l = a.current, b = s.numberSymbols();
|
|
179
|
+
l && (e.currentLooseValue = e.currentLooseValue.slice(0, e.selectionStart) + b.decimal + e.currentLooseValue.slice(e.selectionEnd), e.selectionStart = e.selectionEnd = e.selectionStart + 1, e = Se(e, o, s));
|
|
180
180
|
break;
|
|
181
181
|
}
|
|
182
182
|
default:
|
|
@@ -185,14 +185,14 @@ const bt = "Please enter a valid value!", pt = ct(), Ie = n.forwardRef(
|
|
|
185
185
|
r.preventDefault(), f(r, e);
|
|
186
186
|
},
|
|
187
187
|
[o, d, m, C, h, le, f, y]
|
|
188
|
-
),
|
|
189
|
-
|
|
190
|
-
}, []),
|
|
188
|
+
), Xe = n.useCallback(() => {
|
|
189
|
+
q.current = !0;
|
|
190
|
+
}, []), Q = n.useCallback(
|
|
191
191
|
(r) => {
|
|
192
192
|
if (g || u)
|
|
193
193
|
return;
|
|
194
194
|
const e = y();
|
|
195
|
-
|
|
195
|
+
Ie(
|
|
196
196
|
s.parseNumber(String(e.currentLooseValue), o),
|
|
197
197
|
e,
|
|
198
198
|
C,
|
|
@@ -203,12 +203,12 @@ const bt = "Please enter a valid value!", pt = ct(), Ie = n.forwardRef(
|
|
|
203
203
|
), f(r, e);
|
|
204
204
|
},
|
|
205
205
|
[o, d, m, C, h, g, u, f, y]
|
|
206
|
-
),
|
|
206
|
+
), X = n.useCallback(
|
|
207
207
|
(r) => {
|
|
208
208
|
if (g || u)
|
|
209
209
|
return;
|
|
210
210
|
const e = y();
|
|
211
|
-
|
|
211
|
+
xe(
|
|
212
212
|
s.parseNumber(String(e.currentLooseValue), o),
|
|
213
213
|
e,
|
|
214
214
|
C,
|
|
@@ -219,152 +219,162 @@ const bt = "Please enter a valid value!", pt = ct(), Ie = n.forwardRef(
|
|
|
219
219
|
), f(r, e);
|
|
220
220
|
},
|
|
221
221
|
[o, d, m, C, h, g, u, f, y]
|
|
222
|
-
),
|
|
222
|
+
), Ze = n.useCallback(
|
|
223
223
|
(r) => {
|
|
224
|
-
const e =
|
|
225
|
-
!document || e !== a.current || !a.current || g || u || (r.nativeEvent.deltaY < 0 &&
|
|
224
|
+
const e = Ce(document);
|
|
225
|
+
!document || e !== a.current || !a.current || g || u || (r.nativeEvent.deltaY < 0 && Q(r), r.nativeEvent.deltaY > 0 && X(r));
|
|
226
226
|
},
|
|
227
|
-
[
|
|
228
|
-
),
|
|
227
|
+
[Q, X, u, g]
|
|
228
|
+
), et = n.useCallback(
|
|
229
229
|
(r) => {
|
|
230
|
-
i.current.currentLooseValue =
|
|
230
|
+
i.current.currentLooseValue = Y.current, i.current.focused = !0, Z(se, r, v(), {}), S((e) => !e);
|
|
231
231
|
},
|
|
232
|
-
[se,
|
|
233
|
-
),
|
|
232
|
+
[se, S, v]
|
|
233
|
+
), tt = n.useCallback(
|
|
234
234
|
(r) => {
|
|
235
|
-
i.current =
|
|
235
|
+
i.current = he(), Z(ue, r, v(), {}), S((e) => !e);
|
|
236
236
|
},
|
|
237
|
-
[ue,
|
|
238
|
-
),
|
|
237
|
+
[ue, S, v]
|
|
238
|
+
), nt = n.useCallback((r) => {
|
|
239
239
|
if (document && a.current) {
|
|
240
|
-
const e =
|
|
240
|
+
const e = Ce(document);
|
|
241
241
|
r.preventDefault(), e !== a.current && a.current.focus();
|
|
242
242
|
}
|
|
243
243
|
}, []);
|
|
244
|
-
|
|
244
|
+
ke(() => {
|
|
245
245
|
a.current && a.current.type !== "number" && i.current.selectionStart !== void 0 && i.current.selectionEnd !== void 0 && (a.current.selectionStart = i.current.selectionStart, a.current.selectionEnd = i.current.selectionEnd, i.current.selectionStart = void 0, i.current.selectionEnd = void 0);
|
|
246
|
-
}, [
|
|
247
|
-
const
|
|
246
|
+
}, [Ue]);
|
|
247
|
+
const [rt, ge] = n.useState(E);
|
|
248
|
+
ke(() => {
|
|
249
|
+
if (E !== void 0)
|
|
250
|
+
ge(E);
|
|
251
|
+
else if (a.current && a.current.parentElement) {
|
|
252
|
+
const r = getComputedStyle(a.current.parentElement).direction;
|
|
253
|
+
ge(r === "rtl" ? "rtl" : void 0);
|
|
254
|
+
}
|
|
255
|
+
}, [E]);
|
|
256
|
+
const ve = !J() || A().valid, ye = /* @__PURE__ */ n.createElement(
|
|
248
257
|
"span",
|
|
249
258
|
{
|
|
250
|
-
dir:
|
|
251
|
-
style:
|
|
252
|
-
className:
|
|
259
|
+
dir: E,
|
|
260
|
+
style: F ? ae : { width: te, ...ae },
|
|
261
|
+
className: ct(
|
|
253
262
|
"k-input",
|
|
254
263
|
"k-numerictextbox",
|
|
255
264
|
{
|
|
256
|
-
[`k-input-${
|
|
257
|
-
[`k-input-${
|
|
258
|
-
[`k-rounded-${
|
|
259
|
-
"k-invalid": !
|
|
260
|
-
"k-required":
|
|
265
|
+
[`k-input-${Ee.sizeMap[I] || I}`]: I,
|
|
266
|
+
[`k-input-${M}`]: M,
|
|
267
|
+
[`k-rounded-${Ee.roundedMap[$] || $}`]: $,
|
|
268
|
+
"k-invalid": !ve,
|
|
269
|
+
"k-required": B,
|
|
261
270
|
"k-disabled": u
|
|
262
271
|
},
|
|
263
|
-
|
|
272
|
+
Pe
|
|
264
273
|
),
|
|
265
274
|
"aria-disabled": u ? "true" : void 0,
|
|
266
|
-
...
|
|
275
|
+
...F ? {} : ie
|
|
267
276
|
},
|
|
268
|
-
/* @__PURE__ */ n.createElement(
|
|
277
|
+
/* @__PURE__ */ n.createElement(We, null),
|
|
269
278
|
/* @__PURE__ */ n.createElement(
|
|
270
279
|
"input",
|
|
271
280
|
{
|
|
272
281
|
role: "spinbutton",
|
|
273
|
-
value:
|
|
274
|
-
tabIndex:
|
|
275
|
-
accessKey:
|
|
282
|
+
value: O === null ? "" : O,
|
|
283
|
+
tabIndex: dt(Re, u),
|
|
284
|
+
accessKey: Fe,
|
|
276
285
|
disabled: u,
|
|
277
|
-
title:
|
|
286
|
+
title: Be,
|
|
278
287
|
"aria-disabled": u ? "true" : void 0,
|
|
279
|
-
"aria-valuemin":
|
|
280
|
-
"aria-valuemax":
|
|
281
|
-
"aria-label":
|
|
282
|
-
"aria-labelledby":
|
|
283
|
-
"aria-describedby":
|
|
284
|
-
"aria-required":
|
|
285
|
-
placeholder:
|
|
288
|
+
"aria-valuemin": W ? d : void 0,
|
|
289
|
+
"aria-valuemax": W ? m : void 0,
|
|
290
|
+
"aria-label": ze,
|
|
291
|
+
"aria-labelledby": Te,
|
|
292
|
+
"aria-describedby": Me,
|
|
293
|
+
"aria-required": B || void 0,
|
|
294
|
+
placeholder: ne,
|
|
286
295
|
spellCheck: !1,
|
|
287
296
|
autoComplete: "off",
|
|
288
297
|
autoCorrect: "off",
|
|
289
|
-
autoFocus:
|
|
290
|
-
type:
|
|
298
|
+
autoFocus: Ke,
|
|
299
|
+
type: qe || "tel",
|
|
291
300
|
className: "k-input-inner",
|
|
292
301
|
id: ce,
|
|
293
302
|
name: R,
|
|
294
303
|
readOnly: g,
|
|
295
|
-
style:
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
304
|
+
style: je,
|
|
305
|
+
dir: rt,
|
|
306
|
+
onChange: Je,
|
|
307
|
+
onFocus: et,
|
|
308
|
+
onBlur: tt,
|
|
309
|
+
onKeyDown: Qe,
|
|
310
|
+
onPaste: Xe,
|
|
311
|
+
onWheel: Ze,
|
|
302
312
|
ref: a,
|
|
303
|
-
...
|
|
313
|
+
..._e
|
|
304
314
|
}
|
|
305
315
|
),
|
|
306
|
-
/* @__PURE__ */ n.createElement(
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
316
|
+
/* @__PURE__ */ n.createElement($e, null),
|
|
317
|
+
Ge,
|
|
318
|
+
W && /* @__PURE__ */ n.createElement("span", { className: "k-input-spinner k-spin-button", onMouseDown: nt }, /* @__PURE__ */ n.createElement(
|
|
319
|
+
Le,
|
|
310
320
|
{
|
|
311
321
|
tabIndex: -1,
|
|
312
322
|
type: "button",
|
|
313
323
|
icon: "chevron-up",
|
|
314
|
-
svgIcon:
|
|
315
|
-
fillMode:
|
|
316
|
-
size:
|
|
324
|
+
svgIcon: ft,
|
|
325
|
+
fillMode: M,
|
|
326
|
+
size: I,
|
|
317
327
|
className: "k-spinner-increase",
|
|
318
|
-
"aria-label":
|
|
319
|
-
|
|
320
|
-
H
|
|
328
|
+
"aria-label": T.toLanguageString(
|
|
329
|
+
H,
|
|
330
|
+
K[H]
|
|
321
331
|
),
|
|
322
|
-
title:
|
|
323
|
-
|
|
324
|
-
H
|
|
332
|
+
title: T.toLanguageString(
|
|
333
|
+
H,
|
|
334
|
+
K[H]
|
|
325
335
|
),
|
|
326
|
-
onClick:
|
|
336
|
+
onClick: Q
|
|
327
337
|
}
|
|
328
338
|
), /* @__PURE__ */ n.createElement(
|
|
329
|
-
|
|
339
|
+
Le,
|
|
330
340
|
{
|
|
331
341
|
tabIndex: -1,
|
|
332
342
|
type: "button",
|
|
333
343
|
icon: "chevron-down",
|
|
334
|
-
svgIcon:
|
|
335
|
-
fillMode:
|
|
336
|
-
size:
|
|
344
|
+
svgIcon: pt,
|
|
345
|
+
fillMode: M,
|
|
346
|
+
size: I,
|
|
337
347
|
className: "k-spinner-decrease",
|
|
338
|
-
"aria-label":
|
|
339
|
-
|
|
340
|
-
|
|
348
|
+
"aria-label": T.toLanguageString(
|
|
349
|
+
_,
|
|
350
|
+
K[_]
|
|
341
351
|
),
|
|
342
|
-
title:
|
|
343
|
-
|
|
344
|
-
|
|
352
|
+
title: T.toLanguageString(
|
|
353
|
+
_,
|
|
354
|
+
K[_]
|
|
345
355
|
),
|
|
346
|
-
onClick:
|
|
356
|
+
onClick: X
|
|
347
357
|
}
|
|
348
358
|
))
|
|
349
359
|
);
|
|
350
|
-
return
|
|
351
|
-
|
|
360
|
+
return F ? /* @__PURE__ */ n.createElement(
|
|
361
|
+
bt,
|
|
352
362
|
{
|
|
353
|
-
label:
|
|
363
|
+
label: F,
|
|
354
364
|
editorId: ce,
|
|
355
|
-
editorValue:
|
|
356
|
-
editorValid:
|
|
365
|
+
editorValue: O === null ? "" : O,
|
|
366
|
+
editorValid: ve,
|
|
357
367
|
editorDisabled: u,
|
|
358
|
-
editorPlaceholder:
|
|
359
|
-
children:
|
|
360
|
-
style: { width:
|
|
361
|
-
dir:
|
|
368
|
+
editorPlaceholder: ne,
|
|
369
|
+
children: ye,
|
|
370
|
+
style: { width: te },
|
|
371
|
+
dir: E,
|
|
362
372
|
...ie
|
|
363
373
|
}
|
|
364
|
-
) :
|
|
374
|
+
) : ye;
|
|
365
375
|
}
|
|
366
376
|
);
|
|
367
|
-
|
|
377
|
+
Oe.propTypes = {
|
|
368
378
|
value: t.number,
|
|
369
379
|
defaultValue: t.number,
|
|
370
380
|
step: t.number,
|
|
@@ -428,8 +438,8 @@ const c = {
|
|
|
428
438
|
rounded: void 0,
|
|
429
439
|
fillMode: void 0
|
|
430
440
|
};
|
|
431
|
-
|
|
441
|
+
Oe.displayName = "KendoNumericTextBox";
|
|
432
442
|
export {
|
|
433
|
-
|
|
434
|
-
|
|
443
|
+
Oe as NumericTextBox,
|
|
444
|
+
vt as NumericTextBoxPropsContext
|
|
435
445
|
};
|
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: 1784273472,version:"15.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: '15.
|
|
10
|
+
publishDate: 1784273472,
|
|
11
|
+
version: '15.2.0-develop.1',
|
|
12
12
|
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/components/my-license/'
|
|
13
13
|
});
|