@progress/kendo-react-inputs 14.5.0-develop.13 → 14.5.0-develop.14

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.
Files changed (39) hide show
  1. package/MaskedTextBoxMcpWrapper.d.ts +17 -0
  2. package/MaskedTextBoxMcpWrapper.js +8 -0
  3. package/MaskedTextBoxMcpWrapper.mjs +18 -0
  4. package/colors/ColorPicker.js +1 -1
  5. package/colors/ColorPicker.mjs +194 -183
  6. package/colors/interfaces/ColorPickerProps.d.ts +6 -1
  7. package/dist/cdn/js/kendo-react-inputs.js +1 -1
  8. package/index.d.mts +5 -1
  9. package/index.d.ts +5 -1
  10. package/index.js +1 -1
  11. package/index.mjs +92 -89
  12. package/maskedtextbox/MaskedTextBoxProps.d.ts +6 -1
  13. package/numerictextbox/NumericTextBox.js +1 -1
  14. package/numerictextbox/NumericTextBox.mjs +170 -168
  15. package/numerictextbox/interfaces/NumericTextBoxProps.d.ts +6 -1
  16. package/package-metadata.js +1 -1
  17. package/package-metadata.mjs +2 -2
  18. package/package.json +10 -10
  19. package/range-slider/RangeSlider.d.ts +6 -1
  20. package/range-slider/RangeSlider.js +2 -2
  21. package/range-slider/RangeSlider.mjs +43 -43
  22. package/rating/Rating.d.ts +6 -1
  23. package/rating/Rating.js +2 -2
  24. package/rating/Rating.mjs +62 -62
  25. package/signature/Signature.js +1 -1
  26. package/signature/Signature.mjs +94 -92
  27. package/signature/interfaces/SignatureProps.d.ts +6 -1
  28. package/slider/Slider.d.ts +6 -1
  29. package/slider/Slider.js +1 -1
  30. package/slider/Slider.mjs +131 -134
  31. package/switch/Switch.d.ts +6 -1
  32. package/switch/Switch.js +1 -1
  33. package/switch/Switch.mjs +88 -86
  34. package/textarea/TextArea.js +1 -1
  35. package/textarea/TextArea.mjs +97 -95
  36. package/textarea/interfaces/TextAreaProps.d.ts +6 -1
  37. package/textbox/Textbox.d.ts +20 -1
  38. package/textbox/Textbox.js +1 -1
  39. package/textbox/Textbox.mjs +92 -81
@@ -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","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;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Oe=require("@progress/kendo-inputs-common"),_=require("@progress/kendo-react-buttons"),a=require("@progress/kendo-react-common"),Ee=require("@progress/kendo-react-dialogs"),xe=require("@progress/kendo-react-intl"),s=require("prop-types"),Me=require("react"),m=require("../messages/index.js"),oe=require("../package-metadata.js"),we=require("./utils/index.js"),N=require("@progress/kendo-svg-icons");function Ie(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=Ie(Me),Le=250,Pe=84,se=3,re=2,Re="#000000",qe="#ffffff",ae=c=>c!==void 0,ie=a.createPropsContext(),E=n.forwardRef((c,k)=>{const g=!a.validatePackage(oe.packageMetadata,{component:"Signature"}),v=a.getLicenseMessage(oe.packageMetadata),F=a.usePropsContext(ie,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=xe.useLocalization(),p=n.useRef(null),y=n.useRef(null),j=n.useRef(null),W=n.useRef(null),M=n.useRef(null),[r,le]=n.useState(),[h,G]=n.useState(!1),[w,A]=n.useState(!1),[C,V]=n.useState(),[ce,ue]=n.useState(),U=ae(e.value)?e.value:C,[de,pe]=n.useState(!1),b=ae(e.open),f=b?e.open:de,me=e.maximized||w||!e.maximizable||e.disabled,ge=!(e.maximized&&!w),fe=!(!(e.value||C)||w||e.readOnly||e.disabled),H=x.toLanguageString(m.signatureMaximize,m.messages[m.signatureMaximize]),$=x.toLanguageString(m.signatureMinimize,m.messages[m.signatureMinimize]),K=x.toLanguageString(m.signatureClear,m.messages[m.signatureClear]),I=e.popupScale||se,L=e.exportScale||re,P=t=>{V(t),e.onChange&&e.onChange({value:t})},ke=t=>{r==null||r.loadImage(t.value),P(t.value)};n.useEffect(()=>{e.value!==C&&(V(e.value),r==null||r.loadImage(e.value))},[e.value]);const be=()=>{r==null||r.clear(),P()},S=n.useCallback(t=>{b||pe(t)},[b]),ve=t=>{var o,i;ee(t),(i=((o=M.current)==null?void 0:o.element)||y.current)==null||i.focus()},R=n.useCallback(()=>{let t=Re;return!e.color&&typeof document!="undefined"&&p.current&&(t=getComputedStyle(p.current).color),e.color||t},[e.color]),q=n.useCallback(()=>{let t=qe;return!e.backgroundColor&&typeof document!="undefined"&&p.current&&(t=getComputedStyle(p.current).backgroundColor),e.backgroundColor||t},[e.backgroundColor]),X=()=>({scale:e.maximized?e.popupScale:1,color:R(),backgroundColor:q(),strokeWidth:e.strokeWidth,smooth:e.smooth,readonly:e.readOnly}),J=async t=>{const{width:o,height:i}=t;return await(r==null?void 0:r.exportImage({width:o*L,height:i*L}))};n.useEffect(()=>{const t=y.current,o=new Oe.SignaturePad(t,X());return U&&o.loadImage(U),le(o),()=>o.destroy()},[]),n.useEffect(()=>{r==null||r.setOptions({onChange:async()=>P(await J(te())),onDraw:()=>A(!0),onDrawEnd:()=>A(!1)})},[r]),a.useIsomorphicLayoutEffect(()=>r==null?void 0:r.setOptions(X()),[e.readOnly,e.color,e.backgroundColor,e.strokeWidth,e.smooth]),n.useEffect(()=>{var i,d;const t=(d=(i=j.current)==null?void 0:i.element)==null?void 0:d.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,d;o.key==="Escape"&&(S(!1),(d=(i=M.current)==null?void 0:i.element)==null||d.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 D=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(),d=e.valid!==void 0?e.valid:!O()||!i;return{customError:t,valid:d,valueMissing:i}},[e.validationMessage,e.valid,z,O]),B=n.useCallback(()=>e.validityStyles,[e.validityStyles]),Y=n.useCallback(()=>e,[e]),u=n.useCallback(()=>{const t={element:p.current,focus:D};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:R}),Object.defineProperty(t,"backgroundColor",{get:q}),t},[Q,z,T,B,O,D,Y,R,q]);n.useImperativeHandle(k,u);const Z=n.useRef(null);n.useImperativeHandle(Z,u),a.useWebMcpRegister("signature",Z,e,e.webMcp);const ye=n.useCallback(t=>{h||e.maximized||(G(!0),a.dispatchEvent(e.onFocus,t,u(),{}))},[h,e.onFocus,u]),he=n.useCallback(t=>{we.hasParent(t.relatedTarget,p.current)||(G(!1),a.dispatchEvent(e.onBlur,t,u(),{}))},[h,e.onBlur,u]),Ce=n.useCallback(async t=>{ue(await J(ne())),S(!0),a.dispatchEvent(e.onOpen,t,u(),{})},[f,b,e.onOpen,e.value,C,u]),ee=n.useCallback(t=>{S(!1),a.dispatchEvent(e.onClose,t,u(),{})},[f,b,e.onClose,u]),Se=()=>{be(),D()},te=()=>{var i,d;const t=e.width||((i=p.current)==null?void 0:i.offsetWidth)||Le,o=e.height||((d=p.current)==null?void 0:d.offsetHeight)||Pe;return{width:t,height:o}},ne=()=>{const{width:t,height:o}=te();return{width:t*I,height:o*I}},ze=!B()||T().valid;return n.createElement("div",{ref:p,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":!ze,"k-required":e.required,"k-disabled":e.disabled,"k-focus":h},e.className),onFocus:ye,onBlur:he},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:Ce,"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||ge}),ref:W,icon:"hyperlink-open",svgIcon:N.hyperlinkOpenIcon,size:e.size,rounded:e.rounded,fillMode:"flat",onClick:ee,"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"},fe&&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:Se,"aria-label":K,title:K})),f&&n.createElement(Ee.Dialog,{ref:j},n.createElement(E,{...e,...ne(),value:ce,maximized:!0,exportScale:1/I*L,open:!1,onChange:ke,onClose:ve})),g&&n.createElement(a.WatermarkOverlay,{message:v}))});E.propTypes={value:s.string,width:s.number,height:s.number,tabIndex:s.number,dir:s.string,ariaDescribedBy:s.string,ariaLabelledBy:s.string,ariaLabel:s.string,readOnly:s.bool,disabled:s.bool,validationMessage:s.string,required:s.bool,onChange:s.func,onFocus:s.func,onBlur:s.func,onOpen:s.func,onClose:s.func,size:s.oneOf(["small","medium","large"]),rounded:s.oneOf(["small","medium","large","none"]),fillMode:s.oneOf(["solid","flat","outline"])};const l={strokeWidth:1,smooth:!1,popupScale:se,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=ie;
@@ -6,18 +6,18 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import { SignaturePad as Le } from "@progress/kendo-inputs-common";
9
- import { Button as T } from "@progress/kendo-react-buttons";
10
- import { validatePackage as we, getLicenseMessage as Ie, usePropsContext as Pe, noop as f, useIsomorphicLayoutEffect as De, dispatchEvent as h, classNames as B, kendoThemeMaps as ee, getTabIndex as Te, WatermarkOverlay as Be, createPropsContext as Re } from "@progress/kendo-react-common";
11
- import { Dialog as Fe } from "@progress/kendo-react-dialogs";
12
- import { useLocalization as _e } from "@progress/kendo-react-intl";
9
+ import { Button as R } from "@progress/kendo-react-buttons";
10
+ import { validatePackage as Ie, getLicenseMessage as Pe, usePropsContext as De, noop as f, useIsomorphicLayoutEffect as Re, useWebMcpRegister as Te, dispatchEvent as h, classNames as T, kendoThemeMaps as te, getTabIndex as Be, WatermarkOverlay as Fe, createPropsContext as _e } from "@progress/kendo-react-common";
11
+ import { Dialog as We } from "@progress/kendo-react-dialogs";
12
+ import { useLocalization as Ne } from "@progress/kendo-react-intl";
13
13
  import a from "prop-types";
14
14
  import * as o from "react";
15
- import { signatureMaximize as te, messages as R, signatureMinimize as oe, signatureClear as ne } from "../messages/index.mjs";
16
- import { packageMetadata as ae } from "../package-metadata.mjs";
17
- import { hasParent as Ne } from "./utils/index.mjs";
18
- import { hyperlinkOpenIcon as re, xIcon as We } from "@progress/kendo-svg-icons";
19
- const qe = 250, Ge = 84, se = 3, le = 2, Ae = "#000000", Ve = "#ffffff", ie = (d) => d !== void 0, je = Re(), F = o.forwardRef((d, ce) => {
20
- const ue = !we(ae, { component: "Signature" }), de = Ie(ae), _ = Pe(je, d), e = o.useMemo(
15
+ import { signatureMaximize as oe, messages as B, signatureMinimize as ne, signatureClear as ae } from "../messages/index.mjs";
16
+ import { packageMetadata as re } from "../package-metadata.mjs";
17
+ import { hasParent as qe } from "./utils/index.mjs";
18
+ import { hyperlinkOpenIcon as ie, xIcon as Ge } from "@progress/kendo-svg-icons";
19
+ const Ae = 250, Ve = 84, le = 3, ce = 2, je = "#000000", Ue = "#ffffff", se = (d) => d !== void 0, He = _e(), F = o.forwardRef((d, ue) => {
20
+ const de = !Ie(re, { component: "Signature" }), me = Pe(re), _ = De(He, d), e = o.useMemo(
21
21
  () => ({
22
22
  strokeWidth: s.strokeWidth,
23
23
  smooth: s.smooth,
@@ -38,34 +38,34 @@ const qe = 250, Ge = 84, se = 3, le = 2, Ae = "#000000", Ve = "#ffffff", ie = (d
38
38
  ..._
39
39
  }),
40
40
  [_]
41
- ), S = _e(), c = o.useRef(null), g = o.useRef(null), N = o.useRef(null), W = o.useRef(null), z = o.useRef(null), [r, me] = o.useState(), [b, q] = o.useState(!1), [E, G] = o.useState(!1), [k, A] = o.useState(), [pe, fe] = o.useState(), V = ie(e.value) ? e.value : k, [ge, be] = o.useState(!1), p = ie(e.open), m = p ? e.open : ge, ke = e.maximized || E || !e.maximizable || e.disabled, ve = !(e.maximized && !E), ye = !(!(e.value || k) || E || e.readOnly || e.disabled), j = S.toLanguageString(te, R[te]), U = S.toLanguageString(oe, R[oe]), H = S.toLanguageString(ne, R[ne]), O = e.popupScale || se, x = e.exportScale || le, M = (t) => {
41
+ ), S = Ne(), u = o.useRef(null), g = o.useRef(null), W = o.useRef(null), N = o.useRef(null), z = o.useRef(null), [r, pe] = o.useState(), [b, q] = o.useState(!1), [E, G] = o.useState(!1), [k, A] = o.useState(), [fe, ge] = o.useState(), V = se(e.value) ? e.value : k, [be, ke] = o.useState(!1), p = se(e.open), m = p ? e.open : be, ve = e.maximized || E || !e.maximizable || e.disabled, ye = !(e.maximized && !E), Ce = !(!(e.value || k) || E || e.readOnly || e.disabled), j = S.toLanguageString(oe, B[oe]), U = S.toLanguageString(ne, B[ne]), H = S.toLanguageString(ae, B[ae]), O = e.popupScale || le, x = e.exportScale || ce, M = (t) => {
42
42
  A(t), e.onChange && e.onChange({ value: t });
43
- }, Ce = (t) => {
43
+ }, he = (t) => {
44
44
  r == null || r.loadImage(t.value), M(t.value);
45
45
  };
46
46
  o.useEffect(() => {
47
47
  e.value !== k && (A(e.value), r == null || r.loadImage(e.value));
48
48
  }, [e.value]);
49
- const he = () => {
49
+ const Se = () => {
50
50
  r == null || r.clear(), M();
51
51
  }, v = o.useCallback(
52
52
  (t) => {
53
- p || be(t);
53
+ p || ke(t);
54
54
  },
55
55
  [p]
56
- ), Se = (t) => {
56
+ ), ze = (t) => {
57
57
  var n, i;
58
- Q(t), (i = ((n = z.current) == null ? void 0 : n.element) || g.current) == null || i.focus();
59
- }, L = o.useCallback(() => {
60
- let t = Ae;
61
- return !e.color && typeof document != "undefined" && c.current && (t = getComputedStyle(c.current).color), e.color || t;
62
- }, [e.color]), w = o.useCallback(() => {
63
- let t = Ve;
64
- return !e.backgroundColor && typeof document != "undefined" && c.current && (t = getComputedStyle(c.current).backgroundColor), e.backgroundColor || t;
58
+ Y(t), (i = ((n = z.current) == null ? void 0 : n.element) || g.current) == null || i.focus();
59
+ }, w = o.useCallback(() => {
60
+ let t = je;
61
+ return !e.color && typeof document != "undefined" && u.current && (t = getComputedStyle(u.current).color), e.color || t;
62
+ }, [e.color]), L = o.useCallback(() => {
63
+ let t = Ue;
64
+ return !e.backgroundColor && typeof document != "undefined" && u.current && (t = getComputedStyle(u.current).backgroundColor), e.backgroundColor || t;
65
65
  }, [e.backgroundColor]), $ = () => ({
66
66
  scale: e.maximized ? e.popupScale : 1,
67
- color: L(),
68
- backgroundColor: w(),
67
+ color: w(),
68
+ backgroundColor: L(),
69
69
  strokeWidth: e.strokeWidth,
70
70
  smooth: e.smooth,
71
71
  readonly: e.readOnly
@@ -78,19 +78,19 @@ const qe = 250, Ge = 84, se = 3, le = 2, Ae = "#000000", Ve = "#ffffff", ie = (d
78
78
  };
79
79
  o.useEffect(() => {
80
80
  const t = g.current, n = new Le(t, $());
81
- return V && n.loadImage(V), me(n), () => n.destroy();
81
+ return V && n.loadImage(V), pe(n), () => n.destroy();
82
82
  }, []), o.useEffect(() => {
83
83
  r == null || r.setOptions({
84
- onChange: async () => M(await K(Y())),
84
+ onChange: async () => M(await K(Z())),
85
85
  onDraw: () => G(!0),
86
86
  onDrawEnd: () => G(!1)
87
87
  });
88
- }, [r]), De(
88
+ }, [r]), Re(
89
89
  () => r == null ? void 0 : r.setOptions($()),
90
90
  [e.readOnly, e.color, e.backgroundColor, e.strokeWidth, e.smooth]
91
91
  ), o.useEffect(() => {
92
- var i, l;
93
- const t = (l = (i = N.current) == null ? void 0 : i.element) == null ? void 0 : l.querySelector(".k-overlay");
92
+ var i, c;
93
+ const t = (c = (i = W.current) == null ? void 0 : i.element) == null ? void 0 : c.querySelector(".k-overlay");
94
94
  if (!t)
95
95
  return;
96
96
  const n = () => v(!1);
@@ -99,30 +99,30 @@ const qe = 250, Ge = 84, se = 3, le = 2, Ae = "#000000", Ve = "#ffffff", ie = (d
99
99
  if (!m || typeof document == "undefined")
100
100
  return;
101
101
  const t = (n) => {
102
- var i, l;
103
- n.key === "Escape" && (v(!1), (l = (i = z.current) == null ? void 0 : i.element) == null || l.focus());
102
+ var i, c;
103
+ n.key === "Escape" && (v(!1), (c = (i = z.current) == null ? void 0 : i.element) == null || c.focus());
104
104
  };
105
105
  return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
106
106
  }, [m]), o.useEffect(() => {
107
107
  var t, n;
108
- e.maximized && ((n = (t = W.current) == null ? void 0 : t.element) == null || n.focus());
108
+ e.maximized && ((n = (t = N.current) == null ? void 0 : t.element) == null || n.focus());
109
109
  }, []);
110
110
  const I = o.useCallback(() => {
111
111
  var t;
112
112
  return (t = g.current) == null ? void 0 : t.focus();
113
113
  }, []), y = o.useCallback(() => e.value, [e.value]), X = o.useCallback(() => e.name, [e.name]), C = o.useCallback(() => e.required, [e.required]), P = o.useCallback(() => {
114
- const t = e.validationMessage !== void 0, i = !y(), l = e.valid !== void 0 ? e.valid : !C() || !i;
114
+ const t = e.validationMessage !== void 0, i = !y(), c = e.valid !== void 0 ? e.valid : !C() || !i;
115
115
  return {
116
116
  customError: t,
117
- valid: l,
117
+ valid: c,
118
118
  valueMissing: i
119
119
  };
120
- }, [e.validationMessage, e.valid, y, C]), D = o.useCallback(() => e.validityStyles, [e.validityStyles]), J = o.useCallback(() => e, [e]), u = o.useCallback(() => {
120
+ }, [e.validationMessage, e.valid, y, C]), D = o.useCallback(() => e.validityStyles, [e.validityStyles]), J = o.useCallback(() => e, [e]), l = o.useCallback(() => {
121
121
  const t = {
122
- element: c.current,
122
+ element: u.current,
123
123
  focus: I
124
124
  };
125
- return Object.defineProperty(t, "name", { get: X }), Object.defineProperty(t, "value", { get: y }), Object.defineProperty(t, "validity", { get: P }), Object.defineProperty(t, "validityStyles", { get: D }), Object.defineProperty(t, "required", { get: C }), Object.defineProperty(t, "props", { get: J }), Object.defineProperty(t, "color", { get: L }), Object.defineProperty(t, "backgroundColor", { get: w }), t;
125
+ return Object.defineProperty(t, "name", { get: X }), Object.defineProperty(t, "value", { get: y }), Object.defineProperty(t, "validity", { get: P }), Object.defineProperty(t, "validityStyles", { get: D }), Object.defineProperty(t, "required", { get: C }), Object.defineProperty(t, "props", { get: J }), Object.defineProperty(t, "color", { get: w }), Object.defineProperty(t, "backgroundColor", { get: L }), t;
126
126
  }, [
127
127
  X,
128
128
  y,
@@ -131,77 +131,79 @@ const qe = 250, Ge = 84, se = 3, le = 2, Ae = "#000000", Ve = "#ffffff", ie = (d
131
131
  C,
132
132
  I,
133
133
  J,
134
- L,
135
- w
134
+ w,
135
+ L
136
136
  ]);
137
- o.useImperativeHandle(ce, u);
138
- const ze = o.useCallback(
137
+ o.useImperativeHandle(ue, l);
138
+ const Q = o.useRef(null);
139
+ o.useImperativeHandle(Q, l), Te("signature", Q, e, e.webMcp);
140
+ const Ee = o.useCallback(
139
141
  (t) => {
140
- b || e.maximized || (q(!0), h(e.onFocus, t, u(), {}));
142
+ b || e.maximized || (q(!0), h(e.onFocus, t, l(), {}));
141
143
  },
142
- [b, e.onFocus, u]
143
- ), Ee = o.useCallback(
144
+ [b, e.onFocus, l]
145
+ ), Oe = o.useCallback(
144
146
  (t) => {
145
- Ne(t.relatedTarget, c.current) || (q(!1), h(e.onBlur, t, u(), {}));
147
+ qe(t.relatedTarget, u.current) || (q(!1), h(e.onBlur, t, l(), {}));
146
148
  },
147
- [b, e.onBlur, u]
148
- ), Oe = o.useCallback(
149
+ [b, e.onBlur, l]
150
+ ), xe = o.useCallback(
149
151
  async (t) => {
150
- fe(await K(Z())), v(!0), h(e.onOpen, t, u(), {});
152
+ ge(await K(ee())), v(!0), h(e.onOpen, t, l(), {});
151
153
  },
152
- [m, p, e.onOpen, e.value, k, u]
153
- ), Q = o.useCallback(
154
+ [m, p, e.onOpen, e.value, k, l]
155
+ ), Y = o.useCallback(
154
156
  (t) => {
155
- v(!1), h(e.onClose, t, u(), {});
157
+ v(!1), h(e.onClose, t, l(), {});
156
158
  },
157
- [m, p, e.onClose, u]
158
- ), xe = () => {
159
- he(), I();
160
- }, Y = () => {
161
- var i, l;
162
- const t = e.width || ((i = c.current) == null ? void 0 : i.offsetWidth) || qe, n = e.height || ((l = c.current) == null ? void 0 : l.offsetHeight) || Ge;
159
+ [m, p, e.onClose, l]
160
+ ), Me = () => {
161
+ Se(), I();
162
+ }, Z = () => {
163
+ var i, c;
164
+ const t = e.width || ((i = u.current) == null ? void 0 : i.offsetWidth) || Ae, n = e.height || ((c = u.current) == null ? void 0 : c.offsetHeight) || Ve;
163
165
  return {
164
166
  width: t,
165
167
  height: n
166
168
  };
167
- }, Z = () => {
168
- const { width: t, height: n } = Y();
169
+ }, ee = () => {
170
+ const { width: t, height: n } = Z();
169
171
  return {
170
172
  width: t * O,
171
173
  height: n * O
172
174
  };
173
- }, Me = !D() || P().valid;
175
+ }, we = !D() || P().valid;
174
176
  return /* @__PURE__ */ o.createElement(
175
177
  "div",
176
178
  {
177
- ref: c,
179
+ ref: u,
178
180
  dir: e.dir,
179
181
  style: { width: e.width, height: e.height, ...e.style },
180
- className: B(
182
+ className: T(
181
183
  "k-input",
182
184
  "k-signature",
183
185
  {
184
186
  "k-signature-maximized": e.maximized,
185
- [`k-signature-${ee.sizeMap[e.size] || e.size}`]: e.size,
187
+ [`k-signature-${te.sizeMap[e.size] || e.size}`]: e.size,
186
188
  [`k-signature-${e.fillMode}`]: e.fillMode,
187
189
  [`k-input-${e.fillMode}`]: e.fillMode,
188
- [`k-rounded-${ee.roundedMap[e.rounded] || e.rounded}`]: e.rounded,
189
- "k-invalid": !Me,
190
+ [`k-rounded-${te.roundedMap[e.rounded] || e.rounded}`]: e.rounded,
191
+ "k-invalid": !we,
190
192
  "k-required": e.required,
191
193
  "k-disabled": e.disabled,
192
194
  "k-focus": b
193
195
  },
194
196
  e.className
195
197
  ),
196
- onFocus: ze,
197
- onBlur: Ee
198
+ onFocus: Ee,
199
+ onBlur: Oe
198
200
  },
199
201
  /* @__PURE__ */ o.createElement(
200
202
  "div",
201
203
  {
202
204
  className: "k-signature-canvas",
203
205
  ref: g,
204
- tabIndex: Te(e.tabIndex, e.disabled),
206
+ tabIndex: Be(e.tabIndex, e.disabled),
205
207
  role: "img",
206
208
  id: e.id,
207
209
  "aria-label": e.ariaLabel,
@@ -212,70 +214,70 @@ const qe = 250, Ge = 84, se = 3, le = 2, Ae = "#000000", Ve = "#ffffff", ie = (d
212
214
  }
213
215
  ),
214
216
  /* @__PURE__ */ o.createElement("div", { className: "k-signature-actions k-signature-actions-top" }, /* @__PURE__ */ o.createElement(
215
- T,
217
+ R,
216
218
  {
217
219
  type: "button",
218
- className: B("k-signature-action", "k-signature-maximize", {
219
- "k-hidden": e.disabled || ke
220
+ className: T("k-signature-action", "k-signature-maximize", {
221
+ "k-hidden": e.disabled || ve
220
222
  }),
221
223
  ref: z,
222
224
  icon: "hyperlink-open",
223
- svgIcon: re,
225
+ svgIcon: ie,
224
226
  size: e.size,
225
227
  rounded: e.rounded,
226
228
  fillMode: "flat",
227
- onClick: Oe,
229
+ onClick: xe,
228
230
  "aria-label": j,
229
231
  title: j
230
232
  }
231
233
  ), /* @__PURE__ */ o.createElement(
232
- T,
234
+ R,
233
235
  {
234
236
  type: "button",
235
- className: B("k-signature-action", "k-signature-minimize", "k-rotate-180", {
236
- "k-hidden": e.disabled || ve
237
+ className: T("k-signature-action", "k-signature-minimize", "k-rotate-180", {
238
+ "k-hidden": e.disabled || ye
237
239
  }),
238
- ref: W,
240
+ ref: N,
239
241
  icon: "hyperlink-open",
240
- svgIcon: re,
242
+ svgIcon: ie,
241
243
  size: e.size,
242
244
  rounded: e.rounded,
243
245
  fillMode: "flat",
244
- onClick: Q,
246
+ onClick: Y,
245
247
  "aria-label": U,
246
248
  title: U
247
249
  }
248
250
  )),
249
251
  !e.hideLine && /* @__PURE__ */ o.createElement("div", { className: "k-signature-line", style: { zIndex: 2, pointerEvents: "none" } }),
250
- /* @__PURE__ */ o.createElement("div", { className: "k-signature-actions k-signature-actions-bottom" }, ye && /* @__PURE__ */ o.createElement(
251
- T,
252
+ /* @__PURE__ */ o.createElement("div", { className: "k-signature-actions k-signature-actions-bottom" }, Ce && /* @__PURE__ */ o.createElement(
253
+ R,
252
254
  {
253
255
  type: "button",
254
256
  className: "k-signature-action k-signature-clear",
255
257
  icon: "x",
256
- svgIcon: We,
258
+ svgIcon: Ge,
257
259
  size: e.size,
258
260
  rounded: e.rounded,
259
261
  fillMode: "flat",
260
- onClick: xe,
262
+ onClick: Me,
261
263
  "aria-label": H,
262
264
  title: H
263
265
  }
264
266
  )),
265
- m && /* @__PURE__ */ o.createElement(Fe, { ref: N }, /* @__PURE__ */ o.createElement(
267
+ m && /* @__PURE__ */ o.createElement(We, { ref: W }, /* @__PURE__ */ o.createElement(
266
268
  F,
267
269
  {
268
270
  ...e,
269
- ...Z(),
270
- value: pe,
271
+ ...ee(),
272
+ value: fe,
271
273
  maximized: !0,
272
274
  exportScale: 1 / O * x,
273
275
  open: !1,
274
- onChange: Ce,
275
- onClose: Se
276
+ onChange: he,
277
+ onClose: ze
276
278
  }
277
279
  )),
278
- ue && /* @__PURE__ */ o.createElement(Be, { message: de })
280
+ de && /* @__PURE__ */ o.createElement(Fe, { message: me })
279
281
  );
280
282
  });
281
283
  F.propTypes = {
@@ -303,8 +305,8 @@ F.propTypes = {
303
305
  const s = {
304
306
  strokeWidth: 1,
305
307
  smooth: !1,
306
- popupScale: se,
307
- exportScale: le,
308
+ popupScale: le,
309
+ exportScale: ce,
308
310
  maximizable: !0,
309
311
  disabled: !1,
310
312
  required: !1,
@@ -321,5 +323,5 @@ const s = {
321
323
  F.displayName = "KendoSignature";
322
324
  export {
323
325
  F as Signature,
324
- je as SignaturePropsContext
326
+ He as SignaturePropsContext
325
327
  };
@@ -5,7 +5,7 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { FormComponentProps } from '@progress/kendo-react-common';
8
+ import { FormComponentProps, WebMcpProps } from '@progress/kendo-react-common';
9
9
  import { SignatureChangeEvent } from './SignatureChangeEvent';
10
10
  import { SignatureFocusEvent } from './SignatureFocusEvent';
11
11
  import { SignatureBlurEvent } from './SignatureBlurEvent';
@@ -332,4 +332,9 @@ export interface SignatureProps extends FormComponentProps {
332
332
  children?: React.ReactNode;
333
333
  /** @hidden */
334
334
  maximized?: boolean;
335
+ /**
336
+ * Enables Web MCP tool registration for this component.
337
+ * Requires a parent `WebMcpProvider` from `@progress/kendo-react-webmcp`.
338
+ */
339
+ webMcp?: boolean | WebMcpProps;
335
340
  }
@@ -5,7 +5,7 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { FormComponentProps, BaseEvent } from '@progress/kendo-react-common';
8
+ import { FormComponentProps, BaseEvent, WebMcpProps } from '@progress/kendo-react-common';
9
9
  import { Direction } from '../interfaces/Direction';
10
10
  import * as React from 'react';
11
11
  /**
@@ -196,6 +196,11 @@ export interface SliderProps extends FormComponentProps {
196
196
  * ```
197
197
  */
198
198
  dir?: Direction;
199
+ /**
200
+ * Enables Web MCP tool registration for this component.
201
+ * Requires a parent `WebMcpProvider` from `@progress/kendo-react-webmcp`.
202
+ */
203
+ webMcp?: boolean | WebMcpProps;
199
204
  }
200
205
  /** @hidden */
201
206
  export declare const SliderWithoutContext: React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<SliderHandle>>;
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"),r=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 d in e)if(d!=="default"){const b=Object.getOwnPropertyDescriptor(e,d);Object.defineProperty(k,d,b.get?b:{enumerable:!0,get:()=>e[d]})}}return k.default=e,Object.freeze(k)}const i=le(a),h={step:1,largeStep:10,buttons:!1,vertical:!1,disabled:!1,tabIndex:0},E=i.forwardRef((e,k)=>{var A,M,O;const{step:d=h.step,largeStep:b=h.largeStep,vertical:l=h.vertical,disabled:u=h.disabled,tabIndex:P=h.tabIndex}=e,[U,H]=a.useState((A=e.defaultValue)!=null?A:e.min),[W,z]=a.useState(!1),[R,X]=a.useState(e.dir),L=a.useRef(null),y=a.useRef(null),N=a.useMemo(()=>new F.LocalizationService,[]),q=a.useRef(null),B=e.value!==void 0,I=B&&e.value!==void 0?e.value:U,o=a.useMemo(()=>{const{min:t,max:n}=e;return I<t?t:I>n?n:I},[I,e.min,e.max]),C=a.useMemo(()=>{const{min:t,max:n}=e,s=n-t;return s===0?0:(o-t)/s*100},[o,e.min,e.max]),v=(M=e.dir)!=null?M:R;a.useEffect(()=>{if(e.dir===void 0&&y.current){const n=window.getComputedStyle(y.current).direction;n!==R&&X(n)}},[e.dir,R]);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 s=Math.min(Math.max(n,e.min),e.max);B||H(s),c.dispatchEvent(e.onChange,t,q.current,{value:s})},[e.min,e.max,e.onChange,B]),G=a.useCallback(()=>{z(!0)},[]),Y=a.useCallback(()=>{z(!1)},[]),J=a.useCallback(t=>{if(u)return;let n;t.keyCode===c.Keys.left||t.keyCode===c.Keys.down?n=o-(d||0):t.keyCode===c.Keys.right||t.keyCode===c.Keys.up?n=o+(d||0):t.keyCode===c.Keys.pageDown?n=o-(b||0):t.keyCode===c.Keys.pageUp?n=o+(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))},[o,d,b,e.min,e.max,g,u]),Q=a.useCallback(t=>{t.preventDefault(),!u&&g(t,o-(d||0))},[o,d,g,u]),Z=a.useCallback(t=>{t.preventDefault(),!u&&g(t,o+(d||0))},[o,d,g,u]),w=a.useCallback(t=>{const n=t.element.getBoundingClientRect();let s;l?s=n.bottom-t.event.clientY:s=v==="rtl"?n.right-t.event.clientX:t.event.clientX-n.left;const S=l?n.height:n.width,x=s/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,s,S,x;return v==="rtl"?(n=l?f.chevronUpIcon:f.chevronLeftIcon,s=l?f.chevronDownIcon:f.chevronRightIcon,S=l?"chevron-up":"chevron-left",x=l?"chevron-down":"chevron-right"):(n=l?f.chevronUpIcon:f.chevronRightIcon,s=l?f.chevronDownIcon:f.chevronLeftIcon,S=l?"chevron-up":"chevron-right",x=l?"chevron-down":"chevron-left"),i.createElement(i.Fragment,null,i.createElement(j.Button,{className:"k-button-decrease",rounded:"full",icon:x,svgIcon:s,title:t.decrementTitle,onClick:t.decrement}),t.children,i.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]),a.useEffect(()=>{q.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+"% - 13px)",zIndex:1}:T={left:"calc("+C+"%)",zIndex:1},i.createElement("div",{ref:y,dir:v,id:e.id,style:{gap:0,...e.style},onFocus:G,onBlur:Y,onKeyDown:J,className:c.classNames("k-slider",{"k-focus":W,"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:i.createElement(c.Draggable,{onDrag:p,onPress:$,autoScroll:!1},i.createElement("div",{className:"k-slider-track-wrap",style:{flexGrow:1,position:"relative",touchAction:"none",...te}},e.children&&i.createElement("ul",{className:"k-reset k-slider-items",style:{margin:0,...ne}},i.Children.map(e.children,(t,n)=>t&&i.cloneElement(t,{position:100*(t.props.position-e.min)/(e.max-e.min),vertical:l,firstTick:n===0,lastTick:n===i.Children.count(e.children)-1},t.props.children))),i.createElement("div",{className:"k-slider-track",style:l?{bottom:0,height:"100%"}:{[v==="rtl"?"right":"left"]:0,width:"100%"},ref:L},i.createElement("div",{className:"k-slider-selection",style:l?{height:C+"%"}:{width:C+"%"}}),i.createElement("span",{role:"slider","aria-valuemin":e.min,"aria-valuemax":e.max,"aria-valuenow":o,"aria-valuetext":String(o),"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}))))}))});E.displayName="Slider";const _=c.createPropsContext(),V=c.withPropsContext(_,E);V.displayName="KendoReactSlider";V.propTypes={value:r.number,defaultValue:r.number,min:r.number.isRequired,max:r.number.isRequired,step:r.number,largeStep:r.number,onChange:r.func,style:r.object,className:r.string,buttons:r.bool,tabIndex:r.number,disabled:r.bool,vertical:r.bool,id:r.string,ariaDescribedBy:r.string,ariaLabelledBy:r.string,ariaLabel:r.string,dir:r.oneOf(["ltr","rtl"]),children:r.node};F.registerForLocalization(E);exports.Slider=V;exports.SliderPropsContext=_;exports.SliderWithoutContext=E;
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 b=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(b,s,h.get?h:{enumerable:!0,get:()=>e[s]})}}return b.default=e,Object.freeze(b)}const r=le(a),k={step:1,largeStep:10,buttons:!1,vertical:!1,disabled:!1,tabIndex:0},R=r.forwardRef((e,b)=>{var M,A,O;const{step:s=k.step,largeStep:h=k.largeStep,vertical:l=k.vertical,disabled:u=k.disabled,tabIndex:P=k.tabIndex}=e,[U,W]=a.useState((M=e.defaultValue)!=null?M:e.min),[H,z]=a.useState(!1),[E,X]=a.useState(e.dir),L=a.useRef(null),y=a.useRef(null),N=a.useMemo(()=>new F.LocalizationService,[]),q=a.useRef(null),B=e.value!==void 0,I=B&&e.value!==void 0?e.value:U,o=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:(o-e.min)/t*100},[o,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);B||W(d),c.dispatchEvent(e.onChange,t,q.current,{value:d})},[e.min,e.max,e.onChange,B]),G=a.useCallback(()=>{z(!0)},[]),Y=a.useCallback(()=>{z(!1)},[]),J=a.useCallback(t=>{if(u)return;let n;t.keyCode===c.Keys.left||t.keyCode===c.Keys.down?n=o-(s||0):t.keyCode===c.Keys.right||t.keyCode===c.Keys.up?n=o+(s||0):t.keyCode===c.Keys.pageDown?n=o-(h||0):t.keyCode===c.Keys.pageUp?n=o+(h||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))},[o,s,h,e.min,e.max,g,u]),Q=a.useCallback(t=>{t.preventDefault(),!u&&g(t,o-(s||0))},[o,s,g,u]),Z=a.useCallback(t=>{t.preventDefault(),!u&&g(t,o+(s||0))},[o,s,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(b,()=>({props:e,sliderTrack:L.current,focus:D}),[e,D]),c.useWebMcpRegister("slider",b,e,e.webMcp),a.useEffect(()=>{q.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+"% - 13px)",zIndex:1}:T={left:"calc("+C+"%)",zIndex:1},r.createElement("div",{ref:y,dir:v,id:e.id,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:k.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",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":o,"aria-valuetext":String(o),"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(),V=c.withPropsContext(_,R);V.displayName="KendoReactSlider";V.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=V;exports.SliderPropsContext=_;exports.SliderWithoutContext=R;