@wix/form-elements 1.106.0 → 1.108.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-D2F4vgf1.js → appointment-rac-ZAp8oWbK.js} +289 -290
- package/dist/component/{bookings-address-rac-_5S8J8_i.js → bookings-address-rac-x-Az7vHf.js} +1 -1
- package/dist/component/{bookings-email-rac-6vmDR9nS.js → bookings-email-rac-MoF_CaqB.js} +1 -1
- package/dist/component/{bookings-first-name-rac-DtTJ4T2K.js → bookings-first-name-rac-CWh3Rb0M.js} +1 -1
- package/dist/component/{bookings-header-rac-B3dsEwzR.js → bookings-header-rac-BVTiXUWk.js} +1 -1
- package/dist/component/{bookings-last-name-rac-B3idkbi8.js → bookings-last-name-rac-kXRRlyHl.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-CrRBcQwT.js → bookings-login-bar-rac-C4Zr6kXE.js} +23 -24
- package/dist/component/{bookings-phone-rac-BE0yWNnj.js → bookings-phone-rac-2rz1m_xi.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-CYo1l0-6.js → bookings-rich-text-rac-BEjGypQw.js} +1 -1
- package/dist/component/{checkbox-field-rac-boTtXVEt.js → checkbox-field-rac-DwEQLIaz.js} +66 -67
- package/dist/component/{checkbox-group-field-headless-DnkUvDm8.js → checkbox-group-field-headless-BsOww_QB.js} +37 -37
- package/dist/component/{checkbox-group-field-rac-DrDTgHMg.js → checkbox-group-field-rac-DTcZcVS6.js} +6 -6
- package/dist/component/{checkbox-group-rac-v3ozUBpo.js → checkbox-group-rac-DQsML-pW.js} +1 -1
- package/dist/component/{checkbox-rac-YSLE-RnG.js → checkbox-rac-irEBBOxP.js} +1 -1
- package/dist/component/{contacts-address-rac-C653yaHZ.js → contacts-address-rac-B5bSAYrm.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-BeAQ6shx.js → contacts-birthdate-rac-DyScj8f4.js} +1 -1
- package/dist/component/{contacts-company-rac-BglKOoTG.js → contacts-company-rac-C5X9-jXa.js} +1 -1
- package/dist/component/{contacts-email-rac-D6m7ynfc.js → contacts-email-rac-B0vkfmrS.js} +1 -1
- package/dist/component/{contacts-first-name-rac-Dgxn0tUJ.js → contacts-first-name-rac-Cfil3U_e.js} +1 -1
- package/dist/component/{contacts-last-name-rac-1UyIuRKH.js → contacts-last-name-rac-CtPLE-7-.js} +1 -1
- package/dist/component/{contacts-phone-rac-BQ77BlW4.js → contacts-phone-rac-YkzsAoBZ.js} +1 -1
- package/dist/component/{contacts-position-rac-BUDUv7lv.js → contacts-position-rac-BS4j8QC-.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-DdtA0qKW.js → contacts-subscribe-rac-z_9VsEZL.js} +1 -1
- package/dist/component/{contacts-tax-id-rac-WUaKcNl0.js → contacts-tax-id-rac-WFkmKyZv.js} +1 -1
- package/dist/component/{date-availability-XjBFq8jt.js → date-availability-NN3rxosk.js} +1 -1
- package/dist/component/{date-input-field-rac-aY2zuuKs.js → date-input-field-rac-mdhEC3oq.js} +88 -89
- package/dist/component/{date-input-rac-DRiP2_97.js → date-input-rac-CGciuoTx.js} +1 -1
- package/dist/component/{date-picker-field-rac-Bzl-d3Uj.js → date-picker-field-rac-CRZVODfF.js} +90 -91
- package/dist/component/{date-picker-rac-DHHUh8vn.js → date-picker-rac-Bfbvjy8W.js} +1 -1
- package/dist/component/{date-time-input-field-rac-DP_StuLr.js → date-time-input-field-rac-TDWBXZ44.js} +76 -77
- package/dist/component/{date-time-input-rac-B11KIxsf.js → date-time-input-rac-DY0qdSix.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-BHZBqyWv.js → dext-checkbox-group-rac-BFGM7SOt.js} +2 -2
- package/dist/component/{dext-checkbox-rac-BIlAqEvV.js → dext-checkbox-rac-DPZvTeUZ.js} +1 -1
- package/dist/component/{dext-date-picker-rac-CHBXNrZi.js → dext-date-picker-rac-Xd5kojsQ.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-BYtliKry.js → dext-date-time-input-rac-C0RIdxJW.js} +1 -1
- package/dist/component/{dext-dropdown-rac-C2VPSFV5.js → dext-dropdown-rac-D1m8vJvm.js} +1 -1
- package/dist/component/{dext-email-rac-Fnb0Ggcs.js → dext-email-rac-BC81RFYY.js} +1 -1
- package/dist/component/{dext-number-input-rac-DopfSyFi.js → dext-number-input-rac-Z_ih9FfX.js} +1 -1
- package/dist/component/{dext-phone-rac-Rn4i_2rc.js → dext-phone-rac-s3BOnXuI.js} +1 -1
- package/dist/component/{dext-radio-group-rac-bNaskJpK.js → dext-radio-group-rac-CL3jcezs.js} +2 -2
- package/dist/component/{dext-rating-input-rac-DL6ZZd7d.js → dext-rating-input-rac-wz1EyP5b.js} +1 -1
- package/dist/component/{dext-tags-rac-TsUPoImO.js → dext-tags-rac-BY4Rf2BP.js} +2 -2
- package/dist/component/{dext-text-area-rac-BIuY7LTd.js → dext-text-area-rac-DRJzlsq8.js} +1 -1
- package/dist/component/{dext-text-input-rac-CSYPW0Qi.js → dext-text-input-rac-BGcRNNAi.js} +1 -1
- package/dist/component/{dext-url-input-rac-_g0lqGfW.js → dext-url-input-rac-CRAIm8yp.js} +1 -1
- package/dist/component/{donation-rac-BYKFtsyR.js → donation-rac-BlTfOIlE.js} +83 -84
- package/dist/component/{dropdown-field-headless-CBaqlNZi.js → dropdown-field-headless-DhzRAMcM.js} +12 -12
- package/dist/component/{dropdown-field-rac-CCAGSMm3.js → dropdown-field-rac-DXyY5we-.js} +5 -5
- package/dist/component/{dropdown-rac-C_EqUsZ1.js → dropdown-rac-C6YM6qxm.js} +1 -1
- package/dist/component/{ecom-address-rac-Bw9eH0iF.js → ecom-address-rac-CAdr7wya.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-B5PVOO2a.js → ecom-subscription-checkbox-rac-Z2VMuCbt.js} +6 -6
- package/dist/component/{email-input-field-rac-B2kqQ6yo.js → email-input-field-rac-DpkfunVK.js} +53 -54
- package/dist/component/{events-repeater-rac--4OnUxWE.js → events-repeater-rac-CuJkdrPo.js} +61 -62
- package/dist/component/{events-rsvp-rac-CczCoo3T.js → events-rsvp-rac-BKWlSeQ9.js} +8 -8
- package/dist/component/{field-error-headless-D3-1L5sf.js → field-error-headless-tsg9FQ-_.js} +12 -12
- package/dist/component/{field-label-headless-Du4ckIVy.js → field-label-headless-CB8dEat8.js} +11 -11
- package/dist/component/{file-upload-rac-DbdkUbWM.js → file-upload-rac-ZdgYt646.js} +67 -68
- package/dist/component/{fixed-payment-rac-f9-01iDN.js → fixed-payment-rac-CuIQEeHh.js} +20 -21
- package/dist/component/{form-DQauhsho.js → form-0jt4L5xo.js} +3045 -2896
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +1 -1
- package/dist/component/header-field-rac-CWVGzxKb.js +24 -0
- package/dist/component/{header-rac-CR9T3Pnu.js → header-rac-D6KsV-ko.js} +1 -1
- package/dist/component/{image-choice-rac-DJ_8v467.js → image-choice-rac-CUCyVS8c.js} +29 -30
- package/dist/component/{index-BB7d_9Dv.js → index-TJSnVtCO.js} +72 -72
- package/dist/component/{index-CcUTIUWM.js → index-iOqQidgV.js} +12 -12
- package/dist/component/{isObjectLike-xvPa_08X.js → isObjectLike-DQbx8r1c.js} +1 -1
- package/dist/component/{multiline-address-field-rac-CyaFOloE.js → multiline-address-field-rac-DtZ1NTfD.js} +186 -187
- package/dist/component/{multiline-address-rac-CaHGUN_f.js → multiline-address-rac-ub-_XzHU.js} +1 -1
- package/dist/component/number-input-field-rac-DLItn4DK.js +92 -0
- package/dist/component/{number-input-rac-DMKX6nhk.js → number-input-rac-UuxJzqEx.js} +1 -1
- package/dist/component/{password-rac-0RUXPAn6.js → password-rac-Di6q96Rn.js} +37 -38
- package/dist/component/{payment-input-rac-CHSZ3-Lt.js → payment-input-rac-CG6c4-Ge.js} +52 -53
- package/dist/component/{phone-input-field-rac-JmIFcP1e.js → phone-input-field-rac-D4JphCuT.js} +75 -76
- package/dist/component/{phone-rac-BLRnAPXP.js → phone-rac-_vDw2usa.js} +1 -1
- package/dist/component/{product-list-rac-BkF5tDwt.js → product-list-rac-CgxRlj1f.js} +73 -74
- package/dist/component/{quiz-radio-group-rac-32cCMTUS.js → quiz-radio-group-rac-bi26aGxN.js} +1 -1
- package/dist/component/{radio-button-module-classes-IOulhuSH.js → radio-button-module-classes-DDJq2ESf.js} +33 -33
- package/dist/component/{radio-group-field-rac-CJwku6e0.js → radio-group-field-rac-D1aMVO6l.js} +4 -4
- package/dist/component/{radio-group-rac-BiW-9Abj.js → radio-group-rac-HKC85M6t.js} +1 -1
- package/dist/component/{rating-input-field-rac-B9cwaROK.js → rating-input-field-rac-CpRehxFB.js} +42 -43
- package/dist/component/{rating-input-rac-BpwlNvzQ.js → rating-input-rac-BMuCZ3oj.js} +1 -1
- package/dist/component/{rich-content-rac.module-B1uyPmtK.js → rich-content-rac.module-mZ6xoAOd.js} +4 -4
- package/dist/component/rich-text-field-rac-CUK8V8Kf.js +21 -0
- package/dist/component/{rich-text-rac-VfeZxS27.js → rich-text-rac-B-7sR2FJ.js} +1 -1
- package/dist/component/{service-dropdown-rac-BCfs8IhW.js → service-dropdown-rac-1DDNT5bn.js} +43 -44
- package/dist/component/{services-multi-choice-rac-CCqdF_7P.js → services-multi-choice-rac-CB-6dwxz.js} +21 -22
- package/dist/component/{signature-rac-DOyMo3u0.js → signature-rac-7XBci6P2.js} +35 -36
- package/dist/component/{submit-button-rac-C2uA5DeE.js → submit-button-rac-B1-Mk8Gg.js} +21 -22
- package/dist/component/{tags-field-rac-C_uIw2by.js → tags-field-rac-CQ9Y7mq-.js} +49 -50
- package/dist/component/{tags-rac-1pQ-fpe_.js → tags-rac-Visic-Ml.js} +1 -1
- package/dist/component/{text-area-field-rac-DqlOkm7e.js → text-area-field-rac-C8fP1g-w.js} +31 -32
- package/dist/component/{text-area-rac-DPdkrFcH.js → text-area-rac-B6yZxzxm.js} +1 -1
- package/dist/component/{text-input-field-rac-CmXm6r1w.js → text-input-field-rac-CNjbOxD1.js} +5 -5
- package/dist/component/{text-input-headless-DD__2DFf.js → text-input-headless-Bm8PJGep.js} +12 -12
- package/dist/component/{text-input-rac-DRHyQEH7.js → text-input-rac-BEPC1Z-4.js} +1 -1
- package/dist/component/{time-input-rac-BJPIymQY.js → time-input-rac-3m6C_Jp5.js} +41 -42
- package/dist/component/url-input-field-rac-CIk_6Lf6.js +74 -0
- package/dist/component/{url-input-rac-C0ChQUzq.js → url-input-rac-DyVoygXH.js} +1 -1
- package/dist/component/use-dropdown-option-class-name-McG3ayOT.js +21 -0
- package/dist/component/{use-element-state-class-name-BatTc2bw.js → use-element-state-class-name-B9MBWX44.js} +1 -1
- package/dist/component/{use-is-forced-open-dropdown-B0jiPTmS.js → use-is-forced-open-dropdown-r5G_sZsO.js} +7 -7
- package/dist/component/{use-service-options-base-oeE7xszw.js → use-service-options-base-hcbkvhpw.js} +7 -7
- package/dist/component/use-text-input-class-name-SnurFqAr.js +23 -0
- package/dist/form.d.ts +3 -1
- package/package.json +2 -2
- package/dist/component/form-element-classes-bLFmhsKw.js +0 -137
- package/dist/component/header-field-rac-DamDk5BR.js +0 -25
- package/dist/component/number-input-field-rac-BuYUzDWV.js +0 -93
- package/dist/component/rich-text-field-rac-C_qE7Ykg.js +0 -22
- package/dist/component/url-input-field-rac-CFDYkZ6I.js +0 -75
- package/dist/component/use-dropdown-option-class-name-3L5ZmNLK.js +0 -21
- package/dist/component/use-text-input-class-name-LQ5S-NLh.js +0 -24
package/dist/component/{field-label-headless-Du4ckIVy.js → field-label-headless-CB8dEat8.js}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b5 as m, an as d, ao as p, b2 as D, bf as B } from "./form-0jt4L5xo.js";
|
|
2
2
|
import l from "react";
|
|
3
3
|
import { f as L } from "./find-child-C60k4CxG.js";
|
|
4
|
-
import { sdk as
|
|
4
|
+
import { sdk as g } from "@wix/image-kit";
|
|
5
5
|
function N({ id: e, width: t, height: n }, a, r, o = "fill") {
|
|
6
|
-
return (o === "fit" ?
|
|
6
|
+
return (o === "fit" ? g.getScaleToFitImageURL : g.getScaleToFillImageURL)(e, t, n, typeof a == "number" ? a : parseInt(a, 10), typeof r == "number" ? r : parseInt(r, 10));
|
|
7
7
|
}
|
|
8
|
-
var
|
|
8
|
+
var u = /* @__PURE__ */ (function(e) {
|
|
9
9
|
return e.TOP = "top", e.BOTTOM = "bottom", e;
|
|
10
10
|
})({});
|
|
11
11
|
const S = {
|
|
@@ -15,14 +15,14 @@ const S = {
|
|
|
15
15
|
margin: 0,
|
|
16
16
|
padding: 0
|
|
17
17
|
}, U = "", i = ({ children: e, className: t, ...n }) => {
|
|
18
|
-
const { as: a = "label", requiredIndicatorHidden: r = !1, label: o } = n, { label: T, required:
|
|
18
|
+
const { as: a = "label", requiredIndicatorHidden: r = !1, label: o } = n, { label: T, required: R = !1, hideLabel: F = !1, requiredIndicatorType: q = d.ASTERISK, requiredIndicatorPlacement: O = p.AFTER_FIELD_TITLE, media: y, mediaSettings: s } = m(), { labelId: A, inputId: P } = D(), _ = a, b = R && !r ? L(e, i.Required) : null, c = y ? L(e, i.Image) : null, f = (s == null ? void 0 : s.imagePosition) ?? u.TOP, h = q === d.ASTERISK && O === p.BEFORE_FIELD_TITLE, E = (o ?? T) || U, I = /* @__PURE__ */ l.createElement(_, {
|
|
19
19
|
id: A,
|
|
20
20
|
htmlFor: a === "label" ? P : void 0,
|
|
21
21
|
className: t,
|
|
22
22
|
style: F ? S : void 0
|
|
23
|
-
}, h ? /* @__PURE__ */ l.createElement(l.Fragment, null,
|
|
24
|
-
return
|
|
25
|
-
},
|
|
23
|
+
}, h ? /* @__PURE__ */ l.createElement(l.Fragment, null, b, E) : /* @__PURE__ */ l.createElement(l.Fragment, null, E, b));
|
|
24
|
+
return c ? /* @__PURE__ */ l.createElement("div", null, f === u.TOP ? c : null, I, f === u.BOTTOM ? c : null) : I;
|
|
25
|
+
}, v = ({ className: e }) => {
|
|
26
26
|
const { t } = B(), { requiredIndicatorType: n } = m();
|
|
27
27
|
return n === d.TEXT ? /* @__PURE__ */ l.createElement("span", {
|
|
28
28
|
className: e,
|
|
@@ -31,7 +31,7 @@ const S = {
|
|
|
31
31
|
className: e,
|
|
32
32
|
"aria-hidden": "true"
|
|
33
33
|
}, "*");
|
|
34
|
-
},
|
|
34
|
+
}, x = ({ className: e }) => {
|
|
35
35
|
const { media: t, mediaSettings: n } = m();
|
|
36
36
|
if (!t)
|
|
37
37
|
return null;
|
|
@@ -44,8 +44,8 @@ const S = {
|
|
|
44
44
|
"data-alignment": n == null ? void 0 : n.imageAlignment
|
|
45
45
|
}) : null;
|
|
46
46
|
};
|
|
47
|
-
i.Required =
|
|
48
|
-
i.Image =
|
|
47
|
+
i.Required = v;
|
|
48
|
+
i.Image = x;
|
|
49
49
|
export {
|
|
50
50
|
i as L,
|
|
51
51
|
N as g
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import t, { useState as
|
|
1
|
+
import t, { useState as Q, useRef as V, useMemo as oe, useEffect as se, useCallback as P, createContext as pe, useContext as fe } from "react";
|
|
2
2
|
import { RicosViewer as Ee } from "@wix/ricos/viewer";
|
|
3
3
|
import B from "classnames";
|
|
4
|
-
import {
|
|
5
|
-
import { E as
|
|
4
|
+
import { b1 as Fe, bf as ie, ba as ge, a9 as he, bd as be, a2 as re, be as xe, b2 as ce, b5 as j, b7 as Ce, H as ne, T as Le, _ as De, p as le, u as ae } from "./form-0jt4L5xo.js";
|
|
5
|
+
import { E as Ne } from "./error-icon-hZxQ6DEy.js";
|
|
6
6
|
import { s as I } from "./field-rac.module-B4l_0KRU.js";
|
|
7
|
-
import { v as ne, J as De, Q as Ne, j as le, o as ae } from "./form-element-classes-bLFmhsKw.js";
|
|
8
7
|
import { f as h, a as z } from "./find-child-C60k4CxG.js";
|
|
9
|
-
import { b as ve, a as ye, D as _e, E as Te } from "./field-error-headless-
|
|
10
|
-
import { L as Be } from "./field-label-headless-
|
|
8
|
+
import { b as ve, a as ye, D as _e, E as Te } from "./field-error-headless-tsg9FQ-_.js";
|
|
9
|
+
import { L as Be } from "./field-label-headless-CB8dEat8.js";
|
|
11
10
|
import { DropZone as Re, Text as Se, FileTrigger as Me, Button as de, ProgressBar as Ie } from "react-aria-components";
|
|
12
11
|
const we = {
|
|
13
12
|
Video: "video/*",
|
|
@@ -21,13 +20,13 @@ const we = {
|
|
|
21
20
|
return async (o, i, d) => {
|
|
22
21
|
if (!(r != null && r.uploadFile) || !o.length)
|
|
23
22
|
return r != null && r.uploadFile || console.error("No uploadFile action"), o.length || console.error("No files to upload"), [];
|
|
24
|
-
const
|
|
23
|
+
const b = o.map(({ file: l }) => r.uploadFile({
|
|
25
24
|
file: l,
|
|
26
25
|
formId: n,
|
|
27
26
|
uploadTarget: e
|
|
28
27
|
}).then((s) => {
|
|
29
|
-
const { id:
|
|
30
|
-
fileId:
|
|
28
|
+
const { id: x, displayName: m, url: c, isPrivate: N } = s, v = {
|
|
29
|
+
fileId: x,
|
|
31
30
|
displayName: m || l.name,
|
|
32
31
|
url: N ? void 0 : c,
|
|
33
32
|
fileType: l.type || "application/octet-stream"
|
|
@@ -39,11 +38,11 @@ const we = {
|
|
|
39
38
|
}).catch((s) => {
|
|
40
39
|
d(s, l);
|
|
41
40
|
}));
|
|
42
|
-
return (await Promise.all(
|
|
41
|
+
return (await Promise.all(b)).filter((l) => l !== void 0);
|
|
43
42
|
};
|
|
44
43
|
};
|
|
45
|
-
function Ze({ valueSliderLimit: e, value: r, explanationText: n, target: o, onChange: i, uploadFileFormats: d, onBlur:
|
|
46
|
-
const [l, s] =
|
|
44
|
+
function Ze({ valueSliderLimit: e, value: r, explanationText: n, target: o, onChange: i, uploadFileFormats: d, onBlur: b, onFilesCleared: D }) {
|
|
45
|
+
const [l, s] = Q(Ue(r)), [x, m] = Q(r || []), [c, N] = Q(), v = Ae(o), { t: E } = ie(), U = ge().includes(he.BUTTONS_HOVER), { setFormStatus: y } = be(), S = V(!1), _ = V(i);
|
|
47
46
|
_.current = i;
|
|
48
47
|
const C = oe(() => l.some((u) => u.state === "uploading"), [
|
|
49
48
|
l
|
|
@@ -55,7 +54,7 @@ function Ze({ valueSliderLimit: e, value: r, explanationText: n, target: o, onCh
|
|
|
55
54
|
y,
|
|
56
55
|
o
|
|
57
56
|
]);
|
|
58
|
-
const
|
|
57
|
+
const k = P(() => {
|
|
59
58
|
if (!l.length)
|
|
60
59
|
return n;
|
|
61
60
|
const F = l.filter((u) => u.state === "uploading").length;
|
|
@@ -113,8 +112,8 @@ function Ze({ valueSliderLimit: e, value: r, explanationText: n, target: o, onCh
|
|
|
113
112
|
}
|
|
114
113
|
}, q = (F) => {
|
|
115
114
|
const u = l[F];
|
|
116
|
-
if (
|
|
117
|
-
const g =
|
|
115
|
+
if (x && i && u.state !== "error") {
|
|
116
|
+
const g = x.filter((f) => f.displayName !== u.file.name);
|
|
118
117
|
i(g), m(g);
|
|
119
118
|
const p = l.filter((f) => f.file.name !== u.file.name);
|
|
120
119
|
s(p), p.length === 0 && D();
|
|
@@ -123,22 +122,22 @@ function Ze({ valueSliderLimit: e, value: r, explanationText: n, target: o, onCh
|
|
|
123
122
|
s(g), g.length === 0 && D();
|
|
124
123
|
}
|
|
125
124
|
}, $ = () => {
|
|
126
|
-
c && N(void 0),
|
|
127
|
-
}, K = d.map((F) => we[F]).join(),
|
|
125
|
+
c && N(void 0), b();
|
|
126
|
+
}, K = d.map((F) => we[F]).join(), H = P(() => {
|
|
128
127
|
s([]), m([]);
|
|
129
128
|
}, []);
|
|
130
|
-
return
|
|
129
|
+
return xe(H), {
|
|
131
130
|
files: l,
|
|
132
131
|
limitError: c,
|
|
133
|
-
hover:
|
|
134
|
-
getExplanationText:
|
|
132
|
+
hover: U,
|
|
133
|
+
getExplanationText: k,
|
|
135
134
|
handleChange: O,
|
|
136
135
|
handleDelete: q,
|
|
137
136
|
accept: K,
|
|
138
137
|
handleBlur: $
|
|
139
138
|
};
|
|
140
139
|
}
|
|
141
|
-
function
|
|
140
|
+
function Ue(e = []) {
|
|
142
141
|
const r = e || [];
|
|
143
142
|
try {
|
|
144
143
|
return r.map((n) => ({
|
|
@@ -162,28 +161,28 @@ function Z() {
|
|
|
162
161
|
return e;
|
|
163
162
|
}
|
|
164
163
|
const A = ({ children: e, className: r }) => {
|
|
165
|
-
const { ariaDescribedBy: n } = ce(), { disabled: o, hasError: i } = j(), { handleFileChange: d } = Z(),
|
|
164
|
+
const { ariaDescribedBy: n } = ce(), { disabled: o, hasError: i } = j(), { handleFileChange: d } = Z(), b = h(e, A.Title), D = h(e, A.Subtitle), l = h(e, A.Button);
|
|
166
165
|
return /* @__PURE__ */ t.createElement(Re, {
|
|
167
166
|
"aria-describedby": n,
|
|
168
167
|
className: r,
|
|
169
168
|
"data-invalid": i,
|
|
170
169
|
isDisabled: o,
|
|
171
170
|
onDrop: async (s) => {
|
|
172
|
-
const
|
|
171
|
+
const x = [];
|
|
173
172
|
for (const m of s.items)
|
|
174
173
|
if (m.kind === "file") {
|
|
175
174
|
const c = await m.getFile();
|
|
176
|
-
c &&
|
|
175
|
+
c && x.push(c);
|
|
177
176
|
}
|
|
178
|
-
if (
|
|
177
|
+
if (x.length > 0) {
|
|
179
178
|
const m = new DataTransfer();
|
|
180
|
-
|
|
179
|
+
x.forEach((c) => m.items.add(c)), d(m.files);
|
|
181
180
|
}
|
|
182
181
|
}
|
|
183
182
|
}, /* @__PURE__ */ t.createElement(Se, {
|
|
184
183
|
slot: "label"
|
|
185
|
-
},
|
|
186
|
-
},
|
|
184
|
+
}, b, D), l);
|
|
185
|
+
}, ke = ({ className: e, children: r }) => {
|
|
187
186
|
const { limitReached: n } = Z();
|
|
188
187
|
return /* @__PURE__ */ t.createElement("p", {
|
|
189
188
|
className: e
|
|
@@ -197,15 +196,15 @@ const A = ({ children: e, className: r }) => {
|
|
|
197
196
|
}, r({
|
|
198
197
|
limitReached: n
|
|
199
198
|
}));
|
|
200
|
-
},
|
|
201
|
-
const { ariaDescribedBy: o, inputId: i, labelId: d, errorId:
|
|
199
|
+
}, J = ({ className: e, children: r, "aria-roledescription": n }) => {
|
|
200
|
+
const { ariaDescribedBy: o, inputId: i, labelId: d, errorId: b } = ce(), { disabled: D, required: l, onFocus: s, hasError: x, errorMessage: m } = j(), { handleFileChange: c, accept: N, multiple: v, buttonRef: E, handleBlur: R, limitError: U, files: y } = Z(), S = (y == null ? void 0 : y.some((C) => C.errorMessage)) ?? !1, _ = !!(x || m || U || S);
|
|
202
201
|
return /* @__PURE__ */ t.createElement(Me, {
|
|
203
202
|
acceptedFileTypes: N ? N.split(",") : void 0,
|
|
204
203
|
allowsMultiple: v,
|
|
205
204
|
onSelect: (C) => {
|
|
206
205
|
if (C) {
|
|
207
|
-
const
|
|
208
|
-
|
|
206
|
+
const k = Array.from(C), M = new DataTransfer();
|
|
207
|
+
k.forEach((O) => M.items.add(O)), c(M.files);
|
|
209
208
|
}
|
|
210
209
|
}
|
|
211
210
|
}, /* @__PURE__ */ t.createElement(de, {
|
|
@@ -214,7 +213,7 @@ const A = ({ children: e, className: r }) => {
|
|
|
214
213
|
"aria-labelledby": d,
|
|
215
214
|
"aria-describedby": [
|
|
216
215
|
o,
|
|
217
|
-
|
|
216
|
+
b
|
|
218
217
|
].filter(Boolean).join(" "),
|
|
219
218
|
render: (C) => /* @__PURE__ */ t.createElement("button", {
|
|
220
219
|
...C,
|
|
@@ -233,15 +232,15 @@ const A = ({ children: e, className: r }) => {
|
|
|
233
232
|
className: e
|
|
234
233
|
}, r);
|
|
235
234
|
};
|
|
236
|
-
|
|
237
|
-
A.Title =
|
|
235
|
+
J.Text = Pe;
|
|
236
|
+
A.Title = ke;
|
|
238
237
|
A.Subtitle = Oe;
|
|
239
|
-
A.Button =
|
|
238
|
+
A.Button = J;
|
|
240
239
|
const T = ({ children: e, className: r, ...n }) => {
|
|
241
|
-
const { file: o, index: i } = n, d = o.file.name,
|
|
240
|
+
const { file: o, index: i } = n, d = o.file.name, b = h(e, T.Name), D = h(e, T.Remove), l = h(e, T.Spinner), s = h(e, T.Error);
|
|
242
241
|
return /* @__PURE__ */ t.createElement("div", {
|
|
243
242
|
className: r
|
|
244
|
-
}, z(
|
|
243
|
+
}, z(b, {
|
|
245
244
|
fileName: d
|
|
246
245
|
}), o.state === "uploading" ? l : z(D, {
|
|
247
246
|
index: i,
|
|
@@ -255,7 +254,7 @@ const T = ({ children: e, className: r, ...n }) => {
|
|
|
255
254
|
className: e
|
|
256
255
|
}, n);
|
|
257
256
|
}, Ve = ({ className: e, "aria-label": r, children: n, ...o }) => {
|
|
258
|
-
const { fileName: i, index: d } = o, { disabled:
|
|
257
|
+
const { fileName: i, index: d } = o, { disabled: b } = j(), { handleDelete: D, fileRemoveButtonRefs: l } = Z(), s = V(null);
|
|
259
258
|
se(() => {
|
|
260
259
|
const m = l.current, c = i;
|
|
261
260
|
return m[c] = s, () => {
|
|
@@ -265,17 +264,17 @@ const T = ({ children: e, className: r, ...n }) => {
|
|
|
265
264
|
i,
|
|
266
265
|
l
|
|
267
266
|
]);
|
|
268
|
-
const
|
|
267
|
+
const x = () => {
|
|
269
268
|
D(d);
|
|
270
269
|
};
|
|
271
270
|
return /* @__PURE__ */ t.createElement(de, {
|
|
272
271
|
ref: s,
|
|
273
|
-
"aria-disabled":
|
|
272
|
+
"aria-disabled": b,
|
|
274
273
|
"aria-label": r,
|
|
275
274
|
"aria-description": i,
|
|
276
|
-
onClick:
|
|
275
|
+
onClick: x,
|
|
277
276
|
className: e,
|
|
278
|
-
isDisabled:
|
|
277
|
+
isDisabled: b
|
|
279
278
|
}, n);
|
|
280
279
|
}, ue = ({ className: e, children: r, ...n }) => {
|
|
281
280
|
const { errorMessage: o } = n;
|
|
@@ -306,23 +305,23 @@ const X = ({ children: e, className: r }) => {
|
|
|
306
305
|
})));
|
|
307
306
|
};
|
|
308
307
|
X.File = T;
|
|
309
|
-
const
|
|
310
|
-
const { id: r, value: n, onChange: o, uploadFileFormats: i, valueSliderLimit: d, target:
|
|
308
|
+
const G = (e) => e.file.name, a = ({ children: e }) => {
|
|
309
|
+
const { id: r, value: n, onChange: o, uploadFileFormats: i, valueSliderLimit: d, target: b, explanationText: D, onBlur: l, hasError: s, errorMessage: x, FieldLayout: m } = j(), c = V(null), N = V({}), v = P(() => {
|
|
311
310
|
var L;
|
|
312
311
|
(L = c.current) == null || L.focus();
|
|
313
|
-
}, []), { files: E, limitError: R, hover:
|
|
312
|
+
}, []), { files: E, limitError: R, hover: U, getExplanationText: y, handleBlur: S, handleChange: _, handleDelete: C, accept: k } = Ze({
|
|
314
313
|
valueSliderLimit: d,
|
|
315
314
|
value: n,
|
|
316
315
|
explanationText: D,
|
|
317
|
-
target:
|
|
316
|
+
target: b,
|
|
318
317
|
onChange: o,
|
|
319
318
|
uploadFileFormats: i,
|
|
320
319
|
onBlur: l,
|
|
321
320
|
onFilesCleared: v
|
|
322
321
|
}), M = P((L) => {
|
|
323
322
|
var te;
|
|
324
|
-
const ee = E[L], W =
|
|
325
|
-
E.length > 1 && ((te = (E.filter((Y) =>
|
|
323
|
+
const ee = E[L], W = G(ee);
|
|
324
|
+
E.length > 1 && ((te = (E.filter((Y) => G(Y) !== W).map((Y) => N.current[G(Y)]).find(Boolean) ?? c).current) == null || te.focus()), C(L);
|
|
326
325
|
}, [
|
|
327
326
|
C,
|
|
328
327
|
E
|
|
@@ -331,11 +330,11 @@ const J = (e) => e.file.name, a = ({ children: e }) => {
|
|
|
331
330
|
handleBlur: S,
|
|
332
331
|
handleDelete: M,
|
|
333
332
|
files: E,
|
|
334
|
-
accept:
|
|
333
|
+
accept: k,
|
|
335
334
|
limitReached: q,
|
|
336
335
|
multiple: O,
|
|
337
336
|
getExplanationText: y,
|
|
338
|
-
hover:
|
|
337
|
+
hover: U,
|
|
339
338
|
limitError: R,
|
|
340
339
|
buttonRef: c,
|
|
341
340
|
fileRemoveButtonRefs: N
|
|
@@ -344,13 +343,13 @@ const J = (e) => e.file.name, a = ({ children: e }) => {
|
|
|
344
343
|
S,
|
|
345
344
|
M,
|
|
346
345
|
E,
|
|
347
|
-
|
|
346
|
+
k,
|
|
348
347
|
q,
|
|
349
348
|
O,
|
|
350
349
|
y,
|
|
351
|
-
|
|
350
|
+
U,
|
|
352
351
|
R
|
|
353
|
-
]), K = h(e, a.Label),
|
|
352
|
+
]), K = h(e, a.Label), H = h(e, a.DropZone), F = h(e, a.Button), u = h(e, a.Explanation), g = h(e, a.Files), p = h(e, a.Description), f = h(e, a.Error);
|
|
354
353
|
return Ce(() => {
|
|
355
354
|
var L;
|
|
356
355
|
(L = c.current) == null || L.focus();
|
|
@@ -359,10 +358,10 @@ const J = (e) => e.file.name, a = ({ children: e }) => {
|
|
|
359
358
|
}, /* @__PURE__ */ t.createElement(m, {
|
|
360
359
|
fieldId: r,
|
|
361
360
|
renderLabel: () => K,
|
|
362
|
-
renderInput: () =>
|
|
361
|
+
renderInput: () => H ?? F,
|
|
363
362
|
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, z(f, {
|
|
364
363
|
hasError: !!(s || R),
|
|
365
|
-
errorMessage: R ??
|
|
364
|
+
errorMessage: R ?? x
|
|
366
365
|
}), p, u, g)
|
|
367
366
|
}));
|
|
368
367
|
}, qe = ({ className: e }) => {
|
|
@@ -373,7 +372,7 @@ const J = (e) => e.file.name, a = ({ children: e }) => {
|
|
|
373
372
|
};
|
|
374
373
|
a.Label = Be;
|
|
375
374
|
a.DropZone = A;
|
|
376
|
-
a.Button =
|
|
375
|
+
a.Button = J;
|
|
377
376
|
a.Explanation = qe;
|
|
378
377
|
a.Files = X;
|
|
379
378
|
a.Description = _e;
|
|
@@ -396,7 +395,7 @@ const $e = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
396
395
|
...e
|
|
397
396
|
}, /* @__PURE__ */ t.createElement("path", {
|
|
398
397
|
d: "M12,21 C7.02943725,21 3,16.9705627 3,12 C3,7.02943725 7.02943725,3 12,3 C16.9705627,3 21,7.02943725 21,12 C21,16.9705627 16.9705627,21 12,21 Z M12,20 C16.418278,20 20,16.418278 20,12 C20,7.581722 16.418278,4 12,4 C7.581722,4 4,7.581722 4,12 C4,16.418278 7.581722,20 12,20 Z M12.7287834,7.27532214 C12.9203342,7.46687299 13.0199347,7.73174979 13.0020527,8.00205275 L13.0020527,12.0020527 C13.0199347,12.2723557 12.9203342,12.5372325 12.7287834,12.7287834 C12.5372325,12.9203342 12.2723557,13.0199347 12.0020527,13.0020527 C11.7317498,13.0199347 11.466873,12.9203342 11.2753221,12.7287834 C11.0837713,12.5372325 10.9841708,12.2723557 11.0020527,12.0020527 L11.0020527,8.00205275 C10.9841708,7.73174979 11.0837713,7.46687299 11.2753221,7.27532214 C11.466873,7.08377129 11.7317498,6.98417081 12.0020527,7.00205275 C12.2723557,6.98417081 12.5372325,7.08377129 12.7287834,7.27532214 Z M12.7287834,15.2753221 C12.9203342,15.466873 13.0199347,15.7317498 13.0020527,16.0020527 C13.0199347,16.2723557 12.9203342,16.5372325 12.7287834,16.7287834 C12.5372325,16.9203342 12.2723557,17.0199347 12.0020527,17.0020527 C11.7317498,17.0199347 11.466873,16.9203342 11.2753221,16.7287834 C11.0837713,16.5372325 10.9841708,16.2723557 11.0020527,16.0020527 C10.9841708,15.7317498 11.0837713,15.466873 11.2753221,15.2753221 C11.466873,15.0837713 11.7317498,14.9841708 12.0020527,15.0020527 C12.2723557,14.9841708 12.5372325,15.0837713 12.7287834,15.2753221 Z"
|
|
399
|
-
})),
|
|
398
|
+
})), He = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
400
399
|
viewBox: "0 0 24 24",
|
|
401
400
|
width: 24,
|
|
402
401
|
height: 24,
|
|
@@ -437,11 +436,11 @@ const $e = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
437
436
|
values: "0;360",
|
|
438
437
|
repeatCount: "indefinite"
|
|
439
438
|
})));
|
|
440
|
-
}, Ye = "_explanation_16me0_1",
|
|
439
|
+
}, Ye = "_explanation_16me0_1", Qe = "_files_16me0_5", Ge = "_file_16me0_5", Je = "_fileName_16me0_24", Xe = "_removeButton_16me0_32", et = "_spinner_16me0_72", tt = "_fileError_16me0_88", w = {
|
|
441
440
|
explanation: Ye,
|
|
442
|
-
files:
|
|
443
|
-
file:
|
|
444
|
-
fileName:
|
|
441
|
+
files: Qe,
|
|
442
|
+
file: Ge,
|
|
443
|
+
fileName: Je,
|
|
445
444
|
removeButton: Xe,
|
|
446
445
|
spinner: et,
|
|
447
446
|
fileError: tt
|
|
@@ -453,9 +452,9 @@ const $e = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
453
452
|
return /* @__PURE__ */ t.createElement(a, null, /* @__PURE__ */ t.createElement(a.Label, {
|
|
454
453
|
className: B(ne, I.label)
|
|
455
454
|
}, /* @__PURE__ */ t.createElement(a.Label.Required, {
|
|
456
|
-
className: B(
|
|
455
|
+
className: B(Le, I.requiredMark)
|
|
457
456
|
})), /* @__PURE__ */ t.createElement(a.Button, {
|
|
458
|
-
className: B(
|
|
457
|
+
className: B(De, I.uploadButton),
|
|
459
458
|
"aria-roledescription": e("file-upload.aria-roledescription")
|
|
460
459
|
}, /* @__PURE__ */ t.createElement($e, null), /* @__PURE__ */ t.createElement(a.Button.Text, null)), /* @__PURE__ */ t.createElement(a.Explanation, {
|
|
461
460
|
className: B(le, I.description, w.explanation)
|
|
@@ -471,14 +470,14 @@ const $e = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
471
470
|
}, /* @__PURE__ */ t.createElement(We, null)), /* @__PURE__ */ t.createElement(a.Files.File.Remove, {
|
|
472
471
|
className: w.removeButton,
|
|
473
472
|
"aria-label": e("file-upload.delete-file.aria-label")
|
|
474
|
-
}, /* @__PURE__ */ t.createElement(
|
|
473
|
+
}, /* @__PURE__ */ t.createElement(He, null)), /* @__PURE__ */ t.createElement(a.Files.File.Error, {
|
|
475
474
|
className: B(ae, I.error, w.fileError)
|
|
476
475
|
}, /* @__PURE__ */ t.createElement(Ke, null), /* @__PURE__ */ t.createElement(a.Files.File.Error.Text, null)))), /* @__PURE__ */ t.createElement(a.Description, {
|
|
477
476
|
className: B(le, I.description)
|
|
478
477
|
}, rt), /* @__PURE__ */ t.createElement(a.Error, {
|
|
479
478
|
className: B(ae, I.error)
|
|
480
|
-
}, /* @__PURE__ */ t.createElement(
|
|
481
|
-
},
|
|
479
|
+
}, /* @__PURE__ */ t.createElement(Ne, null), /* @__PURE__ */ t.createElement(a.Error.Text, null)));
|
|
480
|
+
}, Et = () => /* @__PURE__ */ t.createElement(nt, null);
|
|
482
481
|
export {
|
|
483
|
-
|
|
482
|
+
Et as FileUploadRAC
|
|
484
483
|
};
|
|
@@ -1,33 +1,32 @@
|
|
|
1
|
-
import t, { useMemo as
|
|
1
|
+
import t, { useMemo as _ } from "react";
|
|
2
2
|
import { RicosViewer as A } from "@wix/ricos/viewer";
|
|
3
3
|
import u from "classnames";
|
|
4
|
-
import {
|
|
5
|
-
import { f as c, a as
|
|
6
|
-
import { f as
|
|
7
|
-
import { D as
|
|
8
|
-
import { L as
|
|
4
|
+
import { b5 as C, aZ as I, b2 as P, H as O, I as S, p as x } from "./form-0jt4L5xo.js";
|
|
5
|
+
import { f as c, a as N } from "./find-child-C60k4CxG.js";
|
|
6
|
+
import { f as R } from "./format-currency-BwShJ9vM.js";
|
|
7
|
+
import { D as v, E as M } from "./field-error-headless-tsg9FQ-_.js";
|
|
8
|
+
import { L as g } from "./field-label-headless-CB8dEat8.js";
|
|
9
9
|
import { s as L } from "./field-rac.module-B4l_0KRU.js";
|
|
10
|
-
import { v, w as M, j as g } from "./form-element-classes-bLFmhsKw.js";
|
|
11
10
|
const e = ({ children: r }) => {
|
|
12
11
|
var p;
|
|
13
|
-
const { id: n, validation: a, FieldLayout: l } = C(), { currency: o, regionalFormat: m } = I(), s =
|
|
12
|
+
const { id: n, validation: a, FieldLayout: l } = C(), { currency: o, regionalFormat: m } = I(), s = _(() => {
|
|
14
13
|
var d, E, f;
|
|
15
14
|
return (f = (E = (d = a == null ? void 0 : a.predefined) == null ? void 0 : d.paymentOptions) == null ? void 0 : E.products) == null ? void 0 : f[0];
|
|
16
15
|
}, [
|
|
17
16
|
a
|
|
18
|
-
]), i = (p = s == null ? void 0 : s.fixedPriceOptions) == null ? void 0 : p.price, y = c(r, e.Label), F = c(r, e.Amount),
|
|
17
|
+
]), i = (p = s == null ? void 0 : s.fixedPriceOptions) == null ? void 0 : p.price, y = c(r, e.Label), F = c(r, e.Amount), b = c(r, e.Description), D = c(r, e.Error);
|
|
19
18
|
return /* @__PURE__ */ t.createElement(l, {
|
|
20
19
|
fieldId: n,
|
|
21
20
|
renderLabel: () => y,
|
|
22
|
-
renderInput: () =>
|
|
21
|
+
renderInput: () => N(F, {
|
|
23
22
|
price: i,
|
|
24
23
|
currencyCode: o == null ? void 0 : o.code,
|
|
25
24
|
locale: m
|
|
26
25
|
}),
|
|
27
|
-
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null,
|
|
26
|
+
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, D, b)
|
|
28
27
|
});
|
|
29
28
|
}, B = ({ className: r, ...n }) => {
|
|
30
|
-
const { price: a, currencyCode: l, locale: o } = n, { inputId: m, ariaDescribedBy: s } = P(), i =
|
|
29
|
+
const { price: a, currencyCode: l, locale: o } = n, { inputId: m, ariaDescribedBy: s } = P(), i = R({
|
|
31
30
|
amount: a,
|
|
32
31
|
currency: l,
|
|
33
32
|
locale: o
|
|
@@ -38,25 +37,25 @@ const e = ({ children: r }) => {
|
|
|
38
37
|
className: r,
|
|
39
38
|
"data-hook": "fixed-payment-value"
|
|
40
39
|
}, i);
|
|
41
|
-
}, T = ({ className: r }) => /* @__PURE__ */ t.createElement(
|
|
40
|
+
}, T = ({ className: r }) => /* @__PURE__ */ t.createElement(g, {
|
|
42
41
|
className: r
|
|
43
42
|
}, null);
|
|
44
43
|
e.Label = T;
|
|
45
44
|
e.Amount = B;
|
|
46
|
-
e.Description =
|
|
47
|
-
e.Error =
|
|
45
|
+
e.Description = v;
|
|
46
|
+
e.Error = M;
|
|
48
47
|
const V = "_value_c7203_1", k = {
|
|
49
48
|
value: V
|
|
50
49
|
}, w = ({ content: r, locale: n }) => /* @__PURE__ */ t.createElement(A, {
|
|
51
50
|
content: r,
|
|
52
51
|
locale: n
|
|
53
|
-
}),
|
|
54
|
-
className: u(
|
|
52
|
+
}), H = () => /* @__PURE__ */ t.createElement(e, null, /* @__PURE__ */ t.createElement(e.Label, {
|
|
53
|
+
className: u(O, L.label)
|
|
55
54
|
}), /* @__PURE__ */ t.createElement(e.Amount, {
|
|
56
|
-
className: u(
|
|
55
|
+
className: u(S, k.value)
|
|
57
56
|
}), /* @__PURE__ */ t.createElement(e.Description, {
|
|
58
|
-
className: u(
|
|
59
|
-
}, w)),
|
|
57
|
+
className: u(x, L.description)
|
|
58
|
+
}, w)), U = () => /* @__PURE__ */ t.createElement(H, null);
|
|
60
59
|
export {
|
|
61
|
-
|
|
60
|
+
U as FixedPaymentRAC
|
|
62
61
|
};
|