@wix/form-elements 1.159.0 → 1.160.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-CpiyUOXo.js → appointment-rac-BmHu56e5.js} +63 -63
- package/dist/component/{bookings-address-rac-BBEUV1t7.js → bookings-address-rac-DY9l2g0h.js} +1 -1
- package/dist/component/{bookings-email-rac-DdfoeLFV.js → bookings-email-rac-B5vNSOsS.js} +1 -1
- package/dist/component/{bookings-first-name-rac-DH39yvQ-.js → bookings-first-name-rac-CJiefCNz.js} +1 -1
- package/dist/component/{bookings-header-rac-StLm7b4I.js → bookings-header-rac-BFu7Ko5w.js} +1 -1
- package/dist/component/{bookings-last-name-rac-DHZMPMOO.js → bookings-last-name-rac-DegMM13h.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-DrHp1ojM.js → bookings-login-bar-rac-DrA-5tBH.js} +7 -7
- package/dist/component/{bookings-phone-rac-6aGjbavK.js → bookings-phone-rac-DsaeqxCI.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-DBlGZUM5.js → bookings-rich-text-rac-jRHiwqi8.js} +1 -1
- package/dist/component/{checkbox-field-rac-Cna1Va1X.js → checkbox-field-rac-CyoBb6Yf.js} +43 -43
- package/dist/component/{checkbox-group-field-headless-m_-10Mdx.js → checkbox-group-field-headless-Bv1gU3oL.js} +54 -54
- package/dist/component/{checkbox-group-field-rac-BSCi5hmx.js → checkbox-group-field-rac-DasArcdV.js} +6 -6
- package/dist/component/{checkbox-group-rac-BWYQZmAI.js → checkbox-group-rac-CzmufV1U.js} +1 -1
- package/dist/component/{checkbox-rac-BsUTfSUf.js → checkbox-rac-6C7XoUoZ.js} +1 -1
- package/dist/component/{contacts-address-rac-DwCLW8rV.js → contacts-address-rac-BZobbFtz.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-DnNgxbKb.js → contacts-birthdate-rac-DIzf41DS.js} +1 -1
- package/dist/component/{contacts-company-rac-BQqXzpNl.js → contacts-company-rac-BiBDO28r.js} +1 -1
- package/dist/component/{contacts-email-rac-BINnZzxp.js → contacts-email-rac-5mqokCSD.js} +1 -1
- package/dist/component/{contacts-first-name-rac-DBWKFkIU.js → contacts-first-name-rac-BXe3_Nz5.js} +1 -1
- package/dist/component/{contacts-last-name-rac-D_-qrF7I.js → contacts-last-name-rac-Cfqgh7u1.js} +1 -1
- package/dist/component/{contacts-phone-rac-7n7JkSDr.js → contacts-phone-rac-cmLUWnAc.js} +1 -1
- package/dist/component/{contacts-position-rac-DvXP8nvT.js → contacts-position-rac-DTyvklfN.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-DnLnV5Gm.js → contacts-subscribe-rac-D-ZEX1A3.js} +1 -1
- package/dist/component/{contacts-tax-id-rac-BJVWhvYW.js → contacts-tax-id-rac-B4NYJwWt.js} +1 -1
- package/dist/component/{date-availability-Df807-eN.js → date-availability-Dach9aRC.js} +1 -1
- package/dist/component/date-input-field-rac-B72mHcya.js +309 -0
- package/dist/component/{date-input-rac-CSB3MWHW.js → date-input-rac-CYix11gT.js} +1 -1
- package/dist/component/{date-picker-field-rac-CySThPfz.js → date-picker-field-rac-B8pvtPir.js} +86 -86
- package/dist/component/{date-picker-rac-Fp8_pxtf.js → date-picker-rac-D6cR0zH9.js} +1 -1
- package/dist/component/date-time-input-field-rac-B7Y3Yf5l.js +441 -0
- package/dist/component/{date-time-input-rac-wctMR4uM.js → date-time-input-rac-DMN-noQX.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-erMPfwFL.js → dext-checkbox-group-rac-Kq0GnteP.js} +2 -2
- package/dist/component/{dext-checkbox-rac-DQSq9Lqd.js → dext-checkbox-rac-BY9GZ4n1.js} +1 -1
- package/dist/component/{dext-date-picker-rac-RCLcd1VV.js → dext-date-picker-rac-CXArIddp.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-DMolWzvy.js → dext-date-time-input-rac-B39TtxGq.js} +1 -1
- package/dist/component/{dext-dropdown-rac-wQ2GJL4V.js → dext-dropdown-rac-C3y0G8cS.js} +1 -1
- package/dist/component/{dext-email-rac-BtymBVTW.js → dext-email-rac-BIg3cq7Q.js} +1 -1
- package/dist/component/{dext-number-input-rac-DHPiK0Z3.js → dext-number-input-rac-27sHJ7yN.js} +1 -1
- package/dist/component/{dext-phone-rac-C58vHEEe.js → dext-phone-rac-CcohoFQp.js} +1 -1
- package/dist/component/dext-radio-group-rac-eead3Gve.js +18 -0
- package/dist/component/{dext-rating-input-rac-DI0k3tVa.js → dext-rating-input-rac-B_E6OcBr.js} +1 -1
- package/dist/component/{dext-tags-rac-DmF6ctvQ.js → dext-tags-rac-Yd9aAtnF.js} +2 -2
- package/dist/component/{dext-text-area-rac-Bv6ridbR.js → dext-text-area-rac-CMACri2C.js} +1 -1
- package/dist/component/{dext-text-input-rac-DoTAdUgU.js → dext-text-input-rac-sNjSCfQ-.js} +1 -1
- package/dist/component/{dext-url-input-rac-BuoMS6g2.js → dext-url-input-rac-DwhbzJty.js} +1 -1
- package/dist/component/{donation-rac-CjZalSgn.js → donation-rac-BVAN3kMk.js} +77 -77
- package/dist/component/{dropdown-field-rac-By_fpqhx.js → dropdown-field-rac-DdoGigWx.js} +14 -14
- package/dist/component/{dropdown-rac-BnIEC4RX.js → dropdown-rac-CRkt5w47.js} +1 -1
- package/dist/component/{ecom-address-rac-B6Usk1Ty.js → ecom-address-rac-C36hFHW0.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-B4B0wzlC.js → ecom-subscription-checkbox-rac-BKfQ348w.js} +2 -2
- package/dist/component/{email-input-field-rac-Df3KI3_v.js → email-input-field-rac-MOaISYxa.js} +59 -59
- package/dist/component/{events-repeater-rac-B2iBk8lV.js → events-repeater-rac-D6p-NgE8.js} +20 -20
- package/dist/component/{events-rsvp-rac-xl_qCIh3.js → events-rsvp-rac-DVpgN8gm.js} +18 -18
- package/dist/component/{field-error-headless-DWc76YmY.js → field-error-headless-XNWmDH3E.js} +4 -4
- package/dist/component/{field-label-headless-DKBKqI2X.js → field-label-headless-CORRAJGt.js} +4 -4
- package/dist/component/{file-upload-rac-BVj4cRqe.js → file-upload-rac-DRMr7E4b.js} +89 -89
- package/dist/component/{fixed-payment-rac-BS1Hb4hg.js → fixed-payment-rac-BUXzNex9.js} +18 -18
- package/dist/component/{form-BTUoOcqB.js → form-DSpx-AO8.js} +785 -728
- package/dist/component/form.js +1 -1
- package/dist/component/{header-field-rac-DTJ_Us6u.js → header-field-rac-CiDXlNsa.js} +6 -6
- package/dist/component/{header-rac-CvYp0Jjo.js → header-rac-B5Rg-h8u.js} +1 -1
- package/dist/component/{image-choice-rac--qrYqKJl.js → image-choice-rac-CtoA_KDp.js} +22 -22
- package/dist/component/{index-DIl9BH2M.js → index-Bz7ZhQsF.js} +53 -53
- package/dist/component/{index-CoEV4QEy.js → index-CwruESwc.js} +5 -5
- package/dist/component/{isObjectLike-CLN09X5V.js → isObjectLike-C5dHxHP0.js} +11 -11
- package/dist/component/multiline-address-field-rac-Z-qF366L.js +1664 -0
- package/dist/component/{multiline-address-rac-DtaAJjbR.js → multiline-address-rac-CJIHTMw5.js} +1 -1
- package/dist/component/{number-input-field-rac-2gqDUlw9.js → number-input-field-rac-D4vf6I6N.js} +29 -29
- package/dist/component/{number-input-rac-BlciEPLN.js → number-input-rac-B2jW6JUQ.js} +1 -1
- package/dist/component/{password-rac-BvvQgafk.js → password-rac-DGRZ17Jl.js} +29 -29
- package/dist/component/{payment-input-rac-CSRyOPPr.js → payment-input-rac-BtD-tAKv.js} +27 -27
- package/dist/component/phone-input-field-rac-KD4-APhr.js +512 -0
- package/dist/component/{phone-rac-DMP1MoRs.js → phone-rac-Cw2yccgg.js} +1 -1
- package/dist/component/{product-list-rac-WQ9Qhzum.js → product-list-rac-XbzTDdbp.js} +33 -33
- package/dist/component/{quiz-radio-group-rac-DzrL3-gZ.js → quiz-radio-group-rac-BDw_mAw5.js} +1 -1
- package/dist/component/{radio-button-module-classes-CJk18LzO.js → radio-button-module-classes-CFGf0Hzh.js} +23 -23
- package/dist/component/{radio-group-field-rac-DGoMoSgo.js → radio-group-field-rac-CXN7tyVu.js} +6 -6
- package/dist/component/{radio-group-rac-DhAELVNV.js → radio-group-rac-COHzqjBh.js} +1 -1
- package/dist/component/{rating-input-field-rac-CFoesqmC.js → rating-input-field-rac-DCXNZgf1.js} +37 -37
- package/dist/component/{rating-input-rac-CFMIxche.js → rating-input-rac-DwQt9ML7.js} +1 -1
- package/dist/component/{rich-content-rac.module-xJ03MegT.js → rich-content-rac.module-B7rPwNns.js} +8 -8
- package/dist/component/{rich-text-field-rac-CBMY4JOB.js → rich-text-field-rac-DlER7NRD.js} +4 -4
- package/dist/component/{rich-text-rac-CvZ7s1Ct.js → rich-text-rac-CjicsHA7.js} +1 -1
- package/dist/component/service-dropdown-rac-B81LC_6_.js +145 -0
- package/dist/component/{services-multi-choice-rac-fXOov4K7.js → services-multi-choice-rac-BR6gZeHk.js} +16 -16
- package/dist/component/{signature-rac-CG_Q9Oxr.js → signature-rac-XFj7Ddtp.js} +69 -69
- package/dist/component/{submit-button-rac-DAsovEp2.js → submit-button-rac-Bz7zs_3W.js} +12 -12
- package/dist/component/{tags-field-rac-9mpOMPLm.js → tags-field-rac-DWWkNKqc.js} +22 -22
- package/dist/component/{tags-rac-CNBJ08wS.js → tags-rac-BXyiQ9i1.js} +1 -1
- package/dist/component/{text-area-field-rac-D4aTm7CM.js → text-area-field-rac-DsIRYi0d.js} +21 -21
- package/dist/component/{text-area-rac-DoKiH_Kv.js → text-area-rac-CF9pDP9d.js} +1 -1
- package/dist/component/{text-input-field-rac-BbvPB26b.js → text-input-field-rac-BwIDZACz.js} +5 -5
- package/dist/component/{text-input-headless-BGaBRrP1.js → text-input-headless-5kQs2_Xu.js} +14 -14
- package/dist/component/{text-input-rac-1ac1EKad.js → text-input-rac-CRmSuw1k.js} +1 -1
- package/dist/component/{time-input-rac-BS0rR-89.js → time-input-rac-BRMNpe51.js} +20 -20
- package/dist/component/{url-input-field-rac-DbO6ATng.js → url-input-field-rac-CKLS3QDk.js} +17 -17
- package/dist/component/{url-input-rac-DHuny3d-.js → url-input-rac-Dv-kp50D.js} +1 -1
- package/dist/component/use-dropdown-option-class-name-BQi_qE_-.js +116 -0
- package/dist/component/use-dropdown-trigger-class-name-bAK8aHiG.js +96 -0
- package/dist/component/{use-element-state-class-name-BUsFQfoW.js → use-element-state-class-name-rXM_lHug.js} +1 -1
- package/dist/component/{use-hoverable-input-class-name-C2l3G8gb.js → use-hoverable-input-class-name-BnV_uerV.js} +2 -2
- package/dist/component/use-is-forced-open-dropdown-Bp-5Xpmw.js +53 -0
- package/dist/component/{use-service-options-base-D_enm38a.js → use-service-options-base-CLeE9-Tx.js} +10 -10
- package/dist/component/use-text-input-class-name-DIKWvfkm.js +6 -0
- package/dist/form.d.ts +8 -0
- package/package.json +2 -2
- package/dist/component/date-input-field-rac-CEuPElMH.js +0 -303
- package/dist/component/date-time-input-field-rac-DG5KSBHe.js +0 -433
- package/dist/component/dext-radio-group-rac-Cp-I94HW.js +0 -18
- package/dist/component/dropdown-field-headless-BYEjiIUf.js +0 -93
- package/dist/component/multiline-address-field-rac-BjWzx-LH.js +0 -1659
- package/dist/component/phone-input-field-rac-BVWzH_TY.js +0 -508
- package/dist/component/service-dropdown-rac-B627AgPG.js +0 -145
- package/dist/component/use-dropdown-trigger-class-name-rcGBzxI1.js +0 -117
- package/dist/component/use-is-forced-open-dropdown-CoOk4W4i.js +0 -48
- package/dist/component/use-text-input-class-name-BLtPQoYE.js +0 -6
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import t, { useState as Y, useRef as k, useMemo as fe, useEffect as ne, useCallback as M, createContext as he, useContext as _e } from "react";
|
|
2
2
|
import Le from "@wix/editor-react-components/AnimatedIcon";
|
|
3
|
-
import { RicosViewer as
|
|
3
|
+
import { RicosViewer as Ce } from "@wix/ricos/viewer";
|
|
4
4
|
import Z from "classnames";
|
|
5
|
-
import {
|
|
5
|
+
import { bv as xe, bJ as re, bE as ve, aC as Ne, bH as De, av as ie, bI as Te, bw as Ee, bz as V, bB as Se, bt as Be, bs as ye, V as Ie, ab as Re, b as Ze, O as Ae, P as ce, z as ue, M as de, L as pe, N as Me, f as te } from "./form-DSpx-AO8.js";
|
|
6
6
|
import { E as Oe } from "./error-icon-hZxQ6DEy.js";
|
|
7
7
|
import { s as $ } from "./field-rac.module-DP0lkkEv.js";
|
|
8
|
-
import { u as me } from "./use-element-state-class-name-
|
|
9
|
-
import { DropZone as Ue, Text as we, FileTrigger as
|
|
8
|
+
import { u as me } from "./use-element-state-class-name-rXM_lHug.js";
|
|
9
|
+
import { DropZone as Ue, Text as we, FileTrigger as Pe, Button as be, ProgressBar as He, VisuallyHidden as ke } from "react-aria-components";
|
|
10
10
|
import { f as L, a as W } from "./find-child-C60k4CxG.js";
|
|
11
|
-
import { b as ze, a as Ve, D as
|
|
12
|
-
import { L as
|
|
11
|
+
import { b as ze, a as Ve, D as je, E as qe } from "./field-error-headless-XNWmDH3E.js";
|
|
12
|
+
import { L as Ke } from "./field-label-headless-CORRAJGt.js";
|
|
13
13
|
const $e = {
|
|
14
14
|
Video: "video/*",
|
|
15
15
|
Image: "image/*",
|
|
@@ -18,7 +18,7 @@ const $e = {
|
|
|
18
18
|
Archive: ".zip, .rar, .tar, .tar.gz, .gz, .gzip, .jar, .7z, .fgz, .webarchive",
|
|
19
19
|
Model3D: ".gltf, .glb"
|
|
20
20
|
}, Ye = (e) => {
|
|
21
|
-
const { actions: n, formId: r } =
|
|
21
|
+
const { actions: n, formId: r } = xe();
|
|
22
22
|
return async (l, s, d) => {
|
|
23
23
|
if (!(n != null && n.uploadFile) || !l.length)
|
|
24
24
|
return n != null && n.uploadFile || console.error("No uploadFile action"), l.length || console.error("No files to upload"), [];
|
|
@@ -27,8 +27,8 @@ const $e = {
|
|
|
27
27
|
formId: r,
|
|
28
28
|
uploadTarget: e
|
|
29
29
|
}).then((i) => {
|
|
30
|
-
const { id:
|
|
31
|
-
fileId:
|
|
30
|
+
const { id: x, displayName: p, url: m, isPrivate: c } = i, T = {
|
|
31
|
+
fileId: x,
|
|
32
32
|
displayName: p || o.name,
|
|
33
33
|
url: c ? void 0 : m,
|
|
34
34
|
fileType: o.type || "application/octet-stream"
|
|
@@ -43,8 +43,8 @@ const $e = {
|
|
|
43
43
|
return (await Promise.all(E)).filter((o) => o !== void 0);
|
|
44
44
|
};
|
|
45
45
|
};
|
|
46
|
-
function We({ valueSliderLimit: e, value: n, explanationText: r, target: l, onChange: s, uploadFileFormats: d, onBlur: E, onFilesCleared:
|
|
47
|
-
const [o, i] = Y(Je(n)), [
|
|
46
|
+
function We({ valueSliderLimit: e, value: n, explanationText: r, target: l, onChange: s, uploadFileFormats: d, onBlur: E, onFilesCleared: C }) {
|
|
47
|
+
const [o, i] = Y(Je(n)), [x, p] = Y(n || []), [m, c] = Y(), T = Ye(l), { t: v } = re(), g = ve().includes(Ne.BUTTONS_HOVER), { setFormStatus: B } = De(), I = k(!1), y = k(s);
|
|
48
48
|
y.current = s;
|
|
49
49
|
const N = fe(() => o.some((f) => f.state === "uploading"), [
|
|
50
50
|
o
|
|
@@ -61,7 +61,7 @@ function We({ valueSliderLimit: e, value: n, explanationText: r, target: l, onCh
|
|
|
61
61
|
return;
|
|
62
62
|
const h = o.filter((f) => f.state === "uploading").length;
|
|
63
63
|
if (h) {
|
|
64
|
-
const f = o.filter((
|
|
64
|
+
const f = o.filter((b) => b.state === "uploaded" && b.file.size > 0).length, _ = f / (f + h);
|
|
65
65
|
return v("form.file-upload.uploading", {
|
|
66
66
|
count: Math.round(_ * 100)
|
|
67
67
|
});
|
|
@@ -78,27 +78,27 @@ function We({ valueSliderLimit: e, value: n, explanationText: r, target: l, onCh
|
|
|
78
78
|
u
|
|
79
79
|
]), S = M(async (h) => {
|
|
80
80
|
await T(h, ({ file: f, uploadedFile: _ }) => {
|
|
81
|
-
i((
|
|
81
|
+
i((b) => b.map((F) => F.file === f ? {
|
|
82
82
|
file: f,
|
|
83
83
|
state: "uploaded"
|
|
84
|
-
} :
|
|
84
|
+
} : F)), p((b) => {
|
|
85
85
|
var w;
|
|
86
|
-
const
|
|
87
|
-
...
|
|
86
|
+
const F = [
|
|
87
|
+
...b
|
|
88
88
|
].concat(_);
|
|
89
|
-
return (w = y.current) == null || w.call(y,
|
|
89
|
+
return (w = y.current) == null || w.call(y, F), F;
|
|
90
90
|
});
|
|
91
91
|
}, (f, _) => {
|
|
92
|
-
i((
|
|
92
|
+
i((b) => b.map((F) => F.file === _ ? {
|
|
93
93
|
file: _,
|
|
94
94
|
state: "error",
|
|
95
95
|
errorMessage: v("form.file-upload.error.upload-failed")
|
|
96
|
-
} :
|
|
96
|
+
} : F));
|
|
97
97
|
});
|
|
98
98
|
}, [
|
|
99
99
|
T,
|
|
100
100
|
v
|
|
101
|
-
]),
|
|
101
|
+
]), q = async (h) => {
|
|
102
102
|
if (m && c(void 0), h) {
|
|
103
103
|
if (o.length + h.length > e) {
|
|
104
104
|
c(v("form.file-upload.error.upload-limit", {
|
|
@@ -106,27 +106,27 @@ function We({ valueSliderLimit: e, value: n, explanationText: r, target: l, onCh
|
|
|
106
106
|
}));
|
|
107
107
|
return;
|
|
108
108
|
}
|
|
109
|
-
const
|
|
109
|
+
const b = Array.from(h).reduce((F, w) => (o.some((P) => P.file.name === w.name) || F.push({
|
|
110
110
|
file: w,
|
|
111
111
|
state: "uploading"
|
|
112
|
-
}),
|
|
112
|
+
}), F), []);
|
|
113
113
|
i([
|
|
114
114
|
...o,
|
|
115
|
-
...
|
|
116
|
-
]), await S(
|
|
115
|
+
...b
|
|
116
|
+
]), await S(b);
|
|
117
117
|
}
|
|
118
118
|
}, U = (h) => {
|
|
119
119
|
const f = o[h];
|
|
120
|
-
if (
|
|
121
|
-
const _ =
|
|
120
|
+
if (x && s && f.state !== "error") {
|
|
121
|
+
const _ = x.filter((F) => F.displayName !== f.file.name);
|
|
122
122
|
s(_), p(_);
|
|
123
|
-
const
|
|
124
|
-
i(
|
|
123
|
+
const b = o.filter((F) => F.file.name !== f.file.name);
|
|
124
|
+
i(b), b.length === 0 && C();
|
|
125
125
|
} else {
|
|
126
|
-
const _ = o.filter((
|
|
127
|
-
i(_), _.length === 0 &&
|
|
126
|
+
const _ = o.filter((b) => b !== f);
|
|
127
|
+
i(_), _.length === 0 && C();
|
|
128
128
|
}
|
|
129
|
-
},
|
|
129
|
+
}, K = () => {
|
|
130
130
|
m && c(void 0), E();
|
|
131
131
|
}, J = d.map((h) => $e[h]).join(), X = M(() => {
|
|
132
132
|
i([]), p([]);
|
|
@@ -137,10 +137,10 @@ function We({ valueSliderLimit: e, value: n, explanationText: r, target: l, onCh
|
|
|
137
137
|
hover: g,
|
|
138
138
|
getExplanationText: R,
|
|
139
139
|
getStatusText: u,
|
|
140
|
-
handleChange:
|
|
140
|
+
handleChange: q,
|
|
141
141
|
handleDelete: U,
|
|
142
142
|
accept: J,
|
|
143
|
-
handleBlur:
|
|
143
|
+
handleBlur: K
|
|
144
144
|
};
|
|
145
145
|
}
|
|
146
146
|
function Je(e = []) {
|
|
@@ -159,26 +159,26 @@ function Je(e = []) {
|
|
|
159
159
|
}
|
|
160
160
|
return [];
|
|
161
161
|
}
|
|
162
|
-
const
|
|
163
|
-
function
|
|
164
|
-
const e = _e(
|
|
162
|
+
const Fe = /* @__PURE__ */ he(void 0);
|
|
163
|
+
function j() {
|
|
164
|
+
const e = _e(Fe);
|
|
165
165
|
if (typeof e > "u")
|
|
166
166
|
throw new Error("FileUpload components must be used within FileUpload");
|
|
167
167
|
return e;
|
|
168
168
|
}
|
|
169
169
|
const z = ({ children: e, className: n }) => {
|
|
170
|
-
const { ariaDescribedBy: r } = Ee(), { disabled: l, hasError: s } = V(), { handleFileChange: d, limitReached: E } =
|
|
170
|
+
const { ariaDescribedBy: r } = Ee(), { disabled: l, hasError: s } = V(), { handleFileChange: d, limitReached: E } = j();
|
|
171
171
|
if (E)
|
|
172
172
|
return null;
|
|
173
|
-
const
|
|
173
|
+
const C = L(e, z.Title), o = L(e, z.Subtitle), i = L(e, z.Button);
|
|
174
174
|
return /* @__PURE__ */ t.createElement(Ue, {
|
|
175
175
|
"aria-describedby": r,
|
|
176
176
|
className: n,
|
|
177
177
|
"data-invalid": s,
|
|
178
178
|
isDisabled: l,
|
|
179
|
-
onDrop: async (
|
|
179
|
+
onDrop: async (x) => {
|
|
180
180
|
const p = [];
|
|
181
|
-
for (const m of
|
|
181
|
+
for (const m of x.items)
|
|
182
182
|
if (m.kind === "file") {
|
|
183
183
|
const c = await m.getFile();
|
|
184
184
|
c && p.push(c);
|
|
@@ -190,35 +190,35 @@ const z = ({ children: e, className: n }) => {
|
|
|
190
190
|
}
|
|
191
191
|
}, /* @__PURE__ */ t.createElement(we, {
|
|
192
192
|
slot: "label"
|
|
193
|
-
},
|
|
193
|
+
}, C, o), i);
|
|
194
194
|
}, Qe = ({ className: e, children: n }) => {
|
|
195
|
-
const { limitReached: r } =
|
|
195
|
+
const { limitReached: r } = j();
|
|
196
196
|
return /* @__PURE__ */ t.createElement("p", {
|
|
197
197
|
className: e
|
|
198
198
|
}, n({
|
|
199
199
|
limitReached: r
|
|
200
200
|
}));
|
|
201
201
|
}, Ge = ({ className: e, children: n }) => {
|
|
202
|
-
const { limitReached: r } =
|
|
202
|
+
const { limitReached: r } = j(), { explanationText: l } = V();
|
|
203
203
|
return /* @__PURE__ */ t.createElement("p", {
|
|
204
204
|
className: e
|
|
205
205
|
}, l || n({
|
|
206
206
|
limitReached: r
|
|
207
207
|
}));
|
|
208
208
|
}, oe = ({ className: e, children: n, "aria-roledescription": r, onHoverStart: l, onHoverEnd: s, onFocusChange: d }) => {
|
|
209
|
-
const { ariaDescribedBy: E, inputId:
|
|
210
|
-
return /* @__PURE__ */ t.createElement(
|
|
209
|
+
const { ariaDescribedBy: E, inputId: C, labelId: o, errorId: i } = Ee(), { disabled: x, required: p, onFocus: m, hasError: c, errorMessage: T } = V(), { handleFileChange: v, accept: O, multiple: g, buttonRef: B, handleBlur: I, limitError: y, files: N } = j(), u = (N == null ? void 0 : N.some((S) => S.errorMessage)) ?? !1, R = !!(c || T || y || u);
|
|
210
|
+
return /* @__PURE__ */ t.createElement(Pe, {
|
|
211
211
|
acceptedFileTypes: O ? O.split(",") : void 0,
|
|
212
212
|
allowsMultiple: g,
|
|
213
213
|
onSelect: (S) => {
|
|
214
214
|
if (S) {
|
|
215
|
-
const
|
|
216
|
-
|
|
215
|
+
const q = Array.from(S), U = new DataTransfer();
|
|
216
|
+
q.forEach((K) => U.items.add(K)), v(U.files);
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
|
-
}, /* @__PURE__ */ t.createElement(
|
|
219
|
+
}, /* @__PURE__ */ t.createElement(be, {
|
|
220
220
|
ref: B,
|
|
221
|
-
id:
|
|
221
|
+
id: C,
|
|
222
222
|
"aria-labelledby": o,
|
|
223
223
|
"aria-describedby": [
|
|
224
224
|
E,
|
|
@@ -230,7 +230,7 @@ const z = ({ children: e, className: n }) => {
|
|
|
230
230
|
"aria-invalid": R || void 0,
|
|
231
231
|
"aria-required": p
|
|
232
232
|
}),
|
|
233
|
-
isDisabled:
|
|
233
|
+
isDisabled: x,
|
|
234
234
|
className: e,
|
|
235
235
|
onFocus: m,
|
|
236
236
|
onBlur: I,
|
|
@@ -249,12 +249,12 @@ z.Title = Qe;
|
|
|
249
249
|
z.Subtitle = Ge;
|
|
250
250
|
z.Button = oe;
|
|
251
251
|
const A = ({ children: e, className: n, ...r }) => {
|
|
252
|
-
const { file: l, index: s } = r, d = l.file.name, E = L(e, A.Name),
|
|
252
|
+
const { file: l, index: s } = r, d = l.file.name, E = L(e, A.Name), C = L(e, A.Remove), o = L(e, A.Spinner), i = L(e, A.Error);
|
|
253
253
|
return /* @__PURE__ */ t.createElement("div", {
|
|
254
254
|
className: n
|
|
255
255
|
}, W(E, {
|
|
256
256
|
fileName: d
|
|
257
|
-
}), l.state === "uploading" ? o : W(
|
|
257
|
+
}), l.state === "uploading" ? o : W(C, {
|
|
258
258
|
index: s,
|
|
259
259
|
fileName: d
|
|
260
260
|
}), l.errorMessage && W(i, {
|
|
@@ -266,7 +266,7 @@ const A = ({ children: e, className: n, ...r }) => {
|
|
|
266
266
|
className: e
|
|
267
267
|
}, r);
|
|
268
268
|
}, tt = ({ className: e, "aria-label": n, children: r, ...l }) => {
|
|
269
|
-
const { fileName: s, index: d } = l, { disabled: E } = V(), { handleDelete:
|
|
269
|
+
const { fileName: s, index: d } = l, { disabled: E } = V(), { handleDelete: C, fileRemoveButtonRefs: o } = j(), i = k(null);
|
|
270
270
|
ne(() => {
|
|
271
271
|
const p = o.current, m = s;
|
|
272
272
|
return p[m] = i, () => {
|
|
@@ -276,15 +276,15 @@ const A = ({ children: e, className: n, ...r }) => {
|
|
|
276
276
|
s,
|
|
277
277
|
o
|
|
278
278
|
]);
|
|
279
|
-
const
|
|
280
|
-
|
|
279
|
+
const x = () => {
|
|
280
|
+
C(d);
|
|
281
281
|
};
|
|
282
|
-
return /* @__PURE__ */ t.createElement(
|
|
282
|
+
return /* @__PURE__ */ t.createElement(be, {
|
|
283
283
|
ref: i,
|
|
284
284
|
"aria-disabled": E,
|
|
285
285
|
"aria-label": n,
|
|
286
286
|
"aria-description": s,
|
|
287
|
-
onClick:
|
|
287
|
+
onClick: x,
|
|
288
288
|
className: e,
|
|
289
289
|
isDisabled: E
|
|
290
290
|
}, r);
|
|
@@ -296,7 +296,7 @@ const A = ({ children: e, className: n, ...r }) => {
|
|
|
296
296
|
className: e,
|
|
297
297
|
role: "alert"
|
|
298
298
|
}, n)) : null;
|
|
299
|
-
}, nt = ({ className: e, "aria-label": n, children: r }) => /* @__PURE__ */ t.createElement(
|
|
299
|
+
}, nt = ({ className: e, "aria-label": n, children: r }) => /* @__PURE__ */ t.createElement(He, {
|
|
300
300
|
"aria-label": n,
|
|
301
301
|
className: e,
|
|
302
302
|
isIndeterminate: !0
|
|
@@ -307,7 +307,7 @@ A.Spinner = nt;
|
|
|
307
307
|
A.Error = ge;
|
|
308
308
|
ge.Text = ze;
|
|
309
309
|
const le = ({ children: e, className: n }) => {
|
|
310
|
-
const { files: r } =
|
|
310
|
+
const { files: r } = j(), l = L(e, le.File);
|
|
311
311
|
return !r || r.length === 0 ? null : /* @__PURE__ */ t.createElement("div", {
|
|
312
312
|
className: n
|
|
313
313
|
}, r.map((s, d) => W(l, {
|
|
@@ -318,21 +318,21 @@ const le = ({ children: e, className: n }) => {
|
|
|
318
318
|
};
|
|
319
319
|
le.File = A;
|
|
320
320
|
const G = (e) => e.file.name, a = ({ children: e }) => {
|
|
321
|
-
const { t: n } = re(), { id: r, value: l, onChange: s, uploadFileFormats: d, valueSliderLimit: E, target:
|
|
321
|
+
const { t: n } = re(), { id: r, value: l, onChange: s, uploadFileFormats: d, valueSliderLimit: E, target: C, explanationText: o, onBlur: i, hasError: x, errorMessage: p, FieldLayout: m } = V(), c = k(null), T = k({}), v = k(!1), O = M(() => {
|
|
322
322
|
c.current ? c.current.focus() : v.current = !0;
|
|
323
|
-
}, []), { files: g, limitError: B, hover: I, getExplanationText: y, getStatusText: N, handleBlur: u, handleChange: R, handleDelete: S, accept:
|
|
323
|
+
}, []), { files: g, limitError: B, hover: I, getExplanationText: y, getStatusText: N, handleBlur: u, handleChange: R, handleDelete: S, accept: q } = We({
|
|
324
324
|
valueSliderLimit: E,
|
|
325
325
|
value: l,
|
|
326
326
|
explanationText: o,
|
|
327
|
-
target:
|
|
327
|
+
target: C,
|
|
328
328
|
onChange: s,
|
|
329
329
|
uploadFileFormats: d,
|
|
330
330
|
onBlur: i,
|
|
331
331
|
onFilesCleared: O
|
|
332
|
-
}), U = M((
|
|
332
|
+
}), U = M((P) => {
|
|
333
333
|
var se;
|
|
334
|
-
const Q = g[
|
|
335
|
-
g.length > 1 && ((se = (g.filter((ee) => G(ee) !==
|
|
334
|
+
const Q = g[P], H = G(Q);
|
|
335
|
+
g.length > 1 && ((se = (g.filter((ee) => G(ee) !== H).map((ee) => T.current[G(ee)]).find(Boolean) ?? c).current) == null || se.focus()), S(P);
|
|
336
336
|
}, [
|
|
337
337
|
S,
|
|
338
338
|
g
|
|
@@ -342,14 +342,14 @@ const G = (e) => e.file.name, a = ({ children: e }) => {
|
|
|
342
342
|
}, [
|
|
343
343
|
g
|
|
344
344
|
]);
|
|
345
|
-
const
|
|
345
|
+
const K = E > 1, J = g.length >= E, X = fe(() => ({
|
|
346
346
|
handleFileChange: R,
|
|
347
347
|
handleBlur: u,
|
|
348
348
|
handleDelete: U,
|
|
349
349
|
files: g,
|
|
350
|
-
accept:
|
|
350
|
+
accept: q,
|
|
351
351
|
limitReached: J,
|
|
352
|
-
multiple:
|
|
352
|
+
multiple: K,
|
|
353
353
|
getExplanationText: y,
|
|
354
354
|
getStatusText: N,
|
|
355
355
|
hover: I,
|
|
@@ -361,33 +361,33 @@ const G = (e) => e.file.name, a = ({ children: e }) => {
|
|
|
361
361
|
u,
|
|
362
362
|
U,
|
|
363
363
|
g,
|
|
364
|
-
|
|
364
|
+
q,
|
|
365
365
|
J,
|
|
366
|
-
|
|
366
|
+
K,
|
|
367
367
|
y,
|
|
368
368
|
N,
|
|
369
369
|
I,
|
|
370
370
|
B
|
|
371
|
-
]), h = L(e, a.Label), f = L(e, a.DropZone), _ = L(e, a.Button),
|
|
371
|
+
]), h = L(e, a.Label), f = L(e, a.DropZone), _ = L(e, a.Button), b = L(e, a.Explanation), F = L(e, a.Files), w = L(e, a.Description), ae = L(e, a.Error);
|
|
372
372
|
return Se(() => {
|
|
373
|
-
var
|
|
373
|
+
var P, Q;
|
|
374
374
|
if (c.current) {
|
|
375
375
|
c.current.focus({
|
|
376
376
|
preventScroll: !0
|
|
377
377
|
});
|
|
378
378
|
return;
|
|
379
379
|
}
|
|
380
|
-
(Q = (
|
|
380
|
+
(Q = (P = g.map((H) => T.current[G(H)]).find((H) => H == null ? void 0 : H.current)) == null ? void 0 : P.current) == null || Q.focus({
|
|
381
381
|
preventScroll: !0
|
|
382
382
|
});
|
|
383
|
-
}, r), /* @__PURE__ */ t.createElement(
|
|
383
|
+
}, r), /* @__PURE__ */ t.createElement(Fe.Provider, {
|
|
384
384
|
value: X
|
|
385
385
|
}, /* @__PURE__ */ t.createElement(m, {
|
|
386
386
|
fieldId: r,
|
|
387
387
|
renderLabel: () => h,
|
|
388
388
|
renderInput: () => f ?? _,
|
|
389
389
|
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, W(ae, {
|
|
390
|
-
hasError: !!(
|
|
390
|
+
hasError: !!(x || B),
|
|
391
391
|
errorMessage: B ?? p
|
|
392
392
|
}), /* @__PURE__ */ t.createElement(ke, {
|
|
393
393
|
role: "status",
|
|
@@ -395,21 +395,21 @@ const G = (e) => e.file.name, a = ({ children: e }) => {
|
|
|
395
395
|
"aria-atomic": "true"
|
|
396
396
|
}, n("form.file-upload.explanation-text", {
|
|
397
397
|
count: g.length
|
|
398
|
-
})),
|
|
398
|
+
})), b, F, w)
|
|
399
399
|
}));
|
|
400
400
|
}, rt = ({ className: e, showUploadStatusOnly: n }) => {
|
|
401
|
-
const { files: r, getExplanationText: l, getStatusText: s } =
|
|
401
|
+
const { files: r, getExplanationText: l, getStatusText: s } = j(), d = n ? s() : l();
|
|
402
402
|
return r.length === 1 || !d ? null : /* @__PURE__ */ t.createElement("p", {
|
|
403
403
|
className: e
|
|
404
404
|
}, d);
|
|
405
405
|
};
|
|
406
|
-
a.Label =
|
|
406
|
+
a.Label = Ke;
|
|
407
407
|
a.DropZone = z;
|
|
408
408
|
a.Button = oe;
|
|
409
409
|
a.Explanation = rt;
|
|
410
410
|
a.Files = le;
|
|
411
|
-
a.Description =
|
|
412
|
-
a.Error =
|
|
411
|
+
a.Description = je;
|
|
412
|
+
a.Error = qe;
|
|
413
413
|
const ot = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
414
414
|
viewBox: "0 0 24 24",
|
|
415
415
|
width: 24,
|
|
@@ -469,7 +469,7 @@ const ot = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
469
469
|
values: "0;360",
|
|
470
470
|
repeatCount: "indefinite"
|
|
471
471
|
})));
|
|
472
|
-
}, it = "_dropZone_8sprf_1", ct = "_dropZoneHover_8sprf_27", ut = "_dropZoneTitle_8sprf_69", dt = "_dropZoneSubtitle_8sprf_74", pt = "_button_8sprf_78", mt = "_buttonHover_8sprf_131", ft = "_explanation_8sprf_148", Et = "_files_8sprf_152",
|
|
472
|
+
}, it = "_dropZone_8sprf_1", ct = "_dropZoneHover_8sprf_27", ut = "_dropZoneTitle_8sprf_69", dt = "_dropZoneSubtitle_8sprf_74", pt = "_button_8sprf_78", mt = "_buttonHover_8sprf_131", ft = "_explanation_8sprf_148", Et = "_files_8sprf_152", bt = "_file_8sprf_152", Ft = "_fileName_8sprf_202", gt = "_buttonLabel_8sprf_210", ht = "_removeButton_8sprf_214", _t = "_spinner_8sprf_261", Lt = "_fileError_8sprf_277", D = {
|
|
473
473
|
dropZone: it,
|
|
474
474
|
dropZoneHover: ct,
|
|
475
475
|
dropZoneTitle: ut,
|
|
@@ -478,16 +478,16 @@ const ot = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
478
478
|
buttonHover: mt,
|
|
479
479
|
explanation: ft,
|
|
480
480
|
files: Et,
|
|
481
|
-
file:
|
|
482
|
-
fileName:
|
|
481
|
+
file: bt,
|
|
482
|
+
fileName: Ft,
|
|
483
483
|
buttonLabel: gt,
|
|
484
484
|
removeButton: ht,
|
|
485
485
|
spinner: _t,
|
|
486
486
|
fileError: Lt
|
|
487
|
-
},
|
|
487
|
+
}, Ct = ({ content: e, locale: n }) => /* @__PURE__ */ t.createElement(Ce, {
|
|
488
488
|
content: e,
|
|
489
489
|
locale: n
|
|
490
|
-
}),
|
|
490
|
+
}), xt = () => {
|
|
491
491
|
var B, I, y, N;
|
|
492
492
|
const { t: e } = re(), { disabled: n, readOnly: r } = V(), l = !n && !r, s = me({
|
|
493
493
|
globalClasses: de,
|
|
@@ -501,7 +501,7 @@ const ot = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
501
501
|
base: D.button,
|
|
502
502
|
hover: D.buttonHover
|
|
503
503
|
}
|
|
504
|
-
}), E = (N = (y = (I = (B = Be().fileUpload) == null ? void 0 : B.elementProps) == null ? void 0 : I.uploadButton) == null ? void 0 : y.elementProps) == null ? void 0 : N.icon, { wix:
|
|
504
|
+
}), E = (N = (y = (I = (B = Be().fileUpload) == null ? void 0 : B.elementProps) == null ? void 0 : I.uploadButton) == null ? void 0 : y.elementProps) == null ? void 0 : N.icon, { wix: C, className: o, ...i } = E ?? {}, x = ye(te.FILE_UPLOAD, te.UPLOAD_BUTTON, te.UPLOAD_BUTTON_LABEL), p = k(null), [m, c] = Y(!1), [T, v] = Y(!1), O = M(() => {
|
|
505
505
|
var u;
|
|
506
506
|
c(!0), (u = p.current) == null || u.runAnimationForward();
|
|
507
507
|
}, []), g = M(() => {
|
|
@@ -539,7 +539,7 @@ const ot = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
539
539
|
ref: p,
|
|
540
540
|
className: Z(Ze, Ae, o)
|
|
541
541
|
}) : E ? null : /* @__PURE__ */ t.createElement(ot, null), /* @__PURE__ */ t.createElement(a.DropZone.Button.Text, {
|
|
542
|
-
className: Z(ce.base, D.buttonLabel,
|
|
542
|
+
className: Z(ce.base, D.buttonLabel, x, {
|
|
543
543
|
[ce.hover]: l && (m || T)
|
|
544
544
|
})
|
|
545
545
|
}))), /* @__PURE__ */ t.createElement(a.Explanation, {
|
|
@@ -561,10 +561,10 @@ const ot = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
561
561
|
className: Z(pe, $.error, D.fileError)
|
|
562
562
|
}, /* @__PURE__ */ t.createElement(lt, null), /* @__PURE__ */ t.createElement(a.Files.File.Error.Text, null)))), /* @__PURE__ */ t.createElement(a.Description, {
|
|
563
563
|
className: Z(ue, $.description)
|
|
564
|
-
},
|
|
564
|
+
}, Ct), /* @__PURE__ */ t.createElement(a.Error, {
|
|
565
565
|
className: Z(pe, $.error)
|
|
566
566
|
}, /* @__PURE__ */ t.createElement(Oe, null), /* @__PURE__ */ t.createElement(a.Error.Text, null)));
|
|
567
|
-
}, Ut = () => /* @__PURE__ */ t.createElement(
|
|
567
|
+
}, Ut = () => /* @__PURE__ */ t.createElement(xt, null);
|
|
568
568
|
export {
|
|
569
569
|
Ut as FileUploadRAC
|
|
570
570
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
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
|
|
4
|
+
import { bz as C, br as I, bw as P, V as S, Q as x, z as N } from "./form-DSpx-AO8.js";
|
|
5
|
+
import { f as c, a as R } from "./find-child-C60k4CxG.js";
|
|
6
6
|
import { f as O } from "./format-currency-BwShJ9vM.js";
|
|
7
|
-
import { D as v, E as M } from "./field-error-headless-
|
|
8
|
-
import { L as
|
|
7
|
+
import { D as v, E as M } from "./field-error-headless-XNWmDH3E.js";
|
|
8
|
+
import { L as V } from "./field-label-headless-CORRAJGt.js";
|
|
9
9
|
import { s as F } from "./field-rac.module-DP0lkkEv.js";
|
|
10
10
|
const e = ({ children: r }) => {
|
|
11
11
|
var p;
|
|
@@ -18,14 +18,14 @@ const e = ({ children: r }) => {
|
|
|
18
18
|
return /* @__PURE__ */ t.createElement(l, {
|
|
19
19
|
fieldId: a,
|
|
20
20
|
renderLabel: () => y,
|
|
21
|
-
renderInput: () =>
|
|
21
|
+
renderInput: () => R(L, {
|
|
22
22
|
price: i,
|
|
23
23
|
currencyCode: o == null ? void 0 : o.code,
|
|
24
24
|
locale: m
|
|
25
25
|
}),
|
|
26
26
|
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, D, b)
|
|
27
27
|
});
|
|
28
|
-
},
|
|
28
|
+
}, g = ({ className: r, ...a }) => {
|
|
29
29
|
const { price: n, currencyCode: l, locale: o } = a, { inputId: m, ariaDescribedBy: s } = P(), i = O({
|
|
30
30
|
amount: n,
|
|
31
31
|
currency: l,
|
|
@@ -37,25 +37,25 @@ const e = ({ children: r }) => {
|
|
|
37
37
|
className: r,
|
|
38
38
|
"data-hook": "fixed-payment-value"
|
|
39
39
|
}, i);
|
|
40
|
-
},
|
|
40
|
+
}, T = ({ className: r }) => /* @__PURE__ */ t.createElement(V, {
|
|
41
41
|
className: r
|
|
42
42
|
}, null);
|
|
43
|
-
e.Label =
|
|
44
|
-
e.Amount =
|
|
43
|
+
e.Label = T;
|
|
44
|
+
e.Amount = g;
|
|
45
45
|
e.Description = v;
|
|
46
46
|
e.Error = M;
|
|
47
|
-
const
|
|
48
|
-
value:
|
|
49
|
-
},
|
|
47
|
+
const w = "_value_c7203_1", z = {
|
|
48
|
+
value: w
|
|
49
|
+
}, B = ({ content: r, locale: a }) => /* @__PURE__ */ t.createElement(A, {
|
|
50
50
|
content: r,
|
|
51
51
|
locale: a
|
|
52
|
-
}),
|
|
53
|
-
className: u(
|
|
52
|
+
}), k = () => /* @__PURE__ */ t.createElement(e, null, /* @__PURE__ */ t.createElement(e.Label, {
|
|
53
|
+
className: u(S, F.label)
|
|
54
54
|
}), /* @__PURE__ */ t.createElement(e.Amount, {
|
|
55
|
-
className: u(
|
|
55
|
+
className: u(x, z.value)
|
|
56
56
|
}), /* @__PURE__ */ t.createElement(e.Description, {
|
|
57
|
-
className: u(
|
|
58
|
-
},
|
|
57
|
+
className: u(N, F.description)
|
|
58
|
+
}, B)), K = () => /* @__PURE__ */ t.createElement(k, null);
|
|
59
59
|
export {
|
|
60
|
-
|
|
60
|
+
K as FixedPaymentRAC
|
|
61
61
|
};
|