@progress/kendo-react-inputs 13.4.0-develop.4 → 14.0.0-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/checkbox/Checkbox.js +1 -1
- package/checkbox/Checkbox.mjs +133 -118
- package/colors/ColorPalette.d.ts +20 -81
- package/colors/ColorPalette.js +1 -1
- package/colors/ColorPalette.mjs +207 -181
- package/colors/interfaces/ColorPaletteChangeEvent.d.ts +2 -2
- package/colors/interfaces/ColorPaletteHandle.d.ts +46 -0
- package/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/index.d.mts +2 -1
- package/index.d.ts +2 -1
- package/input/Input.js +1 -1
- package/input/Input.mjs +120 -101
- package/maskedtextbox/MaskedTextBox.d.ts +6 -0
- package/maskedtextbox/MaskedTextBox.js +1 -1
- package/maskedtextbox/MaskedTextBox.mjs +82 -61
- package/numerictextbox/NumericTextBox.js +1 -1
- package/numerictextbox/NumericTextBox.mjs +251 -227
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +1 -1
- package/package.json +10 -10
- package/switch/Switch.js +1 -1
- package/switch/Switch.mjs +109 -90
- package/textarea/TextArea.js +1 -1
- package/textarea/TextArea.mjs +131 -115
- package/textbox/Textbox.js +1 -1
- package/textbox/Textbox.mjs +77 -62
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-inputs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.0-develop.1",
|
|
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": "
|
|
32
|
-
"@progress/kendo-react-buttons": "
|
|
33
|
-
"@progress/kendo-react-common": "
|
|
34
|
-
"@progress/kendo-react-dialogs": "
|
|
35
|
-
"@progress/kendo-react-layout": "
|
|
36
|
-
"@progress/kendo-react-intl": "
|
|
37
|
-
"@progress/kendo-react-labels": "
|
|
38
|
-
"@progress/kendo-react-popup": "
|
|
31
|
+
"@progress/kendo-react-animation": "14.0.0-develop.1",
|
|
32
|
+
"@progress/kendo-react-buttons": "14.0.0-develop.1",
|
|
33
|
+
"@progress/kendo-react-common": "14.0.0-develop.1",
|
|
34
|
+
"@progress/kendo-react-dialogs": "14.0.0-develop.1",
|
|
35
|
+
"@progress/kendo-react-layout": "14.0.0-develop.1",
|
|
36
|
+
"@progress/kendo-react-intl": "14.0.0-develop.1",
|
|
37
|
+
"@progress/kendo-react-labels": "14.0.0-develop.1",
|
|
38
|
+
"@progress/kendo-react-popup": "14.0.0-develop.1",
|
|
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": 1770382872,
|
|
86
86
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
87
87
|
}
|
|
88
88
|
},
|
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 n=require("react"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),Y=require("prop-types"),i=require("@progress/kendo-react-common"),Z=require("@progress/kendo-react-intl"),N=require("../messages/index.js");function z(e){const f=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const h=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(f,s,h.get?h:{enumerable:!0,get:()=>e[s]})}}return f.default=e,Object.freeze(f)}const d=z(n),t=z(Y),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},x=d.forwardRef((e,f)=>{var F;const{disabled:s=l.disabled,defaultChecked:h=l.defaultChecked,size:C=l.size,trackRounded:w=l.trackRounded,thumbRounded:R=l.thumbRounded,offLabel:O=l.offLabel,onBlur:S=l.onBlur,onFocus:M=l.onFocus,onLabel:T=l.onLabel}=e,[I,V]=n.useState(h||!1),[_,P]=n.useState(!1),o=n.useRef(null),m=n.useRef(null),E=n.useRef(null),v=n.useRef(void 0),q=n.useRef(void 0),B=n.useRef(void 0),D=n.useMemo(()=>new Z.LocalizationService,[]),c=n.useMemo(()=>v.current!==void 0?v.current:e.checked!==void 0?e.checked:I,[e.checked,I]),b=n.useMemo(()=>{var g,K;const a=e.validationMessage!==void 0,r=(g=e.valid)!=null?g:e.required?!!c:!0,y=(K=e.valid)!=null?K:r;return{customError:a,valid:y,valueMissing:c===null}},[e.valid,e.validationMessage,e.required,c]),W=(F=e.validityStyles)!=null?F:l.validityStyles;n.useEffect(()=>{var a;(a=E.current)!=null&&a.setCustomValidity&&E.current.setCustomValidity(b.valid?"":e.validationMessage||D.toLanguageString(N.switchValidation,N.messages[N.switchValidation]))},[b,e.validationMessage,D]),n.useEffect(()=>{o.current&&(B.current=e.dir||getComputedStyle(o.current).direction||void 0)},[e.dir]);const k=n.useCallback(()=>({props:e,get element(){return o.current},get actionElement(){return m.current},get value(){return c},get name(){return e.name},get validity(){return b}}),[e,c,b]),u=n.useCallback((a,r)=>{V(a),v.current=a,i.dispatchEvent(e.onChange,r,{...k(),value:a},{value:a}),v.current=void 0},[e.onChange,k]);n.useEffect(()=>{const a=e.name||e.id,r=i.subscribeToKendoPaste(m.current,{fieldName:a,onValueChange:y=>{if(y!==c){const g={target:m.current,currentTarget:m.current,nativeEvent:new Event("change",{bubbles:!0})};u(y,g)}}});return()=>{r==null||r.unsubscribe()}},[e.name,e.id,c,u]);const H=n.useCallback(a=>{q.current!==a.timeStamp&&(q.current=a.timeStamp,u(!c,a))},[c,u]),$=n.useCallback(a=>{if(s)return;const{keyCode:r}=a;(r===i.Keys.space||r===i.Keys.enter)&&(u(!c,a),a.preventDefault())},[s,c,u]),A=n.useCallback(a=>{s||(P(!0),M&&M(a))},[s,M]),G=n.useCallback(a=>{s||(P(!1),S&&S(a))},[s,S]);n.useImperativeHandle(f,k,[k]);const J=B.current||e.dir||o.current&&getComputedStyle(o.current).direction||void 0,Q=!W||b.valid,U=i.classNames("k-switch",{[`k-switch-${i.kendoThemeMaps.sizeMap[C]||C}`]:C,"k-switch-on":c,"k-switch-off":!c,"k-focus":_,"k-disabled":s,"k-invalid":!Q},e.className),X=d.createElement("input",{type:"checkbox",checked:e.checked,ref:E,tabIndex:-1,"aria-hidden":!0,value:c,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:m,role:"switch","aria-checked":c,"aria-disabled":s||void 0,"aria-labelledby":e.ariaLabelledBy,"aria-describedby":e.ariaDescribedBy,"aria-label":e.ariaLabel,"aria-required":e.required,className:U,dir:J,onKeyDown:$,onClick:H,onBlur:G,onFocus:A,tabIndex:i.getTabIndex(e.tabIndex,s,void 0),accessKey:e.accessKey,id:e.id},d.createElement("span",{className:i.classNames("k-switch-track",{[`k-rounded-${i.kendoThemeMaps.roundedMap[w]||w}`]:w}),ref:o},X,T?d.createElement("span",{className:"k-switch-label-on"},T):"",O?d.createElement("span",{className:"k-switch-label-off"},O):""),d.createElement("span",{className:"k-switch-thumb-wrap"},d.createElement("span",{className:i.classNames("k-switch-thumb",{[`k-rounded-${i.kendoThemeMaps.roundedMap[R]||R}`]:R})})))});x.displayName="Switch";const j=i.createPropsContext(),L=i.withIdHOC(i.withPropsContext(j,x));L.displayName="KendoReactSwitch";L.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=L;exports.SwitchPropsContext=j;exports.SwitchWithoutContext=x;
|
package/switch/Switch.mjs
CHANGED
|
@@ -5,59 +5,59 @@
|
|
|
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 { useState as q, useRef as
|
|
8
|
+
import * as c from "react";
|
|
9
|
+
import { useState as q, useRef as s, useMemo as E, useEffect as L, useCallback as u, useImperativeHandle as ae } from "react";
|
|
10
10
|
import * as t from "prop-types";
|
|
11
|
-
import { withIdHOC as ne, withPropsContext as ie, createPropsContext as de, noop as
|
|
12
|
-
import { LocalizationService as
|
|
13
|
-
import { switchValidation as
|
|
14
|
-
const
|
|
11
|
+
import { withIdHOC as ne, withPropsContext as ie, createPropsContext as de, noop as M, dispatchEvent as re, subscribeToKendoPaste as ce, Keys as V, classNames as N, kendoThemeMaps as x, getTabIndex as le } from "@progress/kendo-react-common";
|
|
12
|
+
import { LocalizationService as oe } from "@progress/kendo-react-intl";
|
|
13
|
+
import { switchValidation as H, messages as se } from "../messages/index.mjs";
|
|
14
|
+
const d = {
|
|
15
15
|
disabled: !1,
|
|
16
16
|
defaultChecked: !1,
|
|
17
17
|
size: void 0,
|
|
18
18
|
trackRounded: void 0,
|
|
19
19
|
thumbRounded: void 0,
|
|
20
20
|
offLabel: "OFF",
|
|
21
|
-
onBlur:
|
|
22
|
-
onFocus:
|
|
21
|
+
onBlur: M,
|
|
22
|
+
onFocus: M,
|
|
23
23
|
onLabel: "ON",
|
|
24
24
|
validityStyles: !0
|
|
25
|
-
},
|
|
26
|
-
var
|
|
25
|
+
}, W = c.forwardRef((e, j) => {
|
|
26
|
+
var T;
|
|
27
27
|
const {
|
|
28
|
-
disabled:
|
|
29
|
-
defaultChecked:
|
|
30
|
-
size:
|
|
31
|
-
trackRounded:
|
|
32
|
-
thumbRounded:
|
|
33
|
-
offLabel:
|
|
34
|
-
onBlur:
|
|
35
|
-
onFocus:
|
|
36
|
-
onLabel:
|
|
37
|
-
} = e, [
|
|
38
|
-
var
|
|
39
|
-
const a = e.validationMessage !== void 0,
|
|
28
|
+
disabled: r = d.disabled,
|
|
29
|
+
defaultChecked: A = d.defaultChecked,
|
|
30
|
+
size: g = d.size,
|
|
31
|
+
trackRounded: k = d.trackRounded,
|
|
32
|
+
thumbRounded: w = d.thumbRounded,
|
|
33
|
+
offLabel: B = d.offLabel,
|
|
34
|
+
onBlur: C = d.onBlur,
|
|
35
|
+
onFocus: R = d.onFocus,
|
|
36
|
+
onLabel: I = d.onLabel
|
|
37
|
+
} = e, [F, G] = q(A || !1), [J, D] = q(!1), l = s(null), m = s(null), S = s(null), b = s(void 0), K = s(void 0), z = s(void 0), O = E(() => new oe(), []), n = E(() => b.current !== void 0 ? b.current : e.checked !== void 0 ? e.checked : F, [e.checked, F]), f = E(() => {
|
|
38
|
+
var y, P;
|
|
39
|
+
const a = e.validationMessage !== void 0, i = (y = e.valid) != null ? y : e.required ? !!n : !0, v = (P = e.valid) != null ? P : i;
|
|
40
40
|
return {
|
|
41
41
|
customError: a,
|
|
42
|
-
valid:
|
|
42
|
+
valid: v,
|
|
43
43
|
valueMissing: n === null
|
|
44
44
|
};
|
|
45
|
-
}, [e.valid, e.validationMessage, e.required, n]),
|
|
46
|
-
|
|
45
|
+
}, [e.valid, e.validationMessage, e.required, n]), Q = (T = e.validityStyles) != null ? T : d.validityStyles;
|
|
46
|
+
L(() => {
|
|
47
47
|
var a;
|
|
48
|
-
(a =
|
|
49
|
-
|
|
48
|
+
(a = S.current) != null && a.setCustomValidity && S.current.setCustomValidity(
|
|
49
|
+
f.valid ? "" : e.validationMessage || O.toLanguageString(H, se[H])
|
|
50
50
|
);
|
|
51
|
-
}, [
|
|
52
|
-
l.current && (
|
|
51
|
+
}, [f, e.validationMessage, O]), L(() => {
|
|
52
|
+
l.current && (z.current = e.dir || getComputedStyle(l.current).direction || void 0);
|
|
53
53
|
}, [e.dir]);
|
|
54
|
-
const
|
|
54
|
+
const h = u(() => ({
|
|
55
55
|
props: e,
|
|
56
56
|
get element() {
|
|
57
57
|
return l.current;
|
|
58
58
|
},
|
|
59
59
|
get actionElement() {
|
|
60
|
-
return
|
|
60
|
+
return m.current;
|
|
61
61
|
},
|
|
62
62
|
get value() {
|
|
63
63
|
return n;
|
|
@@ -66,120 +66,139 @@ const i = {
|
|
|
66
66
|
return e.name;
|
|
67
67
|
},
|
|
68
68
|
get validity() {
|
|
69
|
-
return
|
|
69
|
+
return f;
|
|
70
70
|
}
|
|
71
|
-
}), [e, n,
|
|
72
|
-
(a,
|
|
73
|
-
|
|
71
|
+
}), [e, n, f]), o = u(
|
|
72
|
+
(a, i) => {
|
|
73
|
+
G(a), b.current = a, re(
|
|
74
74
|
e.onChange,
|
|
75
|
-
|
|
76
|
-
{ ...
|
|
75
|
+
i,
|
|
76
|
+
{ ...h(), value: a },
|
|
77
77
|
{ value: a }
|
|
78
|
-
),
|
|
78
|
+
), b.current = void 0;
|
|
79
79
|
},
|
|
80
|
-
[e.onChange,
|
|
81
|
-
)
|
|
80
|
+
[e.onChange, h]
|
|
81
|
+
);
|
|
82
|
+
L(() => {
|
|
83
|
+
const a = e.name || e.id, i = ce(m.current, {
|
|
84
|
+
fieldName: a,
|
|
85
|
+
onValueChange: (v) => {
|
|
86
|
+
if (v !== n) {
|
|
87
|
+
const y = {
|
|
88
|
+
target: m.current,
|
|
89
|
+
currentTarget: m.current,
|
|
90
|
+
nativeEvent: new Event("change", { bubbles: !0 })
|
|
91
|
+
};
|
|
92
|
+
o(v, y);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
return () => {
|
|
97
|
+
i == null || i.unsubscribe();
|
|
98
|
+
};
|
|
99
|
+
}, [e.name, e.id, n, o]);
|
|
100
|
+
const U = u(
|
|
82
101
|
(a) => {
|
|
83
|
-
|
|
102
|
+
K.current !== a.timeStamp && (K.current = a.timeStamp, o(!n, a));
|
|
84
103
|
},
|
|
85
|
-
[n,
|
|
86
|
-
),
|
|
104
|
+
[n, o]
|
|
105
|
+
), X = u(
|
|
87
106
|
(a) => {
|
|
88
|
-
if (
|
|
107
|
+
if (r)
|
|
89
108
|
return;
|
|
90
|
-
const { keyCode:
|
|
91
|
-
(
|
|
109
|
+
const { keyCode: i } = a;
|
|
110
|
+
(i === V.space || i === V.enter) && (o(!n, a), a.preventDefault());
|
|
92
111
|
},
|
|
93
|
-
[
|
|
94
|
-
),
|
|
112
|
+
[r, n, o]
|
|
113
|
+
), Y = u(
|
|
95
114
|
(a) => {
|
|
96
|
-
|
|
115
|
+
r || (D(!0), R && R(a));
|
|
97
116
|
},
|
|
98
|
-
[
|
|
99
|
-
),
|
|
117
|
+
[r, R]
|
|
118
|
+
), Z = u(
|
|
100
119
|
(a) => {
|
|
101
|
-
|
|
120
|
+
r || (D(!1), C && C(a));
|
|
102
121
|
},
|
|
103
|
-
[
|
|
122
|
+
[r, C]
|
|
104
123
|
);
|
|
105
|
-
ae(
|
|
106
|
-
const
|
|
124
|
+
ae(j, h, [h]);
|
|
125
|
+
const _ = z.current || e.dir || l.current && getComputedStyle(l.current).direction || void 0, p = !Q || f.valid, ee = N(
|
|
107
126
|
"k-switch",
|
|
108
127
|
{
|
|
109
|
-
[`k-switch-${
|
|
128
|
+
[`k-switch-${x.sizeMap[g] || g}`]: g,
|
|
110
129
|
"k-switch-on": n,
|
|
111
130
|
"k-switch-off": !n,
|
|
112
|
-
"k-focus":
|
|
113
|
-
"k-disabled":
|
|
114
|
-
"k-invalid": !
|
|
131
|
+
"k-focus": J,
|
|
132
|
+
"k-disabled": r,
|
|
133
|
+
"k-invalid": !p
|
|
115
134
|
},
|
|
116
135
|
e.className
|
|
117
|
-
),
|
|
136
|
+
), te = /* @__PURE__ */ c.createElement(
|
|
118
137
|
"input",
|
|
119
138
|
{
|
|
120
139
|
type: "checkbox",
|
|
121
140
|
checked: e.checked,
|
|
122
|
-
ref:
|
|
141
|
+
ref: S,
|
|
123
142
|
tabIndex: -1,
|
|
124
143
|
"aria-hidden": !0,
|
|
125
144
|
value: n,
|
|
126
145
|
style: { opacity: 0, width: 1, border: 0, zIndex: -1, position: "absolute", left: "50%" },
|
|
127
|
-
onChange:
|
|
146
|
+
onChange: M,
|
|
128
147
|
name: e.name || void 0
|
|
129
148
|
}
|
|
130
149
|
);
|
|
131
|
-
return /* @__PURE__ */
|
|
150
|
+
return /* @__PURE__ */ c.createElement(
|
|
132
151
|
"span",
|
|
133
152
|
{
|
|
134
|
-
ref:
|
|
153
|
+
ref: m,
|
|
135
154
|
role: "switch",
|
|
136
155
|
"aria-checked": n,
|
|
137
|
-
"aria-disabled":
|
|
156
|
+
"aria-disabled": r || void 0,
|
|
138
157
|
"aria-labelledby": e.ariaLabelledBy,
|
|
139
158
|
"aria-describedby": e.ariaDescribedBy,
|
|
140
159
|
"aria-label": e.ariaLabel,
|
|
141
160
|
"aria-required": e.required,
|
|
142
|
-
className:
|
|
143
|
-
dir:
|
|
144
|
-
onKeyDown:
|
|
145
|
-
onClick:
|
|
146
|
-
onBlur:
|
|
147
|
-
onFocus:
|
|
148
|
-
tabIndex: le(e.tabIndex,
|
|
161
|
+
className: ee,
|
|
162
|
+
dir: _,
|
|
163
|
+
onKeyDown: X,
|
|
164
|
+
onClick: U,
|
|
165
|
+
onBlur: Z,
|
|
166
|
+
onFocus: Y,
|
|
167
|
+
tabIndex: le(e.tabIndex, r, void 0),
|
|
149
168
|
accessKey: e.accessKey,
|
|
150
169
|
id: e.id
|
|
151
170
|
},
|
|
152
|
-
/* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ c.createElement(
|
|
153
172
|
"span",
|
|
154
173
|
{
|
|
155
|
-
className:
|
|
156
|
-
[`k-rounded-${
|
|
174
|
+
className: N("k-switch-track", {
|
|
175
|
+
[`k-rounded-${x.roundedMap[k] || k}`]: k
|
|
157
176
|
}),
|
|
158
177
|
ref: l
|
|
159
178
|
},
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
179
|
+
te,
|
|
180
|
+
I ? /* @__PURE__ */ c.createElement("span", { className: "k-switch-label-on" }, I) : "",
|
|
181
|
+
B ? /* @__PURE__ */ c.createElement("span", { className: "k-switch-label-off" }, B) : ""
|
|
163
182
|
),
|
|
164
|
-
/* @__PURE__ */
|
|
183
|
+
/* @__PURE__ */ c.createElement("span", { className: "k-switch-thumb-wrap" }, /* @__PURE__ */ c.createElement(
|
|
165
184
|
"span",
|
|
166
185
|
{
|
|
167
|
-
className:
|
|
168
|
-
[`k-rounded-${
|
|
186
|
+
className: N("k-switch-thumb", {
|
|
187
|
+
[`k-rounded-${x.roundedMap[w] || w}`]: w
|
|
169
188
|
})
|
|
170
189
|
}
|
|
171
190
|
))
|
|
172
191
|
);
|
|
173
192
|
});
|
|
174
|
-
|
|
175
|
-
const
|
|
193
|
+
W.displayName = "Switch";
|
|
194
|
+
const ue = de(), $ = ne(
|
|
176
195
|
ie(
|
|
177
|
-
|
|
178
|
-
|
|
196
|
+
ue,
|
|
197
|
+
W
|
|
179
198
|
)
|
|
180
199
|
);
|
|
181
|
-
|
|
182
|
-
|
|
200
|
+
$.displayName = "KendoReactSwitch";
|
|
201
|
+
$.propTypes = {
|
|
183
202
|
accessKey: t.string,
|
|
184
203
|
checked: t.bool,
|
|
185
204
|
className: t.string,
|
|
@@ -208,7 +227,7 @@ W.propTypes = {
|
|
|
208
227
|
validityStyles: t.bool
|
|
209
228
|
};
|
|
210
229
|
export {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
230
|
+
$ as Switch,
|
|
231
|
+
ue as SwitchPropsContext,
|
|
232
|
+
W as SwitchWithoutContext
|
|
214
233
|
};
|
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 strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const pe=require("react"),e=require("prop-types"),r=require("@progress/kendo-react-common");function ge(l){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const s in l)if(s!=="default"){const u=Object.getOwnPropertyDescriptor(l,s);Object.defineProperty(c,s,u.get?u:{enumerable:!0,get:()=>l[s]})}}return c.default=l,Object.freeze(c)}const a=ge(pe),$=r.createPropsContext(),T=a.forwardRef((l,c)=>{const s=r.usePropsContext($,l),{size:u=m.size,rounded:x=m.rounded,fillMode:S=m.fillMode,autoFocus:K=m.autoFocus,flow:h=m.flow,prefix:L=null,suffix:_=null,ariaDescribedBy:G,ariaLabelledBy:J,autoSize:b,className:Q,defaultValue:U,disabled:o,readOnly:W,required:p,rows:X,id:w,name:E,placeholder:Y,style:Z,tabIndex:ee,value:y,valid:M,validationMessage:F,validityStyles:V,onChange:k,onFocus:C,onBlur:z,visited:ve,touched:xe,modified:he,resizable:d,inputAttributes:te,textareaStyle:A,...ae}=s,t=a.useRef(null),I=a.useCallback(()=>{t.current&&t.current.focus()},[]),N=a.useCallback(()=>{t.current&&t.current.blur()},[]),[B,j]=a.useState(U),[re,q]=a.useState(!1),[ne,oe]=r.useCustomComponent(L),[se,le]=r.useCustomComponent(_),g=y!==void 0,v=g?y:B,R=E||w,i=a.useCallback(()=>({element:t,focus:I,blur:N,get value(){return v},get name(){return t.current&&t.current.name}}),[N,I,v]);a.useImperativeHandle(c,i);const[D,H]=a.useState("auto"),ue=r.useId(),ie=r.useDir(t,s.dir),O=M!==void 0?M:p?!!v:!0;a.useEffect(()=>{t.current&&t.current.setCustomValidity&&t.current.setCustomValidity(O?"":F||"")},[O,F]),r.useIsomorphicLayoutEffect(()=>{t.current&&H(`${t.current.scrollHeight}px`)},[v]);const P=a.useCallback(n=>{const f=n.target.value;H("auto"),!g&&!o&&j(f),k&&!o&&r.dispatchEvent(k,n,{...i(),value:f},{value:f})},[j,k,o,g]),ce=a.useCallback(n=>{q(!0),C&&!o&&r.dispatchEvent(C,n,i(),void 0)},[C,o,i]),de=a.useCallback(n=>{q(!1),z&&!o&&r.dispatchEvent(z,n,i(),void 0)},[z,o,i]),fe=a.useCallback(n=>{t.current&&(t.current.value=n);const f={target:t.current,currentTarget:t.current};P(f)},[P]);r.useKendoPaste(t,{fieldName:R,onValueChange:fe,enabled:!!R});const me=a.useMemo(()=>{let n={};return b?n={resize:"none",overflow:"hidden",height:D}:d&&(n={resize:d}),{...n,...A}},[b,d,D,A]),be={id:w||ue,role:"textbox",name:E,className:r.classNames("k-input-inner","!k-overflow-auto",{"k-resize":!b&&d!=="none","k-resize-none":b||d==="none","!k-flex-none":h==="vertical"}),ref:t,disabled:o,rows:X,placeholder:Y,readOnly:W,required:p,tabIndex:r.getTabIndex(ee,o),autoFocus:K,style:me,"aria-labelledby":J,"aria-describedby":G,"aria-multiline":!0,"aria-disabled":o||void 0,"aria-required":p,value:g?y:B,...Object.assign({},ae,te),onChange:P,onFocus:ce,onBlur:de};return a.createElement("span",{className:r.classNames("k-input","k-textarea",{[`k-input-${r.kendoThemeMaps.sizeMap[u]||u}`]:u,[`k-input-${S}`]:S,[`k-rounded-${r.kendoThemeMaps.roundedMap[x]||x}`]:x,"k-invalid":!(O||V!==void 0||V===!0),"k-required":p,"k-disabled":o,"k-focus":re,"!k-flex-col":h==="vertical","!k-flex-row":h==="horizontal"},Q),style:Z,dir:ie},s.prefix&&a.createElement(ne,{...oe}),a.createElement("textarea",{...be}),s.suffix&&a.createElement(se,{...le}))});T.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(["small","medium","large"]),rounded:e.oneOf(["small","medium","large","full","none"]),fillMode:e.oneOf(["solid","flat","outline"]),resizable:e.oneOf(["none","both","horizontal","vertical"]),autoFocus:e.bool,flow:e.oneOf(["vertical","horizontal"])};const m={size:void 0,rounded:void 0,fillMode:void 0,autoFocus:!1,flow:"horizontal"};T.displayName="KendoTextArea";exports.TextArea=T;exports.TextAreaPropsContext=$;
|