@progress/kendo-react-inputs 13.4.0-develop.2 → 13.4.0-develop.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/checkbox/Checkbox.js +1 -1
- package/checkbox/Checkbox.mjs +23 -23
- package/checkbox/interfaces/CheckboxProps.d.ts +1 -1
- package/colors/ColorGradient.mjs +4 -4
- package/colors/ColorInput.d.ts +1 -1
- package/colors/ColorPicker.js +1 -1
- package/colors/ColorPicker.mjs +12 -12
- package/colors/FlatColorPicker.d.ts +1 -1
- package/colors/FlatColorPicker.mjs +11 -11
- package/colors/HexInput.d.ts +1 -1
- package/colors/interfaces/ColorGradientProps.d.ts +1 -1
- package/colors/interfaces/ColorPickerProps.d.ts +1 -1
- package/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/index.d.mts +1 -1
- package/index.d.ts +1 -1
- package/input/Input.mjs +13 -13
- package/maskedtextbox/MaskedTextBox.d.ts +1 -1
- package/maskedtextbox/MaskedTextBox.js +1 -1
- package/maskedtextbox/MaskedTextBox.mjs +15 -15
- package/maskedtextbox/MaskedTextBoxProps.d.ts +1 -1
- package/numerictextbox/NumericTextBox.js +1 -1
- package/numerictextbox/NumericTextBox.mjs +40 -40
- package/numerictextbox/interfaces/NumericTextBoxProps.d.ts +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +1 -1
- package/package.json +10 -10
- package/radiobutton/RadioButton.mjs +18 -18
- package/radiobutton/RadioGroup.mjs +15 -15
- package/range-slider/RangeSlider.mjs +15 -15
- package/rating/Rating.mjs +12 -12
- package/rating/RatingItem.mjs +4 -4
- package/signature/Signature.js +1 -1
- package/signature/Signature.mjs +13 -13
- package/signature/interfaces/SignatureProps.d.ts +1 -1
- package/slider/Slider.d.ts +12 -78
- package/slider/Slider.js +1 -1
- package/slider/Slider.mjs +241 -191
- package/switch/Switch.d.ts +11 -126
- package/switch/Switch.js +1 -1
- package/switch/Switch.mjs +187 -209
- package/textarea/TextArea.js +1 -1
- package/textarea/TextArea.mjs +21 -21
- package/textarea/interfaces/TextAreaProps.d.ts +1 -1
- package/textbox/Textbox.d.ts +2 -1
- package/textbox/Textbox.js +1 -1
- package/textbox/Textbox.mjs +19 -19
package/index.d.mts
CHANGED
|
@@ -44,7 +44,7 @@ export { sanitizeNumber } from './numerictextbox/utils/index.js';
|
|
|
44
44
|
export { rangeReducer, RANGE_ACTION } from './range-slider/range-raducer.js';
|
|
45
45
|
export * from './range-slider/RangeSlider.js';
|
|
46
46
|
export * from './interfaces/ToggleBaseProps.js';
|
|
47
|
-
export { Switch, SwitchWithoutContext, type SwitchHandle, type SwitchProps, type SwitchPropsContext, type
|
|
47
|
+
export { Switch, SwitchWithoutContext, type SwitchHandle, type SwitchProps, type SwitchPropsContext, type SwitchChangeEvent } from './switch/Switch.js';
|
|
48
48
|
export * from './checkbox/interfaces/CheckboxProps.js';
|
|
49
49
|
export * from './checkbox/interfaces/CheckboxChangeEvent.js';
|
|
50
50
|
export * from './checkbox/interfaces/CheckboxFocusEvent.js';
|
package/index.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export { sanitizeNumber } from './numerictextbox/utils/index.js';
|
|
|
44
44
|
export { rangeReducer, RANGE_ACTION } from './range-slider/range-raducer.js';
|
|
45
45
|
export * from './range-slider/RangeSlider.js';
|
|
46
46
|
export * from './interfaces/ToggleBaseProps.js';
|
|
47
|
-
export { Switch, SwitchWithoutContext, type SwitchHandle, type SwitchProps, type SwitchPropsContext, type
|
|
47
|
+
export { Switch, SwitchWithoutContext, type SwitchHandle, type SwitchProps, type SwitchPropsContext, type SwitchChangeEvent } from './switch/Switch.js';
|
|
48
48
|
export * from './checkbox/interfaces/CheckboxProps.js';
|
|
49
49
|
export * from './checkbox/interfaces/CheckboxChangeEvent.js';
|
|
50
50
|
export * from './checkbox/interfaces/CheckboxFocusEvent.js';
|
package/input/Input.mjs
CHANGED
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as r from "react";
|
|
9
9
|
import a from "prop-types";
|
|
10
|
-
import { createPropsContext as
|
|
11
|
-
import { FloatingLabel as
|
|
10
|
+
import { createPropsContext as j, applyDefaultProps as z, useUnstyled as J, useId as Q, classNames as W } from "@progress/kendo-react-common";
|
|
11
|
+
import { FloatingLabel as X } from "@progress/kendo-react-labels";
|
|
12
12
|
const C = r.forwardRef((I, L) => {
|
|
13
|
-
const M = r.useContext(
|
|
13
|
+
const M = r.useContext(Y).call(void 0, I), [, P] = r.useReducer((t) => t, !0), n = z(M, Z), {
|
|
14
14
|
className: k,
|
|
15
15
|
label: o,
|
|
16
16
|
labelClassName: x,
|
|
@@ -30,9 +30,9 @@ const C = r.forwardRef((I, L) => {
|
|
|
30
30
|
style: m,
|
|
31
31
|
ariaLabel: U,
|
|
32
32
|
...B
|
|
33
|
-
} = n, D =
|
|
33
|
+
} = n, D = J(), u = R || D;
|
|
34
34
|
u && u.uInput;
|
|
35
|
-
const O =
|
|
35
|
+
const O = Q(), [S, T] = r.useState({
|
|
36
36
|
value: N
|
|
37
37
|
}), g = E || O, e = r.useRef(null), l = r.useRef(void 0), d = r.useRef(null), q = () => {
|
|
38
38
|
e.current && e.current.focus();
|
|
@@ -70,7 +70,7 @@ const C = r.forwardRef((I, L) => {
|
|
|
70
70
|
for (const h in t)
|
|
71
71
|
t.hasOwnProperty(h) && (i = i || !!t[h]);
|
|
72
72
|
return i;
|
|
73
|
-
}, v = !y || s().valid, G =
|
|
73
|
+
}, v = !y || s().valid, G = W(
|
|
74
74
|
"k-input",
|
|
75
75
|
{
|
|
76
76
|
"k-invalid": !v,
|
|
@@ -79,7 +79,7 @@ const C = r.forwardRef((I, L) => {
|
|
|
79
79
|
k
|
|
80
80
|
), H = () => {
|
|
81
81
|
e.current && e.current.setCustomValidity && (s().valid || !y ? e.current.classList.remove("k-invalid") : e.current.classList.add("k-invalid"), e.current.setCustomValidity(s().valid ? "" : p || ""));
|
|
82
|
-
},
|
|
82
|
+
}, _ = (t) => {
|
|
83
83
|
T({
|
|
84
84
|
value: t.target.value
|
|
85
85
|
}), l.current = t.target.value, n.onChange && n.onChange.call(void 0, {
|
|
@@ -88,7 +88,7 @@ const C = r.forwardRef((I, L) => {
|
|
|
88
88
|
value: t.target.value,
|
|
89
89
|
target: d.current
|
|
90
90
|
}), l.current = void 0;
|
|
91
|
-
},
|
|
91
|
+
}, K = (t) => {
|
|
92
92
|
if (t.animationName === "autoFillStart") {
|
|
93
93
|
const i = t.target.parentNode;
|
|
94
94
|
i && i.classList.contains("k-empty") && i.classList.remove("k-empty");
|
|
@@ -113,13 +113,13 @@ const C = r.forwardRef((I, L) => {
|
|
|
113
113
|
id: g,
|
|
114
114
|
autoFocus: V,
|
|
115
115
|
className: G,
|
|
116
|
-
onChange:
|
|
117
|
-
onAnimationStart:
|
|
116
|
+
onChange: _,
|
|
117
|
+
onAnimationStart: K,
|
|
118
118
|
ref: e
|
|
119
119
|
}
|
|
120
120
|
);
|
|
121
121
|
return o ? /* @__PURE__ */ r.createElement(
|
|
122
|
-
|
|
122
|
+
X,
|
|
123
123
|
{
|
|
124
124
|
label: o,
|
|
125
125
|
labelClassName: x,
|
|
@@ -134,7 +134,7 @@ const C = r.forwardRef((I, L) => {
|
|
|
134
134
|
unstyled: u
|
|
135
135
|
}
|
|
136
136
|
) : b;
|
|
137
|
-
}),
|
|
137
|
+
}), Y = j(), Z = {
|
|
138
138
|
defaultValue: "",
|
|
139
139
|
required: !1,
|
|
140
140
|
validityStyles: !0,
|
|
@@ -156,5 +156,5 @@ C.propTypes = {
|
|
|
156
156
|
};
|
|
157
157
|
export {
|
|
158
158
|
C as Input,
|
|
159
|
-
|
|
159
|
+
Y as InputPropsContext
|
|
160
160
|
};
|
|
@@ -58,7 +58,7 @@ export declare class MaskedTextBoxWithoutContext extends React.Component<MaskedT
|
|
|
58
58
|
validityStyles: PropTypes.Requireable<boolean>;
|
|
59
59
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
60
60
|
size: PropTypes.Requireable<"small" | "medium" | "large" | undefined>;
|
|
61
|
-
rounded: PropTypes.Requireable<"small" | "medium" | "large" | "full" | undefined>;
|
|
61
|
+
rounded: PropTypes.Requireable<"small" | "none" | "medium" | "large" | "full" | undefined>;
|
|
62
62
|
fillMode: PropTypes.Requireable<"flat" | "solid" | "outline" | undefined>;
|
|
63
63
|
autoFocus: PropTypes.Requireable<boolean>;
|
|
64
64
|
inputAttributes: PropTypes.Requireable<object>;
|
|
@@ -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 O=require("react"),e=require("prop-types"),M=require("./masking.service.js"),h=require("./utils.js"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react"),e=require("prop-types"),M=require("./masking.service.js"),h=require("./utils.js"),l=require("@progress/kendo-react-common"),E=require("@progress/kendo-react-labels");function V(u){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(u){for(const s in u)if(s!=="default"){const i=Object.getOwnPropertyDescriptor(u,s);Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>u[s]})}}return t.default=u,Object.freeze(t)}const p=V(O),n=class n extends p.Component{constructor(){super(...arguments),this.state={},this._inputId=`k_${this.props.id}`,this._service=new M.MaskingService,this._isPasted=!1,this._selection=[null,null],this._input=null,this.focus=()=>{this._input&&this._input.focus()},this.pasteHandler=t=>{const{selectionStart:s,selectionEnd:i}=t.target;i!==s&&(this._isPasted=!0,this._selection=[s||0,i||0])},this.onChangeHandler=t=>{const s=t.currentTarget,i=s.value,a=this._selection[0]||0,o=this._selection[1]||0;if(!this.props.mask){this._isPasted=!1,this._selection=[null,null],this.triggerOnChange(i,t);return}const r=this.value;let d;if(this._isPasted){this._isPasted=!1;const c=r.length-o,v=i.length-c;d=this._service.maskInRange(i.slice(a,v),r,a,o)}else d=this._service.maskInput(i,r,s.selectionStart||0);this._selection=[d.selection,d.selection],this.triggerOnChange(d.value,t)},this.focusHandler=t=>{this.state.focused||(this.setState({focused:!0}),this.props.onFocus&&this.props.onFocus.call(void 0,{target:this,syntheticEvent:t,nativeEvent:t.nativeEvent}))},this.blurHandler=t=>{this.state.focused&&(this.setState({focused:!1}),this.props.onBlur&&this.props.onBlur.call(void 0,{target:this,syntheticEvent:t,nativeEvent:t.nativeEvent}))},this.setValidity=()=>{this.element&&this.element.setCustomValidity(this.validity.valid?"":this.props.validationMessage||"")}}get element(){return this._input}get value(){return this._valueDuringOnChange!==void 0?this._valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value!==void 0?this.state.value:this.props.defaultValue!==void 0?this.props.defaultValue:""}get rawValue(){return this._service.rawValue(this.value)}get validity(){const t=this.value,s=this._service.validationValue(t),i=this.props.validationMessage!==void 0,a=this.props.valid!==void 0?this.props.valid:(!this.required||!!s)&&(!this.props.maskValidation||!this.props.prompt||t.indexOf(this.props.prompt)===-1);return{customError:i,valid:a,valueMissing:!s}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:n.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:!1}get name(){return this.props.name}componentDidUpdate(t,s){if(this.element&&this.state.focused&&s.focused){let[i,a]=this._selection;const o=t.selection,r=this.props.selection;(!o&&r||o&&r&&(o.start!==r.start||o.end!==r.end))&&(i=r.start,a=r.end),i!==null&&a!==null&&this.element.setSelectionRange(i,a)}h.maskingChanged(t,this.props)&&this.updateService(),this.setValidity()}componentDidMount(){this.updateService(),this.setValidity()}render(){const{size:t=n.defaultProps.size,fillMode:s=n.defaultProps.fillMode,rounded:i=n.defaultProps.rounded,autoFocus:a=n.defaultProps.autoFocus,prefix:o=n.defaultProps.prefix,suffix:r=n.defaultProps.suffix,inputAttributes:d,unstyled:c,className:v}=this.props,g=this.props.id||this._inputId,m=!this.validityStyles||this.validity.valid,b=this.props.style||{},C=c&&c.uMaskedTextBox,[_]=l.useCustomComponent(o),[P]=l.useCustomComponent(r),y=p.createElement("span",{dir:this.props.dir,className:l.classNames("k-input","k-maskedtextbox",{[`k-input-${l.kendoThemeMaps.sizeMap[t]||t}`]:t,[`k-input-${s}`]:s,[`k-rounded-${l.kendoThemeMaps.roundedMap[i]||i}`]:i,"k-invalid":!m,"k-disabled":this.props.disabled},v),style:this.props.label?b:{width:this.props.width,...b}},p.createElement(_,null),p.createElement("input",{type:"text",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",autoFocus:a,spellCheck:!1,className:l.classNames(l.uMaskedTextBox.inputInner({c:C})),value:this.value,id:g,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,"aria-placeholder":this.props.mask,"aria-required":this.props.required,name:this.props.name,tabIndex:l.getTabIndex(this.props.tabIndex,this.props.disabled,!0),accessKey:this.props.accessKey,title:this.props.title,disabled:this.props.disabled||void 0,readOnly:this.props.readonly||void 0,placeholder:this.props.placeholder,ref:S=>{this._input=S},onChange:this.onChangeHandler,onPaste:this.pasteHandler,onFocus:this.focusHandler,onBlur:this.blurHandler,onDragStart:h.returnFalse,onDrop:h.returnFalse,...d}),p.createElement(P,null));return this.props.label?p.createElement(E.FloatingLabel,{label:this.props.label,editorId:g,editorValue:this.value,editorValid:m,editorDisabled:this.props.disabled,editorPlaceholder:this.props.placeholder,children:y,style:{width:this.props.width},dir:this.props.dir}):y}triggerOnChange(t,s){if(this.setState({value:t}),this.props.onChange){this._valueDuringOnChange=t;const i={syntheticEvent:s,nativeEvent:s.nativeEvent,selectionStart:this._selection[0],selectionEnd:this._selection[1],target:this,value:this.value};this.props.onChange.call(void 0,i),this._valueDuringOnChange=void 0}}updateService(t){const s=Object.assign({includeLiterals:this.props.includeLiterals,mask:this.props.mask,prompt:this.props.prompt,promptPlaceholder:this.props.promptPlaceholder,rules:this.rules},t);this._service.update(s)}get rules(){return Object.assign({},h.defaultRules,this.props.rules)}};n.displayName="MaskedTextBox",n.propTypes={value:e.string,defaultValue:e.string,placeholder:e.string,title:e.string,dir:e.string,id:e.string,style:e.object,className:e.string,prefix:e.any,suffix:e.any,ariaLabelledBy:e.string,ariaDescribedBy:e.string,width:e.oneOfType([e.string,e.number]),tabIndex:e.number,accessKey:e.string,disabled:e.bool,readonly:e.bool,prompt:e.string,promptPlaceholder:e.string,includeLiterals:e.bool,maskValidation:e.bool,mask:e.string,rules:function(t,s,i){const a=t.rules;return a!==void 0&&!Object.entries(a).some(r=>typeof r!="string"||!(a[r]instanceof RegExp))?new Error("Invalid prop `"+s+"` supplied to `"+i+"`. Validation failed."):null},selection:e.shape({start:e.number.isRequired,end:e.number.isRequired}),name:e.string,label:e.node,validationMessage:e.string,required:e.bool,valid:e.bool,validityStyles:e.bool,onChange:e.func,size:e.oneOf(["small","medium","large"]),rounded:e.oneOf(["small","medium","large","full","none"]),fillMode:e.oneOf(["solid","flat","outline"]),autoFocus:e.bool,inputAttributes:e.object},n.defaultProps={prompt:"_",promptPlaceholder:" ",includeLiterals:!1,maskValidation:!0,rules:h.defaultRules,validityStyles:!0,prefix:t=>null,suffix:t=>null,size:void 0,rounded:void 0,fillMode:void 0,autoFocus:!1};let f=n;const k=l.createPropsContext(),x=l.withIdHOC(l.withPropsContext(k,l.withUnstyledHOC(f)));x.displayName="KendoReactMaskedTextBox";exports.MaskedTextBox=x;exports.MaskedTextBoxPropsContext=k;exports.MaskedTextBoxWithoutContext=f;
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
8
|
+
import * as d from "react";
|
|
9
9
|
import e from "prop-types";
|
|
10
10
|
import { MaskingService as E } from "./masking.service.mjs";
|
|
11
11
|
import { defaultRules as g, maskingChanged as O, returnFalse as y } from "./utils.mjs";
|
|
12
|
-
import { withIdHOC as V, withPropsContext as M, createPropsContext as I, withUnstyledHOC as w, useCustomComponent as b, classNames as
|
|
12
|
+
import { withIdHOC as V, withPropsContext as M, createPropsContext as I, withUnstyledHOC as w, useCustomComponent as b, classNames as _, kendoThemeMaps as k, getTabIndex as D, uMaskedTextBox as H } from "@progress/kendo-react-common";
|
|
13
13
|
import { FloatingLabel as q } from "@progress/kendo-react-labels";
|
|
14
|
-
const l = class l extends
|
|
14
|
+
const l = class l extends d.Component {
|
|
15
15
|
constructor() {
|
|
16
16
|
super(...arguments), this.state = {}, this._inputId = `k_${this.props.id}`, this._service = new E(), this._isPasted = !1, this._selection = [null, null], this._input = null, this.focus = () => {
|
|
17
17
|
this._input && this._input.focus();
|
|
@@ -28,7 +28,7 @@ const l = class l extends p.Component {
|
|
|
28
28
|
let n;
|
|
29
29
|
if (this._isPasted) {
|
|
30
30
|
this._isPasted = !1;
|
|
31
|
-
const
|
|
31
|
+
const p = r.length - o, u = s.length - p;
|
|
32
32
|
n = this._service.maskInRange(s.slice(a, u), r, a, o);
|
|
33
33
|
} else
|
|
34
34
|
n = this._service.maskInput(s, r, i.selectionStart || 0);
|
|
@@ -144,19 +144,19 @@ const l = class l extends p.Component {
|
|
|
144
144
|
prefix: o = l.defaultProps.prefix,
|
|
145
145
|
suffix: r = l.defaultProps.suffix,
|
|
146
146
|
inputAttributes: n,
|
|
147
|
-
unstyled:
|
|
147
|
+
unstyled: p,
|
|
148
148
|
className: u
|
|
149
|
-
} = this.props, c = this.props.id || this._inputId, f = !this.validityStyles || this.validity.valid, v = this.props.style || {},
|
|
149
|
+
} = this.props, c = this.props.id || this._inputId, f = !this.validityStyles || this.validity.valid, v = this.props.style || {}, x = p && p.uMaskedTextBox, [C] = b(o), [P] = b(r), m = /* @__PURE__ */ d.createElement(
|
|
150
150
|
"span",
|
|
151
151
|
{
|
|
152
152
|
dir: this.props.dir,
|
|
153
|
-
className:
|
|
153
|
+
className: _(
|
|
154
154
|
"k-input",
|
|
155
155
|
"k-maskedtextbox",
|
|
156
156
|
{
|
|
157
|
-
[`k-input-${
|
|
157
|
+
[`k-input-${k.sizeMap[t] || t}`]: t,
|
|
158
158
|
[`k-input-${i}`]: i,
|
|
159
|
-
[`k-rounded-${
|
|
159
|
+
[`k-rounded-${k.roundedMap[s] || s}`]: s,
|
|
160
160
|
"k-invalid": !f,
|
|
161
161
|
"k-disabled": this.props.disabled
|
|
162
162
|
},
|
|
@@ -164,8 +164,8 @@ const l = class l extends p.Component {
|
|
|
164
164
|
),
|
|
165
165
|
style: this.props.label ? v : { width: this.props.width, ...v }
|
|
166
166
|
},
|
|
167
|
-
/* @__PURE__ */
|
|
168
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ d.createElement(C, null),
|
|
168
|
+
/* @__PURE__ */ d.createElement(
|
|
169
169
|
"input",
|
|
170
170
|
{
|
|
171
171
|
type: "text",
|
|
@@ -174,7 +174,7 @@ const l = class l extends p.Component {
|
|
|
174
174
|
autoCapitalize: "off",
|
|
175
175
|
autoFocus: a,
|
|
176
176
|
spellCheck: !1,
|
|
177
|
-
className:
|
|
177
|
+
className: _(H.inputInner({ c: x })),
|
|
178
178
|
value: this.value,
|
|
179
179
|
id: c,
|
|
180
180
|
"aria-labelledby": this.props.ariaLabelledBy,
|
|
@@ -200,9 +200,9 @@ const l = class l extends p.Component {
|
|
|
200
200
|
...n
|
|
201
201
|
}
|
|
202
202
|
),
|
|
203
|
-
/* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ d.createElement(P, null)
|
|
204
204
|
);
|
|
205
|
-
return this.props.label ? /* @__PURE__ */
|
|
205
|
+
return this.props.label ? /* @__PURE__ */ d.createElement(
|
|
206
206
|
q,
|
|
207
207
|
{
|
|
208
208
|
label: this.props.label,
|
|
@@ -291,7 +291,7 @@ l.displayName = "MaskedTextBox", l.propTypes = {
|
|
|
291
291
|
validityStyles: e.bool,
|
|
292
292
|
onChange: e.func,
|
|
293
293
|
size: e.oneOf(["small", "medium", "large"]),
|
|
294
|
-
rounded: e.oneOf(["small", "medium", "large", "full"]),
|
|
294
|
+
rounded: e.oneOf(["small", "medium", "large", "full", "none"]),
|
|
295
295
|
fillMode: e.oneOf(["solid", "flat", "outline"]),
|
|
296
296
|
autoFocus: e.bool,
|
|
297
297
|
inputAttributes: e.object
|
|
@@ -240,7 +240,7 @@ export interface MaskedTextBoxProps extends FormComponentProps {
|
|
|
240
240
|
* <MaskedTextBox rounded="full" />
|
|
241
241
|
* ```
|
|
242
242
|
*/
|
|
243
|
-
rounded?: 'small' | 'medium' | 'large' | 'full';
|
|
243
|
+
rounded?: 'small' | 'medium' | 'large' | 'full' | 'none';
|
|
244
244
|
/**
|
|
245
245
|
* Configures the `fillMode` of the MaskedTextBox.
|
|
246
246
|
*
|
|
@@ -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 we=require("react"),t=require("prop-types"),fe=require("@progress/kendo-react-intl"),i=require("@progress/kendo-react-common"),be=require("@progress/kendo-svg-icons"),Ke=require("@progress/kendo-react-labels"),g=require("../messages/index.js"),u=require("./utils/index.js"),pe=require("@progress/kendo-react-buttons");function $e(m){const L=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(m){for(const v in m)if(v!=="default"){const R=Object.getOwnPropertyDescriptor(m,v);Object.defineProperty(L,v,R.get?R:{enumerable:!0,get:()=>m[v]})}}return L.default=m,Object.freeze(L)}const n=$e(we),Ue="Please enter a valid value!",ge=i.createPropsContext(),Q=n.forwardRef((m,L)=>{const v=i.usePropsContext(ge,m),{className:R,value:C,defaultValue:ve,format:s,width:X,tabIndex:ye,accessKey:Ve,title:ke,placeholder:Z,min:f,max:b,dir:ee,name:G,label:B,id:Ce,ariaDescribedBy:Se,ariaLabelledBy:Ee,ariaLabel:xe,inputType:Oe,readOnly:y,validationMessage:H,children:he,touched:We,visited:Ye,modified:Je,style:te,inputStyle:Ie,valid:w,step:S=c.step,spinners:Le=c.spinners,disabled:l=c.disabled,required:q=c.required,validityStyles:ne=c.validityStyles,prefix:Pe=c.prefix,suffix:De=c.suffix,onChange:h=c.onChange,onFocus:re=c.onFocus,onBlur:ae=c.onBlur,rangeOnEnter:se=c.rangeOnEnter,size:P=c.size,rounded:K=c.rounded,fillMode:M=c.fillMode,autoFocus:Ne=c.autoFocus,inputAttributes:Re,...ue}=v,Be=i.useId(),oe=Ce||Be,o=fe.useInternationalization(),T=fe.useLocalization(),a=n.useRef(null),F=n.useRef(void 0),[qe,I]=n.useState(!1),d=n.useRef(u.getInitialState()),j=n.useRef(!1),$=n.useRef(void 0),D=n.useRef(ve),N=u.formatValue(d.current.focused&&!l?d.current.currentLooseValue:u.getStateOrPropsValue(C,D.current),s,o);$.current=N;const[Me]=i.useCustomComponent(Pe),[Te]=i.useCustomComponent(De);n.useEffect(()=>{a.current&&a.current.setCustomValidity&&a.current.setCustomValidity(_().valid?"":H||Ue)});const le=n.useCallback(()=>{a.current&&a.current.focus()},[]),z=n.useCallback(()=>F.current!==void 0?F.current:u.getStateOrPropsValue(C,D.current),[C]),ce=n.useCallback(()=>G,[G]),A=n.useCallback(()=>q,[q]),_=n.useCallback(()=>{const r=H!==void 0,e=z(),x=w!==void 0?w:!d.current.valueIsOutOfRange&&(!A()||e!=null);return{customError:r,valid:x,valueMissing:e==null}},[H,w,z,A]),U=n.useCallback(()=>ne,[ne]),ie=n.useCallback(()=>v,[v]),E=n.useCallback(()=>{const r={element:a.current,focus:le};return Object.defineProperty(r,"name",{get:ce}),Object.defineProperty(r,"value",{get:z}),Object.defineProperty(r,"validity",{get:_}),Object.defineProperty(r,"validityStyles",{get:U}),Object.defineProperty(r,"required",{get:A}),Object.defineProperty(r,"props",{get:ie}),r},[ce,z,_,U,A,le,ie]);n.useImperativeHandle(L,E);const V=n.useCallback(()=>({eventValue:u.getStateOrPropsValue(C,D.current),prevLooseValue:$.current,currentLooseValue:a.current.value,selectionStart:a.current.selectionStart,selectionEnd:a.current.selectionEnd,decimalSelect:!1,valueIsCorrected:!1,valueIsOutOfRange:!1,isPaste:j.current,focused:d.current.focused}),[C]),k=n.useCallback((r,e)=>{if(l)return;F.current=e.eventValue,D.current=e.eventValue;const x=u.formatValue(u.rangeValue(e.eventValue,f,b),s,o),p=u.rangeValue(o.parseNumber(x,s),f,b);p!==e.eventValue&&(e.valueIsOutOfRange=!0,e.eventValue=p,D.current=p),C!==e.eventValue&&i.dispatchEvent(h,r,E(),{value:e.eventValue}),F.current=void 0,d.current=e,I(J=>!J)},[C,h,l,I,E]),Fe=n.useCallback(r=>{const e=V();j.current=!1,k(r,u.sanitizeNumber(e,s,o))},[s,h,o,k,V]),je=n.useCallback(r=>{if(y||l)return;let e=V();const x=o.parseNumber(String(e.currentLooseValue),s);if(e.selectionEnd>e.selectionStart&&e.selectionEnd-e.selectionStart===String(e.currentLooseValue).length){const p=o.numberSymbols(),O=p&&r.key===p.minusSign,J=p&&r.key===p.decimal;j.current=!O&&!J;return}switch(r.keyCode){case 38:u.increaseValue(x,e,S,f,b,s,o);break;case 40:u.decreaseValue(x,e,S,f,b,s,o);break;case 13:{if(se===!1)return;const p=u.formatValue(u.rangeValue(x,f,b),s,o),O=u.rangeValue(o.parseNumber(p,s),f,b);e.eventValue=O,e.currentLooseValue=u.formatValue(O,s,o),e.selectionStart=e.selectionEnd=e.currentLooseValue.length;break}case 110:{const p=a.current,O=o.numberSymbols();p&&(e.currentLooseValue=e.currentLooseValue.slice(0,e.selectionStart)+O.decimal+e.currentLooseValue.slice(e.selectionEnd),e.selectionStart=e.selectionEnd=e.selectionStart+1,e=u.sanitizeNumber(e,s,o));break}default:return}r.preventDefault(),k(r,e)},[s,f,b,S,h,se,k,V]),ze=n.useCallback(()=>{j.current=!0},[]),W=n.useCallback(r=>{if(y||l)return;const e=V();u.increaseValue(o.parseNumber(String(e.currentLooseValue),s),e,S,f,b,s,o),k(r,e)},[s,f,b,S,h,y,l,k,V]),Y=n.useCallback(r=>{if(y||l)return;const e=V();u.decreaseValue(o.parseNumber(String(e.currentLooseValue),s),e,S,f,b,s,o),k(r,e)},[s,f,b,S,h,y,l,k,V]),Ae=n.useCallback(r=>{const e=i.getActiveElement(document);!document||e!==a.current||!a.current||y||l||(r.nativeEvent.deltaY<0&&W(r),r.nativeEvent.deltaY>0&&Y(r))},[W,Y,l,y]),_e=n.useCallback(r=>{d.current.currentLooseValue=$.current,d.current.focused=!0,i.dispatchEvent(re,r,E(),{}),I(e=>!e)},[re,I,E]),Ge=n.useCallback(r=>{d.current=u.getInitialState(),i.dispatchEvent(ae,r,E(),{}),I(e=>!e)},[ae,I,E]),He=n.useCallback(r=>{if(document&&a.current){const e=i.getActiveElement(document);r.preventDefault(),e!==a.current&&a.current.focus()}},[]);i.useIsomorphicLayoutEffect(()=>{a.current&&a.current.type!=="number"&&d.current.selectionStart!==void 0&&d.current.selectionEnd!==void 0&&(a.current.selectionStart=d.current.selectionStart,a.current.selectionEnd=d.current.selectionEnd,d.current.selectionStart=void 0,d.current.selectionEnd=void 0)},[qe]);const de=!U()||_().valid,me=n.createElement("span",{dir:ee,style:B?te:{width:X,...te},className:i.classNames("k-input","k-numerictextbox",{[`k-input-${i.kendoThemeMaps.sizeMap[P]||P}`]:P,[`k-input-${M}`]:M,[`k-rounded-${i.kendoThemeMaps.roundedMap[K]||K}`]:K,"k-invalid":!de,"k-required":q,"k-disabled":l},R),"aria-disabled":l?"true":void 0,...B?{}:ue},n.createElement(Me,null),n.createElement("input",{role:"spinbutton",value:N===null?"":N,tabIndex:i.getTabIndex(ye,l),accessKey:Ve,disabled:l,title:ke,"aria-disabled":l?"true":void 0,"aria-valuemin":f,"aria-valuemax":b,"aria-label":xe,"aria-labelledby":Ee,"aria-describedby":Se,"aria-required":q,placeholder:Z,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoFocus:Ne,type:Oe||"tel",className:"k-input-inner",id:oe,name:G,readOnly:y,style:Ie,onChange:Fe,onFocus:_e,onBlur:Ge,onKeyDown:je,onPaste:ze,onWheel:Ae,ref:a,...Re}),n.createElement(Te,null),he,Le&&n.createElement("span",{className:"k-input-spinner k-spin-button",onMouseDown:He},n.createElement(pe.Button,{tabIndex:-1,type:"button",icon:"caret-alt-up",svgIcon:be.caretAltUpIcon,fillMode:M,size:P,className:"k-spinner-increase","aria-label":T.toLanguageString(g.numericIncreaseValue,g.messages[g.numericIncreaseValue]),title:T.toLanguageString(g.numericIncreaseValue,g.messages[g.numericIncreaseValue]),onClick:W}),n.createElement(pe.Button,{tabIndex:-1,type:"button",icon:"caret-alt-down",svgIcon:be.caretAltDownIcon,fillMode:M,size:P,className:"k-spinner-decrease","aria-label":T.toLanguageString(g.numericDecreaseValue,g.messages[g.numericDecreaseValue]),title:T.toLanguageString(g.numericDecreaseValue,g.messages[g.numericDecreaseValue]),onClick:Y})));return B?n.createElement(Ke.FloatingLabel,{label:B,editorId:oe,editorValue:N===null?"":N,editorValid:de,editorDisabled:l,editorPlaceholder:Z,children:me,style:{width:X},dir:ee,...ue}):me});Q.propTypes={value:t.number,defaultValue:t.number,step:t.number,format:t.oneOfType([t.string,t.shape({style:t.oneOf(["decimal","currency","percent","scientific","accounting"]),currency:t.string,currencyDisplay:t.oneOf(["symbol","code","name"]),useGrouping:t.bool,minimumIntegerDigits:t.number,minimumFractionDigits:t.number,maximumFractionDigits:t.number})]),width:t.oneOfType([t.string,t.number]),tabIndex:t.number,accessKey:t.string,title:t.string,placeholder:t.string,min:t.number,max:t.number,spinners:t.bool,disabled:t.bool,readOnly:t.bool,dir:t.string,name:t.string,label:t.string,validationMessage:t.string,required:t.bool,id:t.string,rangeOnEnter:t.bool,ariaLabelledBy:t.string,ariaDescribedBy:t.string,ariaLabel:t.string,onChange:t.func,onFocus:t.func,onBlur:t.func,size:t.oneOf(["small","medium","large"]),rounded:t.oneOf(["small","medium","large","full"]),fillMode:t.oneOf(["solid","flat","outline"]),inputAttributes:t.object};const c={prefix:m=>null,suffix:m=>null,step:1,spinners:!0,disabled:!1,required:!1,validityStyles:!0,rangeOnEnter:!0,autoFocus:!1,onChange:m=>{},onFocus:m=>{},onBlur:m=>{},size:void 0,rounded:void 0,fillMode:void 0};Q.displayName="KendoNumericTextBox";exports.NumericTextBox=Q;exports.NumericTextBoxPropsContext=ge;
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const we=require("react"),t=require("prop-types"),fe=require("@progress/kendo-react-intl"),i=require("@progress/kendo-react-common"),be=require("@progress/kendo-svg-icons"),Ke=require("@progress/kendo-react-labels"),g=require("../messages/index.js"),u=require("./utils/index.js"),pe=require("@progress/kendo-react-buttons");function $e(m){const L=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(m){for(const v in m)if(v!=="default"){const R=Object.getOwnPropertyDescriptor(m,v);Object.defineProperty(L,v,R.get?R:{enumerable:!0,get:()=>m[v]})}}return L.default=m,Object.freeze(L)}const n=$e(we),Ue="Please enter a valid value!",ge=i.createPropsContext(),Q=n.forwardRef((m,L)=>{const v=i.usePropsContext(ge,m),{className:R,value:C,defaultValue:ve,format:s,width:X,tabIndex:ye,accessKey:Ve,title:ke,placeholder:Z,min:f,max:b,dir:ee,name:G,label:B,id:Ce,ariaDescribedBy:Se,ariaLabelledBy:Ee,ariaLabel:xe,inputType:Oe,readOnly:y,validationMessage:H,children:he,touched:We,visited:Ye,modified:Je,style:te,inputStyle:Ie,valid:w,step:S=c.step,spinners:Le=c.spinners,disabled:l=c.disabled,required:q=c.required,validityStyles:ne=c.validityStyles,prefix:Pe=c.prefix,suffix:De=c.suffix,onChange:h=c.onChange,onFocus:re=c.onFocus,onBlur:ae=c.onBlur,rangeOnEnter:se=c.rangeOnEnter,size:P=c.size,rounded:K=c.rounded,fillMode:M=c.fillMode,autoFocus:Ne=c.autoFocus,inputAttributes:Re,...ue}=v,Be=i.useId(),oe=Ce||Be,o=fe.useInternationalization(),T=fe.useLocalization(),a=n.useRef(null),F=n.useRef(void 0),[qe,I]=n.useState(!1),d=n.useRef(u.getInitialState()),j=n.useRef(!1),$=n.useRef(void 0),D=n.useRef(ve),N=u.formatValue(d.current.focused&&!l?d.current.currentLooseValue:u.getStateOrPropsValue(C,D.current),s,o);$.current=N;const[Me]=i.useCustomComponent(Pe),[Te]=i.useCustomComponent(De);n.useEffect(()=>{a.current&&a.current.setCustomValidity&&a.current.setCustomValidity(_().valid?"":H||Ue)});const le=n.useCallback(()=>{a.current&&a.current.focus()},[]),z=n.useCallback(()=>F.current!==void 0?F.current:u.getStateOrPropsValue(C,D.current),[C]),ce=n.useCallback(()=>G,[G]),A=n.useCallback(()=>q,[q]),_=n.useCallback(()=>{const r=H!==void 0,e=z(),x=w!==void 0?w:!d.current.valueIsOutOfRange&&(!A()||e!=null);return{customError:r,valid:x,valueMissing:e==null}},[H,w,z,A]),U=n.useCallback(()=>ne,[ne]),ie=n.useCallback(()=>v,[v]),E=n.useCallback(()=>{const r={element:a.current,focus:le};return Object.defineProperty(r,"name",{get:ce}),Object.defineProperty(r,"value",{get:z}),Object.defineProperty(r,"validity",{get:_}),Object.defineProperty(r,"validityStyles",{get:U}),Object.defineProperty(r,"required",{get:A}),Object.defineProperty(r,"props",{get:ie}),r},[ce,z,_,U,A,le,ie]);n.useImperativeHandle(L,E);const V=n.useCallback(()=>({eventValue:u.getStateOrPropsValue(C,D.current),prevLooseValue:$.current,currentLooseValue:a.current.value,selectionStart:a.current.selectionStart,selectionEnd:a.current.selectionEnd,decimalSelect:!1,valueIsCorrected:!1,valueIsOutOfRange:!1,isPaste:j.current,focused:d.current.focused}),[C]),k=n.useCallback((r,e)=>{if(l)return;F.current=e.eventValue,D.current=e.eventValue;const x=u.formatValue(u.rangeValue(e.eventValue,f,b),s,o),p=u.rangeValue(o.parseNumber(x,s),f,b);p!==e.eventValue&&(e.valueIsOutOfRange=!0,e.eventValue=p,D.current=p),C!==e.eventValue&&i.dispatchEvent(h,r,E(),{value:e.eventValue}),F.current=void 0,d.current=e,I(J=>!J)},[C,h,l,I,E]),Fe=n.useCallback(r=>{const e=V();j.current=!1,k(r,u.sanitizeNumber(e,s,o))},[s,h,o,k,V]),je=n.useCallback(r=>{if(y||l)return;let e=V();const x=o.parseNumber(String(e.currentLooseValue),s);if(e.selectionEnd>e.selectionStart&&e.selectionEnd-e.selectionStart===String(e.currentLooseValue).length){const p=o.numberSymbols(),O=p&&r.key===p.minusSign,J=p&&r.key===p.decimal;j.current=!O&&!J;return}switch(r.keyCode){case 38:u.increaseValue(x,e,S,f,b,s,o);break;case 40:u.decreaseValue(x,e,S,f,b,s,o);break;case 13:{if(se===!1)return;const p=u.formatValue(u.rangeValue(x,f,b),s,o),O=u.rangeValue(o.parseNumber(p,s),f,b);e.eventValue=O,e.currentLooseValue=u.formatValue(O,s,o),e.selectionStart=e.selectionEnd=e.currentLooseValue.length;break}case 110:{const p=a.current,O=o.numberSymbols();p&&(e.currentLooseValue=e.currentLooseValue.slice(0,e.selectionStart)+O.decimal+e.currentLooseValue.slice(e.selectionEnd),e.selectionStart=e.selectionEnd=e.selectionStart+1,e=u.sanitizeNumber(e,s,o));break}default:return}r.preventDefault(),k(r,e)},[s,f,b,S,h,se,k,V]),ze=n.useCallback(()=>{j.current=!0},[]),W=n.useCallback(r=>{if(y||l)return;const e=V();u.increaseValue(o.parseNumber(String(e.currentLooseValue),s),e,S,f,b,s,o),k(r,e)},[s,f,b,S,h,y,l,k,V]),Y=n.useCallback(r=>{if(y||l)return;const e=V();u.decreaseValue(o.parseNumber(String(e.currentLooseValue),s),e,S,f,b,s,o),k(r,e)},[s,f,b,S,h,y,l,k,V]),Ae=n.useCallback(r=>{const e=i.getActiveElement(document);!document||e!==a.current||!a.current||y||l||(r.nativeEvent.deltaY<0&&W(r),r.nativeEvent.deltaY>0&&Y(r))},[W,Y,l,y]),_e=n.useCallback(r=>{d.current.currentLooseValue=$.current,d.current.focused=!0,i.dispatchEvent(re,r,E(),{}),I(e=>!e)},[re,I,E]),Ge=n.useCallback(r=>{d.current=u.getInitialState(),i.dispatchEvent(ae,r,E(),{}),I(e=>!e)},[ae,I,E]),He=n.useCallback(r=>{if(document&&a.current){const e=i.getActiveElement(document);r.preventDefault(),e!==a.current&&a.current.focus()}},[]);i.useIsomorphicLayoutEffect(()=>{a.current&&a.current.type!=="number"&&d.current.selectionStart!==void 0&&d.current.selectionEnd!==void 0&&(a.current.selectionStart=d.current.selectionStart,a.current.selectionEnd=d.current.selectionEnd,d.current.selectionStart=void 0,d.current.selectionEnd=void 0)},[qe]);const de=!U()||_().valid,me=n.createElement("span",{dir:ee,style:B?te:{width:X,...te},className:i.classNames("k-input","k-numerictextbox",{[`k-input-${i.kendoThemeMaps.sizeMap[P]||P}`]:P,[`k-input-${M}`]:M,[`k-rounded-${i.kendoThemeMaps.roundedMap[K]||K}`]:K,"k-invalid":!de,"k-required":q,"k-disabled":l},R),"aria-disabled":l?"true":void 0,...B?{}:ue},n.createElement(Me,null),n.createElement("input",{role:"spinbutton",value:N===null?"":N,tabIndex:i.getTabIndex(ye,l),accessKey:Ve,disabled:l,title:ke,"aria-disabled":l?"true":void 0,"aria-valuemin":f,"aria-valuemax":b,"aria-label":xe,"aria-labelledby":Ee,"aria-describedby":Se,"aria-required":q,placeholder:Z,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoFocus:Ne,type:Oe||"tel",className:"k-input-inner",id:oe,name:G,readOnly:y,style:Ie,onChange:Fe,onFocus:_e,onBlur:Ge,onKeyDown:je,onPaste:ze,onWheel:Ae,ref:a,...Re}),n.createElement(Te,null),he,Le&&n.createElement("span",{className:"k-input-spinner k-spin-button",onMouseDown:He},n.createElement(pe.Button,{tabIndex:-1,type:"button",icon:"caret-alt-up",svgIcon:be.caretAltUpIcon,fillMode:M,size:P,className:"k-spinner-increase","aria-label":T.toLanguageString(g.numericIncreaseValue,g.messages[g.numericIncreaseValue]),title:T.toLanguageString(g.numericIncreaseValue,g.messages[g.numericIncreaseValue]),onClick:W}),n.createElement(pe.Button,{tabIndex:-1,type:"button",icon:"caret-alt-down",svgIcon:be.caretAltDownIcon,fillMode:M,size:P,className:"k-spinner-decrease","aria-label":T.toLanguageString(g.numericDecreaseValue,g.messages[g.numericDecreaseValue]),title:T.toLanguageString(g.numericDecreaseValue,g.messages[g.numericDecreaseValue]),onClick:Y})));return B?n.createElement(Ke.FloatingLabel,{label:B,editorId:oe,editorValue:N===null?"":N,editorValid:de,editorDisabled:l,editorPlaceholder:Z,children:me,style:{width:X},dir:ee,...ue}):me});Q.propTypes={value:t.number,defaultValue:t.number,step:t.number,format:t.oneOfType([t.string,t.shape({style:t.oneOf(["decimal","currency","percent","scientific","accounting"]),currency:t.string,currencyDisplay:t.oneOf(["symbol","code","name"]),useGrouping:t.bool,minimumIntegerDigits:t.number,minimumFractionDigits:t.number,maximumFractionDigits:t.number})]),width:t.oneOfType([t.string,t.number]),tabIndex:t.number,accessKey:t.string,title:t.string,placeholder:t.string,min:t.number,max:t.number,spinners:t.bool,disabled:t.bool,readOnly:t.bool,dir:t.string,name:t.string,label:t.string,validationMessage:t.string,required:t.bool,id:t.string,rangeOnEnter:t.bool,ariaLabelledBy:t.string,ariaDescribedBy:t.string,ariaLabel:t.string,onChange:t.func,onFocus:t.func,onBlur:t.func,size:t.oneOf(["small","medium","large"]),rounded:t.oneOf(["small","medium","large","full","none"]),fillMode:t.oneOf(["solid","flat","outline"]),inputAttributes:t.object};const c={prefix:m=>null,suffix:m=>null,step:1,spinners:!0,disabled:!1,required:!1,validityStyles:!0,rangeOnEnter:!0,autoFocus:!1,onChange:m=>{},onFocus:m=>{},onBlur:m=>{},size:void 0,rounded:void 0,fillMode:void 0};Q.displayName="KendoNumericTextBox";exports.NumericTextBox=Q;exports.NumericTextBoxPropsContext=ge;
|
|
@@ -8,22 +8,22 @@
|
|
|
8
8
|
import * as r from "react";
|
|
9
9
|
import t from "prop-types";
|
|
10
10
|
import { useInternationalization as Xe, useLocalization as Ze } from "@progress/kendo-react-intl";
|
|
11
|
-
import { createPropsContext as et, usePropsContext as tt, useId as rt, useCustomComponent as pe, dispatchEvent as Q, getActiveElement as be, useIsomorphicLayoutEffect as nt, classNames as at, kendoThemeMaps as ge, getTabIndex as
|
|
12
|
-
import { caretAltUpIcon as
|
|
11
|
+
import { createPropsContext as et, usePropsContext as tt, useId as rt, useCustomComponent as pe, dispatchEvent as Q, getActiveElement as be, useIsomorphicLayoutEffect as nt, classNames as at, kendoThemeMaps as ge, getTabIndex as ot } from "@progress/kendo-react-common";
|
|
12
|
+
import { caretAltUpIcon as st, caretAltDownIcon as lt } from "@progress/kendo-svg-icons";
|
|
13
13
|
import { FloatingLabel as ut } from "@progress/kendo-react-labels";
|
|
14
14
|
import { numericIncreaseValue as T, messages as z, numericDecreaseValue as q } from "../messages/index.mjs";
|
|
15
15
|
import { getInitialState as ve, formatValue as A, getStateOrPropsValue as X, rangeValue as G, sanitizeNumber as ye, decreaseValue as Ve, increaseValue as ke } from "./utils/index.mjs";
|
|
16
16
|
import { Button as Ce } from "@progress/kendo-react-buttons";
|
|
17
17
|
const it = "Please enter a valid value!", ct = et(), Ee = r.forwardRef(
|
|
18
18
|
(C, Se) => {
|
|
19
|
-
const
|
|
19
|
+
const _ = tt(
|
|
20
20
|
ct,
|
|
21
21
|
C
|
|
22
22
|
), {
|
|
23
23
|
className: xe,
|
|
24
24
|
value: g,
|
|
25
25
|
defaultValue: he,
|
|
26
|
-
format:
|
|
26
|
+
format: o,
|
|
27
27
|
width: Z,
|
|
28
28
|
tabIndex: Ie,
|
|
29
29
|
accessKey: Oe,
|
|
@@ -32,7 +32,7 @@ const it = "Please enter a valid value!", ct = et(), Ee = r.forwardRef(
|
|
|
32
32
|
min: c,
|
|
33
33
|
max: d,
|
|
34
34
|
dir: te,
|
|
35
|
-
name:
|
|
35
|
+
name: j,
|
|
36
36
|
label: O,
|
|
37
37
|
id: Pe,
|
|
38
38
|
ariaDescribedBy: Ne,
|
|
@@ -58,18 +58,18 @@ const it = "Please enter a valid value!", ct = et(), Ee = r.forwardRef(
|
|
|
58
58
|
suffix: qe = u.suffix,
|
|
59
59
|
onChange: E = u.onChange,
|
|
60
60
|
onFocus: ae = u.onFocus,
|
|
61
|
-
onBlur:
|
|
62
|
-
rangeOnEnter:
|
|
61
|
+
onBlur: oe = u.onBlur,
|
|
62
|
+
rangeOnEnter: se = u.rangeOnEnter,
|
|
63
63
|
size: x = u.size,
|
|
64
64
|
rounded: w = u.rounded,
|
|
65
65
|
fillMode: P = u.fillMode,
|
|
66
66
|
autoFocus: Ae = u.autoFocus,
|
|
67
67
|
inputAttributes: Ge,
|
|
68
68
|
...le
|
|
69
|
-
} =
|
|
69
|
+
} = _, _e = rt(), ue = Pe || _e, s = Xe(), N = Ze(), a = r.useRef(null), D = r.useRef(void 0), [je, S] = r.useState(!1), i = r.useRef(ve()), R = r.useRef(!1), U = r.useRef(void 0), h = r.useRef(he), I = A(
|
|
70
70
|
i.current.focused && !l ? i.current.currentLooseValue : X(g, h.current),
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
o,
|
|
72
|
+
s
|
|
73
73
|
);
|
|
74
74
|
U.current = I;
|
|
75
75
|
const [He] = pe(ze), [Ke] = pe(qe);
|
|
@@ -80,14 +80,14 @@ const it = "Please enter a valid value!", ct = et(), Ee = r.forwardRef(
|
|
|
80
80
|
});
|
|
81
81
|
const ie = r.useCallback(() => {
|
|
82
82
|
a.current && a.current.focus();
|
|
83
|
-
}, []), F = r.useCallback(() => D.current !== void 0 ? D.current : X(g, h.current), [g]), ce = r.useCallback(() =>
|
|
83
|
+
}, []), F = r.useCallback(() => D.current !== void 0 ? D.current : X(g, h.current), [g]), ce = r.useCallback(() => j, [j]), B = r.useCallback(() => L, [L]), M = r.useCallback(() => {
|
|
84
84
|
const n = H !== void 0, e = F(), V = K !== void 0 ? K : !i.current.valueIsOutOfRange && (!B() || e != null);
|
|
85
85
|
return {
|
|
86
86
|
customError: n,
|
|
87
87
|
valid: V,
|
|
88
88
|
valueMissing: e == null
|
|
89
89
|
};
|
|
90
|
-
}, [H, K, F, B]), $ = r.useCallback(() => ne, [ne]), de = r.useCallback(() =>
|
|
90
|
+
}, [H, K, F, B]), $ = r.useCallback(() => ne, [ne]), de = r.useCallback(() => _, [_]), y = r.useCallback(() => {
|
|
91
91
|
const n = {
|
|
92
92
|
element: a.current,
|
|
93
93
|
focus: ie
|
|
@@ -111,7 +111,7 @@ const it = "Please enter a valid value!", ct = et(), Ee = r.forwardRef(
|
|
|
111
111
|
if (l)
|
|
112
112
|
return;
|
|
113
113
|
D.current = e.eventValue, h.current = e.eventValue;
|
|
114
|
-
const V = A(G(e.eventValue, c, d),
|
|
114
|
+
const V = A(G(e.eventValue, c, d), o, s), m = G(s.parseNumber(V, o), c, d);
|
|
115
115
|
m !== e.eventValue && (e.valueIsOutOfRange = !0, e.eventValue = m, h.current = m), g !== e.eventValue && Q(E, n, y(), {
|
|
116
116
|
value: e.eventValue
|
|
117
117
|
}), D.current = void 0, i.current = e, S((J) => !J);
|
|
@@ -120,37 +120,37 @@ const it = "Please enter a valid value!", ct = et(), Ee = r.forwardRef(
|
|
|
120
120
|
), we = r.useCallback(
|
|
121
121
|
(n) => {
|
|
122
122
|
const e = p();
|
|
123
|
-
R.current = !1, b(n, ye(e,
|
|
123
|
+
R.current = !1, b(n, ye(e, o, s));
|
|
124
124
|
},
|
|
125
|
-
[
|
|
125
|
+
[o, E, s, b, p]
|
|
126
126
|
), Ue = r.useCallback(
|
|
127
127
|
(n) => {
|
|
128
128
|
if (f || l)
|
|
129
129
|
return;
|
|
130
130
|
let e = p();
|
|
131
|
-
const V =
|
|
131
|
+
const V = s.parseNumber(String(e.currentLooseValue), o);
|
|
132
132
|
if (e.selectionEnd > e.selectionStart && e.selectionEnd - e.selectionStart === String(e.currentLooseValue).length) {
|
|
133
|
-
const m =
|
|
133
|
+
const m = s.numberSymbols(), k = m && n.key === m.minusSign, J = m && n.key === m.decimal;
|
|
134
134
|
R.current = !k && !J;
|
|
135
135
|
return;
|
|
136
136
|
}
|
|
137
137
|
switch (n.keyCode) {
|
|
138
138
|
case 38:
|
|
139
|
-
ke(V, e, v, c, d,
|
|
139
|
+
ke(V, e, v, c, d, o, s);
|
|
140
140
|
break;
|
|
141
141
|
case 40:
|
|
142
|
-
Ve(V, e, v, c, d,
|
|
142
|
+
Ve(V, e, v, c, d, o, s);
|
|
143
143
|
break;
|
|
144
144
|
case 13: {
|
|
145
|
-
if (
|
|
145
|
+
if (se === !1)
|
|
146
146
|
return;
|
|
147
|
-
const m = A(G(V, c, d),
|
|
148
|
-
e.eventValue = k, e.currentLooseValue = A(k,
|
|
147
|
+
const m = A(G(V, c, d), o, s), k = G(s.parseNumber(m, o), c, d);
|
|
148
|
+
e.eventValue = k, e.currentLooseValue = A(k, o, s), e.selectionStart = e.selectionEnd = e.currentLooseValue.length;
|
|
149
149
|
break;
|
|
150
150
|
}
|
|
151
151
|
case 110: {
|
|
152
|
-
const m = a.current, k =
|
|
153
|
-
m && (e.currentLooseValue = e.currentLooseValue.slice(0, e.selectionStart) + k.decimal + e.currentLooseValue.slice(e.selectionEnd), e.selectionStart = e.selectionEnd = e.selectionStart + 1, e = ye(e,
|
|
152
|
+
const m = a.current, k = s.numberSymbols();
|
|
153
|
+
m && (e.currentLooseValue = e.currentLooseValue.slice(0, e.selectionStart) + k.decimal + e.currentLooseValue.slice(e.selectionEnd), e.selectionStart = e.selectionEnd = e.selectionStart + 1, e = ye(e, o, s));
|
|
154
154
|
break;
|
|
155
155
|
}
|
|
156
156
|
default:
|
|
@@ -158,7 +158,7 @@ const it = "Please enter a valid value!", ct = et(), Ee = r.forwardRef(
|
|
|
158
158
|
}
|
|
159
159
|
n.preventDefault(), b(n, e);
|
|
160
160
|
},
|
|
161
|
-
[
|
|
161
|
+
[o, c, d, v, E, se, b, p]
|
|
162
162
|
), $e = r.useCallback(() => {
|
|
163
163
|
R.current = !0;
|
|
164
164
|
}, []), W = r.useCallback(
|
|
@@ -167,32 +167,32 @@ const it = "Please enter a valid value!", ct = et(), Ee = r.forwardRef(
|
|
|
167
167
|
return;
|
|
168
168
|
const e = p();
|
|
169
169
|
ke(
|
|
170
|
-
|
|
170
|
+
s.parseNumber(String(e.currentLooseValue), o),
|
|
171
171
|
e,
|
|
172
172
|
v,
|
|
173
173
|
c,
|
|
174
174
|
d,
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
o,
|
|
176
|
+
s
|
|
177
177
|
), b(n, e);
|
|
178
178
|
},
|
|
179
|
-
[
|
|
179
|
+
[o, c, d, v, E, f, l, b, p]
|
|
180
180
|
), Y = r.useCallback(
|
|
181
181
|
(n) => {
|
|
182
182
|
if (f || l)
|
|
183
183
|
return;
|
|
184
184
|
const e = p();
|
|
185
185
|
Ve(
|
|
186
|
-
|
|
186
|
+
s.parseNumber(String(e.currentLooseValue), o),
|
|
187
187
|
e,
|
|
188
188
|
v,
|
|
189
189
|
c,
|
|
190
190
|
d,
|
|
191
|
-
|
|
192
|
-
|
|
191
|
+
o,
|
|
192
|
+
s
|
|
193
193
|
), b(n, e);
|
|
194
194
|
},
|
|
195
|
-
[
|
|
195
|
+
[o, c, d, v, E, f, l, b, p]
|
|
196
196
|
), We = r.useCallback(
|
|
197
197
|
(n) => {
|
|
198
198
|
const e = be(document);
|
|
@@ -206,9 +206,9 @@ const it = "Please enter a valid value!", ct = et(), Ee = r.forwardRef(
|
|
|
206
206
|
[ae, S, y]
|
|
207
207
|
), Je = r.useCallback(
|
|
208
208
|
(n) => {
|
|
209
|
-
i.current = ve(), Q(
|
|
209
|
+
i.current = ve(), Q(oe, n, y(), {}), S((e) => !e);
|
|
210
210
|
},
|
|
211
|
-
[
|
|
211
|
+
[oe, S, y]
|
|
212
212
|
), Qe = r.useCallback((n) => {
|
|
213
213
|
if (document && a.current) {
|
|
214
214
|
const e = be(document);
|
|
@@ -217,7 +217,7 @@ const it = "Please enter a valid value!", ct = et(), Ee = r.forwardRef(
|
|
|
217
217
|
}, []);
|
|
218
218
|
nt(() => {
|
|
219
219
|
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);
|
|
220
|
-
}, [
|
|
220
|
+
}, [je]);
|
|
221
221
|
const me = !$() || M().valid, fe = /* @__PURE__ */ r.createElement(
|
|
222
222
|
"span",
|
|
223
223
|
{
|
|
@@ -245,7 +245,7 @@ const it = "Please enter a valid value!", ct = et(), Ee = r.forwardRef(
|
|
|
245
245
|
{
|
|
246
246
|
role: "spinbutton",
|
|
247
247
|
value: I === null ? "" : I,
|
|
248
|
-
tabIndex:
|
|
248
|
+
tabIndex: ot(Ie, l),
|
|
249
249
|
accessKey: Oe,
|
|
250
250
|
disabled: l,
|
|
251
251
|
title: Le,
|
|
@@ -264,7 +264,7 @@ const it = "Please enter a valid value!", ct = et(), Ee = r.forwardRef(
|
|
|
264
264
|
type: Fe || "tel",
|
|
265
265
|
className: "k-input-inner",
|
|
266
266
|
id: ue,
|
|
267
|
-
name:
|
|
267
|
+
name: j,
|
|
268
268
|
readOnly: f,
|
|
269
269
|
style: Me,
|
|
270
270
|
onChange: we,
|
|
@@ -285,7 +285,7 @@ const it = "Please enter a valid value!", ct = et(), Ee = r.forwardRef(
|
|
|
285
285
|
tabIndex: -1,
|
|
286
286
|
type: "button",
|
|
287
287
|
icon: "caret-alt-up",
|
|
288
|
-
svgIcon:
|
|
288
|
+
svgIcon: st,
|
|
289
289
|
fillMode: P,
|
|
290
290
|
size: x,
|
|
291
291
|
className: "k-spinner-increase",
|
|
@@ -378,7 +378,7 @@ Ee.propTypes = {
|
|
|
378
378
|
onFocus: t.func,
|
|
379
379
|
onBlur: t.func,
|
|
380
380
|
size: t.oneOf(["small", "medium", "large"]),
|
|
381
|
-
rounded: t.oneOf(["small", "medium", "large", "full"]),
|
|
381
|
+
rounded: t.oneOf(["small", "medium", "large", "full", "none"]),
|
|
382
382
|
fillMode: t.oneOf(["solid", "flat", "outline"]),
|
|
383
383
|
inputAttributes: t.object
|
|
384
384
|
};
|
|
@@ -174,7 +174,7 @@ export interface NumericTextBoxProps extends FormComponentProps, Omit<React.HTML
|
|
|
174
174
|
* <NumericTextBox rounded="full" />
|
|
175
175
|
* ```
|
|
176
176
|
*/
|
|
177
|
-
rounded?: 'small' | 'medium' | 'large' | 'full';
|
|
177
|
+
rounded?: 'small' | 'medium' | 'large' | 'full' | 'none';
|
|
178
178
|
/**
|
|
179
179
|
* Configures the `fillMode` of the NumericTextBox.
|
|
180
180
|
*
|
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: 1770362866,version:"13.4.0-develop.4",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"});exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -8,6 +8,6 @@ export const packageMetadata = Object.freeze({
|
|
|
8
8
|
productCode: 'KENDOUIREACT',
|
|
9
9
|
productCodes: ['KENDOUIREACT'],
|
|
10
10
|
publishDate: 0,
|
|
11
|
-
version: '13.4.0-develop.
|
|
11
|
+
version: '13.4.0-develop.4',
|
|
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": "13.4.0-develop.
|
|
3
|
+
"version": "13.4.0-develop.4",
|
|
4
4
|
"description": "React Inputs offer a customizable interface for users to enter and pick different information. KendoReact Input package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
"@progress/kendo-drawing": "^1.21.2",
|
|
29
29
|
"@progress/kendo-inputs-common": "^3.1.0",
|
|
30
30
|
"@progress/kendo-licensing": "^1.7.2",
|
|
31
|
-
"@progress/kendo-react-animation": "13.4.0-develop.
|
|
32
|
-
"@progress/kendo-react-buttons": "13.4.0-develop.
|
|
33
|
-
"@progress/kendo-react-common": "13.4.0-develop.
|
|
34
|
-
"@progress/kendo-react-dialogs": "13.4.0-develop.
|
|
35
|
-
"@progress/kendo-react-layout": "13.4.0-develop.
|
|
36
|
-
"@progress/kendo-react-intl": "13.4.0-develop.
|
|
37
|
-
"@progress/kendo-react-labels": "13.4.0-develop.
|
|
38
|
-
"@progress/kendo-react-popup": "13.4.0-develop.
|
|
31
|
+
"@progress/kendo-react-animation": "13.4.0-develop.4",
|
|
32
|
+
"@progress/kendo-react-buttons": "13.4.0-develop.4",
|
|
33
|
+
"@progress/kendo-react-common": "13.4.0-develop.4",
|
|
34
|
+
"@progress/kendo-react-dialogs": "13.4.0-develop.4",
|
|
35
|
+
"@progress/kendo-react-layout": "13.4.0-develop.4",
|
|
36
|
+
"@progress/kendo-react-intl": "13.4.0-develop.4",
|
|
37
|
+
"@progress/kendo-react-labels": "13.4.0-develop.4",
|
|
38
|
+
"@progress/kendo-react-popup": "13.4.0-develop.4",
|
|
39
39
|
"@progress/kendo-svg-icons": "^4.0.0",
|
|
40
40
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
41
41
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"package": {
|
|
83
83
|
"productName": "KendoReact",
|
|
84
84
|
"productCode": "KENDOUIREACT",
|
|
85
|
-
"publishDate":
|
|
85
|
+
"publishDate": 1770362866,
|
|
86
86
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
87
87
|
}
|
|
88
88
|
},
|