@wix/form-elements 1.143.0 → 1.145.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-BAwonF75.js → appointment-rac-De-uH9rz.js} +93 -93
- package/dist/component/{bookings-address-rac-xhj2n7jK.js → bookings-address-rac-DB6QCMQJ.js} +1 -1
- package/dist/component/{bookings-email-rac-BGjeAwgm.js → bookings-email-rac-g6ZdB_BO.js} +1 -1
- package/dist/component/{bookings-first-name-rac-l392yYAU.js → bookings-first-name-rac-DQgL_VHl.js} +1 -1
- package/dist/component/{bookings-header-rac-JwIo7hsJ.js → bookings-header-rac-DAnIm-Oq.js} +1 -1
- package/dist/component/{bookings-last-name-rac-CJp81BPl.js → bookings-last-name-rac-D62jNdDb.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-BiPklGE_.js → bookings-login-bar-rac-5z8HfBhU.js} +1 -1
- package/dist/component/{bookings-phone-rac-mQfDJGkK.js → bookings-phone-rac-D0gu-_wy.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-BOfHn2EU.js → bookings-rich-text-rac-b4J1HcdI.js} +1 -1
- package/dist/component/{checkbox-field-rac-CA6SeM0c.js → checkbox-field-rac-CmRRc9Dz.js} +83 -83
- package/dist/component/{checkbox-group-field-headless-ChLT0zKA.js → checkbox-group-field-headless-CB8yAfMe.js} +61 -61
- package/dist/component/{checkbox-group-field-rac-_Fkre79S.js → checkbox-group-field-rac-C5gRZRTd.js} +4 -4
- package/dist/component/{checkbox-group-rac-esBLJZ6Y.js → checkbox-group-rac-DNDF1Irh.js} +1 -1
- package/dist/component/{checkbox-rac-C3vXtbJh.js → checkbox-rac-B9vztGBU.js} +1 -1
- package/dist/component/{contacts-address-rac-BuBBBt19.js → contacts-address-rac-CKZeSncj.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-BMBJeVOK.js → contacts-birthdate-rac-BbpNNQgF.js} +1 -1
- package/dist/component/{contacts-company-rac-CZl168-E.js → contacts-company-rac-BX2KT201.js} +1 -1
- package/dist/component/{contacts-email-rac-CJgVzCns.js → contacts-email-rac-5Irzx1mA.js} +1 -1
- package/dist/component/{contacts-first-name-rac-9ZNYKQeb.js → contacts-first-name-rac-CxKp8_2u.js} +1 -1
- package/dist/component/{contacts-last-name-rac-KgylQwHW.js → contacts-last-name-rac-BDCbSv5I.js} +1 -1
- package/dist/component/{contacts-phone-rac-DYr30FLP.js → contacts-phone-rac-BM_PV_uH.js} +1 -1
- package/dist/component/{contacts-position-rac-B9BZZ3K9.js → contacts-position-rac-1aqthQSi.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-DOQb2GLm.js → contacts-subscribe-rac-CdqXs4kp.js} +1 -1
- package/dist/component/{contacts-tax-id-rac-cYE1ehXN.js → contacts-tax-id-rac-BKHpcDb6.js} +1 -1
- package/dist/component/{date-availability-BOKvA8w-.js → date-availability-DmFFTX8p.js} +1 -1
- package/dist/component/{date-input-field-rac-BwY53gNr.js → date-input-field-rac-BnlAOn12.js} +45 -45
- package/dist/component/{date-input-rac-Cgg4QJbB.js → date-input-rac-BB6qZ16w.js} +1 -1
- package/dist/component/{date-picker-field-rac-0Ue6uiCM.js → date-picker-field-rac-Ckwu2vD6.js} +11 -11
- package/dist/component/{date-picker-rac-CgICj33f.js → date-picker-rac-DSqzUAaH.js} +1 -1
- package/dist/component/{date-time-input-field-rac-ChRCMk7_.js → date-time-input-field-rac-DO-iRdkW.js} +21 -21
- package/dist/component/{date-time-input-rac-B8tRZrri.js → date-time-input-rac-smVCCxdY.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-B_qjx1QD.js → dext-checkbox-group-rac-B8bx3rT2.js} +4 -4
- package/dist/component/{dext-checkbox-rac-Bw9SyhHA.js → dext-checkbox-rac-x8VLGRbc.js} +1 -1
- package/dist/component/{dext-date-picker-rac-Bzn28zNq.js → dext-date-picker-rac-D2a9NXap.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-7Cuk3PoA.js → dext-date-time-input-rac-Cp5XjpGv.js} +1 -1
- package/dist/component/{dext-dropdown-rac-Md1VI5pc.js → dext-dropdown-rac-nWgEvyxt.js} +1 -1
- package/dist/component/{dext-email-rac-DbHwHGKz.js → dext-email-rac-CkX6ya8p.js} +1 -1
- package/dist/component/{dext-number-input-rac-DIVk3zXL.js → dext-number-input-rac-CKT0MS1x.js} +1 -1
- package/dist/component/{dext-phone-rac-ZIya63UJ.js → dext-phone-rac-DM2E7zW_.js} +1 -1
- package/dist/component/{dext-radio-group-rac-DV1xHkOD.js → dext-radio-group-rac-Czr5yY3K.js} +4 -4
- package/dist/component/{dext-rating-input-rac-YRIYgeT4.js → dext-rating-input-rac-CKWNpFuu.js} +1 -1
- package/dist/component/{dext-tags-rac-DTJ6Pz_x.js → dext-tags-rac-6AskGGTp.js} +4 -4
- package/dist/component/{dext-text-area-rac-V-d9i95A.js → dext-text-area-rac-ClGLD7sD.js} +1 -1
- package/dist/component/{dext-text-input-rac-ccrundX-.js → dext-text-input-rac-Blbk53d4.js} +1 -1
- package/dist/component/{dext-url-input-rac-Bd5SZ2U4.js → dext-url-input-rac-BuitmJU0.js} +1 -1
- package/dist/component/{donation-rac-BFmpW-3b.js → donation-rac-DOifFCD7.js} +52 -52
- package/dist/component/{dropdown-field-headless-C2qgeReH.js → dropdown-field-headless-m2P6s7X5.js} +22 -22
- package/dist/component/{dropdown-field-rac-Bj1YSgpT.js → dropdown-field-rac-5e6wWJBl.js} +4 -4
- package/dist/component/{dropdown-rac-DfdvX5I5.js → dropdown-rac-BGxE9pJB.js} +1 -1
- package/dist/component/{ecom-address-rac-DOWNQhhX.js → ecom-address-rac-kbD9qW5Y.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-2ELdC1ql.js → ecom-subscription-checkbox-rac-CE-Yixnj.js} +5 -5
- package/dist/component/{email-input-field-rac-CY0U6vEM.js → email-input-field-rac-CbwcB33o.js} +46 -46
- package/dist/component/{events-repeater-rac-C2oo_RZt.js → events-repeater-rac-CGhUscBr.js} +4 -4
- package/dist/component/{events-rsvp-rac-BrimIo0r.js → events-rsvp-rac-AQ33zPTe.js} +3 -3
- package/dist/component/{field-error-headless-r0fX50xw.js → field-error-headless-ClPQ03Jc.js} +9 -9
- package/dist/component/field-label-headless-DhN8Lkuq.js +52 -0
- package/dist/component/{file-upload-rac-Beb2BcFK.js → file-upload-rac-yTx1ZRhZ.js} +53 -53
- package/dist/component/{fixed-payment-rac-DGFWYMZG.js → fixed-payment-rac-nlyxa9nB.js} +12 -12
- package/dist/component/{form-DtzwuBIo.js → form-D3iU18lh.js} +2386 -2352
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +2 -2
- package/dist/component/{header-field-rac-CVmGSa0E.js → header-field-rac-DAEzcleV.js} +4 -4
- package/dist/component/{header-rac-C3AEJmYN.js → header-rac-CJZ4qMFg.js} +1 -1
- package/dist/component/{image-choice-rac-Ch-mxLgP.js → image-choice-rac-BFAMHwPh.js} +10 -10
- package/dist/component/{index-CTn6AQ3A.js → index-DQW26cnX.js} +2 -2
- package/dist/component/{index-CmqLlW8X.js → index-W7GOFnq8.js} +43 -43
- package/dist/component/{isObjectLike-iyypwAQL.js → isObjectLike-CE8eaxSI.js} +7 -7
- package/dist/component/{multiline-address-field-rac-DJXcb6NG.js → multiline-address-field-rac-FbJO0HFf.js} +94 -94
- package/dist/component/{multiline-address-rac-DcZgTx1c.js → multiline-address-rac-CI-vt6Pm.js} +1 -1
- package/dist/component/{number-input-field-rac-W3TqQGhC.js → number-input-field-rac-BRVAr7LL.js} +21 -21
- package/dist/component/{number-input-rac-CdXigsba.js → number-input-rac-C8hCiJiu.js} +1 -1
- package/dist/component/{password-rac-Dph6984u.js → password-rac-Baslr6Ga.js} +7 -7
- package/dist/component/{payment-input-rac-D5ARk1lF.js → payment-input-rac-CfJSKxYz.js} +17 -17
- package/dist/component/{phone-input-field-rac-BUfe-B2i.js → phone-input-field-rac-Dqh4CXdC.js} +24 -24
- package/dist/component/{phone-rac-DTiWT1uy.js → phone-rac-DaLuGuxd.js} +1 -1
- package/dist/component/{product-list-rac-1_Q2JYwH.js → product-list-rac-PNMwRBtL.js} +31 -31
- package/dist/component/{quiz-radio-group-rac-iyBhi0wJ.js → quiz-radio-group-rac-DN8vY-oM.js} +1 -1
- package/dist/component/{radio-button-module-classes-DwfobXBe.js → radio-button-module-classes-DlJi9a2f.js} +11 -11
- package/dist/component/{radio-group-field-rac-BkKNVwMi.js → radio-group-field-rac-C0tLXhl5.js} +4 -4
- package/dist/component/{radio-group-rac-CH0nkJ8V.js → radio-group-rac-FAk7PYgP.js} +1 -1
- package/dist/component/{rating-input-field-rac-CUUUlgZi.js → rating-input-field-rac-Cl1kH_uu.js} +12 -12
- package/dist/component/{rating-input-rac-8yEiqBR5.js → rating-input-rac-D9p-0pkI.js} +1 -1
- package/dist/component/{rich-content-rac.module-DeKU0pwh.js → rich-content-rac.module-Dkr46kPC.js} +3 -3
- package/dist/component/{rich-text-field-rac-Cwd-RWTi.js → rich-text-field-rac-DthhTvTp.js} +4 -4
- package/dist/component/{rich-text-rac-C5-jPNYP.js → rich-text-rac-DqZX4NeB.js} +1 -1
- package/dist/component/{service-dropdown-rac-DBGAnsut.js → service-dropdown-rac-BMOGLU2Z.js} +30 -30
- package/dist/component/{services-multi-choice-rac-CqEoGsuw.js → services-multi-choice-rac-DcdUewzJ.js} +5 -5
- package/dist/component/{signature-rac-Cq3y66Cr.js → signature-rac-BRvN6kUW.js} +37 -37
- package/dist/component/submit-button-rac-B70UC8eS.js +228 -0
- package/dist/component/{tags-field-rac-CpJ0O9f_.js → tags-field-rac-NpYyV8X4.js} +16 -16
- package/dist/component/{tags-rac-BPjw67Po.js → tags-rac-BMEbpJ-z.js} +1 -1
- package/dist/component/{text-area-field-rac-BG6MJuIW.js → text-area-field-rac-BLSrNwJ6.js} +9 -9
- package/dist/component/{text-area-rac-BAS4F4VC.js → text-area-rac-Cm7aAfIz.js} +1 -1
- package/dist/component/{text-input-field-rac-BhMktcEd.js → text-input-field-rac-BDqV7s0M.js} +3 -3
- package/dist/component/{text-input-headless-Bpjd70nh.js → text-input-headless-B0jcwDev.js} +7 -7
- package/dist/component/{text-input-rac-Bj21XKGA.js → text-input-rac-Cc_SkCCS.js} +1 -1
- package/dist/component/{time-input-rac-DBpRHdnX.js → time-input-rac-DDCiAFe2.js} +33 -33
- package/dist/component/{url-input-field-rac-B_EMXVWh.js → url-input-field-rac-jen6pbz7.js} +24 -24
- package/dist/component/{url-input-rac-D0Ck-9KV.js → url-input-rac-BWh6udtS.js} +1 -1
- package/dist/component/{use-dropdown-option-class-name-CkpHwC6t.js → use-dropdown-option-class-name-OD8brKoy.js} +2 -2
- package/dist/component/{use-dropdown-trigger-class-name-DmDwpAVn.js → use-dropdown-trigger-class-name-BrkmG0ad.js} +4 -4
- package/dist/component/{use-element-state-class-name-BrgdwHYP.js → use-element-state-class-name-B1r_nXW1.js} +3 -3
- package/dist/component/{use-hoverable-input-class-name-qVo45l-t.js → use-hoverable-input-class-name-B-FhrcyQ.js} +6 -6
- package/dist/component/{use-service-options-base-Dlqs4p0Z.js → use-service-options-base-CTA_43F3.js} +1 -1
- package/dist/component/use-text-input-class-name-BXuk3TK7.js +6 -0
- package/dist/form.d.ts +36 -0
- package/package.json +2 -2
- package/dist/component/field-label-headless-D-kCfg8j.js +0 -52
- package/dist/component/submit-button-rac-CKM7yUL4.js +0 -172
- package/dist/component/use-text-input-class-name-CP2VJOso.js +0 -6
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import t, { useState as Y, useRef as q, 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 xe } from "@wix/ricos/viewer";
|
|
4
4
|
import Z from "classnames";
|
|
5
|
-
import {
|
|
5
|
+
import { bj as Ce, bx as oe, bs as ve, aq as Ne, bv as De, aj as ie, bw as Te, bk as Ee, bn as z, bp as Se, bh as Be, bg as ye, R as Ie, $ as Re, b as Ze, J as Ae, K as ce, u as ue, H as de, G as me, I as Me, f as te } from "./form-D3iU18lh.js";
|
|
6
6
|
import { E as Oe } from "./error-icon-hZxQ6DEy.js";
|
|
7
7
|
import { s as $ } from "./field-rac.module-DfEb7pBp.js";
|
|
8
|
-
import { u as pe } from "./use-element-state-class-name-
|
|
8
|
+
import { u as pe } from "./use-element-state-class-name-B1r_nXW1.js";
|
|
9
9
|
import { DropZone as Ue, Text as we, FileTrigger as He, Button as Fe, ProgressBar as Pe, VisuallyHidden as qe } from "react-aria-components";
|
|
10
10
|
import { f as L, a as W } from "./find-child-C60k4CxG.js";
|
|
11
|
-
import { b as ke, a as ze, D as Ve, E as je } from "./field-error-headless-
|
|
12
|
-
import { L as Ke } from "./field-label-headless-
|
|
11
|
+
import { b as ke, a as ze, D as Ve, E as je } from "./field-error-headless-ClPQ03Jc.js";
|
|
12
|
+
import { L as Ke } from "./field-label-headless-DhN8Lkuq.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: o } =
|
|
21
|
+
const { actions: n, formId: o } = Ce();
|
|
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: o,
|
|
28
28
|
uploadTarget: e
|
|
29
29
|
}).then((i) => {
|
|
30
|
-
const { id:
|
|
31
|
-
fileId:
|
|
30
|
+
const { id: C, displayName: m, url: p, isPrivate: c } = i, T = {
|
|
31
|
+
fileId: C,
|
|
32
32
|
displayName: m || r.name,
|
|
33
33
|
url: c ? void 0 : p,
|
|
34
34
|
fileType: r.type || "application/octet-stream"
|
|
@@ -43,16 +43,16 @@ const $e = {
|
|
|
43
43
|
return (await Promise.all(E)).filter((r) => r !== void 0);
|
|
44
44
|
};
|
|
45
45
|
};
|
|
46
|
-
function We({ valueSliderLimit: e, value: n, explanationText: o, target: l, onChange: s, uploadFileFormats: d, onBlur: E, onFilesCleared:
|
|
47
|
-
const [r, i] = Y(Ge(n)), [
|
|
46
|
+
function We({ valueSliderLimit: e, value: n, explanationText: o, target: l, onChange: s, uploadFileFormats: d, onBlur: E, onFilesCleared: x }) {
|
|
47
|
+
const [r, i] = Y(Ge(n)), [C, m] = Y(n || []), [p, c] = Y(), T = Ye(l), { t: v } = oe(), g = ve().includes(Ne.BUTTONS_HOVER), { setFormStatus: B } = De(), I = q(!1), y = q(s);
|
|
48
48
|
y.current = s;
|
|
49
|
-
const
|
|
49
|
+
const N = fe(() => r.some((f) => f.state === "uploading"), [
|
|
50
50
|
r
|
|
51
51
|
]);
|
|
52
52
|
ne(() => {
|
|
53
|
-
I.current !==
|
|
53
|
+
I.current !== N && (I.current = N, B(l, N ? ie.BUSY : ie.READY));
|
|
54
54
|
}, [
|
|
55
|
-
|
|
55
|
+
N,
|
|
56
56
|
B,
|
|
57
57
|
l
|
|
58
58
|
]);
|
|
@@ -62,16 +62,16 @@ function We({ valueSliderLimit: e, value: n, explanationText: o, target: l, onCh
|
|
|
62
62
|
const h = r.filter((f) => f.state === "uploading").length;
|
|
63
63
|
if (h) {
|
|
64
64
|
const f = r.filter((F) => F.state === "uploaded" && F.file.size > 0).length, _ = f / (f + h);
|
|
65
|
-
return
|
|
65
|
+
return v("form.file-upload.uploading", {
|
|
66
66
|
count: Math.round(_ * 100)
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
return
|
|
69
|
+
return v("form.file-upload.explanation-text", {
|
|
70
70
|
count: r.length
|
|
71
71
|
});
|
|
72
72
|
}, [
|
|
73
73
|
r,
|
|
74
|
-
|
|
74
|
+
v
|
|
75
75
|
]), R = M(() => r.length ? r.some((f) => f.state === "uploading") ? u() : o || u() : o, [
|
|
76
76
|
r,
|
|
77
77
|
o,
|
|
@@ -92,16 +92,16 @@ function We({ valueSliderLimit: e, value: n, explanationText: o, target: l, onCh
|
|
|
92
92
|
i((F) => F.map((b) => b.file === _ ? {
|
|
93
93
|
file: _,
|
|
94
94
|
state: "error",
|
|
95
|
-
errorMessage:
|
|
95
|
+
errorMessage: v("form.file-upload.error.upload-failed")
|
|
96
96
|
} : b));
|
|
97
97
|
});
|
|
98
98
|
}, [
|
|
99
99
|
T,
|
|
100
|
-
|
|
100
|
+
v
|
|
101
101
|
]), j = async (h) => {
|
|
102
102
|
if (p && c(void 0), h) {
|
|
103
103
|
if (r.length + h.length > e) {
|
|
104
|
-
c(
|
|
104
|
+
c(v("form.file-upload.error.upload-limit", {
|
|
105
105
|
limit: e
|
|
106
106
|
}));
|
|
107
107
|
return;
|
|
@@ -117,14 +117,14 @@ function We({ valueSliderLimit: e, value: n, explanationText: o, target: l, onCh
|
|
|
117
117
|
}
|
|
118
118
|
}, U = (h) => {
|
|
119
119
|
const f = r[h];
|
|
120
|
-
if (
|
|
121
|
-
const _ =
|
|
120
|
+
if (C && s && f.state !== "error") {
|
|
121
|
+
const _ = C.filter((b) => b.displayName !== f.file.name);
|
|
122
122
|
s(_), m(_);
|
|
123
123
|
const F = r.filter((b) => b.file.name !== f.file.name);
|
|
124
|
-
i(F), F.length === 0 &&
|
|
124
|
+
i(F), F.length === 0 && x();
|
|
125
125
|
} else {
|
|
126
126
|
const _ = r.filter((F) => F !== f);
|
|
127
|
-
i(_), _.length === 0 &&
|
|
127
|
+
i(_), _.length === 0 && x();
|
|
128
128
|
}
|
|
129
129
|
}, K = () => {
|
|
130
130
|
p && c(void 0), E();
|
|
@@ -170,15 +170,15 @@ const k = ({ children: e, className: n }) => {
|
|
|
170
170
|
const { ariaDescribedBy: o } = Ee(), { disabled: l, hasError: s } = z(), { handleFileChange: d, limitReached: E } = V();
|
|
171
171
|
if (E)
|
|
172
172
|
return null;
|
|
173
|
-
const
|
|
173
|
+
const x = L(e, k.Title), r = L(e, k.Subtitle), i = L(e, k.Button);
|
|
174
174
|
return /* @__PURE__ */ t.createElement(Ue, {
|
|
175
175
|
"aria-describedby": o,
|
|
176
176
|
className: n,
|
|
177
177
|
"data-invalid": s,
|
|
178
178
|
isDisabled: l,
|
|
179
|
-
onDrop: async (
|
|
179
|
+
onDrop: async (C) => {
|
|
180
180
|
const m = [];
|
|
181
|
-
for (const p of
|
|
181
|
+
for (const p of C.items)
|
|
182
182
|
if (p.kind === "file") {
|
|
183
183
|
const c = await p.getFile();
|
|
184
184
|
c && m.push(c);
|
|
@@ -190,7 +190,7 @@ const k = ({ children: e, className: n }) => {
|
|
|
190
190
|
}
|
|
191
191
|
}, /* @__PURE__ */ t.createElement(we, {
|
|
192
192
|
slot: "label"
|
|
193
|
-
},
|
|
193
|
+
}, x, r), i);
|
|
194
194
|
}, Je = ({ className: e, children: n }) => {
|
|
195
195
|
const { limitReached: o } = V();
|
|
196
196
|
return /* @__PURE__ */ t.createElement("p", {
|
|
@@ -206,19 +206,19 @@ const k = ({ children: e, className: n }) => {
|
|
|
206
206
|
limitReached: o
|
|
207
207
|
}));
|
|
208
208
|
}, re = ({ className: e, children: n, "aria-roledescription": o, onHoverStart: l, onHoverEnd: s, onFocusChange: d }) => {
|
|
209
|
-
const { ariaDescribedBy: E, inputId:
|
|
209
|
+
const { ariaDescribedBy: E, inputId: x, labelId: r, errorId: i } = Ee(), { disabled: C, required: m, onFocus: p, hasError: c, errorMessage: T } = z(), { handleFileChange: v, accept: O, multiple: g, buttonRef: B, handleBlur: I, limitError: y, files: N } = V(), u = (N == null ? void 0 : N.some((S) => S.errorMessage)) ?? !1, R = !!(c || T || y || u);
|
|
210
210
|
return /* @__PURE__ */ t.createElement(He, {
|
|
211
211
|
acceptedFileTypes: O ? O.split(",") : void 0,
|
|
212
212
|
allowsMultiple: g,
|
|
213
213
|
onSelect: (S) => {
|
|
214
214
|
if (S) {
|
|
215
215
|
const j = Array.from(S), U = new DataTransfer();
|
|
216
|
-
j.forEach((K) => U.items.add(K)),
|
|
216
|
+
j.forEach((K) => U.items.add(K)), v(U.files);
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
}, /* @__PURE__ */ t.createElement(Fe, {
|
|
220
220
|
ref: B,
|
|
221
|
-
id:
|
|
221
|
+
id: x,
|
|
222
222
|
"aria-labelledby": r,
|
|
223
223
|
"aria-describedby": [
|
|
224
224
|
E,
|
|
@@ -230,7 +230,7 @@ const k = ({ children: e, className: n }) => {
|
|
|
230
230
|
"aria-invalid": R || void 0,
|
|
231
231
|
"aria-required": m
|
|
232
232
|
}),
|
|
233
|
-
isDisabled:
|
|
233
|
+
isDisabled: C,
|
|
234
234
|
className: e,
|
|
235
235
|
onFocus: p,
|
|
236
236
|
onBlur: I,
|
|
@@ -249,12 +249,12 @@ k.Title = Je;
|
|
|
249
249
|
k.Subtitle = Qe;
|
|
250
250
|
k.Button = re;
|
|
251
251
|
const A = ({ children: e, className: n, ...o }) => {
|
|
252
|
-
const { file: l, index: s } = o, d = l.file.name, E = L(e, A.Name),
|
|
252
|
+
const { file: l, index: s } = o, d = l.file.name, E = L(e, A.Name), x = L(e, A.Remove), r = 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" ? r : W(
|
|
257
|
+
}), l.state === "uploading" ? r : W(x, {
|
|
258
258
|
index: s,
|
|
259
259
|
fileName: d
|
|
260
260
|
}), l.errorMessage && W(i, {
|
|
@@ -266,7 +266,7 @@ const A = ({ children: e, className: n, ...o }) => {
|
|
|
266
266
|
className: e
|
|
267
267
|
}, o);
|
|
268
268
|
}, tt = ({ className: e, "aria-label": n, children: o, ...l }) => {
|
|
269
|
-
const { fileName: s, index: d } = l, { disabled: E } = z(), { handleDelete:
|
|
269
|
+
const { fileName: s, index: d } = l, { disabled: E } = z(), { handleDelete: x, fileRemoveButtonRefs: r } = V(), i = q(null);
|
|
270
270
|
ne(() => {
|
|
271
271
|
const m = r.current, p = s;
|
|
272
272
|
return m[p] = i, () => {
|
|
@@ -276,15 +276,15 @@ const A = ({ children: e, className: n, ...o }) => {
|
|
|
276
276
|
s,
|
|
277
277
|
r
|
|
278
278
|
]);
|
|
279
|
-
const
|
|
280
|
-
|
|
279
|
+
const C = () => {
|
|
280
|
+
x(d);
|
|
281
281
|
};
|
|
282
282
|
return /* @__PURE__ */ t.createElement(Fe, {
|
|
283
283
|
ref: i,
|
|
284
284
|
"aria-disabled": E,
|
|
285
285
|
"aria-label": n,
|
|
286
286
|
"aria-description": s,
|
|
287
|
-
onClick:
|
|
287
|
+
onClick: C,
|
|
288
288
|
className: e,
|
|
289
289
|
isDisabled: E
|
|
290
290
|
}, o);
|
|
@@ -318,13 +318,13 @@ const le = ({ children: e, className: n }) => {
|
|
|
318
318
|
};
|
|
319
319
|
le.File = A;
|
|
320
320
|
const Q = (e) => e.file.name, a = ({ children: e }) => {
|
|
321
|
-
const { t: n } = oe(), { id: o, value: l, onChange: s, uploadFileFormats: d, valueSliderLimit: E, target:
|
|
322
|
-
c.current ? c.current.focus() :
|
|
323
|
-
}, []), { files: g, limitError: B, hover: I, getExplanationText: y, getStatusText:
|
|
321
|
+
const { t: n } = oe(), { id: o, value: l, onChange: s, uploadFileFormats: d, valueSliderLimit: E, target: x, explanationText: r, onBlur: i, hasError: C, errorMessage: m, FieldLayout: p } = z(), c = q(null), T = q({}), v = q(!1), O = M(() => {
|
|
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: j } = We({
|
|
324
324
|
valueSliderLimit: E,
|
|
325
325
|
value: l,
|
|
326
326
|
explanationText: r,
|
|
327
|
-
target:
|
|
327
|
+
target: x,
|
|
328
328
|
onChange: s,
|
|
329
329
|
uploadFileFormats: d,
|
|
330
330
|
onBlur: i,
|
|
@@ -338,7 +338,7 @@ const Q = (e) => e.file.name, a = ({ children: e }) => {
|
|
|
338
338
|
g
|
|
339
339
|
]);
|
|
340
340
|
ne(() => {
|
|
341
|
-
|
|
341
|
+
v.current && c.current && (v.current = !1, c.current.focus());
|
|
342
342
|
}, [
|
|
343
343
|
g
|
|
344
344
|
]);
|
|
@@ -351,7 +351,7 @@ const Q = (e) => e.file.name, a = ({ children: e }) => {
|
|
|
351
351
|
limitReached: G,
|
|
352
352
|
multiple: K,
|
|
353
353
|
getExplanationText: y,
|
|
354
|
-
getStatusText:
|
|
354
|
+
getStatusText: N,
|
|
355
355
|
hover: I,
|
|
356
356
|
limitError: B,
|
|
357
357
|
buttonRef: c,
|
|
@@ -365,7 +365,7 @@ const Q = (e) => e.file.name, a = ({ children: e }) => {
|
|
|
365
365
|
G,
|
|
366
366
|
K,
|
|
367
367
|
y,
|
|
368
|
-
|
|
368
|
+
N,
|
|
369
369
|
I,
|
|
370
370
|
B
|
|
371
371
|
]), h = L(e, a.Label), f = L(e, a.DropZone), _ = L(e, a.Button), F = L(e, a.Explanation), b = L(e, a.Files), w = L(e, a.Description), ae = L(e, a.Error);
|
|
@@ -383,7 +383,7 @@ const Q = (e) => e.file.name, a = ({ children: e }) => {
|
|
|
383
383
|
renderLabel: () => h,
|
|
384
384
|
renderInput: () => f ?? _,
|
|
385
385
|
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, W(ae, {
|
|
386
|
-
hasError: !!(
|
|
386
|
+
hasError: !!(C || B),
|
|
387
387
|
errorMessage: B ?? m
|
|
388
388
|
}), /* @__PURE__ */ t.createElement(qe, {
|
|
389
389
|
role: "status",
|
|
@@ -480,11 +480,11 @@ const rt = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
480
480
|
removeButton: ht,
|
|
481
481
|
spinner: _t,
|
|
482
482
|
fileError: Lt
|
|
483
|
-
},
|
|
483
|
+
}, xt = ({ content: e, locale: n }) => /* @__PURE__ */ t.createElement(xe, {
|
|
484
484
|
content: e,
|
|
485
485
|
locale: n
|
|
486
|
-
}),
|
|
487
|
-
var B, I, y,
|
|
486
|
+
}), Ct = () => {
|
|
487
|
+
var B, I, y, N;
|
|
488
488
|
const { t: e } = oe(), { disabled: n, readOnly: o } = z(), l = !n && !o, s = pe({
|
|
489
489
|
globalClasses: de,
|
|
490
490
|
moduleClasses: {
|
|
@@ -497,7 +497,7 @@ const rt = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
497
497
|
base: D.button,
|
|
498
498
|
hover: D.buttonHover
|
|
499
499
|
}
|
|
500
|
-
}), E = (
|
|
500
|
+
}), 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: x, className: r, ...i } = E ?? {}, C = ye(te.FILE_UPLOAD, te.UPLOAD_BUTTON, te.UPLOAD_BUTTON_LABEL), m = q(null), [p, c] = Y(!1), [T, v] = Y(!1), O = M(() => {
|
|
501
501
|
var u;
|
|
502
502
|
c(!0), (u = m.current) == null || u.runAnimationForward();
|
|
503
503
|
}, []), g = M(() => {
|
|
@@ -529,13 +529,13 @@ const rt = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
529
529
|
"aria-roledescription": e("file-upload.aria-roledescription"),
|
|
530
530
|
onHoverStart: O,
|
|
531
531
|
onHoverEnd: g,
|
|
532
|
-
onFocusChange:
|
|
532
|
+
onFocusChange: v
|
|
533
533
|
}, i.svg ? /* @__PURE__ */ t.createElement(Le, {
|
|
534
534
|
...i,
|
|
535
535
|
ref: m,
|
|
536
536
|
className: Z(Ze, Ae, r)
|
|
537
537
|
}) : E ? null : /* @__PURE__ */ t.createElement(rt, null), /* @__PURE__ */ t.createElement(a.DropZone.Button.Text, {
|
|
538
|
-
className: Z(ce.base, D.buttonLabel,
|
|
538
|
+
className: Z(ce.base, D.buttonLabel, C, {
|
|
539
539
|
[ce.hover]: l && (p || T)
|
|
540
540
|
})
|
|
541
541
|
}))), /* @__PURE__ */ t.createElement(a.Explanation, {
|
|
@@ -557,10 +557,10 @@ const rt = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
557
557
|
className: Z(me, $.error, D.fileError)
|
|
558
558
|
}, /* @__PURE__ */ t.createElement(lt, null), /* @__PURE__ */ t.createElement(a.Files.File.Error.Text, null)))), /* @__PURE__ */ t.createElement(a.Description, {
|
|
559
559
|
className: Z(ue, $.description)
|
|
560
|
-
},
|
|
560
|
+
}, xt), /* @__PURE__ */ t.createElement(a.Error, {
|
|
561
561
|
className: Z(me, $.error)
|
|
562
562
|
}, /* @__PURE__ */ t.createElement(Oe, null), /* @__PURE__ */ t.createElement(a.Error.Text, null)));
|
|
563
|
-
}, Ut = () => /* @__PURE__ */ t.createElement(
|
|
563
|
+
}, Ut = () => /* @__PURE__ */ t.createElement(Ct, null);
|
|
564
564
|
export {
|
|
565
565
|
Ut as FileUploadRAC
|
|
566
566
|
};
|
|
@@ -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 {
|
|
4
|
+
import { bn as C, bf as I, bk as P, R, L as S, u as x } from "./form-D3iU18lh.js";
|
|
5
5
|
import { f as c, a as N } 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 g } from "./field-label-headless-
|
|
7
|
+
import { D as v, E as M } from "./field-error-headless-ClPQ03Jc.js";
|
|
8
|
+
import { L as g } from "./field-label-headless-DhN8Lkuq.js";
|
|
9
9
|
import { s as F } from "./field-rac.module-DfEb7pBp.js";
|
|
10
10
|
const e = ({ children: r }) => {
|
|
11
11
|
var p;
|
|
@@ -14,16 +14,16 @@ const e = ({ children: r }) => {
|
|
|
14
14
|
return (f = (E = (d = n == null ? void 0 : n.predefined) == null ? void 0 : d.paymentOptions) == null ? void 0 : E.products) == null ? void 0 : f[0];
|
|
15
15
|
}, [
|
|
16
16
|
n
|
|
17
|
-
]), i = (p = s == null ? void 0 : s.fixedPriceOptions) == null ? void 0 : p.price, L = c(r, e.Label),
|
|
17
|
+
]), i = (p = s == null ? void 0 : s.fixedPriceOptions) == null ? void 0 : p.price, L = c(r, e.Label), y = c(r, e.Amount), b = c(r, e.Description), D = c(r, e.Error);
|
|
18
18
|
return /* @__PURE__ */ t.createElement(l, {
|
|
19
19
|
fieldId: a,
|
|
20
20
|
renderLabel: () => L,
|
|
21
|
-
renderInput: () => N(
|
|
21
|
+
renderInput: () => N(y, {
|
|
22
22
|
price: i,
|
|
23
23
|
currencyCode: o == null ? void 0 : o.code,
|
|
24
24
|
locale: m
|
|
25
25
|
}),
|
|
26
|
-
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, D,
|
|
26
|
+
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, D, b)
|
|
27
27
|
});
|
|
28
28
|
}, T = ({ className: r, ...a }) => {
|
|
29
29
|
const { price: n, currencyCode: l, locale: o } = a, { inputId: m, ariaDescribedBy: s } = P(), i = O({
|
|
@@ -44,18 +44,18 @@ e.Label = V;
|
|
|
44
44
|
e.Amount = T;
|
|
45
45
|
e.Description = v;
|
|
46
46
|
e.Error = M;
|
|
47
|
-
const
|
|
48
|
-
value:
|
|
49
|
-
},
|
|
47
|
+
const k = "_value_c7203_1", B = {
|
|
48
|
+
value: k
|
|
49
|
+
}, w = ({ content: r, locale: a }) => /* @__PURE__ */ t.createElement(A, {
|
|
50
50
|
content: r,
|
|
51
51
|
locale: a
|
|
52
|
-
}),
|
|
52
|
+
}), X = () => /* @__PURE__ */ t.createElement(e, null, /* @__PURE__ */ t.createElement(e.Label, {
|
|
53
53
|
className: u(R, F.label)
|
|
54
54
|
}), /* @__PURE__ */ t.createElement(e.Amount, {
|
|
55
|
-
className: u(S,
|
|
55
|
+
className: u(S, B.value)
|
|
56
56
|
}), /* @__PURE__ */ t.createElement(e.Description, {
|
|
57
57
|
className: u(x, F.description)
|
|
58
|
-
},
|
|
58
|
+
}, w)), Q = () => /* @__PURE__ */ t.createElement(X, null);
|
|
59
59
|
export {
|
|
60
60
|
Q as FixedPaymentRAC
|
|
61
61
|
};
|