@wix/form-elements 1.64.0 → 1.65.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-DojiZqx9.js → appointment-rac-0kUk8XQJ.js} +35 -35
- package/dist/component/{bookings-address-rac-Bm_lQchD.js → bookings-address-rac-BUM0wpw0.js} +1 -1
- package/dist/component/{bookings-email-rac-vwuy0kW8.js → bookings-email-rac-BHlvupVS.js} +1 -1
- package/dist/component/{bookings-first-name-rac-BbWuLoeg.js → bookings-first-name-rac-Bwn6xv1U.js} +1 -1
- package/dist/component/{bookings-header-rac-DVknNH29.js → bookings-header-rac-BkRvQMi4.js} +1 -1
- package/dist/component/{bookings-last-name-rac-BnT3Cq0b.js → bookings-last-name-rac-DRTj4VdX.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-DKi-VAXc.js → bookings-login-bar-rac-D-2Bt7Kx.js} +2 -2
- package/dist/component/{bookings-phone-rac-Bfy8rheB.js → bookings-phone-rac-CTcHHpDr.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-DGiBDcXw.js → bookings-rich-text-rac-n-w9iWII.js} +1 -1
- package/dist/component/{checkbox-field-rac-CYADRY54.js → checkbox-field-rac-BamOJv3P.js} +43 -43
- package/dist/component/{checkbox-group-field-headless-BDAFpX5F.js → checkbox-group-field-headless-BmKJbEi0.js} +3 -3
- package/dist/component/{checkbox-group-field-rac-2YUsOmDI.js → checkbox-group-field-rac-CC8qfj0Y.js} +6 -6
- package/dist/component/{checkbox-group-rac-CQf1C9H5.js → checkbox-group-rac-CsrP7zD5.js} +1 -1
- package/dist/component/{checkbox-rac-Bjv8jZjs.js → checkbox-rac-X6E-fJ8k.js} +1 -1
- package/dist/component/{contacts-address-rac-BBTiEec9.js → contacts-address-rac-oYnkIZ6m.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-XReeFHVW.js → contacts-birthdate-rac-B7p8LgYA.js} +1 -1
- package/dist/component/{contacts-company-rac-B-fUQszu.js → contacts-company-rac-cjLRO5J-.js} +1 -1
- package/dist/component/{contacts-email-rac-DBtcCcsV.js → contacts-email-rac-BlJJSkGK.js} +1 -1
- package/dist/component/{contacts-first-name-rac-mkwU3706.js → contacts-first-name-rac-Nl-MDndn.js} +1 -1
- package/dist/component/{contacts-last-name-rac-DY5N-AZx.js → contacts-last-name-rac-DhxAobRI.js} +1 -1
- package/dist/component/{contacts-phone-rac-Ce1rMz_z.js → contacts-phone-rac-CZLWlH0T.js} +1 -1
- package/dist/component/{contacts-position-rac-B65H8PDu.js → contacts-position-rac-DlKC0lCU.js} +1 -1
- package/dist/component/contacts-subscribe-rac-POSKh1Ta.js +13 -0
- package/dist/component/{contacts-tax-id-rac-Jtt0ySK2.js → contacts-tax-id-rac-uyBKxOJn.js} +1 -1
- package/dist/component/{date-availability-B8UwvTJa.js → date-availability-DnFJD1aS.js} +1 -1
- package/dist/component/{date-input-field-rac-RL2a0xoD.js → date-input-field-rac-DojzGm-i.js} +30 -30
- package/dist/component/{date-input-rac-ak3G7V07.js → date-input-rac-BaPKcAuU.js} +1 -1
- package/dist/component/{date-picker-field-rac-SL_Roltf.js → date-picker-field-rac-C1rzJMV8.js} +16 -16
- package/dist/component/{date-picker-rac-ByrM0YIX.js → date-picker-rac-BHsOfkYn.js} +1 -1
- package/dist/component/{date-time-input-field-rac-DOE7xcKi.js → date-time-input-field-rac-B4jAAxU8.js} +15 -15
- package/dist/component/{date-time-input-rac-BA-GyrAc.js → date-time-input-rac-XyL5z_ma.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-EwUnBO80.js → dext-checkbox-group-rac-DzpdOP3i.js} +2 -2
- package/dist/component/{dext-checkbox-rac-CIRKi4B5.js → dext-checkbox-rac-BUWkvW5s.js} +1 -1
- package/dist/component/{dext-date-picker-rac-BYO_Q1zM.js → dext-date-picker-rac-CR0PUoOn.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-BOahPeaH.js → dext-date-time-input-rac-D3WhLSKK.js} +1 -1
- package/dist/component/{dext-dropdown-rac-sTD_r-0H.js → dext-dropdown-rac-BJ1UfAIM.js} +1 -1
- package/dist/component/{dext-email-rac-e-2_h3he.js → dext-email-rac-xk_5C79-.js} +1 -1
- package/dist/component/{dext-number-input-rac-D6LACzWl.js → dext-number-input-rac-Cu1Sqoac.js} +1 -1
- package/dist/component/{dext-phone-rac-kUycy5Od.js → dext-phone-rac-S34qxXwg.js} +1 -1
- package/dist/component/{dext-radio-group-rac-DPD2UkrV.js → dext-radio-group-rac-DXnAk_eU.js} +2 -2
- package/dist/component/{dext-rating-input-rac-DUsnrl9W.js → dext-rating-input-rac-ewGpgB63.js} +1 -1
- package/dist/component/{dext-tags-rac-D6z69HuO.js → dext-tags-rac-BApZKGqP.js} +2 -2
- package/dist/component/{dext-text-area-rac-C-DVtFJ1.js → dext-text-area-rac-DBtuaiwM.js} +1 -1
- package/dist/component/{dext-text-input-rac-CIa2MdC6.js → dext-text-input-rac-qI8VECmA.js} +1 -1
- package/dist/component/{dext-url-input-rac-8rVVW5us.js → dext-url-input-rac-C6vzqNjn.js} +1 -1
- package/dist/component/donation-rac-BDVKvG4j.js +302 -0
- package/dist/component/{dropdown-field-headless-DReo519l.js → dropdown-field-headless-DBl8vGed.js} +3 -3
- package/dist/component/{dropdown-field-rac-DzrjA2O6.js → dropdown-field-rac-O6G7_kSn.js} +7 -7
- package/dist/component/{dropdown-rac-CS7oLTp_.js → dropdown-rac-BImZ5Jwe.js} +1 -1
- package/dist/component/{ecom-address-rac-EIb88J_6.js → ecom-address-rac-BU4XZ_Do.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-CE0Ks6qS.js → ecom-subscription-checkbox-rac-DLzpoNYm.js} +5 -5
- package/dist/component/{email-input-field-rac-BScZxYHw.js → email-input-field-rac-Ui0p35z5.js} +59 -59
- package/dist/component/{events-repeater-rac-Y0rH2Jli.js → events-repeater-rac-bPKOOOit.js} +8 -8
- package/dist/component/{events-rsvp-rac-BiAYVv_b.js → events-rsvp-rac-lsRBBfPQ.js} +12 -12
- package/dist/component/{field-error-headless-DrnFrGun.js → field-error-headless-D6iejMQP.js} +1 -1
- package/dist/component/{field-label-headless-BIYf1BIh.js → field-label-headless-BWLfU3YB.js} +1 -1
- package/dist/component/field-rac.module-DnUIb9Oh.js +21 -0
- package/dist/component/{file-upload-rac-br--tZLp.js → file-upload-rac-DqKL8QQZ.js} +87 -87
- package/dist/component/{fixed-payment-rac-XEtrsaMy.js → fixed-payment-rac-BDtRB8w2.js} +9 -9
- package/dist/component/{form-9yjqDnxY.js → form-CtWkUmxc.js} +69 -69
- package/dist/component/form-element-classes-BSMjWijd.js +63 -0
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +1 -1
- package/dist/component/{header-field-rac-CLELgzqY.js → header-field-rac-BLM8RCDY.js} +3 -3
- package/dist/component/{header-rac-D8KGkVVp.js → header-rac-DViRwafg.js} +1 -1
- package/dist/component/image-choice-rac-D76t2y-b.js +141 -0
- package/dist/component/{index-PHkE0Ru4.js → index--iRBHLXJ.js} +4 -4
- package/dist/component/{index-C4y71e1i.js → index-pEItT2oo.js} +2 -2
- package/dist/component/{isObjectLike-srCDplej.js → isObjectLike-968AHV2b.js} +1 -1
- package/dist/component/{multiline-address-field-rac-CsBLI9y-.js → multiline-address-field-rac-CObOc8KE.js} +98 -98
- package/dist/component/{multiline-address-rac-DFDPFfXh.js → multiline-address-rac-1qVZkN41.js} +1 -1
- package/dist/component/{number-input-field-rac-DZRR7gdt.js → number-input-field-rac-CPQ3u0N7.js} +20 -20
- package/dist/component/{number-input-rac-BCS5lkff.js → number-input-rac-Bq1UyUPZ.js} +1 -1
- package/dist/component/{password-rac-ClDGgR3E.js → password-rac-BZPK1VkN.js} +9 -9
- package/dist/component/{payment-input-rac-COydWmUE.js → payment-input-rac-CQrV0WmN.js} +11 -11
- package/dist/component/{phone-input-field-rac-DYCibqe1.js → phone-input-field-rac-DzUE1-RF.js} +56 -56
- package/dist/component/{phone-rac-BS-dmWkJ.js → phone-rac-BovOZ7V5.js} +1 -1
- package/dist/component/{product-list-rac-hxOhaA-r.js → product-list-rac-CeGm1_WN.js} +22 -22
- package/dist/component/quiz-radio-group-rac-Lw2thQqC.js +13 -0
- package/dist/component/{radio-group-field-rac-DKqWnMBJ.js → radio-group-field-rac-BSVmjEgZ.js} +8 -8
- package/dist/component/{radio-group-field-rac.module-BwUynK_5.js → radio-group-field-rac.module-Cb3mm0f2.js} +3 -3
- package/dist/component/{radio-group-rac-DHURQZKK.js → radio-group-rac-BHhOCSQ2.js} +1 -1
- package/dist/component/{rating-input-field-rac-CZRdSVrf.js → rating-input-field-rac-BvbBZZDO.js} +21 -21
- package/dist/component/{rating-input-rac-BaH52DYm.js → rating-input-rac-DDe1EBpt.js} +1 -1
- package/dist/component/{rich-content-rac.module-ILBfxEmN.js → rich-content-rac.module-BacYkzEv.js} +1 -1
- package/dist/component/{rich-text-field-rac-B58q8Is7.js → rich-text-field-rac-D1W0mUjr.js} +5 -5
- package/dist/component/{rich-text-rac-DGbZh1eX.js → rich-text-rac-B-cOn0RU.js} +1 -1
- package/dist/component/{service-dropdown-rac-DUiNIbdv.js → service-dropdown-rac-CebfMkGP.js} +22 -22
- package/dist/component/{services-multi-choice-rac-B7y9s2l8.js → services-multi-choice-rac-C4bF1xhB.js} +29 -29
- package/dist/component/{signature-rac-CydpvQJZ.js → signature-rac-DWWT65Ez.js} +46 -46
- package/dist/component/{submit-button-rac-OO53h4H8.js → submit-button-rac-_mgn4ChE.js} +2 -2
- package/dist/component/{tags-field-rac-eX3d3JEH.js → tags-field-rac-7coCWj0y.js} +59 -59
- package/dist/component/{tags-rac-CdIB_48Z.js → tags-rac-rgsn8Os0.js} +1 -1
- package/dist/component/{text-area-field-rac-Bir5Q7gz.js → text-area-field-rac-5lUQxnNM.js} +15 -15
- package/dist/component/{text-area-rac-Ct1UNU04.js → text-area-rac-DpGOBzN3.js} +1 -1
- package/dist/component/{text-input-field-rac-onGUXC9J.js → text-input-field-rac-CgWadDfM.js} +3 -3
- package/dist/component/{text-input-headless-Bs9m7QFg.js → text-input-headless-fhxuPytc.js} +3 -3
- package/dist/component/{text-input-rac-DK4nEw4D.js → text-input-rac-kgWS3UUV.js} +1 -1
- package/dist/component/{time-input-rac-BCG9ktFa.js → time-input-rac-CuLUJcBH.js} +15 -15
- package/dist/component/{url-input-field-rac-mUkrVTcL.js → url-input-field-rac-CAGHb2na.js} +18 -18
- package/dist/component/{url-input-rac-Cl7LFYlr.js → url-input-rac-s5_SVi0h.js} +1 -1
- package/dist/component/{use-service-options-base-BYVuKRj2.js → use-service-options-base-CYAEJ75H.js} +1 -1
- package/package.json +2 -2
- package/dist/component/contacts-subscribe-rac-BxO8rIyL.js +0 -13
- package/dist/component/donation-rac-BjmSBabc.js +0 -305
- package/dist/component/field-rac.module-CWkwwhq4.js +0 -21
- package/dist/component/form-element-classes-KRzHUNLu.js +0 -57
- package/dist/component/image-choice-rac-Cl09CLP4.js +0 -141
- package/dist/component/quiz-radio-group-rac-BT-YZO2Q.js +0 -13
|
@@ -1,13 +1,13 @@
|
|
|
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 { ae as Fe, as as ie, an as ge, i as he, aq as xe, e as re, ar as be, af as ce, ai as
|
|
4
|
+
import { ae as Fe, as as ie, an as ge, i as he, aq as xe, e as re, ar as be, af as ce, ai as q, ak as Ce } from "./form-CtWkUmxc.js";
|
|
5
5
|
import { E as Le } from "./error-icon-hZxQ6DEy.js";
|
|
6
|
-
import { s as I } from "./field-rac.module-
|
|
7
|
-
import {
|
|
6
|
+
import { s as I } from "./field-rac.module-DnUIb9Oh.js";
|
|
7
|
+
import { z as ne, P as De, a1 as Ne, j as ae, q as le } from "./form-element-classes-BSMjWijd.js";
|
|
8
8
|
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-
|
|
9
|
+
import { b as ve, a as ye, D as _e, E as Te } from "./field-error-headless-D6iejMQP.js";
|
|
10
|
+
import { L as Be } from "./field-label-headless-BWLfU3YB.js";
|
|
11
11
|
import { DropZone as Re, Text as Se, FileTrigger as Me, Button as de, ProgressBar as Ie } from "react-aria-components";
|
|
12
12
|
const we = {
|
|
13
13
|
Video: "video/*",
|
|
@@ -21,32 +21,32 @@ const we = {
|
|
|
21
21
|
return async (o, i, d) => {
|
|
22
22
|
if (!(r != null && r.uploadFile) || !o.length)
|
|
23
23
|
return r != null && r.uploadFile || console.error("No uploadFile action"), o.length || console.error("No files to upload"), [];
|
|
24
|
-
const x = o.map(({ file:
|
|
25
|
-
file:
|
|
24
|
+
const x = o.map(({ file: a }) => r.uploadFile({
|
|
25
|
+
file: a,
|
|
26
26
|
formId: n,
|
|
27
27
|
uploadTarget: e
|
|
28
28
|
}).then((s) => {
|
|
29
29
|
const { id: b, displayName: m, url: c, isPrivate: N } = s, v = {
|
|
30
30
|
fileId: b,
|
|
31
|
-
displayName: m ||
|
|
31
|
+
displayName: m || a.name,
|
|
32
32
|
url: N ? void 0 : c,
|
|
33
|
-
fileType:
|
|
33
|
+
fileType: a.type || "application/octet-stream"
|
|
34
34
|
};
|
|
35
35
|
return i({
|
|
36
|
-
file:
|
|
36
|
+
file: a,
|
|
37
37
|
uploadedFile: v
|
|
38
38
|
}), v;
|
|
39
39
|
}).catch((s) => {
|
|
40
|
-
d(s,
|
|
40
|
+
d(s, a);
|
|
41
41
|
}));
|
|
42
|
-
return (await Promise.all(x)).filter((
|
|
42
|
+
return (await Promise.all(x)).filter((a) => a !== void 0);
|
|
43
43
|
};
|
|
44
44
|
};
|
|
45
45
|
function Ze({ valueSliderLimit: e, value: r, explanationText: n, target: o, onChange: i, uploadFileFormats: d, onBlur: x, onFilesCleared: D }) {
|
|
46
|
-
const [
|
|
46
|
+
const [a, s] = Q(ke(r)), [b, m] = Q(r || []), [c, N] = Q(), v = Ae(o), { t: E } = ie(), k = ge().includes(he.BUTTONS_HOVER), { setFormStatus: y } = xe(), S = V(!1), _ = V(i);
|
|
47
47
|
_.current = i;
|
|
48
|
-
const C = oe(() =>
|
|
49
|
-
|
|
48
|
+
const C = oe(() => a.some((u) => u.state === "uploading"), [
|
|
49
|
+
a
|
|
50
50
|
]);
|
|
51
51
|
se(() => {
|
|
52
52
|
S.current !== C && (S.current = C, y(o, C ? re.BUSY : re.READY));
|
|
@@ -56,20 +56,20 @@ function Ze({ valueSliderLimit: e, value: r, explanationText: n, target: o, onCh
|
|
|
56
56
|
o
|
|
57
57
|
]);
|
|
58
58
|
const U = P(() => {
|
|
59
|
-
if (!
|
|
59
|
+
if (!a.length)
|
|
60
60
|
return n;
|
|
61
|
-
const F =
|
|
61
|
+
const F = a.filter((u) => u.state === "uploading").length;
|
|
62
62
|
if (F) {
|
|
63
|
-
const u =
|
|
63
|
+
const u = a.filter((p) => p.state === "uploaded" && p.file.size > 0).length, g = u / (u + F);
|
|
64
64
|
return E("form.file-upload.uploading", {
|
|
65
65
|
count: Math.round(g * 100)
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
68
|
return n || E("form.file-upload.explanation-text", {
|
|
69
|
-
count:
|
|
69
|
+
count: a.length
|
|
70
70
|
});
|
|
71
71
|
}, [
|
|
72
|
-
|
|
72
|
+
a,
|
|
73
73
|
n,
|
|
74
74
|
E
|
|
75
75
|
]), M = P(async (F) => {
|
|
@@ -96,30 +96,30 @@ function Ze({ valueSliderLimit: e, value: r, explanationText: n, target: o, onCh
|
|
|
96
96
|
E
|
|
97
97
|
]), O = async (F) => {
|
|
98
98
|
if (c && N(void 0), F) {
|
|
99
|
-
if (
|
|
99
|
+
if (a.length + F.length > e) {
|
|
100
100
|
N(E("form.file-upload.error.upload-limit", {
|
|
101
101
|
limit: e
|
|
102
102
|
}));
|
|
103
103
|
return;
|
|
104
104
|
}
|
|
105
|
-
const p = Array.from(F).reduce((f, L) => (
|
|
105
|
+
const p = Array.from(F).reduce((f, L) => (a.some((Y) => Y.file.name === L.name) || f.push({
|
|
106
106
|
file: L,
|
|
107
107
|
state: "uploading"
|
|
108
108
|
}), f), []);
|
|
109
109
|
s([
|
|
110
|
-
...
|
|
110
|
+
...a,
|
|
111
111
|
...p
|
|
112
112
|
]), await M(p);
|
|
113
113
|
}
|
|
114
|
-
},
|
|
115
|
-
const u =
|
|
114
|
+
}, j = (F) => {
|
|
115
|
+
const u = a[F];
|
|
116
116
|
if (b && i && u.state !== "error") {
|
|
117
117
|
const g = b.filter((f) => f.displayName !== u.file.name);
|
|
118
118
|
i(g), m(g);
|
|
119
|
-
const p =
|
|
119
|
+
const p = a.filter((f) => f.file.name !== u.file.name);
|
|
120
120
|
s(p), p.length === 0 && D();
|
|
121
121
|
} else {
|
|
122
|
-
const g =
|
|
122
|
+
const g = a.filter((p) => p !== u);
|
|
123
123
|
s(g), g.length === 0 && D();
|
|
124
124
|
}
|
|
125
125
|
}, $ = () => {
|
|
@@ -128,12 +128,12 @@ function Ze({ valueSliderLimit: e, value: r, explanationText: n, target: o, onCh
|
|
|
128
128
|
s([]), m([]);
|
|
129
129
|
}, []);
|
|
130
130
|
return be(W), {
|
|
131
|
-
files:
|
|
131
|
+
files: a,
|
|
132
132
|
limitError: c,
|
|
133
133
|
hover: k,
|
|
134
134
|
getExplanationText: U,
|
|
135
135
|
handleChange: O,
|
|
136
|
-
handleDelete:
|
|
136
|
+
handleDelete: j,
|
|
137
137
|
accept: K,
|
|
138
138
|
handleBlur: $
|
|
139
139
|
};
|
|
@@ -162,7 +162,7 @@ function Z() {
|
|
|
162
162
|
return e;
|
|
163
163
|
}
|
|
164
164
|
const A = ({ children: e, className: r }) => {
|
|
165
|
-
const { ariaDescribedBy: n } = ce(), { disabled: o, hasError: i } =
|
|
165
|
+
const { ariaDescribedBy: n } = ce(), { disabled: o, hasError: i } = q(), { handleFileChange: d } = Z(), x = h(e, A.Title), D = h(e, A.Subtitle), a = h(e, A.Button);
|
|
166
166
|
return /* @__PURE__ */ t.createElement(Re, {
|
|
167
167
|
"aria-describedby": n,
|
|
168
168
|
className: r,
|
|
@@ -182,7 +182,7 @@ const A = ({ children: e, className: r }) => {
|
|
|
182
182
|
}
|
|
183
183
|
}, /* @__PURE__ */ t.createElement(Se, {
|
|
184
184
|
slot: "label"
|
|
185
|
-
}, x, D),
|
|
185
|
+
}, x, D), a);
|
|
186
186
|
}, Ue = ({ className: e, children: r }) => {
|
|
187
187
|
const { limitReached: n } = Z();
|
|
188
188
|
return /* @__PURE__ */ t.createElement("p", {
|
|
@@ -197,8 +197,8 @@ const A = ({ children: e, className: r }) => {
|
|
|
197
197
|
}, r({
|
|
198
198
|
limitReached: n
|
|
199
199
|
}));
|
|
200
|
-
},
|
|
201
|
-
const { ariaDescribedBy: o, inputId: i, labelId: d, errorId: x } = ce(), { disabled: D, required:
|
|
200
|
+
}, J = ({ className: e, children: r, "aria-roledescription": n }) => {
|
|
201
|
+
const { ariaDescribedBy: o, inputId: i, labelId: d, errorId: x } = ce(), { disabled: D, required: a, onFocus: s, hasError: b, errorMessage: m } = q(), { handleFileChange: c, accept: N, multiple: v, buttonRef: E, handleBlur: R, limitError: k, files: y } = Z(), S = (y == null ? void 0 : y.some((C) => C.errorMessage)) ?? !1, _ = !!(b || m || k || S);
|
|
202
202
|
return /* @__PURE__ */ t.createElement(Me, {
|
|
203
203
|
acceptedFileTypes: N ? N.split(",") : void 0,
|
|
204
204
|
allowsMultiple: v,
|
|
@@ -220,7 +220,7 @@ const A = ({ children: e, className: r }) => {
|
|
|
220
220
|
...C,
|
|
221
221
|
"aria-roledescription": n,
|
|
222
222
|
"aria-invalid": _ || void 0,
|
|
223
|
-
"aria-required":
|
|
223
|
+
"aria-required": a
|
|
224
224
|
}),
|
|
225
225
|
isDisabled: D,
|
|
226
226
|
className: e,
|
|
@@ -228,22 +228,22 @@ const A = ({ children: e, className: r }) => {
|
|
|
228
228
|
onBlur: R
|
|
229
229
|
}, r));
|
|
230
230
|
}, Pe = ({ className: e }) => {
|
|
231
|
-
const { buttonText: r } =
|
|
231
|
+
const { buttonText: r } = q();
|
|
232
232
|
return /* @__PURE__ */ t.createElement("span", {
|
|
233
233
|
className: e
|
|
234
234
|
}, r);
|
|
235
235
|
};
|
|
236
|
-
|
|
236
|
+
J.Text = Pe;
|
|
237
237
|
A.Title = Ue;
|
|
238
238
|
A.Subtitle = Oe;
|
|
239
|
-
A.Button =
|
|
239
|
+
A.Button = J;
|
|
240
240
|
const T = ({ children: e, className: r, ...n }) => {
|
|
241
|
-
const { file: o, index: i } = n, d = o.file.name, x = h(e, T.Name), D = h(e, T.Remove),
|
|
241
|
+
const { file: o, index: i } = n, d = o.file.name, x = h(e, T.Name), D = h(e, T.Remove), a = h(e, T.Spinner), s = h(e, T.Error);
|
|
242
242
|
return /* @__PURE__ */ t.createElement("div", {
|
|
243
243
|
className: r
|
|
244
244
|
}, z(x, {
|
|
245
245
|
fileName: d
|
|
246
|
-
}), o.state === "uploading" ?
|
|
246
|
+
}), o.state === "uploading" ? a : z(D, {
|
|
247
247
|
index: i,
|
|
248
248
|
fileName: d
|
|
249
249
|
}), o.errorMessage && z(s, {
|
|
@@ -255,15 +255,15 @@ const T = ({ children: e, className: r, ...n }) => {
|
|
|
255
255
|
className: e
|
|
256
256
|
}, n);
|
|
257
257
|
}, Ve = ({ className: e, "aria-label": r, children: n, ...o }) => {
|
|
258
|
-
const { fileName: i, index: d } = o, { disabled: x } =
|
|
258
|
+
const { fileName: i, index: d } = o, { disabled: x } = q(), { handleDelete: D, fileRemoveButtonRefs: a } = Z(), s = V(null);
|
|
259
259
|
se(() => {
|
|
260
|
-
const m =
|
|
260
|
+
const m = a.current, c = i;
|
|
261
261
|
return m[c] = s, () => {
|
|
262
262
|
m[c] === s && (m[c] = void 0);
|
|
263
263
|
};
|
|
264
264
|
}, [
|
|
265
265
|
i,
|
|
266
|
-
|
|
266
|
+
a
|
|
267
267
|
]);
|
|
268
268
|
const b = () => {
|
|
269
269
|
D(d);
|
|
@@ -285,18 +285,18 @@ const T = ({ children: e, className: r, ...n }) => {
|
|
|
285
285
|
className: e,
|
|
286
286
|
role: "alert"
|
|
287
287
|
}, r)) : null;
|
|
288
|
-
},
|
|
288
|
+
}, qe = ({ className: e, "aria-label": r, children: n }) => /* @__PURE__ */ t.createElement(Ie, {
|
|
289
289
|
"aria-label": r,
|
|
290
290
|
className: e,
|
|
291
291
|
isIndeterminate: !0
|
|
292
292
|
}, n);
|
|
293
293
|
T.Name = ze;
|
|
294
294
|
T.Remove = Ve;
|
|
295
|
-
T.Spinner =
|
|
295
|
+
T.Spinner = qe;
|
|
296
296
|
T.Error = ue;
|
|
297
297
|
ue.Text = ve;
|
|
298
|
-
const
|
|
299
|
-
const { files: n } = Z(), o = h(e,
|
|
298
|
+
const X = ({ children: e, className: r }) => {
|
|
299
|
+
const { files: n } = Z(), o = h(e, X.File);
|
|
300
300
|
return !n || n.length === 0 ? null : /* @__PURE__ */ t.createElement("div", {
|
|
301
301
|
className: r
|
|
302
302
|
}, n.map((i, d) => z(o, {
|
|
@@ -305,9 +305,9 @@ const G = ({ children: e, className: r }) => {
|
|
|
305
305
|
index: d
|
|
306
306
|
})));
|
|
307
307
|
};
|
|
308
|
-
|
|
309
|
-
const
|
|
310
|
-
const { id: r, value: n, onChange: o, uploadFileFormats: i, valueSliderLimit: d, target: x, explanationText: D, onBlur:
|
|
308
|
+
X.File = T;
|
|
309
|
+
const G = (e) => e.file.name, l = ({ children: e }) => {
|
|
310
|
+
const { id: r, value: n, onChange: o, uploadFileFormats: i, valueSliderLimit: d, target: x, explanationText: D, onBlur: a, hasError: s, errorMessage: b, FieldLayout: m } = q(), c = V(null), N = V({}), v = P(() => {
|
|
311
311
|
var L;
|
|
312
312
|
(L = c.current) == null || L.focus();
|
|
313
313
|
}, []), { files: E, limitError: R, hover: k, getExplanationText: y, handleBlur: S, handleChange: _, handleDelete: C, accept: U } = Ze({
|
|
@@ -317,22 +317,22 @@ const Q = (e) => e.file.name, a = ({ children: e }) => {
|
|
|
317
317
|
target: x,
|
|
318
318
|
onChange: o,
|
|
319
319
|
uploadFileFormats: i,
|
|
320
|
-
onBlur:
|
|
320
|
+
onBlur: a,
|
|
321
321
|
onFilesCleared: v
|
|
322
322
|
}), M = P((L) => {
|
|
323
323
|
var te;
|
|
324
|
-
const ee = E[L], Y =
|
|
325
|
-
E.length > 1 && ((te = (E.filter((H) =>
|
|
324
|
+
const ee = E[L], Y = G(ee);
|
|
325
|
+
E.length > 1 && ((te = (E.filter((H) => G(H) !== Y).map((H) => N.current[G(H)]).find(Boolean) ?? c).current) == null || te.focus()), C(L);
|
|
326
326
|
}, [
|
|
327
327
|
C,
|
|
328
328
|
E
|
|
329
|
-
]), O = d > 1,
|
|
329
|
+
]), O = d > 1, j = E.length >= d, $ = oe(() => ({
|
|
330
330
|
handleFileChange: _,
|
|
331
331
|
handleBlur: S,
|
|
332
332
|
handleDelete: M,
|
|
333
333
|
files: E,
|
|
334
334
|
accept: U,
|
|
335
|
-
limitReached:
|
|
335
|
+
limitReached: j,
|
|
336
336
|
multiple: O,
|
|
337
337
|
getExplanationText: y,
|
|
338
338
|
hover: k,
|
|
@@ -345,12 +345,12 @@ const Q = (e) => e.file.name, a = ({ children: e }) => {
|
|
|
345
345
|
M,
|
|
346
346
|
E,
|
|
347
347
|
U,
|
|
348
|
-
|
|
348
|
+
j,
|
|
349
349
|
O,
|
|
350
350
|
y,
|
|
351
351
|
k,
|
|
352
352
|
R
|
|
353
|
-
]), K = h(e,
|
|
353
|
+
]), K = h(e, l.Label), W = h(e, l.DropZone), F = h(e, l.Button), u = h(e, l.Explanation), g = h(e, l.Files), p = h(e, l.Description), f = h(e, l.Error);
|
|
354
354
|
return Ce(() => {
|
|
355
355
|
var L;
|
|
356
356
|
(L = c.current) == null || L.focus();
|
|
@@ -365,19 +365,19 @@ const Q = (e) => e.file.name, a = ({ children: e }) => {
|
|
|
365
365
|
errorMessage: R ?? b
|
|
366
366
|
}), p, u, g)
|
|
367
367
|
}));
|
|
368
|
-
},
|
|
368
|
+
}, je = ({ className: e }) => {
|
|
369
369
|
const { getExplanationText: r } = Z(), n = r();
|
|
370
370
|
return n ? /* @__PURE__ */ t.createElement("p", {
|
|
371
371
|
className: e
|
|
372
372
|
}, n) : null;
|
|
373
373
|
};
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
374
|
+
l.Label = Be;
|
|
375
|
+
l.DropZone = A;
|
|
376
|
+
l.Button = J;
|
|
377
|
+
l.Explanation = je;
|
|
378
|
+
l.Files = X;
|
|
379
|
+
l.Description = _e;
|
|
380
|
+
l.Error = Te;
|
|
381
381
|
const $e = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
382
382
|
viewBox: "0 0 24 24",
|
|
383
383
|
width: 24,
|
|
@@ -437,12 +437,12 @@ const $e = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
437
437
|
values: "0;360",
|
|
438
438
|
repeatCount: "indefinite"
|
|
439
439
|
})));
|
|
440
|
-
}, He = "_explanation_16me0_1",
|
|
440
|
+
}, He = "_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
441
|
explanation: He,
|
|
442
|
-
files:
|
|
443
|
-
file:
|
|
444
|
-
fileName:
|
|
445
|
-
removeButton:
|
|
442
|
+
files: Qe,
|
|
443
|
+
file: Ge,
|
|
444
|
+
fileName: Je,
|
|
445
|
+
removeButton: Xe,
|
|
446
446
|
spinner: et,
|
|
447
447
|
fileError: tt
|
|
448
448
|
}, rt = ({ content: e, locale: r }) => /* @__PURE__ */ t.createElement(Ee, {
|
|
@@ -450,34 +450,34 @@ const $e = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
450
450
|
locale: r
|
|
451
451
|
}), nt = () => {
|
|
452
452
|
const { t: e } = ie();
|
|
453
|
-
return /* @__PURE__ */ t.createElement(
|
|
453
|
+
return /* @__PURE__ */ t.createElement(l, null, /* @__PURE__ */ t.createElement(l.Label, {
|
|
454
454
|
className: B(ne, I.label)
|
|
455
|
-
}, /* @__PURE__ */ t.createElement(
|
|
455
|
+
}, /* @__PURE__ */ t.createElement(l.Label.Required, {
|
|
456
456
|
className: B(De, I.requiredMark)
|
|
457
|
-
})), /* @__PURE__ */ t.createElement(
|
|
457
|
+
})), /* @__PURE__ */ t.createElement(l.Button, {
|
|
458
458
|
className: B(Ne, I.uploadButton),
|
|
459
459
|
"aria-roledescription": e("file-upload.aria-roledescription")
|
|
460
|
-
}, /* @__PURE__ */ t.createElement($e, null), /* @__PURE__ */ t.createElement(
|
|
461
|
-
className: B(
|
|
462
|
-
}), /* @__PURE__ */ t.createElement(
|
|
460
|
+
}, /* @__PURE__ */ t.createElement($e, null), /* @__PURE__ */ t.createElement(l.Button.Text, null)), /* @__PURE__ */ t.createElement(l.Explanation, {
|
|
461
|
+
className: B(ae, I.description, w.explanation)
|
|
462
|
+
}), /* @__PURE__ */ t.createElement(l.Files, {
|
|
463
463
|
className: B(ne, w.files)
|
|
464
|
-
}, /* @__PURE__ */ t.createElement(
|
|
464
|
+
}, /* @__PURE__ */ t.createElement(l.Files.File, {
|
|
465
465
|
className: w.file
|
|
466
|
-
}, /* @__PURE__ */ t.createElement(
|
|
466
|
+
}, /* @__PURE__ */ t.createElement(l.Files.File.Name, {
|
|
467
467
|
className: w.fileName
|
|
468
|
-
}), /* @__PURE__ */ t.createElement(
|
|
468
|
+
}), /* @__PURE__ */ t.createElement(l.Files.File.Spinner, {
|
|
469
469
|
className: w.spinner,
|
|
470
470
|
"aria-label": e("file-upload.file.uploading-spinner.aria-label")
|
|
471
|
-
}, /* @__PURE__ */ t.createElement(Ye, null)), /* @__PURE__ */ t.createElement(
|
|
471
|
+
}, /* @__PURE__ */ t.createElement(Ye, null)), /* @__PURE__ */ t.createElement(l.Files.File.Remove, {
|
|
472
472
|
className: w.removeButton,
|
|
473
473
|
"aria-label": e("file-upload.delete-file.aria-label")
|
|
474
|
-
}, /* @__PURE__ */ t.createElement(We, null)), /* @__PURE__ */ t.createElement(
|
|
475
|
-
className: B(
|
|
476
|
-
}, /* @__PURE__ */ t.createElement(Ke, null), /* @__PURE__ */ t.createElement(
|
|
477
|
-
className: B(
|
|
478
|
-
}, rt), /* @__PURE__ */ t.createElement(
|
|
479
|
-
className: B(
|
|
480
|
-
}, /* @__PURE__ */ t.createElement(Le, null), /* @__PURE__ */ t.createElement(
|
|
474
|
+
}, /* @__PURE__ */ t.createElement(We, null)), /* @__PURE__ */ t.createElement(l.Files.File.Error, {
|
|
475
|
+
className: B(le, I.error, w.fileError)
|
|
476
|
+
}, /* @__PURE__ */ t.createElement(Ke, null), /* @__PURE__ */ t.createElement(l.Files.File.Error.Text, null)))), /* @__PURE__ */ t.createElement(l.Description, {
|
|
477
|
+
className: B(ae, I.description)
|
|
478
|
+
}, rt), /* @__PURE__ */ t.createElement(l.Error, {
|
|
479
|
+
className: B(le, I.error)
|
|
480
|
+
}, /* @__PURE__ */ t.createElement(Le, null), /* @__PURE__ */ t.createElement(l.Error.Text, null)));
|
|
481
481
|
}, Ft = () => /* @__PURE__ */ t.createElement(nt, null);
|
|
482
482
|
export {
|
|
483
483
|
Ft as FileUploadRAC
|
|
@@ -1,13 +1,13 @@
|
|
|
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 { ai as C, ab as I, af as P } from "./form-
|
|
4
|
+
import { ai as C, ab as I, af as P } from "./form-CtWkUmxc.js";
|
|
5
5
|
import { f as c, a as O } from "./find-child-C60k4CxG.js";
|
|
6
6
|
import { f as S } from "./format-currency-BwShJ9vM.js";
|
|
7
|
-
import { D as x, E as N } from "./field-error-headless-
|
|
8
|
-
import { L as R } from "./field-label-headless-
|
|
9
|
-
import { s as L } from "./field-rac.module-
|
|
10
|
-
import {
|
|
7
|
+
import { D as x, E as N } from "./field-error-headless-D6iejMQP.js";
|
|
8
|
+
import { L as R } from "./field-label-headless-BWLfU3YB.js";
|
|
9
|
+
import { s as L } from "./field-rac.module-DnUIb9Oh.js";
|
|
10
|
+
import { z as v, B, j as M } from "./form-element-classes-BSMjWijd.js";
|
|
11
11
|
const e = ({ children: r }) => {
|
|
12
12
|
var p;
|
|
13
13
|
const { id: n, validation: a, FieldLayout: l } = C(), { currency: o, regionalFormat: m } = I(), s = _(() => {
|
|
@@ -26,7 +26,7 @@ const e = ({ children: r }) => {
|
|
|
26
26
|
}),
|
|
27
27
|
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, D, b)
|
|
28
28
|
});
|
|
29
|
-
},
|
|
29
|
+
}, g = ({ className: r, ...n }) => {
|
|
30
30
|
const { price: a, currencyCode: l, locale: o } = n, { inputId: m, ariaDescribedBy: s } = P(), i = S({
|
|
31
31
|
amount: a,
|
|
32
32
|
currency: l,
|
|
@@ -42,7 +42,7 @@ const e = ({ children: r }) => {
|
|
|
42
42
|
className: r
|
|
43
43
|
}, null);
|
|
44
44
|
e.Label = T;
|
|
45
|
-
e.Amount =
|
|
45
|
+
e.Amount = g;
|
|
46
46
|
e.Description = x;
|
|
47
47
|
e.Error = N;
|
|
48
48
|
const V = "_value_19v7w_1", w = {
|
|
@@ -53,9 +53,9 @@ const V = "_value_19v7w_1", w = {
|
|
|
53
53
|
}), k = () => /* @__PURE__ */ t.createElement(e, null, /* @__PURE__ */ t.createElement(e.Label, {
|
|
54
54
|
className: u(v, L.label)
|
|
55
55
|
}), /* @__PURE__ */ t.createElement(e.Amount, {
|
|
56
|
-
className: u(
|
|
56
|
+
className: u(B, w.value)
|
|
57
57
|
}), /* @__PURE__ */ t.createElement(e.Description, {
|
|
58
|
-
className: u(
|
|
58
|
+
className: u(M, L.description)
|
|
59
59
|
}, j)), X = () => /* @__PURE__ */ t.createElement(k, null);
|
|
60
60
|
export {
|
|
61
61
|
X as FixedPaymentRAC
|