@progress/kendo-react-inputs 8.1.0-develop.9 → 8.1.1-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.
package/rating/Rating.mjs CHANGED
@@ -7,98 +7,110 @@
7
7
  */
8
8
  "use client";
9
9
  import * as a from "react";
10
- import i from "prop-types";
11
- import { createPropsContext as ee, usePropsContext as te, useDir as ae, Keys as M, IconWrap as f, toIconName as B, getTabIndex as ne, classNames as le, svgIconPropType as $ } from "@progress/kendo-react-common";
12
- import { starOutlineIcon as K, starIcon as L } from "@progress/kendo-svg-icons";
10
+ import r from "prop-types";
11
+ import { createPropsContext as te, usePropsContext as ae, useDir as ne, Keys as R, IconWrap as y, toIconName as B, getTabIndex as le, classNames as se, svgIconPropType as S } from "@progress/kendo-react-common";
12
+ import { starOutlineIcon as $, starIcon as K } from "@progress/kendo-svg-icons";
13
13
  import { RatingItem as oe } from "./RatingItem.mjs";
14
- import { RATING_ACTION as r, ratingReducer as se } from "./rating-reducer.mjs";
15
- import { calcIsFirstHalf as A, toRound as R, getRemainder as ie, isHalf as re, isSelected as F, isCorrectValue as X } from "./utils/index.mjs";
16
- import { ratingAriaLabel as q, messages as ce } from "../messages/index.mjs";
17
- import { useLocalization as ue } from "@progress/kendo-react-intl";
18
- const G = (n, g, e) => {
19
- const [h, c] = a.useState(n);
20
- return [h, (o) => {
21
- const V = se(g.state || h, { ...o, ...g });
22
- e && e(V, o.event), c(V);
14
+ import { RATING_ACTION as c, ratingReducer as ie } from "./rating-reducer.mjs";
15
+ import { calcIsFirstHalf as L, toRound as D, getRemainder as re, isHalf as ce, isSelected as F, isCorrectValue as A } from "./utils/index.mjs";
16
+ import { ratingAriaLabel as X, messages as ue } from "../messages/index.mjs";
17
+ import { useLocalization as me } from "@progress/kendo-react-intl";
18
+ const q = (n, g, v) => {
19
+ const [e, N] = a.useState(n);
20
+ return [e, (h) => {
21
+ const o = ie(g.state || e, { ...h, ...g });
22
+ v && v(o, h.event), N(o);
23
23
  }];
24
- }, me = ee(), H = a.forwardRef((n, g) => {
25
- const e = te(me, n), h = ue(), c = a.useRef(null), D = a.useRef(null), o = ae(D, e.dir);
26
- a.useImperativeHandle(c, () => ({
27
- element: D.current,
24
+ }, de = te(), G = a.forwardRef((n, g) => {
25
+ const v = ae(de, n), e = {
26
+ dir: s.dir,
27
+ min: s.min,
28
+ max: s.max,
29
+ step: s.step,
30
+ item: s.item,
31
+ defaultValue: s.defaultValue,
32
+ readonly: s.readonly,
33
+ disabled: s.disabled,
34
+ selection: s.selection,
35
+ precision: s.precision,
36
+ ...v
37
+ }, N = me(), m = a.useRef(null), h = a.useRef(null), o = ne(h, e.dir);
38
+ a.useImperativeHandle(m, () => ({
39
+ element: h.current,
28
40
  props: e
29
- })), a.useImperativeHandle(g, () => c.current);
30
- const V = a.useCallback(
41
+ })), a.useImperativeHandle(g, () => m.current);
42
+ const W = a.useCallback(
31
43
  (t, l) => {
32
- e.onChange && c.current && e.onChange.call(void 0, {
44
+ e.onChange && m.current && e.onChange.call(void 0, {
33
45
  value: t,
34
- target: c.current,
46
+ target: m.current,
35
47
  syntheticEvent: l
36
48
  });
37
49
  },
38
50
  [e.onChange]
39
- ), b = a.useMemo(
40
- () => e.min !== void 0 ? e.min : m.min,
41
- [e.min]
42
51
  ), I = a.useMemo(
43
- () => e.max !== void 0 ? e.max : m.max,
52
+ () => e.min !== void 0 ? e.min : s.min,
53
+ [e.min]
54
+ ), x = a.useMemo(
55
+ () => e.max !== void 0 ? e.max : s.max,
44
56
  [e.max]
45
57
  ), d = a.useMemo(
46
- () => e.precision || m.precision,
58
+ () => e.precision || s.precision,
47
59
  [e.precision]
48
- ), s = a.useMemo(
49
- () => e.step !== void 0 ? e.step : m.step,
60
+ ), i = a.useMemo(
61
+ () => e.step !== void 0 ? e.step : s.step,
50
62
  [e.step]
51
- ), w = a.useMemo(
52
- () => e.readonly || m.readonly,
63
+ ), V = a.useMemo(
64
+ () => e.readonly || s.readonly,
53
65
  [e.readonly]
54
66
  ), k = a.useMemo(
55
- () => e.disabled || m.disabled,
67
+ () => e.disabled || s.disabled,
56
68
  [e.disabled]
57
- ), W = a.useMemo(
58
- () => e.item || m.item,
69
+ ), _ = a.useMemo(
70
+ () => e.item || s.item,
59
71
  [e.item]
60
- ), [P, p] = G(
61
- e.defaultValue !== void 0 ? e.defaultValue : m.defaultValue,
72
+ ), [H, p] = q(
73
+ e.defaultValue !== void 0 ? e.defaultValue : s.defaultValue,
62
74
  {
63
75
  state: e.value,
64
- min: b,
65
- max: I,
66
- step: d === "half" ? s / 2 : s
76
+ min: I,
77
+ max: x,
78
+ step: d === "half" ? i / 2 : i
67
79
  },
68
- V
69
- ), [T, O] = G(
80
+ W
81
+ ), [T, O] = q(
70
82
  null,
71
83
  {
72
84
  state: e.value,
73
- min: b,
74
- max: I,
75
- step: d === "half" ? s / 2 : s,
85
+ min: I,
86
+ max: x,
87
+ step: d === "half" ? i / 2 : i,
76
88
  precision: d
77
89
  }
78
90
  ), u = a.useMemo(
79
- () => e.value !== void 0 ? e.value : P,
80
- [e.value, P]
81
- ), x = a.useMemo(
91
+ () => e.value !== void 0 ? e.value : H,
92
+ [e.value, H]
93
+ ), C = a.useMemo(
82
94
  () => T,
83
95
  [T]
84
96
  ), z = a.useMemo(
85
- () => e.selection || m.selection,
97
+ () => e.selection || s.selection,
86
98
  [e.selection]
87
- ), C = a.useMemo(
88
- () => s / (d === "half" ? 2 : 1),
89
- [s, d]
90
- ), _ = a.useCallback(
99
+ ), E = a.useMemo(
100
+ () => i / (d === "half" ? 2 : 1),
101
+ [i, d]
102
+ ), j = a.useCallback(
91
103
  (t) => {
92
- if (!(!t.target || !t.target.element || w || k)) {
104
+ if (!(!t.target || !t.target.element || V || k)) {
93
105
  if (d === "half") {
94
- const l = t.target.element.getBoundingClientRect(), E = A(o || "ltr", l, t.syntheticEvent.clientX) ? R(t.target.value - s / 2, C) : t.target.value;
95
- p({ type: r.select, payload: E, event: t.syntheticEvent });
106
+ const l = t.target.element.getBoundingClientRect(), M = L(o || "ltr", l, t.syntheticEvent.clientX) ? D(t.target.value - i / 2, E) : t.target.value;
107
+ p({ type: c.select, payload: M, event: t.syntheticEvent });
96
108
  } else
97
- p({ type: r.select, payload: t.target.value, event: t.syntheticEvent });
109
+ p({ type: c.select, payload: t.target.value, event: t.syntheticEvent });
98
110
  if (e.onClick) {
99
111
  const l = {
100
112
  value: u,
101
- target: c.current,
113
+ target: m.current,
102
114
  syntheticEvent: t.syntheticEvent
103
115
  };
104
116
  e.onClick.call(void 0, l);
@@ -106,37 +118,37 @@ const G = (n, g, e) => {
106
118
  }
107
119
  },
108
120
  [e.onClick, p, u]
109
- ), j = a.useCallback(
121
+ ), J = a.useCallback(
110
122
  (t) => {
111
- if (!(w || k)) {
123
+ if (!(V || k)) {
112
124
  switch (t.keyCode) {
113
- case M.right:
125
+ case R.right:
114
126
  t.preventDefault(), p({
115
- type: o === "rtl" ? r.decrease : r.increase,
127
+ type: o === "rtl" ? c.decrease : c.increase,
116
128
  event: t
117
129
  });
118
130
  break;
119
- case M.left:
131
+ case R.left:
120
132
  t.preventDefault(), p({
121
- type: o === "rtl" ? r.increase : r.decrease,
133
+ type: o === "rtl" ? c.increase : c.decrease,
122
134
  event: t
123
135
  });
124
136
  break;
125
- case M.home:
137
+ case R.home:
126
138
  t.preventDefault(), p({
127
- type: o === "rtl" ? r.min : r.max,
139
+ type: o === "rtl" ? c.min : c.max,
128
140
  event: t
129
141
  });
130
142
  break;
131
- case M.end:
143
+ case R.end:
132
144
  t.preventDefault(), p({
133
- type: o === "rtl" ? r.max : r.min,
145
+ type: o === "rtl" ? c.max : c.min,
134
146
  event: t
135
147
  });
136
148
  break;
137
- case M.esc:
149
+ case R.esc:
138
150
  t.preventDefault(), p({
139
- type: r.deselect,
151
+ type: c.deselect,
140
152
  event: t
141
153
  });
142
154
  break;
@@ -145,18 +157,18 @@ const G = (n, g, e) => {
145
157
  void 0,
146
158
  {
147
159
  value: u,
148
- target: c.current,
160
+ target: m.current,
149
161
  syntheticEvent: t
150
162
  }
151
163
  );
152
164
  }
153
165
  },
154
166
  [e.onKeyDown, p, u]
155
- ), J = a.useCallback(
167
+ ), Q = a.useCallback(
156
168
  (t) => {
157
169
  if (e.onFocus) {
158
170
  const l = {
159
- target: c.current,
171
+ target: m.current,
160
172
  syntheticEvent: t
161
173
  };
162
174
  e.onFocus.call(
@@ -166,11 +178,11 @@ const G = (n, g, e) => {
166
178
  }
167
179
  },
168
180
  [e.onFocus]
169
- ), Q = a.useCallback(
181
+ ), U = a.useCallback(
170
182
  (t) => {
171
183
  if (e.onBlur) {
172
184
  const l = {
173
- target: c.current,
185
+ target: m.current,
174
186
  syntheticEvent: t
175
187
  };
176
188
  e.onBlur.call(
@@ -180,45 +192,45 @@ const G = (n, g, e) => {
180
192
  }
181
193
  },
182
194
  [e.onBlur]
183
- ), U = a.useCallback(
195
+ ), Y = a.useCallback(
184
196
  (t) => {
185
197
  if (!(!t.target || !t.target.element))
186
198
  if (d === "half") {
187
- const l = t.target.element.getBoundingClientRect(), E = A(o || "ltr", l, t.syntheticEvent.clientX) ? t.target.value - s / 2 : t.target.value;
188
- O({ type: r.select, payload: E, event: t.syntheticEvent });
199
+ const l = t.target.element.getBoundingClientRect(), M = L(o || "ltr", l, t.syntheticEvent.clientX) ? t.target.value - i / 2 : t.target.value;
200
+ O({ type: c.select, payload: M, event: t.syntheticEvent });
189
201
  } else
190
- O({ type: r.select, payload: t.target.value, event: t.syntheticEvent });
202
+ O({ type: c.select, payload: t.target.value, event: t.syntheticEvent });
191
203
  },
192
- [d, s, o]
193
- ), Y = a.useCallback(
204
+ [d, i, o]
205
+ ), Z = a.useCallback(
194
206
  (t) => {
195
- O({ type: r.reset, event: t.syntheticEvent });
207
+ O({ type: c.reset, event: t.syntheticEvent });
196
208
  },
197
209
  []
198
- ), S = [], Z = ie(R(I - b, C), s);
199
- for (let t = b; t <= I; t = R(t + s, C)) {
200
- const l = R(t + Z, C), v = d === "half" ? re(l, x !== null ? x : u !== null ? u : 0, s) : !1, E = F(l, u, s, z), N = F(l, x !== null ? x : u, s, z), y = F(l, x, s, z);
201
- S.push(
210
+ ), P = [], ee = re(D(x - I, E), i);
211
+ for (let t = I; t <= x; t = D(t + i, E)) {
212
+ 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);
213
+ P.push(
202
214
  /* @__PURE__ */ a.createElement(
203
- W,
215
+ _,
204
216
  {
205
217
  key: l,
206
218
  value: l,
207
219
  dir: o,
208
- title: String(v ? R(l - s / 2, C) : l),
220
+ title: String(f ? D(l - i / 2, E) : l),
209
221
  icon: e.icon,
210
222
  svgIcon: e.svgIcon,
211
- half: v,
212
- selected: E || N,
213
- hovered: y,
214
- onClick: _,
215
- onMouseMove: U,
216
- onMouseLeave: Y
223
+ half: f,
224
+ selected: M || w,
225
+ hovered: b,
226
+ onClick: j,
227
+ onMouseMove: Y,
228
+ onMouseLeave: Z
217
229
  },
218
- v && /* @__PURE__ */ a.createElement("span", { className: "k-rating-precision-complement" }, !(e.icon || e.svgIconOutline) && /* @__PURE__ */ a.createElement(f, { name: "star-outline", icon: K, style: { clipPath: `${o === "rtl" ? "inset(0 50% 0 0)" : "inset(0 0 0 50%)"}` }, size: "xlarge" }), (e.icon || e.svgIconOutline) && /* @__PURE__ */ a.createElement(f, { name: B(`${e.icon}-outline`), icon: e.svgIconOutline, size: "xlarge" })),
219
- v && /* @__PURE__ */ a.createElement("span", { className: "k-rating-precision-part" }, !(e.icon || e.svgIcon) && /* @__PURE__ */ a.createElement(f, { name: "star", icon: L, style: { clipPath: `${o === "rtl" ? "inset(0 0 0 50%)" : "inset(0 50% 0 0)"}` }, size: "xlarge" }), (e.icon || e.svgIcon) && /* @__PURE__ */ a.createElement(f, { name: e.icon ? B(e.icon) : void 0, icon: e.svgIcon, size: "xlarge" })),
220
- v && /* @__PURE__ */ a.createElement("span", { style: { width: "24px", height: "24px", display: "block" } }),
221
- !v && !(e.icon || e.svgIcon) && (y || N && !y) && /* @__PURE__ */ a.createElement(f, { name: "star", icon: L, size: "xlarge" }) || !(e.icon || e.svgIcon) && !y && !N && /* @__PURE__ */ a.createElement(f, { name: "star-outline", icon: K, size: "xlarge" }) || (e.icon || e.svgIcon) && (y || N && !y) && /* @__PURE__ */ a.createElement(f, { name: e.icon, icon: e.svgIcon, size: "xlarge" }) || (e.icon || e.svgIcon) && !y && /* @__PURE__ */ a.createElement(f, { name: B(`${e.icon}-outline`), icon: e.svgIconOutline, size: "xlarge" })
230
+ f && /* @__PURE__ */ a.createElement("span", { className: "k-rating-precision-complement" }, !(e.icon || e.svgIconOutline) && /* @__PURE__ */ a.createElement(y, { name: "star-outline", icon: $, style: { clipPath: `${o === "rtl" ? "inset(0 50% 0 0)" : "inset(0 0 0 50%)"}` }, size: "xlarge" }), (e.icon || e.svgIconOutline) && /* @__PURE__ */ a.createElement(y, { name: B(`${e.icon}-outline`), icon: e.svgIconOutline, size: "xlarge" })),
231
+ f && /* @__PURE__ */ a.createElement("span", { className: "k-rating-precision-part" }, !(e.icon || e.svgIcon) && /* @__PURE__ */ a.createElement(y, { name: "star", icon: K, style: { clipPath: `${o === "rtl" ? "inset(0 0 0 50%)" : "inset(0 50% 0 0)"}` }, size: "xlarge" }), (e.icon || e.svgIcon) && /* @__PURE__ */ a.createElement(y, { name: e.icon ? B(e.icon) : void 0, icon: e.svgIcon, size: "xlarge" })),
232
+ f && /* @__PURE__ */ a.createElement("span", { style: { width: "24px", height: "24px", display: "block" } }),
233
+ !f && !(e.icon || e.svgIcon) && (b || w && !b) && /* @__PURE__ */ a.createElement(y, { name: "star", icon: K, size: "xlarge" }) || !(e.icon || e.svgIcon) && !b && !w && /* @__PURE__ */ a.createElement(y, { name: "star-outline", icon: $, size: "xlarge" }) || (e.icon || e.svgIcon) && (b || w && !b) && /* @__PURE__ */ a.createElement(y, { name: e.icon, icon: e.svgIcon, size: "xlarge" }) || (e.icon || e.svgIcon) && !b && /* @__PURE__ */ a.createElement(y, { name: B(`${e.icon}-outline`), icon: e.svgIconOutline, size: "xlarge" })
222
234
  )
223
235
  );
224
236
  }
@@ -227,27 +239,27 @@ const G = (n, g, e) => {
227
239
  {
228
240
  id: e.id,
229
241
  style: e.style,
230
- ref: D,
242
+ ref: h,
231
243
  role: "slider",
232
244
  dir: o,
233
- tabIndex: ne(e.tabIndex, e.disabled, void 0),
234
- className: le(
245
+ tabIndex: le(e.tabIndex, e.disabled, void 0),
246
+ className: se(
235
247
  "k-rating",
236
248
  {
237
249
  "k-rtl": o === "rtl",
238
- "k-readonly": w,
250
+ "k-readonly": V,
239
251
  "k-disabled": k
240
252
  },
241
253
  e.className
242
254
  ),
243
- onKeyDown: j,
244
- onFocus: J,
245
- onBlur: Q,
246
- "aria-valuemin": b,
247
- "aria-valuemax": I,
255
+ onKeyDown: J,
256
+ onFocus: Q,
257
+ onBlur: U,
258
+ "aria-valuemin": I,
259
+ "aria-valuemax": x,
248
260
  "aria-valuenow": u !== null ? u : void 0,
249
261
  "aria-disabled": k ? "true" : void 0,
250
- "aria-label": h.toLanguageString(q, ce[q]),
262
+ "aria-label": N.toLanguageString(X, ue[X]),
251
263
  "aria-labelledby": e.ariaLabelledBy,
252
264
  "aria-describedby": e.ariaDescribedBy
253
265
  },
@@ -256,7 +268,7 @@ const G = (n, g, e) => {
256
268
  {
257
269
  id: "rating",
258
270
  className: "k-hidden",
259
- readOnly: w,
271
+ readOnly: V,
260
272
  disabled: k
261
273
  }
262
274
  ),
@@ -265,7 +277,7 @@ const G = (n, g, e) => {
265
277
  {
266
278
  className: "k-rating-container"
267
279
  },
268
- S
280
+ P
269
281
  ),
270
282
  e.label && /* @__PURE__ */ a.createElement(
271
283
  "span",
@@ -275,34 +287,34 @@ const G = (n, g, e) => {
275
287
  e.label
276
288
  )
277
289
  );
278
- }), de = {
279
- id: i.string,
280
- dir: i.oneOf(["ltr", "rtl"]),
281
- selection: i.oneOf(["continues", "single"]),
282
- precision: i.oneOf(["item", "half"]),
283
- value: (n, g, e) => n.value && n.min && n.max && n.step && !(n.precision === "half" ? X(n.min, n.max, n.step / 2, n.value) : X(n.min, n.max, n.step, n.value)) && n.precision === "half" ? new Error(
284
- `Invalid prop + ${g} supplied to ${e}.
290
+ }), pe = {
291
+ id: r.string,
292
+ dir: r.oneOf(["ltr", "rtl"]),
293
+ selection: r.oneOf(["continues", "single"]),
294
+ precision: r.oneOf(["item", "half"]),
295
+ value: (n, g, v) => n.value && n.min && n.max && n.step && !(n.precision === "half" ? A(n.min, n.max, n.step / 2, n.value) : A(n.min, n.max, n.step, n.value)) && n.precision === "half" ? new Error(
296
+ `Invalid prop + ${g} supplied to ${v}.
285
297
  The value of the { value } property is not correct, please check your values.
286
298
  `
287
299
  ) : null,
288
- defaultValue: i.number,
289
- min: i.number,
290
- max: i.number,
291
- step: (n, g, e) => n.step !== void 0 && n.step <= 0 ? new Error(
292
- `Invalid prop + ${g} supplied to ${e}.
300
+ defaultValue: r.number,
301
+ min: r.number,
302
+ max: r.number,
303
+ step: (n, g, v) => n.step !== void 0 && n.step <= 0 ? new Error(
304
+ `Invalid prop + ${g} supplied to ${v}.
293
305
  The value of the { step } property is cannot be equal or less than "0", please check your values.
294
306
  `
295
307
  ) : null,
296
- hovered: i.number,
297
- label: i.string,
298
- readonly: i.bool,
299
- disabled: i.bool,
300
- half: i.bool,
301
- icon: i.string,
302
- svgIcon: $,
303
- svgIconOutline: $,
304
- ariaDescribedBy: i.string
305
- }, m = {
308
+ hovered: r.number,
309
+ label: r.string,
310
+ readonly: r.bool,
311
+ disabled: r.bool,
312
+ half: r.bool,
313
+ icon: r.string,
314
+ svgIcon: S,
315
+ svgIconOutline: S,
316
+ ariaDescribedBy: r.string
317
+ }, s = {
306
318
  dir: "ltr",
307
319
  min: 1,
308
320
  max: 5,
@@ -314,10 +326,9 @@ const G = (n, g, e) => {
314
326
  selection: "continues",
315
327
  precision: "item"
316
328
  };
317
- H.displayName = "KendoReactRating";
318
- H.propTypes = de;
319
- H.defaultProps = m;
329
+ G.displayName = "KendoReactRating";
330
+ G.propTypes = pe;
320
331
  export {
321
- H as Rating,
322
- me as RatingPropsContext
332
+ G as Rating,
333
+ de as RatingPropsContext
323
334
  };
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),a=require("prop-types"),r=require("@progress/kendo-react-common");function h(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const c=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,c.get?c:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const l=h(g),u=l.forwardRef((e,o)=>{const t=l.useRef(null),c=l.useRef(null),i=r.useDir(c,e.dir);l.useImperativeHandle(t,()=>({element:c.current,props:e,value:e.value})),l.useImperativeHandle(o,()=>t.current);const s=l.useCallback(n=>{e.onClick&&e.onClick.call(void 0,{value:e.value,target:t.current,syntheticEvent:n})},[e.onClick,e.value]),d=l.useCallback(n=>{e.onKeyDown&&e.onKeyDown.call(void 0,{target:t.current,syntheticEvent:n})},[e.onKeyDown]),v=l.useCallback(n=>{e.onFocus&&e.onFocus.call(void 0,{target:t.current,syntheticEvent:n})},[e.onFocus]),f=l.useCallback(n=>{e.onBlur&&e.onBlur.call(void 0,{target:t.current,syntheticEvent:n})},[e.onBlur]),y=l.useCallback(n=>{e.onMouseMove&&e.onMouseMove.call(void 0,{target:t.current,syntheticEvent:n})},[e.onMouseMove]),M=l.useCallback(n=>{e.onMouseEnter&&e.onMouseEnter.call(void 0,{target:t.current,syntheticEvent:n})},[e.onMouseEnter]),b=l.useCallback(n=>{e.onMouseLeave&&e.onMouseLeave.call(void 0,{target:t.current,syntheticEvent:n})},[e.onMouseLeave]);return l.createElement("span",{id:e.id,ref:c,dir:i,"data-half":e.half,tabIndex:e.tabIndex,title:e.title,style:e.style,className:r.classNames("k-rating-item",{"k-rtl":i==="rtl","k-selected":e.selected,"k-hover":e.hovered},e.className),onClick:s,onKeyDown:d,onFocus:v,onBlur:f,onMouseEnter:M,onMouseLeave:b,onMouseMove:y},e.children)}),m={id:a.string,icon:a.any,dir:a.oneOf(["ltr","rtl"]),title:a.string,value:a.number,half:a.bool,selected:a.bool,hovered:a.bool},k={dir:"ltr"};u.displayName="KendoReactRatingItem";u.propTypes=m;u.defaultProps=k;exports.RatingItem=u;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),l=require("prop-types"),i=require("@progress/kendo-react-common");function h(r){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(s,t,a.get?a:{enumerable:!0,get:()=>r[t]})}}return s.default=r,Object.freeze(s)}const o=h(g),c=o.forwardRef((r,s)=>{const t=o.useRef(null),a=o.useRef(null),e={dir:k.dir,...r},u=i.useDir(a,e.dir);o.useImperativeHandle(t,()=>({element:a.current,props:e,value:e.value})),o.useImperativeHandle(s,()=>t.current);const d=o.useCallback(n=>{e.onClick&&e.onClick.call(void 0,{value:e.value,target:t.current,syntheticEvent:n})},[e.onClick,e.value]),v=o.useCallback(n=>{e.onKeyDown&&e.onKeyDown.call(void 0,{target:t.current,syntheticEvent:n})},[e.onKeyDown]),f=o.useCallback(n=>{e.onFocus&&e.onFocus.call(void 0,{target:t.current,syntheticEvent:n})},[e.onFocus]),y=o.useCallback(n=>{e.onBlur&&e.onBlur.call(void 0,{target:t.current,syntheticEvent:n})},[e.onBlur]),p=o.useCallback(n=>{e.onMouseMove&&e.onMouseMove.call(void 0,{target:t.current,syntheticEvent:n})},[e.onMouseMove]),M=o.useCallback(n=>{e.onMouseEnter&&e.onMouseEnter.call(void 0,{target:t.current,syntheticEvent:n})},[e.onMouseEnter]),b=o.useCallback(n=>{e.onMouseLeave&&e.onMouseLeave.call(void 0,{target:t.current,syntheticEvent:n})},[e.onMouseLeave]);return o.createElement("span",{id:e.id,ref:a,dir:u,"data-half":e.half,tabIndex:e.tabIndex,title:e.title,style:e.style,className:i.classNames("k-rating-item",{"k-rtl":u==="rtl","k-selected":e.selected,"k-hover":e.hovered},e.className),onClick:d,onKeyDown:v,onFocus:f,onBlur:y,onMouseEnter:M,onMouseLeave:b,onMouseMove:p},e.children)}),m={id:l.string,icon:l.any,dir:l.oneOf(["ltr","rtl"]),title:l.string,value:l.number.isRequired,half:l.bool,selected:l.bool,hovered:l.bool},k={dir:"ltr"};c.displayName="KendoReactRatingItem";c.propTypes=m;exports.RatingItem=c;
@@ -7,55 +7,55 @@
7
7
  */
8
8
  "use client";
9
9
  import * as n from "react";
10
- import a from "prop-types";
11
- import { useDir as m, classNames as y } from "@progress/kendo-react-common";
12
- const c = n.forwardRef((e, i) => {
13
- const l = n.useRef(null), o = n.useRef(null), u = m(o, e.dir);
14
- n.useImperativeHandle(l, () => ({
15
- element: o.current,
10
+ import l from "prop-types";
11
+ import { useDir as p, classNames as y } from "@progress/kendo-react-common";
12
+ const s = n.forwardRef((c, u) => {
13
+ const o = n.useRef(null), a = n.useRef(null), e = { dir: b.dir, ...c }, r = p(a, e.dir);
14
+ n.useImperativeHandle(o, () => ({
15
+ element: a.current,
16
16
  props: e,
17
17
  value: e.value
18
- })), n.useImperativeHandle(i, () => l.current);
19
- const s = n.useCallback(
18
+ })), n.useImperativeHandle(u, () => o.current);
19
+ const i = n.useCallback(
20
20
  (t) => {
21
21
  e.onClick && e.onClick.call(
22
22
  void 0,
23
23
  {
24
24
  value: e.value,
25
- target: l.current,
25
+ target: o.current,
26
26
  syntheticEvent: t
27
27
  }
28
28
  );
29
29
  },
30
30
  [e.onClick, e.value]
31
- ), r = n.useCallback(
31
+ ), d = n.useCallback(
32
32
  (t) => {
33
33
  e.onKeyDown && e.onKeyDown.call(
34
34
  void 0,
35
35
  {
36
- target: l.current,
36
+ target: o.current,
37
37
  syntheticEvent: t
38
38
  }
39
39
  );
40
40
  },
41
41
  [e.onKeyDown]
42
- ), d = n.useCallback(
42
+ ), v = n.useCallback(
43
43
  (t) => {
44
44
  e.onFocus && e.onFocus.call(
45
45
  void 0,
46
46
  {
47
- target: l.current,
47
+ target: o.current,
48
48
  syntheticEvent: t
49
49
  }
50
50
  );
51
51
  },
52
52
  [e.onFocus]
53
- ), v = n.useCallback(
53
+ ), h = n.useCallback(
54
54
  (t) => {
55
55
  e.onBlur && e.onBlur.call(
56
56
  void 0,
57
57
  {
58
- target: l.current,
58
+ target: o.current,
59
59
  syntheticEvent: t
60
60
  }
61
61
  );
@@ -66,29 +66,29 @@ const c = n.forwardRef((e, i) => {
66
66
  e.onMouseMove && e.onMouseMove.call(
67
67
  void 0,
68
68
  {
69
- target: l.current,
69
+ target: o.current,
70
70
  syntheticEvent: t
71
71
  }
72
72
  );
73
73
  },
74
74
  [e.onMouseMove]
75
- ), h = n.useCallback(
75
+ ), M = n.useCallback(
76
76
  (t) => {
77
77
  e.onMouseEnter && e.onMouseEnter.call(
78
78
  void 0,
79
79
  {
80
- target: l.current,
80
+ target: o.current,
81
81
  syntheticEvent: t
82
82
  }
83
83
  );
84
84
  },
85
85
  [e.onMouseEnter]
86
- ), M = n.useCallback(
86
+ ), m = n.useCallback(
87
87
  (t) => {
88
88
  e.onMouseLeave && e.onMouseLeave.call(
89
89
  void 0,
90
90
  {
91
- target: l.current,
91
+ target: o.current,
92
92
  syntheticEvent: t
93
93
  }
94
94
  );
@@ -99,8 +99,8 @@ const c = n.forwardRef((e, i) => {
99
99
  "span",
100
100
  {
101
101
  id: e.id,
102
- ref: o,
103
- dir: u,
102
+ ref: a,
103
+ dir: r,
104
104
  "data-half": e.half,
105
105
  tabIndex: e.tabIndex,
106
106
  title: e.title,
@@ -108,37 +108,36 @@ const c = n.forwardRef((e, i) => {
108
108
  className: y(
109
109
  "k-rating-item",
110
110
  {
111
- "k-rtl": u === "rtl",
111
+ "k-rtl": r === "rtl",
112
112
  "k-selected": e.selected,
113
113
  "k-hover": e.hovered
114
114
  },
115
115
  e.className
116
116
  ),
117
- onClick: s,
118
- onKeyDown: r,
119
- onFocus: d,
120
- onBlur: v,
121
- onMouseEnter: h,
122
- onMouseLeave: M,
117
+ onClick: i,
118
+ onKeyDown: d,
119
+ onFocus: v,
120
+ onBlur: h,
121
+ onMouseEnter: M,
122
+ onMouseLeave: m,
123
123
  onMouseMove: f
124
124
  },
125
125
  e.children
126
126
  );
127
127
  }), k = {
128
- id: a.string,
129
- icon: a.any,
130
- dir: a.oneOf(["ltr", "rtl"]),
131
- title: a.string,
132
- value: a.number,
133
- half: a.bool,
134
- selected: a.bool,
135
- hovered: a.bool
128
+ id: l.string,
129
+ icon: l.any,
130
+ dir: l.oneOf(["ltr", "rtl"]),
131
+ title: l.string,
132
+ value: l.number.isRequired,
133
+ half: l.bool,
134
+ selected: l.bool,
135
+ hovered: l.bool
136
136
  }, b = {
137
137
  dir: "ltr"
138
138
  };
139
- c.displayName = "KendoReactRatingItem";
140
- c.propTypes = k;
141
- c.defaultProps = b;
139
+ s.displayName = "KendoReactRatingItem";
140
+ s.propTypes = k;
142
141
  export {
143
- c as RatingItem
142
+ s as RatingItem
144
143
  };