@progress/kendo-react-inputs 14.5.0-develop.8 → 15.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.
Files changed (58) hide show
  1. package/MaskedTextBoxMcpWrapper.d.ts +17 -0
  2. package/MaskedTextBoxMcpWrapper.js +8 -0
  3. package/MaskedTextBoxMcpWrapper.mjs +18 -0
  4. package/README.md +4 -4
  5. package/checkbox/Checkbox.js +1 -1
  6. package/checkbox/Checkbox.mjs +64 -64
  7. package/colors/ColorGradient.js +1 -1
  8. package/colors/ColorGradient.mjs +74 -72
  9. package/colors/ColorInput.js +1 -1
  10. package/colors/ColorInput.mjs +57 -45
  11. package/colors/ColorPalette.js +1 -1
  12. package/colors/ColorPalette.mjs +84 -81
  13. package/colors/ColorPicker.js +1 -1
  14. package/colors/ColorPicker.mjs +228 -215
  15. package/colors/FlatColorPicker.js +1 -1
  16. package/colors/FlatColorPicker.mjs +86 -94
  17. package/colors/interfaces/ColorPickerProps.d.ts +6 -1
  18. package/dist/cdn/js/kendo-react-inputs.js +1 -1
  19. package/index.d.mts +5 -1
  20. package/index.d.ts +5 -1
  21. package/index.js +1 -1
  22. package/index.mjs +92 -89
  23. package/maskedtextbox/MaskedTextBoxProps.d.ts +6 -1
  24. package/messages/index.d.ts +55 -0
  25. package/messages/index.js +1 -1
  26. package/messages/index.mjs +82 -60
  27. package/numerictextbox/NumericTextBox.js +1 -1
  28. package/numerictextbox/NumericTextBox.mjs +215 -213
  29. package/numerictextbox/interfaces/NumericTextBoxProps.d.ts +6 -1
  30. package/package-metadata.js +1 -1
  31. package/package-metadata.mjs +2 -2
  32. package/package.json +16 -11
  33. package/radiobutton/RadioButton.js +1 -1
  34. package/radiobutton/RadioButton.mjs +23 -20
  35. package/radiobutton/interfaces/RadioButtonProps.d.ts +7 -0
  36. package/range-slider/RangeSlider.d.ts +14 -1
  37. package/range-slider/RangeSlider.js +11 -11
  38. package/range-slider/RangeSlider.mjs +188 -185
  39. package/rating/Rating.d.ts +6 -1
  40. package/rating/Rating.js +3 -3
  41. package/rating/Rating.mjs +83 -76
  42. package/signature/Signature.js +1 -1
  43. package/signature/Signature.mjs +127 -129
  44. package/signature/interfaces/SignatureProps.d.ts +6 -1
  45. package/slider/Slider.d.ts +6 -1
  46. package/slider/Slider.js +1 -1
  47. package/slider/Slider.mjs +155 -150
  48. package/slider/SliderLabel.js +1 -1
  49. package/slider/SliderLabel.mjs +3 -2
  50. package/switch/Switch.d.ts +6 -1
  51. package/switch/Switch.js +1 -1
  52. package/switch/Switch.mjs +100 -100
  53. package/textarea/TextArea.js +1 -1
  54. package/textarea/TextArea.mjs +101 -101
  55. package/textarea/interfaces/TextAreaProps.d.ts +6 -1
  56. package/textbox/Textbox.d.ts +20 -1
  57. package/textbox/Textbox.js +1 -1
  58. package/textbox/Textbox.mjs +92 -81
package/switch/Switch.mjs CHANGED
@@ -5,63 +5,63 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import * as d from "react";
9
- import { useState as q, useRef as u, useMemo as N, useEffect as x, useCallback as f, useImperativeHandle as ie } from "react";
8
+ import * as l from "react";
9
+ import { useState as H, useRef as d, useMemo as E, useEffect as M, useCallback as m, useImperativeHandle as V } from "react";
10
10
  import t from "prop-types";
11
- import { withIdHOC as re, withPropsContext as ce, noop as I, dispatchEvent as de, subscribeToKendoPaste as le, Keys as H, classNames as M, kendoThemeMaps as B, getTabIndex as se, createPropsContext as oe } from "@progress/kendo-react-common";
12
- import { LocalizationService as ue } from "@progress/kendo-react-intl";
13
- import { switchValidation as V, messages as W, switchAriaLabel as $ } from "../messages/index.mjs";
14
- const r = {
11
+ import { withIdHOC as le, withPropsContext as de, noop as B, dispatchEvent as se, subscribeToKendoPaste as oe, Keys as W, useWebMcpRegister as ue, classNames as N, kendoThemeMaps as x, getTabIndex as fe, createPropsContext as me } from "@progress/kendo-react-common";
12
+ import { LocalizationService as be, useLocalization as he } from "@progress/kendo-react-intl";
13
+ import { switchValidation as $, messages as A, switchAriaLabel as j } from "../messages/index.mjs";
14
+ const c = {
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: I,
22
- onFocus: I,
21
+ onBlur: B,
22
+ onFocus: B,
23
23
  onLabel: "ON",
24
24
  validityStyles: !0
25
- }, A = d.forwardRef((e, G) => {
26
- var P;
25
+ }, G = l.forwardRef((e, Q) => {
26
+ var T;
27
27
  const {
28
- disabled: c = r.disabled,
29
- defaultChecked: J = r.defaultChecked,
30
- size: k = r.size,
31
- trackRounded: w = r.trackRounded,
32
- thumbRounded: C = r.thumbRounded,
33
- offLabel: F = r.offLabel,
34
- onBlur: R = r.onBlur,
35
- onFocus: L = r.onFocus,
36
- onLabel: D = r.onLabel
37
- } = e, [K, Q] = q(J || !1), [U, z] = q(!1), l = u(null), s = u(null), b = u(null), h = u(void 0), S = u(!1), O = u(void 0), E = N(() => new ue(), []), n = N(() => h.current !== void 0 ? h.current : e.checked !== void 0 ? e.checked : K, [e.checked, K]), m = N(() => {
38
- var y, T;
39
- const a = e.validationMessage !== void 0, i = (y = e.valid) != null ? y : e.required ? !!n : !0, g = (T = e.valid) != null ? T : i;
28
+ disabled: r = c.disabled,
29
+ defaultChecked: U = c.defaultChecked,
30
+ size: k = c.size,
31
+ trackRounded: w = c.trackRounded,
32
+ thumbRounded: C = c.thumbRounded,
33
+ offLabel: I = c.offLabel,
34
+ onBlur: R = c.onBlur,
35
+ onFocus: L = c.onFocus,
36
+ onLabel: z = c.onLabel
37
+ } = e, [F, X] = H(U || !1), [Y, D] = H(!1), s = d(null), o = d(null), h = d(null), v = d(void 0), S = d(!1), K = d(void 0), O = E(() => new be(), []), Z = he(), n = E(() => v.current !== void 0 ? v.current : e.checked !== void 0 ? e.checked : F, [e.checked, F]), b = E(() => {
38
+ var y, q;
39
+ const a = e.validationMessage !== void 0, i = (y = e.valid) != null ? y : e.required ? !!n : !0, g = (q = e.valid) != null ? q : i;
40
40
  return {
41
41
  customError: a,
42
42
  valid: g,
43
43
  valueMissing: n === null
44
44
  };
45
- }, [e.valid, e.validationMessage, e.required, n]), X = (P = e.validityStyles) != null ? P : r.validityStyles;
46
- x(() => {
45
+ }, [e.valid, e.validationMessage, e.required, n]), _ = (T = e.validityStyles) != null ? T : c.validityStyles;
46
+ M(() => {
47
47
  var a;
48
- (a = b.current) != null && a.setCustomValidity && b.current.setCustomValidity(
49
- m.valid ? "" : e.validationMessage || E.toLanguageString(V, W[V])
48
+ (a = h.current) != null && a.setCustomValidity && h.current.setCustomValidity(
49
+ b.valid ? "" : e.validationMessage || O.toLanguageString($, A[$])
50
50
  );
51
- }, [m, e.validationMessage, E]), x(() => {
52
- l.current && (O.current = e.dir || getComputedStyle(l.current).direction || void 0);
51
+ }, [b, e.validationMessage, O]), M(() => {
52
+ s.current && (K.current = e.dir || getComputedStyle(s.current).direction || void 0);
53
53
  }, [e.dir]);
54
- const v = f(() => ({
54
+ const u = m(() => ({
55
55
  props: e,
56
56
  get element() {
57
- return l.current;
57
+ return s.current;
58
58
  },
59
59
  get actionElement() {
60
- return s.current;
60
+ return o.current;
61
61
  },
62
62
  focus: () => {
63
63
  var a;
64
- (a = s.current) == null || a.focus();
64
+ (a = o.current) == null || a.focus();
65
65
  },
66
66
  get value() {
67
67
  return n;
@@ -70,147 +70,147 @@ const r = {
70
70
  return e.name;
71
71
  },
72
72
  get validity() {
73
- return m;
73
+ return b;
74
74
  }
75
- }), [e, n, m]), o = f(
75
+ }), [e, n, b]), f = m(
76
76
  (a, i) => {
77
- Q(a), h.current = a, de(
77
+ X(a), v.current = a, se(
78
78
  e.onChange,
79
79
  i,
80
- { ...v(), value: a },
80
+ { ...u(), value: a },
81
81
  { value: a }
82
- ), h.current = void 0;
82
+ ), v.current = void 0;
83
83
  },
84
- [e.onChange, v]
84
+ [e.onChange, u]
85
85
  );
86
- x(() => {
87
- const a = e.name || e.id, i = le(s.current, {
86
+ M(() => {
87
+ const a = e.name || e.id, i = oe(o.current, {
88
88
  fieldName: a,
89
89
  onValueChange: (g) => {
90
90
  if (g !== n) {
91
91
  const y = {
92
- target: s.current,
93
- currentTarget: s.current,
92
+ target: o.current,
93
+ currentTarget: o.current,
94
94
  nativeEvent: new Event("change", { bubbles: !0 })
95
95
  };
96
- o(g, y);
96
+ f(g, y);
97
97
  }
98
98
  }
99
99
  });
100
100
  return () => {
101
101
  i == null || i.unsubscribe();
102
102
  };
103
- }, [e.name, e.id, n, o]);
104
- const Y = f(
103
+ }, [e.name, e.id, n, f]);
104
+ const p = m(
105
105
  (a) => {
106
- if (a.target === b.current) {
106
+ if (a.target === h.current) {
107
107
  if (S.current) {
108
108
  S.current = !1;
109
109
  return;
110
110
  }
111
111
  } else
112
112
  S.current = !0;
113
- o(!n, a);
113
+ f(!n, a);
114
114
  },
115
- [n, o]
116
- ), Z = f(
115
+ [n, f]
116
+ ), ee = m(
117
117
  (a) => {
118
- if (c)
118
+ if (r)
119
119
  return;
120
120
  const { keyCode: i } = a;
121
- (i === H.space || i === H.enter) && (o(!n, a), a.preventDefault());
121
+ (i === W.space || i === W.enter) && (f(!n, a), a.preventDefault());
122
122
  },
123
- [c, n, o]
124
- ), _ = f(
123
+ [r, n, f]
124
+ ), te = m(
125
125
  (a) => {
126
- c || (z(!0), L && L(a));
126
+ r || (D(!0), L && L(a));
127
127
  },
128
- [c, L]
129
- ), p = f(
128
+ [r, L]
129
+ ), ae = m(
130
130
  (a) => {
131
- c || (z(!1), R && R(a));
131
+ r || (D(!1), R && R(a));
132
132
  },
133
- [c, R]
133
+ [r, R]
134
134
  );
135
- ie(G, v, [v]);
136
- const ee = O.current || e.dir || l.current && getComputedStyle(l.current).direction || void 0, te = !X || m.valid, ae = M(
135
+ V(Q, u, [u]);
136
+ const P = d(null);
137
+ V(P, u, [u]), ue("switch", P, e, e.webMcp);
138
+ const ne = K.current || e.dir || s.current && getComputedStyle(s.current).direction || void 0, ie = !_ || b.valid, ce = N(
137
139
  "k-switch",
138
140
  {
139
- [`k-switch-${B.sizeMap[k] || k}`]: k,
141
+ [`k-switch-${x.sizeMap[k] || k}`]: k,
140
142
  "k-switch-on": n,
141
143
  "k-switch-off": !n,
142
- "k-focus": U,
143
- "k-disabled": c,
144
- "k-invalid": !te
144
+ "k-focus": Y,
145
+ "k-disabled": r,
146
+ "k-invalid": !ie
145
147
  },
146
148
  e.className
147
- ), ne = /* @__PURE__ */ d.createElement(
149
+ ), re = /* @__PURE__ */ l.createElement(
148
150
  "input",
149
151
  {
150
152
  type: "checkbox",
151
153
  checked: e.checked,
152
- ref: b,
154
+ ref: h,
153
155
  tabIndex: -1,
154
- "aria-hidden": !0,
155
- "aria-label": e.ariaLabel || E.toLanguageString($, W[$]),
156
156
  value: n,
157
157
  style: { opacity: 0, width: 1, border: 0, zIndex: -1, position: "absolute", left: "50%" },
158
- onChange: I,
158
+ onChange: B,
159
159
  name: e.name || void 0
160
160
  }
161
161
  );
162
- return /* @__PURE__ */ d.createElement(
162
+ return /* @__PURE__ */ l.createElement(
163
163
  "span",
164
164
  {
165
- ref: s,
165
+ ref: o,
166
166
  role: "switch",
167
167
  "aria-checked": n,
168
- "aria-disabled": c || void 0,
168
+ "aria-disabled": r || void 0,
169
169
  "aria-labelledby": e.ariaLabelledBy,
170
170
  "aria-describedby": e.ariaDescribedBy,
171
- "aria-label": e.ariaLabel,
171
+ "aria-label": e.ariaLabel || Z.toLanguageString(j, A[j]),
172
172
  "aria-required": e.required,
173
- className: ae,
174
- dir: ee,
175
- onKeyDown: Z,
176
- onClick: Y,
177
- onBlur: p,
178
- onFocus: _,
179
- tabIndex: se(e.tabIndex, c, void 0),
173
+ className: ce,
174
+ dir: ne,
175
+ onKeyDown: ee,
176
+ onClick: p,
177
+ onBlur: ae,
178
+ onFocus: te,
179
+ tabIndex: fe(e.tabIndex, r, void 0),
180
180
  accessKey: e.accessKey,
181
181
  id: e.id
182
182
  },
183
- /* @__PURE__ */ d.createElement(
183
+ /* @__PURE__ */ l.createElement(
184
184
  "span",
185
185
  {
186
- className: M("k-switch-track", {
187
- [`k-rounded-${B.roundedMap[w] || w}`]: w
186
+ className: N("k-switch-track", {
187
+ [`k-rounded-${x.roundedMap[w] || w}`]: w
188
188
  }),
189
- ref: l
189
+ ref: s
190
190
  },
191
- ne,
192
- D ? /* @__PURE__ */ d.createElement("span", { className: "k-switch-label-on" }, D) : "",
193
- F ? /* @__PURE__ */ d.createElement("span", { className: "k-switch-label-off" }, F) : ""
191
+ re,
192
+ z ? /* @__PURE__ */ l.createElement("span", { className: "k-switch-label-on" }, z) : "",
193
+ I ? /* @__PURE__ */ l.createElement("span", { className: "k-switch-label-off" }, I) : ""
194
194
  ),
195
- /* @__PURE__ */ d.createElement("span", { className: "k-switch-thumb-wrap" }, /* @__PURE__ */ d.createElement(
195
+ /* @__PURE__ */ l.createElement("span", { className: "k-switch-thumb-wrap" }, /* @__PURE__ */ l.createElement(
196
196
  "span",
197
197
  {
198
- className: M("k-switch-thumb", {
199
- [`k-rounded-${B.roundedMap[C] || C}`]: C
198
+ className: N("k-switch-thumb", {
199
+ [`k-rounded-${x.roundedMap[C] || C}`]: C
200
200
  })
201
201
  }
202
202
  ))
203
203
  );
204
204
  });
205
- A.displayName = "Switch";
206
- const fe = oe(), j = re(
207
- ce(
208
- fe,
209
- A
205
+ G.displayName = "Switch";
206
+ const ve = me(), J = le(
207
+ de(
208
+ ve,
209
+ G
210
210
  )
211
211
  );
212
- j.displayName = "KendoReactSwitch";
213
- j.propTypes = {
212
+ J.displayName = "KendoReactSwitch";
213
+ J.propTypes = {
214
214
  accessKey: t.string,
215
215
  checked: t.bool,
216
216
  className: t.string,
@@ -239,7 +239,7 @@ j.propTypes = {
239
239
  validityStyles: t.bool
240
240
  };
241
241
  export {
242
- j as Switch,
243
- fe as SwitchPropsContext,
244
- A as SwitchWithoutContext
242
+ J as Switch,
243
+ ve as SwitchPropsContext,
244
+ G as SwitchWithoutContext
245
245
  };
@@ -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 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=$;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ge=require("react"),e=require("prop-types"),n=require("@progress/kendo-react-common");function ve(l){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const o in l)if(o!=="default"){const i=Object.getOwnPropertyDescriptor(l,o);Object.defineProperty(c,o,i.get?i:{enumerable:!0,get:()=>l[o]})}}return c.default=l,Object.freeze(c)}const t=ve(ge),K=n.createPropsContext(),T=t.forwardRef((l,c)=>{const o=n.usePropsContext(K,l),{size:i=m.size,rounded:x=m.rounded,fillMode:S=m.fillMode,autoFocus:L=m.autoFocus,flow:h=m.flow,prefix:_=null,suffix:W=null,ariaDescribedBy:G,ariaLabelledBy:J,autoSize:p,className:Q,defaultValue:U,disabled:s,readOnly:X,required:b,rows:Y,id:M,name:w,placeholder:Z,style:ee,tabIndex:te,value:y,valid:E,validationMessage:F,validityStyles:I,onChange:k,onFocus:C,onBlur:z,visited:xe,touched:he,modified:ye,resizable:d,inputAttributes:ae,textareaStyle:V,...ne}=o,a=t.useRef(null),A=t.useCallback(()=>{a.current&&a.current.focus()},[]),N=t.useCallback(()=>{a.current&&a.current.blur()},[]),[B,R]=t.useState(U),[re,j]=t.useState(!1),[oe,se]=n.useCustomComponent(_),[le,ue]=n.useCustomComponent(W),g=y!==void 0,v=g?y:B,q=w||M,u=t.useCallback(()=>({element:a,focus:A,blur:N,get value(){return v},get name(){return a.current&&a.current.name}}),[N,A,v]);t.useImperativeHandle(c,u);const H=t.useRef(null);t.useImperativeHandle(H,u),n.useWebMcpRegister("textarea",H,o,o.webMcp);const[D,$]=t.useState("auto"),ie=n.useId(),ce=n.useDir(a,o.dir),O=E!==void 0?E:b?!!v:!0;t.useEffect(()=>{a.current&&a.current.setCustomValidity&&a.current.setCustomValidity(O?"":F||"")},[O,F]),n.useIsomorphicLayoutEffect(()=>{a.current&&$(`${a.current.scrollHeight}px`)},[v]);const P=t.useCallback(r=>{const f=r.target.value;$("auto"),!g&&!s&&R(f),k&&!s&&n.dispatchEvent(k,r,{...u(),value:f},{value:f})},[R,k,s,g]),de=t.useCallback(r=>{j(!0),C&&!s&&n.dispatchEvent(C,r,u(),void 0)},[C,s,u]),fe=t.useCallback(r=>{j(!1),z&&!s&&n.dispatchEvent(z,r,u(),void 0)},[z,s,u]),me=t.useCallback(r=>{a.current&&(a.current.value=r);const f={target:a.current,currentTarget:a.current};P(f)},[P]);n.useKendoPaste(a,{fieldName:q,onValueChange:me,enabled:!!q});const pe=t.useMemo(()=>{let r={};return p?r={resize:"none",overflow:"hidden",height:D}:d&&(r={resize:d}),{...r,...V}},[p,d,D,V]),be={id:M||ie,name:w,className:n.classNames("k-input-inner","!k-overflow-auto",{"k-resize":!p&&d!=="none","k-resize-none":p||d==="none","!k-flex-none":h==="vertical"}),ref:a,disabled:s,rows:Y,placeholder:Z,readOnly:X,required:b,tabIndex:n.getTabIndex(te,s),autoFocus:L,style:pe,"aria-labelledby":J,"aria-describedby":G,"aria-disabled":s||void 0,"aria-required":b,value:g?y:B,...Object.assign({},ne,ae),onChange:P,onFocus:de,onBlur:fe};return t.createElement("span",{className:n.classNames("k-input","k-textarea",{[`k-input-${n.kendoThemeMaps.sizeMap[i]||i}`]:i,[`k-input-${S}`]:S,[`k-rounded-${n.kendoThemeMaps.roundedMap[x]||x}`]:x,"k-invalid":!(O||I!==void 0||I===!0),"k-required":b,"k-disabled":s,"k-focus":re,"!k-flex-col":h==="vertical","!k-flex-row":h==="horizontal"},Q),style:ee,dir:ce},o.prefix&&t.createElement(oe,{...se}),t.createElement("textarea",{...be}),o.suffix&&t.createElement(le,{...ue}))});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=K;
@@ -5,176 +5,176 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import * as a from "react";
8
+ import * as t from "react";
9
9
  import e from "prop-types";
10
- import { usePropsContext as ve, useCustomComponent as $, useId as ge, useDir as he, useIsomorphicLayoutEffect as ye, dispatchEvent as z, useKendoPaste as ke, getTabIndex as Ce, classNames as q, kendoThemeMaps as D, createPropsContext as ze } from "@progress/kendo-react-common";
11
- const Pe = ze(), K = a.forwardRef((L, j) => {
12
- const u = ve(Pe, L), {
13
- size: b = i.size,
14
- rounded: p = i.rounded,
15
- fillMode: P = i.fillMode,
10
+ import { usePropsContext as xe, useCustomComponent as q, useWebMcpRegister as he, useId as ye, useDir as ke, useIsomorphicLayoutEffect as Ce, dispatchEvent as z, useKendoPaste as ze, getTabIndex as we, classNames as D, kendoThemeMaps as K, createPropsContext as Pe } from "@progress/kendo-react-common";
11
+ const Fe = Pe(), L = t.forwardRef((j, W) => {
12
+ const s = xe(Fe, j), {
13
+ size: p = i.size,
14
+ rounded: b = i.rounded,
15
+ fillMode: w = i.fillMode,
16
16
  autoFocus: G = i.autoFocus,
17
- flow: x = i.flow,
17
+ flow: v = i.flow,
18
18
  prefix: J = null,
19
19
  suffix: Q = null,
20
20
  ariaDescribedBy: U,
21
- ariaLabelledBy: W,
21
+ ariaLabelledBy: X,
22
22
  autoSize: c,
23
- className: X,
24
- defaultValue: Y,
23
+ className: Y,
24
+ defaultValue: Z,
25
25
  disabled: o,
26
- readOnly: Z,
26
+ readOnly: _,
27
27
  required: d,
28
- rows: _,
29
- id: w,
28
+ rows: ee,
29
+ id: P,
30
30
  name: F,
31
- placeholder: ee,
32
- style: te,
33
- tabIndex: ae,
34
- value: v,
35
- valid: S,
36
- validationMessage: T,
37
- validityStyles: V,
38
- onChange: g,
31
+ placeholder: te,
32
+ style: ae,
33
+ tabIndex: re,
34
+ value: g,
35
+ valid: I,
36
+ validationMessage: M,
37
+ validityStyles: S,
38
+ onChange: x,
39
39
  onFocus: h,
40
40
  onBlur: y,
41
41
  // Removed to support direct use in Form Field component
42
- visited: we,
43
- touched: Fe,
42
+ visited: Ie,
43
+ touched: Me,
44
44
  modified: Se,
45
- resizable: s,
46
- inputAttributes: re,
47
- textareaStyle: E,
48
- ...oe
49
- } = u, t = a.useRef(null), I = a.useCallback(() => {
50
- t.current && t.current.focus();
51
- }, []), O = a.useCallback(() => {
52
- t.current && t.current.blur();
53
- }, []), [B, M] = a.useState(Y), [ne, A] = a.useState(!1), [se, le] = $(J), [ie, ue] = $(Q), f = v !== void 0, m = f ? v : B, N = F || w, n = a.useCallback(() => ({
54
- element: t,
55
- focus: I,
56
- blur: O,
45
+ resizable: l,
46
+ inputAttributes: oe,
47
+ textareaStyle: T,
48
+ ...ne
49
+ } = s, a = t.useRef(null), V = t.useCallback(() => {
50
+ a.current && a.current.focus();
51
+ }, []), E = t.useCallback(() => {
52
+ a.current && a.current.blur();
53
+ }, []), [O, B] = t.useState(Z), [se, A] = t.useState(!1), [le, ue] = q(J), [ie, ce] = q(Q), f = g !== void 0, m = f ? g : O, N = F || P, n = t.useCallback(() => ({
54
+ element: a,
55
+ focus: V,
56
+ blur: E,
57
57
  get value() {
58
58
  return m;
59
59
  },
60
60
  get name() {
61
- return t.current && t.current.name;
61
+ return a.current && a.current.name;
62
62
  }
63
- }), [O, I, m]);
64
- a.useImperativeHandle(j, n);
65
- const [H, R] = a.useState("auto"), ce = ge(), de = he(t, u.dir), k = S !== void 0 ? S : d ? !!m : !0;
66
- a.useEffect(() => {
67
- t.current && t.current.setCustomValidity && t.current.setCustomValidity(k ? "" : T || "");
68
- }, [k, T]), ye(() => {
69
- t.current && R(`${t.current.scrollHeight}px`);
63
+ }), [E, V, m]);
64
+ t.useImperativeHandle(W, n);
65
+ const R = t.useRef(null);
66
+ t.useImperativeHandle(R, n), he("textarea", R, s, s.webMcp);
67
+ const [H, $] = t.useState("auto"), de = ye(), fe = ke(a, s.dir), k = I !== void 0 ? I : d ? !!m : !0;
68
+ t.useEffect(() => {
69
+ a.current && a.current.setCustomValidity && a.current.setCustomValidity(k ? "" : M || "");
70
+ }, [k, M]), Ce(() => {
71
+ a.current && $(`${a.current.scrollHeight}px`);
70
72
  }, [m]);
71
- const C = a.useCallback(
73
+ const C = t.useCallback(
72
74
  (r) => {
73
- const l = r.target.value;
74
- R("auto"), !f && !o && M(l), g && !o && z(
75
- g,
75
+ const u = r.target.value;
76
+ $("auto"), !f && !o && B(u), x && !o && z(
77
+ x,
76
78
  r,
77
79
  {
78
80
  ...n(),
79
- value: l
81
+ value: u
80
82
  },
81
- { value: l }
83
+ { value: u }
82
84
  );
83
85
  },
84
- [M, g, o, f]
85
- ), fe = a.useCallback(
86
+ [B, x, o, f]
87
+ ), me = t.useCallback(
86
88
  (r) => {
87
89
  A(!0), h && !o && z(h, r, n(), void 0);
88
90
  },
89
91
  [h, o, n]
90
- ), me = a.useCallback(
92
+ ), pe = t.useCallback(
91
93
  (r) => {
92
94
  A(!1), y && !o && z(y, r, n(), void 0);
93
95
  },
94
96
  [y, o, n]
95
- ), be = a.useCallback(
97
+ ), be = t.useCallback(
96
98
  (r) => {
97
- t.current && (t.current.value = r);
98
- const l = {
99
- target: t.current,
100
- currentTarget: t.current
99
+ a.current && (a.current.value = r);
100
+ const u = {
101
+ target: a.current,
102
+ currentTarget: a.current
101
103
  };
102
- C(l);
104
+ C(u);
103
105
  },
104
106
  [C]
105
107
  );
106
- ke(t, {
108
+ ze(a, {
107
109
  fieldName: N,
108
110
  onValueChange: be,
109
111
  enabled: !!N
110
112
  });
111
- const pe = a.useMemo(() => {
113
+ const ve = t.useMemo(() => {
112
114
  let r = {};
113
115
  return c ? r = {
114
116
  resize: "none",
115
117
  overflow: "hidden",
116
118
  height: H
117
- } : s && (r = { resize: s }), {
119
+ } : l && (r = { resize: l }), {
118
120
  ...r,
119
- ...E
121
+ ...T
120
122
  };
121
- }, [c, s, H, E]), xe = {
122
- id: w || ce,
123
- role: "textbox",
123
+ }, [c, l, H, T]), ge = {
124
+ id: P || de,
124
125
  name: F,
125
- className: q("k-input-inner", "!k-overflow-auto", {
126
- "k-resize": !c && s !== "none",
127
- "k-resize-none": c || s === "none",
128
- "!k-flex-none": x === "vertical"
126
+ className: D("k-input-inner", "!k-overflow-auto", {
127
+ "k-resize": !c && l !== "none",
128
+ "k-resize-none": c || l === "none",
129
+ "!k-flex-none": v === "vertical"
129
130
  }),
130
- ref: t,
131
+ ref: a,
131
132
  disabled: o,
132
- rows: _,
133
- placeholder: ee,
134
- readOnly: Z,
133
+ rows: ee,
134
+ placeholder: te,
135
+ readOnly: _,
135
136
  required: d,
136
- tabIndex: Ce(ae, o),
137
+ tabIndex: we(re, o),
137
138
  autoFocus: G,
138
- style: pe,
139
- "aria-labelledby": W,
139
+ style: ve,
140
+ "aria-labelledby": X,
140
141
  "aria-describedby": U,
141
- "aria-multiline": !0,
142
142
  "aria-disabled": o || void 0,
143
143
  "aria-required": d,
144
- value: f ? v : B,
145
- ...Object.assign({}, oe, re),
144
+ value: f ? g : O,
145
+ ...Object.assign({}, ne, oe),
146
146
  onChange: C,
147
- onFocus: fe,
148
- onBlur: me
147
+ onFocus: me,
148
+ onBlur: pe
149
149
  };
150
- return /* @__PURE__ */ a.createElement(
150
+ return /* @__PURE__ */ t.createElement(
151
151
  "span",
152
152
  {
153
- className: q(
153
+ className: D(
154
154
  "k-input",
155
155
  "k-textarea",
156
156
  {
157
- [`k-input-${D.sizeMap[b] || b}`]: b,
158
- [`k-input-${P}`]: P,
159
- [`k-rounded-${D.roundedMap[p] || p}`]: p,
160
- "k-invalid": !(k || V !== void 0 || V === !0),
157
+ [`k-input-${K.sizeMap[p] || p}`]: p,
158
+ [`k-input-${w}`]: w,
159
+ [`k-rounded-${K.roundedMap[b] || b}`]: b,
160
+ "k-invalid": !(k || S !== void 0 || S === !0),
161
161
  "k-required": d,
162
162
  "k-disabled": o,
163
- "k-focus": ne,
164
- "!k-flex-col": x === "vertical",
165
- "!k-flex-row": x === "horizontal"
163
+ "k-focus": se,
164
+ "!k-flex-col": v === "vertical",
165
+ "!k-flex-row": v === "horizontal"
166
166
  },
167
- X
167
+ Y
168
168
  ),
169
- style: te,
170
- dir: de
169
+ style: ae,
170
+ dir: fe
171
171
  },
172
- u.prefix && /* @__PURE__ */ a.createElement(se, { ...le }),
173
- /* @__PURE__ */ a.createElement("textarea", { ...xe }),
174
- u.suffix && /* @__PURE__ */ a.createElement(ie, { ...ue })
172
+ s.prefix && /* @__PURE__ */ t.createElement(le, { ...ue }),
173
+ /* @__PURE__ */ t.createElement("textarea", { ...ge }),
174
+ s.suffix && /* @__PURE__ */ t.createElement(ie, { ...ce })
175
175
  );
176
176
  });
177
- K.propTypes = {
177
+ L.propTypes = {
178
178
  ariaDescribedBy: e.string,
179
179
  ariaLabelledBy: e.string,
180
180
  autoSize: e.bool,
@@ -207,8 +207,8 @@ const i = {
207
207
  autoFocus: !1,
208
208
  flow: "horizontal"
209
209
  };
210
- K.displayName = "KendoTextArea";
210
+ L.displayName = "KendoTextArea";
211
211
  export {
212
- K as TextArea,
213
- Pe as TextAreaPropsContext
212
+ L as TextArea,
213
+ Fe as TextAreaPropsContext
214
214
  };