@progress/kendo-react-inputs 13.4.0-develop.2 → 13.4.0-develop.3
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.mjs +22 -22
- package/colors/ColorGradient.mjs +4 -4
- package/colors/ColorPicker.mjs +11 -11
- package/colors/FlatColorPicker.mjs +11 -11
- 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.mjs +14 -14
- package/numerictextbox/NumericTextBox.mjs +7 -7
- 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.mjs +12 -12
- package/slider/Slider.d.ts +12 -78
- package/slider/Slider.js +1 -1
- package/slider/Slider.mjs +241 -191
- package/switch/Switch.d.ts +9 -124
- package/switch/Switch.js +1 -1
- package/switch/Switch.mjs +187 -209
- package/textarea/TextArea.mjs +20 -20
- package/textbox/Textbox.mjs +18 -18
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 strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),X=require("prop-types"),i=require("@progress/kendo-react-common"),Y=require("@progress/kendo-react-intl"),S=require("../messages/index.js");function z(e){const u=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const c in e)if(c!=="default"){const m=Object.getOwnPropertyDescriptor(e,c);Object.defineProperty(u,c,m.get?m:{enumerable:!0,get:()=>e[c]})}}return u.default=e,Object.freeze(u)}const d=z(n),t=z(X),l={disabled:!1,defaultChecked:!1,size:void 0,trackRounded:void 0,thumbRounded:void 0,offLabel:"OFF",onBlur:i.noop,onFocus:i.noop,onLabel:"ON",validityStyles:!0},M=d.forwardRef((e,u)=>{var P;const{disabled:c=l.disabled,defaultChecked:m=l.defaultChecked,size:v=l.size,trackRounded:y=l.trackRounded,thumbRounded:g=l.thumbRounded,offLabel:x=l.offLabel,onBlur:C=l.onBlur,onFocus:w=l.onFocus,onLabel:L=l.onLabel}=e,[E,j]=n.useState(m||!1),[V,O]=n.useState(!1),o=n.useRef(null),I=n.useRef(null),R=n.useRef(null),b=n.useRef(void 0),q=n.useRef(void 0),B=n.useRef(void 0),D=n.useMemo(()=>new Y.LocalizationService,[]),s=n.useMemo(()=>b.current!==void 0?b.current:e.checked!==void 0?e.checked:E,[e.checked,E]),f=n.useMemo(()=>{var T,F;const a=e.validationMessage!==void 0,r=(T=e.valid)!=null?T:e.required?!!s:!0,U=(F=e.valid)!=null?F:r;return{customError:a,valid:U,valueMissing:s===null}},[e.valid,e.validationMessage,e.required,s]),_=(P=e.validityStyles)!=null?P:l.validityStyles;n.useEffect(()=>{var a;(a=R.current)!=null&&a.setCustomValidity&&R.current.setCustomValidity(f.valid?"":e.validationMessage||D.toLanguageString(S.switchValidation,S.messages[S.switchValidation]))},[f,e.validationMessage,D]),n.useEffect(()=>{o.current&&(B.current=e.dir||getComputedStyle(o.current).direction||void 0)},[e.dir]);const h=n.useCallback(()=>({props:e,get element(){return o.current},get actionElement(){return I.current},get value(){return s},get name(){return e.name},get validity(){return f}}),[e,s,f]),k=n.useCallback((a,r)=>{j(a),b.current=a,i.dispatchEvent(e.onChange,r,{...h(),value:a},{value:a}),b.current=void 0},[e.onChange,h]),W=n.useCallback(a=>{q.current!==a.timeStamp&&(q.current=a.timeStamp,k(!s,a))},[s,k]),H=n.useCallback(a=>{if(c)return;const{keyCode:r}=a;(r===i.Keys.space||r===i.Keys.enter)&&(k(!s,a),a.preventDefault())},[c,s,k]),$=n.useCallback(a=>{c||(O(!0),w&&w(a))},[c,w]),p=n.useCallback(a=>{c||(O(!1),C&&C(a))},[c,C]);n.useImperativeHandle(u,h,[h]);const A=B.current||e.dir||o.current&&getComputedStyle(o.current).direction||void 0,G=!_||f.valid,J=i.classNames("k-switch",{[`k-switch-${i.kendoThemeMaps.sizeMap[v]||v}`]:v,"k-switch-on":s,"k-switch-off":!s,"k-focus":V,"k-disabled":c,"k-invalid":!G},e.className),Q=d.createElement("input",{type:"checkbox",checked:e.checked,ref:R,tabIndex:-1,"aria-hidden":!0,value:s,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"},onChange:i.noop,name:e.name||void 0});return d.createElement("span",{ref:I,role:"switch","aria-checked":s,"aria-disabled":c||void 0,"aria-labelledby":e.ariaLabelledBy,"aria-describedby":e.ariaDescribedBy,"aria-label":e.ariaLabel,"aria-required":e.required,className:J,dir:A,onKeyDown:H,onClick:W,onBlur:p,onFocus:$,tabIndex:i.getTabIndex(e.tabIndex,c,void 0),accessKey:e.accessKey,id:e.id},d.createElement("span",{className:i.classNames("k-switch-track",{[`k-rounded-${i.kendoThemeMaps.roundedMap[y]||y}`]:y}),ref:o},Q,L?d.createElement("span",{className:"k-switch-label-on"},L):"",x?d.createElement("span",{className:"k-switch-label-off"},x):""),d.createElement("span",{className:"k-switch-thumb-wrap"},d.createElement("span",{className:i.classNames("k-switch-thumb",{[`k-rounded-${i.kendoThemeMaps.roundedMap[g]||g}`]:g})})))});M.displayName="Switch";const K=i.createPropsContext(),N=i.withIdHOC(i.withPropsContext(K,M));N.displayName="KendoReactSwitch";N.propTypes={accessKey:t.string,checked:t.bool,className:t.string,defaultChecked:t.bool,defaultValue:t.any,disabled:t.bool,dir:t.string,id:t.string,size:t.oneOf(["small","medium","large"]),trackRounded:t.oneOf(["small","medium","large","full"]),thumbRounded:t.oneOf(["small","medium","large","full"]),ariaDescribedBy:t.string,ariaLabelledBy:t.string,ariaLabel:t.string,offLabel:t.node,onBlur:t.func,onChange:t.func,onFocus:t.func,onLabel:t.node,tabIndex:t.number,value:t.any,name:t.string,required:t.bool,valid:t.bool,validationMessage:t.string,validityStyles:t.bool};exports.Switch=N;exports.SwitchPropsContext=K;exports.SwitchWithoutContext=M;
|
package/switch/Switch.mjs
CHANGED
|
@@ -5,232 +5,210 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
style: { opacity: 0, width: 1, border: 0, zIndex: -1, position: "absolute", left: "50%" },
|
|
41
|
-
onChange: h,
|
|
42
|
-
name: this.name || void 0
|
|
43
|
-
}
|
|
44
|
-
), this.handleClick = (e) => {
|
|
45
|
-
this.eventTimeStamp !== e.timeStamp && (this.eventTimeStamp = e.timeStamp, this.toggle(!this.value, e));
|
|
46
|
-
}, this.handleKeyDown = (e) => {
|
|
47
|
-
if (this.props.disabled)
|
|
48
|
-
return;
|
|
49
|
-
const { keyCode: i } = e;
|
|
50
|
-
(i === v.space || i === v.enter) && (this.toggle(!this.value, e), e.preventDefault());
|
|
51
|
-
}, this.handleWrapperFocus = (e) => {
|
|
52
|
-
if (this.props.disabled)
|
|
53
|
-
return;
|
|
54
|
-
this.setState({ focused: !0 });
|
|
55
|
-
const { onFocus: i } = this.props;
|
|
56
|
-
i && i.call(void 0, e);
|
|
57
|
-
}, this.handleWrapperBlur = (e) => {
|
|
58
|
-
if (this.props.disabled)
|
|
59
|
-
return;
|
|
60
|
-
this.setState({ focused: !1 });
|
|
61
|
-
const { onBlur: i } = this.props;
|
|
62
|
-
i && i.call(void 0, e);
|
|
63
|
-
}, this.state = {
|
|
64
|
-
checked: r.defaultChecked || a.defaultProps.defaultChecked,
|
|
65
|
-
focused: !1
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Gets the value of the Switch.
|
|
70
|
-
*/
|
|
71
|
-
get value() {
|
|
72
|
-
return this.valueDuringOnChange !== void 0 ? this.valueDuringOnChange : this.props.checked !== void 0 ? this.props.checked : this.state.checked;
|
|
73
|
-
}
|
|
74
|
-
get element() {
|
|
75
|
-
return this._element;
|
|
76
|
-
}
|
|
77
|
-
get actionElement() {
|
|
78
|
-
return this._wrapper;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Gets the `name` property of the Switch.
|
|
82
|
-
*/
|
|
83
|
-
get name() {
|
|
84
|
-
return this.props.name;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Represents the validity state into which the Switch is set.
|
|
88
|
-
*/
|
|
89
|
-
get validity() {
|
|
90
|
-
const r = this.props.validationMessage !== void 0, e = this.props.valid !== void 0 ? this.props.valid : this.props.required ? !!this.value : !0, i = this.props.valid !== void 0 ? this.props.valid : e;
|
|
8
|
+
import * as r from "react";
|
|
9
|
+
import { useState as q, useRef as o, useMemo as C, useEffect as P, useCallback as s, useImperativeHandle as ae } from "react";
|
|
10
|
+
import * as t from "prop-types";
|
|
11
|
+
import { withIdHOC as ne, withPropsContext as ie, createPropsContext as de, noop as L, dispatchEvent as re, Keys as T, classNames as R, kendoThemeMaps as S, getTabIndex as le } from "@progress/kendo-react-common";
|
|
12
|
+
import { LocalizationService as ce } from "@progress/kendo-react-intl";
|
|
13
|
+
import { switchValidation as V, messages as oe } from "../messages/index.mjs";
|
|
14
|
+
const i = {
|
|
15
|
+
disabled: !1,
|
|
16
|
+
defaultChecked: !1,
|
|
17
|
+
size: void 0,
|
|
18
|
+
trackRounded: void 0,
|
|
19
|
+
thumbRounded: void 0,
|
|
20
|
+
offLabel: "OFF",
|
|
21
|
+
onBlur: L,
|
|
22
|
+
onFocus: L,
|
|
23
|
+
onLabel: "ON",
|
|
24
|
+
validityStyles: !0
|
|
25
|
+
}, H = r.forwardRef((e, $) => {
|
|
26
|
+
var z;
|
|
27
|
+
const {
|
|
28
|
+
disabled: d = i.disabled,
|
|
29
|
+
defaultChecked: j = i.defaultChecked,
|
|
30
|
+
size: b = i.size,
|
|
31
|
+
trackRounded: v = i.trackRounded,
|
|
32
|
+
thumbRounded: y = i.thumbRounded,
|
|
33
|
+
offLabel: N = i.offLabel,
|
|
34
|
+
onBlur: k = i.onBlur,
|
|
35
|
+
onFocus: g = i.onFocus,
|
|
36
|
+
onLabel: x = i.onLabel
|
|
37
|
+
} = e, [E, A] = q(j || !1), [G, M] = q(!1), l = o(null), B = o(null), w = o(null), m = o(void 0), I = o(void 0), F = o(void 0), D = C(() => new ce(), []), n = C(() => m.current !== void 0 ? m.current : e.checked !== void 0 ? e.checked : E, [e.checked, E]), u = C(() => {
|
|
38
|
+
var K, O;
|
|
39
|
+
const a = e.validationMessage !== void 0, c = (K = e.valid) != null ? K : e.required ? !!n : !0, te = (O = e.valid) != null ? O : c;
|
|
91
40
|
return {
|
|
92
|
-
customError:
|
|
93
|
-
valid:
|
|
94
|
-
valueMissing:
|
|
41
|
+
customError: a,
|
|
42
|
+
valid: te,
|
|
43
|
+
valueMissing: n === null
|
|
95
44
|
};
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
45
|
+
}, [e.valid, e.validationMessage, e.required, n]), J = (z = e.validityStyles) != null ? z : i.validityStyles;
|
|
46
|
+
P(() => {
|
|
47
|
+
var a;
|
|
48
|
+
(a = w.current) != null && a.setCustomValidity && w.current.setCustomValidity(
|
|
49
|
+
u.valid ? "" : e.validationMessage || D.toLanguageString(V, oe[V])
|
|
50
|
+
);
|
|
51
|
+
}, [u, e.validationMessage, D]), P(() => {
|
|
52
|
+
l.current && (F.current = e.dir || getComputedStyle(l.current).direction || void 0);
|
|
53
|
+
}, [e.dir]);
|
|
54
|
+
const f = s(() => ({
|
|
55
|
+
props: e,
|
|
56
|
+
get element() {
|
|
57
|
+
return l.current;
|
|
58
|
+
},
|
|
59
|
+
get actionElement() {
|
|
60
|
+
return B.current;
|
|
61
|
+
},
|
|
62
|
+
get value() {
|
|
63
|
+
return n;
|
|
64
|
+
},
|
|
65
|
+
get name() {
|
|
66
|
+
return e.name;
|
|
67
|
+
},
|
|
68
|
+
get validity() {
|
|
69
|
+
return u;
|
|
70
|
+
}
|
|
71
|
+
}), [e, n, u]), h = s(
|
|
72
|
+
(a, c) => {
|
|
73
|
+
A(a), m.current = a, re(
|
|
74
|
+
e.onChange,
|
|
75
|
+
c,
|
|
76
|
+
{ ...f(), value: a },
|
|
77
|
+
{ value: a }
|
|
78
|
+
), m.current = void 0;
|
|
79
|
+
},
|
|
80
|
+
[e.onChange, f]
|
|
81
|
+
), Q = s(
|
|
82
|
+
(a) => {
|
|
83
|
+
I.current !== a.timeStamp && (I.current = a.timeStamp, h(!n, a));
|
|
84
|
+
},
|
|
85
|
+
[n, h]
|
|
86
|
+
), U = s(
|
|
87
|
+
(a) => {
|
|
88
|
+
if (d)
|
|
89
|
+
return;
|
|
90
|
+
const { keyCode: c } = a;
|
|
91
|
+
(c === T.space || c === T.enter) && (h(!n, a), a.preventDefault());
|
|
92
|
+
},
|
|
93
|
+
[d, n, h]
|
|
94
|
+
), X = s(
|
|
95
|
+
(a) => {
|
|
96
|
+
d || (M(!0), g && g(a));
|
|
97
|
+
},
|
|
98
|
+
[d, g]
|
|
99
|
+
), Y = s(
|
|
100
|
+
(a) => {
|
|
101
|
+
d || (M(!1), k && k(a));
|
|
102
|
+
},
|
|
103
|
+
[d, k]
|
|
104
|
+
);
|
|
105
|
+
ae($, f, [f]);
|
|
106
|
+
const Z = F.current || e.dir || l.current && getComputedStyle(l.current).direction || void 0, _ = !J || u.valid, p = R(
|
|
107
|
+
"k-switch",
|
|
108
|
+
{
|
|
109
|
+
[`k-switch-${S.sizeMap[b] || b}`]: b,
|
|
110
|
+
"k-switch-on": n,
|
|
111
|
+
"k-switch-off": !n,
|
|
112
|
+
"k-focus": G,
|
|
113
|
+
"k-disabled": d,
|
|
114
|
+
"k-invalid": !_
|
|
115
|
+
},
|
|
116
|
+
e.className
|
|
117
|
+
), ee = /* @__PURE__ */ r.createElement(
|
|
118
|
+
"input",
|
|
119
|
+
{
|
|
120
|
+
type: "checkbox",
|
|
121
|
+
checked: e.checked,
|
|
122
|
+
ref: w,
|
|
123
|
+
tabIndex: -1,
|
|
124
|
+
"aria-hidden": !0,
|
|
125
|
+
value: n,
|
|
126
|
+
style: { opacity: 0, width: 1, border: 0, zIndex: -1, position: "absolute", left: "50%" },
|
|
127
|
+
onChange: L,
|
|
128
|
+
name: e.name || void 0
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
return /* @__PURE__ */ r.createElement(
|
|
132
|
+
"span",
|
|
133
|
+
{
|
|
134
|
+
ref: B,
|
|
135
|
+
role: "switch",
|
|
136
|
+
"aria-checked": n,
|
|
137
|
+
"aria-disabled": d || void 0,
|
|
138
|
+
"aria-labelledby": e.ariaLabelledBy,
|
|
139
|
+
"aria-describedby": e.ariaDescribedBy,
|
|
140
|
+
"aria-label": e.ariaLabel,
|
|
141
|
+
"aria-required": e.required,
|
|
142
|
+
className: p,
|
|
143
|
+
dir: Z,
|
|
144
|
+
onKeyDown: U,
|
|
145
|
+
onClick: Q,
|
|
146
|
+
onBlur: Y,
|
|
147
|
+
onFocus: X,
|
|
148
|
+
tabIndex: le(e.tabIndex, d, void 0),
|
|
149
|
+
accessKey: e.accessKey,
|
|
150
|
+
id: e.id
|
|
151
|
+
},
|
|
152
|
+
/* @__PURE__ */ r.createElement(
|
|
153
|
+
"span",
|
|
129
154
|
{
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
"k-disabled": i,
|
|
135
|
-
"k-invalid": !y
|
|
155
|
+
className: R("k-switch-track", {
|
|
156
|
+
[`k-rounded-${S.roundedMap[v] || v}`]: v
|
|
157
|
+
}),
|
|
158
|
+
ref: l
|
|
136
159
|
},
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
"
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
"aria-describedby": this.props.ariaDescribedBy,
|
|
143
|
-
"aria-label": this.props.ariaLabel,
|
|
144
|
-
"aria-required": this.props.required
|
|
145
|
-
};
|
|
146
|
-
return /* @__PURE__ */ s.createElement(
|
|
160
|
+
ee,
|
|
161
|
+
x ? /* @__PURE__ */ r.createElement("span", { className: "k-switch-label-on" }, x) : "",
|
|
162
|
+
N ? /* @__PURE__ */ r.createElement("span", { className: "k-switch-label-off" }, N) : ""
|
|
163
|
+
),
|
|
164
|
+
/* @__PURE__ */ r.createElement("span", { className: "k-switch-thumb-wrap" }, /* @__PURE__ */ r.createElement(
|
|
147
165
|
"span",
|
|
148
166
|
{
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
"span",
|
|
166
|
-
{
|
|
167
|
-
className: p("k-switch-track", {
|
|
168
|
-
[`k-rounded-${c.roundedMap[d] || d}`]: d
|
|
169
|
-
}),
|
|
170
|
-
ref: (n) => {
|
|
171
|
-
this._element = n;
|
|
172
|
-
}
|
|
173
|
-
},
|
|
174
|
-
this.dummyInput(this.value),
|
|
175
|
-
f ? /* @__PURE__ */ s.createElement("span", { className: "k-switch-label-on" }, f) : "",
|
|
176
|
-
m ? /* @__PURE__ */ s.createElement("span", { className: "k-switch-label-off" }, m) : ""
|
|
177
|
-
),
|
|
178
|
-
/* @__PURE__ */ s.createElement("span", { className: "k-switch-thumb-wrap" }, /* @__PURE__ */ s.createElement(
|
|
179
|
-
"span",
|
|
180
|
-
{
|
|
181
|
-
className: p("k-switch-thumb", {
|
|
182
|
-
[`k-rounded-${c.roundedMap[o] || o}`]: o
|
|
183
|
-
})
|
|
184
|
-
}
|
|
185
|
-
))
|
|
186
|
-
);
|
|
187
|
-
}
|
|
188
|
-
};
|
|
189
|
-
a.displayName = "Switch", a.propTypes = {
|
|
167
|
+
className: R("k-switch-thumb", {
|
|
168
|
+
[`k-rounded-${S.roundedMap[y] || y}`]: y
|
|
169
|
+
})
|
|
170
|
+
}
|
|
171
|
+
))
|
|
172
|
+
);
|
|
173
|
+
});
|
|
174
|
+
H.displayName = "Switch";
|
|
175
|
+
const se = de(), W = ne(
|
|
176
|
+
ie(
|
|
177
|
+
se,
|
|
178
|
+
H
|
|
179
|
+
)
|
|
180
|
+
);
|
|
181
|
+
W.displayName = "KendoReactSwitch";
|
|
182
|
+
W.propTypes = {
|
|
190
183
|
accessKey: t.string,
|
|
191
184
|
checked: t.bool,
|
|
192
185
|
className: t.string,
|
|
193
|
-
disabled: t.bool,
|
|
194
186
|
defaultChecked: t.bool,
|
|
187
|
+
defaultValue: t.any,
|
|
188
|
+
disabled: t.bool,
|
|
189
|
+
dir: t.string,
|
|
190
|
+
id: t.string,
|
|
195
191
|
size: t.oneOf(["small", "medium", "large"]),
|
|
196
192
|
trackRounded: t.oneOf(["small", "medium", "large", "full"]),
|
|
197
193
|
thumbRounded: t.oneOf(["small", "medium", "large", "full"]),
|
|
198
|
-
dir: t.string,
|
|
199
|
-
id: t.string,
|
|
200
|
-
ariaLabelledBy: t.string,
|
|
201
194
|
ariaDescribedBy: t.string,
|
|
202
|
-
|
|
203
|
-
|
|
195
|
+
ariaLabelledBy: t.string,
|
|
196
|
+
ariaLabel: t.string,
|
|
197
|
+
offLabel: t.node,
|
|
198
|
+
onBlur: t.func,
|
|
199
|
+
onChange: t.func,
|
|
200
|
+
onFocus: t.func,
|
|
201
|
+
onLabel: t.node,
|
|
204
202
|
tabIndex: t.number,
|
|
203
|
+
value: t.any,
|
|
204
|
+
name: t.string,
|
|
205
|
+
required: t.bool,
|
|
205
206
|
valid: t.bool,
|
|
206
|
-
validate: t.bool,
|
|
207
207
|
validationMessage: t.string,
|
|
208
|
-
|
|
209
|
-
onChange: t.any,
|
|
210
|
-
onFocus: t.any,
|
|
211
|
-
onLabel: t.string
|
|
212
|
-
}, a.defaultProps = {
|
|
213
|
-
disabled: !1,
|
|
214
|
-
defaultChecked: !1,
|
|
215
|
-
size: void 0,
|
|
216
|
-
trackRounded: void 0,
|
|
217
|
-
thumbRounded: void 0,
|
|
218
|
-
offLabel: "OFF",
|
|
219
|
-
onBlur: h,
|
|
220
|
-
onFocus: h,
|
|
221
|
-
onLabel: "ON",
|
|
222
|
-
validityStyles: !0
|
|
208
|
+
validityStyles: t.bool
|
|
223
209
|
};
|
|
224
|
-
let u = a;
|
|
225
|
-
const B = N(), O = C(
|
|
226
|
-
S(
|
|
227
|
-
B,
|
|
228
|
-
u
|
|
229
|
-
)
|
|
230
|
-
);
|
|
231
|
-
O.displayName = "KendoReactSwitch";
|
|
232
210
|
export {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
211
|
+
W as Switch,
|
|
212
|
+
se as SwitchPropsContext,
|
|
213
|
+
H as SwitchWithoutContext
|
|
236
214
|
};
|
package/textarea/TextArea.mjs
CHANGED
|
@@ -17,19 +17,19 @@ const ke = be(), R = t.forwardRef(($, q) => {
|
|
|
17
17
|
flow: b = n.flow,
|
|
18
18
|
prefix: L = null,
|
|
19
19
|
suffix: j = null,
|
|
20
|
-
ariaDescribedBy:
|
|
21
|
-
ariaLabelledBy:
|
|
20
|
+
ariaDescribedBy: _,
|
|
21
|
+
ariaLabelledBy: K,
|
|
22
22
|
autoSize: u,
|
|
23
|
-
className:
|
|
24
|
-
defaultValue:
|
|
23
|
+
className: G,
|
|
24
|
+
defaultValue: J,
|
|
25
25
|
disabled: o,
|
|
26
|
-
readOnly:
|
|
26
|
+
readOnly: Q,
|
|
27
27
|
required: d,
|
|
28
|
-
rows:
|
|
29
|
-
id:
|
|
30
|
-
name:
|
|
31
|
-
placeholder:
|
|
32
|
-
style:
|
|
28
|
+
rows: U,
|
|
29
|
+
id: W,
|
|
30
|
+
name: X,
|
|
31
|
+
placeholder: Y,
|
|
32
|
+
style: Z,
|
|
33
33
|
tabIndex: ee,
|
|
34
34
|
value: x,
|
|
35
35
|
valid: w,
|
|
@@ -50,7 +50,7 @@ const ke = be(), R = t.forwardRef(($, q) => {
|
|
|
50
50
|
a.current && a.current.focus();
|
|
51
51
|
}, []), T = t.useCallback(() => {
|
|
52
52
|
a.current && a.current.blur();
|
|
53
|
-
}, []), [E, M] = t.useState(
|
|
53
|
+
}, []), [E, M] = t.useState(J), [oe, P] = t.useState(!1), [re, se] = B(L), [le, ne] = B(j), c = x !== void 0, f = c ? x : E, s = t.useCallback(() => ({
|
|
54
54
|
element: a,
|
|
55
55
|
focus: O,
|
|
56
56
|
blur: T,
|
|
@@ -103,9 +103,9 @@ const ke = be(), R = t.forwardRef(($, q) => {
|
|
|
103
103
|
...I
|
|
104
104
|
};
|
|
105
105
|
}, [u, l, V, I]), pe = {
|
|
106
|
-
id:
|
|
106
|
+
id: W || ie,
|
|
107
107
|
role: "textbox",
|
|
108
|
-
name:
|
|
108
|
+
name: X,
|
|
109
109
|
className: N("k-input-inner", "!k-overflow-auto", {
|
|
110
110
|
"k-resize": !u && l !== "none",
|
|
111
111
|
"k-resize-none": u || l === "none",
|
|
@@ -113,15 +113,15 @@ const ke = be(), R = t.forwardRef(($, q) => {
|
|
|
113
113
|
}),
|
|
114
114
|
ref: a,
|
|
115
115
|
disabled: o,
|
|
116
|
-
rows:
|
|
117
|
-
placeholder:
|
|
118
|
-
readOnly:
|
|
116
|
+
rows: U,
|
|
117
|
+
placeholder: Y,
|
|
118
|
+
readOnly: Q,
|
|
119
119
|
required: d,
|
|
120
120
|
tabIndex: ye(ee, o),
|
|
121
121
|
autoFocus: D,
|
|
122
122
|
style: me,
|
|
123
|
-
"aria-labelledby":
|
|
124
|
-
"aria-describedby":
|
|
123
|
+
"aria-labelledby": K,
|
|
124
|
+
"aria-describedby": _,
|
|
125
125
|
"aria-multiline": !0,
|
|
126
126
|
"aria-disabled": o || void 0,
|
|
127
127
|
"aria-required": d,
|
|
@@ -148,9 +148,9 @@ const ke = be(), R = t.forwardRef(($, q) => {
|
|
|
148
148
|
"!k-flex-col": b === "vertical",
|
|
149
149
|
"!k-flex-row": b === "horizontal"
|
|
150
150
|
},
|
|
151
|
-
|
|
151
|
+
G
|
|
152
152
|
),
|
|
153
|
-
style:
|
|
153
|
+
style: Z,
|
|
154
154
|
dir: ue
|
|
155
155
|
},
|
|
156
156
|
i.prefix && /* @__PURE__ */ t.createElement(re, { ...se }),
|
package/textbox/Textbox.mjs
CHANGED
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
import * as e from "react";
|
|
9
9
|
import a from "prop-types";
|
|
10
10
|
import { useUnstyled as j, useCustomComponent as x, useAsyncFocusBlur as H, classNames as g, kendoThemeMaps as h, uTextBox as w } from "@progress/kendo-react-common";
|
|
11
|
-
const
|
|
12
|
-
const o = e.useRef(null), i = e.useRef(null),
|
|
11
|
+
const _ = e.forwardRef((t, C) => {
|
|
12
|
+
const o = e.useRef(null), i = e.useRef(null), l = e.useRef(void 0), c = j(), k = c && c.uTextBox, y = e.useCallback(() => {
|
|
13
13
|
var n;
|
|
14
|
-
return
|
|
14
|
+
return l.current !== void 0 ? l.current : (n = o.current) == null ? void 0 : n.value;
|
|
15
15
|
}, []);
|
|
16
16
|
e.useImperativeHandle(i, () => ({
|
|
17
17
|
get element() {
|
|
@@ -21,15 +21,15 @@ const C = e.forwardRef((t, k) => {
|
|
|
21
21
|
return o.current && o.current.name;
|
|
22
22
|
},
|
|
23
23
|
get value() {
|
|
24
|
-
return
|
|
24
|
+
return y();
|
|
25
25
|
}
|
|
26
|
-
})), e.useImperativeHandle(
|
|
26
|
+
})), e.useImperativeHandle(C, () => i.current);
|
|
27
27
|
const {
|
|
28
|
-
size:
|
|
28
|
+
size: s = u.size,
|
|
29
29
|
fillMode: d = u.fillMode,
|
|
30
30
|
rounded: r = u.rounded,
|
|
31
|
-
autoFocus:
|
|
32
|
-
inputAttributes:
|
|
31
|
+
autoFocus: B = u.autoFocus,
|
|
32
|
+
inputAttributes: F,
|
|
33
33
|
className: f,
|
|
34
34
|
dir: b,
|
|
35
35
|
style: M,
|
|
@@ -52,12 +52,12 @@ const C = e.forwardRef((t, k) => {
|
|
|
52
52
|
v(!1);
|
|
53
53
|
}, A = e.useCallback(
|
|
54
54
|
(n) => {
|
|
55
|
-
|
|
55
|
+
l.current = n.target.value, t.onChange && t.onChange.call(void 0, {
|
|
56
56
|
syntheticEvent: n,
|
|
57
57
|
nativeEvent: n.nativeEvent,
|
|
58
58
|
value: n.target.value,
|
|
59
59
|
target: i.current
|
|
60
|
-
}),
|
|
60
|
+
}), l.current = void 0;
|
|
61
61
|
},
|
|
62
62
|
[t.onChange]
|
|
63
63
|
), { onFocus: I, onBlur: P } = H({
|
|
@@ -70,7 +70,7 @@ const C = e.forwardRef((t, k) => {
|
|
|
70
70
|
"k-input",
|
|
71
71
|
"k-textbox",
|
|
72
72
|
{
|
|
73
|
-
[`k-input-${h.sizeMap[
|
|
73
|
+
[`k-input-${h.sizeMap[s] || s}`]: s,
|
|
74
74
|
[`k-input-${d}`]: d,
|
|
75
75
|
[`k-rounded-${h.roundedMap[r] || r}`]: r,
|
|
76
76
|
"k-focus": m,
|
|
@@ -80,15 +80,15 @@ const C = e.forwardRef((t, k) => {
|
|
|
80
80
|
},
|
|
81
81
|
f
|
|
82
82
|
),
|
|
83
|
-
[f, d, m, t.disabled, t.required, t.valid, r,
|
|
83
|
+
[f, d, m, t.disabled, t.required, t.valid, r, s]
|
|
84
84
|
);
|
|
85
85
|
return /* @__PURE__ */ e.createElement("span", { style: M, dir: b, className: $, onFocus: I, onBlur: P }, /* @__PURE__ */ e.createElement(T, null), /* @__PURE__ */ e.createElement(
|
|
86
86
|
"input",
|
|
87
87
|
{
|
|
88
88
|
ref: o,
|
|
89
|
-
className: g(w.inputInner({ c:
|
|
90
|
-
autoFocus:
|
|
91
|
-
...Object.assign({}, R,
|
|
89
|
+
className: g(w.inputInner({ c: k })),
|
|
90
|
+
autoFocus: B,
|
|
91
|
+
...Object.assign({}, R, F),
|
|
92
92
|
"aria-required": t.required,
|
|
93
93
|
onChange: A
|
|
94
94
|
}
|
|
@@ -101,14 +101,14 @@ const C = e.forwardRef((t, k) => {
|
|
|
101
101
|
fillMode: void 0,
|
|
102
102
|
autoFocus: !1
|
|
103
103
|
};
|
|
104
|
-
|
|
104
|
+
_.propTypes = {
|
|
105
105
|
size: a.oneOf(["small", "medium", "large"]),
|
|
106
106
|
rounded: a.oneOf(["small", "medium", "large", "full"]),
|
|
107
107
|
fillMode: a.oneOf(["solid", "flat", "outline"]),
|
|
108
108
|
autoFocus: a.bool,
|
|
109
109
|
inputAttributes: a.object
|
|
110
110
|
};
|
|
111
|
-
|
|
111
|
+
_.displayName = "KendoReactTextBoxComponent";
|
|
112
112
|
export {
|
|
113
|
-
|
|
113
|
+
_ as TextBox
|
|
114
114
|
};
|