@progress/kendo-react-inputs 13.4.0-develop.3 → 13.4.0-develop.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-inputs",
3
- "version": "13.4.0-develop.3",
3
+ "version": "13.4.0-develop.5",
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": "13.4.0-develop.3",
32
- "@progress/kendo-react-buttons": "13.4.0-develop.3",
33
- "@progress/kendo-react-common": "13.4.0-develop.3",
34
- "@progress/kendo-react-dialogs": "13.4.0-develop.3",
35
- "@progress/kendo-react-layout": "13.4.0-develop.3",
36
- "@progress/kendo-react-intl": "13.4.0-develop.3",
37
- "@progress/kendo-react-labels": "13.4.0-develop.3",
38
- "@progress/kendo-react-popup": "13.4.0-develop.3",
31
+ "@progress/kendo-react-animation": "13.4.0-develop.5",
32
+ "@progress/kendo-react-buttons": "13.4.0-develop.5",
33
+ "@progress/kendo-react-common": "13.4.0-develop.5",
34
+ "@progress/kendo-react-dialogs": "13.4.0-develop.5",
35
+ "@progress/kendo-react-layout": "13.4.0-develop.5",
36
+ "@progress/kendo-react-intl": "13.4.0-develop.5",
37
+ "@progress/kendo-react-labels": "13.4.0-develop.5",
38
+ "@progress/kendo-react-popup": "13.4.0-develop.5",
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": 1770312080,
85
+ "publishDate": 1770377871,
86
86
  "licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
87
87
  }
88
88
  },
@@ -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 ze=require("@progress/kendo-inputs-common"),_=require("@progress/kendo-react-buttons"),a=require("@progress/kendo-react-common"),Oe=require("@progress/kendo-react-dialogs"),Ee=require("@progress/kendo-react-intl"),r=require("prop-types"),xe=require("react"),p=require("../messages/index.js"),ne=require("../package-metadata.js"),Me=require("./utils/index.js"),N=require("@progress/kendo-svg-icons");function we(c){const k=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const g in c)if(g!=="default"){const v=Object.getOwnPropertyDescriptor(c,g);Object.defineProperty(k,g,v.get?v:{enumerable:!0,get:()=>c[g]})}}return k.default=c,Object.freeze(k)}const n=we(xe),Ie=250,Le=84,ae=3,re=2,Pe="#000000",qe="#ffffff",oe=c=>c!==void 0,se=a.createPropsContext(),E=n.forwardRef((c,k)=>{const g=!a.validatePackage(ne.packageMetadata,{component:"Signature"}),v=a.getLicenseMessage(ne.packageMetadata),F=a.usePropsContext(se,c),e=n.useMemo(()=>({strokeWidth:l.strokeWidth,smooth:l.smooth,popupScale:l.popupScale,exportScale:l.exportScale,maximizable:l.maximizable,disabled:l.disabled,required:l.required,validityStyles:l.validityStyles,onChange:l.onChange,onFocus:l.onFocus,onBlur:l.onBlur,onOpen:l.onOpen,onClose:l.onClose,size:l.size,rounded:l.rounded,fillMode:l.fillMode,...F}),[F]),x=Ee.useLocalization(),d=n.useRef(null),y=n.useRef(null),j=n.useRef(null),W=n.useRef(null),M=n.useRef(null),[s,ie]=n.useState(),[h,G]=n.useState(!1),[w,A]=n.useState(!1),[C,V]=n.useState(),[le,ce]=n.useState(),U=oe(e.value)?e.value:C,[ue,de]=n.useState(!1),b=oe(e.open),f=b?e.open:ue,me=e.maximized||w||!e.maximizable||e.disabled,pe=!(e.maximized&&!w),ge=!(!(e.value||C)||w||e.readOnly||e.disabled),H=x.toLanguageString(p.signatureMaximize,p.messages[p.signatureMaximize]),$=x.toLanguageString(p.signatureMinimize,p.messages[p.signatureMinimize]),K=x.toLanguageString(p.signatureClear,p.messages[p.signatureClear]),I=e.popupScale||ae,L=e.exportScale||re,P=t=>{V(t),e.onChange&&e.onChange({value:t})},fe=t=>{s==null||s.loadImage(t.value),P(t.value)};n.useEffect(()=>{e.value!==C&&(V(e.value),s==null||s.loadImage(e.value))},[e.value]);const ke=()=>{s==null||s.clear(),P()},S=n.useCallback(t=>{b||de(t)},[b]),be=t=>{var o,i;Z(t),(i=((o=M.current)==null?void 0:o.element)||y.current)==null||i.focus()},q=n.useCallback(()=>{let t=Pe;return!e.color&&typeof document!="undefined"&&d.current&&(t=getComputedStyle(d.current).color),e.color||t},[e.color]),D=n.useCallback(()=>{let t=qe;return!e.backgroundColor&&typeof document!="undefined"&&d.current&&(t=getComputedStyle(d.current).backgroundColor),e.backgroundColor||t},[e.backgroundColor]),X=()=>({scale:e.maximized?e.popupScale:1,color:q(),backgroundColor:D(),strokeWidth:e.strokeWidth,smooth:e.smooth,readonly:e.readOnly}),J=async t=>{const{width:o,height:i}=t;return await(s==null?void 0:s.exportImage({width:o*L,height:i*L}))};n.useEffect(()=>{const t=y.current,o=new ze.SignaturePad(t,X());return U&&o.loadImage(U),ie(o),()=>o.destroy()},[]),n.useEffect(()=>{s==null||s.setOptions({onChange:async()=>P(await J(ee())),onDraw:()=>A(!0),onDrawEnd:()=>A(!1)})},[s]),a.useIsomorphicLayoutEffect(()=>s==null?void 0:s.setOptions(X()),[e.readOnly,e.color,e.backgroundColor,e.strokeWidth,e.smooth]),n.useEffect(()=>{var i,u;const t=(u=(i=j.current)==null?void 0:i.element)==null?void 0:u.querySelector(".k-overlay");if(!t)return;const o=()=>S(!1);return t.addEventListener("click",o),()=>t.removeEventListener("click",o)},[f]),n.useEffect(()=>{if(!f||typeof document=="undefined")return;const t=o=>{var i,u;o.key==="Escape"&&(S(!1),(u=(i=M.current)==null?void 0:i.element)==null||u.focus())};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[f]),n.useEffect(()=>{var t,o;e.maximized&&((o=(t=W.current)==null?void 0:t.element)==null||o.focus())},[]);const R=n.useCallback(()=>{var t;return(t=y.current)==null?void 0:t.focus()},[]),z=n.useCallback(()=>e.value,[e.value]),Q=n.useCallback(()=>e.name,[e.name]),O=n.useCallback(()=>e.required,[e.required]),T=n.useCallback(()=>{const t=e.validationMessage!==void 0,i=!z(),u=e.valid!==void 0?e.valid:!O()||!i;return{customError:t,valid:u,valueMissing:i}},[e.validationMessage,e.valid,z,O]),B=n.useCallback(()=>e.validityStyles,[e.validityStyles]),Y=n.useCallback(()=>e,[e]),m=n.useCallback(()=>{const t={element:d.current,focus:R};return Object.defineProperty(t,"name",{get:Q}),Object.defineProperty(t,"value",{get:z}),Object.defineProperty(t,"validity",{get:T}),Object.defineProperty(t,"validityStyles",{get:B}),Object.defineProperty(t,"required",{get:O}),Object.defineProperty(t,"props",{get:Y}),Object.defineProperty(t,"color",{get:q}),Object.defineProperty(t,"backgroundColor",{get:D}),t},[Q,z,T,B,O,R,Y,q,D]);n.useImperativeHandle(k,m);const ve=n.useCallback(t=>{h||e.maximized||(G(!0),a.dispatchEvent(e.onFocus,t,m(),{}))},[h,e.onFocus,m]),ye=n.useCallback(t=>{Me.hasParent(t.relatedTarget,d.current)||(G(!1),a.dispatchEvent(e.onBlur,t,m(),{}))},[h,e.onBlur,m]),he=n.useCallback(async t=>{ce(await J(te())),S(!0),a.dispatchEvent(e.onOpen,t,m(),{})},[f,b,e.onOpen,e.value,C,m]),Z=n.useCallback(t=>{S(!1),a.dispatchEvent(e.onClose,t,m(),{})},[f,b,e.onClose,m]),Ce=()=>{ke(),R()},ee=()=>{var i,u;const t=e.width||((i=d.current)==null?void 0:i.offsetWidth)||Ie,o=e.height||((u=d.current)==null?void 0:u.offsetHeight)||Le;return{width:t,height:o}},te=()=>{const{width:t,height:o}=ee();return{width:t*I,height:o*I}},Se=!B()||T().valid;return n.createElement("div",{ref:d,dir:e.dir,style:{width:e.width,height:e.height,...e.style},className:a.classNames("k-input","k-signature",{"k-signature-maximized":e.maximized,[`k-signature-${a.kendoThemeMaps.sizeMap[e.size]||e.size}`]:e.size,[`k-signature-${e.fillMode}`]:e.fillMode,[`k-input-${e.fillMode}`]:e.fillMode,[`k-rounded-${a.kendoThemeMaps.roundedMap[e.rounded]||e.rounded}`]:e.rounded,"k-invalid":!Se,"k-required":e.required,"k-disabled":e.disabled,"k-focus":h},e.className),onFocus:ve,onBlur:ye},n.createElement("div",{className:"k-signature-canvas",ref:y,tabIndex:a.getTabIndex(e.tabIndex,e.disabled),role:"img",id:e.id,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledBy,"aria-describedby":e.ariaDescribedBy,"aria-disabled":e.disabled?"true":void 0,style:e.inputStyle}),n.createElement("div",{className:"k-signature-actions k-signature-actions-top"},n.createElement(_.Button,{type:"button",className:a.classNames("k-signature-action","k-signature-maximize",{"k-hidden":e.disabled||me}),ref:M,icon:"hyperlink-open",svgIcon:N.hyperlinkOpenIcon,size:e.size,rounded:e.rounded,fillMode:"flat",onClick:he,"aria-label":H,title:H}),n.createElement(_.Button,{type:"button",className:a.classNames("k-signature-action","k-signature-minimize","k-rotate-180",{"k-hidden":e.disabled||pe}),ref:W,icon:"hyperlink-open",svgIcon:N.hyperlinkOpenIcon,size:e.size,rounded:e.rounded,fillMode:"flat",onClick:Z,"aria-label":$,title:$})),!e.hideLine&&n.createElement("div",{className:"k-signature-line",style:{zIndex:2,pointerEvents:"none"}}),n.createElement("div",{className:"k-signature-actions k-signature-actions-bottom"},ge&&n.createElement(_.Button,{type:"button",className:"k-signature-action k-signature-clear",icon:"x",svgIcon:N.xIcon,size:e.size,rounded:e.rounded,fillMode:"flat",onClick:Ce,"aria-label":K,title:K})),f&&n.createElement(Oe.Dialog,{ref:j},n.createElement(E,{...e,...te(),value:le,maximized:!0,exportScale:1/I*L,open:!1,onChange:fe,onClose:be})),g&&n.createElement(a.WatermarkOverlay,{message:v}))});E.propTypes={value:r.string,width:r.number,height:r.number,tabIndex:r.number,dir:r.string,ariaDescribedBy:r.string,ariaLabelledBy:r.string,ariaLabel:r.string,readOnly:r.bool,disabled:r.bool,validationMessage:r.string,required:r.bool,onChange:r.func,onFocus:r.func,onBlur:r.func,onOpen:r.func,onClose:r.func,size:r.oneOf(["small","medium","large"]),rounded:r.oneOf(["small","medium","large"]),fillMode:r.oneOf(["solid","flat","outline"])};const l={strokeWidth:1,smooth:!1,popupScale:ae,exportScale:re,maximizable:!0,disabled:!1,required:!1,validityStyles:!0,onChange:c=>a.noop,onFocus:c=>a.noop,onBlur:c=>a.noop,onOpen:c=>a.noop,onClose:c=>a.noop,size:void 0,rounded:void 0,fillMode:void 0};E.displayName="KendoSignature";exports.Signature=E;exports.SignaturePropsContext=se;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ze=require("@progress/kendo-inputs-common"),_=require("@progress/kendo-react-buttons"),a=require("@progress/kendo-react-common"),Oe=require("@progress/kendo-react-dialogs"),Ee=require("@progress/kendo-react-intl"),r=require("prop-types"),xe=require("react"),p=require("../messages/index.js"),ne=require("../package-metadata.js"),Me=require("./utils/index.js"),N=require("@progress/kendo-svg-icons");function we(c){const k=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const g in c)if(g!=="default"){const v=Object.getOwnPropertyDescriptor(c,g);Object.defineProperty(k,g,v.get?v:{enumerable:!0,get:()=>c[g]})}}return k.default=c,Object.freeze(k)}const n=we(xe),Ie=250,Le=84,ae=3,re=2,Pe="#000000",qe="#ffffff",oe=c=>c!==void 0,se=a.createPropsContext(),E=n.forwardRef((c,k)=>{const g=!a.validatePackage(ne.packageMetadata,{component:"Signature"}),v=a.getLicenseMessage(ne.packageMetadata),F=a.usePropsContext(se,c),e=n.useMemo(()=>({strokeWidth:l.strokeWidth,smooth:l.smooth,popupScale:l.popupScale,exportScale:l.exportScale,maximizable:l.maximizable,disabled:l.disabled,required:l.required,validityStyles:l.validityStyles,onChange:l.onChange,onFocus:l.onFocus,onBlur:l.onBlur,onOpen:l.onOpen,onClose:l.onClose,size:l.size,rounded:l.rounded,fillMode:l.fillMode,...F}),[F]),x=Ee.useLocalization(),d=n.useRef(null),y=n.useRef(null),j=n.useRef(null),W=n.useRef(null),M=n.useRef(null),[s,ie]=n.useState(),[h,G]=n.useState(!1),[w,A]=n.useState(!1),[C,V]=n.useState(),[le,ce]=n.useState(),U=oe(e.value)?e.value:C,[ue,de]=n.useState(!1),b=oe(e.open),f=b?e.open:ue,me=e.maximized||w||!e.maximizable||e.disabled,pe=!(e.maximized&&!w),ge=!(!(e.value||C)||w||e.readOnly||e.disabled),H=x.toLanguageString(p.signatureMaximize,p.messages[p.signatureMaximize]),$=x.toLanguageString(p.signatureMinimize,p.messages[p.signatureMinimize]),K=x.toLanguageString(p.signatureClear,p.messages[p.signatureClear]),I=e.popupScale||ae,L=e.exportScale||re,P=t=>{V(t),e.onChange&&e.onChange({value:t})},fe=t=>{s==null||s.loadImage(t.value),P(t.value)};n.useEffect(()=>{e.value!==C&&(V(e.value),s==null||s.loadImage(e.value))},[e.value]);const ke=()=>{s==null||s.clear(),P()},S=n.useCallback(t=>{b||de(t)},[b]),be=t=>{var o,i;Z(t),(i=((o=M.current)==null?void 0:o.element)||y.current)==null||i.focus()},q=n.useCallback(()=>{let t=Pe;return!e.color&&typeof document!="undefined"&&d.current&&(t=getComputedStyle(d.current).color),e.color||t},[e.color]),D=n.useCallback(()=>{let t=qe;return!e.backgroundColor&&typeof document!="undefined"&&d.current&&(t=getComputedStyle(d.current).backgroundColor),e.backgroundColor||t},[e.backgroundColor]),X=()=>({scale:e.maximized?e.popupScale:1,color:q(),backgroundColor:D(),strokeWidth:e.strokeWidth,smooth:e.smooth,readonly:e.readOnly}),J=async t=>{const{width:o,height:i}=t;return await(s==null?void 0:s.exportImage({width:o*L,height:i*L}))};n.useEffect(()=>{const t=y.current,o=new ze.SignaturePad(t,X());return U&&o.loadImage(U),ie(o),()=>o.destroy()},[]),n.useEffect(()=>{s==null||s.setOptions({onChange:async()=>P(await J(ee())),onDraw:()=>A(!0),onDrawEnd:()=>A(!1)})},[s]),a.useIsomorphicLayoutEffect(()=>s==null?void 0:s.setOptions(X()),[e.readOnly,e.color,e.backgroundColor,e.strokeWidth,e.smooth]),n.useEffect(()=>{var i,u;const t=(u=(i=j.current)==null?void 0:i.element)==null?void 0:u.querySelector(".k-overlay");if(!t)return;const o=()=>S(!1);return t.addEventListener("click",o),()=>t.removeEventListener("click",o)},[f]),n.useEffect(()=>{if(!f||typeof document=="undefined")return;const t=o=>{var i,u;o.key==="Escape"&&(S(!1),(u=(i=M.current)==null?void 0:i.element)==null||u.focus())};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[f]),n.useEffect(()=>{var t,o;e.maximized&&((o=(t=W.current)==null?void 0:t.element)==null||o.focus())},[]);const R=n.useCallback(()=>{var t;return(t=y.current)==null?void 0:t.focus()},[]),z=n.useCallback(()=>e.value,[e.value]),Q=n.useCallback(()=>e.name,[e.name]),O=n.useCallback(()=>e.required,[e.required]),T=n.useCallback(()=>{const t=e.validationMessage!==void 0,i=!z(),u=e.valid!==void 0?e.valid:!O()||!i;return{customError:t,valid:u,valueMissing:i}},[e.validationMessage,e.valid,z,O]),B=n.useCallback(()=>e.validityStyles,[e.validityStyles]),Y=n.useCallback(()=>e,[e]),m=n.useCallback(()=>{const t={element:d.current,focus:R};return Object.defineProperty(t,"name",{get:Q}),Object.defineProperty(t,"value",{get:z}),Object.defineProperty(t,"validity",{get:T}),Object.defineProperty(t,"validityStyles",{get:B}),Object.defineProperty(t,"required",{get:O}),Object.defineProperty(t,"props",{get:Y}),Object.defineProperty(t,"color",{get:q}),Object.defineProperty(t,"backgroundColor",{get:D}),t},[Q,z,T,B,O,R,Y,q,D]);n.useImperativeHandle(k,m);const ve=n.useCallback(t=>{h||e.maximized||(G(!0),a.dispatchEvent(e.onFocus,t,m(),{}))},[h,e.onFocus,m]),ye=n.useCallback(t=>{Me.hasParent(t.relatedTarget,d.current)||(G(!1),a.dispatchEvent(e.onBlur,t,m(),{}))},[h,e.onBlur,m]),he=n.useCallback(async t=>{ce(await J(te())),S(!0),a.dispatchEvent(e.onOpen,t,m(),{})},[f,b,e.onOpen,e.value,C,m]),Z=n.useCallback(t=>{S(!1),a.dispatchEvent(e.onClose,t,m(),{})},[f,b,e.onClose,m]),Ce=()=>{ke(),R()},ee=()=>{var i,u;const t=e.width||((i=d.current)==null?void 0:i.offsetWidth)||Ie,o=e.height||((u=d.current)==null?void 0:u.offsetHeight)||Le;return{width:t,height:o}},te=()=>{const{width:t,height:o}=ee();return{width:t*I,height:o*I}},Se=!B()||T().valid;return n.createElement("div",{ref:d,dir:e.dir,style:{width:e.width,height:e.height,...e.style},className:a.classNames("k-input","k-signature",{"k-signature-maximized":e.maximized,[`k-signature-${a.kendoThemeMaps.sizeMap[e.size]||e.size}`]:e.size,[`k-signature-${e.fillMode}`]:e.fillMode,[`k-input-${e.fillMode}`]:e.fillMode,[`k-rounded-${a.kendoThemeMaps.roundedMap[e.rounded]||e.rounded}`]:e.rounded,"k-invalid":!Se,"k-required":e.required,"k-disabled":e.disabled,"k-focus":h},e.className),onFocus:ve,onBlur:ye},n.createElement("div",{className:"k-signature-canvas",ref:y,tabIndex:a.getTabIndex(e.tabIndex,e.disabled),role:"img",id:e.id,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledBy,"aria-describedby":e.ariaDescribedBy,"aria-disabled":e.disabled?"true":void 0,style:e.inputStyle}),n.createElement("div",{className:"k-signature-actions k-signature-actions-top"},n.createElement(_.Button,{type:"button",className:a.classNames("k-signature-action","k-signature-maximize",{"k-hidden":e.disabled||me}),ref:M,icon:"hyperlink-open",svgIcon:N.hyperlinkOpenIcon,size:e.size,rounded:e.rounded,fillMode:"flat",onClick:he,"aria-label":H,title:H}),n.createElement(_.Button,{type:"button",className:a.classNames("k-signature-action","k-signature-minimize","k-rotate-180",{"k-hidden":e.disabled||pe}),ref:W,icon:"hyperlink-open",svgIcon:N.hyperlinkOpenIcon,size:e.size,rounded:e.rounded,fillMode:"flat",onClick:Z,"aria-label":$,title:$})),!e.hideLine&&n.createElement("div",{className:"k-signature-line",style:{zIndex:2,pointerEvents:"none"}}),n.createElement("div",{className:"k-signature-actions k-signature-actions-bottom"},ge&&n.createElement(_.Button,{type:"button",className:"k-signature-action k-signature-clear",icon:"x",svgIcon:N.xIcon,size:e.size,rounded:e.rounded,fillMode:"flat",onClick:Ce,"aria-label":K,title:K})),f&&n.createElement(Oe.Dialog,{ref:j},n.createElement(E,{...e,...te(),value:le,maximized:!0,exportScale:1/I*L,open:!1,onChange:fe,onClose:be})),g&&n.createElement(a.WatermarkOverlay,{message:v}))});E.propTypes={value:r.string,width:r.number,height:r.number,tabIndex:r.number,dir:r.string,ariaDescribedBy:r.string,ariaLabelledBy:r.string,ariaLabel:r.string,readOnly:r.bool,disabled:r.bool,validationMessage:r.string,required:r.bool,onChange:r.func,onFocus:r.func,onBlur:r.func,onOpen:r.func,onClose:r.func,size:r.oneOf(["small","medium","large"]),rounded:r.oneOf(["small","medium","large","none"]),fillMode:r.oneOf(["solid","flat","outline"])};const l={strokeWidth:1,smooth:!1,popupScale:ae,exportScale:re,maximizable:!0,disabled:!1,required:!1,validityStyles:!0,onChange:c=>a.noop,onFocus:c=>a.noop,onBlur:c=>a.noop,onOpen:c=>a.noop,onClose:c=>a.noop,size:void 0,rounded:void 0,fillMode:void 0};E.displayName="KendoSignature";exports.Signature=E;exports.SignaturePropsContext=se;
@@ -297,7 +297,7 @@ _.propTypes = {
297
297
  onOpen: a.func,
298
298
  onClose: a.func,
299
299
  size: a.oneOf(["small", "medium", "large"]),
300
- rounded: a.oneOf(["small", "medium", "large"]),
300
+ rounded: a.oneOf(["small", "medium", "large", "none"]),
301
301
  fillMode: a.oneOf(["solid", "flat", "outline"])
302
302
  };
303
303
  const s = {
@@ -153,7 +153,7 @@ export interface SignatureProps extends FormComponentProps {
153
153
  * <Signature rounded="medium" />
154
154
  * ```
155
155
  */
156
- rounded?: 'small' | 'medium' | 'large';
156
+ rounded?: 'small' | 'medium' | 'large' | 'none';
157
157
  /**
158
158
  * Configures the fill mode of the Signature.
159
159
  *
@@ -125,7 +125,7 @@ export interface SwitchProps extends ToggleBaseProps, FormComponentProps {
125
125
  * <Switch trackRounded="medium" />
126
126
  * ```
127
127
  */
128
- trackRounded?: 'small' | 'medium' | 'large' | 'full';
128
+ trackRounded?: 'small' | 'medium' | 'large' | 'full' | 'none';
129
129
  /**
130
130
  * Configures the `thumbRounded` property of the Switch.
131
131
  *
@@ -142,7 +142,7 @@ export interface SwitchProps extends ToggleBaseProps, FormComponentProps {
142
142
  * <Switch thumbRounded="full" />
143
143
  * ```
144
144
  */
145
- thumbRounded?: 'small' | 'medium' | 'large' | 'full';
145
+ thumbRounded?: 'small' | 'medium' | 'large' | 'full' | 'none';
146
146
  /**
147
147
  * Identifies the element(s) which will describe the component.
148
148
  * For example these elements could contain error or hint message.
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"),X=require("prop-types"),i=require("@progress/kendo-react-common"),Y=require("@progress/kendo-react-intl"),S=require("../messages/index.js");function z(e){const u=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const c in e)if(c!=="default"){const m=Object.getOwnPropertyDescriptor(e,c);Object.defineProperty(u,c,m.get?m:{enumerable:!0,get:()=>e[c]})}}return u.default=e,Object.freeze(u)}const d=z(n),t=z(X),l={disabled:!1,defaultChecked:!1,size:void 0,trackRounded:void 0,thumbRounded:void 0,offLabel:"OFF",onBlur:i.noop,onFocus:i.noop,onLabel:"ON",validityStyles:!0},M=d.forwardRef((e,u)=>{var P;const{disabled:c=l.disabled,defaultChecked:m=l.defaultChecked,size:v=l.size,trackRounded:y=l.trackRounded,thumbRounded:g=l.thumbRounded,offLabel:x=l.offLabel,onBlur:C=l.onBlur,onFocus:w=l.onFocus,onLabel:L=l.onLabel}=e,[E,j]=n.useState(m||!1),[V,O]=n.useState(!1),o=n.useRef(null),I=n.useRef(null),R=n.useRef(null),b=n.useRef(void 0),q=n.useRef(void 0),B=n.useRef(void 0),D=n.useMemo(()=>new Y.LocalizationService,[]),s=n.useMemo(()=>b.current!==void 0?b.current:e.checked!==void 0?e.checked:E,[e.checked,E]),f=n.useMemo(()=>{var T,F;const a=e.validationMessage!==void 0,r=(T=e.valid)!=null?T:e.required?!!s:!0,U=(F=e.valid)!=null?F:r;return{customError:a,valid:U,valueMissing:s===null}},[e.valid,e.validationMessage,e.required,s]),_=(P=e.validityStyles)!=null?P:l.validityStyles;n.useEffect(()=>{var a;(a=R.current)!=null&&a.setCustomValidity&&R.current.setCustomValidity(f.valid?"":e.validationMessage||D.toLanguageString(S.switchValidation,S.messages[S.switchValidation]))},[f,e.validationMessage,D]),n.useEffect(()=>{o.current&&(B.current=e.dir||getComputedStyle(o.current).direction||void 0)},[e.dir]);const h=n.useCallback(()=>({props:e,get element(){return o.current},get actionElement(){return I.current},get value(){return s},get name(){return e.name},get validity(){return f}}),[e,s,f]),k=n.useCallback((a,r)=>{j(a),b.current=a,i.dispatchEvent(e.onChange,r,{...h(),value:a},{value:a}),b.current=void 0},[e.onChange,h]),W=n.useCallback(a=>{q.current!==a.timeStamp&&(q.current=a.timeStamp,k(!s,a))},[s,k]),H=n.useCallback(a=>{if(c)return;const{keyCode:r}=a;(r===i.Keys.space||r===i.Keys.enter)&&(k(!s,a),a.preventDefault())},[c,s,k]),$=n.useCallback(a=>{c||(O(!0),w&&w(a))},[c,w]),p=n.useCallback(a=>{c||(O(!1),C&&C(a))},[c,C]);n.useImperativeHandle(u,h,[h]);const A=B.current||e.dir||o.current&&getComputedStyle(o.current).direction||void 0,G=!_||f.valid,J=i.classNames("k-switch",{[`k-switch-${i.kendoThemeMaps.sizeMap[v]||v}`]:v,"k-switch-on":s,"k-switch-off":!s,"k-focus":V,"k-disabled":c,"k-invalid":!G},e.className),Q=d.createElement("input",{type:"checkbox",checked:e.checked,ref:R,tabIndex:-1,"aria-hidden":!0,value:s,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"},onChange:i.noop,name:e.name||void 0});return d.createElement("span",{ref:I,role:"switch","aria-checked":s,"aria-disabled":c||void 0,"aria-labelledby":e.ariaLabelledBy,"aria-describedby":e.ariaDescribedBy,"aria-label":e.ariaLabel,"aria-required":e.required,className:J,dir:A,onKeyDown:H,onClick:W,onBlur:p,onFocus:$,tabIndex:i.getTabIndex(e.tabIndex,c,void 0),accessKey:e.accessKey,id:e.id},d.createElement("span",{className:i.classNames("k-switch-track",{[`k-rounded-${i.kendoThemeMaps.roundedMap[y]||y}`]:y}),ref:o},Q,L?d.createElement("span",{className:"k-switch-label-on"},L):"",x?d.createElement("span",{className:"k-switch-label-off"},x):""),d.createElement("span",{className:"k-switch-thumb-wrap"},d.createElement("span",{className:i.classNames("k-switch-thumb",{[`k-rounded-${i.kendoThemeMaps.roundedMap[g]||g}`]:g})})))});M.displayName="Switch";const K=i.createPropsContext(),N=i.withIdHOC(i.withPropsContext(K,M));N.displayName="KendoReactSwitch";N.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=N;exports.SwitchPropsContext=K;exports.SwitchWithoutContext=M;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),Y=require("prop-types"),i=require("@progress/kendo-react-common"),Z=require("@progress/kendo-react-intl"),N=require("../messages/index.js");function z(e){const f=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const h=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(f,s,h.get?h:{enumerable:!0,get:()=>e[s]})}}return f.default=e,Object.freeze(f)}const d=z(n),t=z(Y),l={disabled:!1,defaultChecked:!1,size:void 0,trackRounded:void 0,thumbRounded:void 0,offLabel:"OFF",onBlur:i.noop,onFocus:i.noop,onLabel:"ON",validityStyles:!0},x=d.forwardRef((e,f)=>{var F;const{disabled:s=l.disabled,defaultChecked:h=l.defaultChecked,size:C=l.size,trackRounded:w=l.trackRounded,thumbRounded:R=l.thumbRounded,offLabel:O=l.offLabel,onBlur:S=l.onBlur,onFocus:M=l.onFocus,onLabel:T=l.onLabel}=e,[I,V]=n.useState(h||!1),[_,P]=n.useState(!1),o=n.useRef(null),m=n.useRef(null),E=n.useRef(null),v=n.useRef(void 0),q=n.useRef(void 0),B=n.useRef(void 0),D=n.useMemo(()=>new Z.LocalizationService,[]),c=n.useMemo(()=>v.current!==void 0?v.current:e.checked!==void 0?e.checked:I,[e.checked,I]),b=n.useMemo(()=>{var g,K;const a=e.validationMessage!==void 0,r=(g=e.valid)!=null?g:e.required?!!c:!0,y=(K=e.valid)!=null?K:r;return{customError:a,valid:y,valueMissing:c===null}},[e.valid,e.validationMessage,e.required,c]),W=(F=e.validityStyles)!=null?F:l.validityStyles;n.useEffect(()=>{var a;(a=E.current)!=null&&a.setCustomValidity&&E.current.setCustomValidity(b.valid?"":e.validationMessage||D.toLanguageString(N.switchValidation,N.messages[N.switchValidation]))},[b,e.validationMessage,D]),n.useEffect(()=>{o.current&&(B.current=e.dir||getComputedStyle(o.current).direction||void 0)},[e.dir]);const k=n.useCallback(()=>({props:e,get element(){return o.current},get actionElement(){return m.current},get value(){return c},get name(){return e.name},get validity(){return b}}),[e,c,b]),u=n.useCallback((a,r)=>{V(a),v.current=a,i.dispatchEvent(e.onChange,r,{...k(),value:a},{value:a}),v.current=void 0},[e.onChange,k]);n.useEffect(()=>{const a=e.name||e.id,r=i.subscribeToKendoPaste(m.current,{fieldName:a,onValueChange:y=>{if(y!==c){const g={target:m.current,currentTarget:m.current,nativeEvent:new Event("change",{bubbles:!0})};u(y,g)}}});return()=>{r==null||r.unsubscribe()}},[e.name,e.id,c,u]);const H=n.useCallback(a=>{q.current!==a.timeStamp&&(q.current=a.timeStamp,u(!c,a))},[c,u]),$=n.useCallback(a=>{if(s)return;const{keyCode:r}=a;(r===i.Keys.space||r===i.Keys.enter)&&(u(!c,a),a.preventDefault())},[s,c,u]),A=n.useCallback(a=>{s||(P(!0),M&&M(a))},[s,M]),G=n.useCallback(a=>{s||(P(!1),S&&S(a))},[s,S]);n.useImperativeHandle(f,k,[k]);const J=B.current||e.dir||o.current&&getComputedStyle(o.current).direction||void 0,Q=!W||b.valid,U=i.classNames("k-switch",{[`k-switch-${i.kendoThemeMaps.sizeMap[C]||C}`]:C,"k-switch-on":c,"k-switch-off":!c,"k-focus":_,"k-disabled":s,"k-invalid":!Q},e.className),X=d.createElement("input",{type:"checkbox",checked:e.checked,ref:E,tabIndex:-1,"aria-hidden":!0,value:c,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"},onChange:i.noop,name:e.name||void 0});return d.createElement("span",{ref:m,role:"switch","aria-checked":c,"aria-disabled":s||void 0,"aria-labelledby":e.ariaLabelledBy,"aria-describedby":e.ariaDescribedBy,"aria-label":e.ariaLabel,"aria-required":e.required,className:U,dir:J,onKeyDown:$,onClick:H,onBlur:G,onFocus:A,tabIndex:i.getTabIndex(e.tabIndex,s,void 0),accessKey:e.accessKey,id:e.id},d.createElement("span",{className:i.classNames("k-switch-track",{[`k-rounded-${i.kendoThemeMaps.roundedMap[w]||w}`]:w}),ref:o},X,T?d.createElement("span",{className:"k-switch-label-on"},T):"",O?d.createElement("span",{className:"k-switch-label-off"},O):""),d.createElement("span",{className:"k-switch-thumb-wrap"},d.createElement("span",{className:i.classNames("k-switch-thumb",{[`k-rounded-${i.kendoThemeMaps.roundedMap[R]||R}`]:R})})))});x.displayName="Switch";const j=i.createPropsContext(),L=i.withIdHOC(i.withPropsContext(j,x));L.displayName="KendoReactSwitch";L.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=L;exports.SwitchPropsContext=j;exports.SwitchWithoutContext=x;
package/switch/Switch.mjs CHANGED
@@ -5,59 +5,59 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import * as r from "react";
9
- import { useState as q, useRef as o, useMemo as C, useEffect as P, useCallback as s, useImperativeHandle as ae } from "react";
8
+ import * as c from "react";
9
+ import { useState as q, useRef as s, useMemo as E, useEffect as L, useCallback as u, useImperativeHandle as ae } from "react";
10
10
  import * as t from "prop-types";
11
- import { withIdHOC as ne, withPropsContext as ie, createPropsContext as de, noop as L, dispatchEvent as re, Keys as T, classNames as R, kendoThemeMaps as S, getTabIndex as le } from "@progress/kendo-react-common";
12
- import { LocalizationService as ce } from "@progress/kendo-react-intl";
13
- import { switchValidation as V, messages as oe } from "../messages/index.mjs";
14
- const i = {
11
+ import { withIdHOC as ne, withPropsContext as ie, createPropsContext as de, noop as M, dispatchEvent as re, subscribeToKendoPaste as ce, Keys as V, classNames as N, kendoThemeMaps as x, getTabIndex as le } from "@progress/kendo-react-common";
12
+ import { LocalizationService as oe } from "@progress/kendo-react-intl";
13
+ import { switchValidation as H, messages as se } from "../messages/index.mjs";
14
+ const d = {
15
15
  disabled: !1,
16
16
  defaultChecked: !1,
17
17
  size: void 0,
18
18
  trackRounded: void 0,
19
19
  thumbRounded: void 0,
20
20
  offLabel: "OFF",
21
- onBlur: L,
22
- onFocus: L,
21
+ onBlur: M,
22
+ onFocus: M,
23
23
  onLabel: "ON",
24
24
  validityStyles: !0
25
- }, H = r.forwardRef((e, $) => {
26
- var z;
25
+ }, W = c.forwardRef((e, j) => {
26
+ var T;
27
27
  const {
28
- disabled: d = i.disabled,
29
- defaultChecked: j = i.defaultChecked,
30
- size: b = i.size,
31
- trackRounded: v = i.trackRounded,
32
- thumbRounded: y = i.thumbRounded,
33
- offLabel: N = i.offLabel,
34
- onBlur: k = i.onBlur,
35
- onFocus: g = i.onFocus,
36
- onLabel: x = i.onLabel
37
- } = e, [E, A] = q(j || !1), [G, M] = q(!1), l = o(null), B = o(null), w = o(null), m = o(void 0), I = o(void 0), F = o(void 0), D = C(() => new ce(), []), n = C(() => m.current !== void 0 ? m.current : e.checked !== void 0 ? e.checked : E, [e.checked, E]), u = C(() => {
38
- var K, O;
39
- const a = e.validationMessage !== void 0, c = (K = e.valid) != null ? K : e.required ? !!n : !0, te = (O = e.valid) != null ? O : c;
28
+ disabled: r = d.disabled,
29
+ defaultChecked: A = d.defaultChecked,
30
+ size: g = d.size,
31
+ trackRounded: k = d.trackRounded,
32
+ thumbRounded: w = d.thumbRounded,
33
+ offLabel: B = d.offLabel,
34
+ onBlur: C = d.onBlur,
35
+ onFocus: R = d.onFocus,
36
+ onLabel: I = d.onLabel
37
+ } = e, [F, G] = q(A || !1), [J, D] = q(!1), l = s(null), m = s(null), S = s(null), b = s(void 0), K = s(void 0), z = s(void 0), O = E(() => new oe(), []), n = E(() => b.current !== void 0 ? b.current : e.checked !== void 0 ? e.checked : F, [e.checked, F]), f = E(() => {
38
+ var y, P;
39
+ const a = e.validationMessage !== void 0, i = (y = e.valid) != null ? y : e.required ? !!n : !0, v = (P = e.valid) != null ? P : i;
40
40
  return {
41
41
  customError: a,
42
- valid: te,
42
+ valid: v,
43
43
  valueMissing: n === null
44
44
  };
45
- }, [e.valid, e.validationMessage, e.required, n]), J = (z = e.validityStyles) != null ? z : i.validityStyles;
46
- P(() => {
45
+ }, [e.valid, e.validationMessage, e.required, n]), Q = (T = e.validityStyles) != null ? T : d.validityStyles;
46
+ L(() => {
47
47
  var a;
48
- (a = w.current) != null && a.setCustomValidity && w.current.setCustomValidity(
49
- u.valid ? "" : e.validationMessage || D.toLanguageString(V, oe[V])
48
+ (a = S.current) != null && a.setCustomValidity && S.current.setCustomValidity(
49
+ f.valid ? "" : e.validationMessage || O.toLanguageString(H, se[H])
50
50
  );
51
- }, [u, e.validationMessage, D]), P(() => {
52
- l.current && (F.current = e.dir || getComputedStyle(l.current).direction || void 0);
51
+ }, [f, e.validationMessage, O]), L(() => {
52
+ l.current && (z.current = e.dir || getComputedStyle(l.current).direction || void 0);
53
53
  }, [e.dir]);
54
- const f = s(() => ({
54
+ const h = u(() => ({
55
55
  props: e,
56
56
  get element() {
57
57
  return l.current;
58
58
  },
59
59
  get actionElement() {
60
- return B.current;
60
+ return m.current;
61
61
  },
62
62
  get value() {
63
63
  return n;
@@ -66,120 +66,139 @@ const i = {
66
66
  return e.name;
67
67
  },
68
68
  get validity() {
69
- return u;
69
+ return f;
70
70
  }
71
- }), [e, n, u]), h = s(
72
- (a, c) => {
73
- A(a), m.current = a, re(
71
+ }), [e, n, f]), o = u(
72
+ (a, i) => {
73
+ G(a), b.current = a, re(
74
74
  e.onChange,
75
- c,
76
- { ...f(), value: a },
75
+ i,
76
+ { ...h(), value: a },
77
77
  { value: a }
78
- ), m.current = void 0;
78
+ ), b.current = void 0;
79
79
  },
80
- [e.onChange, f]
81
- ), Q = s(
80
+ [e.onChange, h]
81
+ );
82
+ L(() => {
83
+ const a = e.name || e.id, i = ce(m.current, {
84
+ fieldName: a,
85
+ onValueChange: (v) => {
86
+ if (v !== n) {
87
+ const y = {
88
+ target: m.current,
89
+ currentTarget: m.current,
90
+ nativeEvent: new Event("change", { bubbles: !0 })
91
+ };
92
+ o(v, y);
93
+ }
94
+ }
95
+ });
96
+ return () => {
97
+ i == null || i.unsubscribe();
98
+ };
99
+ }, [e.name, e.id, n, o]);
100
+ const U = u(
82
101
  (a) => {
83
- I.current !== a.timeStamp && (I.current = a.timeStamp, h(!n, a));
102
+ K.current !== a.timeStamp && (K.current = a.timeStamp, o(!n, a));
84
103
  },
85
- [n, h]
86
- ), U = s(
104
+ [n, o]
105
+ ), X = u(
87
106
  (a) => {
88
- if (d)
107
+ if (r)
89
108
  return;
90
- const { keyCode: c } = a;
91
- (c === T.space || c === T.enter) && (h(!n, a), a.preventDefault());
109
+ const { keyCode: i } = a;
110
+ (i === V.space || i === V.enter) && (o(!n, a), a.preventDefault());
92
111
  },
93
- [d, n, h]
94
- ), X = s(
112
+ [r, n, o]
113
+ ), Y = u(
95
114
  (a) => {
96
- d || (M(!0), g && g(a));
115
+ r || (D(!0), R && R(a));
97
116
  },
98
- [d, g]
99
- ), Y = s(
117
+ [r, R]
118
+ ), Z = u(
100
119
  (a) => {
101
- d || (M(!1), k && k(a));
120
+ r || (D(!1), C && C(a));
102
121
  },
103
- [d, k]
122
+ [r, C]
104
123
  );
105
- ae($, f, [f]);
106
- const Z = F.current || e.dir || l.current && getComputedStyle(l.current).direction || void 0, _ = !J || u.valid, p = R(
124
+ ae(j, h, [h]);
125
+ const _ = z.current || e.dir || l.current && getComputedStyle(l.current).direction || void 0, p = !Q || f.valid, ee = N(
107
126
  "k-switch",
108
127
  {
109
- [`k-switch-${S.sizeMap[b] || b}`]: b,
128
+ [`k-switch-${x.sizeMap[g] || g}`]: g,
110
129
  "k-switch-on": n,
111
130
  "k-switch-off": !n,
112
- "k-focus": G,
113
- "k-disabled": d,
114
- "k-invalid": !_
131
+ "k-focus": J,
132
+ "k-disabled": r,
133
+ "k-invalid": !p
115
134
  },
116
135
  e.className
117
- ), ee = /* @__PURE__ */ r.createElement(
136
+ ), te = /* @__PURE__ */ c.createElement(
118
137
  "input",
119
138
  {
120
139
  type: "checkbox",
121
140
  checked: e.checked,
122
- ref: w,
141
+ ref: S,
123
142
  tabIndex: -1,
124
143
  "aria-hidden": !0,
125
144
  value: n,
126
145
  style: { opacity: 0, width: 1, border: 0, zIndex: -1, position: "absolute", left: "50%" },
127
- onChange: L,
146
+ onChange: M,
128
147
  name: e.name || void 0
129
148
  }
130
149
  );
131
- return /* @__PURE__ */ r.createElement(
150
+ return /* @__PURE__ */ c.createElement(
132
151
  "span",
133
152
  {
134
- ref: B,
153
+ ref: m,
135
154
  role: "switch",
136
155
  "aria-checked": n,
137
- "aria-disabled": d || void 0,
156
+ "aria-disabled": r || void 0,
138
157
  "aria-labelledby": e.ariaLabelledBy,
139
158
  "aria-describedby": e.ariaDescribedBy,
140
159
  "aria-label": e.ariaLabel,
141
160
  "aria-required": e.required,
142
- className: p,
143
- dir: Z,
144
- onKeyDown: U,
145
- onClick: Q,
146
- onBlur: Y,
147
- onFocus: X,
148
- tabIndex: le(e.tabIndex, d, void 0),
161
+ className: ee,
162
+ dir: _,
163
+ onKeyDown: X,
164
+ onClick: U,
165
+ onBlur: Z,
166
+ onFocus: Y,
167
+ tabIndex: le(e.tabIndex, r, void 0),
149
168
  accessKey: e.accessKey,
150
169
  id: e.id
151
170
  },
152
- /* @__PURE__ */ r.createElement(
171
+ /* @__PURE__ */ c.createElement(
153
172
  "span",
154
173
  {
155
- className: R("k-switch-track", {
156
- [`k-rounded-${S.roundedMap[v] || v}`]: v
174
+ className: N("k-switch-track", {
175
+ [`k-rounded-${x.roundedMap[k] || k}`]: k
157
176
  }),
158
177
  ref: l
159
178
  },
160
- ee,
161
- x ? /* @__PURE__ */ r.createElement("span", { className: "k-switch-label-on" }, x) : "",
162
- N ? /* @__PURE__ */ r.createElement("span", { className: "k-switch-label-off" }, N) : ""
179
+ te,
180
+ I ? /* @__PURE__ */ c.createElement("span", { className: "k-switch-label-on" }, I) : "",
181
+ B ? /* @__PURE__ */ c.createElement("span", { className: "k-switch-label-off" }, B) : ""
163
182
  ),
164
- /* @__PURE__ */ r.createElement("span", { className: "k-switch-thumb-wrap" }, /* @__PURE__ */ r.createElement(
183
+ /* @__PURE__ */ c.createElement("span", { className: "k-switch-thumb-wrap" }, /* @__PURE__ */ c.createElement(
165
184
  "span",
166
185
  {
167
- className: R("k-switch-thumb", {
168
- [`k-rounded-${S.roundedMap[y] || y}`]: y
186
+ className: N("k-switch-thumb", {
187
+ [`k-rounded-${x.roundedMap[w] || w}`]: w
169
188
  })
170
189
  }
171
190
  ))
172
191
  );
173
192
  });
174
- H.displayName = "Switch";
175
- const se = de(), W = ne(
193
+ W.displayName = "Switch";
194
+ const ue = de(), $ = ne(
176
195
  ie(
177
- se,
178
- H
196
+ ue,
197
+ W
179
198
  )
180
199
  );
181
- W.displayName = "KendoReactSwitch";
182
- W.propTypes = {
200
+ $.displayName = "KendoReactSwitch";
201
+ $.propTypes = {
183
202
  accessKey: t.string,
184
203
  checked: t.bool,
185
204
  className: t.string,
@@ -208,7 +227,7 @@ W.propTypes = {
208
227
  validityStyles: t.bool
209
228
  };
210
229
  export {
211
- W as Switch,
212
- se as SwitchPropsContext,
213
- H as SwitchWithoutContext
230
+ $ as Switch,
231
+ ue as SwitchPropsContext,
232
+ W as SwitchWithoutContext
214
233
  };
@@ -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 me=require("react"),e=require("prop-types"),o=require("@progress/kendo-react-common");function pe(l){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const s in l)if(s!=="default"){const i=Object.getOwnPropertyDescriptor(l,s);Object.defineProperty(c,s,i.get?i:{enumerable:!0,get:()=>l[s]})}}return c.default=l,Object.freeze(c)}const t=pe(me),q=o.createPropsContext(),S=t.forwardRef((l,c)=>{const s=o.usePropsContext(q,l),{size:i=f.size,rounded:x=f.rounded,fillMode:T=f.fillMode,autoFocus:R=f.autoFocus,flow:v=f.flow,prefix:D=null,suffix:H=null,ariaDescribedBy:$,ariaLabelledBy:L,autoSize:m,className:_,defaultValue:K,disabled:r,readOnly:G,required:p,rows:J,id:Q,name:U,placeholder:W,style:X,tabIndex:Y,value:y,valid:P,validationMessage:w,validityStyles:M,onChange:h,onFocus:k,onBlur:C,visited:be,touched:ge,modified:xe,resizable:d,inputAttributes:Z,textareaStyle:E,...ee}=s,a=t.useRef(null),A=t.useCallback(()=>{a.current&&a.current.focus()},[]),F=t.useCallback(()=>{a.current&&a.current.blur()},[]),[I,V]=t.useState(K),[te,B]=t.useState(!1),[oe,ae]=o.useCustomComponent(D),[re,ne]=o.useCustomComponent(H),b=y!==void 0,g=b?y:I,u=t.useCallback(()=>({element:a,focus:A,blur:F,get value(){return g},get name(){return a.current&&a.current.name}}),[F,A,g]);t.useImperativeHandle(c,u);const[N,j]=t.useState("auto"),se=o.useId(),le=o.useDir(a,s.dir),z=P!==void 0?P:p?!!g:!0;t.useEffect(()=>{a.current&&a.current.setCustomValidity&&a.current.setCustomValidity(z?"":w||"")},[z,w]),o.useIsomorphicLayoutEffect(()=>{a.current&&j(`${a.current.scrollHeight}px`)},[g]);const ie=t.useCallback(n=>{const O=n.target.value;j("auto"),!b&&!r&&V(O),h&&!r&&o.dispatchEvent(h,n,{...u(),value:O},{value:O})},[V,h,r,b]),ue=t.useCallback(n=>{B(!0),k&&!r&&o.dispatchEvent(k,n,u(),void 0)},[k,r,u]),ce=t.useCallback(n=>{B(!1),C&&!r&&o.dispatchEvent(C,n,u(),void 0)},[C,r,u]),de=t.useMemo(()=>{let n={};return m?n={resize:"none",overflow:"hidden",height:N}:d&&(n={resize:d}),{...n,...E}},[m,d,N,E]),fe={id:Q||se,role:"textbox",name:U,className:o.classNames("k-input-inner","!k-overflow-auto",{"k-resize":!m&&d!=="none","k-resize-none":m||d==="none","!k-flex-none":v==="vertical"}),ref:a,disabled:r,rows:J,placeholder:W,readOnly:G,required:p,tabIndex:o.getTabIndex(Y,r),autoFocus:R,style:de,"aria-labelledby":L,"aria-describedby":$,"aria-multiline":!0,"aria-disabled":r||void 0,"aria-required":p,value:b?y:I,...Object.assign({},ee,Z),onChange:ie,onFocus:ue,onBlur:ce};return t.createElement("span",{className:o.classNames("k-input","k-textarea",{[`k-input-${o.kendoThemeMaps.sizeMap[i]||i}`]:i,[`k-input-${T}`]:T,[`k-rounded-${o.kendoThemeMaps.roundedMap[x]||x}`]:x,"k-invalid":!(z||M!==void 0||M===!0),"k-required":p,"k-disabled":r,"k-focus":te,"!k-flex-col":v==="vertical","!k-flex-row":v==="horizontal"},_),style:X,dir:le},s.prefix&&t.createElement(oe,{...ae}),t.createElement("textarea",{...fe}),s.suffix&&t.createElement(re,{...ne}))});S.propTypes={ariaDescribedBy:e.string,ariaLabelledBy:e.string,autoSize:e.bool,className:e.string,defaultValue:e.string,dir:e.string,disabled:e.bool,readOnly:e.bool,rows:e.number,id:e.string,name:e.string,placeholder:e.string,style:e.object,tabIndex:e.number,value:e.oneOfType([e.string,e.arrayOf(e.string),e.number]),onChange:e.func,onFocus:e.func,onBlur:e.func,size:e.oneOf(["small","medium","large"]),rounded:e.oneOf(["small","medium","large","full"]),fillMode:e.oneOf(["solid","flat","outline"]),resizable:e.oneOf(["none","both","horizontal","vertical"]),autoFocus:e.bool,flow:e.oneOf(["vertical","horizontal"])};const f={size:void 0,rounded:void 0,fillMode:void 0,autoFocus:!1,flow:"horizontal"};S.displayName="KendoTextArea";exports.TextArea=S;exports.TextAreaPropsContext=q;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const pe=require("react"),e=require("prop-types"),r=require("@progress/kendo-react-common");function ge(l){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const s in l)if(s!=="default"){const u=Object.getOwnPropertyDescriptor(l,s);Object.defineProperty(c,s,u.get?u:{enumerable:!0,get:()=>l[s]})}}return c.default=l,Object.freeze(c)}const a=ge(pe),$=r.createPropsContext(),T=a.forwardRef((l,c)=>{const s=r.usePropsContext($,l),{size:u=m.size,rounded:x=m.rounded,fillMode:S=m.fillMode,autoFocus:K=m.autoFocus,flow:h=m.flow,prefix:L=null,suffix:_=null,ariaDescribedBy:G,ariaLabelledBy:J,autoSize:b,className:Q,defaultValue:U,disabled:o,readOnly:W,required:p,rows:X,id:w,name:E,placeholder:Y,style:Z,tabIndex:ee,value:y,valid:M,validationMessage:F,validityStyles:V,onChange:k,onFocus:C,onBlur:z,visited:ve,touched:xe,modified:he,resizable:d,inputAttributes:te,textareaStyle:A,...ae}=s,t=a.useRef(null),I=a.useCallback(()=>{t.current&&t.current.focus()},[]),N=a.useCallback(()=>{t.current&&t.current.blur()},[]),[B,j]=a.useState(U),[re,q]=a.useState(!1),[ne,oe]=r.useCustomComponent(L),[se,le]=r.useCustomComponent(_),g=y!==void 0,v=g?y:B,R=E||w,i=a.useCallback(()=>({element:t,focus:I,blur:N,get value(){return v},get name(){return t.current&&t.current.name}}),[N,I,v]);a.useImperativeHandle(c,i);const[D,H]=a.useState("auto"),ue=r.useId(),ie=r.useDir(t,s.dir),O=M!==void 0?M:p?!!v:!0;a.useEffect(()=>{t.current&&t.current.setCustomValidity&&t.current.setCustomValidity(O?"":F||"")},[O,F]),r.useIsomorphicLayoutEffect(()=>{t.current&&H(`${t.current.scrollHeight}px`)},[v]);const P=a.useCallback(n=>{const f=n.target.value;H("auto"),!g&&!o&&j(f),k&&!o&&r.dispatchEvent(k,n,{...i(),value:f},{value:f})},[j,k,o,g]),ce=a.useCallback(n=>{q(!0),C&&!o&&r.dispatchEvent(C,n,i(),void 0)},[C,o,i]),de=a.useCallback(n=>{q(!1),z&&!o&&r.dispatchEvent(z,n,i(),void 0)},[z,o,i]),fe=a.useCallback(n=>{t.current&&(t.current.value=n);const f={target:t.current,currentTarget:t.current};P(f)},[P]);r.useKendoPaste(t,{fieldName:R,onValueChange:fe,enabled:!!R});const me=a.useMemo(()=>{let n={};return b?n={resize:"none",overflow:"hidden",height:D}:d&&(n={resize:d}),{...n,...A}},[b,d,D,A]),be={id:w||ue,role:"textbox",name:E,className:r.classNames("k-input-inner","!k-overflow-auto",{"k-resize":!b&&d!=="none","k-resize-none":b||d==="none","!k-flex-none":h==="vertical"}),ref:t,disabled:o,rows:X,placeholder:Y,readOnly:W,required:p,tabIndex:r.getTabIndex(ee,o),autoFocus:K,style:me,"aria-labelledby":J,"aria-describedby":G,"aria-multiline":!0,"aria-disabled":o||void 0,"aria-required":p,value:g?y:B,...Object.assign({},ae,te),onChange:P,onFocus:ce,onBlur:de};return a.createElement("span",{className:r.classNames("k-input","k-textarea",{[`k-input-${r.kendoThemeMaps.sizeMap[u]||u}`]:u,[`k-input-${S}`]:S,[`k-rounded-${r.kendoThemeMaps.roundedMap[x]||x}`]:x,"k-invalid":!(O||V!==void 0||V===!0),"k-required":p,"k-disabled":o,"k-focus":re,"!k-flex-col":h==="vertical","!k-flex-row":h==="horizontal"},Q),style:Z,dir:ie},s.prefix&&a.createElement(ne,{...oe}),a.createElement("textarea",{...be}),s.suffix&&a.createElement(se,{...le}))});T.propTypes={ariaDescribedBy:e.string,ariaLabelledBy:e.string,autoSize:e.bool,className:e.string,defaultValue:e.string,dir:e.string,disabled:e.bool,readOnly:e.bool,rows:e.number,id:e.string,name:e.string,placeholder:e.string,style:e.object,tabIndex:e.number,value:e.oneOfType([e.string,e.arrayOf(e.string),e.number]),onChange:e.func,onFocus:e.func,onBlur:e.func,size:e.oneOf(["small","medium","large"]),rounded:e.oneOf(["small","medium","large","full","none"]),fillMode:e.oneOf(["solid","flat","outline"]),resizable:e.oneOf(["none","both","horizontal","vertical"]),autoFocus:e.bool,flow:e.oneOf(["vertical","horizontal"])};const m={size:void 0,rounded:void 0,fillMode:void 0,autoFocus:!1,flow:"horizontal"};T.displayName="KendoTextArea";exports.TextArea=T;exports.TextAreaPropsContext=$;