@progress/kendo-react-inputs 8.3.0-develop.8 → 8.3.0
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 +83 -82
- package/colors/ColorGradient.js +1 -1
- package/colors/ColorGradient.mjs +31 -25
- package/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/index.d.mts +6 -3
- package/index.d.ts +6 -3
- package/input/Input.js +1 -1
- package/input/Input.mjs +14 -13
- package/input/InputClearValue.js +1 -1
- package/input/InputClearValue.mjs +14 -10
- package/maskedtextbox/MaskedTextBox.js +1 -1
- package/maskedtextbox/MaskedTextBox.mjs +28 -24
- package/maskedtextbox/parsing/stream.mjs +2 -0
- package/numerictextbox/NumericTextBox.js +1 -1
- package/numerictextbox/NumericTextBox.mjs +67 -66
- package/package-metadata.mjs +1 -1
- package/package.json +8 -8
- package/radiobutton/RadioButton.js +1 -1
- package/radiobutton/RadioButton.mjs +26 -24
- package/radiobutton/RadioGroup.js +1 -1
- package/radiobutton/RadioGroup.mjs +26 -25
- package/slider/Slider.mjs +12 -19
- package/switch/Switch.js +1 -1
- package/switch/Switch.mjs +3 -3
- package/textarea/TextArea.js +1 -1
- package/textarea/TextArea.mjs +28 -27
- package/textbox/Textbox.js +1 -1
- package/textbox/Textbox.mjs +24 -23
package/slider/Slider.mjs
CHANGED
|
@@ -12,7 +12,7 @@ import { Keys as n, validatePackage as y, classNames as w, Draggable as S, getTa
|
|
|
12
12
|
import { provideLocalizationService as C, registerForLocalization as I } from "@progress/kendo-react-intl";
|
|
13
13
|
import { sliderIncreaseValue as d, messages as h, sliderDecreaseValue as m, sliderDragTitle as u } from "../messages/index.mjs";
|
|
14
14
|
import { SLIDER_LABEL_ATTRIBUTE as L } from "./SliderLabel.mjs";
|
|
15
|
-
import { packageMetadata as
|
|
15
|
+
import { packageMetadata as A } from "../package-metadata.mjs";
|
|
16
16
|
import { Button as v } from "@progress/kendo-react-buttons";
|
|
17
17
|
import { caretAltUpIcon as g, caretAltLeftIcon as f, caretAltRightIcon as b, caretAltDownIcon as k } from "@progress/kendo-svg-icons";
|
|
18
18
|
const p = class p extends i.Component {
|
|
@@ -74,7 +74,7 @@ const p = class p extends i.Component {
|
|
|
74
74
|
}, this.drag = (t) => {
|
|
75
75
|
const e = t.element.getBoundingClientRect(), l = this.props.vertical ? e.bottom - t.event.clientY : this.state.dir === "rtl" ? e.right - t.event.clientX : t.event.clientX - e.left, r = this.props.vertical ? e.height : e.width, o = l / r;
|
|
76
76
|
this.change(t, this.props.min + o * (this.props.max - this.props.min));
|
|
77
|
-
}, y(
|
|
77
|
+
}, y(A);
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
80
80
|
* @hidden
|
|
@@ -138,23 +138,16 @@ const p = class p extends i.Component {
|
|
|
138
138
|
...e
|
|
139
139
|
}
|
|
140
140
|
},
|
|
141
|
-
this.props.children && /* @__PURE__ */ i.createElement(
|
|
142
|
-
|
|
141
|
+
this.props.children && /* @__PURE__ */ i.createElement("ul", { className: "k-reset k-slider-items", style: { margin: 0, ...l } }, i.Children.map(this.props.children, (r, o) => r && i.cloneElement(
|
|
142
|
+
r,
|
|
143
143
|
{
|
|
144
|
-
|
|
145
|
-
|
|
144
|
+
position: 100 * (r.props.position - this.props.min) / (this.props.max - this.props.min),
|
|
145
|
+
vertical: this.props.vertical,
|
|
146
|
+
firstTick: o === 0,
|
|
147
|
+
lastTick: o === i.Children.count(this.props.children) - 1
|
|
146
148
|
},
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
{
|
|
150
|
-
position: 100 * (r.props.position - this.props.min) / (this.props.max - this.props.min),
|
|
151
|
-
vertical: this.props.vertical,
|
|
152
|
-
firstTick: o === 0,
|
|
153
|
-
lastTick: o === i.Children.count(this.props.children) - 1
|
|
154
|
-
},
|
|
155
|
-
r.props.children
|
|
156
|
-
))
|
|
157
|
-
),
|
|
149
|
+
r.props.children
|
|
150
|
+
))),
|
|
158
151
|
/* @__PURE__ */ i.createElement(
|
|
159
152
|
"div",
|
|
160
153
|
{
|
|
@@ -215,11 +208,11 @@ p.displayName = "Slider", p.propTypes = {
|
|
|
215
208
|
// TODO: validation when buttons is set to true, but no step is provided
|
|
216
209
|
};
|
|
217
210
|
let c = p;
|
|
218
|
-
const
|
|
211
|
+
const B = E(), N = D(B, c);
|
|
219
212
|
N.displayName = "KendoReactSlider";
|
|
220
213
|
I(c);
|
|
221
214
|
export {
|
|
222
215
|
N as Slider,
|
|
223
|
-
|
|
216
|
+
B as SliderPropsContext,
|
|
224
217
|
c as SliderWithoutContext
|
|
225
218
|
};
|
package/switch/Switch.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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react"),
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react"),i=require("prop-types"),s=require("@progress/kendo-react-common"),S=require("@progress/kendo-react-intl"),p=require("../messages/index.js"),N=require("../package-metadata.js");function O(o){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const e in o)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(a,e,t.get?t:{enumerable:!0,get:()=>o[e]})}}return a.default=o,Object.freeze(a)}const r=O(C),n=class n extends r.Component{constructor(a){super(a),this.setValidity=()=>{this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity.valid?"":this.props.validationMessage||this.defaultValidationMessage.toLanguageString(p.switchValidation,p.messages[p.switchValidation]))},this.limit=(e,t,d)=>{const h=d.offsetWidth,l=t.offsetWidth;return e<0?0:e>h-l?h-l:e},this.toggle=(e,t)=>{this.setState({checked:e}),this.valueDuringOnChange=e,s.dispatchEvent(this.props.onChange,t,this,{value:e}),this.valueDuringOnChange=void 0},this._element=null,this._wrapper=null,this._input=null,this._id=this.props.id,this.defaultValidationMessage=S.provideLocalizationService(this),this.focus=()=>{this.actionElement&&this.actionElement.focus()},this.dummyInput=e=>r.createElement("input",{type:"checkbox",checked:this.props.checked,ref:t=>{this._input=t},tabIndex:-1,"aria-hidden":!0,value:e,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"},onChange:s.noop,name:this.name||void 0}),this.handleClick=e=>{this.eventTimeStamp!==e.timeStamp&&(this.eventTimeStamp=e.timeStamp,this.toggle(!this.value,e))},this.handleKeyDown=e=>{if(this.props.disabled)return;const{keyCode:t}=e;(t===s.Keys.space||t===s.Keys.enter)&&(this.toggle(!this.value,e),e.preventDefault())},this.handleWrapperFocus=e=>{if(this.props.disabled)return;this.setState({focused:!0});const{onFocus:t}=this.props;t&&t.call(void 0,e)},this.handleWrapperBlur=e=>{if(this.props.disabled)return;this.setState({focused:!1});const{onBlur:t}=this.props;t&&t.call(void 0,e)},s.validatePackage(N.packageMetadata),this.state={checked:a.defaultChecked||n.defaultProps.defaultChecked,focused:!1}}get value(){return this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.checked!==void 0?this.props.checked:this.state.checked}get element(){return this._element}get actionElement(){return this._wrapper}get name(){return this.props.name}get validity(){const a=this.props.validationMessage!==void 0,e=this.props.valid!==void 0?this.props.valid:this.props.required?!!this.value:!0,t=this.props.valid!==void 0?this.props.valid:e;return{customError:a,valid:t,valueMissing:this.value===null}}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}componentDidMount(){this.setValidity(),this.forceUpdate()}componentDidUpdate(){this.setValidity()}render(){const{focused:a}=this.state,{dir:e,disabled:t,trackRounded:d,thumbRounded:h,size:l,offLabel:m,onLabel:f,tabIndex:v}=this.props;this.dir=e||this.element&&getComputedStyle(this.element).direction||void 0;const y=!this.validityStyles||this.validity.valid,k=s.classNames("k-switch",{[`k-switch-${s.kendoThemeMaps.sizeMap[l]||l}`]:l,"k-switch-on":this.value,"k-switch-off":!this.value,"k-focus":a,"k-disabled":t,"k-invalid":!y},this.props.className),w={"aria-checked":this.value,"aria-disabled":t||void 0,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,"aria-label":this.props.ariaLabel,"aria-required":this.props.required};return r.createElement("span",{ref:u=>{this._wrapper=u},role:"switch",...w,className:k,dir:this.dir,onKeyDown:this.handleKeyDown,onClick:this.handleClick,onBlur:this.handleWrapperBlur,onFocus:this.handleWrapperFocus,tabIndex:s.getTabIndex(v,t,void 0),accessKey:this.props.accessKey,id:this.props.id||this._id},r.createElement("span",{className:s.classNames("k-switch-track",{[`k-rounded-${s.kendoThemeMaps.roundedMap[d]||d}`]:d}),ref:u=>{this._element=u}},this.dummyInput(this.value),f?r.createElement("span",{className:"k-switch-label-on"},f):"",m?r.createElement("span",{className:"k-switch-label-off"},m):""),r.createElement("span",{className:"k-switch-thumb-wrap"},r.createElement("span",{className:s.classNames("k-switch-thumb",{[`k-rounded-${h}`]:h})})))}};n.displayName="Switch",n.propTypes={accessKey:i.string,checked:i.bool,className:i.string,disabled:i.bool,defaultChecked:i.bool,size:i.oneOf([null,"small","medium","large"]),trackRounded:i.oneOf([null,"small","medium","large","full"]),thumbRounded:i.oneOf([null,"small","medium","large","full"]),dir:i.string,id:i.string,ariaLabelledBy:i.string,ariaDescribedBy:i.string,offLabel:i.string,required:i.bool,tabIndex:i.number,valid:i.bool,validate:i.bool,validationMessage:i.string,onBlur:i.any,onChange:i.any,onFocus:i.any,onLabel:i.string},n.defaultProps={disabled:!1,defaultChecked:!1,size:"medium",trackRounded:"full",thumbRounded:"full",offLabel:"OFF",onBlur:s.noop,onFocus:s.noop,onLabel:"ON",validityStyles:!0};let c=n;const g=s.createPropsContext(),b=s.withIdHOC(s.withPropsContext(g,c));b.displayName="KendoReactSwitch";exports.Switch=b;exports.SwitchPropsContext=g;exports.SwitchWithoutContext=c;
|
package/switch/Switch.mjs
CHANGED
|
@@ -106,7 +106,7 @@ const a = class a extends s.Component {
|
|
|
106
106
|
* @hidden
|
|
107
107
|
*/
|
|
108
108
|
get required() {
|
|
109
|
-
return this.props.required !== void 0 ? this.props.required :
|
|
109
|
+
return this.props.required !== void 0 ? this.props.required : !1;
|
|
110
110
|
}
|
|
111
111
|
/**
|
|
112
112
|
* @hidden
|
|
@@ -142,7 +142,8 @@ const a = class a extends s.Component {
|
|
|
142
142
|
"aria-disabled": i || void 0,
|
|
143
143
|
"aria-labelledby": this.props.ariaLabelledBy,
|
|
144
144
|
"aria-describedby": this.props.ariaDescribedBy,
|
|
145
|
-
"aria-label": this.props.ariaLabel
|
|
145
|
+
"aria-label": this.props.ariaLabel,
|
|
146
|
+
"aria-required": this.props.required
|
|
146
147
|
};
|
|
147
148
|
return /* @__PURE__ */ s.createElement(
|
|
148
149
|
"span",
|
|
@@ -214,7 +215,6 @@ a.displayName = "Switch", a.propTypes = {
|
|
|
214
215
|
onBlur: h,
|
|
215
216
|
onFocus: h,
|
|
216
217
|
onLabel: "ON",
|
|
217
|
-
required: !1,
|
|
218
218
|
validityStyles: !0
|
|
219
219
|
};
|
|
220
220
|
let c = a;
|
package/textarea/TextArea.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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const se=require("react"),e=require("prop-types"),a=require("@progress/kendo-react-common");function le(s){const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const se=require("react"),e=require("prop-types"),a=require("@progress/kendo-react-common");function le(s){const u=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const o in s)if(o!=="default"){const l=Object.getOwnPropertyDescriptor(s,o);Object.defineProperty(u,o,l.get?l:{enumerable:!0,get:()=>s[o]})}}return u.default=s,Object.freeze(u)}const t=le(se),B=a.createPropsContext(),z=t.forwardRef((s,u)=>{const o=a.usePropsContext(B,s),{size:l=p.size,rounded:b=p.rounded,fillMode:O=p.fillMode,autoFocus:F=p.autoFocus,prefix:N=null,suffix:w=null,ariaDescribedBy:j,ariaLabelledBy:q,autoSize:T,className:R,defaultValue:D,disabled:n,readOnly:H,required:c,rows:$,id:L,name:_,placeholder:K,style:G,tabIndex:J,value:g,valid:P,validationMessage:M,validityStyles:S,onChange:x,onFocus:v,onBlur:y,visited:ie,touched:ue,modified:ce,resizable:h,...Q}=o,r=t.useRef(null),E=t.useCallback(()=>{r.current&&r.current.focus()},[]),[I,V]=t.useState(D),[U,W]=a.useCustomComponent(N),[X,Y]=a.useCustomComponent(w),d=g!==void 0,f=d?g:I,m=t.useCallback(()=>({element:r,focus:E,get value(){return f},get name(){return r.current&&r.current.name}}),[E,f]);t.useImperativeHandle(u,m);const[Z,A]=t.useState("auto"),ee=a.useId(),te=a.useDir(r,o.dir),C=P!==void 0?P:c?!!f:!0;t.useEffect(()=>{r.current&&r.current.setCustomValidity&&r.current.setCustomValidity(C?"":M||"")},[C,M]),a.useIsomorphicLayoutEffect(()=>{r.current&&A(`${r.current.scrollHeight}px`)},[f]);const ae=t.useCallback(i=>{const k=i.target.value;A("auto"),!d&&!n&&V(k),x&&!n&&a.dispatchEvent(x,i,{...m(),value:k},{value:k})},[V,x,n,d]),re=t.useCallback(i=>{v&&!n&&a.dispatchEvent(v,i,m(),void 0)},[v,n]),ne=t.useCallback(i=>{y&&!n&&a.dispatchEvent(y,i,m(),void 0)},[y,n]),oe={id:L||ee,role:"textbox",name:_,className:a.classNames("k-input-inner","!k-overflow-auto",{"k-resize":!T&&h!=="none"}),ref:r,disabled:n,rows:$,placeholder:K,readOnly:H,required:c,tabIndex:a.getTabIndex(J,n),autoFocus:F,style:T?{resize:"none",overflow:"hidden",height:Z}:h?{resize:h}:{},"aria-labelledby":q,"aria-describedby":j,"aria-multiline":!0,"aria-disabled":n||void 0,"aria-required":c,value:d?g:I,...Q,onChange:ae,onFocus:re,onBlur:ne};return t.createElement("span",{className:a.classNames("k-input","k-textarea",{[`k-input-${a.kendoThemeMaps.sizeMap[l]||l}`]:l,[`k-input-${O}`]:O,[`k-rounded-${a.kendoThemeMaps.roundedMap[b]||b}`]:b,"k-invalid":!(C||S!==void 0||S===!0),"k-required":c,"k-disabled":n},R),style:G,dir:te},o.prefix&&t.createElement(U,{...W}),t.createElement("textarea",{...oe}),o.suffix&&t.createElement(X,{...Y}))});z.propTypes={ariaDescribedBy:e.string,ariaLabelledBy:e.string,autoSize:e.bool,className:e.string,defaultValue:e.string,dir:e.string,disabled:e.bool,readOnly:e.bool,rows:e.number,id:e.string,name:e.string,placeholder:e.string,style:e.object,tabIndex:e.number,value:e.oneOfType([e.string,e.arrayOf(e.string),e.number]),onChange:e.func,onFocus:e.func,onBlur:e.func,size:e.oneOf([null,"small","medium","large"]),rounded:e.oneOf([null,"small","medium","large","full"]),fillMode:e.oneOf([null,"solid","flat","outline"]),resizable:e.oneOf(["none","both","horizontal","vertical"]),autoFocus:e.bool};const p={size:"medium",rounded:"medium",fillMode:"solid",autoFocus:!1};z.displayName="KendoTextArea";exports.TextArea=z;exports.TextAreaPropsContext=B;
|
package/textarea/TextArea.mjs
CHANGED
|
@@ -11,20 +11,20 @@ import e from "prop-types";
|
|
|
11
11
|
import { createPropsContext as ie, usePropsContext as ue, useCustomComponent as F, useId as de, useDir as ce, useIsomorphicLayoutEffect as fe, dispatchEvent as y, classNames as M, getTabIndex as me, kendoThemeMaps as O } from "@progress/kendo-react-common";
|
|
12
12
|
const pe = ie(), S = t.forwardRef((w, A) => {
|
|
13
13
|
const n = ue(pe, w), {
|
|
14
|
-
size:
|
|
15
|
-
rounded:
|
|
16
|
-
fillMode: k =
|
|
17
|
-
autoFocus: N =
|
|
14
|
+
size: c = d.size,
|
|
15
|
+
rounded: f = d.rounded,
|
|
16
|
+
fillMode: k = d.fillMode,
|
|
17
|
+
autoFocus: N = d.autoFocus,
|
|
18
18
|
prefix: H = null,
|
|
19
19
|
suffix: R = null,
|
|
20
20
|
ariaDescribedBy: $,
|
|
21
|
-
ariaLabelledBy:
|
|
21
|
+
ariaLabelledBy: q,
|
|
22
22
|
autoSize: C,
|
|
23
|
-
className:
|
|
24
|
-
defaultValue:
|
|
23
|
+
className: D,
|
|
24
|
+
defaultValue: L,
|
|
25
25
|
disabled: r,
|
|
26
26
|
readOnly: j,
|
|
27
|
-
required:
|
|
27
|
+
required: s,
|
|
28
28
|
rows: K,
|
|
29
29
|
id: G,
|
|
30
30
|
name: J,
|
|
@@ -49,21 +49,21 @@ const pe = ie(), S = t.forwardRef((w, A) => {
|
|
|
49
49
|
a.current && a.current.focus();
|
|
50
50
|
},
|
|
51
51
|
[]
|
|
52
|
-
), [V, B] = t.useState(
|
|
52
|
+
), [V, B] = t.useState(L), [Y, Z] = F(H), [_, ee] = F(R), l = m !== void 0, i = l ? m : V, u = t.useCallback(
|
|
53
53
|
() => ({
|
|
54
54
|
element: a,
|
|
55
55
|
focus: T,
|
|
56
56
|
get value() {
|
|
57
|
-
return
|
|
57
|
+
return i;
|
|
58
58
|
},
|
|
59
59
|
get name() {
|
|
60
60
|
return a.current && a.current.name;
|
|
61
61
|
}
|
|
62
62
|
}),
|
|
63
|
-
[T,
|
|
63
|
+
[T, i]
|
|
64
64
|
);
|
|
65
|
-
t.useImperativeHandle(A,
|
|
66
|
-
const [te, E] = t.useState("auto"), ae = de(), re = ce(a, n.dir), v = z !== void 0 ? z :
|
|
65
|
+
t.useImperativeHandle(A, u);
|
|
66
|
+
const [te, E] = t.useState("auto"), ae = de(), re = ce(a, n.dir), v = z !== void 0 ? z : s ? !!i : !0;
|
|
67
67
|
t.useEffect(
|
|
68
68
|
() => {
|
|
69
69
|
a.current && a.current.setCustomValidity && a.current.setCustomValidity(
|
|
@@ -75,28 +75,28 @@ const pe = ie(), S = t.forwardRef((w, A) => {
|
|
|
75
75
|
() => {
|
|
76
76
|
a.current && E(`${a.current.scrollHeight}px`);
|
|
77
77
|
},
|
|
78
|
-
[
|
|
78
|
+
[i]
|
|
79
79
|
);
|
|
80
80
|
const oe = t.useCallback(
|
|
81
81
|
(o) => {
|
|
82
82
|
const h = o.target.value;
|
|
83
|
-
E("auto"), !
|
|
83
|
+
E("auto"), !l && !r && B(h), p && !r && y(
|
|
84
84
|
p,
|
|
85
85
|
o,
|
|
86
86
|
{
|
|
87
|
-
...
|
|
87
|
+
...u(),
|
|
88
88
|
value: h
|
|
89
89
|
},
|
|
90
90
|
{ value: h }
|
|
91
91
|
);
|
|
92
92
|
},
|
|
93
|
-
[B, p, r,
|
|
93
|
+
[B, p, r, l]
|
|
94
94
|
), ne = t.useCallback(
|
|
95
95
|
(o) => {
|
|
96
96
|
b && !r && y(
|
|
97
97
|
b,
|
|
98
98
|
o,
|
|
99
|
-
|
|
99
|
+
u(),
|
|
100
100
|
void 0
|
|
101
101
|
);
|
|
102
102
|
},
|
|
@@ -106,7 +106,7 @@ const pe = ie(), S = t.forwardRef((w, A) => {
|
|
|
106
106
|
x && !r && y(
|
|
107
107
|
x,
|
|
108
108
|
o,
|
|
109
|
-
|
|
109
|
+
u(),
|
|
110
110
|
void 0
|
|
111
111
|
);
|
|
112
112
|
},
|
|
@@ -121,15 +121,16 @@ const pe = ie(), S = t.forwardRef((w, A) => {
|
|
|
121
121
|
rows: K,
|
|
122
122
|
placeholder: Q,
|
|
123
123
|
readOnly: j,
|
|
124
|
-
required:
|
|
124
|
+
required: s,
|
|
125
125
|
tabIndex: me(W, r),
|
|
126
126
|
autoFocus: N,
|
|
127
127
|
style: C ? { resize: "none", overflow: "hidden", height: te } : g ? { resize: g } : {},
|
|
128
|
-
"aria-labelledby":
|
|
128
|
+
"aria-labelledby": q,
|
|
129
129
|
"aria-describedby": $,
|
|
130
130
|
"aria-multiline": !0,
|
|
131
131
|
"aria-disabled": r || void 0,
|
|
132
|
-
|
|
132
|
+
"aria-required": s,
|
|
133
|
+
value: l ? m : V,
|
|
133
134
|
...X,
|
|
134
135
|
onChange: oe,
|
|
135
136
|
onFocus: ne,
|
|
@@ -142,14 +143,14 @@ const pe = ie(), S = t.forwardRef((w, A) => {
|
|
|
142
143
|
"k-input",
|
|
143
144
|
"k-textarea",
|
|
144
145
|
{
|
|
145
|
-
[`k-input-${O.sizeMap[
|
|
146
|
+
[`k-input-${O.sizeMap[c] || c}`]: c,
|
|
146
147
|
[`k-input-${k}`]: k,
|
|
147
|
-
[`k-rounded-${O.roundedMap[
|
|
148
|
+
[`k-rounded-${O.roundedMap[f] || f}`]: f,
|
|
148
149
|
"k-invalid": !(v || P !== void 0 || P === !0),
|
|
149
|
-
"k-required":
|
|
150
|
+
"k-required": s,
|
|
150
151
|
"k-disabled": r
|
|
151
152
|
},
|
|
152
|
-
|
|
153
|
+
D
|
|
153
154
|
),
|
|
154
155
|
style: U,
|
|
155
156
|
dir: re
|
|
@@ -188,7 +189,7 @@ S.propTypes = {
|
|
|
188
189
|
resizable: e.oneOf(["none", "both", "horizontal", "vertical"]),
|
|
189
190
|
autoFocus: e.bool
|
|
190
191
|
};
|
|
191
|
-
const
|
|
192
|
+
const d = {
|
|
192
193
|
size: "medium",
|
|
193
194
|
rounded: "medium",
|
|
194
195
|
fillMode: "solid",
|
package/textbox/Textbox.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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react"),c=require("prop-types"),a=require("@progress/kendo-react-common"),p=require("../package-metadata.js");function z(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const l=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,l.get?l:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const t=z(j),d=t.forwardRef((e,r)=>{a.validatePackage(p.packageMetadata);const n=t.useRef(null),l=t.useRef(null),s=t.useRef(),f=a.useUnstyled(),i=f&&f.uTextBox,b=t.useCallback(()=>{var u;return s.current!==void 0?s.current:(u=n.current)==null?void 0:u.value},[]);t.useImperativeHandle(l,()=>({get element(){return n.current},get name(){return n.current&&n.current.name},get value(){return b()}})),t.useImperativeHandle(r,()=>l.current);const{size:m=o.size,fillMode:g=o.fillMode,rounded:v=o.rounded,autoFocus:h=o.autoFocus,className:x,dir:B,style:F,prefix:T=o.prefix,suffix:_=o.suffix,valid:w,modified:D,touched:H,visited:I,...q}=e,[M]=a.useCustomComponent(T),[O]=a.useCustomComponent(_),[C,y]=t.useState(!1),R=u=>{y(!0)},N=u=>{y(!1)},S=t.useCallback(u=>{s.current=u.target.value,e.onChange&&e.onChange.call(void 0,{syntheticEvent:u,nativeEvent:u.nativeEvent,value:u.target.value,target:l.current}),s.current=void 0},[e.onChange]),{onFocus:k,onBlur:E}=a.useAsyncFocusBlur({onFocus:R,onBlur:N,onSyncFocus:e.onFocus,onSyncBlur:e.onBlur}),P=t.useMemo(()=>a.classNames(a.uTextBox.wrapper({c:i,rounded:v,fillMode:g,size:m,focused:C,required:e.required,disabled:e.disabled,invalid:e.valid===!1}),x),[x,g,C,e.disabled,e.required,e.valid,v,m,i]);return t.createElement("span",{style:F,dir:B,className:P,onFocus:k,onBlur:E},t.createElement(M,null),t.createElement("input",{ref:n,className:a.classNames(a.uTextBox.input({c:i})),autoFocus:h,...q,"aria-required":e.required,onChange:S}),t.createElement(O,null))}),o={prefix:e=>null,suffix:e=>null,size:"medium",rounded:"medium",fillMode:"solid",autoFocus:!1};d.propTypes={size:c.oneOf([null,"small","medium","large"]),rounded:c.oneOf([null,"small","medium","large","full"]),fillMode:c.oneOf([null,"solid","flat","outline"]),autoFocus:c.bool};d.displayName="KendoReactTextBoxComponent";exports.TextBox=d;
|
package/textbox/Textbox.mjs
CHANGED
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as t from "react";
|
|
10
10
|
import o from "prop-types";
|
|
11
|
-
import { validatePackage as
|
|
11
|
+
import { validatePackage as H, useUnstyled as I, useCustomComponent as g, useAsyncFocusBlur as p, classNames as h, uTextBox as C } from "@progress/kendo-react-common";
|
|
12
12
|
import { packageMetadata as A } from "../package-metadata.mjs";
|
|
13
13
|
const B = t.forwardRef((e, F) => {
|
|
14
|
-
|
|
15
|
-
const l = t.useRef(null),
|
|
14
|
+
H(A);
|
|
15
|
+
const l = t.useRef(null), r = t.useRef(null), a = t.useRef(), i = I(), s = i && i.uTextBox, y = t.useCallback(
|
|
16
16
|
() => {
|
|
17
17
|
var n;
|
|
18
18
|
return a.current !== void 0 ? a.current : (n = l.current) == null ? void 0 : n.value;
|
|
@@ -20,7 +20,7 @@ const B = t.forwardRef((e, F) => {
|
|
|
20
20
|
[]
|
|
21
21
|
);
|
|
22
22
|
t.useImperativeHandle(
|
|
23
|
-
|
|
23
|
+
r,
|
|
24
24
|
() => ({
|
|
25
25
|
get element() {
|
|
26
26
|
return l.current;
|
|
@@ -34,10 +34,10 @@ const B = t.forwardRef((e, F) => {
|
|
|
34
34
|
})
|
|
35
35
|
), t.useImperativeHandle(
|
|
36
36
|
F,
|
|
37
|
-
() =>
|
|
37
|
+
() => r.current
|
|
38
38
|
);
|
|
39
39
|
const {
|
|
40
|
-
size:
|
|
40
|
+
size: c = u.size,
|
|
41
41
|
fillMode: d = u.fillMode,
|
|
42
42
|
rounded: f = u.rounded,
|
|
43
43
|
autoFocus: E = u.autoFocus,
|
|
@@ -52,59 +52,60 @@ const B = t.forwardRef((e, F) => {
|
|
|
52
52
|
touched: K,
|
|
53
53
|
visited: U,
|
|
54
54
|
...N
|
|
55
|
-
} = e, [T] = g(b), [
|
|
55
|
+
} = e, [T] = g(b), [q] = g(M), [v, x] = t.useState(!1), k = (n) => {
|
|
56
56
|
x(!0);
|
|
57
|
-
},
|
|
57
|
+
}, z = (n) => {
|
|
58
58
|
x(!1);
|
|
59
|
-
},
|
|
59
|
+
}, P = t.useCallback(
|
|
60
60
|
(n) => {
|
|
61
61
|
a.current = n.target.value, e.onChange && e.onChange.call(void 0, {
|
|
62
62
|
syntheticEvent: n,
|
|
63
63
|
nativeEvent: n.nativeEvent,
|
|
64
64
|
value: n.target.value,
|
|
65
|
-
target:
|
|
65
|
+
target: r.current
|
|
66
66
|
}), a.current = void 0;
|
|
67
67
|
},
|
|
68
68
|
[e.onChange]
|
|
69
|
-
), { onFocus:
|
|
70
|
-
onFocus:
|
|
71
|
-
onBlur:
|
|
69
|
+
), { onFocus: S, onBlur: O } = p({
|
|
70
|
+
onFocus: k,
|
|
71
|
+
onBlur: z,
|
|
72
72
|
onSyncFocus: e.onFocus,
|
|
73
73
|
onSyncBlur: e.onBlur
|
|
74
|
-
}),
|
|
74
|
+
}), w = t.useMemo(
|
|
75
75
|
() => h(C.wrapper({
|
|
76
|
-
c:
|
|
76
|
+
c: s,
|
|
77
77
|
rounded: f,
|
|
78
78
|
fillMode: d,
|
|
79
|
-
size:
|
|
79
|
+
size: c,
|
|
80
80
|
focused: v,
|
|
81
81
|
required: e.required,
|
|
82
82
|
disabled: e.disabled,
|
|
83
83
|
invalid: e.valid === !1
|
|
84
84
|
}), m),
|
|
85
|
-
[m, d, v, e.disabled, e.required, e.valid, f,
|
|
85
|
+
[m, d, v, e.disabled, e.required, e.valid, f, c, s]
|
|
86
86
|
);
|
|
87
87
|
return /* @__PURE__ */ t.createElement(
|
|
88
88
|
"span",
|
|
89
89
|
{
|
|
90
90
|
style: _,
|
|
91
91
|
dir: R,
|
|
92
|
-
className:
|
|
93
|
-
onFocus:
|
|
94
|
-
onBlur:
|
|
92
|
+
className: w,
|
|
93
|
+
onFocus: S,
|
|
94
|
+
onBlur: O
|
|
95
95
|
},
|
|
96
96
|
/* @__PURE__ */ t.createElement(T, null),
|
|
97
97
|
/* @__PURE__ */ t.createElement(
|
|
98
98
|
"input",
|
|
99
99
|
{
|
|
100
100
|
ref: l,
|
|
101
|
-
className: h(C.input({ c:
|
|
101
|
+
className: h(C.input({ c: s })),
|
|
102
102
|
autoFocus: E,
|
|
103
103
|
...N,
|
|
104
|
-
|
|
104
|
+
"aria-required": e.required,
|
|
105
|
+
onChange: P
|
|
105
106
|
}
|
|
106
107
|
),
|
|
107
|
-
/* @__PURE__ */ t.createElement(
|
|
108
|
+
/* @__PURE__ */ t.createElement(q, null)
|
|
108
109
|
);
|
|
109
110
|
}), u = {
|
|
110
111
|
prefix: (e) => null,
|