@progress/kendo-react-inputs 8.2.0-develop.1 → 8.2.0-develop.11
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 +115 -112
- package/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/index.d.mts +28 -0
- package/index.d.ts +28 -0
- package/input/Input.js +1 -1
- package/input/Input.mjs +47 -43
- package/maskedtextbox/MaskedTextBox.js +1 -1
- package/maskedtextbox/MaskedTextBox.mjs +61 -57
- package/numerictextbox/NumericTextBox.js +1 -1
- package/numerictextbox/NumericTextBox.mjs +89 -86
- package/package-metadata.mjs +1 -1
- package/package.json +8 -8
- package/range-slider/RangeSlider.js +1 -1
- package/range-slider/RangeSlider.mjs +11 -7
- package/slider/Slider.js +1 -1
- package/slider/Slider.mjs +5 -5
- package/textarea/TextArea.js +1 -1
- package/textarea/TextArea.mjs +96 -92
- package/textbox/Textbox.js +1 -1
- package/textbox/Textbox.mjs +54 -50
package/slider/Slider.mjs
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as i from "react";
|
|
10
10
|
import a from "prop-types";
|
|
11
|
-
import { Keys as o, validatePackage as y, classNames as w, Draggable as x, getTabIndex as
|
|
11
|
+
import { Keys as o, validatePackage as y, classNames as w, Draggable as x, getTabIndex as S, dispatchEvent as T, createPropsContext as E, withPropsContext as D } from "@progress/kendo-react-common";
|
|
12
12
|
import { provideLocalizationService as I, registerForLocalization as L } from "@progress/kendo-react-intl";
|
|
13
13
|
import { sliderIncreaseValue as d, messages as p, sliderDecreaseValue as m, sliderDragTitle as u } from "../messages/index.mjs";
|
|
14
14
|
import { SLIDER_LABEL_ATTRIBUTE as C } from "./SliderLabel.mjs";
|
|
@@ -127,7 +127,7 @@ const h = class h extends i.Component {
|
|
|
127
127
|
incrementTitle: s.toLanguageString(d, p[d]),
|
|
128
128
|
decrementTitle: s.toLanguageString(m, p[m])
|
|
129
129
|
},
|
|
130
|
-
/* @__PURE__ */ i.createElement(x, { onDrag: this.dragOver, onPress: this.dragStart }, /* @__PURE__ */ i.createElement(
|
|
130
|
+
/* @__PURE__ */ i.createElement(x, { onDrag: this.dragOver, onPress: this.dragStart, autoScroll: !1 }, /* @__PURE__ */ i.createElement(
|
|
131
131
|
"div",
|
|
132
132
|
{
|
|
133
133
|
className: "k-slider-track-wrap",
|
|
@@ -182,7 +182,7 @@ const h = class h extends i.Component {
|
|
|
182
182
|
"aria-labelledby": this.props.ariaLabelledBy,
|
|
183
183
|
"aria-describedby": this.props.ariaDescribedBy,
|
|
184
184
|
"aria-label": this.props.ariaLabel,
|
|
185
|
-
tabIndex:
|
|
185
|
+
tabIndex: S(this.props.tabIndex, this.props.disabled, void 0),
|
|
186
186
|
className: "k-draghandle k-draghandle-end",
|
|
187
187
|
title: s.toLanguageString(u, p[u]),
|
|
188
188
|
style: this.props.vertical ? { bottom: "calc(" + t + "%)", zIndex: 1 } : this.state.dir === "rtl" ? { right: "calc(" + t + "% - 13px)", zIndex: 1 } : { left: "calc(" + t + "%)", zIndex: 1 }
|
|
@@ -200,7 +200,7 @@ const h = class h extends i.Component {
|
|
|
200
200
|
return this._sliderTrack;
|
|
201
201
|
}
|
|
202
202
|
change(s, t) {
|
|
203
|
-
t = Math.min(Math.max(t, this.props.min), this.props.max), this.setState({ value: t }),
|
|
203
|
+
t = Math.min(Math.max(t, this.props.min), this.props.max), this.setState({ value: t }), T(this.props.onChange, s, this, { value: t });
|
|
204
204
|
}
|
|
205
205
|
};
|
|
206
206
|
h.displayName = "Slider", h.propTypes = {
|
|
@@ -215,7 +215,7 @@ h.displayName = "Slider", h.propTypes = {
|
|
|
215
215
|
// TODO: validation when buttons is set to true, but no step is provided
|
|
216
216
|
};
|
|
217
217
|
let c = h;
|
|
218
|
-
const A =
|
|
218
|
+
const A = E(), N = D(A, c);
|
|
219
219
|
N.displayName = "KendoReactSlider";
|
|
220
220
|
L(c);
|
|
221
221
|
export {
|
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
|
|
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 i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const r in s)if(r!=="default"){const l=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(i,r,l.get?l:{enumerable:!0,get:()=>s[r]})}}return i.default=s,Object.freeze(i)}const t=le(se),B=a.createPropsContext(),z=t.forwardRef((s,i)=>{const r=a.usePropsContext(B,s),{size:l=m.size,rounded:p=m.rounded,fillMode:O=m.fillMode,autoFocus:F=m.autoFocus,prefix:N=null,suffix:w=null,ariaDescribedBy:j,ariaLabelledBy:R,autoSize:T,className:q,defaultValue:D,disabled:o,readOnly:H,required:b,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:ue,touched:ie,modified:ce,resizable:h,...Q}=r,n=t.useRef(null),E=t.useCallback(()=>{n.current&&n.current.focus()},[]),[I,V]=t.useState(D),[U,W]=a.useCustomComponent(N),[X,Y]=a.useCustomComponent(w),c=g!==void 0,d=c?g:I,f=t.useCallback(()=>({element:n,focus:E,get value(){return d},get name(){return n.current&&n.current.name}}),[E,d]);t.useImperativeHandle(i,f);const[Z,A]=t.useState("auto"),ee=a.useId(),te=a.useDir(n,r.dir),C=P!==void 0?P:b?!!d:!0;t.useEffect(()=>{n.current&&n.current.setCustomValidity&&n.current.setCustomValidity(C?"":M||"")},[C,M]),a.useIsomorphicLayoutEffect(()=>{n.current&&A(`${n.current.scrollHeight}px`)},[d]);const ae=t.useCallback(u=>{const k=u.target.value;A("auto"),!c&&!o&&V(k),x&&!o&&a.dispatchEvent(x,u,{...f(),value:k},{value:k})},[V,x,o,c]),ne=t.useCallback(u=>{v&&!o&&a.dispatchEvent(v,u,f(),void 0)},[v,o]),oe=t.useCallback(u=>{y&&!o&&a.dispatchEvent(y,u,f(),void 0)},[y,o]),re={id:L||ee,role:"textbox",name:_,className:a.classNames("k-input-inner","!k-overflow-auto",{"k-resize":!T&&h!=="none"}),ref:n,disabled:o,rows:$,placeholder:K,readOnly:H,required:b,tabIndex:a.getTabIndex(J,o),autoFocus:F,style:T?{resize:"none",overflow:"hidden",height:Z}:h?{resize:h}:{},"aria-labelledby":R,"aria-describedby":j,"aria-multiline":!0,"aria-disabled":o||void 0,value:c?g:I,...Q,onChange:ae,onFocus:ne,onBlur:oe};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[p]||p}`]:p,"k-invalid":!(C||S!==void 0||S===!0),"k-required":b,"k-disabled":o},q),style:G,dir:te},r.prefix&&t.createElement(U,{...W}),t.createElement("textarea",{...re}),r.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 m={size:"medium",rounded:"medium",fillMode:"solid",autoFocus:!1};z.displayName="KendoTextArea";exports.TextArea=z;exports.TextAreaPropsContext=B;
|
package/textarea/TextArea.mjs
CHANGED
|
@@ -8,156 +8,158 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as t from "react";
|
|
10
10
|
import e from "prop-types";
|
|
11
|
-
import { createPropsContext as
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
size:
|
|
15
|
-
rounded:
|
|
16
|
-
fillMode: k =
|
|
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
|
+
const pe = ie(), S = t.forwardRef((w, A) => {
|
|
13
|
+
const n = ue(pe, w), {
|
|
14
|
+
size: d = u.size,
|
|
15
|
+
rounded: c = u.rounded,
|
|
16
|
+
fillMode: k = u.fillMode,
|
|
17
|
+
autoFocus: N = u.autoFocus,
|
|
17
18
|
prefix: H = null,
|
|
18
|
-
suffix:
|
|
19
|
-
ariaDescribedBy:
|
|
20
|
-
ariaLabelledBy:
|
|
19
|
+
suffix: R = null,
|
|
20
|
+
ariaDescribedBy: $,
|
|
21
|
+
ariaLabelledBy: D,
|
|
21
22
|
autoSize: C,
|
|
22
|
-
className:
|
|
23
|
-
defaultValue:
|
|
23
|
+
className: L,
|
|
24
|
+
defaultValue: q,
|
|
24
25
|
disabled: r,
|
|
25
|
-
readOnly:
|
|
26
|
-
required:
|
|
27
|
-
rows:
|
|
28
|
-
id:
|
|
29
|
-
name:
|
|
30
|
-
placeholder:
|
|
31
|
-
style:
|
|
32
|
-
tabIndex:
|
|
33
|
-
value:
|
|
26
|
+
readOnly: j,
|
|
27
|
+
required: f,
|
|
28
|
+
rows: K,
|
|
29
|
+
id: G,
|
|
30
|
+
name: J,
|
|
31
|
+
placeholder: Q,
|
|
32
|
+
style: U,
|
|
33
|
+
tabIndex: W,
|
|
34
|
+
value: m,
|
|
34
35
|
valid: z,
|
|
35
36
|
validationMessage: I,
|
|
36
37
|
validityStyles: P,
|
|
37
|
-
onChange:
|
|
38
|
-
onFocus:
|
|
39
|
-
onBlur:
|
|
38
|
+
onChange: p,
|
|
39
|
+
onFocus: b,
|
|
40
|
+
onBlur: x,
|
|
40
41
|
// Removed to support direct use in Form Field component
|
|
41
|
-
visited:
|
|
42
|
-
touched:
|
|
43
|
-
modified:
|
|
44
|
-
resizable:
|
|
45
|
-
...
|
|
46
|
-
} =
|
|
42
|
+
visited: be,
|
|
43
|
+
touched: xe,
|
|
44
|
+
modified: ge,
|
|
45
|
+
resizable: g,
|
|
46
|
+
...X
|
|
47
|
+
} = n, a = t.useRef(null), T = t.useCallback(
|
|
47
48
|
() => {
|
|
48
49
|
a.current && a.current.focus();
|
|
49
50
|
},
|
|
50
51
|
[]
|
|
51
|
-
), [V, B] = t.useState(
|
|
52
|
+
), [V, B] = t.useState(q), [Y, Z] = F(H), [_, ee] = F(R), s = m !== void 0, l = s ? m : V, i = t.useCallback(
|
|
52
53
|
() => ({
|
|
53
54
|
element: a,
|
|
54
55
|
focus: T,
|
|
55
56
|
get value() {
|
|
56
|
-
return
|
|
57
|
+
return l;
|
|
57
58
|
},
|
|
58
59
|
get name() {
|
|
59
60
|
return a.current && a.current.name;
|
|
60
61
|
}
|
|
61
62
|
}),
|
|
62
|
-
[T,
|
|
63
|
+
[T, l]
|
|
63
64
|
);
|
|
64
|
-
t.useImperativeHandle(
|
|
65
|
-
const [
|
|
65
|
+
t.useImperativeHandle(A, i);
|
|
66
|
+
const [te, E] = t.useState("auto"), ae = de(), re = ce(a, n.dir), v = z !== void 0 ? z : f ? !!l : !0;
|
|
66
67
|
t.useEffect(
|
|
67
68
|
() => {
|
|
68
69
|
a.current && a.current.setCustomValidity && a.current.setCustomValidity(
|
|
69
|
-
|
|
70
|
+
v ? "" : I || ""
|
|
70
71
|
);
|
|
71
72
|
},
|
|
72
|
-
[
|
|
73
|
-
),
|
|
73
|
+
[v, I]
|
|
74
|
+
), fe(
|
|
74
75
|
() => {
|
|
75
76
|
a.current && E(`${a.current.scrollHeight}px`);
|
|
76
77
|
},
|
|
77
|
-
[
|
|
78
|
+
[l]
|
|
78
79
|
);
|
|
79
|
-
const
|
|
80
|
-
(
|
|
81
|
-
const
|
|
82
|
-
E("auto"), !
|
|
83
|
-
|
|
84
|
-
|
|
80
|
+
const oe = t.useCallback(
|
|
81
|
+
(o) => {
|
|
82
|
+
const h = o.target.value;
|
|
83
|
+
E("auto"), !s && !r && B(h), p && !r && y(
|
|
84
|
+
p,
|
|
85
|
+
o,
|
|
85
86
|
{
|
|
86
87
|
...i(),
|
|
87
|
-
value:
|
|
88
|
+
value: h
|
|
88
89
|
},
|
|
89
|
-
{ value:
|
|
90
|
+
{ value: h }
|
|
90
91
|
);
|
|
91
92
|
},
|
|
92
|
-
[B,
|
|
93
|
+
[B, p, r, s]
|
|
93
94
|
), ne = t.useCallback(
|
|
94
|
-
(
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
(o) => {
|
|
96
|
+
b && !r && y(
|
|
97
|
+
b,
|
|
98
|
+
o,
|
|
98
99
|
i(),
|
|
99
100
|
void 0
|
|
100
101
|
);
|
|
101
102
|
},
|
|
102
|
-
[
|
|
103
|
-
),
|
|
104
|
-
(
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
103
|
+
[b, r]
|
|
104
|
+
), se = t.useCallback(
|
|
105
|
+
(o) => {
|
|
106
|
+
x && !r && y(
|
|
107
|
+
x,
|
|
108
|
+
o,
|
|
108
109
|
i(),
|
|
109
110
|
void 0
|
|
110
111
|
);
|
|
111
112
|
},
|
|
112
|
-
[
|
|
113
|
-
),
|
|
114
|
-
id:
|
|
113
|
+
[x, r]
|
|
114
|
+
), le = {
|
|
115
|
+
id: G || ae,
|
|
115
116
|
role: "textbox",
|
|
116
|
-
name:
|
|
117
|
-
className:
|
|
117
|
+
name: J,
|
|
118
|
+
className: M("k-input-inner", "!k-overflow-auto", { "k-resize": !C && g !== "none" }),
|
|
118
119
|
ref: a,
|
|
119
120
|
disabled: r,
|
|
120
|
-
rows:
|
|
121
|
-
placeholder:
|
|
122
|
-
readOnly:
|
|
123
|
-
required:
|
|
124
|
-
tabIndex:
|
|
125
|
-
|
|
126
|
-
"
|
|
127
|
-
"aria-
|
|
121
|
+
rows: K,
|
|
122
|
+
placeholder: Q,
|
|
123
|
+
readOnly: j,
|
|
124
|
+
required: f,
|
|
125
|
+
tabIndex: me(W, r),
|
|
126
|
+
autoFocus: N,
|
|
127
|
+
style: C ? { resize: "none", overflow: "hidden", height: te } : g ? { resize: g } : {},
|
|
128
|
+
"aria-labelledby": D,
|
|
129
|
+
"aria-describedby": $,
|
|
128
130
|
"aria-multiline": !0,
|
|
129
131
|
"aria-disabled": r || void 0,
|
|
130
|
-
value:
|
|
131
|
-
...
|
|
132
|
-
onChange:
|
|
132
|
+
value: s ? m : V,
|
|
133
|
+
...X,
|
|
134
|
+
onChange: oe,
|
|
133
135
|
onFocus: ne,
|
|
134
|
-
onBlur:
|
|
136
|
+
onBlur: se
|
|
135
137
|
};
|
|
136
138
|
return /* @__PURE__ */ t.createElement(
|
|
137
139
|
"span",
|
|
138
140
|
{
|
|
139
|
-
className:
|
|
141
|
+
className: M(
|
|
140
142
|
"k-input",
|
|
141
143
|
"k-textarea",
|
|
142
144
|
{
|
|
143
|
-
[`k-input-${
|
|
145
|
+
[`k-input-${O.sizeMap[d] || d}`]: d,
|
|
144
146
|
[`k-input-${k}`]: k,
|
|
145
|
-
[`k-rounded-${
|
|
146
|
-
"k-invalid": !(
|
|
147
|
-
"k-required":
|
|
147
|
+
[`k-rounded-${O.roundedMap[c] || c}`]: c,
|
|
148
|
+
"k-invalid": !(v || P !== void 0 || P === !0),
|
|
149
|
+
"k-required": f,
|
|
148
150
|
"k-disabled": r
|
|
149
151
|
},
|
|
150
|
-
|
|
152
|
+
L
|
|
151
153
|
),
|
|
152
|
-
style:
|
|
153
|
-
dir:
|
|
154
|
+
style: U,
|
|
155
|
+
dir: re
|
|
154
156
|
},
|
|
155
|
-
|
|
156
|
-
/* @__PURE__ */ t.createElement("textarea", { ...
|
|
157
|
-
|
|
157
|
+
n.prefix && /* @__PURE__ */ t.createElement(Y, { ...Z }),
|
|
158
|
+
/* @__PURE__ */ t.createElement("textarea", { ...le }),
|
|
159
|
+
n.suffix && /* @__PURE__ */ t.createElement(_, { ...ee })
|
|
158
160
|
);
|
|
159
161
|
});
|
|
160
|
-
|
|
162
|
+
S.propTypes = {
|
|
161
163
|
ariaDescribedBy: e.string,
|
|
162
164
|
ariaLabelledBy: e.string,
|
|
163
165
|
autoSize: e.bool,
|
|
@@ -183,15 +185,17 @@ w.propTypes = {
|
|
|
183
185
|
size: e.oneOf([null, "small", "medium", "large"]),
|
|
184
186
|
rounded: e.oneOf([null, "small", "medium", "large", "full"]),
|
|
185
187
|
fillMode: e.oneOf([null, "solid", "flat", "outline"]),
|
|
186
|
-
resizable: e.oneOf(["none", "both", "horizontal", "vertical"])
|
|
188
|
+
resizable: e.oneOf(["none", "both", "horizontal", "vertical"]),
|
|
189
|
+
autoFocus: e.bool
|
|
187
190
|
};
|
|
188
|
-
const
|
|
191
|
+
const u = {
|
|
189
192
|
size: "medium",
|
|
190
193
|
rounded: "medium",
|
|
191
|
-
fillMode: "solid"
|
|
194
|
+
fillMode: "solid",
|
|
195
|
+
autoFocus: !1
|
|
192
196
|
};
|
|
193
|
-
|
|
197
|
+
S.displayName = "KendoTextArea";
|
|
194
198
|
export {
|
|
195
|
-
|
|
196
|
-
|
|
199
|
+
S as TextArea,
|
|
200
|
+
pe as TextAreaPropsContext
|
|
197
201
|
};
|
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 E=require("react"),
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react"),c=require("prop-types"),o=require("@progress/kendo-react-common"),P=require("../package-metadata.js");function q(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,a.get?a:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const t=q(E),f=t.forwardRef((e,r)=>{o.validatePackage(P.packageMetadata);const n=t.useRef(null),a=t.useRef(null),s=t.useRef(),v=t.useCallback(()=>{var u;return s.current!==void 0?s.current:(u=n.current)==null?void 0:u.value},[]);t.useImperativeHandle(a,()=>({get element(){return n.current},get name(){return n.current&&n.current.name},get value(){return v()}})),t.useImperativeHandle(r,()=>a.current);const{size:i=l.size,fillMode:m=l.fillMode,rounded:d=l.rounded,autoFocus:k=l.autoFocus,className:p,dir:x,style:h,prefix:b=l.prefix,suffix:C=l.suffix,valid:z,modified:N,touched:j,visited:D,...y}=e,[M]=o.useCustomComponent(b),[F]=o.useCustomComponent(C),[_,g]=t.useState(!1),B=u=>{g(!0)},O=u=>{g(!1)},R=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:a.current}),s.current=void 0},[e.onChange]),{onFocus:T,onBlur:S}=o.useAsyncFocusBlur({onFocus:B,onBlur:O,onSyncFocus:e.onFocus,onSyncBlur:e.onBlur});return t.createElement("span",{style:h,dir:x,className:o.classNames("k-textbox k-input",{[`k-input-${o.kendoThemeMaps.sizeMap[i]||i}`]:i,[`k-input-${m}`]:m,[`k-rounded-${o.kendoThemeMaps.roundedMap[d]||d}`]:d},{"k-focus":_,"k-required":e.required,"k-disabled":e.disabled,"k-invalid":e.valid===!1},p),onFocus:T,onBlur:S},t.createElement(M,null),t.createElement("input",{ref:n,className:"k-input-inner",autoFocus:k,...y,onChange:R}),t.createElement(F,null))}),l={prefix:e=>null,suffix:e=>null,size:"medium",rounded:"medium",fillMode:"solid",autoFocus:!1};f.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};f.displayName="KendoReactTextBoxComponent";exports.TextBox=f;
|
package/textbox/Textbox.mjs
CHANGED
|
@@ -7,26 +7,26 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as e from "react";
|
|
10
|
-
import
|
|
11
|
-
import { validatePackage as
|
|
12
|
-
import { packageMetadata as
|
|
10
|
+
import a from "prop-types";
|
|
11
|
+
import { validatePackage as P, useCustomComponent as f, useAsyncFocusBlur as S, classNames as O, kendoThemeMaps as m } from "@progress/kendo-react-common";
|
|
12
|
+
import { packageMetadata as $ } from "../package-metadata.mjs";
|
|
13
13
|
const v = e.forwardRef((n, g) => {
|
|
14
|
-
|
|
15
|
-
const
|
|
14
|
+
P($);
|
|
15
|
+
const l = e.useRef(null), r = e.useRef(null), o = e.useRef(), k = e.useCallback(
|
|
16
16
|
() => {
|
|
17
17
|
var t;
|
|
18
|
-
return
|
|
18
|
+
return o.current !== void 0 ? o.current : (t = l.current) == null ? void 0 : t.value;
|
|
19
19
|
},
|
|
20
20
|
[]
|
|
21
21
|
);
|
|
22
22
|
e.useImperativeHandle(
|
|
23
|
-
|
|
23
|
+
r,
|
|
24
24
|
() => ({
|
|
25
25
|
get element() {
|
|
26
|
-
return
|
|
26
|
+
return l.current;
|
|
27
27
|
},
|
|
28
28
|
get name() {
|
|
29
|
-
return
|
|
29
|
+
return l.current && l.current.name;
|
|
30
30
|
},
|
|
31
31
|
get value() {
|
|
32
32
|
return k();
|
|
@@ -34,89 +34,93 @@ const v = e.forwardRef((n, g) => {
|
|
|
34
34
|
})
|
|
35
35
|
), e.useImperativeHandle(
|
|
36
36
|
g,
|
|
37
|
-
() =>
|
|
37
|
+
() => r.current
|
|
38
38
|
);
|
|
39
39
|
const {
|
|
40
|
-
size:
|
|
41
|
-
fillMode:
|
|
42
|
-
rounded:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
40
|
+
size: s = u.size,
|
|
41
|
+
fillMode: c = u.fillMode,
|
|
42
|
+
rounded: i = u.rounded,
|
|
43
|
+
autoFocus: x = u.autoFocus,
|
|
44
|
+
className: h,
|
|
45
|
+
dir: p,
|
|
46
|
+
style: C,
|
|
47
|
+
prefix: F = u.prefix,
|
|
48
|
+
suffix: y = u.suffix,
|
|
49
|
+
valid: q,
|
|
49
50
|
// Destruct to avoid warning when used inside a form field
|
|
50
|
-
modified:
|
|
51
|
-
touched:
|
|
52
|
-
visited:
|
|
51
|
+
modified: H,
|
|
52
|
+
touched: I,
|
|
53
|
+
visited: w,
|
|
53
54
|
...B
|
|
54
|
-
} = n, [M] = f(
|
|
55
|
-
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
},
|
|
55
|
+
} = n, [M] = f(F), [E] = f(y), [R, d] = e.useState(!1), _ = (t) => {
|
|
56
|
+
d(!0);
|
|
57
|
+
}, b = (t) => {
|
|
58
|
+
d(!1);
|
|
59
|
+
}, z = e.useCallback(
|
|
59
60
|
(t) => {
|
|
60
|
-
|
|
61
|
+
o.current = t.target.value, n.onChange && n.onChange.call(void 0, {
|
|
61
62
|
syntheticEvent: t,
|
|
62
63
|
nativeEvent: t.nativeEvent,
|
|
63
64
|
value: t.target.value,
|
|
64
|
-
target:
|
|
65
|
-
}),
|
|
65
|
+
target: r.current
|
|
66
|
+
}), o.current = void 0;
|
|
66
67
|
},
|
|
67
68
|
[n.onChange]
|
|
68
|
-
), { onFocus:
|
|
69
|
-
onFocus:
|
|
70
|
-
onBlur:
|
|
69
|
+
), { onFocus: N, onBlur: T } = S({
|
|
70
|
+
onFocus: _,
|
|
71
|
+
onBlur: b,
|
|
71
72
|
onSyncFocus: n.onFocus,
|
|
72
73
|
onSyncBlur: n.onBlur
|
|
73
74
|
});
|
|
74
75
|
return /* @__PURE__ */ e.createElement(
|
|
75
76
|
"span",
|
|
76
77
|
{
|
|
77
|
-
style:
|
|
78
|
-
dir:
|
|
79
|
-
className:
|
|
78
|
+
style: C,
|
|
79
|
+
dir: p,
|
|
80
|
+
className: O(
|
|
80
81
|
"k-textbox k-input",
|
|
81
82
|
{
|
|
82
|
-
[`k-input-${m.sizeMap[
|
|
83
|
-
[`k-input-${
|
|
84
|
-
[`k-rounded-${m.roundedMap[
|
|
83
|
+
[`k-input-${m.sizeMap[s] || s}`]: s,
|
|
84
|
+
[`k-input-${c}`]: c,
|
|
85
|
+
[`k-rounded-${m.roundedMap[i] || i}`]: i
|
|
85
86
|
},
|
|
86
87
|
{
|
|
87
|
-
"k-focus":
|
|
88
|
+
"k-focus": R,
|
|
88
89
|
"k-required": n.required,
|
|
89
90
|
"k-disabled": n.disabled,
|
|
90
91
|
"k-invalid": n.valid === !1
|
|
91
92
|
},
|
|
92
|
-
|
|
93
|
+
h
|
|
93
94
|
),
|
|
94
|
-
onFocus:
|
|
95
|
-
onBlur:
|
|
95
|
+
onFocus: N,
|
|
96
|
+
onBlur: T
|
|
96
97
|
},
|
|
97
98
|
/* @__PURE__ */ e.createElement(M, null),
|
|
98
99
|
/* @__PURE__ */ e.createElement(
|
|
99
100
|
"input",
|
|
100
101
|
{
|
|
101
|
-
ref:
|
|
102
|
+
ref: l,
|
|
102
103
|
className: "k-input-inner",
|
|
104
|
+
autoFocus: x,
|
|
103
105
|
...B,
|
|
104
|
-
onChange:
|
|
106
|
+
onChange: z
|
|
105
107
|
}
|
|
106
108
|
),
|
|
107
109
|
/* @__PURE__ */ e.createElement(E, null)
|
|
108
110
|
);
|
|
109
|
-
}),
|
|
111
|
+
}), u = {
|
|
110
112
|
prefix: (n) => null,
|
|
111
113
|
suffix: (n) => null,
|
|
112
114
|
size: "medium",
|
|
113
115
|
rounded: "medium",
|
|
114
|
-
fillMode: "solid"
|
|
116
|
+
fillMode: "solid",
|
|
117
|
+
autoFocus: !1
|
|
115
118
|
};
|
|
116
119
|
v.propTypes = {
|
|
117
|
-
size:
|
|
118
|
-
rounded:
|
|
119
|
-
fillMode:
|
|
120
|
+
size: a.oneOf([null, "small", "medium", "large"]),
|
|
121
|
+
rounded: a.oneOf([null, "small", "medium", "large", "full"]),
|
|
122
|
+
fillMode: a.oneOf([null, "solid", "flat", "outline"]),
|
|
123
|
+
autoFocus: a.bool
|
|
120
124
|
};
|
|
121
125
|
v.displayName = "KendoReactTextBoxComponent";
|
|
122
126
|
export {
|