@wix/form-elements 1.105.0 → 1.106.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-DaBg4fM3.js → appointment-rac-D2F4vgf1.js} +5 -5
- package/dist/component/{bookings-address-rac-CkCIr0yY.js → bookings-address-rac-_5S8J8_i.js} +1 -1
- package/dist/component/{bookings-email-rac--o2G6bDi.js → bookings-email-rac-6vmDR9nS.js} +1 -1
- package/dist/component/{bookings-first-name-rac-KilnnzGd.js → bookings-first-name-rac-DtTJ4T2K.js} +1 -1
- package/dist/component/{bookings-header-rac-D9PwyQVM.js → bookings-header-rac-B3dsEwzR.js} +1 -1
- package/dist/component/{bookings-last-name-rac-qWHHoFsL.js → bookings-last-name-rac-B3idkbi8.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-CA9lwDip.js → bookings-login-bar-rac-CrRBcQwT.js} +4 -4
- package/dist/component/{bookings-phone-rac-CJwbY3yf.js → bookings-phone-rac-BE0yWNnj.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-B-7cedEB.js → bookings-rich-text-rac-CYo1l0-6.js} +1 -1
- package/dist/component/{checkbox-field-rac-D5YjimAI.js → checkbox-field-rac-boTtXVEt.js} +16 -20
- package/dist/component/{checkbox-group-field-headless-BJl8C2Lz.js → checkbox-group-field-headless-DnkUvDm8.js} +3 -3
- package/dist/component/{checkbox-group-field-rac-CLDKYOsh.js → checkbox-group-field-rac-DrDTgHMg.js} +11 -11
- package/dist/component/{checkbox-group-rac-DfOsQWr7.js → checkbox-group-rac-v3ozUBpo.js} +1 -1
- package/dist/component/{checkbox-rac-DMDIZxxN.js → checkbox-rac-YSLE-RnG.js} +1 -1
- package/dist/component/{contacts-address-rac-CrpSPX3x.js → contacts-address-rac-C653yaHZ.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-B3vrz3B5.js → contacts-birthdate-rac-BeAQ6shx.js} +1 -1
- package/dist/component/{contacts-company-rac-Nd4-07pv.js → contacts-company-rac-BglKOoTG.js} +1 -1
- package/dist/component/{contacts-email-rac-DlKJXGue.js → contacts-email-rac-D6m7ynfc.js} +1 -1
- package/dist/component/{contacts-first-name-rac-CgfaCG0O.js → contacts-first-name-rac-Dgxn0tUJ.js} +1 -1
- package/dist/component/{contacts-last-name-rac-DmSqTPzC.js → contacts-last-name-rac-1UyIuRKH.js} +1 -1
- package/dist/component/{contacts-phone-rac-C9X_5axq.js → contacts-phone-rac-BQ77BlW4.js} +1 -1
- package/dist/component/{contacts-position-rac-DeJrqxtm.js → contacts-position-rac-BUDUv7lv.js} +1 -1
- package/dist/component/contacts-subscribe-rac-DdtA0qKW.js +6 -0
- package/dist/component/{contacts-tax-id-rac-6pMwtJyC.js → contacts-tax-id-rac-WUaKcNl0.js} +1 -1
- package/dist/component/{date-availability-DfL_xDci.js → date-availability-XjBFq8jt.js} +1 -1
- package/dist/component/{date-input-field-rac-DvlY0Ffu.js → date-input-field-rac-aY2zuuKs.js} +13 -13
- package/dist/component/{date-input-rac-Dr_MtbFO.js → date-input-rac-DRiP2_97.js} +1 -1
- package/dist/component/{date-picker-field-rac-D42hJF0j.js → date-picker-field-rac-Bzl-d3Uj.js} +27 -27
- package/dist/component/{date-picker-rac-CtoqWMPa.js → date-picker-rac-DHHUh8vn.js} +1 -1
- package/dist/component/{date-time-input-field-rac-C1rf0_aD.js → date-time-input-field-rac-DP_StuLr.js} +26 -26
- package/dist/component/{date-time-input-rac-gFwBZVcJ.js → date-time-input-rac-B11KIxsf.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-B0dh55yz.js → dext-checkbox-group-rac-BHZBqyWv.js} +2 -2
- package/dist/component/{dext-checkbox-rac-RQ7hpkFn.js → dext-checkbox-rac-BIlAqEvV.js} +1 -1
- package/dist/component/{dext-date-picker-rac-sJEfD5E6.js → dext-date-picker-rac-CHBXNrZi.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-BxPE1oVN.js → dext-date-time-input-rac-BYtliKry.js} +1 -1
- package/dist/component/{dext-dropdown-rac-BimIan_Z.js → dext-dropdown-rac-C2VPSFV5.js} +1 -1
- package/dist/component/{dext-email-rac-CjrC85Va.js → dext-email-rac-Fnb0Ggcs.js} +1 -1
- package/dist/component/{dext-number-input-rac-CkMRmcJQ.js → dext-number-input-rac-DopfSyFi.js} +1 -1
- package/dist/component/{dext-phone-rac-DO3qV3WL.js → dext-phone-rac-Rn4i_2rc.js} +1 -1
- package/dist/component/{dext-radio-group-rac-CUaqRQSf.js → dext-radio-group-rac-bNaskJpK.js} +2 -2
- package/dist/component/{dext-rating-input-rac-CIRU2af7.js → dext-rating-input-rac-DL6ZZd7d.js} +1 -1
- package/dist/component/{dext-tags-rac-DHqXtqOo.js → dext-tags-rac-TsUPoImO.js} +2 -2
- package/dist/component/{dext-text-area-rac-yBONPzSt.js → dext-text-area-rac-BIuY7LTd.js} +1 -1
- package/dist/component/{dext-text-input-rac-CdhAUC2i.js → dext-text-input-rac-CSYPW0Qi.js} +1 -1
- package/dist/component/{dext-url-input-rac-B4IQEsp2.js → dext-url-input-rac-_g0lqGfW.js} +1 -1
- package/dist/component/{donation-rac-D-rWK7OY.js → donation-rac-BYKFtsyR.js} +55 -55
- package/dist/component/{dropdown-field-headless-CeDAK-PU.js → dropdown-field-headless-CBaqlNZi.js} +4 -4
- package/dist/component/{dropdown-field-rac-BzqUmKJ1.js → dropdown-field-rac-CCAGSMm3.js} +5 -5
- package/dist/component/{dropdown-rac-CHO-8WoH.js → dropdown-rac-C_EqUsZ1.js} +1 -1
- package/dist/component/{ecom-address-rac-BZVqOncl.js → ecom-address-rac-Bw9eH0iF.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-BpILYYtb.js → ecom-subscription-checkbox-rac-B5PVOO2a.js} +10 -17
- package/dist/component/{email-input-field-rac-Cb6ECUnT.js → email-input-field-rac-B2kqQ6yo.js} +12 -12
- package/dist/component/{events-repeater-rac-BaYgjHjJ.js → events-repeater-rac--4OnUxWE.js} +53 -53
- package/dist/component/{events-rsvp-rac-CK0hpQKD.js → events-rsvp-rac-CczCoo3T.js} +12 -12
- package/dist/component/{field-error-headless-CN2-F78X.js → field-error-headless-D3-1L5sf.js} +1 -1
- package/dist/component/{field-label-headless-Ca6NcX2l.js → field-label-headless-Du4ckIVy.js} +1 -1
- package/dist/component/{file-upload-rac-C0DqDLp2.js → file-upload-rac-DbdkUbWM.js} +79 -79
- package/dist/component/{fixed-payment-rac-C5qNAT_7.js → fixed-payment-rac-f9-01iDN.js} +7 -7
- package/dist/component/{form-D1xJH87b.js → form-DQauhsho.js} +69 -69
- package/dist/component/form-element-classes-bLFmhsKw.js +137 -0
- package/dist/component/form.js +1 -1
- package/dist/component/{header-field-rac-BN-Ib7VY.js → header-field-rac-DamDk5BR.js} +3 -3
- package/dist/component/{header-rac-CE0NjfoF.js → header-rac-CR9T3Pnu.js} +1 -1
- package/dist/component/{image-choice-rac-D6dIXR_x.js → image-choice-rac-DJ_8v467.js} +12 -12
- package/dist/component/{index-CcsZgBFf.js → index-BB7d_9Dv.js} +4 -4
- package/dist/component/{index-DOd4eW8z.js → index-CcUTIUWM.js} +2 -2
- package/dist/component/{isObjectLike-DfUDKPeo.js → isObjectLike-xvPa_08X.js} +1 -1
- package/dist/component/{multiline-address-field-rac-jJ5HMakk.js → multiline-address-field-rac-CyaFOloE.js} +79 -79
- package/dist/component/{multiline-address-rac-GQF9HaNq.js → multiline-address-rac-CaHGUN_f.js} +1 -1
- package/dist/component/{number-input-field-rac-DRgq3Ll0.js → number-input-field-rac-BuYUzDWV.js} +14 -14
- package/dist/component/{number-input-rac-C2VoBZeq.js → number-input-rac-DMKX6nhk.js} +1 -1
- package/dist/component/{password-rac-DP8d_92z.js → password-rac-0RUXPAn6.js} +37 -37
- package/dist/component/{payment-input-rac-BycHF-zC.js → payment-input-rac-CHSZ3-Lt.js} +16 -16
- package/dist/component/{phone-input-field-rac-C3_-Dc35.js → phone-input-field-rac-JmIFcP1e.js} +28 -28
- package/dist/component/{phone-rac-DAxScWRl.js → phone-rac-BLRnAPXP.js} +1 -1
- package/dist/component/{product-list-rac-Bxdu4NFP.js → product-list-rac-BkF5tDwt.js} +9 -9
- package/dist/component/quiz-radio-group-rac-32cCMTUS.js +6 -0
- package/dist/component/{radio-button-module-classes-D71u96Y9.js → radio-button-module-classes-IOulhuSH.js} +3 -3
- package/dist/component/radio-group-field-rac-CJwku6e0.js +46 -0
- package/dist/component/{radio-group-rac-DqdjCYmd.js → radio-group-rac-BiW-9Abj.js} +1 -1
- package/dist/component/{rating-input-field-rac-C4Ztlh1u.js → rating-input-field-rac-B9cwaROK.js} +29 -29
- package/dist/component/{rating-input-rac-B4lF_LX7.js → rating-input-rac-BpwlNvzQ.js} +1 -1
- package/dist/component/{rich-content-rac.module-CmW7FwmQ.js → rich-content-rac.module-B1uyPmtK.js} +1 -1
- package/dist/component/{rich-text-field-rac-MwKpKbvj.js → rich-text-field-rac-C_qE7Ykg.js} +3 -3
- package/dist/component/{rich-text-rac-DcMBqEFb.js → rich-text-rac-VfeZxS27.js} +1 -1
- package/dist/component/{service-dropdown-rac-CZWVFnR8.js → service-dropdown-rac-BCfs8IhW.js} +17 -17
- package/dist/component/{services-multi-choice-rac-DvHcWQHS.js → services-multi-choice-rac-CCqdF_7P.js} +6 -6
- package/dist/component/{signature-rac-CMTAWkaY.js → signature-rac-DOyMo3u0.js} +72 -72
- package/dist/component/{submit-button-rac-HnfWQ8wg.js → submit-button-rac-C2uA5DeE.js} +11 -11
- package/dist/component/{tags-field-rac-BuqOeG7-.js → tags-field-rac-C_uIw2by.js} +35 -35
- package/dist/component/{tags-rac-FbHwPPKs.js → tags-rac-1pQ-fpe_.js} +1 -1
- package/dist/component/{text-area-field-rac-Bq224M1o.js → text-area-field-rac-DqlOkm7e.js} +22 -22
- package/dist/component/{text-area-rac-COcGlAYk.js → text-area-rac-DPdkrFcH.js} +1 -1
- package/dist/component/{text-input-field-rac-CTS4jFhC.js → text-input-field-rac-CmXm6r1w.js} +5 -5
- package/dist/component/{text-input-headless-QVLKSgJE.js → text-input-headless-DD__2DFf.js} +3 -3
- package/dist/component/{text-input-rac-BCCkVVG9.js → text-input-rac-DRHyQEH7.js} +1 -1
- package/dist/component/{time-input-rac-7n8d5ppJ.js → time-input-rac-BJPIymQY.js} +21 -21
- package/dist/component/{url-input-field-rac-ChPfhq6I.js → url-input-field-rac-CFDYkZ6I.js} +14 -14
- package/dist/component/{url-input-rac-cFZ8HC3U.js → url-input-rac-C0ChQUzq.js} +1 -1
- package/dist/component/{use-dropdown-option-class-name-Cf2B9xAE.js → use-dropdown-option-class-name-3L5ZmNLK.js} +2 -2
- package/dist/component/{use-element-state-class-name-DF2VZawA.js → use-element-state-class-name-BatTc2bw.js} +1 -1
- package/dist/component/{use-is-forced-open-dropdown-B_knxuKJ.js → use-is-forced-open-dropdown-B0jiPTmS.js} +1 -1
- package/dist/component/{use-service-options-base-Clx3S0du.js → use-service-options-base-oeE7xszw.js} +1 -1
- package/dist/component/{use-text-input-class-name-MbmOF6tH.js → use-text-input-class-name-LQ5S-NLh.js} +3 -3
- package/package.json +2 -2
- package/dist/component/contacts-subscribe-rac-Dv-QNZZc.js +0 -13
- package/dist/component/form-element-classes-BtKlobUX.js +0 -192
- package/dist/component/quiz-radio-group-rac-mAn0MuPW.js +0 -13
- package/dist/component/radio-group-field-rac-eij4o0_R.js +0 -50
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import s, { useRef as W, useCallback as I, useState as
|
|
1
|
+
import s, { useRef as W, useCallback as I, useState as Q, useEffect as K, useMemo as De, isValidElement as we } from "react";
|
|
2
2
|
import { RicosViewer as Re } from "@wix/ricos/viewer";
|
|
3
3
|
import v from "classnames";
|
|
4
|
-
import { useHover as ve, useFocusRing as
|
|
4
|
+
import { useHover as ve, useFocusRing as xe, mergeProps as Se } from "react-aria";
|
|
5
5
|
import { RadioGroup as Fe, Button as fe, TextField as Ae, Input as _e, RadioField as Pe, RadioButton as Ne } from "react-aria-components";
|
|
6
6
|
import he from "signature_pad";
|
|
7
|
-
import { G as Ue, ag as Oe, ac as Be, as as ge, E as ce, e as G, ak as A, ah as H, am as Ee, au as Me } from "./form-
|
|
8
|
-
import { f as
|
|
9
|
-
import { D as We, E as He } from "./field-error-headless-
|
|
10
|
-
import { L as Ye } from "./field-label-headless-
|
|
7
|
+
import { G as Ue, ag as Oe, ac as Be, as as ge, E as ce, e as G, ak as A, ah as H, am as Ee, au as Me } from "./form-DQauhsho.js";
|
|
8
|
+
import { f as T, a as F } from "./find-child-C60k4CxG.js";
|
|
9
|
+
import { D as We, E as He } from "./field-error-headless-D3-1L5sf.js";
|
|
10
|
+
import { L as Ye } from "./field-label-headless-Du4ckIVy.js";
|
|
11
11
|
import { D as ke } from "./data-hooks-Dkw1pbRj.js";
|
|
12
12
|
import { E as $e } from "./error-icon-hZxQ6DEy.js";
|
|
13
13
|
import { s as V } from "./field-rac.module-B4l_0KRU.js";
|
|
14
|
-
import {
|
|
14
|
+
import { v as ue, J as Ve, u as B, Q as ze, o as Ze, j as Xe } from "./form-element-classes-bLFmhsKw.js";
|
|
15
15
|
const Ge = typeof s.useId == "function" ? s.useId : () => W(Ue()).current;
|
|
16
16
|
var w = /* @__PURE__ */ (function(e) {
|
|
17
17
|
return e.TEXT = "text/plain", e.POINTS = "points/json", e;
|
|
18
18
|
})({}), b = /* @__PURE__ */ (function(e) {
|
|
19
19
|
return e.DRAW = "draw", e.TYPE = "type", e.UPLOAD = "upload", e;
|
|
20
|
-
})({}),
|
|
20
|
+
})({}), S = /* @__PURE__ */ (function(e) {
|
|
21
21
|
return e.DRAW = "draw", e.TYPE = "type", e.IMAGE = "image", e.UPLOAD = "upload", e;
|
|
22
22
|
})({});
|
|
23
23
|
const qe = (e) => {
|
|
@@ -54,14 +54,14 @@ const Je = (e, t) => {
|
|
|
54
54
|
const o = (r * t.width + n) * 4;
|
|
55
55
|
return t.data[o] * 65536 + t.data[o + 1] * 256 + t.data[o + 2] === a;
|
|
56
56
|
};
|
|
57
|
-
},
|
|
57
|
+
}, Qe = (e) => (t, a) => {
|
|
58
58
|
const n = (a * e.width + t) * 4;
|
|
59
59
|
return e.data[n + 3] === 0;
|
|
60
60
|
};
|
|
61
61
|
function J(e, t) {
|
|
62
62
|
const a = e.getContext("2d", {
|
|
63
63
|
willReadFrequently: !0
|
|
64
|
-
}), n = e.width, r = e.height, o = a.getImageData(0, 0, n, r), i = t ? Je(t, o) :
|
|
64
|
+
}), n = e.width, r = e.height, o = a.getImageData(0, 0, n, r), i = t ? Je(t, o) : Qe(o);
|
|
65
65
|
let l = n + 1, c = -1, d = r + 1, u = -1, f = 0, m = 0;
|
|
66
66
|
for (m = 0; m < r; m++)
|
|
67
67
|
for (f = 0; f < n; f++)
|
|
@@ -82,7 +82,7 @@ function z(e, t, a) {
|
|
|
82
82
|
}
|
|
83
83
|
return n;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function Ke(e, t) {
|
|
86
86
|
return new Promise((a, n) => {
|
|
87
87
|
const r = new Image();
|
|
88
88
|
r.onload = () => {
|
|
@@ -101,7 +101,7 @@ function me(e, t) {
|
|
|
101
101
|
const a = e.getContext("2d"), n = e.offsetWidth, r = e.offsetHeight, o = Math.max(window.devicePixelRatio || 1, 1), i = n * o, l = r * o;
|
|
102
102
|
return (e.width !== i || e.height !== l) && a ? (e.width = i, e.height = l, a.scale(o, o), t == null || t.redraw(), !0) : !1;
|
|
103
103
|
}
|
|
104
|
-
const M = 480, et = (e) =>
|
|
104
|
+
const M = 480, et = (e) => Ce({
|
|
105
105
|
data: JSON.stringify(e),
|
|
106
106
|
mimeType: w.POINTS
|
|
107
107
|
}), Le = (e) => {
|
|
@@ -136,14 +136,14 @@ function nt(e, t, a = "black", n = !1, r) {
|
|
|
136
136
|
const m = (l - d) / 2;
|
|
137
137
|
o.fillText(t, n ? l - m : m, (c - u) / 2 + f);
|
|
138
138
|
}
|
|
139
|
-
const
|
|
139
|
+
const Te = /^data:([^;,]+)(?:;([^,]+))?,(.+)$/;
|
|
140
140
|
function at(e) {
|
|
141
|
-
return
|
|
141
|
+
return Te.test(e);
|
|
142
142
|
}
|
|
143
143
|
function N(e) {
|
|
144
144
|
if (!e)
|
|
145
145
|
return;
|
|
146
|
-
const t = e.match(
|
|
146
|
+
const t = e.match(Te);
|
|
147
147
|
if (!t)
|
|
148
148
|
return;
|
|
149
149
|
const [, a, n, r] = t;
|
|
@@ -153,7 +153,7 @@ function N(e) {
|
|
|
153
153
|
encoding: n
|
|
154
154
|
};
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function Ce({ data: e, mimeType: t, encoding: a = "text" }) {
|
|
157
157
|
const n = a === "base64" ? btoa(e) : encodeURI(e);
|
|
158
158
|
return `data:${a === "base64" ? `${t};base64` : t},${n}`;
|
|
159
159
|
}
|
|
@@ -205,7 +205,7 @@ async function ot(e, t) {
|
|
|
205
205
|
return c ? de(c, void 0, M, "white").toDataURL("image/jpeg", 0.7) : null;
|
|
206
206
|
}
|
|
207
207
|
if (n != null && n.startsWith("image/")) {
|
|
208
|
-
const r = await
|
|
208
|
+
const r = await Ke(e), o = J(r);
|
|
209
209
|
return o ? de(o, void 0, M).toDataURL("image/jpeg", 0.7) : null;
|
|
210
210
|
}
|
|
211
211
|
return e;
|
|
@@ -216,8 +216,8 @@ async function st(e, t) {
|
|
|
216
216
|
return rt(a, "signature");
|
|
217
217
|
}
|
|
218
218
|
const it = ({ value: e, onChange: t, target: a }) => {
|
|
219
|
-
const [n, r] =
|
|
220
|
-
|
|
219
|
+
const [n, r] = Q(e), { isRTL: o } = Be(), i = qe(a), { setFormStatus: l } = ge(), c = W();
|
|
220
|
+
K(() => {
|
|
221
221
|
e === ce && r(ce);
|
|
222
222
|
}, [
|
|
223
223
|
e
|
|
@@ -271,7 +271,7 @@ const it = ({ value: e, onChange: t, target: a }) => {
|
|
|
271
271
|
value: t,
|
|
272
272
|
onChange: a,
|
|
273
273
|
target: e
|
|
274
|
-
}), [l, c] =
|
|
274
|
+
}), [l, c] = Q(() => {
|
|
275
275
|
if (o == null)
|
|
276
276
|
return b.DRAW;
|
|
277
277
|
switch (i == null ? void 0 : i.mimeType) {
|
|
@@ -298,13 +298,13 @@ const it = ({ value: e, onChange: t, target: a }) => {
|
|
|
298
298
|
]), m = o != null, h = ut(l, o, i), E = (() => {
|
|
299
299
|
switch (l) {
|
|
300
300
|
case b.DRAW:
|
|
301
|
-
return
|
|
301
|
+
return S.DRAW;
|
|
302
302
|
case b.TYPE:
|
|
303
|
-
return
|
|
303
|
+
return S.TYPE;
|
|
304
304
|
case b.UPLOAD:
|
|
305
|
-
return h != null ?
|
|
305
|
+
return h != null ? S.IMAGE : S.UPLOAD;
|
|
306
306
|
default:
|
|
307
|
-
return
|
|
307
|
+
return S.DRAW;
|
|
308
308
|
}
|
|
309
309
|
})();
|
|
310
310
|
return {
|
|
@@ -331,17 +331,17 @@ const dt = (e) => {
|
|
|
331
331
|
const t = e.url ? N(e.url) : void 0;
|
|
332
332
|
return t ? t.mimeType !== w.POINTS && t.mimeType !== w.TEXT : !0;
|
|
333
333
|
}, te = () => {
|
|
334
|
-
const { hoverProps: e, isHovered: t } = ve({}), { focusProps: a, isFocused: n, isFocusVisible: r } =
|
|
334
|
+
const { hoverProps: e, isHovered: t } = ve({}), { focusProps: a, isFocused: n, isFocusVisible: r } = xe({
|
|
335
335
|
within: !0
|
|
336
336
|
});
|
|
337
337
|
return {
|
|
338
|
-
...
|
|
338
|
+
...Se(e, a),
|
|
339
339
|
"data-hovered": t || void 0,
|
|
340
340
|
"data-focus-within": n || void 0,
|
|
341
341
|
"data-focus-visible": r || void 0
|
|
342
342
|
};
|
|
343
343
|
}, g = ({ children: e }) => {
|
|
344
|
-
const { id: t, FieldLayout: a } = A(), n =
|
|
344
|
+
const { id: t, FieldLayout: a } = A(), n = T(e, g.Label), r = T(e, g.Input), o = T(e, g.Description), i = T(e, g.Error);
|
|
345
345
|
return /* @__PURE__ */ s.createElement(a, {
|
|
346
346
|
fieldId: t,
|
|
347
347
|
renderLabel: () => n,
|
|
@@ -353,7 +353,7 @@ const dt = (e) => {
|
|
|
353
353
|
target: n,
|
|
354
354
|
value: t,
|
|
355
355
|
onChange: a
|
|
356
|
-
}), h =
|
|
356
|
+
}), h = T(e, Z.Header), E = T(e, Z.Value), p = {
|
|
357
357
|
signatureMode: o,
|
|
358
358
|
setSignatureMode: i,
|
|
359
359
|
handleClear: l,
|
|
@@ -365,7 +365,7 @@ const dt = (e) => {
|
|
|
365
365
|
};
|
|
366
366
|
return /* @__PURE__ */ s.createElement(s.Fragment, null, !r && F(h, p), F(E, p));
|
|
367
367
|
}, X = ({ children: e, className: t, ...a }) => {
|
|
368
|
-
const { signatureMode: n, setSignatureMode: r, clearable: o, handleClear: i } = a, { uploadEnabled: l } = A(), c =
|
|
368
|
+
const { signatureMode: n, setSignatureMode: r, clearable: o, handleClear: i } = a, { uploadEnabled: l } = A(), c = T(e, X.Tabs), d = T(e, X.Clear);
|
|
369
369
|
return /* @__PURE__ */ s.createElement("div", {
|
|
370
370
|
className: t
|
|
371
371
|
}, F(c, {
|
|
@@ -381,9 +381,9 @@ const dt = (e) => {
|
|
|
381
381
|
}, [
|
|
382
382
|
r
|
|
383
383
|
]), u = {
|
|
384
|
-
[b.DRAW]:
|
|
385
|
-
[b.TYPE]:
|
|
386
|
-
[b.UPLOAD]: o ?
|
|
384
|
+
[b.DRAW]: T(e, _.Draw),
|
|
385
|
+
[b.TYPE]: T(e, _.Type),
|
|
386
|
+
[b.UPLOAD]: o ? T(e, _.Upload) : null
|
|
387
387
|
}, f = u[n], m = mt(f) ? f.props.description : void 0;
|
|
388
388
|
return /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement("div", {
|
|
389
389
|
role: "status",
|
|
@@ -430,14 +430,14 @@ const dt = (e) => {
|
|
|
430
430
|
className: t
|
|
431
431
|
}, e);
|
|
432
432
|
}, P = ({ children: e, className: t, ...a }) => {
|
|
433
|
-
const { signatureView: n, signatureValueForView: r, handleChange: o, handleBeforeChange: i } = a, { disabled: l, readOnly: c, onBlur: d, onFocus: u, hasError: f } = A(), m =
|
|
433
|
+
const { signatureView: n, signatureValueForView: r, handleChange: o, handleBeforeChange: i } = a, { disabled: l, readOnly: c, onBlur: d, onFocus: u, hasError: f } = A(), m = T(e, P.Canvas), h = T(e, P.Type), E = T(e, P.Upload);
|
|
434
434
|
return /* @__PURE__ */ s.createElement("div", {
|
|
435
435
|
className: t,
|
|
436
436
|
"data-hook": "signature-input",
|
|
437
437
|
"data-invalid": f,
|
|
438
438
|
"data-disabled": l,
|
|
439
439
|
"data-readonly": c
|
|
440
|
-
}, n ===
|
|
440
|
+
}, n === S.DRAW && F(m, {
|
|
441
441
|
value: r,
|
|
442
442
|
onChange: o,
|
|
443
443
|
onBeforeChange: i,
|
|
@@ -445,7 +445,7 @@ const dt = (e) => {
|
|
|
445
445
|
readOnly: c,
|
|
446
446
|
onBlur: d,
|
|
447
447
|
onFocus: u
|
|
448
|
-
}), n ===
|
|
448
|
+
}), n === S.TYPE && F(h, {
|
|
449
449
|
value: r,
|
|
450
450
|
onChange: o,
|
|
451
451
|
onBeforeChange: i,
|
|
@@ -453,7 +453,7 @@ const dt = (e) => {
|
|
|
453
453
|
readOnly: c,
|
|
454
454
|
onBlur: d,
|
|
455
455
|
onFocus: u
|
|
456
|
-
}), (n ===
|
|
456
|
+
}), (n === S.UPLOAD || n === S.IMAGE) && F(E, {
|
|
457
457
|
value: r,
|
|
458
458
|
onChange: o,
|
|
459
459
|
onBeforeChange: i,
|
|
@@ -463,7 +463,7 @@ const dt = (e) => {
|
|
|
463
463
|
onFocus: u
|
|
464
464
|
}));
|
|
465
465
|
}, Et = ({ className: e, emptyLabel: t, signedLabel: a, ...n }) => {
|
|
466
|
-
const { value: r, onChange: o, onBeforeChange: i, disabled: l, readOnly: c, onBlur: d, onFocus: u } = n, { id: f } = A(), { inputId: m, ariaDescribedBy: h } = H(), E = te(), p = W(), L = W(), y = W(null),
|
|
466
|
+
const { value: r, onChange: o, onBeforeChange: i, disabled: l, readOnly: c, onBlur: d, onFocus: u } = n, { id: f } = A(), { inputId: m, ariaDescribedBy: h } = H(), E = te(), p = W(), L = W(), y = W(null), x = r == null ? void 0 : r.url, [U, Y] = Q(!1);
|
|
467
467
|
Ee(() => {
|
|
468
468
|
var D;
|
|
469
469
|
(D = L.current) == null || D.focus();
|
|
@@ -497,8 +497,8 @@ const dt = (e) => {
|
|
|
497
497
|
if (L.current = D, p.current = new he(D, {
|
|
498
498
|
...R,
|
|
499
499
|
penColor: getComputedStyle(D).color || void 0
|
|
500
|
-
}), me(L.current, p.current),
|
|
501
|
-
const le = Le(
|
|
500
|
+
}), me(L.current, p.current), x) {
|
|
501
|
+
const le = Le(x);
|
|
502
502
|
le && (p.current.fromData(le), Y(!0));
|
|
503
503
|
} else
|
|
504
504
|
p.current.clear(), Y(!1);
|
|
@@ -509,11 +509,11 @@ const dt = (e) => {
|
|
|
509
509
|
($ = y.current) == null || $.disconnect(), (se = p.current) == null || se.removeEventListener("endStroke", q), (ie = p.current) == null || ie.removeEventListener("beginStroke", j);
|
|
510
510
|
}, [
|
|
511
511
|
R,
|
|
512
|
-
|
|
512
|
+
x,
|
|
513
513
|
j,
|
|
514
514
|
q
|
|
515
515
|
]);
|
|
516
|
-
return
|
|
516
|
+
return K(() => {
|
|
517
517
|
p.current && (c || l ? p.current.off() : p.current.on());
|
|
518
518
|
}, [
|
|
519
519
|
l,
|
|
@@ -526,7 +526,7 @@ const dt = (e) => {
|
|
|
526
526
|
id: m,
|
|
527
527
|
"data-hook": "signature-canvas",
|
|
528
528
|
"data-input-id": m,
|
|
529
|
-
"data-has-value": !!
|
|
529
|
+
"data-has-value": !!x,
|
|
530
530
|
onFocus: u,
|
|
531
531
|
onBlur: d,
|
|
532
532
|
role: "img",
|
|
@@ -534,7 +534,7 @@ const dt = (e) => {
|
|
|
534
534
|
"aria-describedby": h
|
|
535
535
|
}));
|
|
536
536
|
}, ae = ({ children: e, className: t, ...a }) => {
|
|
537
|
-
const { value: n, onChange: r, onBeforeChange: o, disabled: i, readOnly: l, onBlur: c, onFocus: d } = a, { id: u, required: f, hasError: m } = A(), { inputId: h, ariaDescribedBy: E, labelId: p } = H(), L = te(), y = n != null && n.url ? N(n.url) : void 0, { data:
|
|
537
|
+
const { value: n, onChange: r, onBeforeChange: o, disabled: i, readOnly: l, onBlur: c, onFocus: d } = a, { id: u, required: f, hasError: m } = A(), { inputId: h, ariaDescribedBy: E, labelId: p } = H(), L = te(), y = n != null && n.url ? N(n.url) : void 0, { data: x = "" } = y ?? {
|
|
538
538
|
data: ""
|
|
539
539
|
};
|
|
540
540
|
Ee(() => {
|
|
@@ -542,7 +542,7 @@ const dt = (e) => {
|
|
|
542
542
|
R == null || R.focus({
|
|
543
543
|
preventScroll: !0
|
|
544
544
|
});
|
|
545
|
-
}, u),
|
|
545
|
+
}, u), K(() => {
|
|
546
546
|
if (!n) {
|
|
547
547
|
const R = document.getElementById(h);
|
|
548
548
|
R && (R.value = "");
|
|
@@ -552,17 +552,17 @@ const dt = (e) => {
|
|
|
552
552
|
h
|
|
553
553
|
]);
|
|
554
554
|
const U = I((R) => {
|
|
555
|
-
o == null || o(), R.trim() ? r(ee(
|
|
555
|
+
o == null || o(), R.trim() ? r(ee(Ce({
|
|
556
556
|
data: R,
|
|
557
557
|
mimeType: w.TEXT
|
|
558
558
|
}))) : r(null);
|
|
559
559
|
}, [
|
|
560
560
|
o,
|
|
561
561
|
r
|
|
562
|
-
]), Y =
|
|
562
|
+
]), Y = T(e, ae.Value);
|
|
563
563
|
return /* @__PURE__ */ s.createElement(Ae, {
|
|
564
564
|
"aria-labelledby": p,
|
|
565
|
-
value:
|
|
565
|
+
value: x,
|
|
566
566
|
onChange: U,
|
|
567
567
|
onBlur: c,
|
|
568
568
|
onFocus: d,
|
|
@@ -590,16 +590,16 @@ const dt = (e) => {
|
|
|
590
590
|
}, bt = {
|
|
591
591
|
display: "none"
|
|
592
592
|
}, re = ({ children: e, className: t, imageAlt: a, ...n }) => {
|
|
593
|
-
const { value: r, onChange: o, disabled: i, readOnly: l, onBlur: c, onFocus: d } = n, { inputId: u } = H(), f = te(), m =
|
|
593
|
+
const { value: r, onChange: o, disabled: i, readOnly: l, onBlur: c, onFocus: d } = n, { inputId: u } = H(), f = te(), m = T(e, re.Button), h = W(null), E = I((L) => {
|
|
594
594
|
const y = L.target.files;
|
|
595
595
|
if (!y || y.length === 0) {
|
|
596
596
|
o(null);
|
|
597
597
|
return;
|
|
598
598
|
}
|
|
599
|
-
const
|
|
599
|
+
const x = y[0], U = new FileReader();
|
|
600
600
|
U.onload = function() {
|
|
601
|
-
o(ee(this.result,
|
|
602
|
-
}, U.readAsDataURL(
|
|
601
|
+
o(ee(this.result, x.name));
|
|
602
|
+
}, U.readAsDataURL(x);
|
|
603
603
|
}, [
|
|
604
604
|
o
|
|
605
605
|
]), p = r && dt(r);
|
|
@@ -668,7 +668,7 @@ P.Type = ae;
|
|
|
668
668
|
P.Upload = re;
|
|
669
669
|
ae.Value = Lt;
|
|
670
670
|
re.Button = yt;
|
|
671
|
-
const
|
|
671
|
+
const Tt = () => {
|
|
672
672
|
const { t: e } = Me();
|
|
673
673
|
return {
|
|
674
674
|
drawLabel: e("field.signature.mode.draw.label"),
|
|
@@ -684,7 +684,7 @@ const Ct = () => {
|
|
|
684
684
|
imageAlt: e("field.signature.a11y.state.signed"),
|
|
685
685
|
uploadLabel: e("field.signature.settings.upload-button.label")
|
|
686
686
|
};
|
|
687
|
-
},
|
|
687
|
+
}, Ct = (e) => /* @__PURE__ */ s.createElement("svg", {
|
|
688
688
|
viewBox: "0 0 24 24",
|
|
689
689
|
width: 24,
|
|
690
690
|
height: 24,
|
|
@@ -724,11 +724,11 @@ const Ct = () => {
|
|
|
724
724
|
}, /* @__PURE__ */ s.createElement("path", {
|
|
725
725
|
fillRule: "evenodd",
|
|
726
726
|
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"
|
|
727
|
-
})), Rt = "_header_15ti0_1", vt = "_tabs_15ti0_8",
|
|
727
|
+
})), Rt = "_header_15ti0_1", vt = "_tabs_15ti0_8", xt = "_tab_15ti0_8", St = "_tabIcon_15ti0_74", Ft = "_clear_15ti0_81", At = "_value_15ti0_113", _t = "_box_15ti0_118", Pt = "_uploadBox_15ti0_119", Nt = "_typeInput_15ti0_230", C = {
|
|
728
728
|
header: Rt,
|
|
729
729
|
tabs: vt,
|
|
730
|
-
tab:
|
|
731
|
-
tabIcon:
|
|
730
|
+
tab: xt,
|
|
731
|
+
tabIcon: St,
|
|
732
732
|
clear: Ft,
|
|
733
733
|
value: At,
|
|
734
734
|
box: _t,
|
|
@@ -738,49 +738,49 @@ const Ct = () => {
|
|
|
738
738
|
content: e,
|
|
739
739
|
locale: t
|
|
740
740
|
}), Ot = () => {
|
|
741
|
-
const e =
|
|
741
|
+
const e = Tt();
|
|
742
742
|
return /* @__PURE__ */ s.createElement(g, null, /* @__PURE__ */ s.createElement(g.Label, {
|
|
743
743
|
className: v(ue, V.label)
|
|
744
744
|
}, /* @__PURE__ */ s.createElement(g.Label.Required, {
|
|
745
745
|
className: v(Ve, V.requiredMark)
|
|
746
746
|
})), /* @__PURE__ */ s.createElement(g.Input, null, /* @__PURE__ */ s.createElement(g.Input.Header, {
|
|
747
|
-
className:
|
|
747
|
+
className: C.header
|
|
748
748
|
}, /* @__PURE__ */ s.createElement(g.Input.Header.Tabs, {
|
|
749
|
-
className:
|
|
749
|
+
className: C.tabs
|
|
750
750
|
}, /* @__PURE__ */ s.createElement(g.Input.Header.Tabs.Draw, {
|
|
751
|
-
className: v(B,
|
|
751
|
+
className: v(B, C.tab),
|
|
752
752
|
"aria-label": e.drawLabel,
|
|
753
753
|
description: e.drawDescription
|
|
754
754
|
}, /* @__PURE__ */ s.createElement(Dt, {
|
|
755
|
-
className:
|
|
755
|
+
className: C.tabIcon
|
|
756
756
|
})), /* @__PURE__ */ s.createElement(g.Input.Header.Tabs.Type, {
|
|
757
|
-
className: v(B,
|
|
757
|
+
className: v(B, C.tab),
|
|
758
758
|
"aria-label": e.typeLabel,
|
|
759
759
|
description: e.typeDescription
|
|
760
760
|
}, /* @__PURE__ */ s.createElement(wt, {
|
|
761
|
-
className:
|
|
761
|
+
className: C.tabIcon
|
|
762
762
|
})), /* @__PURE__ */ s.createElement(g.Input.Header.Tabs.Upload, {
|
|
763
|
-
className: v(B,
|
|
763
|
+
className: v(B, C.tab),
|
|
764
764
|
"aria-label": e.uploadModeLabel,
|
|
765
765
|
description: e.uploadDescription
|
|
766
766
|
}, /* @__PURE__ */ s.createElement(It, {
|
|
767
|
-
className:
|
|
767
|
+
className: C.tabIcon
|
|
768
768
|
}))), /* @__PURE__ */ s.createElement(g.Input.Header.Clear, {
|
|
769
|
-
className: v(ue,
|
|
769
|
+
className: v(ue, C.clear),
|
|
770
770
|
"aria-label": e.clearLabel
|
|
771
|
-
}, /* @__PURE__ */ s.createElement(
|
|
772
|
-
className:
|
|
771
|
+
}, /* @__PURE__ */ s.createElement(Ct, null))), /* @__PURE__ */ s.createElement(g.Input.Value, {
|
|
772
|
+
className: C.value
|
|
773
773
|
}, /* @__PURE__ */ s.createElement(g.Input.Value.Canvas, {
|
|
774
|
-
className: v(B,
|
|
774
|
+
className: v(B, C.box),
|
|
775
775
|
emptyLabel: e.emptyLabel,
|
|
776
776
|
signedLabel: e.signedLabel
|
|
777
777
|
}), /* @__PURE__ */ s.createElement(g.Input.Value.Type, {
|
|
778
|
-
className: v(B,
|
|
778
|
+
className: v(B, C.box)
|
|
779
779
|
}, /* @__PURE__ */ s.createElement(g.Input.Value.Type.Value, {
|
|
780
|
-
className:
|
|
780
|
+
className: C.typeInput,
|
|
781
781
|
placeholder: e.placeholder
|
|
782
782
|
})), /* @__PURE__ */ s.createElement(g.Input.Value.Upload, {
|
|
783
|
-
className: v(B,
|
|
783
|
+
className: v(B, C.uploadBox),
|
|
784
784
|
imageAlt: e.imageAlt
|
|
785
785
|
}, /* @__PURE__ */ s.createElement(g.Input.Value.Upload.Button, {
|
|
786
786
|
className: v(ze, V.uploadButton)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import t, { useRef as y, useCallback as f } from "react";
|
|
2
2
|
import P from "@wix/editor-react-components/AnimatedIcon";
|
|
3
3
|
import b from "classnames";
|
|
4
|
-
import { ak as B, ae as h } from "./form-
|
|
4
|
+
import { ak as B, ae as h } from "./form-DQauhsho.js";
|
|
5
5
|
import { ProgressBar as A, Button as N } from "react-aria-components";
|
|
6
6
|
import { f as c } from "./find-child-C60k4CxG.js";
|
|
7
|
-
import {
|
|
8
|
-
function
|
|
7
|
+
import { S as I, R as O, U as w, W as F, A as R, V as k } from "./form-element-classes-bLFmhsKw.js";
|
|
8
|
+
function U(n) {
|
|
9
9
|
const s = "calc(50% - 2px)";
|
|
10
10
|
return /* @__PURE__ */ t.createElement(A, {
|
|
11
11
|
...n,
|
|
@@ -82,19 +82,19 @@ const u = ({ children: n }) => {
|
|
|
82
82
|
return /* @__PURE__ */ t.createElement("span", {
|
|
83
83
|
className: n
|
|
84
84
|
}, o);
|
|
85
|
-
},
|
|
85
|
+
}, M = ({ children: n }) => /* @__PURE__ */ t.createElement(t.Fragment, null, n), W = ({ className: n }) => /* @__PURE__ */ t.createElement("span", {
|
|
86
86
|
className: n
|
|
87
|
-
}, /* @__PURE__ */ t.createElement(
|
|
87
|
+
}, /* @__PURE__ */ t.createElement(U, null));
|
|
88
88
|
i.Label = T;
|
|
89
|
-
i.Icon =
|
|
90
|
-
i.Loader =
|
|
89
|
+
i.Icon = M;
|
|
90
|
+
i.Loader = W;
|
|
91
91
|
_.PreviousButton = C;
|
|
92
92
|
_.NextButton = x;
|
|
93
93
|
_.SubmitButton = i;
|
|
94
94
|
u.SubmitButton = _;
|
|
95
|
-
const
|
|
96
|
-
navigationContainer:
|
|
97
|
-
rowSpacing:
|
|
95
|
+
const D = "_navigationContainer_nvvyn_1", H = "_rowSpacing_nvvyn_6", V = "_navigationButton_nvvyn_10", X = "_nextButton_nvvyn_24", $ = "_previousButton_nvvyn_47", j = "_button_nvvyn_90", q = "_buttonNoSteps_nvvyn_133", z = "_buttonWithSteps_nvvyn_137", G = "_progress_nvvyn_165", a = {
|
|
96
|
+
navigationContainer: D,
|
|
97
|
+
rowSpacing: H,
|
|
98
98
|
navigationButton: V,
|
|
99
99
|
nextButton: X,
|
|
100
100
|
previousButton: $,
|
|
@@ -132,7 +132,7 @@ const H = "_navigationContainer_nvvyn_1", W = "_rowSpacing_nvvyn_6", V = "_navig
|
|
|
132
132
|
}), /* @__PURE__ */ t.createElement(u.SubmitButton.SubmitButton.Icon, null, r.svg ? /* @__PURE__ */ t.createElement(P, {
|
|
133
133
|
...r,
|
|
134
134
|
ref: S,
|
|
135
|
-
className: b(
|
|
135
|
+
className: b(R, k, e)
|
|
136
136
|
}) : null), /* @__PURE__ */ t.createElement(u.SubmitButton.SubmitButton.Loader, {
|
|
137
137
|
className: a.progress
|
|
138
138
|
}))));
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { RicosViewer as
|
|
1
|
+
import { RicosViewer as J } from "@wix/ricos/viewer";
|
|
2
2
|
import y from "classnames";
|
|
3
|
-
import t, { useMemo as I, useState as
|
|
4
|
-
import { CheckboxGroup as
|
|
5
|
-
import { ak as
|
|
3
|
+
import t, { useMemo as I, useState as Q, useRef as N, useLayoutEffect as w, useCallback as k } from "react";
|
|
4
|
+
import { CheckboxGroup as B, TextField as K, Input as X, CheckboxField as Y, CheckboxButton as Z } from "react-aria-components";
|
|
5
|
+
import { ak as R, ah as M, au as S, am as U } from "./form-DQauhsho.js";
|
|
6
6
|
import { f as b, 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-D3-1L5sf.js";
|
|
8
|
+
import { L as $ } from "./field-label-headless-Du4ckIVy.js";
|
|
9
9
|
import { F as ee } from "./fieldset-headless-CD3fds9J.js";
|
|
10
10
|
import { E as te } from "./error-icon-hZxQ6DEy.js";
|
|
11
11
|
import { s as D } from "./field-rac.module-B4l_0KRU.js";
|
|
12
|
-
import {
|
|
13
|
-
import { u as ie } from "./use-element-state-class-name-
|
|
14
|
-
import { u as ce } from "./use-text-input-class-name-
|
|
12
|
+
import { v as oe, J as ne, M as ae, o as re, j as se, N as le } from "./form-element-classes-bLFmhsKw.js";
|
|
13
|
+
import { u as ie } from "./use-element-state-class-name-BatTc2bw.js";
|
|
14
|
+
import { u as ce } from "./use-text-input-class-name-LQ5S-NLh.js";
|
|
15
15
|
var ue = /* @__PURE__ */ (function(e) {
|
|
16
16
|
return e[e.FREE_FLOW = 0] = "FREE_FLOW", e[e.ONE = 1] = "ONE", e[e.TWO = 2] = "TWO", e[e.THREE = 3] = "THREE", e;
|
|
17
17
|
})({});
|
|
18
|
-
const
|
|
18
|
+
const v = "Other", de = (e, o) => {
|
|
19
19
|
const r = o.length + 2;
|
|
20
20
|
return (e.find((i) => i.startsWith(`${o}: `)) || "").slice(r);
|
|
21
21
|
}, me = (e) => e.map((o) => o.value ?? o.label), P = ({ className: e, ...o }) => {
|
|
@@ -24,18 +24,18 @@ const R = "Other", de = (e, o) => {
|
|
|
24
24
|
className: e
|
|
25
25
|
}, a);
|
|
26
26
|
}, q = ({ className: e }) => {
|
|
27
|
-
const { value: o, onChange: a, addOtherLabel: r, addOtherPlaceholder: l, otherInputCharacterLimit: i, disabled: u, readOnly: m, hasError: d } =
|
|
27
|
+
const { value: o, onChange: a, addOtherLabel: r, addOtherPlaceholder: l, otherInputCharacterLimit: i, disabled: u, readOnly: m, hasError: d } = R(), { t: p } = S(), n = r || p("add-other.default-other-option-label") || v, O = I(() => de(o || [], n), [
|
|
28
28
|
o,
|
|
29
29
|
n
|
|
30
|
-
]), [c, L] =
|
|
31
|
-
|
|
30
|
+
]), [c, L] = Q(O), f = N(a);
|
|
31
|
+
w(() => {
|
|
32
32
|
f.current = a;
|
|
33
33
|
});
|
|
34
|
-
const
|
|
34
|
+
const g = k((h) => {
|
|
35
35
|
L(h);
|
|
36
|
-
const
|
|
36
|
+
const C = (o || []).filter((E) => !E.startsWith(`${n}:`) && E !== n), _ = h ? `${n}: ${h}` : n;
|
|
37
37
|
f.current([
|
|
38
|
-
...
|
|
38
|
+
...C,
|
|
39
39
|
_
|
|
40
40
|
]);
|
|
41
41
|
}, [
|
|
@@ -44,7 +44,7 @@ const R = "Other", de = (e, o) => {
|
|
|
44
44
|
]);
|
|
45
45
|
return /* @__PURE__ */ t.createElement(K, {
|
|
46
46
|
value: c,
|
|
47
|
-
onChange:
|
|
47
|
+
onChange: g,
|
|
48
48
|
isDisabled: u,
|
|
49
49
|
isReadOnly: m,
|
|
50
50
|
isInvalid: d,
|
|
@@ -57,21 +57,21 @@ const R = "Other", de = (e, o) => {
|
|
|
57
57
|
className: e
|
|
58
58
|
}));
|
|
59
59
|
}, T = ({ children: e, className: o, ...a }) => {
|
|
60
|
-
const { value: r, label: l, isOther: i, isFirstOption: u } = a, { id: m, value: d, onChange: p, options: n, disabled: O, readOnly: c, hasError: L } =
|
|
60
|
+
const { value: r, label: l, isOther: i, isFirstOption: u } = a, { id: m, value: d, onChange: p, options: n, disabled: O, readOnly: c, hasError: L } = R(), f = N(null);
|
|
61
61
|
U(() => {
|
|
62
62
|
var E;
|
|
63
63
|
u && ((E = f.current) == null || E.focus({
|
|
64
64
|
preventScroll: !0
|
|
65
65
|
}));
|
|
66
66
|
}, m);
|
|
67
|
-
const
|
|
67
|
+
const g = b(e, P), h = I(() => d || [], [
|
|
68
68
|
d
|
|
69
|
-
]),
|
|
69
|
+
]), C = I(() => i ? h.find((E) => E === l || E.startsWith(`${l}: `)) || l : r, [
|
|
70
70
|
i,
|
|
71
71
|
h,
|
|
72
72
|
l,
|
|
73
73
|
r
|
|
74
|
-
]), _ =
|
|
74
|
+
]), _ = k((E) => {
|
|
75
75
|
const G = me(n || []), A = h.filter((j) => G.includes(j));
|
|
76
76
|
p(E ? [
|
|
77
77
|
...A,
|
|
@@ -85,22 +85,22 @@ const R = "Other", de = (e, o) => {
|
|
|
85
85
|
]);
|
|
86
86
|
return /* @__PURE__ */ t.createElement(Y, {
|
|
87
87
|
inputRef: f,
|
|
88
|
-
value:
|
|
88
|
+
value: C,
|
|
89
89
|
onChange: i ? _ : void 0,
|
|
90
90
|
isDisabled: O,
|
|
91
91
|
isReadOnly: c,
|
|
92
92
|
isInvalid: L
|
|
93
93
|
}, /* @__PURE__ */ t.createElement(Z, {
|
|
94
94
|
className: o,
|
|
95
|
-
"data-hook": `tags-${i ?
|
|
96
|
-
}, x(
|
|
95
|
+
"data-hook": `tags-${i ? v : r}`
|
|
96
|
+
}, x(g, {
|
|
97
97
|
value: r,
|
|
98
98
|
label: l,
|
|
99
99
|
isOther: i,
|
|
100
100
|
isFirstOption: u
|
|
101
101
|
})));
|
|
102
102
|
}, V = ({ children: e, className: o }) => {
|
|
103
|
-
const { options: a, addOther: r, addOtherLabel: l, numberOfColumns: i = ue.FREE_FLOW } =
|
|
103
|
+
const { options: a, addOther: r, addOtherLabel: l, numberOfColumns: i = ue.FREE_FLOW } = R(), { t: u } = S(), m = l || u("add-other.default-other-option-label") || v, d = b(e, T), p = I(() => {
|
|
104
104
|
const n = a || [];
|
|
105
105
|
return r ? [
|
|
106
106
|
...n,
|
|
@@ -121,7 +121,7 @@ const R = "Other", de = (e, o) => {
|
|
|
121
121
|
}, p.map((n, O) => {
|
|
122
122
|
const c = n.value ?? n.label;
|
|
123
123
|
return x(d, {
|
|
124
|
-
key: n.isOther ?
|
|
124
|
+
key: n.isOther ? v : c,
|
|
125
125
|
value: c,
|
|
126
126
|
label: n.label,
|
|
127
127
|
isOther: n.isOther,
|
|
@@ -129,7 +129,7 @@ const R = "Other", de = (e, o) => {
|
|
|
129
129
|
});
|
|
130
130
|
}));
|
|
131
131
|
}, z = ({ children: e, className: o }) => {
|
|
132
|
-
const { addOther: a, addOtherLabel: r, hasError: l, readOnly: i, value: u } =
|
|
132
|
+
const { addOther: a, addOtherLabel: r, hasError: l, readOnly: i, value: u } = R(), { t: m } = S(), d = r || m("add-other.default-other-option-label") || v, p = b(e, V), n = b(e, q), O = I(() => !a || !u ? !1 : u.some((c) => c === d || c.startsWith(`${d}:`)), [
|
|
133
133
|
a,
|
|
134
134
|
u,
|
|
135
135
|
d
|
|
@@ -140,12 +140,12 @@ const R = "Other", de = (e, o) => {
|
|
|
140
140
|
"data-readonly": i
|
|
141
141
|
}, p, O && n);
|
|
142
142
|
}, s = ({ children: e }) => {
|
|
143
|
-
const { id: o, value: a, onChange: r, FieldLayout: l, required: i, disabled: u, readOnly: m, hasError: d, onBlur: p, onFocus: n } =
|
|
143
|
+
const { id: o, value: a, onChange: r, FieldLayout: l, required: i, disabled: u, readOnly: m, hasError: d, onBlur: p, onFocus: n } = R(), { inputId: O, labelId: c, ariaDescribedBy: L } = M(), f = I(() => a || [], [
|
|
144
144
|
a
|
|
145
|
-
]),
|
|
145
|
+
]), g = b(e, $), h = b(e, z), C = b(e, H), _ = b(e, W);
|
|
146
146
|
return /* @__PURE__ */ t.createElement(l, {
|
|
147
147
|
fieldId: o,
|
|
148
|
-
renderLabel: () =>
|
|
148
|
+
renderLabel: () => g,
|
|
149
149
|
renderInput: () => /* @__PURE__ */ t.createElement(ee, {
|
|
150
150
|
id: O,
|
|
151
151
|
ariaLabelledBy: c,
|
|
@@ -153,7 +153,7 @@ const R = "Other", de = (e, o) => {
|
|
|
153
153
|
required: i,
|
|
154
154
|
onBlur: p,
|
|
155
155
|
onFocus: n
|
|
156
|
-
}, /* @__PURE__ */ t.createElement(
|
|
156
|
+
}, /* @__PURE__ */ t.createElement(B, {
|
|
157
157
|
"aria-labelledby": c,
|
|
158
158
|
value: f,
|
|
159
159
|
onChange: r,
|
|
@@ -162,7 +162,7 @@ const R = "Other", de = (e, o) => {
|
|
|
162
162
|
isRequired: i,
|
|
163
163
|
isInvalid: d
|
|
164
164
|
}, h)),
|
|
165
|
-
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, _,
|
|
165
|
+
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, _, C)
|
|
166
166
|
});
|
|
167
167
|
};
|
|
168
168
|
V.Option = T;
|
|
@@ -179,14 +179,14 @@ const pe = "_control_11yzo_1", he = "_options_11yzo_8", Ee = "_option_11yzo_8",
|
|
|
179
179
|
option: Ee,
|
|
180
180
|
optionHover: Oe,
|
|
181
181
|
optionSelected: be
|
|
182
|
-
}, fe = ({ content: e, locale: o }) => /* @__PURE__ */ t.createElement(
|
|
182
|
+
}, fe = ({ content: e, locale: o }) => /* @__PURE__ */ t.createElement(J, {
|
|
183
183
|
content: e,
|
|
184
184
|
locale: o
|
|
185
185
|
}), Ie = {
|
|
186
186
|
base: F.option,
|
|
187
187
|
selected: F.optionSelected,
|
|
188
188
|
hover: F.optionHover
|
|
189
|
-
},
|
|
189
|
+
}, ke = () => {
|
|
190
190
|
const e = ie({
|
|
191
191
|
globalClasses: le,
|
|
192
192
|
moduleClasses: Ie
|
|
@@ -213,5 +213,5 @@ const pe = "_control_11yzo_1", he = "_options_11yzo_8", Ee = "_option_11yzo_8",
|
|
|
213
213
|
}, fe));
|
|
214
214
|
};
|
|
215
215
|
export {
|
|
216
|
-
|
|
216
|
+
ke as T
|
|
217
217
|
};
|