@progress/kendo-react-inputs 13.4.0-develop.1 → 13.4.0-develop.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/checkbox/Checkbox.mjs +22 -22
- package/colors/ColorGradient.mjs +4 -4
- package/colors/ColorPicker.mjs +11 -11
- package/colors/FlatColorPicker.mjs +11 -11
- package/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/index.d.mts +1 -1
- package/index.d.ts +1 -1
- package/input/Input.mjs +13 -13
- package/maskedtextbox/MaskedTextBox.mjs +14 -14
- package/numerictextbox/NumericTextBox.mjs +7 -7
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +1 -1
- package/package.json +10 -10
- package/radiobutton/RadioButton.mjs +18 -18
- package/radiobutton/RadioGroup.mjs +15 -15
- package/range-slider/RangeSlider.mjs +15 -15
- package/rating/Rating.mjs +12 -12
- package/rating/RatingItem.mjs +4 -4
- package/signature/Signature.mjs +12 -12
- package/slider/Slider.d.ts +12 -78
- package/slider/Slider.js +1 -1
- package/slider/Slider.mjs +241 -191
- package/switch/Switch.d.ts +9 -124
- package/switch/Switch.js +1 -1
- package/switch/Switch.mjs +187 -209
- package/textarea/TextArea.mjs +20 -20
- package/textbox/Textbox.mjs +18 -18
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
|
|
15
|
+
import { ratingAriaLabel as _, messages as ue } from "../messages/index.mjs";
|
|
16
16
|
import { useLocalization as me } from "@progress/kendo-react-intl";
|
|
17
|
-
const
|
|
17
|
+
const X = (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 = te(),
|
|
23
|
+
}, de = te(), q = a.forwardRef((n, g) => {
|
|
24
24
|
const v = ae(de, n), e = {
|
|
25
25
|
dir: s.dir,
|
|
26
26
|
min: s.min,
|
|
@@ -38,7 +38,7 @@ const q = (n, g, v) => {
|
|
|
38
38
|
element: h.current,
|
|
39
39
|
props: e
|
|
40
40
|
})), a.useImperativeHandle(g, () => m.current);
|
|
41
|
-
const
|
|
41
|
+
const G = 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 q = (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]),
|
|
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(
|
|
51
51
|
e.defaultValue !== void 0 ? e.defaultValue : s.defaultValue,
|
|
52
52
|
{
|
|
53
53
|
state: e.value,
|
|
@@ -55,8 +55,8 @@ const q = (n, g, v) => {
|
|
|
55
55
|
max: x,
|
|
56
56
|
step: d === "half" ? i / 2 : i
|
|
57
57
|
},
|
|
58
|
-
|
|
59
|
-
), [T, O] =
|
|
58
|
+
G
|
|
59
|
+
), [T, O] = X(null, {
|
|
60
60
|
state: e.value,
|
|
61
61
|
min: I,
|
|
62
62
|
max: x,
|
|
@@ -177,7 +177,7 @@ const q = (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
|
-
|
|
180
|
+
W,
|
|
181
181
|
{
|
|
182
182
|
key: l,
|
|
183
183
|
value: l,
|
|
@@ -261,7 +261,7 @@ const q = (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(
|
|
264
|
+
"aria-label": N.toLanguageString(_, ue[_]),
|
|
265
265
|
"aria-labelledby": e.ariaLabelledBy,
|
|
266
266
|
"aria-describedby": e.ariaDescribedBy
|
|
267
267
|
},
|
|
@@ -307,9 +307,9 @@ const q = (n, g, v) => {
|
|
|
307
307
|
selection: "continues",
|
|
308
308
|
precision: "item"
|
|
309
309
|
};
|
|
310
|
-
|
|
311
|
-
|
|
310
|
+
q.displayName = "KendoReactRating";
|
|
311
|
+
q.propTypes = pe;
|
|
312
312
|
export {
|
|
313
|
-
|
|
313
|
+
q as Rating,
|
|
314
314
|
de as RatingPropsContext
|
|
315
315
|
};
|
package/rating/RatingItem.mjs
CHANGED
|
@@ -40,7 +40,7 @@ const s = n.forwardRef((c, u) => {
|
|
|
40
40
|
});
|
|
41
41
|
},
|
|
42
42
|
[e.onFocus]
|
|
43
|
-
),
|
|
43
|
+
), f = 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
|
-
),
|
|
51
|
+
), h = 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:
|
|
98
|
+
onBlur: f,
|
|
99
99
|
onMouseEnter: M,
|
|
100
100
|
onMouseLeave: m,
|
|
101
|
-
onMouseMove:
|
|
101
|
+
onMouseMove: h
|
|
102
102
|
},
|
|
103
103
|
e.children
|
|
104
104
|
);
|
package/signature/Signature.mjs
CHANGED
|
@@ -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 { createPropsContext as we, validatePackage as Ie, getLicenseMessage as Pe, usePropsContext as De, noop as f, useIsomorphicLayoutEffect as Te, dispatchEvent as h, classNames as B, kendoThemeMaps as ee, getTabIndex as Be, WatermarkOverlay as Re } from "@progress/kendo-react-common";
|
|
11
|
-
import { Dialog as
|
|
12
|
-
import { useLocalization as
|
|
11
|
+
import { Dialog as _e } from "@progress/kendo-react-dialogs";
|
|
12
|
+
import { useLocalization as Fe } 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 = we(),
|
|
20
|
-
const ue = !Ie(ae, { component: "Signature" }), de = Pe(ae),
|
|
19
|
+
const qe = 250, Ge = 84, se = 3, le = 2, Ae = "#000000", Ve = "#ffffff", ie = (d) => d !== void 0, je = we(), _ = o.forwardRef((d, ce) => {
|
|
20
|
+
const ue = !Ie(ae, { component: "Signature" }), de = Pe(ae), F = De(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
|
-
...
|
|
38
|
+
...F
|
|
39
39
|
}),
|
|
40
|
-
[
|
|
41
|
-
), S =
|
|
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) => {
|
|
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(
|
|
266
|
-
|
|
265
|
+
m && /* @__PURE__ */ o.createElement(_e, { ref: N }, /* @__PURE__ */ o.createElement(
|
|
266
|
+
_,
|
|
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(Re, { message: de })
|
|
279
279
|
);
|
|
280
280
|
});
|
|
281
|
-
|
|
281
|
+
_.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
|
-
|
|
321
|
+
_.displayName = "KendoSignature";
|
|
322
322
|
export {
|
|
323
|
-
|
|
323
|
+
_ as Signature,
|
|
324
324
|
je as SignaturePropsContext
|
|
325
325
|
};
|
package/slider/Slider.d.ts
CHANGED
|
@@ -5,14 +5,13 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { default as PropTypes } from 'prop-types';
|
|
9
8
|
import { FormComponentProps, BaseEvent } from '@progress/kendo-react-common';
|
|
10
9
|
import { Direction } from '../interfaces/Direction.js';
|
|
11
10
|
import * as React from 'react';
|
|
12
11
|
/**
|
|
13
12
|
* The arguments for the `onChange` Slider event.
|
|
14
13
|
*/
|
|
15
|
-
export interface SliderChangeEvent extends BaseEvent<
|
|
14
|
+
export interface SliderChangeEvent extends BaseEvent<SliderHandle> {
|
|
16
15
|
/**
|
|
17
16
|
* The current value of the Slider.
|
|
18
17
|
*/
|
|
@@ -189,78 +188,8 @@ export interface SliderProps extends FormComponentProps {
|
|
|
189
188
|
*/
|
|
190
189
|
dir?: Direction;
|
|
191
190
|
}
|
|
192
|
-
/**
|
|
193
|
-
* @hidden
|
|
194
|
-
*/
|
|
195
|
-
interface SliderState {
|
|
196
|
-
value: number;
|
|
197
|
-
focused: boolean;
|
|
198
|
-
dir?: Direction;
|
|
199
|
-
}
|
|
200
191
|
/** @hidden */
|
|
201
|
-
export declare
|
|
202
|
-
static displayName: string;
|
|
203
|
-
/**
|
|
204
|
-
* @hidden
|
|
205
|
-
*/
|
|
206
|
-
static propTypes: {
|
|
207
|
-
min: PropTypes.Validator<number>;
|
|
208
|
-
max: PropTypes.Validator<number>;
|
|
209
|
-
value: PropTypes.Requireable<number>;
|
|
210
|
-
vertical: PropTypes.Requireable<boolean>;
|
|
211
|
-
id: PropTypes.Requireable<string>;
|
|
212
|
-
ariaLabelledBy: PropTypes.Requireable<string>;
|
|
213
|
-
ariaDescribedBy: PropTypes.Requireable<string>;
|
|
214
|
-
ariaLabel: PropTypes.Requireable<string>;
|
|
215
|
-
};
|
|
216
|
-
/**
|
|
217
|
-
* @hidden
|
|
218
|
-
*/
|
|
219
|
-
static getDerivedStateFromProps(props: SliderProps, state: SliderState): {
|
|
220
|
-
value: number;
|
|
221
|
-
} | null;
|
|
222
|
-
/**
|
|
223
|
-
* @hidden
|
|
224
|
-
*/
|
|
225
|
-
state: {
|
|
226
|
-
value: number;
|
|
227
|
-
focused: boolean;
|
|
228
|
-
dir: Direction | undefined;
|
|
229
|
-
};
|
|
230
|
-
private _sliderTrack;
|
|
231
|
-
private _element;
|
|
232
|
-
constructor(props: SliderProps);
|
|
233
|
-
/**
|
|
234
|
-
* @hidden
|
|
235
|
-
*/
|
|
236
|
-
componentDidMount(): void;
|
|
237
|
-
/**
|
|
238
|
-
* @hidden
|
|
239
|
-
*/
|
|
240
|
-
buttons: (props: any) => any;
|
|
241
|
-
/**
|
|
242
|
-
* @hidden
|
|
243
|
-
*/
|
|
244
|
-
render(): React.JSX.Element;
|
|
245
|
-
/**
|
|
246
|
-
* @hidden
|
|
247
|
-
*/
|
|
248
|
-
focus: () => void;
|
|
249
|
-
/**
|
|
250
|
-
* @hidden
|
|
251
|
-
*/
|
|
252
|
-
get sliderTrack(): HTMLDivElement | null;
|
|
253
|
-
private isLabel;
|
|
254
|
-
private onFocus;
|
|
255
|
-
private onBlur;
|
|
256
|
-
private onKeyDown;
|
|
257
|
-
private decrement;
|
|
258
|
-
private increment;
|
|
259
|
-
private dragStart;
|
|
260
|
-
private dragOver;
|
|
261
|
-
private drag;
|
|
262
|
-
private change;
|
|
263
|
-
}
|
|
192
|
+
export declare const SliderWithoutContext: React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<SliderHandle>>;
|
|
264
193
|
/**
|
|
265
194
|
* Represents the PropsContext of the `Slider` component.
|
|
266
195
|
* Used for global configuration of all `Slider` instances.
|
|
@@ -274,15 +203,20 @@ export declare const SliderPropsContext: React.Context<(p: SliderProps) => Slide
|
|
|
274
203
|
* @remarks
|
|
275
204
|
* Supported children components are: {@link SliderLabel}.
|
|
276
205
|
*/
|
|
277
|
-
export interface SliderHandle
|
|
206
|
+
export interface SliderHandle {
|
|
207
|
+
/**
|
|
208
|
+
* The props of the SliderHandle component.
|
|
209
|
+
*/
|
|
210
|
+
props: SliderProps;
|
|
211
|
+
/**
|
|
212
|
+
* Gets the slider track element.
|
|
213
|
+
*/
|
|
214
|
+
sliderTrack: HTMLDivElement | null;
|
|
278
215
|
}
|
|
279
|
-
/** @hidden */
|
|
280
|
-
export type Slider = SliderHandle;
|
|
281
216
|
/**
|
|
282
217
|
* Represents the [KendoReact Slider component](https://www.telerik.com/kendo-react-ui/components/inputs/slider).
|
|
283
218
|
*
|
|
284
219
|
* Accepts properties of type [SliderProps](https://www.telerik.com/kendo-react-ui/components/inputs/api/sliderprops).
|
|
285
220
|
* Obtaining the `ref` returns an object of type [SliderHandle](https://www.telerik.com/kendo-react-ui/components/inputs/api/sliderhandle).
|
|
286
221
|
*/
|
|
287
|
-
export declare const Slider: React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<any>>;
|
|
288
|
-
export {};
|
|
222
|
+
export declare const Slider: React.ForwardRefExoticComponent<Omit<SliderProps & React.RefAttributes<SliderHandle>, "ref"> & React.RefAttributes<any>>;
|
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
|
|
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;
|