@progress/kendo-react-inputs 8.1.0-develop.9 → 8.1.1-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/checkbox/Checkbox.js +1 -1
- package/checkbox/Checkbox.mjs +87 -90
- package/colors/ColorPicker.js +1 -1
- package/colors/ColorPicker.mjs +53 -54
- package/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/index.d.mts +2 -2
- package/index.d.ts +2 -2
- package/numerictextbox/NumericTextBox.js +1 -1
- package/numerictextbox/NumericTextBox.mjs +208 -206
- package/package-metadata.mjs +1 -1
- package/package.json +8 -8
- package/radiobutton/RadioButton.js +1 -1
- package/radiobutton/RadioButton.mjs +21 -22
- package/radiobutton/RadioGroup.js +1 -1
- package/radiobutton/RadioGroup.mjs +54 -55
- package/range-slider/RangeSlider.js +7 -7
- package/range-slider/RangeSlider.mjs +161 -156
- package/rating/Rating.js +3 -3
- package/rating/Rating.mjs +145 -134
- package/rating/RatingItem.js +1 -1
- package/rating/RatingItem.mjs +40 -41
- package/signature/Signature.js +1 -1
- package/signature/Signature.mjs +151 -133
- package/textarea/TextArea.js +1 -1
- package/textarea/TextArea.mjs +64 -65
- package/textbox/Textbox.js +1 -1
- package/textbox/Textbox.mjs +33 -34
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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ce=require("@progress/kendo-inputs-common"),T=require("@progress/kendo-react-buttons"),s=require("@progress/kendo-react-common"),he=require("@progress/kendo-react-dialogs"),Se=require("@progress/kendo-react-intl"),a=require("prop-types"),ze=require("react"),m=require("../messages/index.js"),Oe=require("../package-metadata.js"),Ee=require("./utils/index.js"),B=require("@progress/kendo-svg-icons");function xe(l){const b=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const p in l)if(p!=="default"){const e=Object.getOwnPropertyDescriptor(l,p);Object.defineProperty(b,p,e.get?e:{enumerable:!0,get:()=>l[p]})}}return b.default=l,Object.freeze(b)}const n=xe(ze),Me=250,Ie=84,te=3,ne=2,we="#000000",Pe="#ffffff",ee=l=>l!==void 0,oe=s.createPropsContext(),O=n.forwardRef((l,b)=>{s.validatePackage(Oe.packageMetadata);const p=s.usePropsContext(oe,l),e=n.useMemo(()=>({strokeWidth:i.strokeWidth,smooth:i.smooth,popupScale:i.popupScale,exportScale:i.exportScale,maximizable:i.maximizable,disabled:i.disabled,required:i.required,validityStyles:i.validityStyles,onChange:i.onChange,onFocus:i.onFocus,onBlur:i.onBlur,onOpen:i.onOpen,onClose:i.onClose,size:i.size,rounded:i.rounded,fillMode:i.fillMode,...p}),[p]),E=Se.useLocalization(),u=n.useRef(null),y=n.useRef(null),_=n.useRef(null),N=n.useRef(null),F=n.useRef(null),[r,ae]=n.useState(),[v,j]=n.useState(!1),[x,G]=n.useState(!1),[C,W]=n.useState(),[se,re]=n.useState(),A=ee(e.value)?e.value:C,[ie,le]=n.useState(!1),k=ee(e.open),g=k?e.open:ie,ce=e.maximized||x||!e.maximizable||e.disabled,ue=!(e.maximized&&!x),de=!(!(e.value||C)||x||e.readOnly||e.disabled),V=E.toLanguageString(m.signatureMaximize,m.messages[m.signatureMaximize]),U=E.toLanguageString(m.signatureMinimize,m.messages[m.signatureMinimize]),H=E.toLanguageString(m.signatureClear,m.messages[m.signatureClear]),M=e.popupScale||te,I=e.exportScale||ne,w=t=>{W(t),e.onChange&&e.onChange({value:t})},me=t=>{r==null||r.loadImage(t.value),w(t.value)};n.useEffect(()=>{e.value!==C&&(W(e.value),r==null||r.loadImage(e.value))},[e.value]);const pe=()=>{r==null||r.clear(),w()},h=n.useCallback(t=>{k||le(t)},[k]),fe=t=>{var o,c;Q(t),(c=((o=F.current)==null?void 0:o.element)||y.current)==null||c.focus()},P=n.useCallback(()=>{let t=we;return!e.color&&typeof document!="undefined"&&u.current&&(t=getComputedStyle(u.current).color),e.color||t},[e.color]),L=n.useCallback(()=>{let t=Pe;return!e.backgroundColor&&typeof document!="undefined"&&u.current&&(t=getComputedStyle(u.current).backgroundColor),e.backgroundColor||t},[e.backgroundColor]),$=()=>({scale:e.maximized?e.popupScale:1,color:P(),backgroundColor:L(),strokeWidth:e.strokeWidth,smooth:e.smooth,readonly:e.readOnly}),K=async t=>{const{width:o,height:c}=t;return await(r==null?void 0:r.exportImage({width:o*I,height:c*I}))};n.useEffect(()=>{const t=y.current,o=new Ce.SignaturePad(t,$());return A&&o.loadImage(A),ae(o),()=>o.destroy()},[]),n.useEffect(()=>{r==null||r.setOptions({onChange:async()=>w(await K(Y())),onDraw:()=>G(!0),onDrawEnd:()=>G(!1)})},[r]),s.useIsomorphicLayoutEffect(()=>r==null?void 0:r.setOptions($()),[e.readOnly,e.color,e.backgroundColor,e.strokeWidth,e.smooth]),n.useEffect(()=>{var c,f;const t=(f=(c=_.current)==null?void 0:c.element)==null?void 0:f.querySelector(".k-overlay");if(!t)return;const o=()=>h(!1);return t.addEventListener("click",o),()=>t.removeEventListener("click",o)},[g]),n.useEffect(()=>{if(!g||typeof document=="undefined")return;const t=o=>{o.keyCode===s.Keys.esc&&h(!1)};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[g]),n.useEffect(()=>{var t,o;e.maximized&&((o=(t=N.current)==null?void 0:t.element)==null||o.focus())},[]);const q=n.useCallback(()=>{var t;return(t=y.current)==null?void 0:t.focus()},[]),S=n.useCallback(()=>e.value,[e.value]),X=n.useCallback(()=>e.name,[e.name]),z=n.useCallback(()=>e.required,[e.required]),D=n.useCallback(()=>{const t=e.validationMessage!==void 0,c=!S(),f=e.valid!==void 0?e.valid:!z()||!c;return{customError:t,valid:f,valueMissing:c}},[e.validationMessage,e.valid,S,z]),R=n.useCallback(()=>e.validityStyles,[e.validityStyles]),J=n.useCallback(()=>e,[e]),d=n.useCallback(()=>{const t={element:u.current,focus:q};return Object.defineProperty(t,"name",{get:X}),Object.defineProperty(t,"value",{get:S}),Object.defineProperty(t,"validity",{get:D}),Object.defineProperty(t,"validityStyles",{get:R}),Object.defineProperty(t,"required",{get:z}),Object.defineProperty(t,"props",{get:J}),Object.defineProperty(t,"color",{get:P}),Object.defineProperty(t,"backgroundColor",{get:L}),t},[X,S,D,R,z,q,J,P,L]);n.useImperativeHandle(b,d);const ge=n.useCallback(t=>{v||e.maximized||(j(!0),s.dispatchEvent(e.onFocus,t,d(),{}))},[v,e.onFocus,d]),be=n.useCallback(t=>{Ee.hasParent(t.relatedTarget,u.current)||(j(!1),s.dispatchEvent(e.onBlur,t,d(),{}))},[v,e.onBlur,d]),ke=n.useCallback(async t=>{re(await K(Z())),h(!0),s.dispatchEvent(e.onOpen,t,d(),{})},[g,k,e.onOpen,e.value,C,d]),Q=n.useCallback(t=>{h(!1),s.dispatchEvent(e.onClose,t,d(),{})},[g,k,e.onClose,d]),ye=()=>{pe(),q()},Y=()=>{var c,f;const t=e.width||((c=u.current)==null?void 0:c.offsetWidth)||Me,o=e.height||((f=u.current)==null?void 0:f.offsetHeight)||Ie;return{width:t,height:o}},Z=()=>{const{width:t,height:o}=Y();return{width:t*M,height:o*M}},ve=!R()||D().valid;return n.createElement("div",{ref:u,dir:e.dir,style:{width:e.width,height:e.height,...e.style},className:s.classNames("k-input","k-signature",{"k-signature-maximized":e.maximized,[`k-signature-${s.kendoThemeMaps.sizeMap[e.size]||e.size}`]:e.size,[`k-signature-${e.fillMode}`]:e.fillMode,[`k-input-${e.fillMode}`]:e.fillMode,[`k-rounded-${s.kendoThemeMaps.roundedMap[e.rounded]||e.rounded}`]:e.rounded,"k-invalid":!ve,"k-required":e.required,"k-disabled":e.disabled,"k-focus":v},e.className),onFocus:ge,onBlur:be},n.createElement("div",{className:"k-signature-canvas",ref:y,tabIndex:s.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}),n.createElement("div",{className:"k-signature-actions k-signature-actions-top"},n.createElement(T.Button,{type:"button",className:s.classNames("k-signature-action","k-signature-maximize",{"k-hidden":e.disabled||ce}),ref:F,icon:"hyperlink-open",svgIcon:B.hyperlinkOpenIcon,fillMode:"flat",size:e.size,onClick:ke,"aria-label":V,title:V}),n.createElement(T.Button,{type:"button",className:s.classNames("k-signature-action","k-signature-minimize","k-rotate-180",{"k-hidden":e.disabled||ue}),ref:N,icon:"hyperlink-open",svgIcon:B.hyperlinkOpenIcon,fillMode:"flat",size:e.size,onClick:Q,"aria-label":U,title:U})),!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"},de&&n.createElement(T.Button,{type:"button",className:"k-signature-action k-signature-clear",icon:"x",svgIcon:B.xIcon,fillMode:"flat",size:e.size,onClick:ye,"aria-label":H,title:H})),g&&n.createElement(he.Dialog,{ref:_},n.createElement(O,{...e,...Z(),value:se,maximized:!0,exportScale:1/M*I,open:!1,onChange:me,onClose:fe})))});O.propTypes={value:a.string,width:a.number,height:a.number,tabIndex:a.number,dir:a.string,ariaDescribedBy:a.string,ariaLabelledBy:a.string,ariaLabel:a.string,readOnly:a.bool,disabled:a.bool,validationMessage:a.string,required:a.bool,onChange:a.func,onFocus:a.func,onBlur:a.func,onOpen:a.func,onClose:a.func,size:a.oneOf([null,"small","medium","large"]),rounded:a.oneOf([null,"small","medium","large"]),fillMode:a.oneOf([null,"solid","flat","outline"])};const i={strokeWidth:1,smooth:!1,popupScale:te,exportScale:ne,maximizable:!0,disabled:!1,required:!1,validityStyles:!0,onChange:l=>s.noop,onFocus:l=>s.noop,onBlur:l=>s.noop,onOpen:l=>s.noop,onClose:l=>s.noop,size:"medium",rounded:"medium",fillMode:"solid"};O.displayName="KendoSignature";exports.Signature=O;exports.SignaturePropsContext=oe;
|
package/signature/Signature.mjs
CHANGED
|
@@ -6,189 +6,207 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import { SignaturePad as
|
|
9
|
+
import { SignaturePad as Oe } from "@progress/kendo-inputs-common";
|
|
10
10
|
import { Button as D } from "@progress/kendo-react-buttons";
|
|
11
|
-
import { createPropsContext as
|
|
12
|
-
import { Dialog as
|
|
13
|
-
import { useLocalization as
|
|
11
|
+
import { createPropsContext as xe, validatePackage as Me, usePropsContext as we, useIsomorphicLayoutEffect as Le, dispatchEvent as h, classNames as T, kendoThemeMaps as ee, getTabIndex as Ie, noop as p, Keys as Pe } from "@progress/kendo-react-common";
|
|
12
|
+
import { Dialog as De } from "@progress/kendo-react-dialogs";
|
|
13
|
+
import { useLocalization as Te } from "@progress/kendo-react-intl";
|
|
14
14
|
import a from "prop-types";
|
|
15
15
|
import * as o from "react";
|
|
16
|
-
import { signatureMaximize as
|
|
17
|
-
import { packageMetadata as
|
|
18
|
-
import { hasParent as
|
|
19
|
-
import { hyperlinkOpenIcon as
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
import { signatureMaximize as te, messages as B, signatureMinimize as oe, signatureClear as ne } from "../messages/index.mjs";
|
|
17
|
+
import { packageMetadata as Be } from "../package-metadata.mjs";
|
|
18
|
+
import { hasParent as Re } from "./utils/index.mjs";
|
|
19
|
+
import { hyperlinkOpenIcon as ae, xIcon as Fe } from "@progress/kendo-svg-icons";
|
|
20
|
+
const _e = 250, Ne = 84, ie = 3, se = 2, qe = "#000000", Ge = "#ffffff", re = (u) => u !== void 0, We = xe(), R = o.forwardRef((u, le) => {
|
|
21
|
+
Me(Be);
|
|
22
|
+
const F = we(We, u), e = o.useMemo(() => ({
|
|
23
|
+
strokeWidth: i.strokeWidth,
|
|
24
|
+
smooth: i.smooth,
|
|
25
|
+
popupScale: i.popupScale,
|
|
26
|
+
exportScale: i.exportScale,
|
|
27
|
+
maximizable: i.maximizable,
|
|
28
|
+
disabled: i.disabled,
|
|
29
|
+
required: i.required,
|
|
30
|
+
validityStyles: i.validityStyles,
|
|
31
|
+
onChange: i.onChange,
|
|
32
|
+
onFocus: i.onFocus,
|
|
33
|
+
onBlur: i.onBlur,
|
|
34
|
+
onOpen: i.onOpen,
|
|
35
|
+
onClose: i.onClose,
|
|
36
|
+
size: i.size,
|
|
37
|
+
rounded: i.rounded,
|
|
38
|
+
fillMode: i.fillMode,
|
|
39
|
+
...F
|
|
40
|
+
}), [F]), z = Te(), l = o.useRef(null), g = o.useRef(null), _ = o.useRef(null), N = o.useRef(null), q = o.useRef(null), [r, ce] = o.useState(), [b, G] = o.useState(!1), [S, W] = o.useState(!1), [k, A] = o.useState(), [ue, de] = o.useState(), V = re(e.value) ? e.value : k, [me, fe] = o.useState(!1), f = re(e.open), m = f ? e.open : me, pe = e.maximized || S || !e.maximizable || e.disabled, ge = !(e.maximized && !S), be = !(!(e.value || k) || S || e.readOnly || e.disabled), j = z.toLanguageString(te, B[te]), U = z.toLanguageString(oe, B[oe]), H = z.toLanguageString(ne, B[ne]), E = e.popupScale || ie, O = e.exportScale || se, x = (t) => {
|
|
41
|
+
A(t), e.onChange && e.onChange({ value: t });
|
|
42
|
+
}, ke = (t) => {
|
|
25
43
|
r == null || r.loadImage(t.value), x(t.value);
|
|
26
44
|
};
|
|
27
45
|
o.useEffect(() => {
|
|
28
|
-
e.value !==
|
|
46
|
+
e.value !== k && (A(e.value), r == null || r.loadImage(e.value));
|
|
29
47
|
}, [e.value]);
|
|
30
|
-
const
|
|
48
|
+
const ye = () => {
|
|
31
49
|
r == null || r.clear(), x();
|
|
32
|
-
},
|
|
50
|
+
}, y = o.useCallback(
|
|
33
51
|
(t) => {
|
|
34
|
-
|
|
52
|
+
f || fe(t);
|
|
35
53
|
},
|
|
36
|
-
[
|
|
37
|
-
),
|
|
38
|
-
var n,
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
let t =
|
|
42
|
-
return !e.color && typeof document != "undefined" &&
|
|
43
|
-
}, [e.color]),
|
|
44
|
-
let t =
|
|
45
|
-
return !e.backgroundColor && typeof document != "undefined" &&
|
|
46
|
-
}, [e.backgroundColor]),
|
|
54
|
+
[f]
|
|
55
|
+
), Ce = (t) => {
|
|
56
|
+
var n, s;
|
|
57
|
+
Q(t), (s = ((n = q.current) == null ? void 0 : n.element) || g.current) == null || s.focus();
|
|
58
|
+
}, M = o.useCallback(() => {
|
|
59
|
+
let t = qe;
|
|
60
|
+
return !e.color && typeof document != "undefined" && l.current && (t = getComputedStyle(l.current).color), e.color || t;
|
|
61
|
+
}, [e.color]), w = o.useCallback(() => {
|
|
62
|
+
let t = Ge;
|
|
63
|
+
return !e.backgroundColor && typeof document != "undefined" && l.current && (t = getComputedStyle(l.current).backgroundColor), e.backgroundColor || t;
|
|
64
|
+
}, [e.backgroundColor]), K = () => ({
|
|
47
65
|
scale: e.maximized ? e.popupScale : 1,
|
|
48
|
-
color:
|
|
49
|
-
backgroundColor:
|
|
66
|
+
color: M(),
|
|
67
|
+
backgroundColor: w(),
|
|
50
68
|
strokeWidth: e.strokeWidth,
|
|
51
69
|
smooth: e.smooth,
|
|
52
70
|
readonly: e.readOnly
|
|
53
|
-
}),
|
|
54
|
-
const { width: n, height:
|
|
71
|
+
}), $ = async (t) => {
|
|
72
|
+
const { width: n, height: s } = t;
|
|
55
73
|
return await (r == null ? void 0 : r.exportImage({
|
|
56
74
|
width: n * O,
|
|
57
|
-
height:
|
|
75
|
+
height: s * O
|
|
58
76
|
}));
|
|
59
77
|
};
|
|
60
78
|
o.useEffect(() => {
|
|
61
|
-
const t =
|
|
62
|
-
return
|
|
79
|
+
const t = g.current, n = new Oe(t, K());
|
|
80
|
+
return V && n.loadImage(V), ce(n), () => n.destroy();
|
|
63
81
|
}, []), o.useEffect(() => {
|
|
64
82
|
r == null || r.setOptions({
|
|
65
|
-
onChange: async () => x(await
|
|
66
|
-
onDraw: () =>
|
|
67
|
-
onDrawEnd: () =>
|
|
83
|
+
onChange: async () => x(await $(Y())),
|
|
84
|
+
onDraw: () => W(!0),
|
|
85
|
+
onDrawEnd: () => W(!1)
|
|
68
86
|
});
|
|
69
|
-
}, [r]),
|
|
70
|
-
() => r == null ? void 0 : r.setOptions(
|
|
87
|
+
}, [r]), Le(
|
|
88
|
+
() => r == null ? void 0 : r.setOptions(K()),
|
|
71
89
|
[e.readOnly, e.color, e.backgroundColor, e.strokeWidth, e.smooth]
|
|
72
90
|
), o.useEffect(() => {
|
|
73
|
-
var
|
|
74
|
-
const t = (
|
|
91
|
+
var s, d;
|
|
92
|
+
const t = (d = (s = _.current) == null ? void 0 : s.element) == null ? void 0 : d.querySelector(".k-overlay");
|
|
75
93
|
if (!t)
|
|
76
94
|
return;
|
|
77
|
-
const n = () =>
|
|
95
|
+
const n = () => y(!1);
|
|
78
96
|
return t.addEventListener("click", n), () => t.removeEventListener("click", n);
|
|
79
|
-
}, [
|
|
80
|
-
if (!
|
|
97
|
+
}, [m]), o.useEffect(() => {
|
|
98
|
+
if (!m || typeof document == "undefined")
|
|
81
99
|
return;
|
|
82
100
|
const t = (n) => {
|
|
83
|
-
n.keyCode ===
|
|
101
|
+
n.keyCode === Pe.esc && y(!1);
|
|
84
102
|
};
|
|
85
103
|
return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
|
|
86
|
-
}, [
|
|
104
|
+
}, [m]), o.useEffect(() => {
|
|
87
105
|
var t, n;
|
|
88
|
-
e.maximized && ((n = (t =
|
|
106
|
+
e.maximized && ((n = (t = N.current) == null ? void 0 : t.element) == null || n.focus());
|
|
89
107
|
}, []);
|
|
90
|
-
const
|
|
108
|
+
const L = o.useCallback(
|
|
91
109
|
() => {
|
|
92
110
|
var t;
|
|
93
|
-
return (t =
|
|
111
|
+
return (t = g.current) == null ? void 0 : t.focus();
|
|
94
112
|
},
|
|
95
113
|
[]
|
|
96
|
-
),
|
|
114
|
+
), C = o.useCallback(
|
|
97
115
|
() => e.value,
|
|
98
116
|
[e.value]
|
|
99
|
-
),
|
|
117
|
+
), X = o.useCallback(
|
|
100
118
|
() => e.name,
|
|
101
119
|
[e.name]
|
|
102
|
-
),
|
|
120
|
+
), v = o.useCallback(
|
|
103
121
|
() => e.required,
|
|
104
122
|
[e.required]
|
|
105
123
|
), I = o.useCallback(
|
|
106
124
|
() => {
|
|
107
|
-
const t = e.validationMessage !== void 0,
|
|
125
|
+
const t = e.validationMessage !== void 0, s = !C(), d = e.valid !== void 0 ? e.valid : !v() || !s;
|
|
108
126
|
return {
|
|
109
127
|
customError: t,
|
|
110
|
-
valid:
|
|
111
|
-
valueMissing:
|
|
128
|
+
valid: d,
|
|
129
|
+
valueMissing: s
|
|
112
130
|
};
|
|
113
131
|
},
|
|
114
|
-
[e.validationMessage, e.valid,
|
|
132
|
+
[e.validationMessage, e.valid, C, v]
|
|
115
133
|
), P = o.useCallback(
|
|
116
134
|
() => e.validityStyles,
|
|
117
135
|
[e.validityStyles]
|
|
118
|
-
),
|
|
136
|
+
), J = o.useCallback(
|
|
119
137
|
() => e,
|
|
120
138
|
[e]
|
|
121
|
-
),
|
|
139
|
+
), c = o.useCallback(
|
|
122
140
|
() => {
|
|
123
141
|
const t = {
|
|
124
|
-
element:
|
|
125
|
-
focus:
|
|
142
|
+
element: l.current,
|
|
143
|
+
focus: L
|
|
126
144
|
};
|
|
127
|
-
return Object.defineProperty(t, "name", { get:
|
|
145
|
+
return Object.defineProperty(t, "name", { get: X }), Object.defineProperty(t, "value", { get: C }), Object.defineProperty(t, "validity", { get: I }), Object.defineProperty(t, "validityStyles", { get: P }), Object.defineProperty(t, "required", { get: v }), Object.defineProperty(t, "props", { get: J }), Object.defineProperty(t, "color", { get: M }), Object.defineProperty(t, "backgroundColor", { get: w }), t;
|
|
128
146
|
},
|
|
129
|
-
[
|
|
147
|
+
[X, C, I, P, v, L, J, M, w]
|
|
130
148
|
);
|
|
131
|
-
o.useImperativeHandle(
|
|
149
|
+
o.useImperativeHandle(le, c);
|
|
132
150
|
const ve = o.useCallback(
|
|
133
151
|
(t) => {
|
|
134
|
-
|
|
152
|
+
b || e.maximized || (G(!0), h(
|
|
135
153
|
e.onFocus,
|
|
136
154
|
t,
|
|
137
|
-
|
|
155
|
+
c(),
|
|
138
156
|
{}
|
|
139
157
|
));
|
|
140
158
|
},
|
|
141
|
-
[
|
|
142
|
-
),
|
|
159
|
+
[b, e.onFocus, c]
|
|
160
|
+
), he = o.useCallback(
|
|
143
161
|
(t) => {
|
|
144
|
-
|
|
162
|
+
Re(t.relatedTarget, l.current) || (G(!1), h(
|
|
145
163
|
e.onBlur,
|
|
146
164
|
t,
|
|
147
|
-
|
|
165
|
+
c(),
|
|
148
166
|
{}
|
|
149
167
|
));
|
|
150
168
|
},
|
|
151
|
-
[
|
|
152
|
-
),
|
|
169
|
+
[b, e.onBlur, c]
|
|
170
|
+
), ze = o.useCallback(
|
|
153
171
|
async (t) => {
|
|
154
|
-
|
|
172
|
+
de(await $(Z())), y(!0), h(
|
|
155
173
|
e.onOpen,
|
|
156
174
|
t,
|
|
157
|
-
|
|
175
|
+
c(),
|
|
158
176
|
{}
|
|
159
177
|
);
|
|
160
178
|
},
|
|
161
|
-
[
|
|
162
|
-
),
|
|
179
|
+
[m, f, e.onOpen, e.value, k, c]
|
|
180
|
+
), Q = o.useCallback(
|
|
163
181
|
(t) => {
|
|
164
|
-
|
|
182
|
+
y(!1), h(
|
|
165
183
|
e.onClose,
|
|
166
184
|
t,
|
|
167
|
-
|
|
185
|
+
c(),
|
|
168
186
|
{}
|
|
169
187
|
);
|
|
170
188
|
},
|
|
171
|
-
[
|
|
172
|
-
),
|
|
173
|
-
|
|
174
|
-
},
|
|
175
|
-
var
|
|
176
|
-
const t = e.width || ((
|
|
189
|
+
[m, f, e.onClose, c]
|
|
190
|
+
), Se = () => {
|
|
191
|
+
ye(), L();
|
|
192
|
+
}, Y = () => {
|
|
193
|
+
var s, d;
|
|
194
|
+
const t = e.width || ((s = l.current) == null ? void 0 : s.offsetWidth) || _e, n = e.height || ((d = l.current) == null ? void 0 : d.offsetHeight) || Ne;
|
|
177
195
|
return {
|
|
178
196
|
width: t,
|
|
179
197
|
height: n
|
|
180
198
|
};
|
|
181
|
-
},
|
|
182
|
-
const { width: t, height: n } =
|
|
199
|
+
}, Z = () => {
|
|
200
|
+
const { width: t, height: n } = Y();
|
|
183
201
|
return {
|
|
184
|
-
width: t *
|
|
185
|
-
height: n *
|
|
202
|
+
width: t * E,
|
|
203
|
+
height: n * E
|
|
186
204
|
};
|
|
187
|
-
},
|
|
205
|
+
}, Ee = !P() || I().valid;
|
|
188
206
|
return /* @__PURE__ */ o.createElement(
|
|
189
207
|
"div",
|
|
190
208
|
{
|
|
191
|
-
ref:
|
|
209
|
+
ref: l,
|
|
192
210
|
dir: e.dir,
|
|
193
211
|
style: { width: e.width, height: e.height, ...e.style },
|
|
194
212
|
className: T(
|
|
@@ -196,26 +214,26 @@ const Be = 250, _e = 84, ae = 3, re = 2, Fe = "#000000", Ne = "#ffffff", ne = (c
|
|
|
196
214
|
"k-signature",
|
|
197
215
|
{
|
|
198
216
|
"k-signature-maximized": e.maximized,
|
|
199
|
-
[`k-signature-${
|
|
217
|
+
[`k-signature-${ee.sizeMap[e.size] || e.size}`]: e.size,
|
|
200
218
|
[`k-signature-${e.fillMode}`]: e.fillMode,
|
|
201
219
|
[`k-input-${e.fillMode}`]: e.fillMode,
|
|
202
|
-
[`k-rounded-${
|
|
203
|
-
"k-invalid": !
|
|
220
|
+
[`k-rounded-${ee.roundedMap[e.rounded] || e.rounded}`]: e.rounded,
|
|
221
|
+
"k-invalid": !Ee,
|
|
204
222
|
"k-required": e.required,
|
|
205
223
|
"k-disabled": e.disabled,
|
|
206
|
-
"k-focus":
|
|
224
|
+
"k-focus": b
|
|
207
225
|
},
|
|
208
226
|
e.className
|
|
209
227
|
),
|
|
210
228
|
onFocus: ve,
|
|
211
|
-
onBlur:
|
|
229
|
+
onBlur: he
|
|
212
230
|
},
|
|
213
231
|
/* @__PURE__ */ o.createElement(
|
|
214
232
|
"div",
|
|
215
233
|
{
|
|
216
234
|
className: "k-signature-canvas",
|
|
217
|
-
ref:
|
|
218
|
-
tabIndex:
|
|
235
|
+
ref: g,
|
|
236
|
+
tabIndex: Ie(e.tabIndex, e.disabled),
|
|
219
237
|
role: "img",
|
|
220
238
|
id: e.id,
|
|
221
239
|
"aria-label": e.ariaLabel,
|
|
@@ -228,29 +246,29 @@ const Be = 250, _e = 84, ae = 3, re = 2, Fe = "#000000", Ne = "#ffffff", ne = (c
|
|
|
228
246
|
D,
|
|
229
247
|
{
|
|
230
248
|
type: "button",
|
|
231
|
-
className: T("k-signature-action", "k-signature-maximize", { "k-hidden": e.disabled ||
|
|
232
|
-
ref:
|
|
249
|
+
className: T("k-signature-action", "k-signature-maximize", { "k-hidden": e.disabled || pe }),
|
|
250
|
+
ref: q,
|
|
233
251
|
icon: "hyperlink-open",
|
|
234
|
-
svgIcon:
|
|
252
|
+
svgIcon: ae,
|
|
235
253
|
fillMode: "flat",
|
|
236
254
|
size: e.size,
|
|
237
|
-
onClick:
|
|
238
|
-
"aria-label":
|
|
239
|
-
title:
|
|
255
|
+
onClick: ze,
|
|
256
|
+
"aria-label": j,
|
|
257
|
+
title: j
|
|
240
258
|
}
|
|
241
259
|
), /* @__PURE__ */ o.createElement(
|
|
242
260
|
D,
|
|
243
261
|
{
|
|
244
262
|
type: "button",
|
|
245
|
-
className: T("k-signature-action", "k-signature-minimize", "k-rotate-180", { "k-hidden": e.disabled ||
|
|
246
|
-
ref:
|
|
263
|
+
className: T("k-signature-action", "k-signature-minimize", "k-rotate-180", { "k-hidden": e.disabled || ge }),
|
|
264
|
+
ref: N,
|
|
247
265
|
icon: "hyperlink-open",
|
|
248
|
-
svgIcon:
|
|
266
|
+
svgIcon: ae,
|
|
249
267
|
fillMode: "flat",
|
|
250
268
|
size: e.size,
|
|
251
|
-
onClick:
|
|
252
|
-
"aria-label":
|
|
253
|
-
title:
|
|
269
|
+
onClick: Q,
|
|
270
|
+
"aria-label": U,
|
|
271
|
+
title: U
|
|
254
272
|
}
|
|
255
273
|
)),
|
|
256
274
|
!e.hideLine && /* @__PURE__ */ o.createElement(
|
|
@@ -260,36 +278,36 @@ const Be = 250, _e = 84, ae = 3, re = 2, Fe = "#000000", Ne = "#ffffff", ne = (c
|
|
|
260
278
|
style: { zIndex: 2, pointerEvents: "none" }
|
|
261
279
|
}
|
|
262
280
|
),
|
|
263
|
-
/* @__PURE__ */ o.createElement("div", { className: "k-signature-actions k-signature-actions-bottom" },
|
|
281
|
+
/* @__PURE__ */ o.createElement("div", { className: "k-signature-actions k-signature-actions-bottom" }, be && /* @__PURE__ */ o.createElement(
|
|
264
282
|
D,
|
|
265
283
|
{
|
|
266
284
|
type: "button",
|
|
267
285
|
className: "k-signature-action k-signature-clear",
|
|
268
286
|
icon: "x",
|
|
269
|
-
svgIcon:
|
|
287
|
+
svgIcon: Fe,
|
|
270
288
|
fillMode: "flat",
|
|
271
289
|
size: e.size,
|
|
272
|
-
onClick:
|
|
273
|
-
"aria-label":
|
|
274
|
-
title:
|
|
290
|
+
onClick: Se,
|
|
291
|
+
"aria-label": H,
|
|
292
|
+
title: H
|
|
275
293
|
}
|
|
276
294
|
)),
|
|
277
|
-
|
|
278
|
-
|
|
295
|
+
m && /* @__PURE__ */ o.createElement(De, { ref: _ }, /* @__PURE__ */ o.createElement(
|
|
296
|
+
R,
|
|
279
297
|
{
|
|
280
298
|
...e,
|
|
281
|
-
...
|
|
282
|
-
value:
|
|
299
|
+
...Z(),
|
|
300
|
+
value: ue,
|
|
283
301
|
maximized: !0,
|
|
284
|
-
exportScale: 1 /
|
|
302
|
+
exportScale: 1 / E * O,
|
|
285
303
|
open: !1,
|
|
286
|
-
onChange:
|
|
287
|
-
onClose:
|
|
304
|
+
onChange: ke,
|
|
305
|
+
onClose: Ce
|
|
288
306
|
}
|
|
289
307
|
))
|
|
290
308
|
);
|
|
291
309
|
});
|
|
292
|
-
|
|
310
|
+
R.propTypes = {
|
|
293
311
|
value: a.string,
|
|
294
312
|
width: a.number,
|
|
295
313
|
height: a.number,
|
|
@@ -311,26 +329,26 @@ h.propTypes = {
|
|
|
311
329
|
rounded: a.oneOf([null, "small", "medium", "large"]),
|
|
312
330
|
fillMode: a.oneOf([null, "solid", "flat", "outline"])
|
|
313
331
|
};
|
|
314
|
-
|
|
315
|
-
h.defaultProps = {
|
|
332
|
+
const i = {
|
|
316
333
|
strokeWidth: 1,
|
|
317
334
|
smooth: !1,
|
|
318
|
-
popupScale:
|
|
319
|
-
exportScale:
|
|
335
|
+
popupScale: ie,
|
|
336
|
+
exportScale: se,
|
|
320
337
|
maximizable: !0,
|
|
321
338
|
disabled: !1,
|
|
322
339
|
required: !1,
|
|
323
340
|
validityStyles: !0,
|
|
324
|
-
onChange: (
|
|
325
|
-
onFocus: (
|
|
326
|
-
onBlur: (
|
|
327
|
-
onOpen: (
|
|
328
|
-
onClose: (
|
|
341
|
+
onChange: (u) => p,
|
|
342
|
+
onFocus: (u) => p,
|
|
343
|
+
onBlur: (u) => p,
|
|
344
|
+
onOpen: (u) => p,
|
|
345
|
+
onClose: (u) => p,
|
|
329
346
|
size: "medium",
|
|
330
347
|
rounded: "medium",
|
|
331
348
|
fillMode: "solid"
|
|
332
349
|
};
|
|
350
|
+
R.displayName = "KendoSignature";
|
|
333
351
|
export {
|
|
334
|
-
|
|
335
|
-
|
|
352
|
+
R as Signature,
|
|
353
|
+
We as SignaturePropsContext
|
|
336
354
|
};
|
package/textarea/TextArea.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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const oe=require("react"),e=require("prop-types"),a=require("@progress/kendo-react-common");function se(s){const u=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const o in s)if(o!=="default"){const l=Object.getOwnPropertyDescriptor(s,o);Object.defineProperty(u,o,l.get?l:{enumerable:!0,get:()=>s[o]})}}return u.default=s,Object.freeze(u)}const t=se(oe),B=a.createPropsContext(),z=t.forwardRef((s,u)=>{const o=a.usePropsContext(B,s),{size:l=k.size,rounded:m=k.rounded,fillMode:O=k.fillMode,prefix:N=null,suffix:w=null,ariaDescribedBy:j,ariaLabelledBy:R,autoSize:T,className:q,defaultValue:D,disabled:r,readOnly:H,required:p,rows:F,id:$,name:L,placeholder:_,style:K,tabIndex:G,value:b,valid:P,validationMessage:M,validityStyles:S,onChange:g,onFocus:x,onBlur:v,visited:le,touched:ie,modified:ue,resizable:y,...J}=o,n=t.useRef(null),E=t.useCallback(()=>{n.current&&n.current.focus()},[]),[I,V]=t.useState(D),[Q,U]=a.useCustomComponent(N),[W,X]=a.useCustomComponent(w),d=b!==void 0,c=d?b:I,f=t.useCallback(()=>({element:n,focus:E,get value(){return c},get name(){return n.current&&n.current.name}}),[E,c]);t.useImperativeHandle(u,f);const[Y,A]=t.useState("auto"),Z=a.useId(),ee=a.useDir(n,o.dir),h=P!==void 0?P:p?!!c:!0;t.useEffect(()=>{n.current&&n.current.setCustomValidity&&n.current.setCustomValidity(h?"":M||"")},[h,M]),a.useIsomorphicLayoutEffect(()=>{n.current&&A(`${n.current.scrollHeight}px`)},[c]);const te=t.useCallback(i=>{const C=i.target.value;A("auto"),!d&&!r&&V(C),g&&!r&&a.dispatchEvent(g,i,{...f(),value:C},{value:C})},[V,g,r,d]),ae=t.useCallback(i=>{x&&!r&&a.dispatchEvent(x,i,f(),void 0)},[x,r]),ne=t.useCallback(i=>{v&&!r&&a.dispatchEvent(v,i,f(),void 0)},[v,r]),re={id:$||Z,role:"textbox",name:L,className:a.classNames("k-input-inner","!k-overflow-auto",{"k-resize":!T&&y!=="none"}),ref:n,disabled:r,rows:F,placeholder:_,readOnly:H,required:p,tabIndex:a.getTabIndex(G,r),style:T?{resize:"none",overflow:"hidden",height:Y}:y?{resize:y}:{},"aria-labelledby":R,"aria-describedby":j,"aria-multiline":!0,"aria-disabled":r||void 0,value:d?b:I,...J,onChange:te,onFocus:ae,onBlur:ne};return t.createElement("span",{className:a.classNames("k-input","k-textarea",{[`k-input-${a.kendoThemeMaps.sizeMap[l]||l}`]:l,[`k-input-${O}`]:O,[`k-rounded-${a.kendoThemeMaps.roundedMap[m]||m}`]:m,"k-invalid":!(h||S!==void 0||S===!0),"k-required":p,"k-disabled":r},q),style:K,dir:ee},o.prefix&&t.createElement(Q,{...U}),t.createElement("textarea",{...re}),o.suffix&&t.createElement(W,{...X}))});z.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([null,"small","medium","large"]),rounded:e.oneOf([null,"small","medium","large","full"]),fillMode:e.oneOf([null,"solid","flat","outline"]),resizable:e.oneOf(["none","both","horizontal","vertical"])};const k={size:"medium",rounded:"medium",fillMode:"solid"};z.displayName="KendoTextArea";exports.TextArea=z;exports.TextAreaPropsContext=B;
|