@wix/form-elements 1.162.0 → 1.163.0
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/dist/component/{appointment-rac-3Z1wiBX6.js → appointment-rac-Cskf9hxi.js} +4 -4
- package/dist/component/{bookings-address-rac-2zV-a8SW.js → bookings-address-rac-C18tuPai.js} +1 -1
- package/dist/component/{bookings-email-rac-C1WakVnh.js → bookings-email-rac-C2GL3cJg.js} +1 -1
- package/dist/component/{bookings-first-name-rac-6f18uXA0.js → bookings-first-name-rac-IEklnchg.js} +1 -1
- package/dist/component/{bookings-header-rac-BeaxlPQl.js → bookings-header-rac-iwcrj5Kj.js} +1 -1
- package/dist/component/{bookings-last-name-rac-CsLZaKfO.js → bookings-last-name-rac-CXZfq3Rw.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-B3TRivWU.js → bookings-login-bar-rac-DP0MBFTm.js} +1 -1
- package/dist/component/{bookings-phone-rac-BnFEknvv.js → bookings-phone-rac-uJGk_tzr.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-CFPqDZay.js → bookings-rich-text-rac-BerRAnFy.js} +1 -1
- package/dist/component/{checkbox-field-rac-DqGbxAd0.js → checkbox-field-rac-BBftIi_U.js} +4 -4
- package/dist/component/{checkbox-group-field-headless-CiobdaVa.js → checkbox-group-field-headless-BiQ4coe6.js} +3 -3
- package/dist/component/{checkbox-group-field-rac-Dxrc2F4x.js → checkbox-group-field-rac-moHc5Cyu.js} +4 -4
- package/dist/component/{checkbox-group-rac-C3tL4YSr.js → checkbox-group-rac-iuPzxN7i.js} +1 -1
- package/dist/component/{checkbox-rac-DhZsIMuk.js → checkbox-rac-BwfHAeFo.js} +1 -1
- package/dist/component/{contacts-address-rac--GiWpa6C.js → contacts-address-rac-DuyEL5YR.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-CmI2nPpr.js → contacts-birthdate-rac-Mkoplu3x.js} +1 -1
- package/dist/component/{contacts-company-rac-DcSLvPnR.js → contacts-company-rac-B-3QghQg.js} +1 -1
- package/dist/component/{contacts-email-rac-BLOIHGP9.js → contacts-email-rac-CqooKQl8.js} +1 -1
- package/dist/component/{contacts-first-name-rac-DgMCKLeE.js → contacts-first-name-rac-CAOu0GIH.js} +1 -1
- package/dist/component/{contacts-last-name-rac-tcEQP1Db.js → contacts-last-name-rac-Cd-wCTC3.js} +1 -1
- package/dist/component/{contacts-phone-rac-CK664cfW.js → contacts-phone-rac-OGE6eaJc.js} +1 -1
- package/dist/component/{contacts-position-rac-B8skwXy6.js → contacts-position-rac-eSsV63RC.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-DQZYJjMo.js → contacts-subscribe-rac-19d4uPR-.js} +1 -1
- package/dist/component/{contacts-tax-id-rac-Ci24ixLu.js → contacts-tax-id-rac-TtyrAftZ.js} +1 -1
- package/dist/component/{date-availability-Va6_2NAZ.js → date-availability-CudIaav_.js} +1 -1
- package/dist/component/{date-input-field-rac-lAKyuHOI.js → date-input-field-rac-DzMiQLxS.js} +6 -6
- package/dist/component/{date-input-rac-ClEesupR.js → date-input-rac-BWfmwcmK.js} +1 -1
- package/dist/component/{date-picker-field-rac-h45jfoso.js → date-picker-field-rac-w4Wf-m0I.js} +6 -6
- package/dist/component/{date-picker-rac-B-pvqBn0.js → date-picker-rac-Bejo7tOm.js} +1 -1
- package/dist/component/{date-time-input-field-rac-41QpurJp.js → date-time-input-field-rac-D6JPrbGb.js} +6 -6
- package/dist/component/{date-time-input-rac-BQOUl7It.js → date-time-input-rac-CAK5NgC4.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-C4Q6tfBD.js → dext-checkbox-group-rac-BqoHMQwI.js} +2 -2
- package/dist/component/{dext-checkbox-rac-Yo2PHNDA.js → dext-checkbox-rac-BEis8bxo.js} +1 -1
- package/dist/component/{dext-date-picker-rac-jM9x8W6a.js → dext-date-picker-rac-DDQTy3BG.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-BgW_4WIg.js → dext-date-time-input-rac-Dp3UEXEu.js} +1 -1
- package/dist/component/{dext-dropdown-rac-DCL7D6-G.js → dext-dropdown-rac-DisXIXNb.js} +1 -1
- package/dist/component/{dext-email-rac-Dz7yBqkd.js → dext-email-rac-CBv4umUC.js} +1 -1
- package/dist/component/{dext-number-input-rac-BdMjBpH9.js → dext-number-input-rac-0UNC_1Ac.js} +1 -1
- package/dist/component/{dext-phone-rac-D2i9fXL3.js → dext-phone-rac-CQVzz499.js} +1 -1
- package/dist/component/{dext-radio-group-rac-Br2f1Ahx.js → dext-radio-group-rac-3lhx-xxX.js} +2 -2
- package/dist/component/{dext-rating-input-rac-OkfJ7Eb0.js → dext-rating-input-rac-2fwxV3iY.js} +1 -1
- package/dist/component/{dext-tags-rac-43vDoDdM.js → dext-tags-rac-DCL78ClS.js} +2 -2
- package/dist/component/{dext-text-area-rac-C072pWO9.js → dext-text-area-rac-WTCWYySB.js} +1 -1
- package/dist/component/{dext-text-input-rac-BiHJpJCt.js → dext-text-input-rac-DMCzSYAI.js} +1 -1
- package/dist/component/{dext-url-input-rac-YOGYMj5C.js → dext-url-input-rac-Bzvt5zTa.js} +1 -1
- package/dist/component/{donation-rac-fCt3mddA.js → donation-rac-B3YHu0bl.js} +5 -5
- package/dist/component/{dropdown-field-rac-EQrQJ2-C.js → dropdown-field-rac-y4GPpf0W.js} +3 -3
- package/dist/component/{dropdown-rac-MPCcjrFd.js → dropdown-rac-Dj7OnxJL.js} +1 -1
- package/dist/component/{ecom-address-rac-DSgpHqzV.js → ecom-address-rac-Bnc60jDw.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-Dw6Ke0Fb.js → ecom-subscription-checkbox-rac-CesTpjav.js} +2 -2
- package/dist/component/{email-input-field-rac-DVmvH4u4.js → email-input-field-rac-BT2FrAEM.js} +3 -3
- package/dist/component/{events-repeater-rac-Uwpo7XF4.js → events-repeater-rac-CA2yjEEk.js} +4 -4
- package/dist/component/{events-rsvp-rac-D2DJAkep.js → events-rsvp-rac-wVpVt7-p.js} +3 -3
- package/dist/component/{field-error-headless-DAc8FpKI.js → field-error-headless-CX95bMbk.js} +1 -1
- package/dist/component/{field-label-headless-DxxwJtjh.js → field-label-headless-niuFY6Mw.js} +1 -1
- package/dist/component/{file-upload-rac-CBKIeaxX.js → file-upload-rac-ByO8l8lE.js} +187 -187
- package/dist/component/{fixed-payment-rac-BsCDoc1p.js → fixed-payment-rac-BNDAdNeQ.js} +3 -3
- package/dist/component/{form-GAuLAdjq.js → form-CCQN_rPn.js} +69 -69
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +1 -1
- package/dist/component/{header-field-rac-DtZCjzLJ.js → header-field-rac-C1RySfYy.js} +2 -2
- package/dist/component/{header-rac-B1hlVDf8.js → header-rac-BaFPV0vy.js} +1 -1
- package/dist/component/{image-choice-rac-DQaCg_Xk.js → image-choice-rac-BShUj92P.js} +4 -4
- package/dist/component/{index-BaVjVNYj.js → index-0_YjLphg.js} +2 -2
- package/dist/component/{index-C1EXd9jU.js → index-DHLfweXD.js} +4 -4
- package/dist/component/{isObjectLike-m2dqIREj.js → isObjectLike-D7tbAd6O.js} +1 -1
- package/dist/component/{multiline-address-field-rac-CMMdLb-J.js → multiline-address-field-rac-CFJKE5vA.js} +7 -7
- package/dist/component/{multiline-address-rac-VUQNp-Tz.js → multiline-address-rac-BlzCkwEH.js} +1 -1
- package/dist/component/{number-input-field-rac-B5bsGDKm.js → number-input-field-rac-XqxdqTRV.js} +4 -4
- package/dist/component/{number-input-rac-BzzW0p9R.js → number-input-rac-CQTg0QSm.js} +1 -1
- package/dist/component/{password-rac-2Rr7lvNO.js → password-rac-DPE-U2xs.js} +4 -4
- package/dist/component/{payment-input-rac-CEUzIrJA.js → payment-input-rac-oOh04431.js} +4 -4
- package/dist/component/{phone-input-field-rac-BDBaqAzE.js → phone-input-field-rac-DW2vQhjC.js} +6 -6
- package/dist/component/{phone-rac-BTK8-tkq.js → phone-rac-BB9B-Hpl.js} +1 -1
- package/dist/component/{product-list-rac-1QbeT5RH.js → product-list-rac-K53VvPJV.js} +4 -4
- package/dist/component/{quiz-radio-group-rac-tn2CzdCu.js → quiz-radio-group-rac-gikcMV2I.js} +1 -1
- package/dist/component/{radio-button-module-classes-aK1SQcLG.js → radio-button-module-classes-CY883yGO.js} +3 -3
- package/dist/component/{radio-group-field-rac-DlMXhW_S.js → radio-group-field-rac-BOEWcfT9.js} +4 -4
- package/dist/component/{radio-group-rac-BmU_5tBK.js → radio-group-rac-gKhmLMm3.js} +1 -1
- package/dist/component/{rating-input-field-rac-DUPJUAX2.js → rating-input-field-rac-83FXIVpy.js} +4 -4
- package/dist/component/{rating-input-rac-BLhkZdj8.js → rating-input-rac-XDwakrtR.js} +1 -1
- package/dist/component/{rich-content-rac.module-C9bGXB69.js → rich-content-rac.module-Bdx8hK3J.js} +1 -1
- package/dist/component/{rich-text-field-rac-CVqmsZzZ.js → rich-text-field-rac-ksEKBaYG.js} +2 -2
- package/dist/component/{rich-text-rac-D8K6445F.js → rich-text-rac-XEFBeQrz.js} +1 -1
- package/dist/component/{service-dropdown-rac-PR_iLdmo.js → service-dropdown-rac-CjFiqV1n.js} +4 -4
- package/dist/component/{services-multi-choice-rac-BvMadJCf.js → services-multi-choice-rac-DNut4K3I.js} +5 -5
- package/dist/component/{signature-rac-Cpjv6kcl.js → signature-rac-BhWPZpwu.js} +185 -185
- package/dist/component/{submit-button-rac-DpDk7cMb.js → submit-button-rac-CWmz_JCl.js} +2 -2
- package/dist/component/{tags-field-rac-DnyWNHXT.js → tags-field-rac-D9P1jVrz.js} +5 -5
- package/dist/component/{tags-rac-D5Do7BNm.js → tags-rac-0zEd-xYa.js} +1 -1
- package/dist/component/{text-area-field-rac-DLBgla0L.js → text-area-field-rac-D_55oi2b.js} +4 -4
- package/dist/component/{text-area-rac-Bfsl2gSn.js → text-area-rac-CpkFyXCH.js} +1 -1
- package/dist/component/{text-input-field-rac-hLsUcQNw.js → text-input-field-rac-b7RXb4Ob.js} +3 -3
- package/dist/component/{text-input-headless-Otd7Uy7V.js → text-input-headless-b1TEpdit.js} +3 -3
- package/dist/component/{text-input-rac-jpnc-v91.js → text-input-rac-CoVcg1S0.js} +1 -1
- package/dist/component/{time-input-rac-DnjrmZZw.js → time-input-rac-DE7OyzgQ.js} +4 -4
- package/dist/component/{url-input-field-rac-C90NYHb8.js → url-input-field-rac-_yxWlb3a.js} +4 -4
- package/dist/component/{url-input-rac-C3wfEnqs.js → url-input-rac-wguMUqug.js} +1 -1
- package/dist/component/{use-dropdown-option-class-name-CYkLlKBs.js → use-dropdown-option-class-name-DdQ0sFRF.js} +2 -2
- package/dist/component/{use-dropdown-trigger-class-name-CTt4Z67m.js → use-dropdown-trigger-class-name-hB8KYv-I.js} +6 -6
- package/dist/component/{use-element-state-class-name-ByDw6j7c.js → use-element-state-class-name-C2tQgxUX.js} +1 -1
- package/dist/component/{use-hoverable-input-class-name-Duhgtn2I.js → use-hoverable-input-class-name-C8iuzofb.js} +2 -2
- package/dist/component/{use-is-forced-open-dropdown-B5gNY4Zm.js → use-is-forced-open-dropdown-DkIrJPsK.js} +1 -1
- package/dist/component/{use-service-options-base-DE-QaNDw.js → use-service-options-base-B-xAR-tx.js} +1 -1
- package/dist/component/use-text-input-class-name-CK4rZeSM.js +6 -0
- package/package.json +2 -2
- package/dist/component/use-text-input-class-name-CmxSw6bY.js +0 -6
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import
|
|
1
|
+
import r, { useRef as V, useContext as Ne, useMemo as be, useCallback as _, useState as q, useEffect as le, Children as Fe, isValidElement as Le } from "react";
|
|
2
2
|
import we from "@wix/editor-react-components/AnimatedIcon";
|
|
3
3
|
import { RicosViewer as xe } from "@wix/ricos/viewer";
|
|
4
4
|
import F from "classnames";
|
|
5
|
-
import { b0 as Ue, bs as Te, aE as Be, F as Oe, bu as Pe, bq as Me, bG as Ce, E as me, au as oe, by as x, bv as W, bA as Ie, bI as He, br as We, U as
|
|
5
|
+
import { b0 as Ue, bs as Te, aE as Be, F as Oe, bu as Pe, bq as Me, bG as Ce, E as me, au as oe, by as x, bv as W, bA as Ie, bI as He, br as We, U as ze, aa as Ye, ab as Ge, G as pe, b as Ze, ah as ke, ai as fe, K as Ve, ac as $e, af as Xe, ad as qe, ag as je, f as ne, ae as Ke } from "./form-CCQN_rPn.js";
|
|
6
6
|
import { useHover as Je, useFocusRing as Qe, mergeProps as et } from "react-aria";
|
|
7
|
-
import { RadioGroup as tt, Button as ye, TextField as nt, DropZone as at, Input as ot, FileTrigger as
|
|
7
|
+
import { RadioGroup as tt, Button as ye, TextField as nt, DropZone as at, Input as ot, FileTrigger as st, RadioField as rt, RadioButton as lt } from "react-aria-components";
|
|
8
8
|
import _e from "signature_pad";
|
|
9
9
|
import { f as I, a as N } from "./find-child-C60k4CxG.js";
|
|
10
|
-
import { D as it, E as ct } from "./field-error-headless-
|
|
11
|
-
import { L as ut } from "./field-label-headless-
|
|
10
|
+
import { D as it, E as ct } from "./field-error-headless-CX95bMbk.js";
|
|
11
|
+
import { L as ut } from "./field-label-headless-niuFY6Mw.js";
|
|
12
12
|
import { D as dt } from "./data-hooks-Dkw1pbRj.js";
|
|
13
13
|
import { E as mt } from "./error-icon-hZxQ6DEy.js";
|
|
14
14
|
import { s as ae } from "./field-rac.module-ts2t4WUO.js";
|
|
15
|
-
import { u as X } from "./use-element-state-class-name-
|
|
16
|
-
const pt = typeof
|
|
15
|
+
import { u as X } from "./use-element-state-class-name-C2tQgxUX.js";
|
|
16
|
+
const pt = typeof r.useId == "function" ? r.useId : () => V(Ue()).current, ft = ({ properties: e }) => e.uploadEnabled === !0, Et = (e, t) => e.fieldType === Oe.SIGNATURE && !e.properties.hidden && !e.properties.disabled && !e.properties.readOnly && (t !== "upload" || ft(e)), gt = (e, t) => e.layout.row - t.layout.row || e.layout.column - t.layout.column, ht = (e) => {
|
|
17
17
|
var o;
|
|
18
18
|
const t = (o = Te().signature) == null ? void 0 : o.signatureMode, a = Ne(Be);
|
|
19
19
|
return be(() => {
|
|
20
|
-
var
|
|
21
|
-
return a && !a.parentId && t ? (
|
|
20
|
+
var s;
|
|
21
|
+
return a && !a.parentId && t ? (s = a.fields.filter((l) => Et(l, t)).sort(gt)[0]) == null ? void 0 : s.id : void 0;
|
|
22
22
|
}, [
|
|
23
23
|
a,
|
|
24
24
|
t
|
|
@@ -36,11 +36,11 @@ const bt = (e) => {
|
|
|
36
36
|
return _(async (o) => {
|
|
37
37
|
if (!n)
|
|
38
38
|
throw new Error("No uploadFile action");
|
|
39
|
-
const
|
|
39
|
+
const s = await n({
|
|
40
40
|
file: o,
|
|
41
41
|
formId: a,
|
|
42
42
|
uploadTarget: e
|
|
43
|
-
}), { id: l, displayName: i, url: c, isPrivate: u } =
|
|
43
|
+
}), { id: l, displayName: i, url: c, isPrivate: u } = s;
|
|
44
44
|
return {
|
|
45
45
|
fileId: l,
|
|
46
46
|
displayName: i || o.name,
|
|
@@ -62,17 +62,17 @@ function Lt(e) {
|
|
|
62
62
|
const Tt = (e, t) => {
|
|
63
63
|
const a = Lt(e);
|
|
64
64
|
return (n, o) => {
|
|
65
|
-
const
|
|
66
|
-
return t.data[
|
|
65
|
+
const s = (o * t.width + n) * 4;
|
|
66
|
+
return t.data[s] * 65536 + t.data[s + 1] * 256 + t.data[s + 2] === a;
|
|
67
67
|
};
|
|
68
68
|
}, Ct = (e) => (t, a) => {
|
|
69
69
|
const n = (a * e.width + t) * 4;
|
|
70
70
|
return e.data[n + 3] === 0;
|
|
71
71
|
};
|
|
72
|
-
function
|
|
72
|
+
function re(e, t) {
|
|
73
73
|
const a = e.getContext("2d", {
|
|
74
74
|
willReadFrequently: !0
|
|
75
|
-
}), n = e.width, o = e.height,
|
|
75
|
+
}), n = e.width, o = e.height, s = a.getImageData(0, 0, n, o), l = t ? Tt(t, s) : Ct(s);
|
|
76
76
|
let i = n + 1, c = -1, u = o + 1, d = -1, f = 0, m = 0;
|
|
77
77
|
for (m = 0; m < o; m++)
|
|
78
78
|
for (f = 0; f < n; f++)
|
|
@@ -97,26 +97,26 @@ function It(e, t) {
|
|
|
97
97
|
return new Promise((a, n) => {
|
|
98
98
|
const o = new Image();
|
|
99
99
|
o.onload = () => {
|
|
100
|
-
const
|
|
100
|
+
const s = j(o.width, o.height), l = s.getContext("2d", {
|
|
101
101
|
willReadFrequently: !0
|
|
102
102
|
});
|
|
103
|
-
l == null || l.drawImage(o, 0, 0), a(
|
|
103
|
+
l == null || l.drawImage(o, 0, 0), a(s);
|
|
104
104
|
}, o.onerror = n, o.src = e;
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
107
|
function Ee(e, t, a, n) {
|
|
108
|
-
const o = e.width,
|
|
109
|
-
return n && m && (m.fillStyle = n, m.fillRect(0, 0, u, d)), m == null || m.drawImage(e, 0, 0, o,
|
|
108
|
+
const o = e.width, s = e.height, l = 1, i = a / s, c = Math.min(i, l), u = o * c, d = s * c, f = j(u, d), m = f.getContext("2d");
|
|
109
|
+
return n && m && (m.fillStyle = n, m.fillRect(0, 0, u, d)), m == null || m.drawImage(e, 0, 0, o, s, 0, 0, u, d), f;
|
|
110
110
|
}
|
|
111
111
|
function ge(e, t) {
|
|
112
|
-
const a = e.getContext("2d"), n = e.offsetWidth, o = e.offsetHeight,
|
|
113
|
-
return (e.width !== l || e.height !== i) && a ? (e.width = l, e.height = i, a.scale(
|
|
112
|
+
const a = e.getContext("2d"), n = e.offsetWidth, o = e.offsetHeight, s = Math.max(window.devicePixelRatio || 1, 1), l = n * s, i = o * s;
|
|
113
|
+
return (e.width !== l || e.height !== i) && a ? (e.width = l, e.height = i, a.scale(s, s), t == null || t.redraw(), !0) : !1;
|
|
114
114
|
}
|
|
115
|
-
const
|
|
115
|
+
const k = 480, yt = (e) => Se({
|
|
116
116
|
data: JSON.stringify(e),
|
|
117
117
|
mimeType: A.POINTS
|
|
118
118
|
}), ve = (e) => {
|
|
119
|
-
const t =
|
|
119
|
+
const t = z(e);
|
|
120
120
|
if ((t == null ? void 0 : t.mimeType) === A.POINTS)
|
|
121
121
|
try {
|
|
122
122
|
return JSON.parse(t.data);
|
|
@@ -134,24 +134,24 @@ function Ae(e, t) {
|
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
136
|
function _t(e, t) {
|
|
137
|
-
const a = t.getContext("2d"), n = t.offsetWidth || t.width,
|
|
138
|
-
a.font = `${
|
|
139
|
-
const { width: i, height: c } = Ae(e, a), u =
|
|
137
|
+
const a = t.getContext("2d"), n = t.offsetWidth || t.width, s = (t.offsetHeight || t.height) * he, l = n * he;
|
|
138
|
+
a.font = `${s}px ${De}`;
|
|
139
|
+
const { width: i, height: c } = Ae(e, a), u = s / (i / l), d = s / (c / s);
|
|
140
140
|
return Math.min(u, d);
|
|
141
141
|
}
|
|
142
142
|
function vt(e, t, a = "black", n = !1, o) {
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
const i = e.offsetWidth || e.width, c = e.offsetHeight || e.height, { width: u, height: d, offsetY: f } = Ae(t,
|
|
146
|
-
|
|
143
|
+
const s = e.getContext("2d"), l = _t(t, e);
|
|
144
|
+
s.font = `${l}px ${De}`, s.textBaseline = "top";
|
|
145
|
+
const i = e.offsetWidth || e.width, c = e.offsetHeight || e.height, { width: u, height: d, offsetY: f } = Ae(t, s);
|
|
146
|
+
s.fillStyle = o, s.fillRect(0, 0, i, c), s.fillStyle = a;
|
|
147
147
|
const m = (i - u) / 2;
|
|
148
|
-
|
|
148
|
+
s.fillText(t, n ? i - m : m, (c - d) / 2 + f);
|
|
149
149
|
}
|
|
150
150
|
const Re = /^data:([^;,]+)(?:;([^,]+))?,(.+)$/;
|
|
151
151
|
function Dt(e) {
|
|
152
152
|
return Re.test(e);
|
|
153
153
|
}
|
|
154
|
-
function
|
|
154
|
+
function z(e) {
|
|
155
155
|
if (!e)
|
|
156
156
|
return;
|
|
157
157
|
const t = e.match(Re);
|
|
@@ -169,22 +169,22 @@ function Se({ data: e, mimeType: t, encoding: a = "text" }) {
|
|
|
169
169
|
return `data:${a === "base64" ? `${t};base64` : t},${n}`;
|
|
170
170
|
}
|
|
171
171
|
function At(e, t) {
|
|
172
|
-
const a =
|
|
172
|
+
const a = z(e);
|
|
173
173
|
if (!a)
|
|
174
174
|
return;
|
|
175
175
|
let n = a.data.length;
|
|
176
176
|
const o = new Uint8Array(n);
|
|
177
177
|
for (; n--; )
|
|
178
178
|
o[n] = a.data.charCodeAt(n);
|
|
179
|
-
const
|
|
179
|
+
const s = a.mimeType.split("/")[1] ?? "txt";
|
|
180
180
|
return new File([
|
|
181
181
|
o
|
|
182
|
-
], `${t}.${
|
|
182
|
+
], `${t}.${s}`, {
|
|
183
183
|
type: a.mimeType
|
|
184
184
|
});
|
|
185
185
|
}
|
|
186
186
|
function ie(e, t = "temp") {
|
|
187
|
-
const a =
|
|
187
|
+
const a = z(e);
|
|
188
188
|
return {
|
|
189
189
|
fileId: "temp",
|
|
190
190
|
displayName: t,
|
|
@@ -193,31 +193,31 @@ function ie(e, t = "temp") {
|
|
|
193
193
|
};
|
|
194
194
|
}
|
|
195
195
|
async function Rt(e, t) {
|
|
196
|
-
const a =
|
|
196
|
+
const a = z(e);
|
|
197
197
|
if (!a)
|
|
198
198
|
return e;
|
|
199
199
|
const n = a.mimeType;
|
|
200
200
|
if (n === A.TEXT) {
|
|
201
|
-
const o = j(
|
|
201
|
+
const o = j(k * 20, k, 1);
|
|
202
202
|
vt(o, a.data, "black", t, "white");
|
|
203
|
-
const
|
|
204
|
-
return (
|
|
203
|
+
const s = re(o, "white");
|
|
204
|
+
return (s == null ? void 0 : s.toDataURL("image/jpeg", 0.7)) ?? null;
|
|
205
205
|
}
|
|
206
206
|
if (n === A.POINTS) {
|
|
207
207
|
const o = ve(e);
|
|
208
208
|
if (!o)
|
|
209
209
|
return null;
|
|
210
|
-
const
|
|
210
|
+
const s = o.map((d) => ({
|
|
211
211
|
...d,
|
|
212
212
|
penColor: "black"
|
|
213
|
-
})), l = j(
|
|
214
|
-
new _e(l).fromData(
|
|
215
|
-
const c =
|
|
216
|
-
return c ? Ee(c, void 0,
|
|
213
|
+
})), l = j(k * 20, k, Math.max(window.devicePixelRatio || 1, 1));
|
|
214
|
+
new _e(l).fromData(s);
|
|
215
|
+
const c = re(l);
|
|
216
|
+
return c ? Ee(c, void 0, k, "white").toDataURL("image/jpeg", 0.7) : null;
|
|
217
217
|
}
|
|
218
218
|
if (n != null && n.startsWith("image/")) {
|
|
219
|
-
const o = await It(e),
|
|
220
|
-
return
|
|
219
|
+
const o = await It(e), s = re(o);
|
|
220
|
+
return s ? Ee(s, void 0, k).toDataURL("image/jpeg", 0.7) : null;
|
|
221
221
|
}
|
|
222
222
|
return e;
|
|
223
223
|
}
|
|
@@ -227,7 +227,7 @@ async function St(e, t) {
|
|
|
227
227
|
return At(a, "signature");
|
|
228
228
|
}
|
|
229
229
|
const Nt = ({ value: e, onChange: t, target: a }) => {
|
|
230
|
-
const [n, o] = q(e), { isRTL:
|
|
230
|
+
const [n, o] = q(e), { isRTL: s } = Me(), l = bt(a), { setFormStatus: i } = Ce(), c = V();
|
|
231
231
|
le(() => {
|
|
232
232
|
e === me && o(me);
|
|
233
233
|
}, [
|
|
@@ -235,11 +235,11 @@ const Nt = ({ value: e, onChange: t, target: a }) => {
|
|
|
235
235
|
]);
|
|
236
236
|
const u = _(() => {
|
|
237
237
|
c.current && (clearTimeout(c.current), c.current = null);
|
|
238
|
-
}, []), d = n == null ? void 0 : n[0], f = d != null && d.url ?
|
|
238
|
+
}, []), d = n == null ? void 0 : n[0], f = d != null && d.url ? z(d.url) : void 0, m = _(async (h) => {
|
|
239
239
|
try {
|
|
240
240
|
const p = (h == null ? void 0 : h.url) ?? "";
|
|
241
241
|
if (Dt(p)) {
|
|
242
|
-
const g = await St(p,
|
|
242
|
+
const g = await St(p, s);
|
|
243
243
|
if (g) {
|
|
244
244
|
const E = await l(g);
|
|
245
245
|
t([
|
|
@@ -255,7 +255,7 @@ const Nt = ({ value: e, onChange: t, target: a }) => {
|
|
|
255
255
|
}, [
|
|
256
256
|
i,
|
|
257
257
|
a,
|
|
258
|
-
|
|
258
|
+
s,
|
|
259
259
|
l,
|
|
260
260
|
t
|
|
261
261
|
]);
|
|
@@ -278,12 +278,12 @@ const Nt = ({ value: e, onChange: t, target: a }) => {
|
|
|
278
278
|
cancelUpload: u
|
|
279
279
|
};
|
|
280
280
|
}, Ft = ({ target: e, value: t, onChange: a }) => {
|
|
281
|
-
const { handleChange: n, cancelUpload: o, signature:
|
|
281
|
+
const { handleChange: n, cancelUpload: o, signature: s, decodedValue: l } = Nt({
|
|
282
282
|
value: t,
|
|
283
283
|
onChange: a,
|
|
284
284
|
target: e
|
|
285
285
|
}), [i, c] = q(() => {
|
|
286
|
-
if (
|
|
286
|
+
if (s == null)
|
|
287
287
|
return C.DRAW;
|
|
288
288
|
switch (l == null ? void 0 : l.mimeType) {
|
|
289
289
|
case A.POINTS:
|
|
@@ -306,7 +306,7 @@ const Nt = ({ value: e, onChange: t, target: a }) => {
|
|
|
306
306
|
n,
|
|
307
307
|
u,
|
|
308
308
|
e
|
|
309
|
-
]), m =
|
|
309
|
+
]), m = s != null, L = xt(i, s, l), h = (() => {
|
|
310
310
|
switch (i) {
|
|
311
311
|
case C.DRAW:
|
|
312
312
|
return R.DRAW;
|
|
@@ -319,7 +319,7 @@ const Nt = ({ value: e, onChange: t, target: a }) => {
|
|
|
319
319
|
}
|
|
320
320
|
})();
|
|
321
321
|
return {
|
|
322
|
-
signature:
|
|
322
|
+
signature: s,
|
|
323
323
|
decodedValue: l,
|
|
324
324
|
signatureMode: i,
|
|
325
325
|
clearable: m,
|
|
@@ -339,7 +339,7 @@ function xt(e, t, a) {
|
|
|
339
339
|
return t && wt[e](a) ? t : void 0;
|
|
340
340
|
}
|
|
341
341
|
const Ut = (e) => {
|
|
342
|
-
const t = e.url ?
|
|
342
|
+
const t = e.url ? z(e.url) : void 0;
|
|
343
343
|
return t ? t.mimeType !== A.POINTS && t.mimeType !== A.TEXT : !0;
|
|
344
344
|
}, ce = () => {
|
|
345
345
|
const { hoverProps: e, isHovered: t } = Je({}), { focusProps: a, isFocused: n, isFocusVisible: o } = Qe({
|
|
@@ -352,20 +352,20 @@ const Ut = (e) => {
|
|
|
352
352
|
"data-focus-visible": o || void 0
|
|
353
353
|
};
|
|
354
354
|
}, b = ({ children: e }) => {
|
|
355
|
-
const { id: t, FieldLayout: a } = x(), n = I(e, b.Label), o = I(e, b.Input),
|
|
356
|
-
return /* @__PURE__ */
|
|
355
|
+
const { id: t, FieldLayout: a } = x(), n = I(e, b.Label), o = I(e, b.Input), s = I(e, b.Description), l = I(e, b.Error);
|
|
356
|
+
return /* @__PURE__ */ r.createElement(a, {
|
|
357
357
|
fieldId: t,
|
|
358
358
|
renderLabel: () => n,
|
|
359
359
|
renderInput: () => o,
|
|
360
|
-
renderDescription: () => /* @__PURE__ */
|
|
360
|
+
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, l, s)
|
|
361
361
|
});
|
|
362
362
|
}, Bt = {
|
|
363
363
|
[C.DRAW]: R.DRAW,
|
|
364
364
|
[C.TYPE]: R.TYPE,
|
|
365
365
|
[C.UPLOAD]: R.UPLOAD
|
|
366
366
|
}, K = ({ children: e, className: t }) => {
|
|
367
|
-
const { id: a, value: n, onChange: o, target:
|
|
368
|
-
target:
|
|
367
|
+
const { id: a, value: n, onChange: o, target: s, readOnly: l } = x(), i = ht(a), { signatureMode: c, setSignatureMode: u, handleClear: d, clearable: f, signatureView: m, signatureValueForView: L, handleChange: h, handleBeforeChange: p } = Ft({
|
|
368
|
+
target: s,
|
|
369
369
|
value: n,
|
|
370
370
|
onChange: o
|
|
371
371
|
}), g = I(e, K.Header), E = I(e, K.Value), S = {
|
|
@@ -378,32 +378,32 @@ const Ut = (e) => {
|
|
|
378
378
|
handleChange: h,
|
|
379
379
|
handleBeforeChange: p
|
|
380
380
|
};
|
|
381
|
-
return /* @__PURE__ */
|
|
381
|
+
return /* @__PURE__ */ r.createElement("div", {
|
|
382
382
|
className: t,
|
|
383
383
|
"data-hook": "signature-container"
|
|
384
384
|
}, !l && N(g, S), N(E, S));
|
|
385
385
|
}, J = ({ children: e, className: t, ...a }) => {
|
|
386
|
-
const { signatureMode: n, setSignatureMode: o, clearable:
|
|
387
|
-
return /* @__PURE__ */
|
|
386
|
+
const { signatureMode: n, setSignatureMode: o, clearable: s, handleClear: l } = a, { uploadEnabled: i } = x(), c = I(e, J.Tabs), u = I(e, J.Clear);
|
|
387
|
+
return /* @__PURE__ */ r.createElement("div", {
|
|
388
388
|
className: t
|
|
389
389
|
}, N(c, {
|
|
390
390
|
signatureMode: n,
|
|
391
391
|
setSignatureMode: o,
|
|
392
392
|
uploadEnabled: i
|
|
393
|
-
}),
|
|
393
|
+
}), s && N(u, {
|
|
394
394
|
handleClear: l
|
|
395
395
|
}));
|
|
396
396
|
}, M = ({ children: e, className: t, ...a }) => {
|
|
397
|
-
const { signatureMode: n, setSignatureMode: o, uploadEnabled:
|
|
397
|
+
const { signatureMode: n, setSignatureMode: o, uploadEnabled: s } = a, { disabled: l } = x(), { labelId: i, inputId: c } = W(), u = _((L) => {
|
|
398
398
|
o(L);
|
|
399
399
|
}, [
|
|
400
400
|
o
|
|
401
401
|
]), d = {
|
|
402
402
|
[C.DRAW]: I(e, M.Draw),
|
|
403
403
|
[C.TYPE]: I(e, M.Type),
|
|
404
|
-
[C.UPLOAD]:
|
|
404
|
+
[C.UPLOAD]: s ? I(e, M.Upload) : null
|
|
405
405
|
}, f = d[n], m = Ot(f) ? f.props.description : void 0;
|
|
406
|
-
return /* @__PURE__ */
|
|
406
|
+
return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("div", {
|
|
407
407
|
role: "status",
|
|
408
408
|
"aria-live": "polite",
|
|
409
409
|
style: {
|
|
@@ -413,7 +413,7 @@ const Ut = (e) => {
|
|
|
413
413
|
height: "1px",
|
|
414
414
|
overflow: "hidden"
|
|
415
415
|
}
|
|
416
|
-
}, m), /* @__PURE__ */
|
|
416
|
+
}, m), /* @__PURE__ */ r.createElement(tt, {
|
|
417
417
|
value: n,
|
|
418
418
|
onChange: u,
|
|
419
419
|
isDisabled: l,
|
|
@@ -422,34 +422,34 @@ const Ut = (e) => {
|
|
|
422
422
|
"data-hook": dt.SIGNATURE_FIELD_MODE_SELECT,
|
|
423
423
|
className: t
|
|
424
424
|
}, d[C.DRAW], d[C.TYPE], d[C.UPLOAD]));
|
|
425
|
-
}, Ot = (e) => /* @__PURE__ */ Le(e), ue = ({ mode: e, children: t, className: a, "aria-label": n }) => /* @__PURE__ */
|
|
425
|
+
}, Ot = (e) => /* @__PURE__ */ Le(e), ue = ({ mode: e, children: t, className: a, "aria-label": n }) => /* @__PURE__ */ r.createElement(rt, {
|
|
426
426
|
value: e,
|
|
427
427
|
"aria-label": n
|
|
428
|
-
}, /* @__PURE__ */
|
|
428
|
+
}, /* @__PURE__ */ r.createElement(lt, {
|
|
429
429
|
"data-hook": `signature-mode-${e}`,
|
|
430
430
|
className: a
|
|
431
|
-
}, t)), Pt = (e) => /* @__PURE__ */
|
|
431
|
+
}, t)), Pt = (e) => /* @__PURE__ */ r.createElement(ue, {
|
|
432
432
|
...e,
|
|
433
433
|
mode: C.DRAW
|
|
434
|
-
}), Mt = (e) => /* @__PURE__ */
|
|
434
|
+
}), Mt = (e) => /* @__PURE__ */ r.createElement(ue, {
|
|
435
435
|
...e,
|
|
436
436
|
mode: C.TYPE
|
|
437
|
-
}), Ht = (e) => /* @__PURE__ */
|
|
437
|
+
}), Ht = (e) => /* @__PURE__ */ r.createElement(ue, {
|
|
438
438
|
...e,
|
|
439
439
|
mode: C.UPLOAD
|
|
440
440
|
}), Wt = ({ children: e, className: t, "aria-label": a, ...n }) => {
|
|
441
|
-
const { handleClear: o } = n, { disabled:
|
|
442
|
-
return /* @__PURE__ */
|
|
441
|
+
const { handleClear: o } = n, { disabled: s, target: l } = x(), { inputId: i } = W();
|
|
442
|
+
return /* @__PURE__ */ r.createElement(ye, {
|
|
443
443
|
onPress: o,
|
|
444
|
-
isDisabled:
|
|
444
|
+
isDisabled: s,
|
|
445
445
|
"aria-label": a,
|
|
446
446
|
"aria-controls": i,
|
|
447
447
|
"data-hook": `clear-${l}`,
|
|
448
448
|
className: t
|
|
449
449
|
}, e);
|
|
450
450
|
}, H = ({ children: e, className: t, ...a }) => {
|
|
451
|
-
const { signatureView: n, signatureValueForView: o, handleChange:
|
|
452
|
-
return /* @__PURE__ */
|
|
451
|
+
const { signatureView: n, signatureValueForView: o, handleChange: s, handleBeforeChange: l } = a, { disabled: i, readOnly: c, onBlur: u, onFocus: d, hasError: f } = x(), m = I(e, H.Canvas), L = I(e, H.Type), h = I(e, H.Upload);
|
|
452
|
+
return /* @__PURE__ */ r.createElement("div", {
|
|
453
453
|
className: t,
|
|
454
454
|
"data-hook": "signature-input",
|
|
455
455
|
"data-invalid": f,
|
|
@@ -457,7 +457,7 @@ const Ut = (e) => {
|
|
|
457
457
|
"data-readonly": c
|
|
458
458
|
}, n === R.DRAW && N(m, {
|
|
459
459
|
value: o,
|
|
460
|
-
onChange:
|
|
460
|
+
onChange: s,
|
|
461
461
|
onBeforeChange: l,
|
|
462
462
|
disabled: i,
|
|
463
463
|
readOnly: c,
|
|
@@ -465,7 +465,7 @@ const Ut = (e) => {
|
|
|
465
465
|
onFocus: d
|
|
466
466
|
}), n === R.TYPE && N(L, {
|
|
467
467
|
value: o,
|
|
468
|
-
onChange:
|
|
468
|
+
onChange: s,
|
|
469
469
|
onBeforeChange: l,
|
|
470
470
|
disabled: i,
|
|
471
471
|
readOnly: c,
|
|
@@ -473,15 +473,15 @@ const Ut = (e) => {
|
|
|
473
473
|
onFocus: d
|
|
474
474
|
}), (n === R.UPLOAD || n === R.IMAGE) && N(h, {
|
|
475
475
|
value: o,
|
|
476
|
-
onChange:
|
|
476
|
+
onChange: s,
|
|
477
477
|
onBeforeChange: l,
|
|
478
478
|
disabled: i,
|
|
479
479
|
readOnly: c,
|
|
480
480
|
onBlur: u,
|
|
481
481
|
onFocus: d
|
|
482
482
|
}));
|
|
483
|
-
},
|
|
484
|
-
const { value: o, onChange:
|
|
483
|
+
}, zt = ({ className: e, emptyLabel: t, signedLabel: a, ...n }) => {
|
|
484
|
+
const { value: o, onChange: s, onBeforeChange: l, disabled: i, readOnly: c, onBlur: u, onFocus: d } = n, { id: f } = x(), { inputId: m, ariaDescribedBy: L } = W(), h = ce(), p = V(), g = V(), E = V(null), S = o == null ? void 0 : o.url, [Y, P] = q(!1);
|
|
485
485
|
Ie(() => {
|
|
486
486
|
var y;
|
|
487
487
|
(y = g.current) == null || y.focus({
|
|
@@ -500,14 +500,14 @@ const Ut = (e) => {
|
|
|
500
500
|
return "";
|
|
501
501
|
const y = (U = p.current) == null ? void 0 : U.toData();
|
|
502
502
|
return y ? yt(y) : ((B = p.current) == null ? void 0 : B.toDataURL()) ?? "";
|
|
503
|
-
}, []),
|
|
503
|
+
}, []), $ = _(() => {
|
|
504
504
|
var w;
|
|
505
505
|
const y = (w = p.current) == null ? void 0 : w.isEmpty();
|
|
506
|
-
P(!y),
|
|
506
|
+
P(!y), s(ie(ee()));
|
|
507
507
|
}, [
|
|
508
508
|
ee,
|
|
509
|
-
|
|
510
|
-
]),
|
|
509
|
+
s
|
|
510
|
+
]), G = _(() => {
|
|
511
511
|
l == null || l();
|
|
512
512
|
}, [
|
|
513
513
|
l
|
|
@@ -518,30 +518,30 @@ const Ut = (e) => {
|
|
|
518
518
|
...v,
|
|
519
519
|
penColor: getComputedStyle(y).color || void 0
|
|
520
520
|
}), ge(g.current, p.current), S) {
|
|
521
|
-
const
|
|
522
|
-
|
|
521
|
+
const Z = ve(S);
|
|
522
|
+
Z && (p.current.fromData(Z), P(!0));
|
|
523
523
|
} else
|
|
524
524
|
p.current.clear(), P(!1);
|
|
525
|
-
p.current.addEventListener("beginStroke",
|
|
525
|
+
p.current.addEventListener("beginStroke", G), p.current.addEventListener("endStroke", $), typeof ResizeObserver < "u" && !E.current && (E.current = new ResizeObserver(() => {
|
|
526
526
|
g.current && ge(g.current, p == null ? void 0 : p.current);
|
|
527
527
|
})), (U = E.current) == null || U.observe(y);
|
|
528
528
|
} else
|
|
529
|
-
(B = E.current) == null || B.disconnect(), (D = p.current) == null || D.removeEventListener("endStroke",
|
|
529
|
+
(B = E.current) == null || B.disconnect(), (D = p.current) == null || D.removeEventListener("endStroke", $), (O = p.current) == null || O.removeEventListener("beginStroke", G);
|
|
530
530
|
}, [
|
|
531
531
|
v,
|
|
532
532
|
S,
|
|
533
|
-
|
|
534
|
-
|
|
533
|
+
G,
|
|
534
|
+
$
|
|
535
535
|
]);
|
|
536
536
|
return le(() => {
|
|
537
537
|
p.current && (c || i ? p.current.off() : p.current.on());
|
|
538
538
|
}, [
|
|
539
539
|
i,
|
|
540
540
|
c
|
|
541
|
-
]), /* @__PURE__ */
|
|
541
|
+
]), /* @__PURE__ */ r.createElement("div", {
|
|
542
542
|
className: e,
|
|
543
543
|
...h
|
|
544
|
-
}, /* @__PURE__ */
|
|
544
|
+
}, /* @__PURE__ */ r.createElement("canvas", {
|
|
545
545
|
ref: te,
|
|
546
546
|
id: m,
|
|
547
547
|
"data-hook": "signature-canvas",
|
|
@@ -550,11 +550,11 @@ const Ut = (e) => {
|
|
|
550
550
|
onFocus: d,
|
|
551
551
|
onBlur: u,
|
|
552
552
|
role: "img",
|
|
553
|
-
"aria-label":
|
|
553
|
+
"aria-label": Y ? a : t,
|
|
554
554
|
"aria-describedby": L
|
|
555
555
|
}));
|
|
556
556
|
}, de = ({ children: e, className: t, ...a }) => {
|
|
557
|
-
const { value: n, onChange: o, onBeforeChange:
|
|
557
|
+
const { value: n, onChange: o, onBeforeChange: s, disabled: l, readOnly: i, onBlur: c, onFocus: u } = a, { id: d, required: f, hasError: m } = x(), { inputId: L, ariaDescribedBy: h, labelId: p } = W(), g = ce(), E = n != null && n.url ? z(n.url) : void 0, { data: S = "" } = E ?? {
|
|
558
558
|
data: ""
|
|
559
559
|
};
|
|
560
560
|
Ie(() => {
|
|
@@ -571,19 +571,19 @@ const Ut = (e) => {
|
|
|
571
571
|
n,
|
|
572
572
|
L
|
|
573
573
|
]);
|
|
574
|
-
const
|
|
575
|
-
|
|
574
|
+
const Y = _((v) => {
|
|
575
|
+
s == null || s(), v.trim() ? o(ie(Se({
|
|
576
576
|
data: v,
|
|
577
577
|
mimeType: A.TEXT
|
|
578
578
|
}))) : o(null);
|
|
579
579
|
}, [
|
|
580
|
-
|
|
580
|
+
s,
|
|
581
581
|
o
|
|
582
582
|
]), P = I(e, de.Value);
|
|
583
|
-
return /* @__PURE__ */
|
|
583
|
+
return /* @__PURE__ */ r.createElement(nt, {
|
|
584
584
|
"aria-labelledby": p,
|
|
585
585
|
value: S,
|
|
586
|
-
onChange:
|
|
586
|
+
onChange: Y,
|
|
587
587
|
onBlur: c,
|
|
588
588
|
onFocus: u,
|
|
589
589
|
isDisabled: l,
|
|
@@ -591,16 +591,16 @@ const Ut = (e) => {
|
|
|
591
591
|
isRequired: f,
|
|
592
592
|
isInvalid: m,
|
|
593
593
|
validationBehavior: "aria"
|
|
594
|
-
}, /* @__PURE__ */
|
|
594
|
+
}, /* @__PURE__ */ r.createElement("div", {
|
|
595
595
|
className: t,
|
|
596
596
|
...g
|
|
597
597
|
}, N(P, {
|
|
598
598
|
inputId: L,
|
|
599
599
|
ariaDescribedBy: h
|
|
600
600
|
})));
|
|
601
|
-
},
|
|
601
|
+
}, Yt = ({ className: e, placeholder: t, ...a }) => {
|
|
602
602
|
const { inputId: n, ariaDescribedBy: o } = a;
|
|
603
|
-
return /* @__PURE__ */
|
|
603
|
+
return /* @__PURE__ */ r.createElement(ot, {
|
|
604
604
|
id: n,
|
|
605
605
|
"data-hook": "signature-text",
|
|
606
606
|
"aria-describedby": o,
|
|
@@ -608,7 +608,7 @@ const Ut = (e) => {
|
|
|
608
608
|
className: e
|
|
609
609
|
});
|
|
610
610
|
}, Q = ({ children: e, className: t, ...a }) => {
|
|
611
|
-
const { value: n, onChange: o, disabled:
|
|
611
|
+
const { value: n, onChange: o, disabled: s, readOnly: l, onBlur: i, onFocus: c } = a, { labelId: u, ariaDescribedBy: d } = W(), f = I(e, Q.Button), m = I(e, Q.Preview), L = _((p) => {
|
|
612
612
|
const g = p[0];
|
|
613
613
|
if (!g) {
|
|
614
614
|
o(null);
|
|
@@ -623,9 +623,9 @@ const Ut = (e) => {
|
|
|
623
623
|
]);
|
|
624
624
|
return n && Ut(n) ? N(m, {
|
|
625
625
|
value: n
|
|
626
|
-
}) ?? null : /* @__PURE__ */
|
|
626
|
+
}) ?? null : /* @__PURE__ */ r.createElement(at, {
|
|
627
627
|
className: t,
|
|
628
|
-
isDisabled:
|
|
628
|
+
isDisabled: s || l,
|
|
629
629
|
"aria-labelledby": u,
|
|
630
630
|
"aria-describedby": d,
|
|
631
631
|
"data-hook": "signature-upload-drop-zone",
|
|
@@ -643,40 +643,40 @@ const Ut = (e) => {
|
|
|
643
643
|
}
|
|
644
644
|
}, N(f, {
|
|
645
645
|
onSelectFiles: L,
|
|
646
|
-
disabled:
|
|
646
|
+
disabled: s,
|
|
647
647
|
readOnly: l,
|
|
648
648
|
onBlur: i,
|
|
649
649
|
onFocus: c
|
|
650
650
|
}));
|
|
651
|
-
},
|
|
652
|
-
const { value: n } = a, { inputId: o } = W(),
|
|
653
|
-
return /* @__PURE__ */
|
|
651
|
+
}, Gt = ({ className: e, imageAlt: t, ...a }) => {
|
|
652
|
+
const { value: n } = a, { inputId: o } = W(), s = ce();
|
|
653
|
+
return /* @__PURE__ */ r.createElement("div", {
|
|
654
654
|
className: e,
|
|
655
655
|
"data-has-value": !0,
|
|
656
|
-
...
|
|
657
|
-
}, n.url ? /* @__PURE__ */
|
|
656
|
+
...s
|
|
657
|
+
}, n.url ? /* @__PURE__ */ r.createElement("img", {
|
|
658
658
|
id: o,
|
|
659
659
|
src: n.url,
|
|
660
660
|
alt: n.displayName || t,
|
|
661
661
|
"data-hook": "signature-image"
|
|
662
|
-
}) : /* @__PURE__ */
|
|
662
|
+
}) : /* @__PURE__ */ r.createElement("span", {
|
|
663
663
|
id: o,
|
|
664
664
|
"data-hook": "signature-image"
|
|
665
665
|
}, n.displayName || t));
|
|
666
|
-
},
|
|
667
|
-
const { onSelectFiles: l, disabled: i, readOnly: c, onBlur: u, onFocus: d } =
|
|
666
|
+
}, se = ({ children: e, className: t, onHoverStart: a, onHoverEnd: n, onFocusChange: o, ...s }) => {
|
|
667
|
+
const { onSelectFiles: l, disabled: i, readOnly: c, onBlur: u, onFocus: d } = s, { inputId: f, ariaDescribedBy: m, labelId: L } = W(), h = pt(), g = !!I(e, se.Text) ? Fe.map(e, (E) => /* @__PURE__ */ Le(E) && E.type === se.Text ? N(E, {
|
|
668
668
|
textId: h
|
|
669
|
-
}) : E) : /* @__PURE__ */
|
|
669
|
+
}) : E) : /* @__PURE__ */ r.createElement("span", {
|
|
670
670
|
id: h
|
|
671
671
|
}, e);
|
|
672
|
-
return /* @__PURE__ */
|
|
672
|
+
return /* @__PURE__ */ r.createElement(st, {
|
|
673
673
|
acceptedFileTypes: [
|
|
674
674
|
"image/*"
|
|
675
675
|
],
|
|
676
676
|
onSelect: (E) => {
|
|
677
677
|
l(E ? Array.from(E) : []);
|
|
678
678
|
}
|
|
679
|
-
}, /* @__PURE__ */
|
|
679
|
+
}, /* @__PURE__ */ r.createElement(ye, {
|
|
680
680
|
id: f,
|
|
681
681
|
onBlur: u,
|
|
682
682
|
onFocus: d,
|
|
@@ -689,9 +689,9 @@ const Ut = (e) => {
|
|
|
689
689
|
onHoverEnd: n,
|
|
690
690
|
onFocusChange: o
|
|
691
691
|
}, g));
|
|
692
|
-
},
|
|
692
|
+
}, Zt = ({ children: e, className: t, ...a }) => {
|
|
693
693
|
const { textId: n } = a;
|
|
694
|
-
return /* @__PURE__ */
|
|
694
|
+
return /* @__PURE__ */ r.createElement("span", {
|
|
695
695
|
id: n,
|
|
696
696
|
className: t
|
|
697
697
|
}, e);
|
|
@@ -707,14 +707,14 @@ J.Clear = Wt;
|
|
|
707
707
|
M.Draw = Pt;
|
|
708
708
|
M.Type = Mt;
|
|
709
709
|
M.Upload = Ht;
|
|
710
|
-
H.Canvas =
|
|
710
|
+
H.Canvas = zt;
|
|
711
711
|
H.Type = de;
|
|
712
712
|
H.Upload = Q;
|
|
713
|
-
de.Value =
|
|
714
|
-
Q.Preview =
|
|
715
|
-
Q.Button =
|
|
716
|
-
|
|
717
|
-
const
|
|
713
|
+
de.Value = Yt;
|
|
714
|
+
Q.Preview = Gt;
|
|
715
|
+
Q.Button = se;
|
|
716
|
+
se.Text = Zt;
|
|
717
|
+
const kt = () => {
|
|
718
718
|
const { t: e } = He();
|
|
719
719
|
return {
|
|
720
720
|
drawLabel: e("field.signature.mode.draw.label"),
|
|
@@ -730,47 +730,47 @@ const Vt = () => {
|
|
|
730
730
|
imageAlt: e("field.signature.a11y.state.signed"),
|
|
731
731
|
uploadLabel: e("field.signature.settings.upload-button.label")
|
|
732
732
|
};
|
|
733
|
-
},
|
|
733
|
+
}, Vt = (e) => /* @__PURE__ */ r.createElement("svg", {
|
|
734
734
|
viewBox: "0 0 24 24",
|
|
735
735
|
width: 24,
|
|
736
736
|
height: 24,
|
|
737
737
|
fill: "currentColor",
|
|
738
738
|
"aria-hidden": "true",
|
|
739
739
|
...e
|
|
740
|
-
}, /* @__PURE__ */
|
|
740
|
+
}, /* @__PURE__ */ r.createElement("path", {
|
|
741
741
|
fillRule: "evenodd",
|
|
742
742
|
d: "M13.5,3 C14.327,3 15,3.673 15,4.5 L15,4.5 L15,5 L19,5 L19,6 L18,6 L18,17.5 C18,18.879 16.878,20 15.5,20 L15.5,20 L7.5,20 C6.122,20 5,18.879 5,17.5 L5,17.5 L5,6 L4,6 L4,5 L8,5 L8,4.5 C8,3.673 8.673,3 9.5,3 L9.5,3 Z M17,6 L6,6 L6,17.5 C6,18.327 6.673,19 7.5,19 L7.5,19 L15.5,19 C16.327,19 17,18.327 17,17.5 L17,17.5 L17,6 Z M10,9 L10,16 L9,16 L9,9 L10,9 Z M14,9 L14,16 L13,16 L13,9 L14,9 Z M13.5,4 L9.5,4 C9.224,4 9,4.225 9,4.5 L9,4.5 L9,5 L14,5 L14,4.5 C14,4.225 13.776,4 13.5,4 L13.5,4 Z"
|
|
743
|
-
})),
|
|
743
|
+
})), $t = (e) => /* @__PURE__ */ r.createElement("svg", {
|
|
744
744
|
viewBox: "0 0 24 24",
|
|
745
745
|
width: 24,
|
|
746
746
|
height: 24,
|
|
747
747
|
fill: "currentColor",
|
|
748
748
|
"aria-hidden": "true",
|
|
749
749
|
...e
|
|
750
|
-
}, /* @__PURE__ */
|
|
750
|
+
}, /* @__PURE__ */ r.createElement("path", {
|
|
751
751
|
fillRule: "evenodd",
|
|
752
752
|
d: "M4.9937,15.9971 L4.9937,18.4971 C4.9937,18.7721 5.2177,18.9971 5.4937,18.9971 L5.4937,18.9971 L17.4937,18.9971 C17.7697,18.9971 17.9937,18.7721 17.9937,18.4971 L17.9937,18.4971 L17.9937,15.9971 L18.9937,15.9971 L18.9937,18.4971 C18.9937,19.3241 18.3207,19.9971 17.4937,19.9971 L17.4937,19.9971 L5.4937,19.9971 C4.6657,19.9971 3.9937,19.3241 3.9937,18.4971 L3.9937,18.4971 L3.9937,15.9971 L4.9937,15.9971 Z M11.9933,4 L11.9933,14.078 L15.0293,11.043 L15.7363,11.75 L11.4933,15.992 L7.2513,11.75 L7.9583,11.043 L10.9933,14.078 L10.9933,4 L11.9933,4 Z"
|
|
753
|
-
})), Xt = (e) => /* @__PURE__ */
|
|
753
|
+
})), Xt = (e) => /* @__PURE__ */ r.createElement("svg", {
|
|
754
754
|
viewBox: "0 0 24 24",
|
|
755
755
|
width: 24,
|
|
756
756
|
height: 24,
|
|
757
757
|
fill: "currentColor",
|
|
758
758
|
"aria-hidden": "true",
|
|
759
759
|
...e
|
|
760
|
-
}, /* @__PURE__ */
|
|
760
|
+
}, /* @__PURE__ */ r.createElement("path", {
|
|
761
761
|
fillRule: "evenodd",
|
|
762
762
|
d: "M18.8525,7.543 L17.7515,8.644 L15.3565,6.248 L16.4575,5.147 C16.5555,5.05 16.6835,5.001 16.8105,5.001 C16.9385,5.001 17.0665,5.05 17.1645,5.147 L18.8525,6.835 C19.0475,7.03 19.0475,7.348 18.8525,7.543 L18.8525,7.543 Z M8.1895,18.206 C8.1185,18.276 8.0275,18.324 7.9295,18.344 L5.1275,18.873 L5.6575,16.07 C5.6755,15.972 5.7225,15.882 5.7945,15.811 L14.6495,6.955 L17.0445,9.351 L8.1895,18.206 Z M19.5595,6.128 L17.8715,4.44 C17.2865,3.856 16.3355,3.856 15.7505,4.44 L5.0875,15.103 C4.8735,15.317 4.7295,15.588 4.6745,15.886 L4.0085,19.407 C3.9775,19.569 4.0295,19.736 4.1465,19.854 C4.2415,19.948 4.3685,20 4.4995,20 C4.5305,20 4.5615,19.997 4.5925,19.991 L8.1165,19.326 C8.4145,19.269 8.6855,19.125 8.8965,18.912 L19.5595,8.25 C20.1445,7.665 20.1445,6.713 19.5595,6.128 L19.5595,6.128 Z"
|
|
763
|
-
})), qt = (e) => /* @__PURE__ */
|
|
763
|
+
})), qt = (e) => /* @__PURE__ */ r.createElement("svg", {
|
|
764
764
|
viewBox: "0 0 20 20",
|
|
765
765
|
width: 24,
|
|
766
766
|
height: 24,
|
|
767
767
|
fill: "currentColor",
|
|
768
768
|
"aria-hidden": "true",
|
|
769
769
|
...e
|
|
770
|
-
}, /* @__PURE__ */
|
|
770
|
+
}, /* @__PURE__ */ r.createElement("path", {
|
|
771
771
|
fillRule: "evenodd",
|
|
772
772
|
d: "M12,4 L12,5 L8,5 L8,16 L7,16 L7,5 L3,5 L3,4 L12,4 Z M18,8 L18,9 L15,9 L15,16 L14,16 L14,9 L11,9 L11,8 L18,8 Z"
|
|
773
|
-
})), jt = "
|
|
773
|
+
})), jt = "_container_63unz_1", Kt = "_header_63unz_7", Jt = "_tabs_63unz_13", Qt = "_tab_63unz_13", en = "_tabHover_63unz_43", tn = "_tabSelected_63unz_48", nn = "_tabIcon_63unz_78", an = "_uploadButton_63unz_85", on = "_uploadButtonHover_63unz_138", sn = "_uploadButtonLabel_63unz_155", rn = "_clear_63unz_159", ln = "_value_63unz_191", cn = "_box_63unz_196", un = "_uploadBox_63unz_197", dn = "_dropZone_63unz_228", mn = "_dropZoneHover_63unz_243", pn = "_boxHover_63unz_280", fn = "_typeInput_63unz_335", T = {
|
|
774
774
|
container: jt,
|
|
775
775
|
header: Kt,
|
|
776
776
|
tabs: Jt,
|
|
@@ -780,8 +780,8 @@ const Vt = () => {
|
|
|
780
780
|
tabIcon: nn,
|
|
781
781
|
uploadButton: an,
|
|
782
782
|
uploadButtonHover: on,
|
|
783
|
-
uploadButtonLabel:
|
|
784
|
-
clear:
|
|
783
|
+
uploadButtonLabel: sn,
|
|
784
|
+
clear: rn,
|
|
785
785
|
value: ln,
|
|
786
786
|
box: cn,
|
|
787
787
|
uploadBox: un,
|
|
@@ -789,25 +789,25 @@ const Vt = () => {
|
|
|
789
789
|
dropZoneHover: mn,
|
|
790
790
|
boxHover: pn,
|
|
791
791
|
typeInput: fn
|
|
792
|
-
}, En = ({ content: e, locale: t }) => /* @__PURE__ */
|
|
792
|
+
}, En = ({ content: e, locale: t }) => /* @__PURE__ */ r.createElement(xe, {
|
|
793
793
|
content: e,
|
|
794
794
|
locale: t
|
|
795
795
|
}), gn = () => {
|
|
796
|
-
var
|
|
797
|
-
const e =
|
|
796
|
+
var G, te, y, w, U, B;
|
|
797
|
+
const e = kt(), { disabled: t, readOnly: a } = x(), n = !t && !a, o = X({
|
|
798
798
|
globalClasses: Ke,
|
|
799
799
|
moduleClasses: {
|
|
800
800
|
base: T.tab,
|
|
801
801
|
hover: T.tabHover,
|
|
802
802
|
selected: T.tabSelected
|
|
803
803
|
}
|
|
804
|
-
}),
|
|
804
|
+
}), s = ({ isSelected: D, isHovered: O, isFocused: Z }) => o({
|
|
805
805
|
isSelected: D,
|
|
806
806
|
isHovered: O,
|
|
807
|
-
isFocused:
|
|
807
|
+
isFocused: Z,
|
|
808
808
|
isInteractive: n
|
|
809
809
|
}), i = X({
|
|
810
|
-
globalClasses:
|
|
810
|
+
globalClasses: $e,
|
|
811
811
|
moduleClasses: {
|
|
812
812
|
base: T.box,
|
|
813
813
|
hover: T.boxHover
|
|
@@ -838,66 +838,66 @@ const Vt = () => {
|
|
|
838
838
|
base: T.uploadButton,
|
|
839
839
|
hover: T.uploadButtonHover
|
|
840
840
|
}
|
|
841
|
-
}), m = (B = (U = (w = (y = (te = (
|
|
841
|
+
}), m = (B = (U = (w = (y = (te = (G = Te().signature) == null ? void 0 : G.elementProps) == null ? void 0 : te.dropZone) == null ? void 0 : y.elementProps) == null ? void 0 : w.uploadButton) == null ? void 0 : U.elementProps) == null ? void 0 : B.icon, { wix: L, className: h, ...p } = m ?? {}, g = We(ne.SIGNATURE, ne.SIGNATURE_DROP_ZONE, ne.SIGNATURE_UPLOAD_BUTTON, ne.UPLOAD_BUTTON_LABEL), E = V(null), [S, Y] = q(!1), [P, v] = q(!1), ee = _(() => {
|
|
842
842
|
var D;
|
|
843
|
-
|
|
844
|
-
}, []),
|
|
843
|
+
Y(!0), (D = E.current) == null || D.runAnimationForward();
|
|
844
|
+
}, []), $ = _(() => {
|
|
845
845
|
var D;
|
|
846
|
-
|
|
846
|
+
Y(!1), (D = E.current) == null || D.runAnimationBackward();
|
|
847
847
|
}, []);
|
|
848
|
-
return /* @__PURE__ */
|
|
849
|
-
className: F(
|
|
850
|
-
}, /* @__PURE__ */
|
|
851
|
-
className: F(
|
|
852
|
-
})), /* @__PURE__ */
|
|
853
|
-
className: F(
|
|
854
|
-
}, /* @__PURE__ */
|
|
848
|
+
return /* @__PURE__ */ r.createElement(b, null, /* @__PURE__ */ r.createElement(b.Label, {
|
|
849
|
+
className: F(ze, ae.label)
|
|
850
|
+
}, /* @__PURE__ */ r.createElement(b.Label.Required, {
|
|
851
|
+
className: F(Ye, ae.requiredMark)
|
|
852
|
+
})), /* @__PURE__ */ r.createElement(b.Input, {
|
|
853
|
+
className: F(Ge, T.container)
|
|
854
|
+
}, /* @__PURE__ */ r.createElement(b.Input.Header, {
|
|
855
855
|
className: T.header
|
|
856
|
-
}, /* @__PURE__ */
|
|
856
|
+
}, /* @__PURE__ */ r.createElement(b.Input.Header.Tabs, {
|
|
857
857
|
className: T.tabs
|
|
858
|
-
}, /* @__PURE__ */
|
|
859
|
-
className:
|
|
858
|
+
}, /* @__PURE__ */ r.createElement(b.Input.Header.Tabs.Draw, {
|
|
859
|
+
className: s,
|
|
860
860
|
"aria-label": e.drawLabel,
|
|
861
861
|
description: e.drawDescription
|
|
862
|
-
}, /* @__PURE__ */
|
|
862
|
+
}, /* @__PURE__ */ r.createElement(Xt, {
|
|
863
863
|
className: T.tabIcon
|
|
864
|
-
})), /* @__PURE__ */
|
|
865
|
-
className:
|
|
864
|
+
})), /* @__PURE__ */ r.createElement(b.Input.Header.Tabs.Type, {
|
|
865
|
+
className: s,
|
|
866
866
|
"aria-label": e.typeLabel,
|
|
867
867
|
description: e.typeDescription
|
|
868
|
-
}, /* @__PURE__ */
|
|
868
|
+
}, /* @__PURE__ */ r.createElement(qt, {
|
|
869
869
|
className: T.tabIcon
|
|
870
|
-
})), /* @__PURE__ */
|
|
871
|
-
className:
|
|
870
|
+
})), /* @__PURE__ */ r.createElement(b.Input.Header.Tabs.Upload, {
|
|
871
|
+
className: s,
|
|
872
872
|
"aria-label": e.uploadModeLabel,
|
|
873
873
|
description: e.uploadDescription
|
|
874
|
-
}, /* @__PURE__ */
|
|
874
|
+
}, /* @__PURE__ */ r.createElement($t, {
|
|
875
875
|
className: T.tabIcon
|
|
876
|
-
}))), /* @__PURE__ */
|
|
876
|
+
}))), /* @__PURE__ */ r.createElement(b.Input.Header.Clear, {
|
|
877
877
|
className: F(pe, T.clear),
|
|
878
878
|
"aria-label": e.clearLabel
|
|
879
|
-
}, /* @__PURE__ */
|
|
879
|
+
}, /* @__PURE__ */ r.createElement(Vt, null))), /* @__PURE__ */ r.createElement(b.Input.Value, {
|
|
880
880
|
className: T.value
|
|
881
|
-
}, /* @__PURE__ */
|
|
881
|
+
}, /* @__PURE__ */ r.createElement(b.Input.Value.Canvas, {
|
|
882
882
|
className: i,
|
|
883
883
|
emptyLabel: e.emptyLabel,
|
|
884
884
|
signedLabel: e.signedLabel
|
|
885
|
-
}), /* @__PURE__ */
|
|
885
|
+
}), /* @__PURE__ */ r.createElement(b.Input.Value.Type, {
|
|
886
886
|
className: u
|
|
887
|
-
}, /* @__PURE__ */
|
|
887
|
+
}, /* @__PURE__ */ r.createElement(b.Input.Value.Type.Value, {
|
|
888
888
|
className: T.typeInput,
|
|
889
889
|
placeholder: e.placeholder
|
|
890
|
-
})), /* @__PURE__ */
|
|
891
|
-
className: ({ isHovered: D, isFocused: O, isDropTarget:
|
|
890
|
+
})), /* @__PURE__ */ r.createElement(b.Input.Value.Upload, {
|
|
891
|
+
className: ({ isHovered: D, isFocused: O, isDropTarget: Z }) => F(T.uploadBox, d({
|
|
892
892
|
isSelected: !1,
|
|
893
|
-
isHovered: D ||
|
|
893
|
+
isHovered: D || Z,
|
|
894
894
|
isFocused: O,
|
|
895
895
|
isInteractive: n
|
|
896
896
|
}))
|
|
897
|
-
}, /* @__PURE__ */
|
|
897
|
+
}, /* @__PURE__ */ r.createElement(b.Input.Value.Upload.Preview, {
|
|
898
898
|
className: F(T.uploadBox, i),
|
|
899
899
|
imageAlt: e.imageAlt
|
|
900
|
-
}), /* @__PURE__ */
|
|
900
|
+
}), /* @__PURE__ */ r.createElement(b.Input.Value.Upload.Button, {
|
|
901
901
|
className: ({ isHovered: D, isFocused: O }) => f({
|
|
902
902
|
isSelected: !1,
|
|
903
903
|
isHovered: D,
|
|
@@ -905,22 +905,22 @@ const Vt = () => {
|
|
|
905
905
|
isInteractive: n
|
|
906
906
|
}),
|
|
907
907
|
onHoverStart: ee,
|
|
908
|
-
onHoverEnd:
|
|
908
|
+
onHoverEnd: $,
|
|
909
909
|
onFocusChange: v
|
|
910
|
-
}, p.svg ? /* @__PURE__ */
|
|
910
|
+
}, p.svg ? /* @__PURE__ */ r.createElement(we, {
|
|
911
911
|
...p,
|
|
912
912
|
ref: E,
|
|
913
|
-
className: F(
|
|
914
|
-
}) : null, /* @__PURE__ */
|
|
913
|
+
className: F(Ze, ke, h)
|
|
914
|
+
}) : null, /* @__PURE__ */ r.createElement(b.Input.Value.Upload.Button.Text, {
|
|
915
915
|
className: F(fe.base, T.uploadButtonLabel, g, {
|
|
916
916
|
[fe.hover]: n && (S || P)
|
|
917
917
|
})
|
|
918
|
-
}, e.uploadLabel))))), /* @__PURE__ */
|
|
919
|
-
className: F(
|
|
920
|
-
}, /* @__PURE__ */
|
|
918
|
+
}, e.uploadLabel))))), /* @__PURE__ */ r.createElement(b.Error, {
|
|
919
|
+
className: F(Ve, ae.error)
|
|
920
|
+
}, /* @__PURE__ */ r.createElement(mt, null), /* @__PURE__ */ r.createElement(b.Error.Text, null)), /* @__PURE__ */ r.createElement(b.Description, {
|
|
921
921
|
className: F(pe, ae.description)
|
|
922
922
|
}, En));
|
|
923
|
-
}, wn = () => /* @__PURE__ */
|
|
923
|
+
}, wn = () => /* @__PURE__ */ r.createElement(gn, null);
|
|
924
924
|
export {
|
|
925
925
|
wn as SignatureRAC
|
|
926
926
|
};
|