@wix/form-elements 1.62.0 → 1.64.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-Dqib2upI.js → appointment-rac-DojiZqx9.js} +35 -35
- package/dist/component/{bookings-address-rac-E-qq4-KG.js → bookings-address-rac-Bm_lQchD.js} +1 -1
- package/dist/component/{bookings-email-rac-DA_Hwn2j.js → bookings-email-rac-vwuy0kW8.js} +1 -1
- package/dist/component/{bookings-first-name-rac-o1n3lnRo.js → bookings-first-name-rac-BbWuLoeg.js} +1 -1
- package/dist/component/{bookings-header-rac-DQ0YvhxZ.js → bookings-header-rac-DVknNH29.js} +1 -1
- package/dist/component/{bookings-last-name-rac-BqL_84Sg.js → bookings-last-name-rac-BnT3Cq0b.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-CAN7roRc.js → bookings-login-bar-rac-DKi-VAXc.js} +16 -16
- package/dist/component/{bookings-phone-rac-CCJVdvkd.js → bookings-phone-rac-Bfy8rheB.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-CCklquEC.js → bookings-rich-text-rac-DGiBDcXw.js} +1 -1
- package/dist/component/checkbox-field-rac-CYADRY54.js +1312 -0
- package/dist/component/checkbox-group-field-headless-BDAFpX5F.js +210 -0
- package/dist/component/checkbox-group-field-rac-2YUsOmDI.js +40 -0
- package/dist/component/{checkbox-group-rac-DWPClKpf.js → checkbox-group-rac-CQf1C9H5.js} +1 -1
- package/dist/component/{checkbox-rac-CvbOws2U.js → checkbox-rac-Bjv8jZjs.js} +1 -1
- package/dist/component/{contacts-address-rac-CWFHC5LT.js → contacts-address-rac-BBTiEec9.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-DPmJPp8M.js → contacts-birthdate-rac-XReeFHVW.js} +1 -1
- package/dist/component/{contacts-company-rac-UWP9uDqI.js → contacts-company-rac-B-fUQszu.js} +1 -1
- package/dist/component/{contacts-email-rac-BCkkWYhr.js → contacts-email-rac-DBtcCcsV.js} +1 -1
- package/dist/component/{contacts-first-name-rac-KNRf92yT.js → contacts-first-name-rac-mkwU3706.js} +1 -1
- package/dist/component/{contacts-last-name-rac-C_EotEpo.js → contacts-last-name-rac-DY5N-AZx.js} +1 -1
- package/dist/component/{contacts-phone-rac-DJGEWLsl.js → contacts-phone-rac-Ce1rMz_z.js} +1 -1
- package/dist/component/{contacts-position-rac-s1pZ662O.js → contacts-position-rac-B65H8PDu.js} +1 -1
- package/dist/component/contacts-subscribe-rac-BxO8rIyL.js +13 -0
- package/dist/component/{contacts-tax-id-rac-3MUvKEqW.js → contacts-tax-id-rac-Jtt0ySK2.js} +1 -1
- package/dist/component/{date-availability-CRsSX5_d.js → date-availability-B8UwvTJa.js} +1 -1
- package/dist/component/{date-input-field-rac-DPo7waqI.js → date-input-field-rac-RL2a0xoD.js} +23 -23
- package/dist/component/{date-input-rac-DsY8ehb1.js → date-input-rac-ak3G7V07.js} +1 -1
- package/dist/component/{date-picker-field-rac-BtzlxVDB.js → date-picker-field-rac-SL_Roltf.js} +31 -31
- package/dist/component/{date-picker-rac-C-Aw6W87.js → date-picker-rac-ByrM0YIX.js} +1 -1
- package/dist/component/{date-time-input-field-rac-zre1vJ2m.js → date-time-input-field-rac-DOE7xcKi.js} +87 -87
- package/dist/component/{date-time-input-rac-CUvTUzbT.js → date-time-input-rac-BA-GyrAc.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-D4mhJU8E.js → dext-checkbox-group-rac-EwUnBO80.js} +2 -2
- package/dist/component/{dext-checkbox-rac-BeYmKpAZ.js → dext-checkbox-rac-CIRKi4B5.js} +1 -1
- package/dist/component/{dext-date-picker-rac-Mr0M3sNQ.js → dext-date-picker-rac-BYO_Q1zM.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-dgxfrHUw.js → dext-date-time-input-rac-BOahPeaH.js} +1 -1
- package/dist/component/{dext-dropdown-rac-CdZOoA5M.js → dext-dropdown-rac-sTD_r-0H.js} +1 -1
- package/dist/component/{dext-email-rac-TBiHlKjv.js → dext-email-rac-e-2_h3he.js} +1 -1
- package/dist/component/{dext-number-input-rac-S78swyZ9.js → dext-number-input-rac-D6LACzWl.js} +1 -1
- package/dist/component/{dext-phone-rac-BhIaSHez.js → dext-phone-rac-kUycy5Od.js} +1 -1
- package/dist/component/{dext-radio-group-rac-B4xG4N8A.js → dext-radio-group-rac-DPD2UkrV.js} +2 -2
- package/dist/component/{dext-rating-input-rac-Bp2Pi5cP.js → dext-rating-input-rac-DUsnrl9W.js} +1 -1
- package/dist/component/{dext-tags-rac-Bnjgmyk-.js → dext-tags-rac-D6z69HuO.js} +2 -2
- package/dist/component/{dext-text-area-rac-f1nJTM_n.js → dext-text-area-rac-C-DVtFJ1.js} +1 -1
- package/dist/component/{dext-text-input-rac-B9m6oI-e.js → dext-text-input-rac-CIa2MdC6.js} +1 -1
- package/dist/component/{dext-url-input-rac-CfEUdRdY.js → dext-url-input-rac-8rVVW5us.js} +1 -1
- package/dist/component/{donation-rac-BqKbQD_H.js → donation-rac-BjmSBabc.js} +62 -62
- package/dist/component/{dropdown-field-headless-CzoD076g.js → dropdown-field-headless-DReo519l.js} +5 -5
- package/dist/component/{dropdown-field-rac-5kD98Ubc.js → dropdown-field-rac-DzrjA2O6.js} +7 -7
- package/dist/component/{dropdown-rac-C9NpsRYi.js → dropdown-rac-CS7oLTp_.js} +1 -1
- package/dist/component/{ecom-address-rac-DdvJEnAO.js → ecom-address-rac-EIb88J_6.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-D7Lf1ETL.js → ecom-subscription-checkbox-rac-CE0Ks6qS.js} +5 -5
- package/dist/component/{email-input-field-rac-DUordV5X.js → email-input-field-rac-BScZxYHw.js} +47 -47
- package/dist/component/{events-repeater-rac-B1yDrnvJ.js → events-repeater-rac-Y0rH2Jli.js} +66 -66
- package/dist/component/{events-rsvp-rac-B65NtAMH.js → events-rsvp-rac-BiAYVv_b.js} +12 -12
- package/dist/component/{field-error-headless-DP4WSQU3.js → field-error-headless-DrnFrGun.js} +4 -4
- package/dist/component/{field-label-headless-BKmi7Fjg.js → field-label-headless-BIYf1BIh.js} +7 -7
- package/dist/component/field-rac.module-CWkwwhq4.js +21 -0
- package/dist/component/{file-upload-rac-DAg_G0_l.js → file-upload-rac-br--tZLp.js} +83 -83
- package/dist/component/{fixed-payment-rac-yO1w1gE2.js → fixed-payment-rac-XEtrsaMy.js} +15 -15
- package/dist/component/{form-D6A2hUbV.js → form-9yjqDnxY.js} +2719 -2709
- package/dist/component/form-element-classes-KRzHUNLu.js +57 -0
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +1 -1
- package/dist/component/{header-field-rac-D3Bi6tTS.js → header-field-rac-CLELgzqY.js} +5 -5
- package/dist/component/{header-rac-Blv89pdS.js → header-rac-D8KGkVVp.js} +1 -1
- package/dist/component/{image-choice-rac-BLUZRNm0.js → image-choice-rac-Cl09CLP4.js} +30 -30
- package/dist/component/{index-BiYk1mJi.js → index-C4y71e1i.js} +2 -2
- package/dist/component/{index-Cv3_acT1.js → index-PHkE0Ru4.js} +4 -4
- package/dist/component/isObjectLike-srCDplej.js +86 -0
- package/dist/component/multiline-address-field-rac-CsBLI9y-.js +1613 -0
- package/dist/component/{multiline-address-rac-B9yHNebZ.js → multiline-address-rac-DFDPFfXh.js} +1 -1
- package/dist/component/{number-input-field-rac-SaC7jFUi.js → number-input-field-rac-DZRR7gdt.js} +19 -19
- package/dist/component/{number-input-rac-KYcJJPrs.js → number-input-rac-BCS5lkff.js} +1 -1
- package/dist/component/{password-rac-CD5bSL2g.js → password-rac-ClDGgR3E.js} +27 -27
- package/dist/component/{payment-input-rac-BlAscmFz.js → payment-input-rac-COydWmUE.js} +34 -34
- package/dist/component/{phone-input-field-rac-D-AosrgV.js → phone-input-field-rac-DYCibqe1.js} +54 -54
- package/dist/component/{phone-rac-DXLYlz5G.js → phone-rac-BS-dmWkJ.js} +1 -1
- package/dist/component/{product-list-rac-CGt4Gnj4.js → product-list-rac-hxOhaA-r.js} +84 -84
- package/dist/component/quiz-radio-group-rac-BT-YZO2Q.js +13 -0
- package/dist/component/{radio-group-field-rac-D8NS7qDq.js → radio-group-field-rac-DKqWnMBJ.js} +3 -3
- package/dist/component/{radio-group-field-rac.module-wK26tCZq.js → radio-group-field-rac.module-BwUynK_5.js} +9 -9
- package/dist/component/{radio-group-rac-HalDjwk1.js → radio-group-rac-DHURQZKK.js} +1 -1
- package/dist/component/{rating-input-field-rac-BBhMkSyL.js → rating-input-field-rac-CZRdSVrf.js} +37 -37
- package/dist/component/{rating-input-rac-BpgFnNoD.js → rating-input-rac-BaH52DYm.js} +1 -1
- package/dist/component/{rich-content-rac.module-BgJ2fteu.js → rich-content-rac.module-ILBfxEmN.js} +4 -4
- package/dist/component/{rich-text-field-rac-BZfCgvHc.js → rich-text-field-rac-B58q8Is7.js} +7 -7
- package/dist/component/{rich-text-rac-CG3V04Gr.js → rich-text-rac-DGbZh1eX.js} +1 -1
- package/dist/component/{service-dropdown-rac-Bc_y-R5O.js → service-dropdown-rac-DUiNIbdv.js} +42 -42
- package/dist/component/{services-multi-choice-rac-BeBdZpRV.js → services-multi-choice-rac-B7y9s2l8.js} +29 -29
- package/dist/component/{signature-rac-DNdpHxFp.js → signature-rac-CydpvQJZ.js} +37 -37
- package/dist/component/{submit-button-rac-Bogk1xYc.js → submit-button-rac-OO53h4H8.js} +8 -8
- package/dist/component/{tags-field-rac-COJG3T_9.js → tags-field-rac-eX3d3JEH.js} +50 -50
- package/dist/component/{tags-rac-DsaUqJ4w.js → tags-rac-CdIB_48Z.js} +1 -1
- package/dist/component/{text-area-field-rac-BVq5p83p.js → text-area-field-rac-Bir5Q7gz.js} +22 -22
- package/dist/component/{text-area-rac-D-uiOy62.js → text-area-rac-Ct1UNU04.js} +1 -1
- package/dist/component/{text-input-field-rac-wYvY_eBR.js → text-input-field-rac-onGUXC9J.js} +6 -6
- package/dist/component/{text-input-headless-BsL6OYhp.js → text-input-headless-Bs9m7QFg.js} +10 -10
- package/dist/component/{text-input-rac-Bu8kXhrN.js → text-input-rac-DK4nEw4D.js} +1 -1
- package/dist/component/{time-input-rac-PWXUi1qL.js → time-input-rac-BCG9ktFa.js} +40 -40
- package/dist/component/{url-input-field-rac-B4qgrssx.js → url-input-field-rac-mUkrVTcL.js} +25 -25
- package/dist/component/{url-input-rac-Bo51kTsG.js → url-input-rac-Cl7LFYlr.js} +1 -1
- package/dist/component/{use-service-options-base-Du6B6AP9.js → use-service-options-base-BYVuKRj2.js} +8 -8
- package/dist/form.d.ts +3 -1
- package/package.json +2 -14
- package/dist/component/checkbox-field-rac-DhAEMdL9.js +0 -625
- package/dist/component/checkbox-group-field-headless-EGVW3vG0.js +0 -204
- package/dist/component/checkbox-group-field-rac-DUDWNOwV.js +0 -33
- package/dist/component/contacts-subscribe-rac-D_2wIX9p.js +0 -13
- package/dist/component/field-rac.module-DtugsLiL.js +0 -21
- package/dist/component/form-element-classes-Bi-nNM8q.js +0 -55
- package/dist/component/isObject-BAwJJxQ3.js +0 -34
- package/dist/component/multiline-address-field-rac-_Sb56AEM.js +0 -1574
- package/dist/component/quiz-radio-group-rac-DaStzNZZ.js +0 -13
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import t, { useState as
|
|
1
|
+
import t, { useState as J, useRef as V, useMemo as oe, useEffect as se, useCallback as P, createContext as pe, useContext as fe } from "react";
|
|
2
2
|
import { RicosViewer as Ee } from "@wix/ricos/viewer";
|
|
3
3
|
import B from "classnames";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { f as h, a as
|
|
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-
|
|
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 j, ak as Ce } from "./form-9yjqDnxY.js";
|
|
5
|
+
import { E as Le } from "./error-icon-hZxQ6DEy.js";
|
|
6
|
+
import { s as I } from "./field-rac.module-CWkwwhq4.js";
|
|
7
|
+
import { t as ne, J as De, X as Ne, j as le, n as ae } from "./form-element-classes-KRzHUNLu.js";
|
|
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-DrnFrGun.js";
|
|
10
|
+
import { L as Be } from "./field-label-headless-BIYf1BIh.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/*",
|
|
@@ -17,7 +17,7 @@ const we = {
|
|
|
17
17
|
Archive: ".zip, .rar, .tar, .tar.gz, .gz, .gzip, .jar, .7z, .fgz, .webarchive",
|
|
18
18
|
Model3D: ".gltf, .glb"
|
|
19
19
|
}, Ae = (e) => {
|
|
20
|
-
const { actions: r, formId: n } =
|
|
20
|
+
const { actions: r, formId: n } = Fe();
|
|
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"), [];
|
|
@@ -43,19 +43,19 @@ const we = {
|
|
|
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 [l, s] =
|
|
46
|
+
const [l, s] = J(ke(r)), [b, m] = J(r || []), [c, N] = J(), 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
48
|
const C = oe(() => l.some((u) => u.state === "uploading"), [
|
|
49
49
|
l
|
|
50
50
|
]);
|
|
51
51
|
se(() => {
|
|
52
|
-
S.current !== C && (S.current = C, y(o, C ?
|
|
52
|
+
S.current !== C && (S.current = C, y(o, C ? re.BUSY : re.READY));
|
|
53
53
|
}, [
|
|
54
54
|
C,
|
|
55
55
|
y,
|
|
56
56
|
o
|
|
57
57
|
]);
|
|
58
|
-
const
|
|
58
|
+
const U = P(() => {
|
|
59
59
|
if (!l.length)
|
|
60
60
|
return n;
|
|
61
61
|
const F = l.filter((u) => u.state === "uploading").length;
|
|
@@ -102,7 +102,7 @@ function Ze({ valueSliderLimit: e, value: r, explanationText: n, target: o, onCh
|
|
|
102
102
|
}));
|
|
103
103
|
return;
|
|
104
104
|
}
|
|
105
|
-
const p = Array.from(F).reduce((f, L) => (l.some((
|
|
105
|
+
const p = Array.from(F).reduce((f, L) => (l.some((Y) => Y.file.name === L.name) || f.push({
|
|
106
106
|
file: L,
|
|
107
107
|
state: "uploading"
|
|
108
108
|
}), f), []);
|
|
@@ -111,7 +111,7 @@ function Ze({ valueSliderLimit: e, value: r, explanationText: n, target: o, onCh
|
|
|
111
111
|
...p
|
|
112
112
|
]), await M(p);
|
|
113
113
|
}
|
|
114
|
-
},
|
|
114
|
+
}, q = (F) => {
|
|
115
115
|
const u = l[F];
|
|
116
116
|
if (b && i && u.state !== "error") {
|
|
117
117
|
const g = b.filter((f) => f.displayName !== u.file.name);
|
|
@@ -124,21 +124,21 @@ function Ze({ valueSliderLimit: e, value: r, explanationText: n, target: o, onCh
|
|
|
124
124
|
}
|
|
125
125
|
}, $ = () => {
|
|
126
126
|
c && N(void 0), x();
|
|
127
|
-
}, K = d.map((F) => we[F]).join(),
|
|
127
|
+
}, K = d.map((F) => we[F]).join(), W = P(() => {
|
|
128
128
|
s([]), m([]);
|
|
129
129
|
}, []);
|
|
130
|
-
return
|
|
130
|
+
return be(W), {
|
|
131
131
|
files: l,
|
|
132
132
|
limitError: c,
|
|
133
|
-
hover:
|
|
134
|
-
getExplanationText:
|
|
133
|
+
hover: k,
|
|
134
|
+
getExplanationText: U,
|
|
135
135
|
handleChange: O,
|
|
136
|
-
handleDelete:
|
|
136
|
+
handleDelete: q,
|
|
137
137
|
accept: K,
|
|
138
138
|
handleBlur: $
|
|
139
139
|
};
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function ke(e = []) {
|
|
142
142
|
const r = e || [];
|
|
143
143
|
try {
|
|
144
144
|
return r.map((n) => ({
|
|
@@ -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 } = j(), { handleFileChange: d } = Z(), x = h(e, A.Title), D = h(e, A.Subtitle), l = h(e, A.Button);
|
|
166
166
|
return /* @__PURE__ */ t.createElement(Re, {
|
|
167
167
|
"aria-describedby": n,
|
|
168
168
|
className: r,
|
|
@@ -183,7 +183,7 @@ const A = ({ children: e, className: r }) => {
|
|
|
183
183
|
}, /* @__PURE__ */ t.createElement(Se, {
|
|
184
184
|
slot: "label"
|
|
185
185
|
}, x, D), l);
|
|
186
|
-
},
|
|
186
|
+
}, Ue = ({ className: e, children: r }) => {
|
|
187
187
|
const { limitReached: n } = Z();
|
|
188
188
|
return /* @__PURE__ */ t.createElement("p", {
|
|
189
189
|
className: e
|
|
@@ -197,15 +197,15 @@ 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: l, onFocus: s, hasError: b, errorMessage: m } =
|
|
200
|
+
}, X = ({ className: e, children: r, "aria-roledescription": n }) => {
|
|
201
|
+
const { ariaDescribedBy: o, inputId: i, labelId: d, errorId: x } = ce(), { disabled: D, required: l, onFocus: s, hasError: b, errorMessage: m } = j(), { 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,
|
|
205
205
|
onSelect: (C) => {
|
|
206
206
|
if (C) {
|
|
207
|
-
const
|
|
208
|
-
|
|
207
|
+
const U = Array.from(C), M = new DataTransfer();
|
|
208
|
+
U.forEach((O) => M.items.add(O)), c(M.files);
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
}, /* @__PURE__ */ t.createElement(de, {
|
|
@@ -228,34 +228,34 @@ 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 } = j();
|
|
232
232
|
return /* @__PURE__ */ t.createElement("span", {
|
|
233
233
|
className: e
|
|
234
234
|
}, r);
|
|
235
235
|
};
|
|
236
|
-
|
|
237
|
-
A.Title =
|
|
236
|
+
X.Text = Pe;
|
|
237
|
+
A.Title = Ue;
|
|
238
238
|
A.Subtitle = Oe;
|
|
239
|
-
A.Button =
|
|
239
|
+
A.Button = X;
|
|
240
240
|
const T = ({ children: e, className: r, ...n }) => {
|
|
241
241
|
const { file: o, index: i } = n, d = o.file.name, x = h(e, T.Name), D = h(e, T.Remove), l = 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" ? l :
|
|
246
|
+
}), o.state === "uploading" ? l : z(D, {
|
|
247
247
|
index: i,
|
|
248
248
|
fileName: d
|
|
249
|
-
}), o.errorMessage &&
|
|
249
|
+
}), o.errorMessage && z(s, {
|
|
250
250
|
errorMessage: o.errorMessage
|
|
251
251
|
}));
|
|
252
|
-
},
|
|
252
|
+
}, ze = ({ className: e, ...r }) => {
|
|
253
253
|
const { fileName: n } = r;
|
|
254
254
|
return /* @__PURE__ */ t.createElement("span", {
|
|
255
255
|
className: e
|
|
256
256
|
}, n);
|
|
257
|
-
},
|
|
258
|
-
const { fileName: i, index: d } = o, { disabled: x } =
|
|
257
|
+
}, Ve = ({ className: e, "aria-label": r, children: n, ...o }) => {
|
|
258
|
+
const { fileName: i, index: d } = o, { disabled: x } = j(), { handleDelete: D, fileRemoveButtonRefs: l } = Z(), s = V(null);
|
|
259
259
|
se(() => {
|
|
260
260
|
const m = l.current, c = i;
|
|
261
261
|
return m[c] = s, () => {
|
|
@@ -285,32 +285,32 @@ const T = ({ children: e, className: r, ...n }) => {
|
|
|
285
285
|
className: e,
|
|
286
286
|
role: "alert"
|
|
287
287
|
}, r)) : null;
|
|
288
|
-
},
|
|
288
|
+
}, je = ({ 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
|
-
T.Name =
|
|
294
|
-
T.Remove =
|
|
295
|
-
T.Spinner =
|
|
293
|
+
T.Name = ze;
|
|
294
|
+
T.Remove = Ve;
|
|
295
|
+
T.Spinner = je;
|
|
296
296
|
T.Error = ue;
|
|
297
297
|
ue.Text = ve;
|
|
298
|
-
const
|
|
299
|
-
const { files: n } = Z(), o = h(e,
|
|
298
|
+
const G = ({ children: e, className: r }) => {
|
|
299
|
+
const { files: n } = Z(), o = h(e, G.File);
|
|
300
300
|
return !n || n.length === 0 ? null : /* @__PURE__ */ t.createElement("div", {
|
|
301
301
|
className: r
|
|
302
|
-
}, n.map((i, d) =>
|
|
302
|
+
}, n.map((i, d) => z(o, {
|
|
303
303
|
key: i.file.name || d,
|
|
304
304
|
file: i,
|
|
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: l, hasError: s, errorMessage: b, FieldLayout: m } =
|
|
308
|
+
G.File = T;
|
|
309
|
+
const Q = (e) => e.file.name, a = ({ children: e }) => {
|
|
310
|
+
const { id: r, value: n, onChange: o, uploadFileFormats: i, valueSliderLimit: d, target: x, explanationText: D, onBlur: l, hasError: s, errorMessage: b, FieldLayout: m } = j(), c = V(null), N = V({}), v = P(() => {
|
|
311
311
|
var L;
|
|
312
312
|
(L = c.current) == null || L.focus();
|
|
313
|
-
}, []), { files: E, limitError: R, hover:
|
|
313
|
+
}, []), { files: E, limitError: R, hover: k, getExplanationText: y, handleBlur: S, handleChange: _, handleDelete: C, accept: U } = Ze({
|
|
314
314
|
valueSliderLimit: d,
|
|
315
315
|
value: n,
|
|
316
316
|
explanationText: D,
|
|
@@ -321,21 +321,21 @@ const G = (e) => e.file.name, a = ({ children: e }) => {
|
|
|
321
321
|
onFilesCleared: v
|
|
322
322
|
}), M = P((L) => {
|
|
323
323
|
var te;
|
|
324
|
-
const ee = E[L],
|
|
325
|
-
E.length > 1 && ((te = (E.filter((
|
|
324
|
+
const ee = E[L], Y = Q(ee);
|
|
325
|
+
E.length > 1 && ((te = (E.filter((H) => Q(H) !== Y).map((H) => N.current[Q(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, q = E.length >= d, $ = oe(() => ({
|
|
330
330
|
handleFileChange: _,
|
|
331
331
|
handleBlur: S,
|
|
332
332
|
handleDelete: M,
|
|
333
333
|
files: E,
|
|
334
|
-
accept:
|
|
335
|
-
limitReached:
|
|
334
|
+
accept: U,
|
|
335
|
+
limitReached: q,
|
|
336
336
|
multiple: O,
|
|
337
337
|
getExplanationText: y,
|
|
338
|
-
hover:
|
|
338
|
+
hover: k,
|
|
339
339
|
limitError: R,
|
|
340
340
|
buttonRef: c,
|
|
341
341
|
fileRemoveButtonRefs: N
|
|
@@ -344,14 +344,14 @@ const G = (e) => e.file.name, a = ({ children: e }) => {
|
|
|
344
344
|
S,
|
|
345
345
|
M,
|
|
346
346
|
E,
|
|
347
|
-
|
|
348
|
-
|
|
347
|
+
U,
|
|
348
|
+
q,
|
|
349
349
|
O,
|
|
350
350
|
y,
|
|
351
|
-
|
|
351
|
+
k,
|
|
352
352
|
R
|
|
353
|
-
]), K = h(e, a.Label),
|
|
354
|
-
return
|
|
353
|
+
]), K = h(e, a.Label), W = h(e, a.DropZone), F = h(e, a.Button), u = h(e, a.Explanation), g = h(e, a.Files), p = h(e, a.Description), f = h(e, a.Error);
|
|
354
|
+
return Ce(() => {
|
|
355
355
|
var L;
|
|
356
356
|
(L = c.current) == null || L.focus();
|
|
357
357
|
}, r), /* @__PURE__ */ t.createElement(me.Provider, {
|
|
@@ -359,13 +359,13 @@ const G = (e) => e.file.name, a = ({ children: e }) => {
|
|
|
359
359
|
}, /* @__PURE__ */ t.createElement(m, {
|
|
360
360
|
fieldId: r,
|
|
361
361
|
renderLabel: () => K,
|
|
362
|
-
renderInput: () =>
|
|
363
|
-
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null,
|
|
362
|
+
renderInput: () => W ?? F,
|
|
363
|
+
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, z(f, {
|
|
364
364
|
hasError: !!(s || R),
|
|
365
365
|
errorMessage: R ?? b
|
|
366
366
|
}), p, u, g)
|
|
367
367
|
}));
|
|
368
|
-
},
|
|
368
|
+
}, qe = ({ className: e }) => {
|
|
369
369
|
const { getExplanationText: r } = Z(), n = r();
|
|
370
370
|
return n ? /* @__PURE__ */ t.createElement("p", {
|
|
371
371
|
className: e
|
|
@@ -373,9 +373,9 @@ const G = (e) => e.file.name, a = ({ children: e }) => {
|
|
|
373
373
|
};
|
|
374
374
|
a.Label = Be;
|
|
375
375
|
a.DropZone = A;
|
|
376
|
-
a.Button =
|
|
377
|
-
a.Explanation =
|
|
378
|
-
a.Files =
|
|
376
|
+
a.Button = X;
|
|
377
|
+
a.Explanation = qe;
|
|
378
|
+
a.Files = G;
|
|
379
379
|
a.Description = _e;
|
|
380
380
|
a.Error = Te;
|
|
381
381
|
const $e = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
@@ -396,7 +396,7 @@ const $e = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
396
396
|
...e
|
|
397
397
|
}, /* @__PURE__ */ t.createElement("path", {
|
|
398
398
|
d: "M12,21 C7.02943725,21 3,16.9705627 3,12 C3,7.02943725 7.02943725,3 12,3 C16.9705627,3 21,7.02943725 21,12 C21,16.9705627 16.9705627,21 12,21 Z M12,20 C16.418278,20 20,16.418278 20,12 C20,7.581722 16.418278,4 12,4 C7.581722,4 4,7.581722 4,12 C4,16.418278 7.581722,20 12,20 Z M12.7287834,7.27532214 C12.9203342,7.46687299 13.0199347,7.73174979 13.0020527,8.00205275 L13.0020527,12.0020527 C13.0199347,12.2723557 12.9203342,12.5372325 12.7287834,12.7287834 C12.5372325,12.9203342 12.2723557,13.0199347 12.0020527,13.0020527 C11.7317498,13.0199347 11.466873,12.9203342 11.2753221,12.7287834 C11.0837713,12.5372325 10.9841708,12.2723557 11.0020527,12.0020527 L11.0020527,8.00205275 C10.9841708,7.73174979 11.0837713,7.46687299 11.2753221,7.27532214 C11.466873,7.08377129 11.7317498,6.98417081 12.0020527,7.00205275 C12.2723557,6.98417081 12.5372325,7.08377129 12.7287834,7.27532214 Z M12.7287834,15.2753221 C12.9203342,15.466873 13.0199347,15.7317498 13.0020527,16.0020527 C13.0199347,16.2723557 12.9203342,16.5372325 12.7287834,16.7287834 C12.5372325,16.9203342 12.2723557,17.0199347 12.0020527,17.0020527 C11.7317498,17.0199347 11.466873,16.9203342 11.2753221,16.7287834 C11.0837713,16.5372325 10.9841708,16.2723557 11.0020527,16.0020527 C10.9841708,15.7317498 11.0837713,15.466873 11.2753221,15.2753221 C11.466873,15.0837713 11.7317498,14.9841708 12.0020527,15.0020527 C12.2723557,14.9841708 12.5372325,15.0837713 12.7287834,15.2753221 Z"
|
|
399
|
-
})),
|
|
399
|
+
})), We = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
400
400
|
viewBox: "0 0 24 24",
|
|
401
401
|
width: 24,
|
|
402
402
|
height: 24,
|
|
@@ -405,7 +405,7 @@ const $e = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
405
405
|
...e
|
|
406
406
|
}, /* @__PURE__ */ t.createElement("path", {
|
|
407
407
|
d: "M17,17 C17,18.6568542 15.6568542,20 14,20 L9,20 C7.34314575,20 6,18.6568542 6,17 L6,7 L5,7 L5,6 L18,6 L18,7 L17,7 L17,17 Z M9,9 L10,9 L10,16 L9,16 L9,9 Z M11,9 L12,9 L12,16 L11,16 L11,9 Z M13,9 L14,9 L14,16 L13,16 L13,9 Z M7,17 C7,18.1045695 7.8954305,19 9,19 L14,19 C15.1045695,19 16,18.1045695 16,17 L16,7 L7,7 L7,17 Z M13,6 L13,5 L10,5 L10,6 L9,6 L9,5 C9,4.44771525 9.44771525,4 10,4 L13,4 C13.5522847,4 14,4.44771525 14,5 L14,6 L13,6 Z"
|
|
408
|
-
})),
|
|
408
|
+
})), Ye = () => {
|
|
409
409
|
const r = "calc(50% - 2px)";
|
|
410
410
|
return /* @__PURE__ */ t.createElement("svg", {
|
|
411
411
|
fill: "none",
|
|
@@ -437,12 +437,12 @@ const $e = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
437
437
|
values: "0;360",
|
|
438
438
|
repeatCount: "indefinite"
|
|
439
439
|
})));
|
|
440
|
-
},
|
|
441
|
-
explanation:
|
|
442
|
-
files:
|
|
443
|
-
file:
|
|
444
|
-
fileName:
|
|
445
|
-
removeButton:
|
|
440
|
+
}, He = "_explanation_16me0_1", Je = "_files_16me0_5", Qe = "_file_16me0_5", Xe = "_fileName_16me0_24", Ge = "_removeButton_16me0_32", et = "_spinner_16me0_72", tt = "_fileError_16me0_88", w = {
|
|
441
|
+
explanation: He,
|
|
442
|
+
files: Je,
|
|
443
|
+
file: Qe,
|
|
444
|
+
fileName: Xe,
|
|
445
|
+
removeButton: Ge,
|
|
446
446
|
spinner: et,
|
|
447
447
|
fileError: tt
|
|
448
448
|
}, rt = ({ content: e, locale: r }) => /* @__PURE__ */ t.createElement(Ee, {
|
|
@@ -451,16 +451,16 @@ const $e = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
451
451
|
}), nt = () => {
|
|
452
452
|
const { t: e } = ie();
|
|
453
453
|
return /* @__PURE__ */ t.createElement(a, null, /* @__PURE__ */ t.createElement(a.Label, {
|
|
454
|
-
className: B(
|
|
454
|
+
className: B(ne, I.label)
|
|
455
455
|
}, /* @__PURE__ */ t.createElement(a.Label.Required, {
|
|
456
|
-
className: B(
|
|
456
|
+
className: B(De, I.requiredMark)
|
|
457
457
|
})), /* @__PURE__ */ t.createElement(a.Button, {
|
|
458
|
-
className: B(
|
|
458
|
+
className: B(Ne, I.uploadButton),
|
|
459
459
|
"aria-roledescription": e("file-upload.aria-roledescription")
|
|
460
460
|
}, /* @__PURE__ */ t.createElement($e, null), /* @__PURE__ */ t.createElement(a.Button.Text, null)), /* @__PURE__ */ t.createElement(a.Explanation, {
|
|
461
|
-
className: B(
|
|
461
|
+
className: B(le, I.description, w.explanation)
|
|
462
462
|
}), /* @__PURE__ */ t.createElement(a.Files, {
|
|
463
|
-
className: B(
|
|
463
|
+
className: B(ne, w.files)
|
|
464
464
|
}, /* @__PURE__ */ t.createElement(a.Files.File, {
|
|
465
465
|
className: w.file
|
|
466
466
|
}, /* @__PURE__ */ t.createElement(a.Files.File.Name, {
|
|
@@ -468,16 +468,16 @@ const $e = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
468
468
|
}), /* @__PURE__ */ t.createElement(a.Files.File.Spinner, {
|
|
469
469
|
className: w.spinner,
|
|
470
470
|
"aria-label": e("file-upload.file.uploading-spinner.aria-label")
|
|
471
|
-
}, /* @__PURE__ */ t.createElement(
|
|
471
|
+
}, /* @__PURE__ */ t.createElement(Ye, null)), /* @__PURE__ */ t.createElement(a.Files.File.Remove, {
|
|
472
472
|
className: w.removeButton,
|
|
473
473
|
"aria-label": e("file-upload.delete-file.aria-label")
|
|
474
|
-
}, /* @__PURE__ */ t.createElement(
|
|
475
|
-
className: B(
|
|
474
|
+
}, /* @__PURE__ */ t.createElement(We, null)), /* @__PURE__ */ t.createElement(a.Files.File.Error, {
|
|
475
|
+
className: B(ae, I.error, w.fileError)
|
|
476
476
|
}, /* @__PURE__ */ t.createElement(Ke, null), /* @__PURE__ */ t.createElement(a.Files.File.Error.Text, null)))), /* @__PURE__ */ t.createElement(a.Description, {
|
|
477
|
-
className: B(
|
|
477
|
+
className: B(le, I.description)
|
|
478
478
|
}, rt), /* @__PURE__ */ t.createElement(a.Error, {
|
|
479
|
-
className: B(
|
|
480
|
-
}, /* @__PURE__ */ t.createElement(
|
|
479
|
+
className: B(ae, I.error)
|
|
480
|
+
}, /* @__PURE__ */ t.createElement(Le, null), /* @__PURE__ */ t.createElement(a.Error.Text, null)));
|
|
481
481
|
}, Ft = () => /* @__PURE__ */ t.createElement(nt, null);
|
|
482
482
|
export {
|
|
483
483
|
Ft as FileUploadRAC
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import t, { useMemo as
|
|
1
|
+
import t, { useMemo as _ } from "react";
|
|
2
2
|
import { RicosViewer as A } from "@wix/ricos/viewer";
|
|
3
3
|
import u from "classnames";
|
|
4
|
-
import {
|
|
4
|
+
import { ai as C, ab as I, af as P } from "./form-9yjqDnxY.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-DrnFrGun.js";
|
|
8
|
+
import { L as R } from "./field-label-headless-BIYf1BIh.js";
|
|
9
|
+
import { s as L } from "./field-rac.module-CWkwwhq4.js";
|
|
10
|
+
import { t as v, v as M, j as g } from "./form-element-classes-KRzHUNLu.js";
|
|
11
11
|
const e = ({ children: r }) => {
|
|
12
12
|
var p;
|
|
13
|
-
const { id: n, validation: a, FieldLayout: l } = C(), { currency: o, regionalFormat: m } = I(), s =
|
|
14
|
-
var d,
|
|
15
|
-
return (
|
|
13
|
+
const { id: n, validation: a, FieldLayout: l } = C(), { currency: o, regionalFormat: m } = I(), s = _(() => {
|
|
14
|
+
var d, f, E;
|
|
15
|
+
return (E = (f = (d = a == null ? void 0 : a.predefined) == null ? void 0 : d.paymentOptions) == null ? void 0 : f.products) == null ? void 0 : E[0];
|
|
16
16
|
}, [
|
|
17
17
|
a
|
|
18
|
-
]), i = (p = s == null ? void 0 : s.fixedPriceOptions) == null ? void 0 : p.price, y = c(r, e.Label), F = c(r, e.Amount),
|
|
18
|
+
]), i = (p = s == null ? void 0 : s.fixedPriceOptions) == null ? void 0 : p.price, y = c(r, e.Label), F = c(r, e.Amount), b = c(r, e.Description), D = c(r, e.Error);
|
|
19
19
|
return /* @__PURE__ */ t.createElement(l, {
|
|
20
20
|
fieldId: n,
|
|
21
21
|
renderLabel: () => y,
|
|
@@ -24,7 +24,7 @@ const e = ({ children: r }) => {
|
|
|
24
24
|
currencyCode: o == null ? void 0 : o.code,
|
|
25
25
|
locale: m
|
|
26
26
|
}),
|
|
27
|
-
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null,
|
|
27
|
+
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, D, b)
|
|
28
28
|
});
|
|
29
29
|
}, B = ({ className: r, ...n }) => {
|
|
30
30
|
const { price: a, currencyCode: l, locale: o } = n, { inputId: m, ariaDescribedBy: s } = P(), i = S({
|
|
@@ -47,16 +47,16 @@ e.Description = x;
|
|
|
47
47
|
e.Error = N;
|
|
48
48
|
const V = "_value_19v7w_1", w = {
|
|
49
49
|
value: V
|
|
50
|
-
},
|
|
50
|
+
}, j = ({ content: r, locale: n }) => /* @__PURE__ */ t.createElement(A, {
|
|
51
51
|
content: r,
|
|
52
52
|
locale: n
|
|
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(M, w.value)
|
|
57
57
|
}), /* @__PURE__ */ t.createElement(e.Description, {
|
|
58
|
-
className: u(
|
|
59
|
-
},
|
|
58
|
+
className: u(g, L.description)
|
|
59
|
+
}, j)), X = () => /* @__PURE__ */ t.createElement(k, null);
|
|
60
60
|
export {
|
|
61
61
|
X as FixedPaymentRAC
|
|
62
62
|
};
|