@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/checkbox/Checkbox.js +1 -1
- package/checkbox/Checkbox.mjs +87 -90
- package/colors/ColorPicker.js +1 -1
- package/colors/ColorPicker.mjs +53 -54
- package/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/index.d.mts +2 -2
- package/index.d.ts +2 -2
- package/numerictextbox/NumericTextBox.js +1 -1
- package/numerictextbox/NumericTextBox.mjs +208 -206
- package/package-metadata.mjs +1 -1
- package/package.json +8 -8
- package/radiobutton/RadioButton.js +1 -1
- package/radiobutton/RadioButton.mjs +21 -22
- package/radiobutton/RadioGroup.js +1 -1
- package/radiobutton/RadioGroup.mjs +54 -55
- package/range-slider/RangeSlider.js +7 -7
- package/range-slider/RangeSlider.mjs +161 -156
- package/rating/Rating.js +3 -3
- package/rating/Rating.mjs +145 -134
- package/rating/RatingItem.js +1 -1
- package/rating/RatingItem.mjs +40 -41
- package/signature/Signature.js +1 -1
- package/signature/Signature.mjs +151 -133
- package/textarea/TextArea.js +1 -1
- package/textarea/TextArea.mjs +64 -65
- package/textbox/Textbox.js +1 -1
- package/textbox/Textbox.mjs +33 -34
package/rating/Rating.mjs
CHANGED
|
@@ -7,98 +7,110 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as a from "react";
|
|
10
|
-
import
|
|
11
|
-
import { createPropsContext as
|
|
12
|
-
import { starOutlineIcon as
|
|
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
|
|
15
|
-
import { calcIsFirstHalf as
|
|
16
|
-
import { ratingAriaLabel as
|
|
17
|
-
import { useLocalization as
|
|
18
|
-
const
|
|
19
|
-
const [
|
|
20
|
-
return [
|
|
21
|
-
const
|
|
22
|
-
|
|
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
|
-
},
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
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, () =>
|
|
30
|
-
const
|
|
41
|
+
})), a.useImperativeHandle(g, () => m.current);
|
|
42
|
+
const W = a.useCallback(
|
|
31
43
|
(t, l) => {
|
|
32
|
-
e.onChange &&
|
|
44
|
+
e.onChange && m.current && e.onChange.call(void 0, {
|
|
33
45
|
value: t,
|
|
34
|
-
target:
|
|
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.
|
|
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 ||
|
|
58
|
+
() => e.precision || s.precision,
|
|
47
59
|
[e.precision]
|
|
48
|
-
),
|
|
49
|
-
() => e.step !== void 0 ? e.step :
|
|
60
|
+
), i = a.useMemo(
|
|
61
|
+
() => e.step !== void 0 ? e.step : s.step,
|
|
50
62
|
[e.step]
|
|
51
|
-
),
|
|
52
|
-
() => e.readonly ||
|
|
63
|
+
), V = a.useMemo(
|
|
64
|
+
() => e.readonly || s.readonly,
|
|
53
65
|
[e.readonly]
|
|
54
66
|
), k = a.useMemo(
|
|
55
|
-
() => e.disabled ||
|
|
67
|
+
() => e.disabled || s.disabled,
|
|
56
68
|
[e.disabled]
|
|
57
|
-
),
|
|
58
|
-
() => e.item ||
|
|
69
|
+
), _ = a.useMemo(
|
|
70
|
+
() => e.item || s.item,
|
|
59
71
|
[e.item]
|
|
60
|
-
), [
|
|
61
|
-
e.defaultValue !== void 0 ? e.defaultValue :
|
|
72
|
+
), [H, p] = q(
|
|
73
|
+
e.defaultValue !== void 0 ? e.defaultValue : s.defaultValue,
|
|
62
74
|
{
|
|
63
75
|
state: e.value,
|
|
64
|
-
min:
|
|
65
|
-
max:
|
|
66
|
-
step: d === "half" ?
|
|
76
|
+
min: I,
|
|
77
|
+
max: x,
|
|
78
|
+
step: d === "half" ? i / 2 : i
|
|
67
79
|
},
|
|
68
|
-
|
|
69
|
-
), [T, O] =
|
|
80
|
+
W
|
|
81
|
+
), [T, O] = q(
|
|
70
82
|
null,
|
|
71
83
|
{
|
|
72
84
|
state: e.value,
|
|
73
|
-
min:
|
|
74
|
-
max:
|
|
75
|
-
step: d === "half" ?
|
|
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 :
|
|
80
|
-
[e.value,
|
|
81
|
-
),
|
|
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 ||
|
|
97
|
+
() => e.selection || s.selection,
|
|
86
98
|
[e.selection]
|
|
87
|
-
),
|
|
88
|
-
() =>
|
|
89
|
-
[
|
|
90
|
-
),
|
|
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 ||
|
|
104
|
+
if (!(!t.target || !t.target.element || V || k)) {
|
|
93
105
|
if (d === "half") {
|
|
94
|
-
const l = t.target.element.getBoundingClientRect(),
|
|
95
|
-
p({ type:
|
|
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:
|
|
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:
|
|
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
|
-
),
|
|
121
|
+
), J = a.useCallback(
|
|
110
122
|
(t) => {
|
|
111
|
-
if (!(
|
|
123
|
+
if (!(V || k)) {
|
|
112
124
|
switch (t.keyCode) {
|
|
113
|
-
case
|
|
125
|
+
case R.right:
|
|
114
126
|
t.preventDefault(), p({
|
|
115
|
-
type: o === "rtl" ?
|
|
127
|
+
type: o === "rtl" ? c.decrease : c.increase,
|
|
116
128
|
event: t
|
|
117
129
|
});
|
|
118
130
|
break;
|
|
119
|
-
case
|
|
131
|
+
case R.left:
|
|
120
132
|
t.preventDefault(), p({
|
|
121
|
-
type: o === "rtl" ?
|
|
133
|
+
type: o === "rtl" ? c.increase : c.decrease,
|
|
122
134
|
event: t
|
|
123
135
|
});
|
|
124
136
|
break;
|
|
125
|
-
case
|
|
137
|
+
case R.home:
|
|
126
138
|
t.preventDefault(), p({
|
|
127
|
-
type: o === "rtl" ?
|
|
139
|
+
type: o === "rtl" ? c.min : c.max,
|
|
128
140
|
event: t
|
|
129
141
|
});
|
|
130
142
|
break;
|
|
131
|
-
case
|
|
143
|
+
case R.end:
|
|
132
144
|
t.preventDefault(), p({
|
|
133
|
-
type: o === "rtl" ?
|
|
145
|
+
type: o === "rtl" ? c.max : c.min,
|
|
134
146
|
event: t
|
|
135
147
|
});
|
|
136
148
|
break;
|
|
137
|
-
case
|
|
149
|
+
case R.esc:
|
|
138
150
|
t.preventDefault(), p({
|
|
139
|
-
type:
|
|
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:
|
|
160
|
+
target: m.current,
|
|
149
161
|
syntheticEvent: t
|
|
150
162
|
}
|
|
151
163
|
);
|
|
152
164
|
}
|
|
153
165
|
},
|
|
154
166
|
[e.onKeyDown, p, u]
|
|
155
|
-
),
|
|
167
|
+
), Q = a.useCallback(
|
|
156
168
|
(t) => {
|
|
157
169
|
if (e.onFocus) {
|
|
158
170
|
const l = {
|
|
159
|
-
target:
|
|
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
|
-
),
|
|
181
|
+
), U = a.useCallback(
|
|
170
182
|
(t) => {
|
|
171
183
|
if (e.onBlur) {
|
|
172
184
|
const l = {
|
|
173
|
-
target:
|
|
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
|
-
),
|
|
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(),
|
|
188
|
-
O({ type:
|
|
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:
|
|
202
|
+
O({ type: c.select, payload: t.target.value, event: t.syntheticEvent });
|
|
191
203
|
},
|
|
192
|
-
[d,
|
|
193
|
-
),
|
|
204
|
+
[d, i, o]
|
|
205
|
+
), Z = a.useCallback(
|
|
194
206
|
(t) => {
|
|
195
|
-
O({ type:
|
|
207
|
+
O({ type: c.reset, event: t.syntheticEvent });
|
|
196
208
|
},
|
|
197
209
|
[]
|
|
198
|
-
),
|
|
199
|
-
for (let t =
|
|
200
|
-
const l =
|
|
201
|
-
|
|
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
|
-
|
|
215
|
+
_,
|
|
204
216
|
{
|
|
205
217
|
key: l,
|
|
206
218
|
value: l,
|
|
207
219
|
dir: o,
|
|
208
|
-
title: String(
|
|
220
|
+
title: String(f ? D(l - i / 2, E) : l),
|
|
209
221
|
icon: e.icon,
|
|
210
222
|
svgIcon: e.svgIcon,
|
|
211
|
-
half:
|
|
212
|
-
selected:
|
|
213
|
-
hovered:
|
|
214
|
-
onClick:
|
|
215
|
-
onMouseMove:
|
|
216
|
-
onMouseLeave:
|
|
223
|
+
half: f,
|
|
224
|
+
selected: M || w,
|
|
225
|
+
hovered: b,
|
|
226
|
+
onClick: j,
|
|
227
|
+
onMouseMove: Y,
|
|
228
|
+
onMouseLeave: Z
|
|
217
229
|
},
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
!
|
|
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:
|
|
242
|
+
ref: h,
|
|
231
243
|
role: "slider",
|
|
232
244
|
dir: o,
|
|
233
|
-
tabIndex:
|
|
234
|
-
className:
|
|
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":
|
|
250
|
+
"k-readonly": V,
|
|
239
251
|
"k-disabled": k
|
|
240
252
|
},
|
|
241
253
|
e.className
|
|
242
254
|
),
|
|
243
|
-
onKeyDown:
|
|
244
|
-
onFocus:
|
|
245
|
-
onBlur:
|
|
246
|
-
"aria-valuemin":
|
|
247
|
-
"aria-valuemax":
|
|
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":
|
|
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:
|
|
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
|
-
|
|
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
|
-
}),
|
|
279
|
-
id:
|
|
280
|
-
dir:
|
|
281
|
-
selection:
|
|
282
|
-
precision:
|
|
283
|
-
value: (n, g,
|
|
284
|
-
`Invalid prop + ${g} supplied to ${
|
|
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:
|
|
289
|
-
min:
|
|
290
|
-
max:
|
|
291
|
-
step: (n, g,
|
|
292
|
-
`Invalid prop + ${g} supplied to ${
|
|
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:
|
|
297
|
-
label:
|
|
298
|
-
readonly:
|
|
299
|
-
disabled:
|
|
300
|
-
half:
|
|
301
|
-
icon:
|
|
302
|
-
svgIcon:
|
|
303
|
-
svgIconOutline:
|
|
304
|
-
ariaDescribedBy:
|
|
305
|
-
},
|
|
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
|
-
|
|
318
|
-
|
|
319
|
-
H.defaultProps = m;
|
|
329
|
+
G.displayName = "KendoReactRating";
|
|
330
|
+
G.propTypes = pe;
|
|
320
331
|
export {
|
|
321
|
-
|
|
322
|
-
|
|
332
|
+
G as Rating,
|
|
333
|
+
de as RatingPropsContext
|
|
323
334
|
};
|
package/rating/RatingItem.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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),
|
|
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;
|
package/rating/RatingItem.mjs
CHANGED
|
@@ -7,55 +7,55 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as n from "react";
|
|
10
|
-
import
|
|
11
|
-
import { useDir as
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
n.useImperativeHandle(
|
|
15
|
-
element:
|
|
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(
|
|
19
|
-
const
|
|
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:
|
|
25
|
+
target: o.current,
|
|
26
26
|
syntheticEvent: t
|
|
27
27
|
}
|
|
28
28
|
);
|
|
29
29
|
},
|
|
30
30
|
[e.onClick, e.value]
|
|
31
|
-
),
|
|
31
|
+
), d = n.useCallback(
|
|
32
32
|
(t) => {
|
|
33
33
|
e.onKeyDown && e.onKeyDown.call(
|
|
34
34
|
void 0,
|
|
35
35
|
{
|
|
36
|
-
target:
|
|
36
|
+
target: o.current,
|
|
37
37
|
syntheticEvent: t
|
|
38
38
|
}
|
|
39
39
|
);
|
|
40
40
|
},
|
|
41
41
|
[e.onKeyDown]
|
|
42
|
-
),
|
|
42
|
+
), v = n.useCallback(
|
|
43
43
|
(t) => {
|
|
44
44
|
e.onFocus && e.onFocus.call(
|
|
45
45
|
void 0,
|
|
46
46
|
{
|
|
47
|
-
target:
|
|
47
|
+
target: o.current,
|
|
48
48
|
syntheticEvent: t
|
|
49
49
|
}
|
|
50
50
|
);
|
|
51
51
|
},
|
|
52
52
|
[e.onFocus]
|
|
53
|
-
),
|
|
53
|
+
), h = n.useCallback(
|
|
54
54
|
(t) => {
|
|
55
55
|
e.onBlur && e.onBlur.call(
|
|
56
56
|
void 0,
|
|
57
57
|
{
|
|
58
|
-
target:
|
|
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:
|
|
69
|
+
target: o.current,
|
|
70
70
|
syntheticEvent: t
|
|
71
71
|
}
|
|
72
72
|
);
|
|
73
73
|
},
|
|
74
74
|
[e.onMouseMove]
|
|
75
|
-
),
|
|
75
|
+
), M = n.useCallback(
|
|
76
76
|
(t) => {
|
|
77
77
|
e.onMouseEnter && e.onMouseEnter.call(
|
|
78
78
|
void 0,
|
|
79
79
|
{
|
|
80
|
-
target:
|
|
80
|
+
target: o.current,
|
|
81
81
|
syntheticEvent: t
|
|
82
82
|
}
|
|
83
83
|
);
|
|
84
84
|
},
|
|
85
85
|
[e.onMouseEnter]
|
|
86
|
-
),
|
|
86
|
+
), m = n.useCallback(
|
|
87
87
|
(t) => {
|
|
88
88
|
e.onMouseLeave && e.onMouseLeave.call(
|
|
89
89
|
void 0,
|
|
90
90
|
{
|
|
91
|
-
target:
|
|
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:
|
|
103
|
-
dir:
|
|
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":
|
|
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:
|
|
118
|
-
onKeyDown:
|
|
119
|
-
onFocus:
|
|
120
|
-
onBlur:
|
|
121
|
-
onMouseEnter:
|
|
122
|
-
onMouseLeave:
|
|
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:
|
|
129
|
-
icon:
|
|
130
|
-
dir:
|
|
131
|
-
title:
|
|
132
|
-
value:
|
|
133
|
-
half:
|
|
134
|
-
selected:
|
|
135
|
-
hovered:
|
|
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
|
-
|
|
140
|
-
|
|
141
|
-
c.defaultProps = b;
|
|
139
|
+
s.displayName = "KendoReactRatingItem";
|
|
140
|
+
s.propTypes = k;
|
|
142
141
|
export {
|
|
143
|
-
|
|
142
|
+
s as RatingItem
|
|
144
143
|
};
|