@progress/kendo-react-inputs 12.0.0-develop.1 → 12.0.0-develop.11

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/index.d.mts CHANGED
@@ -220,12 +220,9 @@ export declare type ColorGradient = ColorGradientHandle;
220
220
  *
221
221
  * @example
222
222
  * ```jsx
223
- * class App extends React.Component {
224
- * render() {
225
- * return <ColorGradient />;
226
- * }
223
+ * const App = () => {
224
+ * return <ColorGradient />;
227
225
  * }
228
- * ReactDOM.render(<App />, document.querySelector('my-app'));
229
226
  * ```
230
227
  */
231
228
  export declare const ColorGradient: React_2.ForwardRefExoticComponent<ColorGradientProps & React_2.RefAttributes<any>>;
@@ -297,14 +294,9 @@ export declare interface ColorGradientProps {
297
294
  *
298
295
  * @example
299
296
  * ```jsx
300
- * class App extends React.Component {
301
- * render() {
302
- * return (
303
- * <ColorGradient disabled={true} />
304
- * );
305
- * }
306
- * }
307
- * ReactDOM.render(<App />, document.querySelector('my-app'));
297
+ * const App = () => (
298
+ * <ColorGradient disabled={true} />
299
+ * );
308
300
  * ```
309
301
  */
310
302
  disabled?: boolean;
@@ -619,12 +611,9 @@ export declare type ColorPalette = ColorPaletteHandle;
619
611
  * Obtaining the `ref` returns an object of type [ColorPaletteHandle]({% slug api_inputs_colorpalettehandle %}).
620
612
  *
621
613
  * ```jsx
622
- * class App extends React.Component {
623
- * render() {
624
- * return <ColorPalette palette='basic' />;
625
- * }
614
+ * const App = () => {
615
+ * return <ColorPalette palette='basic' />;
626
616
  * }
627
- * ReactDOM.render(<App />, document.querySelector('my-app'));
628
617
  * ```
629
618
  */
630
619
  export declare const ColorPalette: React_2.ForwardRefExoticComponent<ColorPaletteProps & React_2.RefAttributes<any>>;
@@ -700,14 +689,9 @@ export declare interface ColorPaletteProps {
700
689
  *
701
690
  * @example
702
691
  * ```jsx
703
- * class App extends React.Component {
704
- * render() {
705
- * return (
706
- * <ColorPalette disabled={true} />
707
- * );
708
- * }
709
- * }
710
- * ReactDOM.render(<App />, document.querySelector('my-app'));
692
+ * const App = () => (
693
+ * <ColorPalette disabled={true} />
694
+ * );
711
695
  * ```
712
696
  */
713
697
  disabled?: boolean;
@@ -853,12 +837,9 @@ export declare class ColorPaletteWithoutContext extends React_2.Component<ColorP
853
837
  *
854
838
  * @example
855
839
  * ```jsx
856
- * class App extends React.Component {
857
- * render() {
858
- * return <ColorPicker />;
859
- * }
840
+ * const App = () => {
841
+ * return <ColorPicker />;
860
842
  * }
861
- * ReactDOM.render(<App />, document.querySelector('my-app'));
862
843
  * ```
863
844
  */
864
845
  export declare const ColorPicker: React_2.ForwardRefExoticComponent<ColorPickerProps & React_2.RefAttributes<ColorPickerHandle | null>>;
@@ -1262,12 +1243,9 @@ declare type Direction = 'ltr' | 'rtl';
1262
1243
  *
1263
1244
  * @example
1264
1245
  * ```jsx
1265
- * class App extends React.Component {
1266
- * render() {
1267
- * return <FlatColorPicker />;
1268
- * }
1246
+ * const App = () => {
1247
+ * return <FlatColorPicker />;
1269
1248
  * }
1270
- * ReactDOM.render(<App />, document.querySelector('my-app'));
1271
1249
  * ```
1272
1250
  */
1273
1251
  export declare const FlatColorPicker: React_2.ForwardRefExoticComponent<FlatColorPickerProps & React_2.RefAttributes<FlatColorPickerHandle | null>>;
@@ -1394,7 +1372,7 @@ export declare interface FlatColorPickerProps {
1394
1372
  /**
1395
1373
  * Sets custom header component.
1396
1374
  */
1397
- header?: React_2.ComponentType;
1375
+ header?: React_2.ComponentType | React_2.ReactNode;
1398
1376
  /**
1399
1377
  * Specifies whether clear button will be rendered in the header.
1400
1378
  */
@@ -1785,28 +1763,19 @@ export declare interface MaskedTextBoxHandle extends Pick<MaskedTextBoxWithoutCo
1785
1763
  * Gets the element of the MaskedTextBox.
1786
1764
  *
1787
1765
  * ```jsx
1788
- * class App extends React.Component {
1789
- * constructor(props) {
1790
- * super(props);
1791
- * }
1792
- * element = null;
1793
- * render() {
1794
- * return (
1766
+ * const App = () => {
1767
+ * const [element, setElement] = React.useState(null);
1768
+ *
1769
+ * return (
1795
1770
  * <div>
1796
1771
  * <MaskedTextBox
1797
1772
  * ref={(component) =>
1798
- * this.element = component ? component.element : null}
1773
+ * setElement(component ? component.element : null)}
1799
1774
  * />
1800
- * <button onClick={() => console.log(this.element)}>console.log the element</button>
1775
+ * <button onClick={() => console.log(element)}>console.log the element</button>
1801
1776
  * </div>
1802
- * );
1803
- * }
1777
+ * );
1804
1778
  * }
1805
- *
1806
- * ReactDOM.render(
1807
- * <App />,
1808
- * document.getElementsByTagName('my-app')[0]
1809
- * );
1810
1779
  * ```
1811
1780
  */
1812
1781
  element: HTMLInputElement | null;
@@ -2150,28 +2119,19 @@ export declare class MaskedTextBoxWithoutContext extends React_2.Component<Maske
2150
2119
  *
2151
2120
  * @example
2152
2121
  * ```jsx
2153
- * class App extends React.Component {
2154
- * constructor(props) {
2155
- * super(props);
2156
- * }
2157
- * element = null;
2158
- * render() {
2159
- * return (
2160
- * <div>
2161
- * <MaskedTextBox
2162
- * ref={(component) =>
2163
- * this.element = component ? component.element : null}
2164
- * />
2165
- * <button onClick={() => console.log(this.element)}>console.log the element</button>
2166
- * </div>
2167
- * );
2168
- * }
2169
- * }
2122
+ * const App = () => {
2123
+ * const [element, setElement] = React.useState(null);
2170
2124
  *
2171
- * ReactDOM.render(
2172
- * <App />,
2173
- * document.getElementsByTagName('my-app')[0]
2174
- * );
2125
+ * return (
2126
+ * <div>
2127
+ * <MaskedTextBox
2128
+ * ref={(component) =>
2129
+ * setElement(component ? component.element : null)}
2130
+ * />
2131
+ * <button onClick={() => console.log(element)}>console.log the element</button>
2132
+ * </div>
2133
+ * );
2134
+ * }
2175
2135
  * ```
2176
2136
  */
2177
2137
  get element(): HTMLInputElement | null;
@@ -3386,7 +3346,7 @@ export declare interface RatingMouseEvent {
3386
3346
  }
3387
3347
 
3388
3348
  /**
3389
- * Represents the properties of [Rating](% slug api_inputs_rating %) component.
3349
+ * Represents the properties of [Rating]({% slug api_inputs_rating %}) component.
3390
3350
  */
3391
3351
  export declare interface RatingProps extends FormComponentProps {
3392
3352
  /**
@@ -4798,12 +4758,9 @@ export declare class SwitchWithoutContext extends React_2.Component<SwitchProps,
4798
4758
  *
4799
4759
  * @example
4800
4760
  * ```jsx
4801
- * class App extends React.Component {
4802
- * render() {
4803
- * return <TextArea />;
4804
- * }
4761
+ * const App = () => {
4762
+ * return <TextArea />;
4805
4763
  * }
4806
- * ReactDOM.render(<App />, document.querySelector('my-app'));
4807
4764
  * ```
4808
4765
  */
4809
4766
  export declare const TextArea: React_2.ForwardRefExoticComponent<TextAreaProps & React_2.RefAttributes<TextAreaHandle | null>>;
package/index.d.ts CHANGED
@@ -220,12 +220,9 @@ export declare type ColorGradient = ColorGradientHandle;
220
220
  *
221
221
  * @example
222
222
  * ```jsx
223
- * class App extends React.Component {
224
- * render() {
225
- * return <ColorGradient />;
226
- * }
223
+ * const App = () => {
224
+ * return <ColorGradient />;
227
225
  * }
228
- * ReactDOM.render(<App />, document.querySelector('my-app'));
229
226
  * ```
230
227
  */
231
228
  export declare const ColorGradient: React_2.ForwardRefExoticComponent<ColorGradientProps & React_2.RefAttributes<any>>;
@@ -297,14 +294,9 @@ export declare interface ColorGradientProps {
297
294
  *
298
295
  * @example
299
296
  * ```jsx
300
- * class App extends React.Component {
301
- * render() {
302
- * return (
303
- * <ColorGradient disabled={true} />
304
- * );
305
- * }
306
- * }
307
- * ReactDOM.render(<App />, document.querySelector('my-app'));
297
+ * const App = () => (
298
+ * <ColorGradient disabled={true} />
299
+ * );
308
300
  * ```
309
301
  */
310
302
  disabled?: boolean;
@@ -619,12 +611,9 @@ export declare type ColorPalette = ColorPaletteHandle;
619
611
  * Obtaining the `ref` returns an object of type [ColorPaletteHandle]({% slug api_inputs_colorpalettehandle %}).
620
612
  *
621
613
  * ```jsx
622
- * class App extends React.Component {
623
- * render() {
624
- * return <ColorPalette palette='basic' />;
625
- * }
614
+ * const App = () => {
615
+ * return <ColorPalette palette='basic' />;
626
616
  * }
627
- * ReactDOM.render(<App />, document.querySelector('my-app'));
628
617
  * ```
629
618
  */
630
619
  export declare const ColorPalette: React_2.ForwardRefExoticComponent<ColorPaletteProps & React_2.RefAttributes<any>>;
@@ -700,14 +689,9 @@ export declare interface ColorPaletteProps {
700
689
  *
701
690
  * @example
702
691
  * ```jsx
703
- * class App extends React.Component {
704
- * render() {
705
- * return (
706
- * <ColorPalette disabled={true} />
707
- * );
708
- * }
709
- * }
710
- * ReactDOM.render(<App />, document.querySelector('my-app'));
692
+ * const App = () => (
693
+ * <ColorPalette disabled={true} />
694
+ * );
711
695
  * ```
712
696
  */
713
697
  disabled?: boolean;
@@ -853,12 +837,9 @@ export declare class ColorPaletteWithoutContext extends React_2.Component<ColorP
853
837
  *
854
838
  * @example
855
839
  * ```jsx
856
- * class App extends React.Component {
857
- * render() {
858
- * return <ColorPicker />;
859
- * }
840
+ * const App = () => {
841
+ * return <ColorPicker />;
860
842
  * }
861
- * ReactDOM.render(<App />, document.querySelector('my-app'));
862
843
  * ```
863
844
  */
864
845
  export declare const ColorPicker: React_2.ForwardRefExoticComponent<ColorPickerProps & React_2.RefAttributes<ColorPickerHandle | null>>;
@@ -1262,12 +1243,9 @@ declare type Direction = 'ltr' | 'rtl';
1262
1243
  *
1263
1244
  * @example
1264
1245
  * ```jsx
1265
- * class App extends React.Component {
1266
- * render() {
1267
- * return <FlatColorPicker />;
1268
- * }
1246
+ * const App = () => {
1247
+ * return <FlatColorPicker />;
1269
1248
  * }
1270
- * ReactDOM.render(<App />, document.querySelector('my-app'));
1271
1249
  * ```
1272
1250
  */
1273
1251
  export declare const FlatColorPicker: React_2.ForwardRefExoticComponent<FlatColorPickerProps & React_2.RefAttributes<FlatColorPickerHandle | null>>;
@@ -1394,7 +1372,7 @@ export declare interface FlatColorPickerProps {
1394
1372
  /**
1395
1373
  * Sets custom header component.
1396
1374
  */
1397
- header?: React_2.ComponentType;
1375
+ header?: React_2.ComponentType | React_2.ReactNode;
1398
1376
  /**
1399
1377
  * Specifies whether clear button will be rendered in the header.
1400
1378
  */
@@ -1785,28 +1763,19 @@ export declare interface MaskedTextBoxHandle extends Pick<MaskedTextBoxWithoutCo
1785
1763
  * Gets the element of the MaskedTextBox.
1786
1764
  *
1787
1765
  * ```jsx
1788
- * class App extends React.Component {
1789
- * constructor(props) {
1790
- * super(props);
1791
- * }
1792
- * element = null;
1793
- * render() {
1794
- * return (
1766
+ * const App = () => {
1767
+ * const [element, setElement] = React.useState(null);
1768
+ *
1769
+ * return (
1795
1770
  * <div>
1796
1771
  * <MaskedTextBox
1797
1772
  * ref={(component) =>
1798
- * this.element = component ? component.element : null}
1773
+ * setElement(component ? component.element : null)}
1799
1774
  * />
1800
- * <button onClick={() => console.log(this.element)}>console.log the element</button>
1775
+ * <button onClick={() => console.log(element)}>console.log the element</button>
1801
1776
  * </div>
1802
- * );
1803
- * }
1777
+ * );
1804
1778
  * }
1805
- *
1806
- * ReactDOM.render(
1807
- * <App />,
1808
- * document.getElementsByTagName('my-app')[0]
1809
- * );
1810
1779
  * ```
1811
1780
  */
1812
1781
  element: HTMLInputElement | null;
@@ -2150,28 +2119,19 @@ export declare class MaskedTextBoxWithoutContext extends React_2.Component<Maske
2150
2119
  *
2151
2120
  * @example
2152
2121
  * ```jsx
2153
- * class App extends React.Component {
2154
- * constructor(props) {
2155
- * super(props);
2156
- * }
2157
- * element = null;
2158
- * render() {
2159
- * return (
2160
- * <div>
2161
- * <MaskedTextBox
2162
- * ref={(component) =>
2163
- * this.element = component ? component.element : null}
2164
- * />
2165
- * <button onClick={() => console.log(this.element)}>console.log the element</button>
2166
- * </div>
2167
- * );
2168
- * }
2169
- * }
2122
+ * const App = () => {
2123
+ * const [element, setElement] = React.useState(null);
2170
2124
  *
2171
- * ReactDOM.render(
2172
- * <App />,
2173
- * document.getElementsByTagName('my-app')[0]
2174
- * );
2125
+ * return (
2126
+ * <div>
2127
+ * <MaskedTextBox
2128
+ * ref={(component) =>
2129
+ * setElement(component ? component.element : null)}
2130
+ * />
2131
+ * <button onClick={() => console.log(element)}>console.log the element</button>
2132
+ * </div>
2133
+ * );
2134
+ * }
2175
2135
  * ```
2176
2136
  */
2177
2137
  get element(): HTMLInputElement | null;
@@ -3386,7 +3346,7 @@ export declare interface RatingMouseEvent {
3386
3346
  }
3387
3347
 
3388
3348
  /**
3389
- * Represents the properties of [Rating](% slug api_inputs_rating %) component.
3349
+ * Represents the properties of [Rating]({% slug api_inputs_rating %}) component.
3390
3350
  */
3391
3351
  export declare interface RatingProps extends FormComponentProps {
3392
3352
  /**
@@ -4798,12 +4758,9 @@ export declare class SwitchWithoutContext extends React_2.Component<SwitchProps,
4798
4758
  *
4799
4759
  * @example
4800
4760
  * ```jsx
4801
- * class App extends React.Component {
4802
- * render() {
4803
- * return <TextArea />;
4804
- * }
4761
+ * const App = () => {
4762
+ * return <TextArea />;
4805
4763
  * }
4806
- * ReactDOM.render(<App />, document.querySelector('my-app'));
4807
4764
  * ```
4808
4765
  */
4809
4766
  export declare const TextArea: React_2.ForwardRefExoticComponent<TextAreaProps & React_2.RefAttributes<TextAreaHandle | null>>;
@@ -56,28 +56,19 @@ const a = class a extends p.Component {
56
56
  *
57
57
  * @example
58
58
  * ```jsx
59
- * class App extends React.Component {
60
- * constructor(props) {
61
- * super(props);
62
- * }
63
- * element = null;
64
- * render() {
65
- * return (
66
- * <div>
67
- * <MaskedTextBox
68
- * ref={(component) =>
69
- * this.element = component ? component.element : null}
70
- * />
71
- * <button onClick={() => console.log(this.element)}>console.log the element</button>
72
- * </div>
73
- * );
74
- * }
75
- * }
59
+ * const App = () => {
60
+ * const [element, setElement] = React.useState(null);
76
61
  *
77
- * ReactDOM.render(
78
- * <App />,
79
- * document.getElementsByTagName('my-app')[0]
80
- * );
62
+ * return (
63
+ * <div>
64
+ * <MaskedTextBox
65
+ * ref={(component) =>
66
+ * setElement(component ? component.element : null)}
67
+ * />
68
+ * <button onClick={() => console.log(element)}>console.log the element</button>
69
+ * </div>
70
+ * );
71
+ * }
81
72
  * ```
82
73
  */
83
74
  get element() {
@@ -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 e=Object.freeze({name:"@progress/kendo-react-inputs",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1755511495,version:"12.0.0-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"});exports.packageMetadata=e;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-inputs",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1756139285,version:"12.0.0-develop.11",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"});exports.packageMetadata=e;
@@ -10,8 +10,8 @@ const e = Object.freeze({
10
10
  productName: "KendoReact",
11
11
  productCode: "KENDOUIREACT",
12
12
  productCodes: ["KENDOUIREACT"],
13
- publishDate: 1755511495,
14
- version: "12.0.0-develop.1",
13
+ publishDate: 1756139285,
14
+ version: "12.0.0-develop.11",
15
15
  licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
16
16
  });
17
17
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-inputs",
3
- "version": "12.0.0-develop.1",
3
+ "version": "12.0.0-develop.11",
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.0",
31
- "@progress/kendo-react-animation": "12.0.0-develop.1",
32
- "@progress/kendo-react-buttons": "12.0.0-develop.1",
33
- "@progress/kendo-react-common": "12.0.0-develop.1",
34
- "@progress/kendo-react-dialogs": "12.0.0-develop.1",
35
- "@progress/kendo-react-layout": "12.0.0-develop.1",
36
- "@progress/kendo-react-intl": "12.0.0-develop.1",
37
- "@progress/kendo-react-labels": "12.0.0-develop.1",
38
- "@progress/kendo-react-popup": "12.0.0-develop.1",
31
+ "@progress/kendo-react-animation": "12.0.0-develop.11",
32
+ "@progress/kendo-react-buttons": "12.0.0-develop.11",
33
+ "@progress/kendo-react-common": "12.0.0-develop.11",
34
+ "@progress/kendo-react-dialogs": "12.0.0-develop.11",
35
+ "@progress/kendo-react-layout": "12.0.0-develop.11",
36
+ "@progress/kendo-react-intl": "12.0.0-develop.11",
37
+ "@progress/kendo-react-labels": "12.0.0-develop.11",
38
+ "@progress/kendo-react-popup": "12.0.0-develop.11",
39
39
  "@progress/kendo-svg-icons": "^4.0.0",
40
40
  "react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
41
41
  "react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
@@ -82,7 +82,7 @@
82
82
  "package": {
83
83
  "productName": "KendoReact",
84
84
  "productCode": "KENDOUIREACT",
85
- "publishDate": 1755511495,
85
+ "publishDate": 1756139285,
86
86
  "licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
87
87
  }
88
88
  },
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 C=require("react"),s=require("prop-types"),i=require("@progress/kendo-react-common"),S=require("@progress/kendo-react-intl"),p=require("../messages/index.js");function N(o){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const e in o)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(a,e,t.get?t:{enumerable:!0,get:()=>o[e]})}}return a.default=o,Object.freeze(a)}const r=N(C),n=class n extends r.Component{constructor(a){super(a),this.setValidity=()=>{this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity.valid?"":this.props.validationMessage||this.defaultValidationMessage.toLanguageString(p.switchValidation,p.messages[p.switchValidation]))},this.limit=(e,t,d)=>{const h=d.offsetWidth,l=t.offsetWidth;return e<0?0:e>h-l?h-l:e},this.toggle=(e,t)=>{this.setState({checked:e}),this.valueDuringOnChange=e,i.dispatchEvent(this.props.onChange,t,this,{value:e}),this.valueDuringOnChange=void 0},this._element=null,this._wrapper=null,this._input=null,this._id=this.props.id,this.defaultValidationMessage=S.provideLocalizationService(this),this.focus=()=>{this.actionElement&&this.actionElement.focus()},this.dummyInput=e=>r.createElement("input",{type:"checkbox",checked:this.props.checked,ref:t=>{this._input=t},tabIndex:-1,"aria-hidden":!0,value:e,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"},onChange:i.noop,name:this.name||void 0}),this.handleClick=e=>{this.eventTimeStamp!==e.timeStamp&&(this.eventTimeStamp=e.timeStamp,this.toggle(!this.value,e))},this.handleKeyDown=e=>{if(this.props.disabled)return;const{keyCode:t}=e;(t===i.Keys.space||t===i.Keys.enter)&&(this.toggle(!this.value,e),e.preventDefault())},this.handleWrapperFocus=e=>{if(this.props.disabled)return;this.setState({focused:!0});const{onFocus:t}=this.props;t&&t.call(void 0,e)},this.handleWrapperBlur=e=>{if(this.props.disabled)return;this.setState({focused:!1});const{onBlur:t}=this.props;t&&t.call(void 0,e)},this.state={checked:a.defaultChecked||n.defaultProps.defaultChecked,focused:!1}}get value(){return this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.checked!==void 0?this.props.checked:this.state.checked}get element(){return this._element}get actionElement(){return this._wrapper}get name(){return this.props.name}get validity(){const a=this.props.validationMessage!==void 0,e=this.props.valid!==void 0?this.props.valid:this.props.required?!!this.value:!0,t=this.props.valid!==void 0?this.props.valid:e;return{customError:a,valid:t,valueMissing:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:n.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:!1}componentDidMount(){this.setValidity(),this.forceUpdate()}componentDidUpdate(){this.setValidity()}render(){const{focused:a}=this.state,{dir:e,disabled:t,trackRounded:d,thumbRounded:h,size:l,offLabel:m,onLabel:f,tabIndex:y}=this.props;this.dir=e||this.element&&getComputedStyle(this.element).direction||void 0;const v=!this.validityStyles||this.validity.valid,k=i.classNames("k-switch",{[`k-switch-${i.kendoThemeMaps.sizeMap[l]||l}`]:l,"k-switch-on":this.value,"k-switch-off":!this.value,"k-focus":a,"k-disabled":t,"k-invalid":!v},this.props.className),w={"aria-checked":this.value,"aria-disabled":t||void 0,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,"aria-label":this.props.ariaLabel,"aria-required":this.props.required};return r.createElement("span",{ref:u=>{this._wrapper=u},role:"switch",...w,className:k,dir:this.dir,onKeyDown:this.handleKeyDown,onClick:this.handleClick,onBlur:this.handleWrapperBlur,onFocus:this.handleWrapperFocus,tabIndex:i.getTabIndex(y,t,void 0),accessKey:this.props.accessKey,id:this.props.id||this._id},r.createElement("span",{className:i.classNames("k-switch-track",{[`k-rounded-${i.kendoThemeMaps.roundedMap[d]||d}`]:d}),ref:u=>{this._element=u}},this.dummyInput(this.value),f?r.createElement("span",{className:"k-switch-label-on"},f):"",m?r.createElement("span",{className:"k-switch-label-off"},m):""),r.createElement("span",{className:"k-switch-thumb-wrap"},r.createElement("span",{className:i.classNames("k-switch-thumb",{[`k-rounded-${h}`]:h})})))}};n.displayName="Switch",n.propTypes={accessKey:s.string,checked:s.bool,className:s.string,disabled:s.bool,defaultChecked:s.bool,size:s.oneOf([null,"small","medium","large"]),trackRounded:s.oneOf([null,"small","medium","large","full"]),thumbRounded:s.oneOf([null,"small","medium","large","full"]),dir:s.string,id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,offLabel:s.string,required:s.bool,tabIndex:s.number,valid:s.bool,validate:s.bool,validationMessage:s.string,onBlur:s.any,onChange:s.any,onFocus:s.any,onLabel:s.string},n.defaultProps={disabled:!1,defaultChecked:!1,size:"medium",trackRounded:"full",thumbRounded:"full",offLabel:"OFF",onBlur:i.noop,onFocus:i.noop,onLabel:"ON",validityStyles:!0};let c=n;const g=i.createPropsContext(),b=i.withIdHOC(i.withPropsContext(g,c));b.displayName="KendoReactSwitch";exports.Switch=b;exports.SwitchPropsContext=g;exports.SwitchWithoutContext=c;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react"),s=require("prop-types"),i=require("@progress/kendo-react-common"),S=require("@progress/kendo-react-intl"),p=require("../messages/index.js");function N(d){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(d){for(const e in d)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(d,e);Object.defineProperty(a,e,t.get?t:{enumerable:!0,get:()=>d[e]})}}return a.default=d,Object.freeze(a)}const r=N(C),n=class n extends r.Component{constructor(a){super(a),this.setValidity=()=>{this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity.valid?"":this.props.validationMessage||this.defaultValidationMessage.toLanguageString(p.switchValidation,p.messages[p.switchValidation]))},this.limit=(e,t,h)=>{const l=h.offsetWidth,o=t.offsetWidth;return e<0?0:e>l-o?l-o:e},this.toggle=(e,t)=>{this.setState({checked:e}),this.valueDuringOnChange=e,i.dispatchEvent(this.props.onChange,t,this,{value:e}),this.valueDuringOnChange=void 0},this._element=null,this._wrapper=null,this._input=null,this._id=this.props.id,this.defaultValidationMessage=S.provideLocalizationService(this),this.focus=()=>{this.actionElement&&this.actionElement.focus()},this.dummyInput=e=>r.createElement("input",{type:"checkbox",checked:this.props.checked,ref:t=>{this._input=t},tabIndex:-1,"aria-hidden":!0,value:e,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"},onChange:i.noop,name:this.name||void 0}),this.handleClick=e=>{this.eventTimeStamp!==e.timeStamp&&(this.eventTimeStamp=e.timeStamp,this.toggle(!this.value,e))},this.handleKeyDown=e=>{if(this.props.disabled)return;const{keyCode:t}=e;(t===i.Keys.space||t===i.Keys.enter)&&(this.toggle(!this.value,e),e.preventDefault())},this.handleWrapperFocus=e=>{if(this.props.disabled)return;this.setState({focused:!0});const{onFocus:t}=this.props;t&&t.call(void 0,e)},this.handleWrapperBlur=e=>{if(this.props.disabled)return;this.setState({focused:!1});const{onBlur:t}=this.props;t&&t.call(void 0,e)},this.state={checked:a.defaultChecked||n.defaultProps.defaultChecked,focused:!1}}get value(){return this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.checked!==void 0?this.props.checked:this.state.checked}get element(){return this._element}get actionElement(){return this._wrapper}get name(){return this.props.name}get validity(){const a=this.props.validationMessage!==void 0,e=this.props.valid!==void 0?this.props.valid:this.props.required?!!this.value:!0,t=this.props.valid!==void 0?this.props.valid:e;return{customError:a,valid:t,valueMissing:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:n.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:!1}componentDidMount(){this.setValidity(),this.forceUpdate()}componentDidUpdate(){this.setValidity()}render(){const{focused:a}=this.state,{dir:e,disabled:t,trackRounded:h,thumbRounded:l,size:o,offLabel:m,onLabel:f,tabIndex:y}=this.props;this.dir=e||this.element&&getComputedStyle(this.element).direction||void 0;const v=!this.validityStyles||this.validity.valid,k=i.classNames("k-switch",{[`k-switch-${i.kendoThemeMaps.sizeMap[o]||o}`]:o,"k-switch-on":this.value,"k-switch-off":!this.value,"k-focus":a,"k-disabled":t,"k-invalid":!v},this.props.className),w={"aria-checked":this.value,"aria-disabled":t||void 0,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,"aria-label":this.props.ariaLabel,"aria-required":this.props.required};return r.createElement("span",{ref:u=>{this._wrapper=u},role:"switch",...w,className:k,dir:this.dir,onKeyDown:this.handleKeyDown,onClick:this.handleClick,onBlur:this.handleWrapperBlur,onFocus:this.handleWrapperFocus,tabIndex:i.getTabIndex(y,t,void 0),accessKey:this.props.accessKey,id:this.props.id||this._id},r.createElement("span",{className:i.classNames("k-switch-track",{[`k-rounded-${i.kendoThemeMaps.roundedMap[h]||h}`]:h}),ref:u=>{this._element=u}},this.dummyInput(this.value),f?r.createElement("span",{className:"k-switch-label-on"},f):"",m?r.createElement("span",{className:"k-switch-label-off"},m):""),r.createElement("span",{className:"k-switch-thumb-wrap"},r.createElement("span",{className:i.classNames("k-switch-thumb",{[`k-rounded-${i.kendoThemeMaps.roundedMap[l]||l}`]:l})})))}};n.displayName="Switch",n.propTypes={accessKey:s.string,checked:s.bool,className:s.string,disabled:s.bool,defaultChecked:s.bool,size:s.oneOf([null,"small","medium","large"]),trackRounded:s.oneOf([null,"small","medium","large","full"]),thumbRounded:s.oneOf([null,"small","medium","large","full"]),dir:s.string,id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,offLabel:s.string,required:s.bool,tabIndex:s.number,valid:s.bool,validate:s.bool,validationMessage:s.string,onBlur:s.any,onChange:s.any,onFocus:s.any,onLabel:s.string},n.defaultProps={disabled:!1,defaultChecked:!1,size:"medium",trackRounded:"full",thumbRounded:"full",offLabel:"OFF",onBlur:i.noop,onFocus:i.noop,onLabel:"ON",validityStyles:!0};let c=n;const g=i.createPropsContext(),b=i.withIdHOC(i.withPropsContext(g,c));b.displayName="KendoReactSwitch";exports.Switch=b;exports.SwitchPropsContext=g;exports.SwitchWithoutContext=c;
package/switch/Switch.mjs CHANGED
@@ -7,9 +7,9 @@
7
7
  */
8
8
  import * as s from "react";
9
9
  import t from "prop-types";
10
- import { dispatchEvent as C, noop as h, Keys as f, classNames as p, kendoThemeMaps as v, getTabIndex as S, createPropsContext as N, withIdHOC as D, withPropsContext as E } from "@progress/kendo-react-common";
10
+ import { dispatchEvent as C, noop as h, Keys as v, classNames as p, kendoThemeMaps as c, getTabIndex as S, createPropsContext as N, withIdHOC as D, withPropsContext as E } from "@progress/kendo-react-common";
11
11
  import { provideLocalizationService as L } from "@progress/kendo-react-intl";
12
- import { switchValidation as g, messages as B } from "../messages/index.mjs";
12
+ import { switchValidation as g, messages as M } from "../messages/index.mjs";
13
13
  const a = class a extends s.Component {
14
14
  /**
15
15
  * @hidden
@@ -17,11 +17,11 @@ const a = class a extends s.Component {
17
17
  constructor(r) {
18
18
  super(r), this.setValidity = () => {
19
19
  this._input && this._input.setCustomValidity && this._input.setCustomValidity(
20
- this.validity.valid ? "" : this.props.validationMessage || this.defaultValidationMessage.toLanguageString(g, B[g])
20
+ this.validity.valid ? "" : this.props.validationMessage || this.defaultValidationMessage.toLanguageString(g, M[g])
21
21
  );
22
- }, this.limit = (e, i, o) => {
23
- const n = o.offsetWidth, l = i.offsetWidth;
24
- return e < 0 ? 0 : e > n - l ? n - l : e;
22
+ }, this.limit = (e, i, n) => {
23
+ const l = n.offsetWidth, o = i.offsetWidth;
24
+ return e < 0 ? 0 : e > l - o ? l - o : e;
25
25
  }, this.toggle = (e, i) => {
26
26
  this.setState({ checked: e }), this.valueDuringOnChange = e, C(this.props.onChange, i, this, { value: e }), this.valueDuringOnChange = void 0;
27
27
  }, this._element = null, this._wrapper = null, this._input = null, this._id = this.props.id, this.defaultValidationMessage = L(this), this.focus = () => {
@@ -47,7 +47,7 @@ const a = class a extends s.Component {
47
47
  if (this.props.disabled)
48
48
  return;
49
49
  const { keyCode: i } = e;
50
- (i === f.space || i === f.enter) && (this.toggle(!this.value, e), e.preventDefault());
50
+ (i === v.space || i === v.enter) && (this.toggle(!this.value, e), e.preventDefault());
51
51
  }, this.handleWrapperFocus = (e) => {
52
52
  if (this.props.disabled)
53
53
  return;
@@ -122,12 +122,12 @@ const a = class a extends s.Component {
122
122
  * @hidden
123
123
  */
124
124
  render() {
125
- const { focused: r } = this.state, { dir: e, disabled: i, trackRounded: o, thumbRounded: n, size: l, offLabel: u, onLabel: m, tabIndex: b } = this.props;
125
+ const { focused: r } = this.state, { dir: e, disabled: i, trackRounded: n, thumbRounded: l, size: o, offLabel: m, onLabel: f, tabIndex: b } = this.props;
126
126
  this.dir = e || this.element && getComputedStyle(this.element).direction || void 0;
127
127
  const y = !this.validityStyles || this.validity.valid, k = p(
128
128
  "k-switch",
129
129
  {
130
- [`k-switch-${v.sizeMap[l] || l}`]: l,
130
+ [`k-switch-${c.sizeMap[o] || o}`]: o,
131
131
  "k-switch-on": this.value,
132
132
  "k-switch-off": !this.value,
133
133
  "k-focus": r,
@@ -165,17 +165,17 @@ const a = class a extends s.Component {
165
165
  "span",
166
166
  {
167
167
  className: p("k-switch-track", {
168
- [`k-rounded-${v.roundedMap[o] || o}`]: o
168
+ [`k-rounded-${c.roundedMap[n] || n}`]: n
169
169
  }),
170
170
  ref: (d) => {
171
171
  this._element = d;
172
172
  }
173
173
  },
174
174
  this.dummyInput(this.value),
175
- m ? /* @__PURE__ */ s.createElement("span", { className: "k-switch-label-on" }, m) : "",
176
- u ? /* @__PURE__ */ s.createElement("span", { className: "k-switch-label-off" }, u) : ""
175
+ f ? /* @__PURE__ */ s.createElement("span", { className: "k-switch-label-on" }, f) : "",
176
+ m ? /* @__PURE__ */ s.createElement("span", { className: "k-switch-label-off" }, m) : ""
177
177
  ),
178
- /* @__PURE__ */ s.createElement("span", { className: "k-switch-thumb-wrap" }, /* @__PURE__ */ s.createElement("span", { className: p("k-switch-thumb", { [`k-rounded-${n}`]: n }) }))
178
+ /* @__PURE__ */ s.createElement("span", { className: "k-switch-thumb-wrap" }, /* @__PURE__ */ s.createElement("span", { className: p("k-switch-thumb", { [`k-rounded-${c.roundedMap[l] || l}`]: l }) }))
179
179
  );
180
180
  }
181
181
  };
@@ -214,16 +214,16 @@ a.displayName = "Switch", a.propTypes = {
214
214
  onLabel: "ON",
215
215
  validityStyles: !0
216
216
  };
217
- let c = a;
218
- const M = N(), O = D(
217
+ let u = a;
218
+ const B = N(), O = D(
219
219
  E(
220
- M,
221
- c
220
+ B,
221
+ u
222
222
  )
223
223
  );
224
224
  O.displayName = "KendoReactSwitch";
225
225
  export {
226
226
  O as Switch,
227
- M as SwitchPropsContext,
228
- c as SwitchWithoutContext
227
+ B as SwitchPropsContext,
228
+ u as SwitchWithoutContext
229
229
  };