@progress/kendo-react-inputs 14.0.0-develop.1 → 14.0.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/slider/Slider.mjs CHANGED
@@ -8,7 +8,7 @@
8
8
  import * as l from "react";
9
9
  import { useState as L, useRef as R, useMemo as N, useEffect as q, useCallback as o, useImperativeHandle as me } from "react";
10
10
  import * as i from "prop-types";
11
- import { withPropsContext as ue, createPropsContext as fe, dispatchEvent as ge, Keys as s, classNames as ve, Draggable as he, getTabIndex as be } from "@progress/kendo-react-common";
11
+ import { withPropsContext as ue, dispatchEvent as fe, Keys as s, classNames as ge, Draggable as ve, getTabIndex as he, createPropsContext as be } from "@progress/kendo-react-common";
12
12
  import { LocalizationService as ye, registerForLocalization as ke } from "@progress/kendo-react-intl";
13
13
  import { sliderDragTitle as H, messages as A, sliderDecreaseValue as O, sliderIncreaseValue as X } from "../messages/index.mjs";
14
14
  import { SLIDER_LABEL_ATTRIBUTE as xe } from "./SliderLabel.mjs";
@@ -53,7 +53,7 @@ const f = {
53
53
  }, []), d = o(
54
54
  (e, n) => {
55
55
  const c = Math.min(Math.max(n, t.min), t.max);
56
- D || $(c), ge(t.onChange, e, V.current, { value: c });
56
+ D || $(c), fe(t.onChange, e, V.current, { value: c });
57
57
  },
58
58
  [t.min, t.max, t.onChange, D]
59
59
  ), te = o(() => {
@@ -153,7 +153,7 @@ const f = {
153
153
  onFocus: te,
154
154
  onBlur: ne,
155
155
  onKeyDown: ae,
156
- className: ve(
156
+ className: ge(
157
157
  "k-slider",
158
158
  {
159
159
  "k-focus": p,
@@ -176,7 +176,7 @@ const f = {
176
176
  O,
177
177
  A[O]
178
178
  ),
179
- children: /* @__PURE__ */ l.createElement(he, { onDrag: ce, onPress: re, autoScroll: !1 }, /* @__PURE__ */ l.createElement(
179
+ children: /* @__PURE__ */ l.createElement(ve, { onDrag: ce, onPress: re, autoScroll: !1 }, /* @__PURE__ */ l.createElement(
180
180
  "div",
181
181
  {
182
182
  className: "k-slider-track-wrap",
@@ -224,7 +224,7 @@ const f = {
224
224
  "aria-labelledby": t.ariaLabelledBy,
225
225
  "aria-describedby": t.ariaDescribedBy,
226
226
  "aria-label": t.ariaLabel,
227
- tabIndex: be(Q, C, void 0),
227
+ tabIndex: he(Q, C, void 0),
228
228
  className: "k-draghandle k-draghandle-end",
229
229
  title: T.toLanguageString(
230
230
  H,
@@ -239,7 +239,7 @@ const f = {
239
239
  );
240
240
  });
241
241
  z.displayName = "Slider";
242
- const Se = fe(), J = ue(Se, z);
242
+ const Se = be(), J = ue(Se, z);
243
243
  J.displayName = "KendoReactSlider";
244
244
  J.propTypes = {
245
245
  value: i.number,
@@ -260,6 +260,10 @@ export interface SwitchHandle {
260
260
  * Returns the HTML element of the Switch component.
261
261
  */
262
262
  element: HTMLSpanElement | null;
263
+ /**
264
+ * Sets the focus on the Switch.
265
+ */
266
+ focus: () => void;
263
267
  /**
264
268
  * Gets the `name` property of the Switch.
265
269
  */
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"),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;
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 m=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(m,s,h.get?h:{enumerable:!0,get:()=>e[s]})}}return m.default=e,Object.freeze(m)}const d=z(n),a=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,m)=>{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),u=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 t=e.validationMessage!==void 0,r=(g=e.valid)!=null?g:e.required?!!c:!0,y=(K=e.valid)!=null?K:r;return{customError:t,valid:y,valueMissing:c===null}},[e.valid,e.validationMessage,e.required,c]),W=(F=e.validityStyles)!=null?F:l.validityStyles;n.useEffect(()=>{var t;(t=E.current)!=null&&t.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 u.current},focus:()=>{var t;(t=u.current)==null||t.focus()},get value(){return c},get name(){return e.name},get validity(){return b}}),[e,c,b]),f=n.useCallback((t,r)=>{V(t),v.current=t,i.dispatchEvent(e.onChange,r,{...k(),value:t},{value:t}),v.current=void 0},[e.onChange,k]);n.useEffect(()=>{const t=e.name||e.id,r=i.subscribeToKendoPaste(u.current,{fieldName:t,onValueChange:y=>{if(y!==c){const g={target:u.current,currentTarget:u.current,nativeEvent:new Event("change",{bubbles:!0})};f(y,g)}}});return()=>{r==null||r.unsubscribe()}},[e.name,e.id,c,f]);const H=n.useCallback(t=>{q.current!==t.timeStamp&&(q.current=t.timeStamp,f(!c,t))},[c,f]),$=n.useCallback(t=>{if(s)return;const{keyCode:r}=t;(r===i.Keys.space||r===i.Keys.enter)&&(f(!c,t),t.preventDefault())},[s,c,f]),A=n.useCallback(t=>{s||(P(!0),M&&M(t))},[s,M]),G=n.useCallback(t=>{s||(P(!1),S&&S(t))},[s,S]);n.useImperativeHandle(m,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:u,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:a.string,checked:a.bool,className:a.string,defaultChecked:a.bool,defaultValue:a.any,disabled:a.bool,dir:a.string,id:a.string,size:a.oneOf(["small","medium","large"]),trackRounded:a.oneOf(["small","medium","large","full"]),thumbRounded:a.oneOf(["small","medium","large","full"]),ariaDescribedBy:a.string,ariaLabelledBy:a.string,ariaLabel:a.string,offLabel:a.node,onBlur:a.func,onChange:a.func,onFocus:a.func,onLabel:a.node,tabIndex:a.number,value:a.any,name:a.string,required:a.bool,valid:a.bool,validationMessage:a.string,validityStyles:a.bool};exports.Switch=L;exports.SwitchPropsContext=j;exports.SwitchWithoutContext=x;
package/switch/Switch.mjs CHANGED
@@ -5,13 +5,13 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
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
- import * as t from "prop-types";
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";
8
+ import * as d from "react";
9
+ import { useState as q, useRef as u, useMemo as E, useEffect as L, useCallback as m, useImperativeHandle as ae } from "react";
10
+ import * as a from "prop-types";
11
+ import { withIdHOC as ne, withPropsContext as ie, noop as M, dispatchEvent as re, subscribeToKendoPaste as ce, Keys as V, classNames as N, kendoThemeMaps as x, getTabIndex as de, createPropsContext as le } from "@progress/kendo-react-common";
12
12
  import { LocalizationService as oe } from "@progress/kendo-react-intl";
13
13
  import { switchValidation as H, messages as se } from "../messages/index.mjs";
14
- const d = {
14
+ const r = {
15
15
  disabled: !1,
16
16
  defaultChecked: !1,
17
17
  size: void 0,
@@ -22,42 +22,46 @@ const d = {
22
22
  onFocus: M,
23
23
  onLabel: "ON",
24
24
  validityStyles: !0
25
- }, W = c.forwardRef((e, j) => {
25
+ }, W = d.forwardRef((e, j) => {
26
26
  var T;
27
27
  const {
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(() => {
28
+ disabled: c = r.disabled,
29
+ defaultChecked: A = r.defaultChecked,
30
+ size: g = r.size,
31
+ trackRounded: k = r.trackRounded,
32
+ thumbRounded: w = r.thumbRounded,
33
+ offLabel: B = r.offLabel,
34
+ onBlur: C = r.onBlur,
35
+ onFocus: R = r.onFocus,
36
+ onLabel: I = r.onLabel
37
+ } = e, [F, G] = q(A || !1), [J, D] = q(!1), l = u(null), o = u(null), S = u(null), b = u(void 0), K = u(void 0), z = u(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
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;
39
+ const t = 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
- customError: a,
41
+ customError: t,
42
42
  valid: v,
43
43
  valueMissing: n === null
44
44
  };
45
- }, [e.valid, e.validationMessage, e.required, n]), Q = (T = e.validityStyles) != null ? T : d.validityStyles;
45
+ }, [e.valid, e.validationMessage, e.required, n]), Q = (T = e.validityStyles) != null ? T : r.validityStyles;
46
46
  L(() => {
47
- var a;
48
- (a = S.current) != null && a.setCustomValidity && S.current.setCustomValidity(
47
+ var t;
48
+ (t = S.current) != null && t.setCustomValidity && S.current.setCustomValidity(
49
49
  f.valid ? "" : e.validationMessage || O.toLanguageString(H, se[H])
50
50
  );
51
51
  }, [f, e.validationMessage, O]), L(() => {
52
52
  l.current && (z.current = e.dir || getComputedStyle(l.current).direction || void 0);
53
53
  }, [e.dir]);
54
- const h = u(() => ({
54
+ const h = m(() => ({
55
55
  props: e,
56
56
  get element() {
57
57
  return l.current;
58
58
  },
59
59
  get actionElement() {
60
- return m.current;
60
+ return o.current;
61
+ },
62
+ focus: () => {
63
+ var t;
64
+ (t = o.current) == null || t.focus();
61
65
  },
62
66
  get value() {
63
67
  return n;
@@ -68,58 +72,58 @@ const d = {
68
72
  get validity() {
69
73
  return f;
70
74
  }
71
- }), [e, n, f]), o = u(
72
- (a, i) => {
73
- G(a), b.current = a, re(
75
+ }), [e, n, f]), s = m(
76
+ (t, i) => {
77
+ G(t), b.current = t, re(
74
78
  e.onChange,
75
79
  i,
76
- { ...h(), value: a },
77
- { value: a }
80
+ { ...h(), value: t },
81
+ { value: t }
78
82
  ), b.current = void 0;
79
83
  },
80
84
  [e.onChange, h]
81
85
  );
82
86
  L(() => {
83
- const a = e.name || e.id, i = ce(m.current, {
84
- fieldName: a,
87
+ const t = e.name || e.id, i = ce(o.current, {
88
+ fieldName: t,
85
89
  onValueChange: (v) => {
86
90
  if (v !== n) {
87
91
  const y = {
88
- target: m.current,
89
- currentTarget: m.current,
92
+ target: o.current,
93
+ currentTarget: o.current,
90
94
  nativeEvent: new Event("change", { bubbles: !0 })
91
95
  };
92
- o(v, y);
96
+ s(v, y);
93
97
  }
94
98
  }
95
99
  });
96
100
  return () => {
97
101
  i == null || i.unsubscribe();
98
102
  };
99
- }, [e.name, e.id, n, o]);
100
- const U = u(
101
- (a) => {
102
- K.current !== a.timeStamp && (K.current = a.timeStamp, o(!n, a));
103
+ }, [e.name, e.id, n, s]);
104
+ const U = m(
105
+ (t) => {
106
+ K.current !== t.timeStamp && (K.current = t.timeStamp, s(!n, t));
103
107
  },
104
- [n, o]
105
- ), X = u(
106
- (a) => {
107
- if (r)
108
+ [n, s]
109
+ ), X = m(
110
+ (t) => {
111
+ if (c)
108
112
  return;
109
- const { keyCode: i } = a;
110
- (i === V.space || i === V.enter) && (o(!n, a), a.preventDefault());
113
+ const { keyCode: i } = t;
114
+ (i === V.space || i === V.enter) && (s(!n, t), t.preventDefault());
111
115
  },
112
- [r, n, o]
113
- ), Y = u(
114
- (a) => {
115
- r || (D(!0), R && R(a));
116
+ [c, n, s]
117
+ ), Y = m(
118
+ (t) => {
119
+ c || (D(!0), R && R(t));
116
120
  },
117
- [r, R]
118
- ), Z = u(
119
- (a) => {
120
- r || (D(!1), C && C(a));
121
+ [c, R]
122
+ ), Z = m(
123
+ (t) => {
124
+ c || (D(!1), C && C(t));
121
125
  },
122
- [r, C]
126
+ [c, C]
123
127
  );
124
128
  ae(j, h, [h]);
125
129
  const _ = z.current || e.dir || l.current && getComputedStyle(l.current).direction || void 0, p = !Q || f.valid, ee = N(
@@ -129,11 +133,11 @@ const d = {
129
133
  "k-switch-on": n,
130
134
  "k-switch-off": !n,
131
135
  "k-focus": J,
132
- "k-disabled": r,
136
+ "k-disabled": c,
133
137
  "k-invalid": !p
134
138
  },
135
139
  e.className
136
- ), te = /* @__PURE__ */ c.createElement(
140
+ ), te = /* @__PURE__ */ d.createElement(
137
141
  "input",
138
142
  {
139
143
  type: "checkbox",
@@ -147,13 +151,13 @@ const d = {
147
151
  name: e.name || void 0
148
152
  }
149
153
  );
150
- return /* @__PURE__ */ c.createElement(
154
+ return /* @__PURE__ */ d.createElement(
151
155
  "span",
152
156
  {
153
- ref: m,
157
+ ref: o,
154
158
  role: "switch",
155
159
  "aria-checked": n,
156
- "aria-disabled": r || void 0,
160
+ "aria-disabled": c || void 0,
157
161
  "aria-labelledby": e.ariaLabelledBy,
158
162
  "aria-describedby": e.ariaDescribedBy,
159
163
  "aria-label": e.ariaLabel,
@@ -164,11 +168,11 @@ const d = {
164
168
  onClick: U,
165
169
  onBlur: Z,
166
170
  onFocus: Y,
167
- tabIndex: le(e.tabIndex, r, void 0),
171
+ tabIndex: de(e.tabIndex, c, void 0),
168
172
  accessKey: e.accessKey,
169
173
  id: e.id
170
174
  },
171
- /* @__PURE__ */ c.createElement(
175
+ /* @__PURE__ */ d.createElement(
172
176
  "span",
173
177
  {
174
178
  className: N("k-switch-track", {
@@ -177,10 +181,10 @@ const d = {
177
181
  ref: l
178
182
  },
179
183
  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) : ""
184
+ I ? /* @__PURE__ */ d.createElement("span", { className: "k-switch-label-on" }, I) : "",
185
+ B ? /* @__PURE__ */ d.createElement("span", { className: "k-switch-label-off" }, B) : ""
182
186
  ),
183
- /* @__PURE__ */ c.createElement("span", { className: "k-switch-thumb-wrap" }, /* @__PURE__ */ c.createElement(
187
+ /* @__PURE__ */ d.createElement("span", { className: "k-switch-thumb-wrap" }, /* @__PURE__ */ d.createElement(
184
188
  "span",
185
189
  {
186
190
  className: N("k-switch-thumb", {
@@ -191,7 +195,7 @@ const d = {
191
195
  );
192
196
  });
193
197
  W.displayName = "Switch";
194
- const ue = de(), $ = ne(
198
+ const ue = le(), $ = ne(
195
199
  ie(
196
200
  ue,
197
201
  W
@@ -199,32 +203,32 @@ const ue = de(), $ = ne(
199
203
  );
200
204
  $.displayName = "KendoReactSwitch";
201
205
  $.propTypes = {
202
- accessKey: t.string,
203
- checked: t.bool,
204
- className: t.string,
205
- defaultChecked: t.bool,
206
- defaultValue: t.any,
207
- disabled: t.bool,
208
- dir: t.string,
209
- id: t.string,
210
- size: t.oneOf(["small", "medium", "large"]),
211
- trackRounded: t.oneOf(["small", "medium", "large", "full"]),
212
- thumbRounded: t.oneOf(["small", "medium", "large", "full"]),
213
- ariaDescribedBy: t.string,
214
- ariaLabelledBy: t.string,
215
- ariaLabel: t.string,
216
- offLabel: t.node,
217
- onBlur: t.func,
218
- onChange: t.func,
219
- onFocus: t.func,
220
- onLabel: t.node,
221
- tabIndex: t.number,
222
- value: t.any,
223
- name: t.string,
224
- required: t.bool,
225
- valid: t.bool,
226
- validationMessage: t.string,
227
- validityStyles: t.bool
206
+ accessKey: a.string,
207
+ checked: a.bool,
208
+ className: a.string,
209
+ defaultChecked: a.bool,
210
+ defaultValue: a.any,
211
+ disabled: a.bool,
212
+ dir: a.string,
213
+ id: a.string,
214
+ size: a.oneOf(["small", "medium", "large"]),
215
+ trackRounded: a.oneOf(["small", "medium", "large", "full"]),
216
+ thumbRounded: a.oneOf(["small", "medium", "large", "full"]),
217
+ ariaDescribedBy: a.string,
218
+ ariaLabelledBy: a.string,
219
+ ariaLabel: a.string,
220
+ offLabel: a.node,
221
+ onBlur: a.func,
222
+ onChange: a.func,
223
+ onFocus: a.func,
224
+ onLabel: a.node,
225
+ tabIndex: a.number,
226
+ value: a.any,
227
+ name: a.string,
228
+ required: a.bool,
229
+ valid: a.bool,
230
+ validationMessage: a.string,
231
+ validityStyles: a.bool
228
232
  };
229
233
  export {
230
234
  $ as Switch,
@@ -7,9 +7,9 @@
7
7
  */
8
8
  import * as a from "react";
9
9
  import e from "prop-types";
10
- import { createPropsContext as ve, usePropsContext as ge, useCustomComponent as $, useId as he, useDir as ye, useIsomorphicLayoutEffect as ke, dispatchEvent as z, useKendoPaste as Ce, getTabIndex as ze, classNames as q, kendoThemeMaps as D } from "@progress/kendo-react-common";
11
- const Pe = ve(), K = a.forwardRef((L, j) => {
12
- const u = ge(Pe, L), {
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
13
  size: b = i.size,
14
14
  rounded: p = i.rounded,
15
15
  fillMode: P = i.fillMode,
@@ -62,10 +62,10 @@ const Pe = ve(), K = a.forwardRef((L, j) => {
62
62
  }
63
63
  }), [O, I, m]);
64
64
  a.useImperativeHandle(j, n);
65
- const [H, R] = a.useState("auto"), ce = he(), de = ye(t, u.dir), k = S !== void 0 ? S : d ? !!m : !0;
65
+ const [H, R] = a.useState("auto"), ce = ge(), de = he(t, u.dir), k = S !== void 0 ? S : d ? !!m : !0;
66
66
  a.useEffect(() => {
67
67
  t.current && t.current.setCustomValidity && t.current.setCustomValidity(k ? "" : T || "");
68
- }, [k, T]), ke(() => {
68
+ }, [k, T]), ye(() => {
69
69
  t.current && R(`${t.current.scrollHeight}px`);
70
70
  }, [m]);
71
71
  const C = a.useCallback(
@@ -103,7 +103,7 @@ const Pe = ve(), K = a.forwardRef((L, j) => {
103
103
  },
104
104
  [C]
105
105
  );
106
- Ce(t, {
106
+ ke(t, {
107
107
  fieldName: N,
108
108
  onValueChange: be,
109
109
  enabled: !!N
@@ -133,7 +133,7 @@ const Pe = ve(), K = a.forwardRef((L, j) => {
133
133
  placeholder: ee,
134
134
  readOnly: Y,
135
135
  required: d,
136
- tabIndex: ze(ae, o),
136
+ tabIndex: Ce(ae, o),
137
137
  autoFocus: _,
138
138
  style: pe,
139
139
  "aria-labelledby": U,