@progress/kendo-react-inputs 14.0.1 → 14.1.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 (37) hide show
  1. package/checkbox/Checkbox.mjs +24 -24
  2. package/colors/ColorGradient.mjs +4 -4
  3. package/colors/ColorPalette.mjs +9 -9
  4. package/colors/ColorPicker.mjs +11 -11
  5. package/colors/FlatColorPicker.d.ts +9 -0
  6. package/colors/FlatColorPicker.mjs +11 -11
  7. package/common/SliderTooltip.d.ts +6 -0
  8. package/dist/cdn/js/kendo-react-inputs.js +1 -1
  9. package/input/Input.d.ts +12 -0
  10. package/input/Input.mjs +12 -12
  11. package/maskedtextbox/MaskedTextBox.mjs +5 -5
  12. package/maskedtextbox/MaskedTextBoxProps.d.ts +18 -0
  13. package/numerictextbox/NumericTextBox.mjs +13 -13
  14. package/numerictextbox/interfaces/NumericTextBoxProps.d.ts +18 -0
  15. package/package-metadata.js +1 -1
  16. package/package-metadata.mjs +1 -1
  17. package/package.json +10 -10
  18. package/radiobutton/RadioButton.mjs +18 -18
  19. package/radiobutton/RadioGroup.mjs +15 -15
  20. package/range-slider/RangeSlider.d.ts +12 -0
  21. package/range-slider/RangeSlider.mjs +15 -15
  22. package/rating/Rating.d.ts +9 -0
  23. package/rating/Rating.mjs +12 -12
  24. package/rating/RatingItem.d.ts +3 -0
  25. package/rating/RatingItem.mjs +4 -4
  26. package/signature/Signature.mjs +12 -12
  27. package/signature/interfaces/SignatureProps.d.ts +9 -0
  28. package/slider/Slider.d.ts +9 -0
  29. package/slider/Slider.js +1 -1
  30. package/slider/Slider.mjs +1 -1
  31. package/switch/Switch.d.ts +9 -0
  32. package/switch/Switch.js +1 -1
  33. package/switch/Switch.mjs +1 -1
  34. package/textarea/TextArea.mjs +16 -16
  35. package/textarea/interfaces/TextAreaProps.d.ts +15 -0
  36. package/textbox/Textbox.d.ts +6 -0
  37. package/textbox/Textbox.mjs +12 -12
@@ -59,18 +59,18 @@ const se = (n, s, p) => {
59
59
  state: e.value
60
60
  },
61
61
  W
62
- ), d = a.useMemo(() => e.value || x, [e.value, x]), _ = a.useRef(null), R = a.useRef(null), h = a.useMemo(() => (d.start - g) / (k - g) * 100, [d.start, g, k]), D = a.useMemo(() => (d.end - g) / (k - g) * 100, [d.end, g, k]), q = a.useMemo(
62
+ ), d = a.useMemo(() => e.value || x, [e.value, x]), q = a.useRef(null), R = a.useRef(null), h = a.useMemo(() => (d.start - g) / (k - g) * 100, [d.start, g, k]), D = a.useMemo(() => (d.end - g) / (k - g) * 100, [d.end, g, k]), B = a.useMemo(
63
63
  () => e.vertical ? { paddingTop: 0, height: "100%" } : {},
64
64
  [e.vertical]
65
- ), B = a.useMemo(
65
+ ), G = a.useMemo(
66
66
  () => e.vertical ? { marginTop: "0.5rem", marginBottom: "0.5rem" } : { marginLeft: "0.5rem", marginRight: "0.5rem" },
67
67
  [e.vertical]
68
68
  ), M = ne(), C = a.useCallback(
69
69
  (t) => {
70
70
  if (!R.current)
71
71
  return;
72
- const u = R.current.getBoundingClientRect(), v = e.vertical ? u.bottom - t.clientY : o === "rtl" ? u.right - t.clientX : t.clientX - u.left, I = e.vertical ? u.height : u.width, Y = v / I;
73
- return g + Y * (k - g);
72
+ const u = R.current.getBoundingClientRect(), v = e.vertical ? u.bottom - t.clientY : o === "rtl" ? u.right - t.clientX : t.clientX - u.left, I = e.vertical ? u.height : u.width, _ = v / I;
73
+ return g + _ * (k - g);
74
74
  },
75
75
  [
76
76
  R,
@@ -83,10 +83,10 @@ const se = (n, s, p) => {
83
83
  e.value && e.value.start,
84
84
  e.value && e.value.end
85
85
  ]
86
- ), G = a.useCallback(
86
+ ), U = a.useCallback(
87
87
  (t) => t <= d.start ? "start" : t >= d.end ? "end" : 2 * t < d.end + d.start ? "start" : "end",
88
88
  [x.start, x.end, e.value && e.value.start, e.value && e.value.end]
89
- ), U = a.useCallback(
89
+ ), X = a.useCallback(
90
90
  (t) => {
91
91
  switch (t.keyCode) {
92
92
  case m.right:
@@ -132,7 +132,7 @@ const se = (n, s, p) => {
132
132
  }
133
133
  },
134
134
  [l]
135
- ), X = a.useCallback(
135
+ ), F = a.useCallback(
136
136
  (t) => {
137
137
  switch (t.keyCode) {
138
138
  case m.right:
@@ -178,9 +178,9 @@ const se = (n, s, p) => {
178
178
  }
179
179
  },
180
180
  [l, o]
181
- ), F = a.useCallback(
181
+ ), Y = a.useCallback(
182
182
  (t) => {
183
- const u = C(t), v = G(u);
183
+ const u = C(t), v = U(u);
184
184
  L(v), v === "end" ? T.current.focus() : w.current.focus();
185
185
  const I = v === "end" ? r.end : r.start;
186
186
  l({ type: I, payload: u, event: t });
@@ -190,7 +190,7 @@ const se = (n, s, p) => {
190
190
  return ee(
191
191
  R,
192
192
  {
193
- onPress: F,
193
+ onPress: Y,
194
194
  onDrag: (t) => {
195
195
  const u = C(t), v = E === "end" ? r.end : r.start;
196
196
  l({ type: v, payload: u, event: t });
@@ -228,10 +228,10 @@ const se = (n, s, p) => {
228
228
  flexGrow: 1,
229
229
  position: "relative",
230
230
  touchAction: "none",
231
- ...B
231
+ ...G
232
232
  }
233
233
  },
234
- e.children && /* @__PURE__ */ a.createElement("ul", { className: "k-reset k-slider-items", style: { ...q } }, a.Children.map(e.children, (t, u) => t && a.cloneElement(
234
+ e.children && /* @__PURE__ */ a.createElement("ul", { className: "k-reset k-slider-items", style: { ...B } }, a.Children.map(e.children, (t, u) => t && a.cloneElement(
235
235
  t,
236
236
  {
237
237
  position: 100 * (t.props.position - e.min) / (e.max - e.min),
@@ -244,7 +244,7 @@ const se = (n, s, p) => {
244
244
  /* @__PURE__ */ a.createElement(
245
245
  "div",
246
246
  {
247
- ref: _,
247
+ ref: q,
248
248
  className: "k-slider-track",
249
249
  style: e.vertical ? { bottom: 0, height: "100%" } : { [o === "rtl" ? "right" : "left"]: 0, width: "100%" }
250
250
  },
@@ -275,7 +275,7 @@ const se = (n, s, p) => {
275
275
  className: "k-draghandle k-draghandle-start",
276
276
  title: M.toLanguageString($, z[$]),
277
277
  style: e.vertical ? { bottom: "calc(" + h + "%)", zIndex: 1 } : o === "rtl" ? { right: "calc(" + h + "% - 13px)", zIndex: 1 } : { left: "calc(" + h + "%)", zIndex: 1 },
278
- onKeyDown: U
278
+ onKeyDown: X
279
279
  }
280
280
  ),
281
281
  /* @__PURE__ */ a.createElement(
@@ -292,7 +292,7 @@ const se = (n, s, p) => {
292
292
  className: "k-draghandle k-draghandle-end",
293
293
  title: M.toLanguageString($, z[$]),
294
294
  style: e.vertical ? { bottom: "calc(" + D + "%)", zIndex: 1 } : o === "rtl" ? { right: "calc(" + D + "% - 13px)", zIndex: 1 } : { left: "calc(" + D + "%)", zIndex: 1 },
295
- onKeyDown: X
295
+ onKeyDown: F
296
296
  }
297
297
  )
298
298
  )
@@ -34,6 +34,9 @@ export interface RatingProps extends FormComponentProps {
34
34
  /**
35
35
  * Sets the `tabIndex` attribute.
36
36
  *
37
+ * @remarks
38
+ * This property is related to accessibility.
39
+ *
37
40
  * @example
38
41
  * ```jsx
39
42
  * <Rating tabIndex={0} value={2} />
@@ -240,6 +243,9 @@ export interface RatingProps extends FormComponentProps {
240
243
  /**
241
244
  * Identifies the element(s) which will describe the component.
242
245
  *
246
+ * @remarks
247
+ * This property is related to accessibility.
248
+ *
243
249
  * @example
244
250
  * ```jsx
245
251
  * <Rating ariaDescribedBy="description-id" />
@@ -249,6 +255,9 @@ export interface RatingProps extends FormComponentProps {
249
255
  /**
250
256
  * Identifies the element(s) which will label the component.
251
257
  *
258
+ * @remarks
259
+ * This property is related to accessibility.
260
+ *
252
261
  * @example
253
262
  * ```jsx
254
263
  * <Rating ariaLabelledBy="label-id" />
package/rating/Rating.mjs CHANGED
@@ -12,15 +12,15 @@ import { starOutlineIcon as $, starIcon as K } from "@progress/kendo-svg-icons";
12
12
  import { RatingItem as oe } from "./RatingItem.mjs";
13
13
  import { RATING_ACTION as r, ratingReducer as ie } from "./rating-reducer.mjs";
14
14
  import { calcIsFirstHalf as L, toRound as D, getRemainder as re, isHalf as ce, isSelected as F, isCorrectValue as A } from "./utils/index.mjs";
15
- import { ratingAriaLabel as _, messages as ue } from "../messages/index.mjs";
15
+ import { ratingAriaLabel as X, messages as ue } from "../messages/index.mjs";
16
16
  import { useLocalization as me } from "@progress/kendo-react-intl";
17
- const X = (n, g, v) => {
17
+ const q = (n, g, v) => {
18
18
  const [e, N] = a.useState(n);
19
19
  return [e, (h) => {
20
20
  const o = ie(g.state || e, { ...h, ...g });
21
21
  v && v(o, h.event), N(o);
22
22
  }];
23
- }, de = se(), q = a.forwardRef((n, g) => {
23
+ }, de = se(), G = a.forwardRef((n, g) => {
24
24
  const v = te(de, n), e = {
25
25
  dir: s.dir,
26
26
  min: s.min,
@@ -38,7 +38,7 @@ const X = (n, g, v) => {
38
38
  element: h.current,
39
39
  props: e
40
40
  })), a.useImperativeHandle(g, () => m.current);
41
- const G = a.useCallback(
41
+ const W = a.useCallback(
42
42
  (t, l) => {
43
43
  e.onChange && m.current && e.onChange.call(void 0, {
44
44
  value: t,
@@ -47,7 +47,7 @@ const X = (n, g, v) => {
47
47
  });
48
48
  },
49
49
  [e.onChange]
50
- ), I = a.useMemo(() => e.min !== void 0 ? e.min : s.min, [e.min]), x = a.useMemo(() => e.max !== void 0 ? e.max : s.max, [e.max]), d = a.useMemo(() => e.precision || s.precision, [e.precision]), i = a.useMemo(() => e.step !== void 0 ? e.step : s.step, [e.step]), V = a.useMemo(() => e.readonly || s.readonly, [e.readonly]), k = a.useMemo(() => e.disabled || s.disabled, [e.disabled]), W = a.useMemo(() => e.item || s.item, [e.item]), [H, p] = X(
50
+ ), I = a.useMemo(() => e.min !== void 0 ? e.min : s.min, [e.min]), x = a.useMemo(() => e.max !== void 0 ? e.max : s.max, [e.max]), d = a.useMemo(() => e.precision || s.precision, [e.precision]), i = a.useMemo(() => e.step !== void 0 ? e.step : s.step, [e.step]), V = a.useMemo(() => e.readonly || s.readonly, [e.readonly]), k = a.useMemo(() => e.disabled || s.disabled, [e.disabled]), _ = a.useMemo(() => e.item || s.item, [e.item]), [H, p] = q(
51
51
  e.defaultValue !== void 0 ? e.defaultValue : s.defaultValue,
52
52
  {
53
53
  state: e.value,
@@ -55,8 +55,8 @@ const X = (n, g, v) => {
55
55
  max: x,
56
56
  step: d === "half" ? i / 2 : i
57
57
  },
58
- G
59
- ), [T, O] = X(null, {
58
+ W
59
+ ), [T, O] = q(null, {
60
60
  state: e.value,
61
61
  min: I,
62
62
  max: x,
@@ -177,7 +177,7 @@ const X = (n, g, v) => {
177
177
  const l = D(t + ee, E), f = d === "half" ? ce(l, C !== null ? C : u !== null ? u : 0, i) : !1, M = F(l, u, i, z), w = F(l, C !== null ? C : u, i, z), b = F(l, C, i, z);
178
178
  P.push(
179
179
  /* @__PURE__ */ a.createElement(
180
- W,
180
+ _,
181
181
  {
182
182
  key: l,
183
183
  value: l,
@@ -261,7 +261,7 @@ const X = (n, g, v) => {
261
261
  "aria-valuemax": x,
262
262
  "aria-valuenow": u !== null ? u : void 0,
263
263
  "aria-disabled": k ? "true" : void 0,
264
- "aria-label": N.toLanguageString(_, ue[_]),
264
+ "aria-label": N.toLanguageString(X, ue[X]),
265
265
  "aria-labelledby": e.ariaLabelledBy,
266
266
  "aria-describedby": e.ariaDescribedBy
267
267
  },
@@ -307,9 +307,9 @@ const X = (n, g, v) => {
307
307
  selection: "continues",
308
308
  precision: "item"
309
309
  };
310
- q.displayName = "KendoReactRating";
311
- q.propTypes = pe;
310
+ G.displayName = "KendoReactRating";
311
+ G.propTypes = pe;
312
312
  export {
313
- q as Rating,
313
+ G as Rating,
314
314
  de as RatingPropsContext
315
315
  };
@@ -21,6 +21,9 @@ export interface RatingItemProps {
21
21
  className?: string;
22
22
  /**
23
23
  * Sets the `tabIndex` attribute.
24
+ *
25
+ * @remarks
26
+ * This property is related to accessibility.
24
27
  */
25
28
  tabIndex?: number;
26
29
  /**
@@ -40,7 +40,7 @@ const s = n.forwardRef((c, u) => {
40
40
  });
41
41
  },
42
42
  [e.onFocus]
43
- ), f = n.useCallback(
43
+ ), h = n.useCallback(
44
44
  (t) => {
45
45
  e.onBlur && e.onBlur.call(void 0, {
46
46
  target: o.current,
@@ -48,7 +48,7 @@ const s = n.forwardRef((c, u) => {
48
48
  });
49
49
  },
50
50
  [e.onBlur]
51
- ), h = n.useCallback(
51
+ ), f = n.useCallback(
52
52
  (t) => {
53
53
  e.onMouseMove && e.onMouseMove.call(void 0, {
54
54
  target: o.current,
@@ -95,10 +95,10 @@ const s = n.forwardRef((c, u) => {
95
95
  onClick: i,
96
96
  onKeyDown: d,
97
97
  onFocus: v,
98
- onBlur: f,
98
+ onBlur: h,
99
99
  onMouseEnter: M,
100
100
  onMouseLeave: m,
101
- onMouseMove: h
101
+ onMouseMove: f
102
102
  },
103
103
  e.children
104
104
  );
@@ -8,16 +8,16 @@
8
8
  import { SignaturePad as Le } from "@progress/kendo-inputs-common";
9
9
  import { Button as T } from "@progress/kendo-react-buttons";
10
10
  import { validatePackage as we, getLicenseMessage as Ie, usePropsContext as Pe, noop as f, useIsomorphicLayoutEffect as De, dispatchEvent as h, classNames as B, kendoThemeMaps as ee, getTabIndex as Te, WatermarkOverlay as Be, createPropsContext as Re } from "@progress/kendo-react-common";
11
- import { Dialog as _e } from "@progress/kendo-react-dialogs";
12
- import { useLocalization as Fe } from "@progress/kendo-react-intl";
11
+ import { Dialog as Fe } from "@progress/kendo-react-dialogs";
12
+ import { useLocalization as _e } from "@progress/kendo-react-intl";
13
13
  import a from "prop-types";
14
14
  import * as o from "react";
15
15
  import { signatureMaximize as te, messages as R, signatureMinimize as oe, signatureClear as ne } from "../messages/index.mjs";
16
16
  import { packageMetadata as ae } from "../package-metadata.mjs";
17
17
  import { hasParent as Ne } from "./utils/index.mjs";
18
18
  import { hyperlinkOpenIcon as re, xIcon as We } from "@progress/kendo-svg-icons";
19
- const qe = 250, Ge = 84, se = 3, le = 2, Ae = "#000000", Ve = "#ffffff", ie = (d) => d !== void 0, je = Re(), _ = o.forwardRef((d, ce) => {
20
- const ue = !we(ae, { component: "Signature" }), de = Ie(ae), F = Pe(je, d), e = o.useMemo(
19
+ const qe = 250, Ge = 84, se = 3, le = 2, Ae = "#000000", Ve = "#ffffff", ie = (d) => d !== void 0, je = Re(), F = o.forwardRef((d, ce) => {
20
+ const ue = !we(ae, { component: "Signature" }), de = Ie(ae), _ = Pe(je, d), e = o.useMemo(
21
21
  () => ({
22
22
  strokeWidth: s.strokeWidth,
23
23
  smooth: s.smooth,
@@ -35,10 +35,10 @@ const qe = 250, Ge = 84, se = 3, le = 2, Ae = "#000000", Ve = "#ffffff", ie = (d
35
35
  size: s.size,
36
36
  rounded: s.rounded,
37
37
  fillMode: s.fillMode,
38
- ...F
38
+ ..._
39
39
  }),
40
- [F]
41
- ), S = Fe(), c = o.useRef(null), g = o.useRef(null), N = o.useRef(null), W = o.useRef(null), z = o.useRef(null), [r, me] = o.useState(), [b, q] = o.useState(!1), [E, G] = o.useState(!1), [k, A] = o.useState(), [pe, fe] = o.useState(), V = ie(e.value) ? e.value : k, [ge, be] = o.useState(!1), p = ie(e.open), m = p ? e.open : ge, ke = e.maximized || E || !e.maximizable || e.disabled, ve = !(e.maximized && !E), ye = !(!(e.value || k) || E || e.readOnly || e.disabled), j = S.toLanguageString(te, R[te]), U = S.toLanguageString(oe, R[oe]), H = S.toLanguageString(ne, R[ne]), O = e.popupScale || se, x = e.exportScale || le, M = (t) => {
40
+ [_]
41
+ ), S = _e(), c = o.useRef(null), g = o.useRef(null), N = o.useRef(null), W = o.useRef(null), z = o.useRef(null), [r, me] = o.useState(), [b, q] = o.useState(!1), [E, G] = o.useState(!1), [k, A] = o.useState(), [pe, fe] = o.useState(), V = ie(e.value) ? e.value : k, [ge, be] = o.useState(!1), p = ie(e.open), m = p ? e.open : ge, ke = e.maximized || E || !e.maximizable || e.disabled, ve = !(e.maximized && !E), ye = !(!(e.value || k) || E || e.readOnly || e.disabled), j = S.toLanguageString(te, R[te]), U = S.toLanguageString(oe, R[oe]), H = S.toLanguageString(ne, R[ne]), O = e.popupScale || se, x = e.exportScale || le, M = (t) => {
42
42
  A(t), e.onChange && e.onChange({ value: t });
43
43
  }, Ce = (t) => {
44
44
  r == null || r.loadImage(t.value), M(t.value);
@@ -262,8 +262,8 @@ const qe = 250, Ge = 84, se = 3, le = 2, Ae = "#000000", Ve = "#ffffff", ie = (d
262
262
  title: H
263
263
  }
264
264
  )),
265
- m && /* @__PURE__ */ o.createElement(_e, { ref: N }, /* @__PURE__ */ o.createElement(
266
- _,
265
+ m && /* @__PURE__ */ o.createElement(Fe, { ref: N }, /* @__PURE__ */ o.createElement(
266
+ F,
267
267
  {
268
268
  ...e,
269
269
  ...Z(),
@@ -278,7 +278,7 @@ const qe = 250, Ge = 84, se = 3, le = 2, Ae = "#000000", Ve = "#ffffff", ie = (d
278
278
  ue && /* @__PURE__ */ o.createElement(Be, { message: de })
279
279
  );
280
280
  });
281
- _.propTypes = {
281
+ F.propTypes = {
282
282
  value: a.string,
283
283
  width: a.number,
284
284
  height: a.number,
@@ -318,8 +318,8 @@ const s = {
318
318
  rounded: void 0,
319
319
  fillMode: void 0
320
320
  };
321
- _.displayName = "KendoSignature";
321
+ F.displayName = "KendoSignature";
322
322
  export {
323
- _ as Signature,
323
+ F as Signature,
324
324
  je as SignaturePropsContext
325
325
  };
@@ -90,6 +90,9 @@ export interface SignatureProps extends FormComponentProps {
90
90
  /**
91
91
  * Identifies the element(s) which will describe the component.
92
92
  *
93
+ * @remarks
94
+ * This property is related to accessibility.
95
+ *
93
96
  * @example
94
97
  * ```jsx
95
98
  * <Signature ariaDescribedBy="description-id" />
@@ -99,6 +102,9 @@ export interface SignatureProps extends FormComponentProps {
99
102
  /**
100
103
  * Identifies the element(s) which will label the component.
101
104
  *
105
+ * @remarks
106
+ * This property is related to accessibility.
107
+ *
102
108
  * @example
103
109
  * ```jsx
104
110
  * <Signature ariaLabelledBy="label-id" />
@@ -108,6 +114,9 @@ export interface SignatureProps extends FormComponentProps {
108
114
  /**
109
115
  * Specifies the accessible label of the Signature.
110
116
  *
117
+ * @remarks
118
+ * This property is related to accessibility.
119
+ *
111
120
  * @example
112
121
  * ```jsx
113
122
  * <Signature ariaLabel="Signature field" />
@@ -154,6 +154,9 @@ export interface SliderProps extends FormComponentProps {
154
154
  /**
155
155
  * Identifies the element(s) which will describe the component.
156
156
  *
157
+ * @remarks
158
+ * This property is related to accessibility.
159
+ *
157
160
  * @example
158
161
  * ```jsx
159
162
  * <Slider ariaDescribedBy="description-id" min={0} max={100} />
@@ -163,6 +166,9 @@ export interface SliderProps extends FormComponentProps {
163
166
  /**
164
167
  * Identifies the element(s) which will label the component.
165
168
  *
169
+ * @remarks
170
+ * This property is related to accessibility.
171
+ *
166
172
  * @example
167
173
  * ```jsx
168
174
  * <Slider ariaLabelledBy="label-id" min={0} max={100} />
@@ -172,6 +178,9 @@ export interface SliderProps extends FormComponentProps {
172
178
  /**
173
179
  * Specifies the accessible label of the Slider.
174
180
  *
181
+ * @remarks
182
+ * This property is related to accessibility.
183
+ *
175
184
  * @example
176
185
  * ```jsx
177
186
  * <Slider ariaLabel="Slider component" min={0} max={100} />
package/slider/Slider.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"),le=require("prop-types"),c=require("@progress/kendo-react-common"),j=require("@progress/kendo-react-intl"),u=require("../messages/index.js"),re=require("./SliderLabel.js"),_=require("@progress/kendo-react-buttons"),g=require("@progress/kendo-svg-icons");function F(e){const k=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const d in e)if(d!=="default"){const b=Object.getOwnPropertyDescriptor(e,d);Object.defineProperty(k,d,b.get?b:{enumerable:!0,get:()=>e[d]})}}return k.default=e,Object.freeze(k)}const i=F(n),r=F(le),v={step:1,largeStep:10,buttons:!1,vertical:!1,disabled:!1,tabIndex:0},T=i.forwardRef((e,k)=>{var K,M,O;const{step:d=v.step,largeStep:b=v.largeStep,vertical:l=v.vertical,disabled:E=v.disabled,tabIndex:U=v.tabIndex}=e,[H,W]=n.useState((K=e.defaultValue)!=null?K:e.min),[X,V]=n.useState(!1),[R,G]=n.useState(e.dir),L=n.useRef(null),h=n.useRef(null),A=n.useMemo(()=>new j.LocalizationService,[]),z=n.useRef(null),N=e.value!==void 0,x=N&&e.value!==void 0?e.value:H,s=n.useMemo(()=>{const{min:t,max:a}=e;return x<t?t:x>a?a:x},[x,e.min,e.max]),y=n.useMemo(()=>{const{min:t,max:a}=e,o=a-t;return o===0?0:(s-t)/o*100},[s,e.min,e.max]),f=(M=e.dir)!=null?M:R;n.useEffect(()=>{if(e.dir===void 0&&h.current){const a=window.getComputedStyle(h.current).direction;a!==R&&G(a)}},[e.dir,R]);const q=n.useCallback(t=>{let a=t;for(;a;){if(a.getAttribute(re.SLIDER_LABEL_ATTRIBUTE))return!0;a=a.parentElement}return!1},[]),m=n.useCallback((t,a)=>{const o=Math.min(Math.max(a,e.min),e.max);N||W(o),c.dispatchEvent(e.onChange,t,z.current,{value:o})},[e.min,e.max,e.onChange,N]),Y=n.useCallback(()=>{V(!0)},[]),J=n.useCallback(()=>{V(!1)},[]),Q=n.useCallback(t=>{let a;t.keyCode===c.Keys.left||t.keyCode===c.Keys.down?a=s-(d||0):t.keyCode===c.Keys.right||t.keyCode===c.Keys.up?a=s+(d||0):t.keyCode===c.Keys.pageDown?a=s-(b||0):t.keyCode===c.Keys.pageUp?a=s+(b||0):t.keyCode===c.Keys.home?a=e.min:t.keyCode===c.Keys.end&&(a=e.max),a!==void 0&&(t.preventDefault(),m(t,a))},[s,d,b,e.min,e.max,m]),Z=n.useCallback(t=>{t.preventDefault(),m(t,s-(d||0))},[s,d,m]),$=n.useCallback(t=>{t.preventDefault(),m(t,s+(d||0))},[s,d,m]),I=n.useCallback(t=>{const a=t.element.getBoundingClientRect();let o;l?o=a.bottom-t.event.clientY:o=f==="rtl"?a.right-t.event.clientX:t.event.clientX-a.left;const C=l?a.height:a.width,S=o/C;m(t,e.min+S*(e.max-e.min))},[l,e.min,e.max,f,m]),p=n.useCallback(t=>{q(t.event.originalEvent.target)||(t.event.isTouch&&t.event.originalEvent.preventDefault(),I(t))},[q,I]),ee=n.useCallback(t=>{t.event.originalEvent.preventDefault(),I(t)},[I]),w=n.useCallback(()=>{h.current&&h.current.focus()},[]),te=n.useCallback(t=>{if(!t.enabled)return t.children;let a,o,C,S;return f==="rtl"?(a=l?g.caretAltUpIcon:g.caretAltLeftIcon,o=l?g.caretAltDownIcon:g.caretAltRightIcon,C=l?"caret-alt-up":"caret-alt-left",S=l?"caret-alt-down":"caret-alt-right"):(a=l?g.caretAltUpIcon:g.caretAltRightIcon,o=l?g.caretAltDownIcon:g.caretAltLeftIcon,C=l?"caret-alt-up":"caret-alt-right",S=l?"caret-alt-down":"caret-alt-left"),i.createElement(i.Fragment,null,i.createElement(_.Button,{className:"k-button-decrease",rounded:"full",icon:S,svgIcon:o,title:t.decrementTitle,onClick:t.decrement}),t.children,i.createElement(_.Button,{className:"k-button-increase",rounded:"full",icon:C,svgIcon:a,title:t.incrementTitle,onClick:t.increment}))},[f,l]);n.useImperativeHandle(k,()=>({props:e,sliderTrack:L.current,focus:w}),[e,w]),n.useEffect(()=>{z.current={props:e,sliderTrack:L.current,focus:w}},[e,w]);const ae=l?{marginTop:"0.5rem",marginBottom:"0.5rem"}:{marginLeft:"0.5rem",marginRight:"0.5rem"},ne=l?{paddingTop:0,height:"100%"}:{};let D;return l?D={bottom:"calc("+y+"%)",zIndex:1}:f==="rtl"?D={right:"calc("+y+"% - 13px)",zIndex:1}:D={left:"calc("+y+"%)",zIndex:1},i.createElement("div",{ref:h,dir:f,id:e.id,style:{gap:0,...e.style},onFocus:Y,onBlur:J,onKeyDown:Q,className:c.classNames("k-slider",{"k-focus":X,"k-disabled":E,"k-slider-horizontal":!l,"k-slider-vertical":l},e.className)},te({enabled:(O=e.buttons)!=null?O:v.buttons,decrement:Z,increment:$,incrementTitle:A.toLanguageString(u.sliderIncreaseValue,u.messages[u.sliderIncreaseValue]),decrementTitle:A.toLanguageString(u.sliderDecreaseValue,u.messages[u.sliderDecreaseValue]),children:i.createElement(c.Draggable,{onDrag:ee,onPress:p,autoScroll:!1},i.createElement("div",{className:"k-slider-track-wrap",style:{flexGrow:1,position:"relative",touchAction:"none",...ae}},e.children&&i.createElement("ul",{className:"k-reset k-slider-items",style:{margin:0,...ne}},i.Children.map(e.children,(t,a)=>t&&i.cloneElement(t,{position:100*(t.props.position-e.min)/(e.max-e.min),vertical:l,firstTick:a===0,lastTick:a===i.Children.count(e.children)-1},t.props.children))),i.createElement("div",{className:"k-slider-track",style:l?{bottom:0,height:"100%"}:{[f==="rtl"?"right":"left"]:0,width:"100%"},ref:L},i.createElement("div",{className:"k-slider-selection",style:l?{height:y+"%"}:{width:y+"%"}}),i.createElement("span",{role:"slider","aria-valuemin":e.min,"aria-valuemax":e.max,"aria-valuenow":s,"aria-valuetext":String(s),"aria-orientation":l?"vertical":void 0,"aria-disabled":E?"true":void 0,"aria-labelledby":e.ariaLabelledBy,"aria-describedby":e.ariaDescribedBy,"aria-label":e.ariaLabel,tabIndex:c.getTabIndex(U,E,void 0),className:"k-draghandle k-draghandle-end",title:A.toLanguageString(u.sliderDragTitle,u.messages[u.sliderDragTitle]),style:D}))))}))});T.displayName="Slider";const P=c.createPropsContext(),B=c.withPropsContext(P,T);B.displayName="KendoReactSlider";B.propTypes={value:r.number,defaultValue:r.number,min:r.number.isRequired,max:r.number.isRequired,step:r.number,largeStep:r.number,onChange:r.func,style:r.object,className:r.string,buttons:r.bool,tabIndex:r.number,disabled:r.bool,vertical:r.bool,id:r.string,ariaDescribedBy:r.string,ariaLabelledBy:r.string,ariaLabel:r.string,dir:r.oneOf(["ltr","rtl"]),children:r.node};j.registerForLocalization(T);exports.Slider=B;exports.SliderPropsContext=P;exports.SliderWithoutContext=T;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),i=require("prop-types"),c=require("@progress/kendo-react-common"),F=require("@progress/kendo-react-intl"),u=require("../messages/index.js"),ne=require("./SliderLabel.js"),j=require("@progress/kendo-react-buttons"),g=require("@progress/kendo-svg-icons");function le(e){const k=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const d in e)if(d!=="default"){const b=Object.getOwnPropertyDescriptor(e,d);Object.defineProperty(k,d,b.get?b:{enumerable:!0,get:()=>e[d]})}}return k.default=e,Object.freeze(k)}const r=le(n),v={step:1,largeStep:10,buttons:!1,vertical:!1,disabled:!1,tabIndex:0},T=r.forwardRef((e,k)=>{var K,M,O;const{step:d=v.step,largeStep:b=v.largeStep,vertical:l=v.vertical,disabled:E=v.disabled,tabIndex:P=v.tabIndex}=e,[U,H]=n.useState((K=e.defaultValue)!=null?K:e.min),[W,V]=n.useState(!1),[R,X]=n.useState(e.dir),L=n.useRef(null),h=n.useRef(null),A=n.useMemo(()=>new F.LocalizationService,[]),z=n.useRef(null),N=e.value!==void 0,x=N&&e.value!==void 0?e.value:U,s=n.useMemo(()=>{const{min:t,max:a}=e;return x<t?t:x>a?a:x},[x,e.min,e.max]),y=n.useMemo(()=>{const{min:t,max:a}=e,o=a-t;return o===0?0:(s-t)/o*100},[s,e.min,e.max]),f=(M=e.dir)!=null?M:R;n.useEffect(()=>{if(e.dir===void 0&&h.current){const a=window.getComputedStyle(h.current).direction;a!==R&&X(a)}},[e.dir,R]);const q=n.useCallback(t=>{let a=t;for(;a;){if(a.getAttribute(ne.SLIDER_LABEL_ATTRIBUTE))return!0;a=a.parentElement}return!1},[]),m=n.useCallback((t,a)=>{const o=Math.min(Math.max(a,e.min),e.max);N||H(o),c.dispatchEvent(e.onChange,t,z.current,{value:o})},[e.min,e.max,e.onChange,N]),G=n.useCallback(()=>{V(!0)},[]),Y=n.useCallback(()=>{V(!1)},[]),J=n.useCallback(t=>{let a;t.keyCode===c.Keys.left||t.keyCode===c.Keys.down?a=s-(d||0):t.keyCode===c.Keys.right||t.keyCode===c.Keys.up?a=s+(d||0):t.keyCode===c.Keys.pageDown?a=s-(b||0):t.keyCode===c.Keys.pageUp?a=s+(b||0):t.keyCode===c.Keys.home?a=e.min:t.keyCode===c.Keys.end&&(a=e.max),a!==void 0&&(t.preventDefault(),m(t,a))},[s,d,b,e.min,e.max,m]),Q=n.useCallback(t=>{t.preventDefault(),m(t,s-(d||0))},[s,d,m]),Z=n.useCallback(t=>{t.preventDefault(),m(t,s+(d||0))},[s,d,m]),I=n.useCallback(t=>{const a=t.element.getBoundingClientRect();let o;l?o=a.bottom-t.event.clientY:o=f==="rtl"?a.right-t.event.clientX:t.event.clientX-a.left;const C=l?a.height:a.width,S=o/C;m(t,e.min+S*(e.max-e.min))},[l,e.min,e.max,f,m]),$=n.useCallback(t=>{q(t.event.originalEvent.target)||(t.event.isTouch&&t.event.originalEvent.preventDefault(),I(t))},[q,I]),p=n.useCallback(t=>{t.event.originalEvent.preventDefault(),I(t)},[I]),w=n.useCallback(()=>{h.current&&h.current.focus()},[]),ee=n.useCallback(t=>{if(!t.enabled)return t.children;let a,o,C,S;return f==="rtl"?(a=l?g.caretAltUpIcon:g.caretAltLeftIcon,o=l?g.caretAltDownIcon:g.caretAltRightIcon,C=l?"caret-alt-up":"caret-alt-left",S=l?"caret-alt-down":"caret-alt-right"):(a=l?g.caretAltUpIcon:g.caretAltRightIcon,o=l?g.caretAltDownIcon:g.caretAltLeftIcon,C=l?"caret-alt-up":"caret-alt-right",S=l?"caret-alt-down":"caret-alt-left"),r.createElement(r.Fragment,null,r.createElement(j.Button,{className:"k-button-decrease",rounded:"full",icon:S,svgIcon:o,title:t.decrementTitle,onClick:t.decrement}),t.children,r.createElement(j.Button,{className:"k-button-increase",rounded:"full",icon:C,svgIcon:a,title:t.incrementTitle,onClick:t.increment}))},[f,l]);n.useImperativeHandle(k,()=>({props:e,sliderTrack:L.current,focus:w}),[e,w]),n.useEffect(()=>{z.current={props:e,sliderTrack:L.current,focus:w}},[e,w]);const te=l?{marginTop:"0.5rem",marginBottom:"0.5rem"}:{marginLeft:"0.5rem",marginRight:"0.5rem"},ae=l?{paddingTop:0,height:"100%"}:{};let D;return l?D={bottom:"calc("+y+"%)",zIndex:1}:f==="rtl"?D={right:"calc("+y+"% - 13px)",zIndex:1}:D={left:"calc("+y+"%)",zIndex:1},r.createElement("div",{ref:h,dir:f,id:e.id,style:{gap:0,...e.style},onFocus:G,onBlur:Y,onKeyDown:J,className:c.classNames("k-slider",{"k-focus":W,"k-disabled":E,"k-slider-horizontal":!l,"k-slider-vertical":l},e.className)},ee({enabled:(O=e.buttons)!=null?O:v.buttons,decrement:Q,increment:Z,incrementTitle:A.toLanguageString(u.sliderIncreaseValue,u.messages[u.sliderIncreaseValue]),decrementTitle:A.toLanguageString(u.sliderDecreaseValue,u.messages[u.sliderDecreaseValue]),children:r.createElement(c.Draggable,{onDrag:p,onPress:$,autoScroll:!1},r.createElement("div",{className:"k-slider-track-wrap",style:{flexGrow:1,position:"relative",touchAction:"none",...te}},e.children&&r.createElement("ul",{className:"k-reset k-slider-items",style:{margin:0,...ae}},r.Children.map(e.children,(t,a)=>t&&r.cloneElement(t,{position:100*(t.props.position-e.min)/(e.max-e.min),vertical:l,firstTick:a===0,lastTick:a===r.Children.count(e.children)-1},t.props.children))),r.createElement("div",{className:"k-slider-track",style:l?{bottom:0,height:"100%"}:{[f==="rtl"?"right":"left"]:0,width:"100%"},ref:L},r.createElement("div",{className:"k-slider-selection",style:l?{height:y+"%"}:{width:y+"%"}}),r.createElement("span",{role:"slider","aria-valuemin":e.min,"aria-valuemax":e.max,"aria-valuenow":s,"aria-valuetext":String(s),"aria-orientation":l?"vertical":void 0,"aria-disabled":E?"true":void 0,"aria-labelledby":e.ariaLabelledBy,"aria-describedby":e.ariaDescribedBy,"aria-label":e.ariaLabel,tabIndex:c.getTabIndex(P,E,void 0),className:"k-draghandle k-draghandle-end",title:A.toLanguageString(u.sliderDragTitle,u.messages[u.sliderDragTitle]),style:D}))))}))});T.displayName="Slider";const _=c.createPropsContext(),B=c.withPropsContext(_,T);B.displayName="KendoReactSlider";B.propTypes={value:i.number,defaultValue:i.number,min:i.number.isRequired,max:i.number.isRequired,step:i.number,largeStep:i.number,onChange:i.func,style:i.object,className:i.string,buttons:i.bool,tabIndex:i.number,disabled:i.bool,vertical:i.bool,id:i.string,ariaDescribedBy:i.string,ariaLabelledBy:i.string,ariaLabel:i.string,dir:i.oneOf(["ltr","rtl"]),children:i.node};F.registerForLocalization(T);exports.Slider=B;exports.SliderPropsContext=_;exports.SliderWithoutContext=T;
package/slider/Slider.mjs CHANGED
@@ -7,7 +7,7 @@
7
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
- import * as i from "prop-types";
10
+ import i from "prop-types";
11
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";
@@ -156,6 +156,9 @@ export interface SwitchProps extends ToggleBaseProps, FormComponentProps {
156
156
  /**
157
157
  * Identifies the element(s) which will label the component.
158
158
  *
159
+ * @remarks
160
+ * This property is related to accessibility.
161
+ *
159
162
  * @example
160
163
  * ```jsx
161
164
  * <Switch ariaLabelledBy="label-id" />
@@ -210,6 +213,9 @@ export interface SwitchProps extends ToggleBaseProps, FormComponentProps {
210
213
  /**
211
214
  * Specifies the [`tabIndex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
212
215
  *
216
+ * @remarks
217
+ * This property is related to accessibility.
218
+ *
213
219
  * @example
214
220
  * ```jsx
215
221
  * <Switch tabIndex={0} />
@@ -228,6 +234,9 @@ export interface SwitchProps extends ToggleBaseProps, FormComponentProps {
228
234
  /**
229
235
  * Specifies the accessible label of the Switch.
230
236
  *
237
+ * @remarks
238
+ * This property is related to accessibility.
239
+ *
231
240
  * @example
232
241
  * ```jsx
233
242
  * <Switch ariaLabel="Toggle switch" />
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 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;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),a=require("prop-types"),i=require("@progress/kendo-react-common"),X=require("@progress/kendo-react-intl"),N=require("../messages/index.js");function Y(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=Y(n),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:I=l.onLabel}=e,[T,j]=n.useState(h||!1),[V,q]=n.useState(!1),o=n.useRef(null),u=n.useRef(null),E=n.useRef(null),v=n.useRef(void 0),B=n.useRef(void 0),D=n.useRef(void 0),P=n.useMemo(()=>new X.LocalizationService,[]),c=n.useMemo(()=>v.current!==void 0?v.current:e.checked!==void 0?e.checked:T,[e.checked,T]),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||P.toLanguageString(N.switchValidation,N.messages[N.switchValidation]))},[b,e.validationMessage,P]),n.useEffect(()=>{o.current&&(D.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)=>{j(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=>{B.current!==t.timeStamp&&(B.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]),$=n.useCallback(t=>{s||(q(!0),M&&M(t))},[s,M]),A=n.useCallback(t=>{s||(q(!1),S&&S(t))},[s,S]);n.useImperativeHandle(m,k,[k]);const G=D.current||e.dir||o.current&&getComputedStyle(o.current).direction||void 0,J=!W||b.valid,Q=i.classNames("k-switch",{[`k-switch-${i.kendoThemeMaps.sizeMap[C]||C}`]:C,"k-switch-on":c,"k-switch-off":!c,"k-focus":V,"k-disabled":s,"k-invalid":!J},e.className),U=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:Q,dir:G,onKeyDown:_,onClick:H,onBlur:A,onFocus:$,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},U,I?d.createElement("span",{className:"k-switch-label-on"},I):"",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 z=i.createPropsContext(),L=i.withIdHOC(i.withPropsContext(z,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=z;exports.SwitchWithoutContext=x;
package/switch/Switch.mjs CHANGED
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import * as d from "react";
9
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";
10
+ import a from "prop-types";
11
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";
@@ -13,19 +13,19 @@ const Pe = ze(), K = a.forwardRef((L, j) => {
13
13
  size: b = i.size,
14
14
  rounded: p = i.rounded,
15
15
  fillMode: P = i.fillMode,
16
- autoFocus: _ = i.autoFocus,
16
+ autoFocus: G = i.autoFocus,
17
17
  flow: x = i.flow,
18
- prefix: G = null,
19
- suffix: J = null,
20
- ariaDescribedBy: Q,
21
- ariaLabelledBy: U,
18
+ prefix: J = null,
19
+ suffix: Q = null,
20
+ ariaDescribedBy: U,
21
+ ariaLabelledBy: W,
22
22
  autoSize: c,
23
- className: W,
24
- defaultValue: X,
23
+ className: X,
24
+ defaultValue: Y,
25
25
  disabled: o,
26
- readOnly: Y,
26
+ readOnly: Z,
27
27
  required: d,
28
- rows: Z,
28
+ rows: _,
29
29
  id: w,
30
30
  name: F,
31
31
  placeholder: ee,
@@ -50,7 +50,7 @@ const Pe = ze(), K = a.forwardRef((L, j) => {
50
50
  t.current && t.current.focus();
51
51
  }, []), O = a.useCallback(() => {
52
52
  t.current && t.current.blur();
53
- }, []), [B, M] = a.useState(X), [ne, A] = a.useState(!1), [se, le] = $(G), [ie, ue] = $(J), f = v !== void 0, m = f ? v : B, N = F || w, n = a.useCallback(() => ({
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
54
  element: t,
55
55
  focus: I,
56
56
  blur: O,
@@ -129,15 +129,15 @@ const Pe = ze(), K = a.forwardRef((L, j) => {
129
129
  }),
130
130
  ref: t,
131
131
  disabled: o,
132
- rows: Z,
132
+ rows: _,
133
133
  placeholder: ee,
134
- readOnly: Y,
134
+ readOnly: Z,
135
135
  required: d,
136
136
  tabIndex: Ce(ae, o),
137
- autoFocus: _,
137
+ autoFocus: G,
138
138
  style: pe,
139
- "aria-labelledby": U,
140
- "aria-describedby": Q,
139
+ "aria-labelledby": W,
140
+ "aria-describedby": U,
141
141
  "aria-multiline": !0,
142
142
  "aria-disabled": o || void 0,
143
143
  "aria-required": d,
@@ -164,7 +164,7 @@ const Pe = ze(), K = a.forwardRef((L, j) => {
164
164
  "!k-flex-col": x === "vertical",
165
165
  "!k-flex-row": x === "horizontal"
166
166
  },
167
- W
167
+ X
168
168
  ),
169
169
  style: te,
170
170
  dir: de
@@ -20,10 +20,16 @@ export interface TextAreaProps extends FormComponentProps, Omit<React.TextareaHT
20
20
  /**
21
21
  * Identifies the element(s) which will describe the component, similar to [HTML aria-describedby attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-describedby_attribute).
22
22
  * For example these elements could contain error or hint message.
23
+ *
24
+ * @remarks
25
+ * This property is related to accessibility.
23
26
  */
24
27
  ariaDescribedBy?: string;
25
28
  /**
26
29
  * Identifies the element(s) which will label the component.
30
+ *
31
+ * @remarks
32
+ * This property is related to accessibility.
27
33
  */
28
34
  ariaLabelledBy?: string;
29
35
  /**
@@ -78,6 +84,9 @@ export interface TextAreaProps extends FormComponentProps, Omit<React.TextareaHT
78
84
  /**
79
85
  * Sets the `tabIndex` property of the TextArea.
80
86
  * Defaults to `0`.
87
+ *
88
+ * @remarks
89
+ * This property is related to accessibility.
81
90
  */
82
91
  tabIndex?: number;
83
92
  /**
@@ -172,11 +181,17 @@ export interface TextAreaProps extends FormComponentProps, Omit<React.TextareaHT
172
181
  resizable?: 'none' | 'vertical' | 'horizontal' | 'both';
173
182
  /**
174
183
  * Represents the `autoFocus` HTML attribute that will be applied to the input element of the TextArea. (Defaults to `false`)
184
+ *
185
+ * @remarks
186
+ * This property is related to accessibility.
175
187
  */
176
188
  autoFocus?: boolean;
177
189
  /**
178
190
  * Sets the HTML attributes of the inner focusable input element.
179
191
  * Attributes which are essential for certain component functionalities cannot be changed.
192
+ *
193
+ * @remarks
194
+ * This property is related to accessibility.
180
195
  */
181
196
  inputAttributes?: React.InputHTMLAttributes<HTMLInputElement>;
182
197
  /**
@@ -74,6 +74,9 @@ export interface TextBoxProps extends Omit<React.InputHTMLAttributes<HTMLInputEl
74
74
  suffix?: CustomComponent<any>;
75
75
  /**
76
76
  * Represents the `autoFocus` HTML attribute that will be applied to the input element of the TextBox. (Defaults to `false`)
77
+ *
78
+ * @remarks
79
+ * This property is related to accessibility.
77
80
  */
78
81
  autoFocus?: boolean;
79
82
  /**
@@ -83,6 +86,9 @@ export interface TextBoxProps extends Omit<React.InputHTMLAttributes<HTMLInputEl
83
86
  /**
84
87
  * Sets the HTML attributes of the inner focusable input element.
85
88
  * Attributes which are essential for certain component functionalities cannot be changed.
89
+ *
90
+ * @remarks
91
+ * This property is related to accessibility.
86
92
  */
87
93
  inputAttributes?: React.InputHTMLAttributes<HTMLInputElement>;
88
94
  }