@progress/kendo-react-inputs 15.1.1-develop.2 → 15.2.0-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/checkbox/Checkbox.js +1 -1
- package/checkbox/Checkbox.mjs +25 -25
- package/colors/ColorPicker.js +1 -1
- package/colors/ColorPicker.mjs +123 -123
- package/colors/FlatColorPicker.js +1 -1
- package/colors/FlatColorPicker.mjs +86 -86
- package/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/numerictextbox/NumericTextBox.js +1 -1
- package/numerictextbox/NumericTextBox.mjs +183 -173
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +10 -10
- package/slider/Slider.js +1 -1
- package/slider/Slider.mjs +103 -103
- package/switch/Switch.js +1 -1
- package/switch/Switch.mjs +56 -54
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-inputs",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.2.0-develop.1",
|
|
4
4
|
"description": "React Inputs offer a customizable interface for users to enter and pick different information. KendoReact Input package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
"@progress/kendo-drawing": "^1.21.2",
|
|
29
29
|
"@progress/kendo-inputs-common": "^3.1.0",
|
|
30
30
|
"@progress/kendo-licensing": "^1.7.2",
|
|
31
|
-
"@progress/kendo-react-animation": "15.
|
|
32
|
-
"@progress/kendo-react-buttons": "15.
|
|
33
|
-
"@progress/kendo-react-common": "15.
|
|
34
|
-
"@progress/kendo-react-dialogs": "15.
|
|
35
|
-
"@progress/kendo-react-layout": "15.
|
|
36
|
-
"@progress/kendo-react-intl": "15.
|
|
37
|
-
"@progress/kendo-react-labels": "15.
|
|
38
|
-
"@progress/kendo-react-popup": "15.
|
|
31
|
+
"@progress/kendo-react-animation": "15.2.0-develop.1",
|
|
32
|
+
"@progress/kendo-react-buttons": "15.2.0-develop.1",
|
|
33
|
+
"@progress/kendo-react-common": "15.2.0-develop.1",
|
|
34
|
+
"@progress/kendo-react-dialogs": "15.2.0-develop.1",
|
|
35
|
+
"@progress/kendo-react-layout": "15.2.0-develop.1",
|
|
36
|
+
"@progress/kendo-react-intl": "15.2.0-develop.1",
|
|
37
|
+
"@progress/kendo-react-labels": "15.2.0-develop.1",
|
|
38
|
+
"@progress/kendo-react-popup": "15.2.0-develop.1",
|
|
39
39
|
"@progress/kendo-svg-icons": "^4.9.0 || ^5.0.0",
|
|
40
40
|
"react": "^18.0.0 || ^19.0.0",
|
|
41
41
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"package": {
|
|
83
83
|
"productName": "KendoReact",
|
|
84
84
|
"productCode": "KENDOUIREACT",
|
|
85
|
-
"publishDate":
|
|
85
|
+
"publishDate": 1784273472,
|
|
86
86
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
87
87
|
}
|
|
88
88
|
},
|
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"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),i=require("prop-types"),c=require("@progress/kendo-react-common"),F=require("@progress/kendo-react-intl"),m=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 b=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(k,o,b.get?b:{enumerable:!0,get:()=>e[o]})}}return k.default=e,Object.freeze(k)}const r=le(a),h={step:1,largeStep:10,buttons:!1,vertical:!1,disabled:!1,tabIndex:0},R=r.forwardRef((e,k)=>{var M,A,O;const{step:o=h.step,largeStep:b=h.largeStep,vertical:l=h.vertical,disabled:u=h.disabled,tabIndex:P=h.tabIndex}=e,[U,W]=a.useState((M=e.defaultValue)!=null?M:e.min),[H,q]=a.useState(!1),[E,X]=a.useState(e.dir),L=a.useRef(null),y=a.useRef(null),N=a.useMemo(()=>new F.LocalizationService,[]),B=a.useRef(null),V=e.value!==void 0,I=V&&e.value!==void 0?e.value:U,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&&y.current){const n=window.getComputedStyle(y.current).direction;n!==E&&X(n)}},[e.dir,E]);const K=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 d=Math.min(Math.max(n,e.min),e.max);V||W(d),c.dispatchEvent(e.onChange,t,B.current,{value:d})},[e.min,e.max,e.onChange,V]),G=a.useCallback(()=>{q(!0)},[]),Y=a.useCallback(()=>{q(!1)},[]),J=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-(b||0):t.keyCode===c.Keys.pageUp?n=s+(b||0):t.keyCode===c.Keys.home?n=e.min:t.keyCode===c.Keys.end&&(n=e.max),n!==void 0&&(t.preventDefault(),g(t,n))},[s,o,b,e.min,e.max,g,u]),Q=a.useCallback(t=>{t.preventDefault(),!u&&g(t,s-(o||0))},[s,o,g,u]),Z=a.useCallback(t=>{t.preventDefault(),!u&&g(t,s+(o||0))},[s,o,g,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;g(t,e.min+x*(e.max-e.min))},[l,e.min,e.max,v,g]),$=a.useCallback(t=>{K(t.event.originalEvent.target)||(t.event.isTouch&&t.event.originalEvent.preventDefault(),w(t))},[K,w]),p=a.useCallback(t=>{t.event.originalEvent.preventDefault(),w(t)},[w]),D=a.useCallback(()=>{y.current&&y.current.focus()},[]),ee=a.useCallback(t=>{if(!t.enabled)return t.children;let n,d,S,x;return v==="rtl"?(n=l?f.chevronUpIcon:f.chevronLeftIcon,d=l?f.chevronDownIcon:f.chevronRightIcon,S=l?"chevron-up":"chevron-left",x=l?"chevron-down":"chevron-right"):(n=l?f.chevronUpIcon:f.chevronRightIcon,d=l?f.chevronDownIcon:f.chevronLeftIcon,S=l?"chevron-up":"chevron-right",x=l?"chevron-down":"chevron-left"),r.createElement(r.Fragment,null,r.createElement(j.Button,{className:"k-button-decrease",rounded:"full",icon:x,svgIcon:d,title:t.decrementTitle,onClick:t.decrement}),t.children,r.createElement(j.Button,{className:"k-button-increase",rounded:"full",icon:S,svgIcon:n,title:t.incrementTitle,onClick:t.increment}))},[v,l]);a.useImperativeHandle(k,()=>({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 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}:v==="rtl"?T={right:"calc("+C+"%)",zIndex:1}:T={left:"calc("+C+"%)",zIndex:1},r.createElement("div",{ref:y,dir:v,id:e.id,"aria-label":e.ariaLabel,style:{gap:0,...e.style},onFocus:G,onBlur:Y,onKeyDown:J,className:c.classNames("k-slider",{"k-focus":H,"k-disabled":u,"k-slider-horizontal":!l,"k-slider-vertical":l},e.className)},ee({enabled:(O=e.buttons)!=null?O:h.buttons,decrement:Q,increment:Z,incrementTitle:N.toLanguageString(m.sliderIncreaseValue,m.messages[m.sliderIncreaseValue]),decrementTitle:N.toLanguageString(m.sliderDecreaseValue,m.messages[m.sliderDecreaseValue]),children:r.createElement(c.Draggable,{onDrag:p,onPress:$,autoScroll:!1},r.createElement("div",{className:"k-slider-track-wrap",style:{flexGrow:1,position:"relative",touchAction:"none",...te}},e.children&&r.createElement("ul",{className:"k-reset k-slider-items","aria-hidden":"true",style:{margin:0,...ne}},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-labelledby":e.ariaLabelledBy,"aria-describedby":e.ariaDescribedBy,"aria-label":e.ariaLabel,tabIndex:c.getTabIndex(P,u,void 0),className:"k-draghandle k-draghandle-end",title:N.toLanguageString(m.sliderDragTitle,m.messages[m.sliderDragTitle]),style:T}))))}))});R.displayName="Slider";const _=c.createPropsContext(),z=c.withPropsContext(_,R);z.displayName="KendoReactSlider";z.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=z;exports.SliderPropsContext=_;exports.SliderWithoutContext=R;
|
package/slider/Slider.mjs
CHANGED
|
@@ -6,43 +6,43 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as r from "react";
|
|
9
|
-
import { useState as
|
|
9
|
+
import { useState as R, useRef as N, useMemo as z, useEffect as q, useCallback as c, useImperativeHandle as me } from "react";
|
|
10
10
|
import i from "prop-types";
|
|
11
|
-
import { withPropsContext as
|
|
12
|
-
import { LocalizationService as
|
|
13
|
-
import {
|
|
14
|
-
import { SLIDER_LABEL_ATTRIBUTE as
|
|
15
|
-
import { Button as
|
|
16
|
-
import { chevronUpIcon as
|
|
17
|
-
const
|
|
11
|
+
import { withPropsContext as ue, dispatchEvent as fe, Keys as m, useWebMcpRegister as ge, classNames as ve, Draggable as he, getTabIndex as be, createPropsContext as ye } from "@progress/kendo-react-common";
|
|
12
|
+
import { LocalizationService as ke, registerForLocalization as xe } from "@progress/kendo-react-intl";
|
|
13
|
+
import { sliderDragTitle as H, messages as B, sliderDecreaseValue as O, sliderIncreaseValue as W } from "../messages/index.mjs";
|
|
14
|
+
import { SLIDER_LABEL_ATTRIBUTE as Se } from "./SliderLabel.mjs";
|
|
15
|
+
import { Button as X } from "@progress/kendo-react-buttons";
|
|
16
|
+
import { chevronUpIcon as _, chevronLeftIcon as j, chevronDownIcon as G, chevronRightIcon as Y } from "@progress/kendo-svg-icons";
|
|
17
|
+
const g = {
|
|
18
18
|
step: 1,
|
|
19
19
|
largeStep: 10,
|
|
20
20
|
buttons: !1,
|
|
21
21
|
vertical: !1,
|
|
22
22
|
disabled: !1,
|
|
23
23
|
tabIndex: 0
|
|
24
|
-
},
|
|
25
|
-
var K, U
|
|
24
|
+
}, V = r.forwardRef((e, P) => {
|
|
25
|
+
var M, K, U;
|
|
26
26
|
const {
|
|
27
|
-
step: u =
|
|
28
|
-
largeStep:
|
|
29
|
-
vertical: a =
|
|
30
|
-
disabled: d =
|
|
31
|
-
tabIndex:
|
|
32
|
-
} = e, [
|
|
27
|
+
step: u = g.step,
|
|
28
|
+
largeStep: C = g.largeStep,
|
|
29
|
+
vertical: a = g.vertical,
|
|
30
|
+
disabled: d = g.disabled,
|
|
31
|
+
tabIndex: Q = g.tabIndex
|
|
32
|
+
} = e, [Z, $] = R((M = e.defaultValue) != null ? M : e.min), [p, A] = R(!1), [I, ee] = R(e.dir), E = N(null), v = N(null), T = z(() => new ke(), []), D = N(null), L = e.value !== void 0, k = L && e.value !== void 0 ? e.value : Z, l = z(() => k < e.min ? e.min : k > e.max ? e.max : k, [k, e.min, e.max]), h = z(() => {
|
|
33
33
|
const t = e.max - e.min;
|
|
34
34
|
return t === 0 ? 0 : (l - e.min) / t * 100;
|
|
35
|
-
}, [l, e.min, e.max]),
|
|
36
|
-
|
|
35
|
+
}, [l, e.min, e.max]), f = (K = e.dir) != null ? K : I;
|
|
36
|
+
q(() => {
|
|
37
37
|
if (e.dir === void 0 && v.current) {
|
|
38
38
|
const n = window.getComputedStyle(v.current).direction;
|
|
39
|
-
n !==
|
|
39
|
+
n !== I && ee(n);
|
|
40
40
|
}
|
|
41
|
-
}, [e.dir,
|
|
42
|
-
const
|
|
41
|
+
}, [e.dir, I]);
|
|
42
|
+
const F = c((t) => {
|
|
43
43
|
let n = t;
|
|
44
44
|
for (; n; ) {
|
|
45
|
-
if (n.getAttribute(
|
|
45
|
+
if (n.getAttribute(Se))
|
|
46
46
|
return !0;
|
|
47
47
|
n = n.parentElement;
|
|
48
48
|
}
|
|
@@ -50,113 +50,113 @@ const f = {
|
|
|
50
50
|
}, []), s = c(
|
|
51
51
|
(t, n) => {
|
|
52
52
|
const o = Math.min(Math.max(n, e.min), e.max);
|
|
53
|
-
|
|
53
|
+
L || $(o), fe(e.onChange, t, D.current, { value: o });
|
|
54
54
|
},
|
|
55
|
-
[e.min, e.max, e.onChange,
|
|
56
|
-
),
|
|
57
|
-
|
|
58
|
-
}, []),
|
|
59
|
-
|
|
60
|
-
}, []),
|
|
55
|
+
[e.min, e.max, e.onChange, L]
|
|
56
|
+
), te = c(() => {
|
|
57
|
+
A(!0);
|
|
58
|
+
}, []), ne = c(() => {
|
|
59
|
+
A(!1);
|
|
60
|
+
}, []), ae = c(
|
|
61
61
|
(t) => {
|
|
62
62
|
if (d)
|
|
63
63
|
return;
|
|
64
64
|
let n;
|
|
65
|
-
t.keyCode === m.left || t.keyCode === m.down ? n = l - (u || 0) : t.keyCode === m.right || t.keyCode === m.up ? n = l + (u || 0) : t.keyCode === m.pageDown ? n = l - (
|
|
65
|
+
t.keyCode === m.left || t.keyCode === m.down ? n = l - (u || 0) : t.keyCode === m.right || t.keyCode === m.up ? n = l + (u || 0) : t.keyCode === m.pageDown ? n = l - (C || 0) : t.keyCode === m.pageUp ? n = l + (C || 0) : t.keyCode === m.home ? n = e.min : t.keyCode === m.end && (n = e.max), n !== void 0 && (t.preventDefault(), s(t, n));
|
|
66
66
|
},
|
|
67
|
-
[l, u,
|
|
68
|
-
),
|
|
67
|
+
[l, u, C, e.min, e.max, s, d]
|
|
68
|
+
), ie = c(
|
|
69
69
|
(t) => {
|
|
70
70
|
t.preventDefault(), !d && s(t, l - (u || 0));
|
|
71
71
|
},
|
|
72
72
|
[l, u, s, d]
|
|
73
|
-
),
|
|
73
|
+
), re = c(
|
|
74
74
|
(t) => {
|
|
75
75
|
t.preventDefault(), !d && s(t, l + (u || 0));
|
|
76
76
|
},
|
|
77
77
|
[l, u, s, d]
|
|
78
|
-
),
|
|
78
|
+
), x = c(
|
|
79
79
|
(t) => {
|
|
80
80
|
const n = t.element.getBoundingClientRect();
|
|
81
81
|
let o;
|
|
82
|
-
a ? o = n.bottom - t.event.clientY : o =
|
|
83
|
-
const
|
|
84
|
-
s(t, e.min +
|
|
82
|
+
a ? o = n.bottom - t.event.clientY : o = f === "rtl" ? n.right - t.event.clientX : t.event.clientX - n.left;
|
|
83
|
+
const b = a ? n.height : n.width, y = o / b;
|
|
84
|
+
s(t, e.min + y * (e.max - e.min));
|
|
85
85
|
},
|
|
86
|
-
[a, e.min, e.max,
|
|
87
|
-
),
|
|
86
|
+
[a, e.min, e.max, f, s]
|
|
87
|
+
), le = c(
|
|
88
88
|
(t) => {
|
|
89
|
-
|
|
89
|
+
F(t.event.originalEvent.target) || (t.event.isTouch && t.event.originalEvent.preventDefault(), x(t));
|
|
90
90
|
},
|
|
91
|
-
[
|
|
92
|
-
),
|
|
91
|
+
[F, x]
|
|
92
|
+
), ce = c(
|
|
93
93
|
(t) => {
|
|
94
|
-
t.event.originalEvent.preventDefault(),
|
|
94
|
+
t.event.originalEvent.preventDefault(), x(t);
|
|
95
95
|
},
|
|
96
|
-
[
|
|
97
|
-
),
|
|
96
|
+
[x]
|
|
97
|
+
), S = c(() => {
|
|
98
98
|
v.current && v.current.focus();
|
|
99
|
-
}, []),
|
|
99
|
+
}, []), oe = c(
|
|
100
100
|
(t) => {
|
|
101
101
|
if (!t.enabled)
|
|
102
102
|
return t.children;
|
|
103
|
-
let n, o,
|
|
104
|
-
return
|
|
105
|
-
|
|
103
|
+
let n, o, b, y;
|
|
104
|
+
return f === "rtl" ? (n = a ? _ : j, o = a ? G : Y, b = a ? "chevron-up" : "chevron-left", y = a ? "chevron-down" : "chevron-right") : (n = a ? _ : Y, o = a ? G : j, b = a ? "chevron-up" : "chevron-right", y = a ? "chevron-down" : "chevron-left"), /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(
|
|
105
|
+
X,
|
|
106
106
|
{
|
|
107
107
|
className: "k-button-decrease",
|
|
108
108
|
rounded: "full",
|
|
109
|
-
icon:
|
|
109
|
+
icon: y,
|
|
110
110
|
svgIcon: o,
|
|
111
111
|
title: t.decrementTitle,
|
|
112
112
|
onClick: t.decrement
|
|
113
113
|
}
|
|
114
114
|
), t.children, /* @__PURE__ */ r.createElement(
|
|
115
|
-
|
|
115
|
+
X,
|
|
116
116
|
{
|
|
117
117
|
className: "k-button-increase",
|
|
118
118
|
rounded: "full",
|
|
119
|
-
icon:
|
|
119
|
+
icon: b,
|
|
120
120
|
svgIcon: n,
|
|
121
121
|
title: t.incrementTitle,
|
|
122
122
|
onClick: t.increment
|
|
123
123
|
}
|
|
124
124
|
));
|
|
125
125
|
},
|
|
126
|
-
[
|
|
126
|
+
[f, a]
|
|
127
127
|
);
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
me(
|
|
129
|
+
P,
|
|
130
130
|
() => ({
|
|
131
131
|
props: e,
|
|
132
|
-
sliderTrack:
|
|
133
|
-
focus:
|
|
132
|
+
sliderTrack: E.current,
|
|
133
|
+
focus: S
|
|
134
134
|
}),
|
|
135
|
-
[e,
|
|
136
|
-
),
|
|
137
|
-
|
|
135
|
+
[e, S]
|
|
136
|
+
), ge("slider", D, e, e.webMcp), q(() => {
|
|
137
|
+
D.current = {
|
|
138
138
|
props: e,
|
|
139
|
-
sliderTrack:
|
|
140
|
-
focus:
|
|
139
|
+
sliderTrack: E.current,
|
|
140
|
+
focus: S
|
|
141
141
|
};
|
|
142
|
-
}, [e,
|
|
143
|
-
const
|
|
144
|
-
let
|
|
145
|
-
return a ?
|
|
142
|
+
}, [e, S]);
|
|
143
|
+
const de = a ? { marginTop: "0.5rem", marginBottom: "0.5rem" } : { marginLeft: "0.5rem", marginRight: "0.5rem" }, se = a ? { paddingTop: 0, height: "100%" } : {};
|
|
144
|
+
let w;
|
|
145
|
+
return a ? w = { bottom: "calc(" + h + "%)", zIndex: 1 } : f === "rtl" ? w = { right: "calc(" + h + "%)", zIndex: 1 } : w = { left: "calc(" + h + "%)", zIndex: 1 }, /* @__PURE__ */ r.createElement(
|
|
146
146
|
"div",
|
|
147
147
|
{
|
|
148
148
|
ref: v,
|
|
149
|
-
dir:
|
|
149
|
+
dir: f,
|
|
150
150
|
id: e.id,
|
|
151
|
-
"aria-label": e.ariaLabel
|
|
151
|
+
"aria-label": e.ariaLabel,
|
|
152
152
|
style: { gap: 0, ...e.style },
|
|
153
|
-
onFocus:
|
|
154
|
-
onBlur:
|
|
155
|
-
onKeyDown:
|
|
156
|
-
className:
|
|
153
|
+
onFocus: te,
|
|
154
|
+
onBlur: ne,
|
|
155
|
+
onKeyDown: ae,
|
|
156
|
+
className: ve(
|
|
157
157
|
"k-slider",
|
|
158
158
|
{
|
|
159
|
-
"k-focus":
|
|
159
|
+
"k-focus": p,
|
|
160
160
|
"k-disabled": d,
|
|
161
161
|
"k-slider-horizontal": !a,
|
|
162
162
|
"k-slider-vertical": a
|
|
@@ -164,19 +164,19 @@ const f = {
|
|
|
164
164
|
e.className
|
|
165
165
|
)
|
|
166
166
|
},
|
|
167
|
-
|
|
168
|
-
enabled: (
|
|
169
|
-
decrement:
|
|
170
|
-
increment:
|
|
171
|
-
incrementTitle:
|
|
172
|
-
X,
|
|
173
|
-
x[X]
|
|
174
|
-
),
|
|
175
|
-
decrementTitle: h.toLanguageString(
|
|
167
|
+
oe({
|
|
168
|
+
enabled: (U = e.buttons) != null ? U : g.buttons,
|
|
169
|
+
decrement: ie,
|
|
170
|
+
increment: re,
|
|
171
|
+
incrementTitle: T.toLanguageString(
|
|
176
172
|
W,
|
|
177
|
-
|
|
173
|
+
B[W]
|
|
174
|
+
),
|
|
175
|
+
decrementTitle: T.toLanguageString(
|
|
176
|
+
O,
|
|
177
|
+
B[O]
|
|
178
178
|
),
|
|
179
|
-
children: /* @__PURE__ */ r.createElement(
|
|
179
|
+
children: /* @__PURE__ */ r.createElement(he, { onDrag: ce, onPress: le, autoScroll: !1 }, /* @__PURE__ */ r.createElement(
|
|
180
180
|
"div",
|
|
181
181
|
{
|
|
182
182
|
className: "k-slider-track-wrap",
|
|
@@ -184,7 +184,7 @@ const f = {
|
|
|
184
184
|
flexGrow: 1,
|
|
185
185
|
position: "relative",
|
|
186
186
|
touchAction: "none",
|
|
187
|
-
...
|
|
187
|
+
...de
|
|
188
188
|
}
|
|
189
189
|
},
|
|
190
190
|
e.children && /* @__PURE__ */ r.createElement(
|
|
@@ -192,7 +192,7 @@ const f = {
|
|
|
192
192
|
{
|
|
193
193
|
className: "k-reset k-slider-items",
|
|
194
194
|
"aria-hidden": "true",
|
|
195
|
-
style: { margin: 0, ...
|
|
195
|
+
style: { margin: 0, ...se }
|
|
196
196
|
},
|
|
197
197
|
r.Children.map(e.children, (t, n) => t && r.cloneElement(
|
|
198
198
|
t,
|
|
@@ -209,14 +209,14 @@ const f = {
|
|
|
209
209
|
"div",
|
|
210
210
|
{
|
|
211
211
|
className: "k-slider-track",
|
|
212
|
-
style: a ? { bottom: 0, height: "100%" } : { [
|
|
213
|
-
ref:
|
|
212
|
+
style: a ? { bottom: 0, height: "100%" } : { [f === "rtl" ? "right" : "left"]: 0, width: "100%" },
|
|
213
|
+
ref: E
|
|
214
214
|
},
|
|
215
215
|
/* @__PURE__ */ r.createElement(
|
|
216
216
|
"div",
|
|
217
217
|
{
|
|
218
218
|
className: "k-slider-selection",
|
|
219
|
-
style: a ? { height:
|
|
219
|
+
style: a ? { height: h + "%" } : { width: h + "%" }
|
|
220
220
|
}
|
|
221
221
|
),
|
|
222
222
|
/* @__PURE__ */ r.createElement(
|
|
@@ -230,14 +230,14 @@ const f = {
|
|
|
230
230
|
"aria-disabled": d ? "true" : void 0,
|
|
231
231
|
"aria-labelledby": e.ariaLabelledBy,
|
|
232
232
|
"aria-describedby": e.ariaDescribedBy,
|
|
233
|
-
"aria-label": e.ariaLabel
|
|
234
|
-
tabIndex:
|
|
233
|
+
"aria-label": e.ariaLabel,
|
|
234
|
+
tabIndex: be(Q, d, void 0),
|
|
235
235
|
className: "k-draghandle k-draghandle-end",
|
|
236
|
-
title:
|
|
237
|
-
|
|
238
|
-
|
|
236
|
+
title: T.toLanguageString(
|
|
237
|
+
H,
|
|
238
|
+
B[H]
|
|
239
239
|
),
|
|
240
|
-
style:
|
|
240
|
+
style: w
|
|
241
241
|
}
|
|
242
242
|
)
|
|
243
243
|
)
|
|
@@ -245,10 +245,10 @@ const f = {
|
|
|
245
245
|
})
|
|
246
246
|
);
|
|
247
247
|
});
|
|
248
|
-
|
|
249
|
-
const
|
|
250
|
-
|
|
251
|
-
|
|
248
|
+
V.displayName = "Slider";
|
|
249
|
+
const we = ye(), J = ue(we, V);
|
|
250
|
+
J.displayName = "KendoReactSlider";
|
|
251
|
+
J.propTypes = {
|
|
252
252
|
value: i.number,
|
|
253
253
|
defaultValue: i.number,
|
|
254
254
|
min: i.number.isRequired,
|
|
@@ -269,9 +269,9 @@ P.propTypes = {
|
|
|
269
269
|
dir: i.oneOf(["ltr", "rtl"]),
|
|
270
270
|
children: i.node
|
|
271
271
|
};
|
|
272
|
-
|
|
272
|
+
xe(V);
|
|
273
273
|
export {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
274
|
+
J as Slider,
|
|
275
|
+
we as SliderPropsContext,
|
|
276
|
+
V as SliderWithoutContext
|
|
277
277
|
};
|
package/switch/Switch.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),t=require("prop-types"),c=require("@progress/kendo-react-common"),j=require("@progress/kendo-react-intl"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),t=require("prop-types"),c=require("@progress/kendo-react-common"),j=require("@progress/kendo-react-intl"),L=require("../messages/index.js");function Z(e){const b=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const v=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(b,s,v.get?v:{enumerable:!0,get:()=>e[s]})}}return b.default=e,Object.freeze(b)}const d=Z(n),r={disabled:!1,defaultChecked:!1,size:void 0,trackRounded:void 0,thumbRounded:void 0,offLabel:"OFF",onBlur:c.noop,onFocus:c.noop,onLabel:"ON",validityStyles:!0},x=d.forwardRef((e,b)=>{var F;const{disabled:s=r.disabled,defaultChecked:v=r.defaultChecked,size:C=r.size,trackRounded:R=r.trackRounded,thumbRounded:S=r.thumbRounded,offLabel:I=r.offLabel,onBlur:M=r.onBlur,onFocus:E=r.onFocus,onLabel:q=r.onLabel}=e,[B,V]=n.useState(v||!1),[W,D]=n.useState(!1),u=n.useRef(null),o=n.useRef(null),k=n.useRef(null),g=n.useRef(void 0),N=n.useRef(!1),P=n.useRef(void 0),T=n.useMemo(()=>new j.LocalizationService,[]);j.useLocalization();const i=n.useMemo(()=>g.current!==void 0?g.current:e.checked!==void 0?e.checked:B,[e.checked,B]),h=n.useMemo(()=>{var w,K;const a=e.validationMessage!==void 0,l=(w=e.valid)!=null?w:e.required?!!i:!0,y=(K=e.valid)!=null?K:l;return{customError:a,valid:y,valueMissing:i===null}},[e.valid,e.validationMessage,e.required,i]),_=(F=e.validityStyles)!=null?F:r.validityStyles;n.useEffect(()=>{var a;(a=k.current)!=null&&a.setCustomValidity&&k.current.setCustomValidity(h.valid?"":e.validationMessage||T.toLanguageString(L.switchValidation,L.messages[L.switchValidation]))},[h,e.validationMessage,T]),n.useEffect(()=>{u.current&&(P.current=e.dir||getComputedStyle(u.current).direction||void 0)},[e.dir]);const f=n.useCallback(()=>({props:e,get element(){return u.current},get actionElement(){return o.current},focus:()=>{var a;(a=o.current)==null||a.focus()},get value(){return i},get name(){return e.name},get validity(){return h}}),[e,i,h]),m=n.useCallback((a,l)=>{V(a),g.current=a,c.dispatchEvent(e.onChange,l,{...f(),value:a},{value:a}),g.current=void 0},[e.onChange,f]);n.useEffect(()=>{const a=e.name||e.id,l=c.subscribeToKendoPaste(o.current,{fieldName:a,onValueChange:y=>{if(y!==i){const w={target:o.current,currentTarget:o.current,nativeEvent:new Event("change",{bubbles:!0})};m(y,w)}}});return()=>{l==null||l.unsubscribe()}},[e.name,e.id,i,m]);const $=n.useCallback(a=>{if(a.target===k.current){if(N.current){N.current=!1;return}}else N.current=!0;m(!i,a)},[i,m]),A=n.useCallback(a=>{if(s)return;const{keyCode:l}=a;(l===c.Keys.space||l===c.Keys.enter)&&(m(!i,a),a.preventDefault())},[s,i,m]),G=n.useCallback(a=>{s||(D(!0),E&&E(a))},[s,E]),J=n.useCallback(a=>{s||(D(!1),M&&M(a))},[s,M]);n.useImperativeHandle(b,f,[f]);const z=n.useRef(null);n.useImperativeHandle(z,f,[f]),c.useWebMcpRegister("switch",z,e,e.webMcp);const Q=P.current||e.dir||u.current&&getComputedStyle(u.current).direction||void 0,U=!_||h.valid,X=c.classNames("k-switch",{[`k-switch-${c.kendoThemeMaps.sizeMap[C]||C}`]:C,"k-switch-on":i,"k-switch-off":!i,"k-focus":W,"k-disabled":s,"k-invalid":!U},e.className),Y=d.createElement("input",{type:"checkbox",checked:e.checked,ref:k,tabIndex:-1,value:i,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"},onChange:c.noop,name:e.name||void 0});return d.createElement("span",{ref:o,role:"switch","aria-checked":i,"aria-disabled":s||void 0,"aria-labelledby":e.ariaLabelledBy,"aria-describedby":e.ariaDescribedBy,"aria-label":e.ariaLabel,"aria-required":e.required,className:X,dir:Q,onKeyDown:A,onClick:$,onBlur:J,onFocus:G,tabIndex:c.getTabIndex(e.tabIndex,s,void 0),accessKey:e.accessKey,id:e.id},d.createElement("span",{className:c.classNames("k-switch-track",{[`k-rounded-${c.kendoThemeMaps.roundedMap[R]||R}`]:R}),ref:u},Y,q?d.createElement("span",{className:"k-switch-label-on"},q):"",I?d.createElement("span",{className:"k-switch-label-off"},I):""),d.createElement("span",{className:"k-switch-thumb-wrap"},d.createElement("span",{className:c.classNames("k-switch-thumb",{[`k-rounded-${c.kendoThemeMaps.roundedMap[S]||S}`]:S})})))});x.displayName="Switch";const H=c.createPropsContext(),O=c.withIdHOC(c.withPropsContext(H,x));O.displayName="KendoReactSwitch";O.propTypes={accessKey:t.string,checked:t.bool,className:t.string,defaultChecked:t.bool,defaultValue:t.any,disabled:t.bool,dir:t.string,id:t.string,size:t.oneOf(["small","medium","large"]),trackRounded:t.oneOf(["small","medium","large","full"]),thumbRounded:t.oneOf(["small","medium","large","full"]),ariaDescribedBy:t.string,ariaLabelledBy:t.string,ariaLabel:t.string,offLabel:t.node,onBlur:t.func,onChange:t.func,onFocus:t.func,onLabel:t.node,tabIndex:t.number,value:t.any,name:t.string,required:t.bool,valid:t.bool,validationMessage:t.string,validityStyles:t.bool};exports.Switch=O;exports.SwitchPropsContext=H;exports.SwitchWithoutContext=x;
|