@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.
- package/MaskedTextBoxMcpWrapper.d.ts +17 -0
- package/MaskedTextBoxMcpWrapper.js +8 -0
- package/MaskedTextBoxMcpWrapper.mjs +18 -0
- package/colors/ColorPicker.js +1 -1
- package/colors/ColorPicker.mjs +194 -183
- package/colors/interfaces/ColorPickerProps.d.ts +6 -1
- package/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/index.d.mts +5 -1
- package/index.d.ts +5 -1
- package/index.js +1 -1
- package/index.mjs +92 -89
- package/maskedtextbox/MaskedTextBoxProps.d.ts +6 -1
- package/numerictextbox/NumericTextBox.js +1 -1
- package/numerictextbox/NumericTextBox.mjs +170 -168
- package/numerictextbox/interfaces/NumericTextBoxProps.d.ts +6 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +10 -10
- package/range-slider/RangeSlider.d.ts +6 -1
- package/range-slider/RangeSlider.js +2 -2
- package/range-slider/RangeSlider.mjs +43 -43
- package/rating/Rating.d.ts +6 -1
- package/rating/Rating.js +2 -2
- package/rating/Rating.mjs +62 -62
- package/signature/Signature.js +1 -1
- package/signature/Signature.mjs +94 -92
- package/signature/interfaces/SignatureProps.d.ts +6 -1
- package/slider/Slider.d.ts +6 -1
- package/slider/Slider.js +1 -1
- package/slider/Slider.mjs +131 -134
- package/switch/Switch.d.ts +6 -1
- package/switch/Switch.js +1 -1
- package/switch/Switch.mjs +88 -86
- package/textarea/TextArea.js +1 -1
- package/textarea/TextArea.mjs +97 -95
- package/textarea/interfaces/TextAreaProps.d.ts +6 -1
- package/textbox/Textbox.d.ts +20 -1
- package/textbox/Textbox.js +1 -1
- package/textbox/Textbox.mjs +92 -81
package/signature/Signature.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const 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;
|
package/signature/Signature.mjs
CHANGED
|
@@ -6,18 +6,18 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import { SignaturePad as Le } from "@progress/kendo-inputs-common";
|
|
9
|
-
import { Button as
|
|
10
|
-
import { validatePackage as
|
|
11
|
-
import { Dialog as
|
|
12
|
-
import { useLocalization as
|
|
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
|
|
16
|
-
import { packageMetadata as
|
|
17
|
-
import { hasParent as
|
|
18
|
-
import { hyperlinkOpenIcon as
|
|
19
|
-
const
|
|
20
|
-
const
|
|
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 =
|
|
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
|
-
},
|
|
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
|
|
49
|
+
const Se = () => {
|
|
50
50
|
r == null || r.clear(), M();
|
|
51
51
|
}, v = o.useCallback(
|
|
52
52
|
(t) => {
|
|
53
|
-
p ||
|
|
53
|
+
p || ke(t);
|
|
54
54
|
},
|
|
55
55
|
[p]
|
|
56
|
-
),
|
|
56
|
+
), ze = (t) => {
|
|
57
57
|
var n, i;
|
|
58
|
-
|
|
59
|
-
},
|
|
60
|
-
let t =
|
|
61
|
-
return !e.color && typeof document != "undefined" &&
|
|
62
|
-
}, [e.color]),
|
|
63
|
-
let t =
|
|
64
|
-
return !e.backgroundColor && typeof document != "undefined" &&
|
|
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:
|
|
68
|
-
backgroundColor:
|
|
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),
|
|
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(
|
|
84
|
+
onChange: async () => M(await K(Z())),
|
|
85
85
|
onDraw: () => G(!0),
|
|
86
86
|
onDrawEnd: () => G(!1)
|
|
87
87
|
});
|
|
88
|
-
}, [r]),
|
|
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,
|
|
93
|
-
const t = (
|
|
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,
|
|
103
|
-
n.key === "Escape" && (v(!1), (
|
|
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 =
|
|
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(),
|
|
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:
|
|
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]),
|
|
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:
|
|
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:
|
|
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
|
-
|
|
135
|
-
|
|
134
|
+
w,
|
|
135
|
+
L
|
|
136
136
|
]);
|
|
137
|
-
o.useImperativeHandle(
|
|
138
|
-
const
|
|
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,
|
|
142
|
+
b || e.maximized || (q(!0), h(e.onFocus, t, l(), {}));
|
|
141
143
|
},
|
|
142
|
-
[b, e.onFocus,
|
|
143
|
-
),
|
|
144
|
+
[b, e.onFocus, l]
|
|
145
|
+
), Oe = o.useCallback(
|
|
144
146
|
(t) => {
|
|
145
|
-
|
|
147
|
+
qe(t.relatedTarget, u.current) || (q(!1), h(e.onBlur, t, l(), {}));
|
|
146
148
|
},
|
|
147
|
-
[b, e.onBlur,
|
|
148
|
-
),
|
|
149
|
+
[b, e.onBlur, l]
|
|
150
|
+
), xe = o.useCallback(
|
|
149
151
|
async (t) => {
|
|
150
|
-
|
|
152
|
+
ge(await K(ee())), v(!0), h(e.onOpen, t, l(), {});
|
|
151
153
|
},
|
|
152
|
-
[m, p, e.onOpen, e.value, k,
|
|
153
|
-
),
|
|
154
|
+
[m, p, e.onOpen, e.value, k, l]
|
|
155
|
+
), Y = o.useCallback(
|
|
154
156
|
(t) => {
|
|
155
|
-
v(!1), h(e.onClose, t,
|
|
157
|
+
v(!1), h(e.onClose, t, l(), {});
|
|
156
158
|
},
|
|
157
|
-
[m, p, e.onClose,
|
|
158
|
-
),
|
|
159
|
-
|
|
160
|
-
},
|
|
161
|
-
var i,
|
|
162
|
-
const t = e.width || ((i =
|
|
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
|
-
},
|
|
168
|
-
const { width: t, height: n } =
|
|
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
|
-
},
|
|
175
|
+
}, we = !D() || P().valid;
|
|
174
176
|
return /* @__PURE__ */ o.createElement(
|
|
175
177
|
"div",
|
|
176
178
|
{
|
|
177
|
-
ref:
|
|
179
|
+
ref: u,
|
|
178
180
|
dir: e.dir,
|
|
179
181
|
style: { width: e.width, height: e.height, ...e.style },
|
|
180
|
-
className:
|
|
182
|
+
className: T(
|
|
181
183
|
"k-input",
|
|
182
184
|
"k-signature",
|
|
183
185
|
{
|
|
184
186
|
"k-signature-maximized": e.maximized,
|
|
185
|
-
[`k-signature-${
|
|
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-${
|
|
189
|
-
"k-invalid": !
|
|
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:
|
|
197
|
-
onBlur:
|
|
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:
|
|
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
|
-
|
|
217
|
+
R,
|
|
216
218
|
{
|
|
217
219
|
type: "button",
|
|
218
|
-
className:
|
|
219
|
-
"k-hidden": e.disabled ||
|
|
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:
|
|
225
|
+
svgIcon: ie,
|
|
224
226
|
size: e.size,
|
|
225
227
|
rounded: e.rounded,
|
|
226
228
|
fillMode: "flat",
|
|
227
|
-
onClick:
|
|
229
|
+
onClick: xe,
|
|
228
230
|
"aria-label": j,
|
|
229
231
|
title: j
|
|
230
232
|
}
|
|
231
233
|
), /* @__PURE__ */ o.createElement(
|
|
232
|
-
|
|
234
|
+
R,
|
|
233
235
|
{
|
|
234
236
|
type: "button",
|
|
235
|
-
className:
|
|
236
|
-
"k-hidden": e.disabled ||
|
|
237
|
+
className: T("k-signature-action", "k-signature-minimize", "k-rotate-180", {
|
|
238
|
+
"k-hidden": e.disabled || ye
|
|
237
239
|
}),
|
|
238
|
-
ref:
|
|
240
|
+
ref: N,
|
|
239
241
|
icon: "hyperlink-open",
|
|
240
|
-
svgIcon:
|
|
242
|
+
svgIcon: ie,
|
|
241
243
|
size: e.size,
|
|
242
244
|
rounded: e.rounded,
|
|
243
245
|
fillMode: "flat",
|
|
244
|
-
onClick:
|
|
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" },
|
|
251
|
-
|
|
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:
|
|
258
|
+
svgIcon: Ge,
|
|
257
259
|
size: e.size,
|
|
258
260
|
rounded: e.rounded,
|
|
259
261
|
fillMode: "flat",
|
|
260
|
-
onClick:
|
|
262
|
+
onClick: Me,
|
|
261
263
|
"aria-label": H,
|
|
262
264
|
title: H
|
|
263
265
|
}
|
|
264
266
|
)),
|
|
265
|
-
m && /* @__PURE__ */ o.createElement(
|
|
267
|
+
m && /* @__PURE__ */ o.createElement(We, { ref: W }, /* @__PURE__ */ o.createElement(
|
|
266
268
|
F,
|
|
267
269
|
{
|
|
268
270
|
...e,
|
|
269
|
-
...
|
|
270
|
-
value:
|
|
271
|
+
...ee(),
|
|
272
|
+
value: fe,
|
|
271
273
|
maximized: !0,
|
|
272
274
|
exportScale: 1 / O * x,
|
|
273
275
|
open: !1,
|
|
274
|
-
onChange:
|
|
275
|
-
onClose:
|
|
276
|
+
onChange: he,
|
|
277
|
+
onClose: ze
|
|
276
278
|
}
|
|
277
279
|
)),
|
|
278
|
-
|
|
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:
|
|
307
|
-
exportScale:
|
|
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
|
-
|
|
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
|
}
|
package/slider/Slider.d.ts
CHANGED
|
@@ -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"),
|
|
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;
|