@wix/form-elements 1.134.0 → 1.136.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-DsD7xLmb.js +1010 -0
- package/dist/component/{bookings-address-rac-F39MfGmX.js → bookings-address-rac-ByaFu51U.js} +1 -1
- package/dist/component/{bookings-email-rac-D4CurQjr.js → bookings-email-rac-CxuvkcYw.js} +1 -1
- package/dist/component/{bookings-first-name-rac-Bz9o1eLl.js → bookings-first-name-rac-JXLJa_7E.js} +1 -1
- package/dist/component/{bookings-header-rac-6mfX0WGf.js → bookings-header-rac-CIQTbf9d.js} +1 -1
- package/dist/component/{bookings-last-name-rac-CD1-B7Ao.js → bookings-last-name-rac-_2Xt4BPe.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-2eQkfhBb.js → bookings-login-bar-rac-BUjys5i9.js} +6 -6
- package/dist/component/{bookings-phone-rac-X6sSnHiH.js → bookings-phone-rac-DlsdGmOt.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-f2artJnn.js → bookings-rich-text-rac-BvRdhL7M.js} +1 -1
- package/dist/component/{checkbox-field-rac-DoZ9bcw3.js → checkbox-field-rac-Be6wicaA.js} +121 -121
- package/dist/component/{checkbox-group-field-headless-B-d37T4z.js → checkbox-group-field-headless-BJ0pGvXi.js} +19 -19
- package/dist/component/{checkbox-group-field-rac-0qYHz3g1.js → checkbox-group-field-rac-D7xqqVf6.js} +4 -4
- package/dist/component/{checkbox-group-rac-BqUJdAju.js → checkbox-group-rac-DtCS-gEH.js} +1 -1
- package/dist/component/{checkbox-rac-BN-qNzpH.js → checkbox-rac-ub7MFwY-.js} +1 -1
- package/dist/component/{contacts-address-rac-B7vWOTFf.js → contacts-address-rac-Bwsdpg11.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-Dl0OatzW.js → contacts-birthdate-rac-D54hibhb.js} +1 -1
- package/dist/component/{contacts-company-rac-DIeGU0Bf.js → contacts-company-rac-CKqzgKio.js} +1 -1
- package/dist/component/{contacts-email-rac-BCH6ogWv.js → contacts-email-rac-Dxm31wuY.js} +1 -1
- package/dist/component/{contacts-first-name-rac-Cx-USWmx.js → contacts-first-name-rac-CXHsx6Vy.js} +1 -1
- package/dist/component/{contacts-last-name-rac-CUZdJI9J.js → contacts-last-name-rac-B0S268f3.js} +1 -1
- package/dist/component/{contacts-phone-rac-hNCW_2UC.js → contacts-phone-rac-DEbgIiEj.js} +1 -1
- package/dist/component/{contacts-position-rac-CJfOgxZc.js → contacts-position-rac-D31uoOlR.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-69721_c9.js → contacts-subscribe-rac-DJ8NtoxZ.js} +1 -1
- package/dist/component/{contacts-tax-id-rac-CXXBqWIm.js → contacts-tax-id-rac-DTQffHAo.js} +1 -1
- package/dist/component/{date-availability-NQGPIrdZ.js → date-availability-DmhJ9apH.js} +1 -1
- package/dist/component/{date-input-field-rac-C-we-suG.js → date-input-field-rac-BwM_q4FW.js} +52 -52
- package/dist/component/{date-input-rac-Cif7Bqxc.js → date-input-rac-C93pgocp.js} +1 -1
- package/dist/component/{date-picker-field-rac-CHDkTXVH.js → date-picker-field-rac-CtZL368W.js} +5 -5
- package/dist/component/{date-picker-rac-DdhgbY6W.js → date-picker-rac-4DNe6hOX.js} +1 -1
- package/dist/component/{date-time-input-field-rac-BjtDbiqE.js → date-time-input-field-rac-MlCVy3Oz.js} +58 -58
- package/dist/component/{date-time-input-rac-BDP5SN-i.js → date-time-input-rac-ByyBvFgo.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-CkF41kIR.js → dext-checkbox-group-rac-BP76Xwiq.js} +4 -4
- package/dist/component/{dext-checkbox-rac-DjYpsxmq.js → dext-checkbox-rac-DGaKSh4Z.js} +1 -1
- package/dist/component/{dext-date-picker-rac-BxXZLogr.js → dext-date-picker-rac-UEXbMSlL.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-e4y_JjEx.js → dext-date-time-input-rac-CsJcGK4I.js} +1 -1
- package/dist/component/{dext-dropdown-rac-DsjB3ZX7.js → dext-dropdown-rac-BzbRzloh.js} +1 -1
- package/dist/component/{dext-email-rac-ClPp1g4D.js → dext-email-rac-DufFAnTi.js} +1 -1
- package/dist/component/{dext-number-input-rac-D2nZNzyN.js → dext-number-input-rac-D6xXi7B2.js} +1 -1
- package/dist/component/{dext-phone-rac-PNiQZ-Lr.js → dext-phone-rac-svy9CDHW.js} +1 -1
- package/dist/component/{dext-radio-group-rac-DUltmMHM.js → dext-radio-group-rac-C4p9NuQS.js} +4 -4
- package/dist/component/{dext-rating-input-rac-C_apsfGT.js → dext-rating-input-rac-wJ7-RFFN.js} +1 -1
- package/dist/component/{dext-tags-rac-DkB_CmOD.js → dext-tags-rac-D2myHrSZ.js} +4 -4
- package/dist/component/{dext-text-area-rac-CfoIK0S7.js → dext-text-area-rac-B4Fw_9mF.js} +1 -1
- package/dist/component/{dext-text-input-rac-CIOXlk6U.js → dext-text-input-rac-DlZanFMT.js} +1 -1
- package/dist/component/{dext-url-input-rac-UHJAs3ck.js → dext-url-input-rac-DYjl3wuk.js} +1 -1
- package/dist/component/{donation-rac-BJfvVi_d.js → donation-rac-B6LwJxik.js} +72 -72
- package/dist/component/{dropdown-field-headless-0DB-T-3t.js → dropdown-field-headless-BAt2RoAH.js} +8 -8
- package/dist/component/{dropdown-field-rac-DB-pd2a8.js → dropdown-field-rac-DFjn3ecV.js} +7 -7
- package/dist/component/{dropdown-rac-4T4zRBVy.js → dropdown-rac-DQ6keNRI.js} +1 -1
- package/dist/component/{ecom-address-rac-BjWD1sRX.js → ecom-address-rac-j1T2zp0k.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-CYCufut6.js → ecom-subscription-checkbox-rac-viTaRZsk.js} +2 -2
- package/dist/component/{email-input-field-rac-DlLoY9jB.js → email-input-field-rac-5eb-1w7B.js} +46 -46
- package/dist/component/{events-repeater-rac-CPHJbWcZ.js → events-repeater-rac-BtcoN_Ra.js} +23 -23
- package/dist/component/{events-rsvp-rac-NXf8Fv3A.js → events-rsvp-rac-DSzFEmty.js} +10 -10
- package/dist/component/{field-error-headless-C-wyL0uw.js → field-error-headless-Bpe041x2.js} +6 -6
- package/dist/component/{field-label-headless-32mvEUId.js → field-label-headless-BUuK1Ftv.js} +7 -7
- package/dist/component/{file-upload-rac-BicD_Bhj.js → file-upload-rac-CfU8Ygwq.js} +50 -50
- package/dist/component/{fixed-payment-rac-DxHalHUv.js → fixed-payment-rac-CYp7zNq8.js} +12 -12
- package/dist/component/{form-B2wZnWX9.js → form-C6lnbh2O.js} +1948 -1896
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +1 -1
- package/dist/component/{header-field-rac-C47Te_oW.js → header-field-rac-B7YfrhId.js} +4 -4
- package/dist/component/{header-rac-ChDYKTx5.js → header-rac-BtJKAKAz.js} +1 -1
- package/dist/component/{image-choice-rac-CqTBWpcY.js → image-choice-rac-Bmq7Pyg6.js} +32 -32
- package/dist/component/{index-BF_Aifc-.js → index-BjPSeVyh.js} +107 -107
- package/dist/component/{index-Br8x_xx8.js → index-CQdUOkIN.js} +5 -5
- package/dist/component/{isObjectLike-D4VXbd0T.js → isObjectLike-CxNqKfU5.js} +7 -7
- package/dist/component/{multiline-address-field-rac-DYcfzGJb.js → multiline-address-field-rac-BeiUJWKd.js} +115 -115
- package/dist/component/{multiline-address-rac-DcGDGyL-.js → multiline-address-rac-B2mocF6M.js} +1 -1
- package/dist/component/{number-input-field-rac-C_Fh8oeD.js → number-input-field-rac-CQX7_S2O.js} +24 -24
- package/dist/component/{number-input-rac-J2tCaAYx.js → number-input-rac-BZri-E8P.js} +1 -1
- package/dist/component/{password-rac-wlfBhft8.js → password-rac-CdwrtDJU.js} +50 -50
- package/dist/component/{payment-input-rac-DKxy3uE0.js → payment-input-rac-ClQiqmjm.js} +38 -38
- package/dist/component/{phone-input-field-rac-ClXUOLpB.js → phone-input-field-rac-BtG_Rado.js} +56 -56
- package/dist/component/{phone-rac-D0-Poz1e.js → phone-rac-CdcAMa5E.js} +1 -1
- package/dist/component/{product-list-rac-TF5fgLyc.js → product-list-rac-Dp_YK6mo.js} +61 -61
- package/dist/component/{quiz-radio-group-rac-BX4V_6wg.js → quiz-radio-group-rac-CorojxKD.js} +1 -1
- package/dist/component/{radio-button-module-classes-D8UpzVUK.js → radio-button-module-classes-ZX12Fyj4.js} +3 -3
- package/dist/component/{radio-group-field-rac-C0zCVtjj.js → radio-group-field-rac-BifCDpE4.js} +10 -10
- package/dist/component/{radio-group-rac-DrKqgPRT.js → radio-group-rac-CJ2fzqnY.js} +1 -1
- package/dist/component/{rating-input-field-rac-DjxfTgv5.js → rating-input-field-rac-Dg1T0DZW.js} +28 -28
- package/dist/component/{rating-input-rac-DO4Bpdj3.js → rating-input-rac-Ba4YK13i.js} +1 -1
- package/dist/component/{rich-content-rac.module-DUNKiTkT.js → rich-content-rac.module-BehwBL3L.js} +3 -3
- package/dist/component/{rich-text-field-rac-DIOTzVwj.js → rich-text-field-rac-DtIWdB-S.js} +7 -7
- package/dist/component/{rich-text-rac-C_E_vEGz.js → rich-text-rac-BX4eDDFw.js} +1 -1
- package/dist/component/service-dropdown-rac-68WLBlsa.js +146 -0
- package/dist/component/{services-multi-choice-rac-D40hZhBB.js → services-multi-choice-rac-8yNdAHfS.js} +7 -7
- package/dist/component/{signature-rac-CKXpb2WN.js → signature-rac-DeVOyl5O.js} +73 -73
- package/dist/component/{submit-button-rac-CDS-vtXq.js → submit-button-rac-IOr1g-G-.js} +12 -12
- package/dist/component/{tags-field-rac-CdQWq8k5.js → tags-field-rac-DaiMlAxt.js} +27 -27
- package/dist/component/{tags-rac-BwChqdGx.js → tags-rac-BgrUkY0A.js} +1 -1
- package/dist/component/{text-area-field-rac-VCFJuHx4.js → text-area-field-rac-CLPZEY93.js} +16 -16
- package/dist/component/{text-area-rac-BICVNsdn.js → text-area-rac-C8PdPSzX.js} +1 -1
- package/dist/component/{text-input-field-rac-C9gyRhcK.js → text-input-field-rac-Dm-xU8Rg.js} +5 -5
- package/dist/component/{text-input-headless-BdkaD-re.js → text-input-headless-BEmRjL8Z.js} +6 -6
- package/dist/component/{text-input-rac-B7buOGbq.js → text-input-rac-C-FnaOXT.js} +1 -1
- package/dist/component/{time-input-rac-CSFhEYi0.js → time-input-rac-VmTURkiK.js} +46 -46
- package/dist/component/{url-input-field-rac-BIXokgHy.js → url-input-field-rac-CnnS0tVx.js} +23 -23
- package/dist/component/{url-input-rac-tTN0GaTH.js → url-input-rac-6nd_ccoP.js} +1 -1
- package/dist/component/{use-dropdown-option-class-name-C6zB6TNA.js → use-dropdown-option-class-name-CcZl1qrj.js} +2 -2
- package/dist/component/{use-dropdown-trigger-class-name-CEq68SuK.js → use-dropdown-trigger-class-name-BNc0mkdK.js} +4 -4
- package/dist/component/{use-element-state-class-name-BFZzVwqe.js → use-element-state-class-name-BU6RXqBy.js} +1 -1
- package/dist/component/{use-hoverable-input-class-name-CzZmczhf.js → use-hoverable-input-class-name-CkXPkbiP.js} +2 -2
- package/dist/component/{use-service-options-base-DOCVW9ax.js → use-service-options-base-B5afDbnr.js} +4 -4
- package/dist/component/use-text-input-class-name-BB3V6Q0b.js +6 -0
- package/package.json +2 -2
- package/dist/component/appointment-rac-CZHb5jGz.js +0 -1010
- package/dist/component/service-dropdown-rac-B3gQT9Tj.js +0 -146
- package/dist/component/use-text-input-class-name-BNX3qkmh.js +0 -6
|
@@ -2,23 +2,23 @@ import s, { useRef as $, useContext as Ae, useMemo as be, useCallback as _, useS
|
|
|
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 {
|
|
5
|
+
import { aN as Ue, bd as Te, ap as Be, F as Oe, bf as Pe, bb as Me, br as ye, E as me, af as oe, bj as x, bg as W, bl as Ce, bt as He, bc as We, M as Ye, Y as Ze, _ as ke, u as pe, b as Ge, a3 as Ve, a4 as fe, G as $e, Z as ze, a1 as Xe, $ as qe, a2 as je, f as ne, a0 as Je } from "./form-C6lnbh2O.js";
|
|
6
6
|
import { useHover as Ke, useFocusRing as Qe, mergeProps as et } from "react-aria";
|
|
7
7
|
import { RadioGroup as tt, Button as Ie, TextField as nt, DropZone as at, Input as ot, FileTrigger as rt, RadioField as st, RadioButton as lt } from "react-aria-components";
|
|
8
8
|
import _e from "signature_pad";
|
|
9
9
|
import { f as C, a as A } 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-Bpe041x2.js";
|
|
11
|
+
import { L as ut } from "./field-label-headless-BUuK1Ftv.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-DfEb7pBp.js";
|
|
15
|
-
import { u as X } from "./use-element-state-class-name-
|
|
16
|
-
const pt = typeof s.useId == "function" ? s.useId : () => $(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)),
|
|
15
|
+
import { u as X } from "./use-element-state-class-name-BU6RXqBy.js";
|
|
16
|
+
const pt = typeof s.useId == "function" ? s.useId : () => $(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().signatureContainer) == null ? void 0 : o.signatureMode, a = Ae(Be);
|
|
19
19
|
return be(() => {
|
|
20
20
|
var r;
|
|
21
|
-
return a && !a.parentId && t ? (r = a.fields.filter((l) => Et(l, t)).sort(
|
|
21
|
+
return a && !a.parentId && t ? (r = a.fields.filter((l) => Et(l, t)).sort(gt)[0]) == null ? void 0 : r.id : void 0;
|
|
22
22
|
}, [
|
|
23
23
|
a,
|
|
24
24
|
t
|
|
@@ -77,11 +77,11 @@ function se(e, t) {
|
|
|
77
77
|
for (m = 0; m < o; m++)
|
|
78
78
|
for (f = 0; f < n; f++)
|
|
79
79
|
l(f, m) || (i > f && (i = f), c < f && (c = f), u > m && (u = m), d < m && (d = m));
|
|
80
|
-
const L = c - i,
|
|
81
|
-
if (L < 0 ||
|
|
80
|
+
const L = c - i, h = d - u;
|
|
81
|
+
if (L < 0 || h < 0)
|
|
82
82
|
return null;
|
|
83
|
-
const p = a.getImageData(i, u, L,
|
|
84
|
-
return
|
|
83
|
+
const p = a.getImageData(i, u, L, h), g = document.createElement("canvas"), E = g.getContext("2d");
|
|
84
|
+
return g.width = L, g.height = h, t ? (E.fillStyle = t, E.fillRect(0, 0, L, h)) : E.clearRect(0, 0, L, h), E.putImageData(p, 0, 0), g;
|
|
85
85
|
}
|
|
86
86
|
function j(e, t, a) {
|
|
87
87
|
const n = document.createElement("canvas");
|
|
@@ -108,11 +108,11 @@ function Ee(e, t, a, n) {
|
|
|
108
108
|
const o = e.width, r = e.height, l = 1, i = a / r, c = Math.min(i, l), u = o * c, d = r * c, f = j(u, d), m = f.getContext("2d");
|
|
109
109
|
return n && m && (m.fillStyle = n, m.fillRect(0, 0, u, d)), m == null || m.drawImage(e, 0, 0, o, r, 0, 0, u, d), f;
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function ge(e, t) {
|
|
112
112
|
const a = e.getContext("2d"), n = e.offsetWidth, o = e.offsetHeight, r = Math.max(window.devicePixelRatio || 1, 1), l = n * r, i = o * r;
|
|
113
113
|
return (e.width !== l || e.height !== i) && a ? (e.width = l, e.height = i, a.scale(r, r), t == null || t.redraw(), !0) : !1;
|
|
114
114
|
}
|
|
115
|
-
const
|
|
115
|
+
const V = 480, It = (e) => Re({
|
|
116
116
|
data: JSON.stringify(e),
|
|
117
117
|
mimeType: N.POINTS
|
|
118
118
|
}), ve = (e) => {
|
|
@@ -124,7 +124,7 @@ const G = 480, It = (e) => Re({
|
|
|
124
124
|
return null;
|
|
125
125
|
}
|
|
126
126
|
return null;
|
|
127
|
-
},
|
|
127
|
+
}, he = 0.8, De = "Madefor";
|
|
128
128
|
function Ne(e, t) {
|
|
129
129
|
const { width: a, actualBoundingBoxAscent: n, actualBoundingBoxDescent: o } = t.measureText(e);
|
|
130
130
|
return {
|
|
@@ -134,7 +134,7 @@ function Ne(e, t) {
|
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
136
|
function _t(e, t) {
|
|
137
|
-
const a = t.getContext("2d"), n = t.offsetWidth || t.width, r = (t.offsetHeight || t.height) *
|
|
137
|
+
const a = t.getContext("2d"), n = t.offsetWidth || t.width, r = (t.offsetHeight || t.height) * he, l = n * he;
|
|
138
138
|
a.font = `${r}px ${De}`;
|
|
139
139
|
const { width: i, height: c } = Ne(e, a), u = r / (i / l), d = r / (c / r);
|
|
140
140
|
return Math.min(u, d);
|
|
@@ -198,7 +198,7 @@ async function St(e, t) {
|
|
|
198
198
|
return e;
|
|
199
199
|
const n = a.mimeType;
|
|
200
200
|
if (n === N.TEXT) {
|
|
201
|
-
const o = j(
|
|
201
|
+
const o = j(V * 20, V, 1);
|
|
202
202
|
vt(o, a.data, "black", t, "white");
|
|
203
203
|
const r = se(o, "white");
|
|
204
204
|
return (r == null ? void 0 : r.toDataURL("image/jpeg", 0.7)) ?? null;
|
|
@@ -210,14 +210,14 @@ async function St(e, t) {
|
|
|
210
210
|
const r = o.map((d) => ({
|
|
211
211
|
...d,
|
|
212
212
|
penColor: "black"
|
|
213
|
-
})), l = j(
|
|
213
|
+
})), l = j(V * 20, V, Math.max(window.devicePixelRatio || 1, 1));
|
|
214
214
|
new _e(l).fromData(r);
|
|
215
215
|
const c = se(l);
|
|
216
|
-
return c ? Ee(c, void 0,
|
|
216
|
+
return c ? Ee(c, void 0, V, "white").toDataURL("image/jpeg", 0.7) : null;
|
|
217
217
|
}
|
|
218
218
|
if (n != null && n.startsWith("image/")) {
|
|
219
219
|
const o = await Ct(e), r = se(o);
|
|
220
|
-
return r ? Ee(r, void 0,
|
|
220
|
+
return r ? Ee(r, void 0, V).toDataURL("image/jpeg", 0.7) : null;
|
|
221
221
|
}
|
|
222
222
|
return e;
|
|
223
223
|
}
|
|
@@ -235,13 +235,13 @@ const At = ({ 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 ? Y(d.url) : void 0, m = _(async (
|
|
238
|
+
}, []), d = n == null ? void 0 : n[0], f = d != null && d.url ? Y(d.url) : void 0, m = _(async (h) => {
|
|
239
239
|
try {
|
|
240
|
-
const p = (
|
|
240
|
+
const p = (h == null ? void 0 : h.url) ?? "";
|
|
241
241
|
if (Dt(p)) {
|
|
242
|
-
const
|
|
243
|
-
if (
|
|
244
|
-
const E = await l(
|
|
242
|
+
const g = await Rt(p, r);
|
|
243
|
+
if (g) {
|
|
244
|
+
const E = await l(g);
|
|
245
245
|
t([
|
|
246
246
|
E
|
|
247
247
|
]);
|
|
@@ -260,13 +260,13 @@ const At = ({ value: e, onChange: t, target: a }) => {
|
|
|
260
260
|
t
|
|
261
261
|
]);
|
|
262
262
|
return {
|
|
263
|
-
handleChange: _((
|
|
264
|
-
const p = (
|
|
265
|
-
c.current = setTimeout(() => m(
|
|
263
|
+
handleChange: _((h) => {
|
|
264
|
+
const p = (g) => {
|
|
265
|
+
c.current = setTimeout(() => m(g), 1500);
|
|
266
266
|
};
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
]), p(
|
|
267
|
+
h ? (c.current && (clearTimeout(c.current), c.current = null), o([
|
|
268
|
+
h
|
|
269
|
+
]), p(h)) : (t == null || t(null), o(void 0), i(a, oe.READY));
|
|
270
270
|
}, [
|
|
271
271
|
m,
|
|
272
272
|
t,
|
|
@@ -306,7 +306,7 @@ const At = ({ value: e, onChange: t, target: a }) => {
|
|
|
306
306
|
n,
|
|
307
307
|
u,
|
|
308
308
|
e
|
|
309
|
-
]), m = r != null, L = xt(i, r, l),
|
|
309
|
+
]), m = r != null, L = xt(i, r, l), h = (() => {
|
|
310
310
|
switch (i) {
|
|
311
311
|
case y.DRAW:
|
|
312
312
|
return S.DRAW;
|
|
@@ -324,7 +324,7 @@ const At = ({ value: e, onChange: t, target: a }) => {
|
|
|
324
324
|
signatureMode: i,
|
|
325
325
|
clearable: m,
|
|
326
326
|
signatureValueForView: L,
|
|
327
|
-
signatureView:
|
|
327
|
+
signatureView: h,
|
|
328
328
|
handleChange: n,
|
|
329
329
|
setSignatureMode: c,
|
|
330
330
|
handleBeforeChange: d,
|
|
@@ -364,24 +364,24 @@ const Ut = (e) => {
|
|
|
364
364
|
[y.TYPE]: S.TYPE,
|
|
365
365
|
[y.UPLOAD]: S.UPLOAD
|
|
366
366
|
}, J = ({ children: e, className: t }) => {
|
|
367
|
-
const { id: a, value: n, onChange: o, target: r, readOnly: l } = x(), i =
|
|
367
|
+
const { id: a, value: n, onChange: o, target: r, readOnly: l } = x(), i = ht(a), { signatureMode: c, setSignatureMode: u, handleClear: d, clearable: f, signatureView: m, signatureValueForView: L, handleChange: h, handleBeforeChange: p } = Ft({
|
|
368
368
|
target: r,
|
|
369
369
|
value: n,
|
|
370
370
|
onChange: o
|
|
371
|
-
}),
|
|
371
|
+
}), g = C(e, J.Header), E = C(e, J.Value), R = {
|
|
372
372
|
signatureMode: i ?? c,
|
|
373
373
|
setSignatureMode: u,
|
|
374
374
|
handleClear: d,
|
|
375
375
|
clearable: f,
|
|
376
376
|
signatureView: i ? Bt[i] : m,
|
|
377
377
|
signatureValueForView: i ? void 0 : L,
|
|
378
|
-
handleChange:
|
|
378
|
+
handleChange: h,
|
|
379
379
|
handleBeforeChange: p
|
|
380
380
|
};
|
|
381
381
|
return /* @__PURE__ */ s.createElement("div", {
|
|
382
382
|
className: t,
|
|
383
383
|
"data-hook": "signature-container"
|
|
384
|
-
}, !l && A(
|
|
384
|
+
}, !l && A(g, R), A(E, R));
|
|
385
385
|
}, K = ({ children: e, className: t, ...a }) => {
|
|
386
386
|
const { signatureMode: n, setSignatureMode: o, clearable: r, handleClear: l } = a, { uploadEnabled: i } = x(), c = C(e, K.Tabs), u = C(e, K.Clear);
|
|
387
387
|
return /* @__PURE__ */ s.createElement("div", {
|
|
@@ -448,7 +448,7 @@ const Ut = (e) => {
|
|
|
448
448
|
className: t
|
|
449
449
|
}, e);
|
|
450
450
|
}, H = ({ children: e, className: t, ...a }) => {
|
|
451
|
-
const { signatureView: n, signatureValueForView: o, handleChange: r, handleBeforeChange: l } = a, { disabled: i, readOnly: c, onBlur: u, onFocus: d, hasError: f } = x(), m = C(e, H.Canvas), L = C(e, H.Type),
|
|
451
|
+
const { signatureView: n, signatureValueForView: o, handleChange: r, handleBeforeChange: l } = a, { disabled: i, readOnly: c, onBlur: u, onFocus: d, hasError: f } = x(), m = C(e, H.Canvas), L = C(e, H.Type), h = C(e, H.Upload);
|
|
452
452
|
return /* @__PURE__ */ s.createElement("div", {
|
|
453
453
|
className: t,
|
|
454
454
|
"data-hook": "signature-input",
|
|
@@ -471,7 +471,7 @@ const Ut = (e) => {
|
|
|
471
471
|
readOnly: c,
|
|
472
472
|
onBlur: u,
|
|
473
473
|
onFocus: d
|
|
474
|
-
}), (n === S.UPLOAD || n === S.IMAGE) && A(
|
|
474
|
+
}), (n === S.UPLOAD || n === S.IMAGE) && A(h, {
|
|
475
475
|
value: o,
|
|
476
476
|
onChange: r,
|
|
477
477
|
onBeforeChange: l,
|
|
@@ -481,10 +481,10 @@ const Ut = (e) => {
|
|
|
481
481
|
onFocus: d
|
|
482
482
|
}));
|
|
483
483
|
}, Yt = ({ className: e, emptyLabel: t, signedLabel: a, ...n }) => {
|
|
484
|
-
const { value: o, onChange: r, onBeforeChange: l, disabled: i, readOnly: c, onBlur: u, onFocus: d } = n, { id: f } = x(), { inputId: m, ariaDescribedBy: L } = W(),
|
|
484
|
+
const { value: o, onChange: r, onBeforeChange: l, disabled: i, readOnly: c, onBlur: u, onFocus: d } = n, { id: f } = x(), { inputId: m, ariaDescribedBy: L } = W(), h = ce(), p = $(), g = $(), E = $(null), R = o == null ? void 0 : o.url, [Z, P] = q(!1);
|
|
485
485
|
Ce(() => {
|
|
486
486
|
var I;
|
|
487
|
-
(I =
|
|
487
|
+
(I = g.current) == null || I.focus();
|
|
488
488
|
}, f);
|
|
489
489
|
const v = be(() => ({
|
|
490
490
|
throttle: 0,
|
|
@@ -512,16 +512,16 @@ const Ut = (e) => {
|
|
|
512
512
|
]), te = _((I) => {
|
|
513
513
|
var U, B, D, O;
|
|
514
514
|
if (I != null) {
|
|
515
|
-
if (
|
|
515
|
+
if (g.current = I, p.current = new _e(I, {
|
|
516
516
|
...v,
|
|
517
517
|
penColor: getComputedStyle(I).color || void 0
|
|
518
|
-
}),
|
|
519
|
-
const
|
|
520
|
-
|
|
518
|
+
}), ge(g.current, p.current), R) {
|
|
519
|
+
const G = ve(R);
|
|
520
|
+
G && (p.current.fromData(G), P(!0));
|
|
521
521
|
} else
|
|
522
522
|
p.current.clear(), P(!1);
|
|
523
523
|
p.current.addEventListener("beginStroke", k), p.current.addEventListener("endStroke", z), typeof ResizeObserver < "u" && !E.current && (E.current = new ResizeObserver(() => {
|
|
524
|
-
|
|
524
|
+
g.current && ge(g.current, p == null ? void 0 : p.current);
|
|
525
525
|
})), (U = E.current) == null || U.observe(I);
|
|
526
526
|
} else
|
|
527
527
|
(B = E.current) == null || B.disconnect(), (D = p.current) == null || D.removeEventListener("endStroke", z), (O = p.current) == null || O.removeEventListener("beginStroke", k);
|
|
@@ -538,7 +538,7 @@ const Ut = (e) => {
|
|
|
538
538
|
c
|
|
539
539
|
]), /* @__PURE__ */ s.createElement("div", {
|
|
540
540
|
className: e,
|
|
541
|
-
...
|
|
541
|
+
...h
|
|
542
542
|
}, /* @__PURE__ */ s.createElement("canvas", {
|
|
543
543
|
ref: te,
|
|
544
544
|
id: m,
|
|
@@ -552,7 +552,7 @@ const Ut = (e) => {
|
|
|
552
552
|
"aria-describedby": L
|
|
553
553
|
}));
|
|
554
554
|
}, de = ({ children: e, className: t, ...a }) => {
|
|
555
|
-
const { value: n, onChange: o, onBeforeChange: r, disabled: l, readOnly: i, onBlur: c, onFocus: u } = a, { id: d, required: f, hasError: m } = x(), { inputId: L, ariaDescribedBy:
|
|
555
|
+
const { value: n, onChange: o, onBeforeChange: r, 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 ? Y(n.url) : void 0, { data: R = "" } = E ?? {
|
|
556
556
|
data: ""
|
|
557
557
|
};
|
|
558
558
|
Ce(() => {
|
|
@@ -591,10 +591,10 @@ const Ut = (e) => {
|
|
|
591
591
|
validationBehavior: "aria"
|
|
592
592
|
}, /* @__PURE__ */ s.createElement("div", {
|
|
593
593
|
className: t,
|
|
594
|
-
...
|
|
594
|
+
...g
|
|
595
595
|
}, A(P, {
|
|
596
596
|
inputId: L,
|
|
597
|
-
ariaDescribedBy:
|
|
597
|
+
ariaDescribedBy: h
|
|
598
598
|
})));
|
|
599
599
|
}, Zt = ({ className: e, placeholder: t, ...a }) => {
|
|
600
600
|
const { inputId: n, ariaDescribedBy: o } = a;
|
|
@@ -607,15 +607,15 @@ const Ut = (e) => {
|
|
|
607
607
|
});
|
|
608
608
|
}, Q = ({ children: e, className: t, ...a }) => {
|
|
609
609
|
const { value: n, onChange: o, disabled: r, readOnly: l, onBlur: i, onFocus: c } = a, { labelId: u, ariaDescribedBy: d } = W(), f = C(e, Q.Button), m = C(e, Q.Preview), L = _((p) => {
|
|
610
|
-
const
|
|
611
|
-
if (!
|
|
610
|
+
const g = p[0];
|
|
611
|
+
if (!g) {
|
|
612
612
|
o(null);
|
|
613
613
|
return;
|
|
614
614
|
}
|
|
615
615
|
const E = new FileReader();
|
|
616
616
|
E.onload = () => {
|
|
617
|
-
o(ie(E.result,
|
|
618
|
-
}, E.readAsDataURL(
|
|
617
|
+
o(ie(E.result, g.name));
|
|
618
|
+
}, E.readAsDataURL(g);
|
|
619
619
|
}, [
|
|
620
620
|
o
|
|
621
621
|
]);
|
|
@@ -628,9 +628,9 @@ const Ut = (e) => {
|
|
|
628
628
|
"aria-describedby": d,
|
|
629
629
|
"data-hook": "signature-upload-drop-zone",
|
|
630
630
|
onDrop: async (p) => {
|
|
631
|
-
for (const
|
|
632
|
-
if (
|
|
633
|
-
const E = await
|
|
631
|
+
for (const g of p.items)
|
|
632
|
+
if (g.kind === "file" && g.type.startsWith("image/")) {
|
|
633
|
+
const E = await g.getFile();
|
|
634
634
|
if (E) {
|
|
635
635
|
L([
|
|
636
636
|
E
|
|
@@ -662,10 +662,10 @@ const Ut = (e) => {
|
|
|
662
662
|
"data-hook": "signature-image"
|
|
663
663
|
}, n.displayName || t));
|
|
664
664
|
}, re = ({ children: e, className: t, onHoverStart: a, onHoverEnd: n, onFocusChange: o, ...r }) => {
|
|
665
|
-
const { onSelectFiles: l, disabled: i, readOnly: c, onBlur: u, onFocus: d } = r, { inputId: f, ariaDescribedBy: m, labelId: L } = W(),
|
|
666
|
-
textId:
|
|
665
|
+
const { onSelectFiles: l, disabled: i, readOnly: c, onBlur: u, onFocus: d } = r, { inputId: f, ariaDescribedBy: m, labelId: L } = W(), h = pt(), g = !!C(e, re.Text) ? Fe.map(e, (E) => /* @__PURE__ */ Le(E) && E.type === re.Text ? A(E, {
|
|
666
|
+
textId: h
|
|
667
667
|
}) : E) : /* @__PURE__ */ s.createElement("span", {
|
|
668
|
-
id:
|
|
668
|
+
id: h
|
|
669
669
|
}, e);
|
|
670
670
|
return /* @__PURE__ */ s.createElement(rt, {
|
|
671
671
|
acceptedFileTypes: [
|
|
@@ -679,15 +679,15 @@ const Ut = (e) => {
|
|
|
679
679
|
onBlur: u,
|
|
680
680
|
onFocus: d,
|
|
681
681
|
isDisabled: i || c,
|
|
682
|
-
"aria-labelledby": `${L} ${
|
|
682
|
+
"aria-labelledby": `${L} ${h}`,
|
|
683
683
|
"aria-describedby": m,
|
|
684
684
|
"data-hook": "signature-upload",
|
|
685
685
|
className: t,
|
|
686
686
|
onHoverStart: a,
|
|
687
687
|
onHoverEnd: n,
|
|
688
688
|
onFocusChange: o
|
|
689
|
-
},
|
|
690
|
-
},
|
|
689
|
+
}, g));
|
|
690
|
+
}, Gt = ({ children: e, className: t, ...a }) => {
|
|
691
691
|
const { textId: n } = a;
|
|
692
692
|
return /* @__PURE__ */ s.createElement("span", {
|
|
693
693
|
id: n,
|
|
@@ -711,8 +711,8 @@ H.Upload = Q;
|
|
|
711
711
|
de.Value = Zt;
|
|
712
712
|
Q.Preview = kt;
|
|
713
713
|
Q.Button = re;
|
|
714
|
-
re.Text =
|
|
715
|
-
const
|
|
714
|
+
re.Text = Gt;
|
|
715
|
+
const Vt = () => {
|
|
716
716
|
const { t: e } = He();
|
|
717
717
|
return {
|
|
718
718
|
drawLabel: e("field.signature.mode.draw.label"),
|
|
@@ -790,19 +790,19 @@ const Gt = () => {
|
|
|
790
790
|
}, En = ({ content: e, locale: t }) => /* @__PURE__ */ s.createElement(xe, {
|
|
791
791
|
content: e,
|
|
792
792
|
locale: t
|
|
793
|
-
}),
|
|
793
|
+
}), gn = () => {
|
|
794
794
|
var k, te, I, w, U, B;
|
|
795
|
-
const e =
|
|
795
|
+
const e = Vt(), { disabled: t, readOnly: a } = x(), n = !t && !a, o = X({
|
|
796
796
|
globalClasses: Je,
|
|
797
797
|
moduleClasses: {
|
|
798
798
|
base: T.tab,
|
|
799
799
|
hover: T.tabHover,
|
|
800
800
|
selected: T.tabSelected
|
|
801
801
|
}
|
|
802
|
-
}), r = ({ isSelected: D, isHovered: O, isFocused:
|
|
802
|
+
}), r = ({ isSelected: D, isHovered: O, isFocused: G }) => o({
|
|
803
803
|
isSelected: D,
|
|
804
804
|
isHovered: O,
|
|
805
|
-
isFocused:
|
|
805
|
+
isFocused: G,
|
|
806
806
|
isInteractive: n
|
|
807
807
|
}), i = X({
|
|
808
808
|
globalClasses: ze,
|
|
@@ -836,7 +836,7 @@ const Gt = () => {
|
|
|
836
836
|
base: T.uploadButton,
|
|
837
837
|
hover: T.uploadButtonHover
|
|
838
838
|
}
|
|
839
|
-
}), m = (B = (U = (w = (I = (te = (k = Te().signatureContainer) == null ? void 0 : k.elementProps) == null ? void 0 : te.signatureDropZone) == null ? void 0 : I.elementProps) == null ? void 0 : w.signatureUploadButton) == null ? void 0 : U.elementProps) == null ? void 0 : B.icon, { wix: L, className:
|
|
839
|
+
}), m = (B = (U = (w = (I = (te = (k = Te().signatureContainer) == null ? void 0 : k.elementProps) == null ? void 0 : te.signatureDropZone) == null ? void 0 : I.elementProps) == null ? void 0 : w.signatureUploadButton) == null ? void 0 : U.elementProps) == null ? void 0 : B.icon, { wix: L, className: h, ...p } = m ?? {}, g = We(ne.SIGNATURE_CONTAINER, ne.SIGNATURE_DROP_ZONE, ne.SIGNATURE_UPLOAD_BUTTON, ne.UPLOAD_BUTTON_LABEL), E = $(null), [R, Z] = q(!1), [P, v] = q(!1), ee = _(() => {
|
|
840
840
|
var D;
|
|
841
841
|
Z(!0), (D = E.current) == null || D.runAnimationForward();
|
|
842
842
|
}, []), z = _(() => {
|
|
@@ -886,9 +886,9 @@ const Gt = () => {
|
|
|
886
886
|
className: T.typeInput,
|
|
887
887
|
placeholder: e.placeholder
|
|
888
888
|
})), /* @__PURE__ */ s.createElement(b.Input.Value.Upload, {
|
|
889
|
-
className: ({ isHovered: D, isFocused: O, isDropTarget:
|
|
889
|
+
className: ({ isHovered: D, isFocused: O, isDropTarget: G }) => F(T.uploadBox, d({
|
|
890
890
|
isSelected: !1,
|
|
891
|
-
isHovered: D ||
|
|
891
|
+
isHovered: D || G,
|
|
892
892
|
isFocused: O,
|
|
893
893
|
isInteractive: n
|
|
894
894
|
}))
|
|
@@ -908,9 +908,9 @@ const Gt = () => {
|
|
|
908
908
|
}, p.svg ? /* @__PURE__ */ s.createElement(we, {
|
|
909
909
|
...p,
|
|
910
910
|
ref: E,
|
|
911
|
-
className: F(
|
|
911
|
+
className: F(Ge, Ve, h)
|
|
912
912
|
}) : null, /* @__PURE__ */ s.createElement(b.Input.Value.Upload.Button.Text, {
|
|
913
|
-
className: F(fe.base, T.uploadButtonLabel,
|
|
913
|
+
className: F(fe.base, T.uploadButtonLabel, g, {
|
|
914
914
|
[fe.hover]: n && (R || P)
|
|
915
915
|
})
|
|
916
916
|
}, e.uploadLabel))))), /* @__PURE__ */ s.createElement(b.Error, {
|
|
@@ -918,7 +918,7 @@ const Gt = () => {
|
|
|
918
918
|
}, /* @__PURE__ */ s.createElement(mt, null), /* @__PURE__ */ s.createElement(b.Error.Text, null)), /* @__PURE__ */ s.createElement(b.Description, {
|
|
919
919
|
className: F(pe, ae.description)
|
|
920
920
|
}, En));
|
|
921
|
-
}, wn = () => /* @__PURE__ */ s.createElement(
|
|
921
|
+
}, wn = () => /* @__PURE__ */ s.createElement(gn, null);
|
|
922
922
|
export {
|
|
923
923
|
wn as SignatureRAC
|
|
924
924
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import t, { useRef as F, useCallback as P } from "react";
|
|
2
2
|
import j from "@wix/editor-react-components/AnimatedIcon";
|
|
3
3
|
import g from "classnames";
|
|
4
|
-
import {
|
|
4
|
+
import { bj as B, bd as q, ai as A, b as R, ah as k, ad as y, ac as M, ag as U } from "./form-C6lnbh2O.js";
|
|
5
5
|
import { ProgressBar as D, Button as N } from "react-aria-components";
|
|
6
6
|
import { f as m } from "./find-child-C60k4CxG.js";
|
|
7
|
-
import { u as f } from "./use-element-state-class-name-
|
|
7
|
+
import { u as f } from "./use-element-state-class-name-BU6RXqBy.js";
|
|
8
8
|
function W(e) {
|
|
9
9
|
const s = "calc(50% - 2px)";
|
|
10
10
|
return /* @__PURE__ */ t.createElement(D, {
|
|
@@ -38,7 +38,7 @@ function W(e) {
|
|
|
38
38
|
})))));
|
|
39
39
|
}
|
|
40
40
|
const u = ({ children: e }) => {
|
|
41
|
-
const { id: o, FieldLayout: s } =
|
|
41
|
+
const { id: o, FieldLayout: s } = B(), n = m(e, u.SubmitButton);
|
|
42
42
|
return /* @__PURE__ */ t.createElement(s, {
|
|
43
43
|
fieldId: o,
|
|
44
44
|
renderLabel: () => null,
|
|
@@ -51,22 +51,22 @@ const u = ({ children: e }) => {
|
|
|
51
51
|
className: e
|
|
52
52
|
}, s, n, i);
|
|
53
53
|
}, L = ({ className: e }) => {
|
|
54
|
-
const { showPreviousButton: o, onPreviousClick: s, previousText: n } =
|
|
54
|
+
const { showPreviousButton: o, onPreviousClick: s, previousText: n } = B();
|
|
55
55
|
return o ? /* @__PURE__ */ t.createElement(N, {
|
|
56
56
|
className: e,
|
|
57
57
|
onPress: s
|
|
58
58
|
}, n) : null;
|
|
59
59
|
}, I = ({ className: e }) => {
|
|
60
|
-
const { showNextButton: o, onNextClick: s, nextText: n } =
|
|
60
|
+
const { showNextButton: o, onNextClick: s, nextText: n } = B();
|
|
61
61
|
return o ? /* @__PURE__ */ t.createElement(N, {
|
|
62
62
|
className: e,
|
|
63
63
|
onPress: s
|
|
64
64
|
}, n) : null;
|
|
65
65
|
}, l = ({ className: e, onHoverStart: o, onHoverEnd: s, children: n }) => {
|
|
66
|
-
const { showSubmitButton: i, onSubmitClick: C, submitText: p, isDisabled: x, isInProgress:
|
|
66
|
+
const { showSubmitButton: i, onSubmitClick: C, submitText: p, isDisabled: x, isInProgress: b, isSubmitting: S } = B();
|
|
67
67
|
if (!i)
|
|
68
68
|
return null;
|
|
69
|
-
const E = m(n, l.Label), d = m(n, l.Icon), v = m(n, l.Loader), c = S ||
|
|
69
|
+
const E = m(n, l.Label), d = m(n, l.Icon), v = m(n, l.Loader), c = S || b;
|
|
70
70
|
return /* @__PURE__ */ t.createElement(N, {
|
|
71
71
|
className: e,
|
|
72
72
|
"aria-label": p,
|
|
@@ -75,10 +75,10 @@ const u = ({ children: e }) => {
|
|
|
75
75
|
onHoverEnd: s,
|
|
76
76
|
isDisabled: x && !c,
|
|
77
77
|
"aria-disabled": c || void 0,
|
|
78
|
-
"data-in-progress":
|
|
79
|
-
},
|
|
78
|
+
"data-in-progress": b
|
|
79
|
+
}, b && v ? v : /* @__PURE__ */ t.createElement(t.Fragment, null, E ?? /* @__PURE__ */ t.createElement(H, null), d));
|
|
80
80
|
}, H = ({ className: e }) => {
|
|
81
|
-
const { submitText: o } =
|
|
81
|
+
const { submitText: o } = B();
|
|
82
82
|
return /* @__PURE__ */ t.createElement("span", {
|
|
83
83
|
className: e
|
|
84
84
|
}, o);
|
|
@@ -106,7 +106,7 @@ const $ = "_navigationContainer_1fjqg_1", z = "_rowSpacing_1fjqg_6", G = "_navig
|
|
|
106
106
|
progress: nt
|
|
107
107
|
}, ot = () => {
|
|
108
108
|
var T, h;
|
|
109
|
-
const { hasSteps: e, showPreviousButton: o, isDisabled: s, isInProgress: n, isSubmitting: i } =
|
|
109
|
+
const { hasSteps: e, showPreviousButton: o, isDisabled: s, isInProgress: n, isSubmitting: i } = B(), p = !s && !(i || n), { wix: x, className: b, ...S } = ((h = (T = q().submitButton) == null ? void 0 : T.elementProps) == null ? void 0 : h.icon) ?? {}, E = f({
|
|
110
110
|
globalClasses: y,
|
|
111
111
|
moduleClasses: {
|
|
112
112
|
base: g(a.navigationButton, a.previousButton),
|
|
@@ -162,7 +162,7 @@ const $ = "_navigationContainer_1fjqg_1", z = "_rowSpacing_1fjqg_6", G = "_navig
|
|
|
162
162
|
}), /* @__PURE__ */ t.createElement(u.SubmitButton.SubmitButton.Icon, null, S.svg ? /* @__PURE__ */ t.createElement(j, {
|
|
163
163
|
...S,
|
|
164
164
|
ref: c,
|
|
165
|
-
className: g(R, k,
|
|
165
|
+
className: g(R, k, b)
|
|
166
166
|
}) : null), /* @__PURE__ */ t.createElement(u.SubmitButton.SubmitButton.Loader, {
|
|
167
167
|
className: a.progress
|
|
168
168
|
}))));
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { RicosViewer as
|
|
1
|
+
import { RicosViewer as Y } from "@wix/ricos/viewer";
|
|
2
2
|
import F from "classnames";
|
|
3
|
-
import t, { useMemo as I, useState as
|
|
4
|
-
import { CheckboxGroup as
|
|
5
|
-
import {
|
|
3
|
+
import t, { useMemo as I, useState as w, useRef as N, useLayoutEffect as z, useCallback as k } from "react";
|
|
4
|
+
import { CheckboxGroup as B, TextField as J, Input as K, CheckboxField as X, CheckboxButton as Z } from "react-aria-components";
|
|
5
|
+
import { bj as D, bg as M, bt as S, bl as U, M as ee, Y as te, a6 as ne, G as oe, u as ae, a7 as re } from "./form-C6lnbh2O.js";
|
|
6
6
|
import { f as O, a as x } from "./find-child-C60k4CxG.js";
|
|
7
|
-
import { E as W, D as H } from "./field-error-headless-
|
|
8
|
-
import { L as $ } from "./field-label-headless-
|
|
7
|
+
import { E as W, D as H } from "./field-error-headless-Bpe041x2.js";
|
|
8
|
+
import { L as $ } from "./field-label-headless-BUuK1Ftv.js";
|
|
9
9
|
import { F as se } from "./fieldset-headless-CD3fds9J.js";
|
|
10
10
|
import { E as le } from "./error-icon-hZxQ6DEy.js";
|
|
11
11
|
import { s as y } from "./field-rac.module-DfEb7pBp.js";
|
|
12
|
-
import { u as ie } from "./use-element-state-class-name-
|
|
13
|
-
import { u as ce } from "./use-text-input-class-name-
|
|
12
|
+
import { u as ie } from "./use-element-state-class-name-BU6RXqBy.js";
|
|
13
|
+
import { u as ce } from "./use-text-input-class-name-BB3V6Q0b.js";
|
|
14
14
|
var ue = /* @__PURE__ */ (function(e) {
|
|
15
15
|
return e[e.FREE_FLOW = 0] = "FREE_FLOW", e[e.ONE = 1] = "ONE", e[e.TWO = 2] = "TWO", e[e.THREE = 3] = "THREE", e;
|
|
16
16
|
})({});
|
|
17
|
-
const
|
|
17
|
+
const v = "Other", de = (e, n) => {
|
|
18
18
|
const i = n.length + 2;
|
|
19
19
|
return (e.find((l) => l.startsWith(`${n}: `)) || "").slice(i);
|
|
20
20
|
}, me = (e) => e.map((n) => n.value ?? n.label), P = ({ className: e, ...n }) => {
|
|
@@ -23,11 +23,11 @@ const R = "Other", de = (e, n) => {
|
|
|
23
23
|
className: e
|
|
24
24
|
}, r);
|
|
25
25
|
}, q = ({ className: e }) => {
|
|
26
|
-
const { value: n, onChange: r, addOtherLabel: i, addOtherPlaceholder: s, otherInputCharacterLimit: l, disabled: u, readOnly: m, hasError: d } = D(), { t: p } = S(), o = i || p("add-other.default-other-option-label") ||
|
|
26
|
+
const { value: n, onChange: r, addOtherLabel: i, addOtherPlaceholder: s, otherInputCharacterLimit: l, disabled: u, readOnly: m, hasError: d } = D(), { t: p } = S(), o = i || p("add-other.default-other-option-label") || v, b = I(() => de(n || [], o), [
|
|
27
27
|
n,
|
|
28
28
|
o
|
|
29
|
-
]), [c, L] =
|
|
30
|
-
|
|
29
|
+
]), [c, L] = w(b), f = N(r);
|
|
30
|
+
z(() => {
|
|
31
31
|
f.current = r;
|
|
32
32
|
});
|
|
33
33
|
const g = k((h) => {
|
|
@@ -41,14 +41,14 @@ const R = "Other", de = (e, n) => {
|
|
|
41
41
|
n,
|
|
42
42
|
o
|
|
43
43
|
]);
|
|
44
|
-
return /* @__PURE__ */ t.createElement(
|
|
44
|
+
return /* @__PURE__ */ t.createElement(J, {
|
|
45
45
|
value: c,
|
|
46
46
|
onChange: g,
|
|
47
47
|
isDisabled: u,
|
|
48
48
|
isReadOnly: m,
|
|
49
49
|
isInvalid: d,
|
|
50
50
|
"aria-label": o
|
|
51
|
-
}, /* @__PURE__ */ t.createElement(
|
|
51
|
+
}, /* @__PURE__ */ t.createElement(K, {
|
|
52
52
|
"data-hook": "tags-other-input",
|
|
53
53
|
"data-filled": c ? !0 : void 0,
|
|
54
54
|
placeholder: s,
|
|
@@ -82,7 +82,7 @@ const R = "Other", de = (e, n) => {
|
|
|
82
82
|
o,
|
|
83
83
|
h
|
|
84
84
|
]);
|
|
85
|
-
return /* @__PURE__ */ t.createElement(
|
|
85
|
+
return /* @__PURE__ */ t.createElement(X, {
|
|
86
86
|
inputRef: f,
|
|
87
87
|
value: C,
|
|
88
88
|
onChange: l ? _ : void 0,
|
|
@@ -91,7 +91,7 @@ const R = "Other", de = (e, n) => {
|
|
|
91
91
|
isInvalid: L
|
|
92
92
|
}, /* @__PURE__ */ t.createElement(Z, {
|
|
93
93
|
className: n,
|
|
94
|
-
"data-hook": `tags-${l ?
|
|
94
|
+
"data-hook": `tags-${l ? v : i}`
|
|
95
95
|
}, x(g, {
|
|
96
96
|
value: i,
|
|
97
97
|
label: s,
|
|
@@ -99,7 +99,7 @@ const R = "Other", de = (e, n) => {
|
|
|
99
99
|
isFirstOption: u
|
|
100
100
|
})));
|
|
101
101
|
}, V = ({ children: e, className: n }) => {
|
|
102
|
-
const { options: r, addOther: i, addOtherLabel: s, numberOfColumns: l = ue.FREE_FLOW } = D(), { t: u } = S(), m = s || u("add-other.default-other-option-label") ||
|
|
102
|
+
const { options: r, addOther: i, addOtherLabel: s, numberOfColumns: l = ue.FREE_FLOW } = D(), { t: u } = S(), m = s || u("add-other.default-other-option-label") || v, d = O(e, T), p = I(() => {
|
|
103
103
|
const o = r || [];
|
|
104
104
|
return i ? [
|
|
105
105
|
...o,
|
|
@@ -120,7 +120,7 @@ const R = "Other", de = (e, n) => {
|
|
|
120
120
|
}, p.map((o, b) => {
|
|
121
121
|
const c = o.value ?? o.label;
|
|
122
122
|
return x(d, {
|
|
123
|
-
key: o.isOther ?
|
|
123
|
+
key: o.isOther ? v : c,
|
|
124
124
|
value: c,
|
|
125
125
|
label: o.label,
|
|
126
126
|
isOther: o.isOther,
|
|
@@ -128,7 +128,7 @@ const R = "Other", de = (e, n) => {
|
|
|
128
128
|
});
|
|
129
129
|
}));
|
|
130
130
|
}, G = ({ children: e, className: n }) => {
|
|
131
|
-
const { addOther: r, addOtherLabel: i, hasError: s, readOnly: l, value: u } = D(), { t: m } = S(), d = i || m("add-other.default-other-option-label") ||
|
|
131
|
+
const { addOther: r, addOtherLabel: i, hasError: s, readOnly: l, value: u } = D(), { t: m } = S(), d = i || m("add-other.default-other-option-label") || v, p = O(e, V), o = O(e, q), b = I(() => !r || !u ? !1 : u.some((c) => c === d || c.startsWith(`${d}:`)), [
|
|
132
132
|
r,
|
|
133
133
|
u,
|
|
134
134
|
d
|
|
@@ -152,7 +152,7 @@ const R = "Other", de = (e, n) => {
|
|
|
152
152
|
required: l,
|
|
153
153
|
onBlur: p,
|
|
154
154
|
onFocus: o
|
|
155
|
-
}, /* @__PURE__ */ t.createElement(
|
|
155
|
+
}, /* @__PURE__ */ t.createElement(B, {
|
|
156
156
|
"aria-labelledby": c,
|
|
157
157
|
value: f,
|
|
158
158
|
onChange: i,
|
|
@@ -172,19 +172,19 @@ a.Options = V;
|
|
|
172
172
|
a.OtherInput = q;
|
|
173
173
|
a.Description = H;
|
|
174
174
|
a.Error = W;
|
|
175
|
-
const pe = "_control_t6hu2_1", he = "_options_t6hu2_7", Ee = "_option_t6hu2_7", be = "_optionHover_t6hu2_74", Oe = "_optionSelected_t6hu2_74",
|
|
175
|
+
const pe = "_control_t6hu2_1", he = "_options_t6hu2_7", Ee = "_option_t6hu2_7", be = "_optionHover_t6hu2_74", Oe = "_optionSelected_t6hu2_74", R = {
|
|
176
176
|
control: pe,
|
|
177
177
|
options: he,
|
|
178
178
|
option: Ee,
|
|
179
179
|
optionHover: be,
|
|
180
180
|
optionSelected: Oe
|
|
181
|
-
}, fe = ({ content: e, locale: n }) => /* @__PURE__ */ t.createElement(
|
|
181
|
+
}, fe = ({ content: e, locale: n }) => /* @__PURE__ */ t.createElement(Y, {
|
|
182
182
|
content: e,
|
|
183
183
|
locale: n
|
|
184
184
|
}), Ie = {
|
|
185
|
-
base:
|
|
186
|
-
selected:
|
|
187
|
-
hover:
|
|
185
|
+
base: R.option,
|
|
186
|
+
selected: R.optionSelected,
|
|
187
|
+
hover: R.optionHover
|
|
188
188
|
}, Ne = () => {
|
|
189
189
|
const e = ie({
|
|
190
190
|
globalClasses: re,
|
|
@@ -195,9 +195,9 @@ const pe = "_control_t6hu2_1", he = "_options_t6hu2_7", Ee = "_option_t6hu2_7",
|
|
|
195
195
|
}, /* @__PURE__ */ t.createElement(a.Label.Required, {
|
|
196
196
|
className: F(te, y.requiredMark)
|
|
197
197
|
})), /* @__PURE__ */ t.createElement(a.Control, {
|
|
198
|
-
className:
|
|
198
|
+
className: R.control
|
|
199
199
|
}, /* @__PURE__ */ t.createElement(a.Options, {
|
|
200
|
-
className: F(ne,
|
|
200
|
+
className: F(ne, R.options)
|
|
201
201
|
}, /* @__PURE__ */ t.createElement(a.Options.Option, {
|
|
202
202
|
className: e
|
|
203
203
|
}, /* @__PURE__ */ t.createElement(a.Options.Option.Label, null))), /* @__PURE__ */ t.createElement(a.OtherInput, {
|