@progress/kendo-react-inputs 13.4.0-develop.1 → 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/slider/Slider.mjs CHANGED
@@ -5,216 +5,266 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import * as i from "react";
9
- import a from "prop-types";
10
- import { withPropsContext as y, createPropsContext as w, Keys as n, classNames as S, Draggable as x, getTabIndex as T, dispatchEvent as E } from "@progress/kendo-react-common";
11
- import { provideLocalizationService as D, registerForLocalization as C } from "@progress/kendo-react-intl";
12
- import { sliderDecreaseValue as d, messages as h, sliderIncreaseValue as m, sliderDragTitle as u } from "../messages/index.mjs";
13
- import { SLIDER_LABEL_ATTRIBUTE as I } from "./SliderLabel.mjs";
14
- import { Button as v } from "@progress/kendo-react-buttons";
15
- import { caretAltUpIcon as g, caretAltLeftIcon as f, caretAltRightIcon as b, caretAltDownIcon as k } from "@progress/kendo-svg-icons";
16
- const p = class p extends i.Component {
17
- constructor(s) {
18
- super(s), this.state = {
19
- value: this.props.defaultValue === void 0 ? this.props.min : this.props.defaultValue,
20
- focused: !1,
21
- dir: this.props.dir
22
- }, this._sliderTrack = null, this._element = null, this.buttons = (t) => {
23
- if (!t.enabled)
24
- return t.children;
25
- const e = this.state.dir === "rtl" ? this.props.vertical ? g : f : this.props.vertical ? g : b, l = this.state.dir === "rtl" ? this.props.vertical ? k : b : this.props.vertical ? k : f, r = this.state.dir === "rtl" ? this.props.vertical ? "caret-alt-up" : "caret-alt-left" : this.props.vertical ? "caret-alt-up" : "caret-alt-right", o = this.state.dir === "rtl" ? this.props.vertical ? "caret-alt-down" : "caret-alt-right" : this.props.vertical ? "caret-alt-down" : "caret-alt-left";
26
- return /* @__PURE__ */ i.createElement(i.Fragment, null, /* @__PURE__ */ i.createElement(
27
- v,
8
+ import * as l from "react";
9
+ import { useState as L, useRef as R, useMemo as N, useEffect as q, useCallback as o, useImperativeHandle as me } from "react";
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";
12
+ import { LocalizationService as ye, registerForLocalization as ke } from "@progress/kendo-react-intl";
13
+ import { sliderDragTitle as H, messages as A, sliderDecreaseValue as O, sliderIncreaseValue as X } from "../messages/index.mjs";
14
+ import { SLIDER_LABEL_ATTRIBUTE as xe } from "./SliderLabel.mjs";
15
+ import { Button as _ } from "@progress/kendo-react-buttons";
16
+ import { caretAltUpIcon as j, caretAltLeftIcon as G, caretAltDownIcon as W, caretAltRightIcon as Y } from "@progress/kendo-svg-icons";
17
+ const f = {
18
+ step: 1,
19
+ largeStep: 10,
20
+ buttons: !1,
21
+ vertical: !1,
22
+ disabled: !1,
23
+ tabIndex: 0
24
+ }, z = l.forwardRef((t, P) => {
25
+ var M, K, U;
26
+ const {
27
+ step: m = f.step,
28
+ largeStep: w = f.largeStep,
29
+ vertical: a = f.vertical,
30
+ disabled: C = f.disabled,
31
+ tabIndex: Q = f.tabIndex
32
+ } = t, [Z, $] = L((M = t.defaultValue) != null ? M : t.min), [p, B] = L(!1), [I, ee] = L(t.dir), E = R(null), g = R(null), T = N(() => new ye(), []), V = R(null), D = t.value !== void 0, y = D && t.value !== void 0 ? t.value : Z, r = N(() => {
33
+ const { min: e, max: n } = t;
34
+ return y < e ? e : y > n ? n : y;
35
+ }, [y, t.min, t.max]), v = N(() => {
36
+ const { min: e, max: n } = t, c = n - e;
37
+ return c === 0 ? 0 : (r - e) / c * 100;
38
+ }, [r, t.min, t.max]), u = (K = t.dir) != null ? K : I;
39
+ q(() => {
40
+ if (t.dir === void 0 && g.current) {
41
+ const n = window.getComputedStyle(g.current).direction;
42
+ n !== I && ee(n);
43
+ }
44
+ }, [t.dir, I]);
45
+ const F = o((e) => {
46
+ let n = e;
47
+ for (; n; ) {
48
+ if (n.getAttribute(xe))
49
+ return !0;
50
+ n = n.parentElement;
51
+ }
52
+ return !1;
53
+ }, []), d = o(
54
+ (e, n) => {
55
+ const c = Math.min(Math.max(n, t.min), t.max);
56
+ D || $(c), ge(t.onChange, e, V.current, { value: c });
57
+ },
58
+ [t.min, t.max, t.onChange, D]
59
+ ), te = o(() => {
60
+ B(!0);
61
+ }, []), ne = o(() => {
62
+ B(!1);
63
+ }, []), ae = o(
64
+ (e) => {
65
+ let n;
66
+ e.keyCode === s.left || e.keyCode === s.down ? n = r - (m || 0) : e.keyCode === s.right || e.keyCode === s.up ? n = r + (m || 0) : e.keyCode === s.pageDown ? n = r - (w || 0) : e.keyCode === s.pageUp ? n = r + (w || 0) : e.keyCode === s.home ? n = t.min : e.keyCode === s.end && (n = t.max), n !== void 0 && (e.preventDefault(), d(e, n));
67
+ },
68
+ [r, m, w, t.min, t.max, d]
69
+ ), ie = o(
70
+ (e) => {
71
+ e.preventDefault(), d(e, r - (m || 0));
72
+ },
73
+ [r, m, d]
74
+ ), le = o(
75
+ (e) => {
76
+ e.preventDefault(), d(e, r + (m || 0));
77
+ },
78
+ [r, m, d]
79
+ ), k = o(
80
+ (e) => {
81
+ const n = e.element.getBoundingClientRect();
82
+ let c;
83
+ a ? c = n.bottom - e.event.clientY : c = u === "rtl" ? n.right - e.event.clientX : e.event.clientX - n.left;
84
+ const h = a ? n.height : n.width, b = c / h;
85
+ d(e, t.min + b * (t.max - t.min));
86
+ },
87
+ [a, t.min, t.max, u, d]
88
+ ), re = o(
89
+ (e) => {
90
+ F(e.event.originalEvent.target) || (e.event.isTouch && e.event.originalEvent.preventDefault(), k(e));
91
+ },
92
+ [F, k]
93
+ ), ce = o(
94
+ (e) => {
95
+ e.event.originalEvent.preventDefault(), k(e);
96
+ },
97
+ [k]
98
+ ), x = o(() => {
99
+ g.current && g.current.focus();
100
+ }, []), oe = o(
101
+ (e) => {
102
+ if (!e.enabled)
103
+ return e.children;
104
+ let n, c, h, b;
105
+ return u === "rtl" ? (n = a ? j : G, c = a ? W : Y, h = a ? "caret-alt-up" : "caret-alt-left", b = a ? "caret-alt-down" : "caret-alt-right") : (n = a ? j : Y, c = a ? W : G, h = a ? "caret-alt-up" : "caret-alt-right", b = a ? "caret-alt-down" : "caret-alt-left"), /* @__PURE__ */ l.createElement(l.Fragment, null, /* @__PURE__ */ l.createElement(
106
+ _,
28
107
  {
29
108
  className: "k-button-decrease",
30
109
  rounded: "full",
31
- icon: o,
32
- svgIcon: l,
33
- title: t.decrementTitle,
34
- onClick: t.decrement
110
+ icon: b,
111
+ svgIcon: c,
112
+ title: e.decrementTitle,
113
+ onClick: e.decrement
35
114
  }
36
- ), t.children, /* @__PURE__ */ i.createElement(
37
- v,
115
+ ), e.children, /* @__PURE__ */ l.createElement(
116
+ _,
38
117
  {
39
118
  className: "k-button-increase",
40
119
  rounded: "full",
41
- icon: r,
42
- svgIcon: e,
43
- title: t.incrementTitle,
44
- onClick: t.increment
120
+ icon: h,
121
+ svgIcon: n,
122
+ title: e.incrementTitle,
123
+ onClick: e.increment
45
124
  }
46
125
  ));
47
- }, this.focus = () => {
48
- this._element && this._element.focus();
49
- }, this.isLabel = (t) => {
50
- let e = t;
51
- for (; e; ) {
52
- if (e.getAttribute(I))
53
- return !0;
54
- e = e.parentElement;
55
- }
56
- return !1;
57
- }, this.onFocus = () => {
58
- this.setState({ focused: !0 });
59
- }, this.onBlur = () => {
60
- this.setState({ focused: !1 });
61
- }, this.onKeyDown = (t) => {
62
- let e;
63
- t.keyCode === n.left || t.keyCode === n.down ? e = this.state.value - (this.props.step || 0) : t.keyCode === n.right || t.keyCode === n.up ? e = this.state.value + (this.props.step || 0) : t.keyCode === n.pageDown ? e = this.state.value - (this.props.largeStep || 0) : t.keyCode === n.pageUp ? e = this.state.value + (this.props.largeStep || 0) : t.keyCode === n.home ? e = this.props.min : t.keyCode === n.end && (e = this.props.max), e !== void 0 && (t.preventDefault(), this.change(t, e));
64
- }, this.decrement = (t) => {
65
- t.preventDefault(), this.change(t, this.state.value - (this.props.step || 0));
66
- }, this.increment = (t) => {
67
- t.preventDefault(), this.change(t, this.state.value + (this.props.step || 0));
68
- }, this.dragStart = (t) => {
69
- this.isLabel(t.event.originalEvent.target) || (t.event.isTouch && t.event.originalEvent.preventDefault(), this.drag(t));
70
- }, this.dragOver = (t) => {
71
- t.event.originalEvent.preventDefault(), this.drag(t);
72
- }, this.drag = (t) => {
73
- const e = t.element.getBoundingClientRect(), l = this.props.vertical ? e.bottom - t.event.clientY : this.state.dir === "rtl" ? e.right - t.event.clientX : t.event.clientX - e.left, r = this.props.vertical ? e.height : e.width, o = l / r;
74
- this.change(t, this.props.min + o * (this.props.max - this.props.min));
126
+ },
127
+ [u, a]
128
+ );
129
+ me(
130
+ P,
131
+ () => ({
132
+ props: t,
133
+ sliderTrack: E.current,
134
+ focus: x
135
+ }),
136
+ [t, x]
137
+ ), q(() => {
138
+ V.current = {
139
+ props: t,
140
+ sliderTrack: E.current,
141
+ focus: x
75
142
  };
76
- }
77
- /**
78
- * @hidden
79
- */
80
- static getDerivedStateFromProps(s, t) {
81
- const e = s.value !== void 0 ? s.value : t.value, { min: l, max: r } = s;
82
- return e === void 0 ? null : { value: Math.min(Math.max(e, l), r) };
83
- }
84
- /**
85
- * @hidden
86
- */
87
- componentDidMount() {
88
- if (!this.state.dir && window && this._element) {
89
- const s = window.getComputedStyle(this._element).direction;
90
- s && this.setState({ dir: s });
91
- }
92
- }
93
- /**
94
- * @hidden
95
- */
96
- render() {
97
- const s = D(this), t = (this.state.value - this.props.min) / (this.props.max - this.props.min) * 100, e = this.props.vertical ? { marginTop: "0.5rem", marginBottom: "0.5rem" } : { marginLeft: "0.5rem", marginRight: "0.5rem" }, l = this.props.vertical ? { paddingTop: 0, height: "100%" } : {};
98
- return /* @__PURE__ */ i.createElement(
99
- "div",
100
- {
101
- ref: (r) => {
102
- this._element = r;
143
+ }, [t, x]);
144
+ const de = a ? { marginTop: "0.5rem", marginBottom: "0.5rem" } : { marginLeft: "0.5rem", marginRight: "0.5rem" }, se = a ? { paddingTop: 0, height: "100%" } : {};
145
+ let S;
146
+ return a ? S = { bottom: "calc(" + v + "%)", zIndex: 1 } : u === "rtl" ? S = { right: "calc(" + v + "% - 13px)", zIndex: 1 } : S = { left: "calc(" + v + "%)", zIndex: 1 }, /* @__PURE__ */ l.createElement(
147
+ "div",
148
+ {
149
+ ref: g,
150
+ dir: u,
151
+ id: t.id,
152
+ style: { gap: 0, ...t.style },
153
+ onFocus: te,
154
+ onBlur: ne,
155
+ onKeyDown: ae,
156
+ className: ve(
157
+ "k-slider",
158
+ {
159
+ "k-focus": p,
160
+ "k-disabled": C,
161
+ "k-slider-horizontal": !a,
162
+ "k-slider-vertical": a
103
163
  },
104
- dir: this.state.dir,
105
- id: this.props.id,
106
- style: { gap: 0, ...this.props.style },
107
- onFocus: this.onFocus,
108
- onBlur: this.onBlur,
109
- onKeyDown: this.onKeyDown,
110
- className: S(
111
- "k-slider",
112
- {
113
- "k-focus": this.state.focused,
114
- "k-disabled": this.props.disabled,
115
- "k-slider-horizontal": !this.props.vertical,
116
- "k-slider-vertical": this.props.vertical
117
- },
118
- this.props.className
119
- )
120
- },
121
- /* @__PURE__ */ i.createElement(
122
- this.buttons,
164
+ t.className
165
+ )
166
+ },
167
+ oe({
168
+ enabled: (U = t.buttons) != null ? U : f.buttons,
169
+ decrement: ie,
170
+ increment: le,
171
+ incrementTitle: T.toLanguageString(
172
+ X,
173
+ A[X]
174
+ ),
175
+ decrementTitle: T.toLanguageString(
176
+ O,
177
+ A[O]
178
+ ),
179
+ children: /* @__PURE__ */ l.createElement(he, { onDrag: ce, onPress: re, autoScroll: !1 }, /* @__PURE__ */ l.createElement(
180
+ "div",
123
181
  {
124
- enabled: this.props.buttons,
125
- decrement: this.decrement,
126
- increment: this.increment,
127
- incrementTitle: s.toLanguageString(m, h[m]),
128
- decrementTitle: s.toLanguageString(d, h[d])
182
+ className: "k-slider-track-wrap",
183
+ style: {
184
+ flexGrow: 1,
185
+ position: "relative",
186
+ touchAction: "none",
187
+ ...de
188
+ }
129
189
  },
130
- /* @__PURE__ */ i.createElement(x, { onDrag: this.dragOver, onPress: this.dragStart, autoScroll: !1 }, /* @__PURE__ */ i.createElement(
190
+ t.children && /* @__PURE__ */ l.createElement("ul", { className: "k-reset k-slider-items", style: { margin: 0, ...se } }, l.Children.map(t.children, (e, n) => e && l.cloneElement(
191
+ e,
192
+ {
193
+ position: 100 * (e.props.position - t.min) / (t.max - t.min),
194
+ vertical: a,
195
+ firstTick: n === 0,
196
+ lastTick: n === l.Children.count(t.children) - 1
197
+ },
198
+ e.props.children
199
+ ))),
200
+ /* @__PURE__ */ l.createElement(
131
201
  "div",
132
202
  {
133
- className: "k-slider-track-wrap",
134
- style: {
135
- flexGrow: 1,
136
- position: "relative",
137
- touchAction: "none",
138
- ...e
139
- }
203
+ className: "k-slider-track",
204
+ style: a ? { bottom: 0, height: "100%" } : { [u === "rtl" ? "right" : "left"]: 0, width: "100%" },
205
+ ref: E
140
206
  },
141
- this.props.children && /* @__PURE__ */ i.createElement("ul", { className: "k-reset k-slider-items", style: { margin: 0, ...l } }, i.Children.map(this.props.children, (r, o) => r && i.cloneElement(
142
- r,
143
- {
144
- position: 100 * (r.props.position - this.props.min) / (this.props.max - this.props.min),
145
- vertical: this.props.vertical,
146
- firstTick: o === 0,
147
- lastTick: o === i.Children.count(this.props.children) - 1
148
- },
149
- r.props.children
150
- ))),
151
- /* @__PURE__ */ i.createElement(
207
+ /* @__PURE__ */ l.createElement(
152
208
  "div",
153
209
  {
154
- className: "k-slider-track",
155
- style: this.props.vertical ? { bottom: 0, height: "100%" } : { [this.state.dir === "rtl" ? "right" : "left"]: 0, width: "100%" },
156
- ref: (r) => {
157
- this._sliderTrack = r;
158
- }
159
- },
160
- /* @__PURE__ */ i.createElement(
161
- "div",
162
- {
163
- className: "k-slider-selection",
164
- style: this.props.vertical ? { height: t + "%" } : { width: t + "%" }
165
- }
166
- ),
167
- /* @__PURE__ */ i.createElement(
168
- "span",
169
- {
170
- role: "slider",
171
- "aria-valuemin": this.props.min,
172
- "aria-valuemax": this.props.max,
173
- "aria-valuenow": this.state.value,
174
- "aria-valuetext": String(this.state.value),
175
- "aria-orientation": this.props.vertical ? "vertical" : void 0,
176
- "aria-disabled": this.props.disabled ? "true" : void 0,
177
- "aria-labelledby": this.props.ariaLabelledBy,
178
- "aria-describedby": this.props.ariaDescribedBy,
179
- "aria-label": this.props.ariaLabel,
180
- tabIndex: T(this.props.tabIndex, this.props.disabled, void 0),
181
- className: "k-draghandle k-draghandle-end",
182
- title: s.toLanguageString(u, h[u]),
183
- style: this.props.vertical ? { bottom: "calc(" + t + "%)", zIndex: 1 } : this.state.dir === "rtl" ? { right: "calc(" + t + "% - 13px)", zIndex: 1 } : { left: "calc(" + t + "%)", zIndex: 1 }
184
- }
185
- )
210
+ className: "k-slider-selection",
211
+ style: a ? { height: v + "%" } : { width: v + "%" }
212
+ }
213
+ ),
214
+ /* @__PURE__ */ l.createElement(
215
+ "span",
216
+ {
217
+ role: "slider",
218
+ "aria-valuemin": t.min,
219
+ "aria-valuemax": t.max,
220
+ "aria-valuenow": r,
221
+ "aria-valuetext": String(r),
222
+ "aria-orientation": a ? "vertical" : void 0,
223
+ "aria-disabled": C ? "true" : void 0,
224
+ "aria-labelledby": t.ariaLabelledBy,
225
+ "aria-describedby": t.ariaDescribedBy,
226
+ "aria-label": t.ariaLabel,
227
+ tabIndex: be(Q, C, void 0),
228
+ className: "k-draghandle k-draghandle-end",
229
+ title: T.toLanguageString(
230
+ H,
231
+ A[H]
232
+ ),
233
+ style: S
234
+ }
186
235
  )
187
- ))
188
- )
189
- );
190
- }
191
- /**
192
- * @hidden
193
- */
194
- get sliderTrack() {
195
- return this._sliderTrack;
196
- }
197
- change(s, t) {
198
- t = Math.min(Math.max(t, this.props.min), this.props.max), this.setState({ value: t }), E(this.props.onChange, s, this, { value: t });
199
- }
200
- };
201
- p.displayName = "Slider", p.propTypes = {
202
- min: a.number.isRequired,
203
- max: a.number.isRequired,
204
- value: a.number,
205
- vertical: a.bool,
206
- id: a.string,
207
- ariaLabelledBy: a.string,
208
- ariaDescribedBy: a.string,
209
- ariaLabel: a.string
210
- // TODO: validation when buttons is set to true, but no step is provided
236
+ )
237
+ ))
238
+ })
239
+ );
240
+ });
241
+ z.displayName = "Slider";
242
+ const Se = fe(), J = ue(Se, z);
243
+ J.displayName = "KendoReactSlider";
244
+ J.propTypes = {
245
+ value: i.number,
246
+ defaultValue: i.number,
247
+ min: i.number.isRequired,
248
+ max: i.number.isRequired,
249
+ step: i.number,
250
+ largeStep: i.number,
251
+ onChange: i.func,
252
+ style: i.object,
253
+ className: i.string,
254
+ buttons: i.bool,
255
+ tabIndex: i.number,
256
+ disabled: i.bool,
257
+ vertical: i.bool,
258
+ id: i.string,
259
+ ariaDescribedBy: i.string,
260
+ ariaLabelledBy: i.string,
261
+ ariaLabel: i.string,
262
+ dir: i.oneOf(["ltr", "rtl"]),
263
+ children: i.node
211
264
  };
212
- let c = p;
213
- const L = w(), A = y(L, c);
214
- A.displayName = "KendoReactSlider";
215
- C(c);
265
+ ke(z);
216
266
  export {
217
- A as Slider,
218
- L as SliderPropsContext,
219
- c as SliderWithoutContext
267
+ J as Slider,
268
+ Se as SliderPropsContext,
269
+ z as SliderWithoutContext
220
270
  };
@@ -5,14 +5,13 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { default as PropTypes } from 'prop-types';
9
- import { BaseEvent, FormComponent, FormComponentProps, FormComponentValidity } from '@progress/kendo-react-common';
8
+ import { BaseEvent, FormComponentProps, FormComponentValidity } from '@progress/kendo-react-common';
10
9
  import { ToggleBaseProps } from '../interfaces/ToggleBaseProps.js';
11
10
  import * as React from 'react';
12
11
  /**
13
12
  * The arguments for the `onChange` Switch event.
14
13
  */
15
- export interface SwitchChangeEvent extends BaseEvent<Switch> {
14
+ export interface SwitchChangeEvent extends BaseEvent<SwitchHandle> {
16
15
  /**
17
16
  * The new value of the Switch.
18
17
  */
@@ -103,7 +102,7 @@ export interface SwitchProps extends ToggleBaseProps, FormComponentProps {
103
102
  * - large
104
103
  * - null&mdash;Does not set a size `className`.
105
104
  *
106
- * @default `medium`
105
+ * @default undefined (theme-controlled)
107
106
  * @example
108
107
  * ```jsx
109
108
  * <Switch size="large" />
@@ -236,124 +235,8 @@ export interface SwitchProps extends ToggleBaseProps, FormComponentProps {
236
235
  */
237
236
  ariaLabel?: string;
238
237
  }
239
- /**
240
- * @hidden
241
- */
242
- export interface SwitchState {
243
- checked: boolean;
244
- focused: boolean;
245
- }
246
238
  /** @hidden */
247
- export declare class SwitchWithoutContext extends React.Component<SwitchProps, SwitchState> implements FormComponent {
248
- static displayName: string;
249
- /**
250
- * Gets the value of the Switch.
251
- */
252
- get value(): boolean;
253
- get element(): HTMLSpanElement | null;
254
- get actionElement(): HTMLSpanElement | null;
255
- /**
256
- * Gets the `name` property of the Switch.
257
- */
258
- get name(): string | undefined;
259
- /**
260
- * Represents the validity state into which the Switch is set.
261
- */
262
- get validity(): FormComponentValidity;
263
- /**
264
- * @hidden
265
- */
266
- protected get validityStyles(): boolean;
267
- /**
268
- * @hidden
269
- */
270
- protected get required(): boolean;
271
- /**
272
- * @hidden
273
- */
274
- protected setValidity: () => void;
275
- protected limit: (offset: number, drag: HTMLSpanElement, wrapper: HTMLSpanElement) => number;
276
- protected toggle: (value: boolean, event: any) => void;
277
- /**
278
- * @hidden
279
- */
280
- static propTypes: {
281
- accessKey: PropTypes.Requireable<string>;
282
- checked: PropTypes.Requireable<boolean>;
283
- className: PropTypes.Requireable<string>;
284
- disabled: PropTypes.Requireable<boolean>;
285
- defaultChecked: PropTypes.Requireable<boolean>;
286
- size: PropTypes.Requireable<"small" | "medium" | "large" | undefined>;
287
- trackRounded: PropTypes.Requireable<"small" | "medium" | "large" | "full" | undefined>;
288
- thumbRounded: PropTypes.Requireable<"small" | "medium" | "large" | "full" | undefined>;
289
- dir: PropTypes.Requireable<string>;
290
- id: PropTypes.Requireable<string>;
291
- ariaLabelledBy: PropTypes.Requireable<string>;
292
- ariaDescribedBy: PropTypes.Requireable<string>;
293
- offLabel: PropTypes.Requireable<string>;
294
- required: PropTypes.Requireable<boolean>;
295
- tabIndex: PropTypes.Requireable<number>;
296
- valid: PropTypes.Requireable<boolean>;
297
- validate: PropTypes.Requireable<boolean>;
298
- validationMessage: PropTypes.Requireable<string>;
299
- onBlur: PropTypes.Requireable<any>;
300
- onChange: PropTypes.Requireable<any>;
301
- onFocus: PropTypes.Requireable<any>;
302
- onLabel: PropTypes.Requireable<string>;
303
- };
304
- /**
305
- * @hidden
306
- */
307
- static defaultProps: {
308
- disabled: boolean;
309
- defaultChecked: boolean;
310
- size: undefined;
311
- trackRounded: undefined;
312
- thumbRounded: undefined;
313
- offLabel: string;
314
- onBlur: () => void;
315
- onFocus: () => void;
316
- onLabel: string;
317
- validityStyles: boolean;
318
- };
319
- /**
320
- * @hidden
321
- */
322
- readonly state: SwitchState;
323
- private _element;
324
- private _wrapper;
325
- private _input;
326
- private _id;
327
- private valueDuringOnChange;
328
- private dir?;
329
- private defaultValidationMessage;
330
- private eventTimeStamp?;
331
- /**
332
- * @hidden
333
- */
334
- constructor(props: SwitchProps);
335
- /**
336
- * @hidden
337
- */
338
- componentDidMount(): void;
339
- /**
340
- * @hidden
341
- */
342
- componentDidUpdate(): void;
343
- /**
344
- * @hidden
345
- */
346
- focus: () => void;
347
- /**
348
- * @hidden
349
- */
350
- render(): React.JSX.Element;
351
- private dummyInput;
352
- private handleClick;
353
- private handleKeyDown;
354
- private handleWrapperFocus;
355
- private handleWrapperBlur;
356
- }
239
+ export declare const SwitchWithoutContext: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<SwitchHandle>>;
357
240
  /**
358
241
  * Represents the PropsContext of the `Switch` component.
359
242
  * Used for global configuration of all `Switch` instances.
@@ -364,7 +247,11 @@ export declare const SwitchPropsContext: React.Context<(p: SwitchProps) => Switc
364
247
  /**
365
248
  * Represent the `ref` of the Switch component.
366
249
  */
367
- export interface SwitchHandle extends Pick<SwitchWithoutContext, keyof SwitchWithoutContext> {
250
+ export interface SwitchHandle {
251
+ /**
252
+ * The props of the SwitchHandle component.
253
+ */
254
+ props: SwitchProps;
368
255
  /**
369
256
  * @hidden
370
257
  */
@@ -386,8 +273,6 @@ export interface SwitchHandle extends Pick<SwitchWithoutContext, keyof SwitchWit
386
273
  */
387
274
  value: boolean;
388
275
  }
389
- /** @hidden */
390
- export type Switch = SwitchHandle;
391
276
  /**
392
277
  * Represents the [KendoReact Switch component](https://www.telerik.com/kendo-react-ui/components/inputs/switch).
393
278
  *