@progress/kendo-react-inputs 15.1.1-develop.3 → 15.2.0-develop.2

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 (42) hide show
  1. package/checkbox/Checkbox.js +1 -1
  2. package/checkbox/Checkbox.mjs +72 -70
  3. package/colors/ColorContrastLabels.js +1 -1
  4. package/colors/ColorContrastLabels.mjs +2 -2
  5. package/colors/ColorGradient.js +1 -1
  6. package/colors/ColorGradient.mjs +51 -52
  7. package/colors/ColorPalette.js +1 -1
  8. package/colors/ColorPalette.mjs +71 -72
  9. package/colors/ColorPicker.js +1 -1
  10. package/colors/ColorPicker.mjs +203 -195
  11. package/colors/FlatColorPicker.d.ts +4 -4
  12. package/colors/FlatColorPicker.js +1 -1
  13. package/colors/FlatColorPicker.mjs +30 -26
  14. package/colors/interfaces/ColorPaletteProps.d.ts +7 -0
  15. package/colors/interfaces/ColorPickerPaletteSettings.d.ts +5 -0
  16. package/dist/cdn/js/kendo-react-inputs.js +1 -1
  17. package/maskedtextbox/MaskedTextBox.d.ts +1 -0
  18. package/maskedtextbox/MaskedTextBox.js +1 -1
  19. package/maskedtextbox/MaskedTextBox.mjs +26 -23
  20. package/maskedtextbox/MaskedTextBoxProps.d.ts +7 -0
  21. package/numerictextbox/NumericTextBox.js +1 -1
  22. package/numerictextbox/NumericTextBox.mjs +2 -2
  23. package/otpinput/OTPInput.js +1 -1
  24. package/otpinput/OTPInput.mjs +141 -143
  25. package/package-metadata.js +1 -1
  26. package/package-metadata.mjs +2 -2
  27. package/package.json +10 -10
  28. package/radiobutton/RadioButton.js +1 -1
  29. package/radiobutton/RadioButton.mjs +32 -30
  30. package/range-slider/RangeSlider.js +11 -11
  31. package/range-slider/RangeSlider.mjs +54 -54
  32. package/rating/Rating.d.ts +12 -0
  33. package/rating/Rating.js +2 -2
  34. package/rating/Rating.mjs +91 -92
  35. package/slider/Slider.d.ts +12 -0
  36. package/slider/Slider.js +1 -1
  37. package/slider/Slider.mjs +69 -64
  38. package/switch/Switch.d.ts +15 -0
  39. package/switch/Switch.js +1 -1
  40. package/switch/Switch.mjs +87 -82
  41. package/textarea/TextArea.js +1 -1
  42. package/textarea/TextArea.mjs +11 -12
package/rating/Rating.mjs CHANGED
@@ -7,28 +7,26 @@
7
7
  */
8
8
  import * as a from "react";
9
9
  import c from "prop-types";
10
- import { usePropsContext as te, useDir as ae, useWebMcpRegister as ne, Keys as E, IconWrap as y, toIconName as O, classNames as le, getTabIndex as se, createPropsContext as oe, svgIconPropType as P } from "@progress/kendo-react-common";
11
- import { RatingItem as ie } from "./RatingItem.mjs";
12
- import { RATING_ACTION as r, ratingReducer as re } from "./rating-reducer.mjs";
13
- import { calcIsFirstHalf as S, toRound as D, getRemainder as ce, isHalf as ue, isSelected as F, isCorrectValue as $ } from "./utils/index.mjs";
14
- import { ratingAriaLabel as K, messages as me } from "../messages/index.mjs";
15
- import { useLocalization as de } from "@progress/kendo-react-intl";
16
- const A = {
10
+ import { usePropsContext as Z, useDir as ee, useWebMcpRegister as te, Keys as E, IconWrap as y, toIconName as z, classNames as ae, getTabIndex as ne, createPropsContext as le, svgIconPropType as $ } from "@progress/kendo-react-common";
11
+ import { RatingItem as se } from "./RatingItem.mjs";
12
+ import { RATING_ACTION as r, ratingReducer as oe } from "./rating-reducer.mjs";
13
+ import { calcIsFirstHalf as K, toRound as D, getRemainder as ie, isHalf as re, isSelected as F, isCorrectValue as L } from "./utils/index.mjs";
14
+ const S = {
17
15
  name: "star",
18
16
  content: '<path d="m22.762 10.668-4.557 3.931 1.389 5.88a1.661 1.661 0 0 1-2.481 1.805L12 19.138l-5.116 3.146a1.661 1.661 0 0 1-2.478-1.805l1.394-5.88-4.557-3.931a1.667 1.667 0 0 1 .943-2.921l5.974-.482 2.304-5.577a1.656 1.656 0 0 1 3.065 0l2.304 5.577 5.973.482a1.667 1.667 0 0 1 .95 2.922z" />',
19
17
  viewBox: "0 0 24 24"
20
- }, W = {
18
+ }, A = {
21
19
  name: "star-outline",
22
20
  content: '<path d="M23.065 8.95a1.44 1.44 0 0 0-1.267-1l-6.101-.493-2.351-5.691a1.454 1.454 0 0 0-2.691 0L8.304 7.454l-6.101.496A1.44 1.44 0 0 0 .936 8.951a1.46 1.46 0 0 0 .433 1.562l4.657 4.011-1.417 5.998a1.46 1.46 0 0 0 .567 1.52 1.43 1.43 0 0 0 1.61.061L12 18.898l5.222 3.211a1.43 1.43 0 0 0 1.611-.061 1.46 1.46 0 0 0 .566-1.52l-1.417-5.998 4.65-4.016a1.46 1.46 0 0 0 .433-1.564m-1.229.644-4.929 4.253a.61.61 0 0 0-.195.599l1.506 6.357a.24.24 0 0 1-.096.261.23.23 0 0 1-.262.009l-5.541-3.404a.61.61 0 0 0-.636 0l-5.54 3.403a.23.23 0 0 1-.263-.01.24.24 0 0 1-.101-.26l1.506-6.358a.61.61 0 0 0-.194-.598l-4.93-4.253a.24.24 0 0 1-.074-.269.23.23 0 0 1 .21-.167l6.471-.522a.61.61 0 0 0 .513-.373l2.493-6.035a.238.238 0 0 1 .444 0l2.494 6.035a.61.61 0 0 0 .512.373l6.472.522a.23.23 0 0 1 .21.167.24.24 0 0 1-.068.269z" />',
23
21
  viewBox: "0 0 24 24"
24
- }, X = (n, g, v) => {
25
- const [e, z] = a.useState(n);
26
- return [e, (h) => {
27
- const o = re(g.state || e, { ...h, ...g });
28
- v && v(o, h.event), z(o);
22
+ }, W = (n, v, g) => {
23
+ const [e, u] = a.useState(n);
24
+ return [e, (o) => {
25
+ const V = oe(v.state || e, { ...o, ...v });
26
+ g && g(V, o.event), u(V);
29
27
  }];
30
- }, pe = oe(), q = a.forwardRef((n, g) => {
31
- const v = te(pe, n), e = {
28
+ }, ce = le(), X = a.forwardRef((n, v) => {
29
+ const g = Z(ce, n), e = {
32
30
  dir: s.dir,
33
31
  min: s.min,
34
32
  max: s.max,
@@ -39,13 +37,13 @@ const A = {
39
37
  disabled: s.disabled,
40
38
  selection: s.selection,
41
39
  precision: s.precision,
42
- ...v
43
- }, z = de(), u = a.useRef(null), h = a.useRef(null), o = ae(h, e.dir);
40
+ ...g
41
+ }, u = a.useRef(null), w = a.useRef(null), o = ee(w, e.dir);
44
42
  a.useImperativeHandle(u, () => ({
45
- element: h.current,
43
+ element: w.current,
46
44
  props: e
47
- })), a.useImperativeHandle(g, () => u.current), ne("rating", u, e, e.webMcp);
48
- const G = a.useCallback(
45
+ })), a.useImperativeHandle(v, () => u.current), te("rating", u, e, e.webMcp);
46
+ const V = a.useCallback(
49
47
  (t, l) => {
50
48
  e.onChange && u.current && e.onChange.call(void 0, {
51
49
  value: t,
@@ -54,32 +52,32 @@ const A = {
54
52
  });
55
53
  },
56
54
  [e.onChange]
57
- ), 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]), w = 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] = X(
55
+ ), h = a.useMemo(() => e.min !== void 0 ? e.min : s.min, [e.min]), I = a.useMemo(() => e.max !== void 0 ? e.max : s.max, [e.max]), m = a.useMemo(() => e.precision || s.precision, [e.precision]), i = a.useMemo(() => e.step !== void 0 ? e.step : s.step, [e.step]), x = a.useMemo(() => e.readonly || s.readonly, [e.readonly]), k = a.useMemo(() => e.disabled || s.disabled, [e.disabled]), q = a.useMemo(() => e.item || s.item, [e.item]), [H, p] = W(
58
56
  e.defaultValue !== void 0 ? e.defaultValue : s.defaultValue,
59
57
  {
60
58
  state: e.value,
61
- min: I,
62
- max: x,
63
- step: d === "half" ? i / 2 : i
59
+ min: h,
60
+ max: I,
61
+ step: m === "half" ? i / 2 : i
64
62
  },
65
- G
66
- ), [L, B] = X(null, {
63
+ V
64
+ ), [T, N] = W(null, {
67
65
  state: e.value,
68
- min: I,
69
- max: x,
70
- step: d === "half" ? i / 2 : i,
71
- precision: d
72
- }), m = a.useMemo(
66
+ min: h,
67
+ max: I,
68
+ step: m === "half" ? i / 2 : i,
69
+ precision: m
70
+ }), d = a.useMemo(
73
71
  () => e.value !== void 0 ? e.value : H,
74
72
  [e.value, H]
75
- ), C = a.useMemo(() => L, [L]), N = a.useMemo(
73
+ ), C = a.useMemo(() => T, [T]), O = a.useMemo(
76
74
  () => e.selection || s.selection,
77
75
  [e.selection]
78
- ), M = a.useMemo(() => i / (d === "half" ? 2 : 1), [i, d]), j = a.useCallback(
76
+ ), M = a.useMemo(() => i / (m === "half" ? 2 : 1), [i, m]), G = a.useCallback(
79
77
  (t) => {
80
- if (!(!t.target || !t.target.element || w || k)) {
81
- if (d === "half") {
82
- const l = t.target.element.getBoundingClientRect(), R = S(o || "ltr", l, t.syntheticEvent.clientX) ? D(t.target.value - i / 2, M) : t.target.value;
78
+ if (!(!t.target || !t.target.element || x || k)) {
79
+ if (m === "half") {
80
+ const l = t.target.element.getBoundingClientRect(), R = K(o || "ltr", l, t.syntheticEvent.clientX) ? D(t.target.value - i / 2, M) : t.target.value;
83
81
  p({ type: r.select, payload: R, event: t.syntheticEvent });
84
82
  } else
85
83
  p({
@@ -89,7 +87,7 @@ const A = {
89
87
  });
90
88
  if (e.onClick) {
91
89
  const l = {
92
- value: m,
90
+ value: d,
93
91
  target: u.current,
94
92
  syntheticEvent: t.syntheticEvent
95
93
  };
@@ -97,10 +95,10 @@ const A = {
97
95
  }
98
96
  }
99
97
  },
100
- [e.onClick, p, m]
101
- ), J = a.useCallback(
98
+ [e.onClick, p, d]
99
+ ), _ = a.useCallback(
102
100
  (t) => {
103
- if (!(w || k)) {
101
+ if (!(x || k)) {
104
102
  switch (t.keyCode) {
105
103
  case E.right:
106
104
  t.preventDefault(), p({
@@ -134,14 +132,14 @@ const A = {
134
132
  break;
135
133
  }
136
134
  e.onKeyDown && e.onKeyDown.call(void 0, {
137
- value: m,
135
+ value: d,
138
136
  target: u.current,
139
137
  syntheticEvent: t
140
138
  });
141
139
  }
142
140
  },
143
- [e.onKeyDown, p, m]
144
- ), Q = a.useCallback(
141
+ [e.onKeyDown, p, d]
142
+ ), j = a.useCallback(
145
143
  (t) => {
146
144
  if (e.onFocus) {
147
145
  const l = {
@@ -152,7 +150,7 @@ const A = {
152
150
  }
153
151
  },
154
152
  [e.onFocus]
155
- ), U = a.useCallback(
153
+ ), J = a.useCallback(
156
154
  (t) => {
157
155
  if (e.onBlur) {
158
156
  const l = {
@@ -163,28 +161,28 @@ const A = {
163
161
  }
164
162
  },
165
163
  [e.onBlur]
166
- ), Y = a.useCallback(
164
+ ), Q = a.useCallback(
167
165
  (t) => {
168
166
  if (!(!t.target || !t.target.element))
169
- if (d === "half") {
170
- const l = t.target.element.getBoundingClientRect(), R = S(o || "ltr", l, t.syntheticEvent.clientX) ? t.target.value - i / 2 : t.target.value;
171
- B({ type: r.select, payload: R, event: t.syntheticEvent });
167
+ if (m === "half") {
168
+ const l = t.target.element.getBoundingClientRect(), R = K(o || "ltr", l, t.syntheticEvent.clientX) ? t.target.value - i / 2 : t.target.value;
169
+ N({ type: r.select, payload: R, event: t.syntheticEvent });
172
170
  } else
173
- B({
171
+ N({
174
172
  type: r.select,
175
173
  payload: t.target.value,
176
174
  event: t.syntheticEvent
177
175
  });
178
176
  },
179
- [d, i, o]
180
- ), Z = a.useCallback((t) => {
181
- B({ type: r.reset, event: t.syntheticEvent });
182
- }, []), T = [], ee = ce(D(x - I, M), i);
183
- for (let t = I || i; t <= x; t = D(t + i, M)) {
184
- const l = D(t + ee, M), f = d === "half" ? ue(l, C !== null ? C : m !== null ? m : 0, i) : !1, R = F(l, m, i, N), V = F(l, C !== null ? C : m, i, N), b = F(l, C, i, N);
185
- T.push(
177
+ [m, i, o]
178
+ ), U = a.useCallback((t) => {
179
+ N({ type: r.reset, event: t.syntheticEvent });
180
+ }, []), P = [], Y = ie(D(I - h, M), i);
181
+ for (let t = h || i; t <= I; t = D(t + i, M)) {
182
+ const l = D(t + Y, M), f = m === "half" ? re(l, C !== null ? C : d !== null ? d : 0, i) : !1, R = F(l, d, i, O), B = F(l, C !== null ? C : d, i, O), b = F(l, C, i, O);
183
+ P.push(
186
184
  /* @__PURE__ */ a.createElement(
187
- _,
185
+ q,
188
186
  {
189
187
  key: l,
190
188
  value: l,
@@ -193,24 +191,24 @@ const A = {
193
191
  icon: e.icon,
194
192
  svgIcon: e.svgIcon,
195
193
  half: f,
196
- selected: R || V,
194
+ selected: R || B,
197
195
  hovered: b,
198
- onClick: j,
199
- onMouseMove: Y,
200
- onMouseLeave: Z
196
+ onClick: G,
197
+ onMouseMove: Q,
198
+ onMouseLeave: U
201
199
  },
202
200
  f && /* @__PURE__ */ a.createElement("span", { className: "k-rating-precision-complement" }, !(e.icon || e.svgIconOutline) && /* @__PURE__ */ a.createElement(
203
201
  y,
204
202
  {
205
203
  name: "star",
206
- icon: W,
204
+ icon: A,
207
205
  style: { clipPath: `${o === "rtl" ? "inset(0 50% 0 0)" : "inset(0 0 0 50%)"}` },
208
206
  size: "xlarge"
209
207
  }
210
208
  ), (e.icon || e.svgIconOutline) && /* @__PURE__ */ a.createElement(
211
209
  y,
212
210
  {
213
- name: O(`${e.icon}-outline`),
211
+ name: z(`${e.icon}-outline`),
214
212
  icon: e.svgIconOutline,
215
213
  size: "xlarge"
216
214
  }
@@ -219,23 +217,23 @@ const A = {
219
217
  y,
220
218
  {
221
219
  name: "star",
222
- icon: A,
220
+ icon: S,
223
221
  style: { clipPath: `${o === "rtl" ? "inset(0 0 0 50%)" : "inset(0 50% 0 0)"}` },
224
222
  size: "xlarge"
225
223
  }
226
224
  ), (e.icon || e.svgIcon) && /* @__PURE__ */ a.createElement(
227
225
  y,
228
226
  {
229
- name: e.icon ? O(e.icon) : void 0,
227
+ name: e.icon ? z(e.icon) : void 0,
230
228
  icon: e.svgIcon,
231
229
  size: "xlarge"
232
230
  }
233
231
  )),
234
232
  f && /* @__PURE__ */ a.createElement("span", { style: { width: "24px", height: "24px", display: "block" } }),
235
- !f && !(e.icon || e.svgIcon) && (b || V && !b) && /* @__PURE__ */ a.createElement(y, { name: "star", icon: A, size: "xlarge" }) || !(e.icon || e.svgIcon) && !b && !V && /* @__PURE__ */ a.createElement(y, { name: "star", icon: W, size: "xlarge" }) || (e.icon || e.svgIcon) && (b || V && !b) && /* @__PURE__ */ a.createElement(y, { name: e.icon, icon: e.svgIcon, size: "xlarge" }) || (e.icon || e.svgIcon) && !b && /* @__PURE__ */ a.createElement(
233
+ !f && !(e.icon || e.svgIcon) && (b || B && !b) && /* @__PURE__ */ a.createElement(y, { name: "star", icon: S, size: "xlarge" }) || !(e.icon || e.svgIcon) && !b && !B && /* @__PURE__ */ a.createElement(y, { name: "star", icon: A, size: "xlarge" }) || (e.icon || e.svgIcon) && (b || B && !b) && /* @__PURE__ */ a.createElement(y, { name: e.icon, icon: e.svgIcon, size: "xlarge" }) || (e.icon || e.svgIcon) && !b && /* @__PURE__ */ a.createElement(
236
234
  y,
237
235
  {
238
- name: O(`${e.icon}-outline`),
236
+ name: z(`${e.icon}-outline`),
239
237
  icon: e.svgIconOutline,
240
238
  size: "xlarge"
241
239
  }
@@ -248,49 +246,50 @@ const A = {
248
246
  {
249
247
  id: e.id,
250
248
  style: e.style,
251
- ref: h,
249
+ ref: w,
252
250
  role: "slider",
253
251
  dir: o,
254
- tabIndex: se(e.tabIndex, e.disabled, void 0),
255
- className: le(
252
+ tabIndex: ne(e.tabIndex, e.disabled, void 0),
253
+ className: ae(
256
254
  "k-rating",
257
255
  {
258
256
  "k-rtl": o === "rtl",
259
- "k-readonly": w,
257
+ "k-readonly": x,
260
258
  "k-disabled": k
261
259
  },
262
260
  e.className
263
261
  ),
264
- onKeyDown: J,
265
- onFocus: Q,
266
- onBlur: U,
267
- "aria-valuemin": I,
268
- "aria-valuemax": x,
269
- "aria-valuenow": m !== null ? m : void 0,
262
+ onKeyDown: _,
263
+ onFocus: j,
264
+ onBlur: J,
265
+ "aria-valuemin": h,
266
+ "aria-valuemax": I,
267
+ "aria-valuenow": d !== null ? d : void 0,
270
268
  "aria-disabled": k ? "true" : void 0,
271
- "aria-label": z.toLanguageString(K, me[K]),
269
+ "aria-readonly": x ? "true" : void 0,
270
+ "aria-label": e.ariaLabel,
272
271
  "aria-labelledby": e.ariaLabelledBy,
273
272
  "aria-describedby": e.ariaDescribedBy
274
273
  },
275
- /* @__PURE__ */ a.createElement("input", { type: "hidden", id: "rating", readOnly: w, disabled: k }),
276
- /* @__PURE__ */ a.createElement("span", { className: "k-rating-container" }, T),
274
+ /* @__PURE__ */ a.createElement("input", { type: "hidden", id: "rating", readOnly: x, disabled: k }),
275
+ /* @__PURE__ */ a.createElement("span", { className: "k-rating-container" }, P),
277
276
  e.label && /* @__PURE__ */ a.createElement("span", { className: "k-rating-label" }, e.label)
278
277
  );
279
- }), ge = {
278
+ }), ue = {
280
279
  id: c.string,
281
280
  dir: c.oneOf(["ltr", "rtl"]),
282
281
  selection: c.oneOf(["continues", "single"]),
283
282
  precision: c.oneOf(["item", "half"]),
284
- value: (n, g, v) => n.value && n.min && n.max && n.step && !(n.precision === "half" ? $(n.min, n.max, n.step / 2, n.value) : $(n.min, n.max, n.step, n.value)) && n.precision === "half" ? new Error(
285
- `Invalid prop + ${g} supplied to ${v}.
283
+ value: (n, v, g) => n.value && n.min && n.max && n.step && !(n.precision === "half" ? L(n.min, n.max, n.step / 2, n.value) : L(n.min, n.max, n.step, n.value)) && n.precision === "half" ? new Error(
284
+ `Invalid prop + ${v} supplied to ${g}.
286
285
  The value of the { value } property is not correct, please check your values.
287
286
  `
288
287
  ) : null,
289
288
  defaultValue: c.number,
290
289
  min: c.number,
291
290
  max: c.number,
292
- step: (n, g, v) => n.step !== void 0 && n.step <= 0 ? new Error(
293
- `Invalid prop + ${g} supplied to ${v}.
291
+ step: (n, v, g) => n.step !== void 0 && n.step <= 0 ? new Error(
292
+ `Invalid prop + ${v} supplied to ${g}.
294
293
  The value of the { step } property is cannot be equal or less than "0", please check your values.
295
294
  `
296
295
  ) : null,
@@ -299,24 +298,24 @@ const A = {
299
298
  readonly: c.bool,
300
299
  disabled: c.bool,
301
300
  icon: c.string,
302
- svgIcon: P,
303
- svgIconOutline: P,
301
+ svgIcon: $,
302
+ svgIconOutline: $,
304
303
  ariaDescribedBy: c.string
305
304
  }, s = {
306
305
  dir: "ltr",
307
306
  min: 0,
308
307
  max: 5,
309
308
  step: 1,
310
- item: ie,
309
+ item: se,
311
310
  defaultValue: null,
312
311
  readonly: !1,
313
312
  disabled: !1,
314
313
  selection: "continues",
315
314
  precision: "item"
316
315
  };
317
- q.displayName = "KendoReactRating";
318
- q.propTypes = ge;
316
+ X.displayName = "KendoReactRating";
317
+ X.propTypes = ue;
319
318
  export {
320
- q as Rating,
321
- pe as RatingPropsContext
319
+ X as Rating,
320
+ ce as RatingPropsContext
322
321
  };
@@ -133,6 +133,18 @@ export interface SliderProps extends FormComponentProps {
133
133
  * ```
134
134
  */
135
135
  disabled?: boolean;
136
+ /**
137
+ * Makes the Slider read-only when set to `true`. The Slider will remain focusable but its value cannot be changed by the user.
138
+ *
139
+ * @remarks
140
+ * This property is related to accessibility.
141
+ *
142
+ * @example
143
+ * ```jsx
144
+ * <Slider readOnly={true} min={0} max={100} />
145
+ * ```
146
+ */
147
+ readOnly?: boolean;
136
148
  /**
137
149
  * Changes the orientation of the Slider to vertical if set to `true`.
138
150
  *
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 a=require("react"),i=require("prop-types"),s=require("@progress/kendo-react-common"),F=require("@progress/kendo-react-intl"),r=require("../messages/index.js"),ae=require("./SliderLabel.js"),j=require("@progress/kendo-react-buttons"),f=require("@progress/kendo-svg-icons");function le(e){const k=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const v=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(k,o,v.get?v:{enumerable:!0,get:()=>e[o]})}}return k.default=e,Object.freeze(k)}const c=le(a),h={step:1,largeStep:10,buttons:!1,vertical:!1,disabled:!1,tabIndex:0},R=c.forwardRef((e,k)=>{var K,M,O;const{step:o=h.step,largeStep:v=h.largeStep,vertical:l=h.vertical,disabled:m=h.disabled,tabIndex:P=h.tabIndex}=e,[U,W]=a.useState((K=e.defaultValue)!=null?K:e.min),[H,z]=a.useState(!1),[E,X]=a.useState(e.dir),N=a.useRef(null),y=a.useRef(null),S=a.useMemo(()=>new F.LocalizationService,[]),A=a.useRef(null),B=e.value!==void 0,w=B&&e.value!==void 0?e.value:U,d=a.useMemo(()=>w<e.min?e.min:w>e.max?e.max:w,[w,e.min,e.max]),C=a.useMemo(()=>{const t=e.max-e.min;return t===0?0:(d-e.min)/t*100},[d,e.min,e.max]),b=(M=e.dir)!=null?M:E;a.useEffect(()=>{if(e.dir===void 0&&y.current){const n=window.getComputedStyle(y.current).direction;n!==E&&X(n)}},[e.dir,E]);const q=a.useCallback(t=>{let n=t;for(;n;){if(n.getAttribute(ae.SLIDER_LABEL_ATTRIBUTE))return!0;n=n.parentElement}return!1},[]),g=a.useCallback((t,n)=>{const u=Math.min(Math.max(n,e.min),e.max);B||W(u),s.dispatchEvent(e.onChange,t,A.current,{value:u})},[e.min,e.max,e.onChange,B]),G=a.useCallback(()=>{z(!0)},[]),Y=a.useCallback(()=>{z(!1)},[]),J=a.useCallback(t=>{if(m)return;let n;t.keyCode===s.Keys.left||t.keyCode===s.Keys.down?n=d-(o||0):t.keyCode===s.Keys.right||t.keyCode===s.Keys.up?n=d+(o||0):t.keyCode===s.Keys.pageDown?n=d-(v||0):t.keyCode===s.Keys.pageUp?n=d+(v||0):t.keyCode===s.Keys.home?n=e.min:t.keyCode===s.Keys.end&&(n=e.max),n!==void 0&&(t.preventDefault(),g(t,n))},[d,o,v,e.min,e.max,g,m]),Q=a.useCallback(t=>{t.preventDefault(),!m&&g(t,d-(o||0))},[d,o,g,m]),Z=a.useCallback(t=>{t.preventDefault(),!m&&g(t,d+(o||0))},[d,o,g,m]),D=a.useCallback(t=>{const n=t.element.getBoundingClientRect();let u;l?u=n.bottom-t.event.clientY:u=b==="rtl"?n.right-t.event.clientX:t.event.clientX-n.left;const x=l?n.height:n.width,I=u/x;g(t,e.min+I*(e.max-e.min))},[l,e.min,e.max,b,g]),$=a.useCallback(t=>{q(t.event.originalEvent.target)||(t.event.isTouch&&t.event.originalEvent.preventDefault(),D(t))},[q,D]),p=a.useCallback(t=>{t.event.originalEvent.preventDefault(),D(t)},[D]),L=a.useCallback(()=>{y.current&&y.current.focus()},[]),ee=a.useCallback(t=>{if(!t.enabled)return t.children;let n,u,x,I;return b==="rtl"?(n=l?f.chevronUpIcon:f.chevronLeftIcon,u=l?f.chevronDownIcon:f.chevronRightIcon,x=l?"chevron-up":"chevron-left",I=l?"chevron-down":"chevron-right"):(n=l?f.chevronUpIcon:f.chevronRightIcon,u=l?f.chevronDownIcon:f.chevronLeftIcon,x=l?"chevron-up":"chevron-right",I=l?"chevron-down":"chevron-left"),c.createElement(c.Fragment,null,c.createElement(j.Button,{className:"k-button-decrease",rounded:"full",icon:I,svgIcon:u,title:t.decrementTitle,onClick:t.decrement}),t.children,c.createElement(j.Button,{className:"k-button-increase",rounded:"full",icon:x,svgIcon:n,title:t.incrementTitle,onClick:t.increment}))},[b,l]);a.useImperativeHandle(k,()=>({props:e,sliderTrack:N.current,focus:L}),[e,L]),s.useWebMcpRegister("slider",A,e,e.webMcp),a.useEffect(()=>{A.current={props:e,sliderTrack:N.current,focus:L}},[e,L]);const te=l?{marginTop:"0.5rem",marginBottom:"0.5rem"}:{marginLeft:"0.5rem",marginRight:"0.5rem"},ne=l?{paddingTop:0,height:"100%"}:{};let T;return l?T={bottom:"calc("+C+"%)",zIndex:1}:b==="rtl"?T={right:"calc("+C+"%)",zIndex:1}:T={left:"calc("+C+"%)",zIndex:1},c.createElement("div",{ref:y,dir:b,id:e.id,"aria-label":e.ariaLabel||S.toLanguageString(r.sliderAriaLabel,r.messages[r.sliderAriaLabel]),style:{gap:0,...e.style},onFocus:G,onBlur:Y,onKeyDown:J,className:s.classNames("k-slider",{"k-focus":H,"k-disabled":m,"k-slider-horizontal":!l,"k-slider-vertical":l},e.className)},ee({enabled:(O=e.buttons)!=null?O:h.buttons,decrement:Q,increment:Z,incrementTitle:S.toLanguageString(r.sliderIncreaseValue,r.messages[r.sliderIncreaseValue]),decrementTitle:S.toLanguageString(r.sliderDecreaseValue,r.messages[r.sliderDecreaseValue]),children:c.createElement(s.Draggable,{onDrag:p,onPress:$,autoScroll:!1},c.createElement("div",{className:"k-slider-track-wrap",style:{flexGrow:1,position:"relative",touchAction:"none",...te}},e.children&&c.createElement("ul",{className:"k-reset k-slider-items","aria-hidden":"true",style:{margin:0,...ne}},c.Children.map(e.children,(t,n)=>t&&c.cloneElement(t,{position:100*(t.props.position-e.min)/(e.max-e.min),vertical:l,firstTick:n===0,lastTick:n===c.Children.count(e.children)-1},t.props.children))),c.createElement("div",{className:"k-slider-track",style:l?{bottom:0,height:"100%"}:{[b==="rtl"?"right":"left"]:0,width:"100%"},ref:N},c.createElement("div",{className:"k-slider-selection",style:l?{height:C+"%"}:{width:C+"%"}}),c.createElement("span",{role:"slider","aria-valuemin":e.min,"aria-valuemax":e.max,"aria-valuenow":d,"aria-orientation":l?"vertical":void 0,"aria-disabled":m?"true":void 0,"aria-labelledby":e.ariaLabelledBy,"aria-describedby":e.ariaDescribedBy,"aria-label":e.ariaLabel||S.toLanguageString(r.sliderAriaLabel,r.messages[r.sliderAriaLabel]),tabIndex:s.getTabIndex(P,m,void 0),className:"k-draghandle k-draghandle-end",title:S.toLanguageString(r.sliderDragTitle,r.messages[r.sliderDragTitle]),style:T}))))}))});R.displayName="Slider";const _=s.createPropsContext(),V=s.withPropsContext(_,R);V.displayName="KendoReactSlider";V.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(R);exports.Slider=V;exports.SliderPropsContext=_;exports.SliderWithoutContext=R;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),i=require("prop-types"),c=require("@progress/kendo-react-common"),_=require("@progress/kendo-react-intl"),m=require("../messages/index.js"),le=require("./SliderLabel.js"),F=require("@progress/kendo-react-buttons"),g=require("@progress/kendo-svg-icons");function ie(e){const y=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const h=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(y,o,h.get?h:{enumerable:!0,get:()=>e[o]})}}return y.default=e,Object.freeze(y)}const r=ie(a),b={step:1,largeStep:10,buttons:!1,vertical:!1,disabled:!1,readOnly:!1,tabIndex:0},R=r.forwardRef((e,y)=>{var M,A,j;const{step:o=b.step,largeStep:h=b.largeStep,vertical:l=b.vertical,disabled:u=b.disabled,tabIndex:U=b.tabIndex,readOnly:z=b.readOnly}=e,[W,H]=a.useState((M=e.defaultValue)!=null?M:e.min),[X,q]=a.useState(!1),[E,G]=a.useState(e.dir),L=a.useRef(null),k=a.useRef(null),N=a.useMemo(()=>new _.LocalizationService,[]),B=a.useRef(null),O=e.value!==void 0,I=O&&e.value!==void 0?e.value:W,s=a.useMemo(()=>I<e.min?e.min:I>e.max?e.max:I,[I,e.min,e.max]),C=a.useMemo(()=>{const t=e.max-e.min;return t===0?0:(s-e.min)/t*100},[s,e.min,e.max]),v=(A=e.dir)!=null?A:E;a.useEffect(()=>{if(e.dir===void 0&&k.current){const n=window.getComputedStyle(k.current).direction;n!==E&&G(n)}},[e.dir,E]);const K=a.useCallback(t=>{let n=t;for(;n;){if(n.getAttribute(le.SLIDER_LABEL_ATTRIBUTE))return!0;n=n.parentElement}return!1},[]),f=a.useCallback((t,n)=>{const d=Math.min(Math.max(n,e.min),e.max);O||H(d),c.dispatchEvent(e.onChange,t,B.current,{value:d})},[e.min,e.max,e.onChange,O]),Y=a.useCallback(()=>{q(!0)},[]),J=a.useCallback(()=>{q(!1)},[]),Q=a.useCallback(t=>{if(u)return;let n;t.keyCode===c.Keys.left||t.keyCode===c.Keys.down?n=s-(o||0):t.keyCode===c.Keys.right||t.keyCode===c.Keys.up?n=s+(o||0):t.keyCode===c.Keys.pageDown?n=s-(h||0):t.keyCode===c.Keys.pageUp?n=s+(h||0):t.keyCode===c.Keys.home?n=e.min:t.keyCode===c.Keys.end&&(n=e.max),n!==void 0&&(t.preventDefault(),f(t,n))},[s,o,h,e.min,e.max,f,u]),Z=a.useCallback(t=>{t.preventDefault(),!u&&f(t,s-(o||0))},[s,o,f,u]),$=a.useCallback(t=>{t.preventDefault(),!u&&f(t,s+(o||0))},[s,o,f,u]),w=a.useCallback(t=>{const n=t.element.getBoundingClientRect();let d;l?d=n.bottom-t.event.clientY:d=v==="rtl"?n.right-t.event.clientX:t.event.clientX-n.left;const S=l?n.height:n.width,x=d/S;f(t,e.min+x*(e.max-e.min))},[l,e.min,e.max,v,f]),p=a.useCallback(t=>{K(t.event.originalEvent.target)||(t.event.isTouch&&t.event.originalEvent.preventDefault(),w(t))},[K,w]),ee=a.useCallback(t=>{t.event.originalEvent.preventDefault(),w(t)},[w]),D=a.useCallback(()=>{k.current&&k.current.focus()},[]),te=a.useCallback(t=>{if(!t.enabled)return t.children;let n,d,S,x;return v==="rtl"?(n=l?g.chevronUpIcon:g.chevronLeftIcon,d=l?g.chevronDownIcon:g.chevronRightIcon,S=l?"chevron-up":"chevron-left",x=l?"chevron-down":"chevron-right"):(n=l?g.chevronUpIcon:g.chevronRightIcon,d=l?g.chevronDownIcon:g.chevronLeftIcon,S=l?"chevron-up":"chevron-right",x=l?"chevron-down":"chevron-left"),r.createElement(r.Fragment,null,r.createElement(F.Button,{className:"k-button-decrease",rounded:"full",icon:x,svgIcon:d,title:t.decrementTitle,onClick:t.decrement}),t.children,r.createElement(F.Button,{className:"k-button-increase",rounded:"full",icon:S,svgIcon:n,title:t.incrementTitle,onClick:t.increment}))},[v,l]);a.useImperativeHandle(y,()=>({props:e,sliderTrack:L.current,focus:D}),[e,D]),c.useWebMcpRegister("slider",B,e,e.webMcp),a.useEffect(()=>{B.current={props:e,sliderTrack:L.current,focus:D}},[e,D]);const ne=l?{marginTop:"0.5rem",marginBottom:"0.5rem"}:{marginLeft:"0.5rem",marginRight:"0.5rem"},ae=l?{paddingTop:0,height:"100%"}:{};let T;return l?T={bottom:"calc("+C+"%)",zIndex:1}:v==="rtl"?T={right:"calc("+C+"%)",zIndex:1}:T={left:"calc("+C+"%)",zIndex:1},r.createElement("div",{ref:k,dir:v,id:e.id,"aria-label":e.ariaLabel,style:{gap:0,...e.style},onFocus:Y,onBlur:J,onKeyDown:Q,className:c.classNames("k-slider",{"k-focus":X,"k-disabled":u,"k-readonly":z,"k-slider-horizontal":!l,"k-slider-vertical":l},e.className)},te({enabled:(j=e.buttons)!=null?j:b.buttons,decrement:Z,increment:$,incrementTitle:N.toLanguageString(m.sliderIncreaseValue,m.messages[m.sliderIncreaseValue]),decrementTitle:N.toLanguageString(m.sliderDecreaseValue,m.messages[m.sliderDecreaseValue]),children:r.createElement(c.Draggable,{onDrag:ee,onPress:p,autoScroll:!1},r.createElement("div",{className:"k-slider-track-wrap",style:{flexGrow:1,position:"relative",touchAction:"none",...ne}},e.children&&r.createElement("ul",{className:"k-reset k-slider-items","aria-hidden":"true",style:{margin:0,...ae}},r.Children.map(e.children,(t,n)=>t&&r.cloneElement(t,{position:100*(t.props.position-e.min)/(e.max-e.min),vertical:l,firstTick:n===0,lastTick:n===r.Children.count(e.children)-1},t.props.children))),r.createElement("div",{className:"k-slider-track",style:l?{bottom:0,height:"100%"}:{[v==="rtl"?"right":"left"]:0,width:"100%"},ref:L},r.createElement("div",{className:"k-slider-selection",style:l?{height:C+"%"}:{width:C+"%"}}),r.createElement("span",{role:"slider","aria-valuemin":e.min,"aria-valuemax":e.max,"aria-valuenow":s,"aria-orientation":l?"vertical":void 0,"aria-disabled":u?"true":void 0,"aria-readonly":z?"true":void 0,"aria-labelledby":e.ariaLabelledBy,"aria-describedby":e.ariaDescribedBy,"aria-label":e.ariaLabel,tabIndex:c.getTabIndex(U,u,void 0),className:"k-draghandle k-draghandle-end",title:N.toLanguageString(m.sliderDragTitle,m.messages[m.sliderDragTitle]),style:T}))))}))});R.displayName="Slider";const P=c.createPropsContext(),V=c.withPropsContext(P,R);V.displayName="KendoReactSlider";V.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,readOnly: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};_.registerForLocalization(R);exports.Slider=V;exports.SliderPropsContext=P;exports.SliderWithoutContext=R;