@wix/form-elements 1.168.0 → 1.170.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-BbXyKTd7.js → appointment-rac-DZ0SFXmL.js} +83 -83
- package/dist/component/{bookings-address-rac-VJkR_U9L.js → bookings-address-rac-BW9grc77.js} +1 -1
- package/dist/component/{bookings-email-rac-_EupwXpQ.js → bookings-email-rac-D8gMaAfB.js} +1 -1
- package/dist/component/{bookings-first-name-rac-DTZixHYj.js → bookings-first-name-rac-CAjcs7b6.js} +1 -1
- package/dist/component/{bookings-header-rac-BKbKTv5g.js → bookings-header-rac-BhKZ1kku.js} +1 -1
- package/dist/component/{bookings-last-name-rac-BDy860-C.js → bookings-last-name-rac-DpsMDuU0.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-DgNP-YNZ.js → bookings-login-bar-rac-BVdWmKS8.js} +3 -3
- package/dist/component/{bookings-phone-rac-B_I6n96b.js → bookings-phone-rac-DsqNi2mI.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-prYPbIiz.js → bookings-rich-text-rac-elM4Ne3f.js} +1 -1
- package/dist/component/{checkbox-field-rac-C-4PXuxG.js → checkbox-field-rac-BU4E73fD.js} +43 -43
- package/dist/component/{checkbox-group-field-headless-D16bAcaq.js → checkbox-group-field-headless-6yJdIbP2.js} +41 -41
- package/dist/component/{checkbox-group-field-rac-GUQ5dO_s.js → checkbox-group-field-rac-CojbCWSF.js} +4 -4
- package/dist/component/{checkbox-group-rac-Bl6xL5-H.js → checkbox-group-rac-3qUVUc-C.js} +1 -1
- package/dist/component/{checkbox-rac-Blg0KVyP.js → checkbox-rac-DwbTapd_.js} +1 -1
- package/dist/component/{contacts-address-rac-BfOhCAj8.js → contacts-address-rac-BL7XDZuP.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-DYBvDh62.js → contacts-birthdate-rac-DeJYIHAg.js} +1 -1
- package/dist/component/{contacts-company-rac-DIJr7zjA.js → contacts-company-rac-BeImf5uc.js} +1 -1
- package/dist/component/{contacts-email-rac-DjmqELhC.js → contacts-email-rac-CtacwrZ0.js} +1 -1
- package/dist/component/{contacts-first-name-rac-DGNll7gw.js → contacts-first-name-rac-CAdOqOOA.js} +1 -1
- package/dist/component/{contacts-last-name-rac-BJ8AZYQN.js → contacts-last-name-rac-Db9mHzCW.js} +1 -1
- package/dist/component/{contacts-phone-rac-BC-QtpEN.js → contacts-phone-rac-W0OLEbzL.js} +1 -1
- package/dist/component/{contacts-position-rac-BQia__74.js → contacts-position-rac-CV4Ibt4Z.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-CTFptz01.js → contacts-subscribe-rac-CQ3Q1pjZ.js} +1 -1
- package/dist/component/{contacts-tax-id-rac-Cy72Jouc.js → contacts-tax-id-rac-Dux-pk6r.js} +1 -1
- package/dist/component/{date-availability-BC6updcS.js → date-availability-RkX-Qw7G.js} +1 -1
- package/dist/component/date-input-field-rac-CYCT6qoa.js +309 -0
- package/dist/component/{date-input-rac-KkRyWRP_.js → date-input-rac-BkYZ7q_o.js} +1 -1
- package/dist/component/{date-picker-field-rac-BLWVJbTJ.js → date-picker-field-rac-eMidYtsl.js} +31 -31
- package/dist/component/{date-picker-rac-DKCQza7v.js → date-picker-rac-D23rxZcF.js} +1 -1
- package/dist/component/{date-time-input-field-rac-CZxZW6fz.js → date-time-input-field-rac-BjIj4dXQ.js} +111 -111
- package/dist/component/{date-time-input-rac-DQ-iBwmr.js → date-time-input-rac-BSGAdk9L.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-kp1Jbwt-.js → dext-checkbox-group-rac-Xmb5IKrb.js} +2 -2
- package/dist/component/{dext-checkbox-rac-CBm9cRUz.js → dext-checkbox-rac-2eA7y0ld.js} +1 -1
- package/dist/component/{dext-date-picker-rac-DsVKWsRy.js → dext-date-picker-rac-CmLxVGGT.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-CO26-8Qo.js → dext-date-time-input-rac-Cd9nwSjb.js} +1 -1
- package/dist/component/{dext-dropdown-rac-eRzu2C-y.js → dext-dropdown-rac-BKdQ0nGS.js} +1 -1
- package/dist/component/{dext-email-rac-DDrZzE_G.js → dext-email-rac-07zDPxyf.js} +1 -1
- package/dist/component/{dext-number-input-rac-Dj7sInLk.js → dext-number-input-rac-DRvGuppY.js} +1 -1
- package/dist/component/{dext-phone-rac-g8M77F7m.js → dext-phone-rac-CKtTVjFg.js} +1 -1
- package/dist/component/{dext-radio-group-rac-BjhygC0R.js → dext-radio-group-rac-BsBmMufq.js} +2 -2
- package/dist/component/{dext-rating-input-rac-BraNjvyA.js → dext-rating-input-rac-CcFSTAIh.js} +1 -1
- package/dist/component/{dext-tags-rac-B5mAIuDi.js → dext-tags-rac-CCTDlCvX.js} +2 -2
- package/dist/component/{dext-text-area-rac-D_YBnaWi.js → dext-text-area-rac-Cif8po9h.js} +1 -1
- package/dist/component/{dext-text-input-rac-BzeWH1jv.js → dext-text-input-rac-2118X4iF.js} +1 -1
- package/dist/component/{dext-url-input-rac-Cn0h_vx3.js → dext-url-input-rac-DDImGkQe.js} +1 -1
- package/dist/component/{donation-rac-CQRdHxWh.js → donation-rac-Dnylss1d.js} +103 -103
- package/dist/component/{dropdown-field-rac-C7LL0W5Z.js → dropdown-field-rac-DDI4ZgZH.js} +3 -3
- package/dist/component/{dropdown-rac-Nb2VyJ0x.js → dropdown-rac-DX0Z3R_8.js} +1 -1
- package/dist/component/{ecom-address-rac-_c2YIIwg.js → ecom-address-rac-D9MeEQsk.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-Bma7TAVj.js → ecom-subscription-checkbox-rac-DKJ9j5dj.js} +2 -2
- package/dist/component/{email-input-field-rac-2E2tEaS5.js → email-input-field-rac-DaKrmlwe.js} +55 -55
- package/dist/component/{events-repeater-rac-COWHYBFD.js → events-repeater-rac-DWrOLT0Y.js} +45 -45
- package/dist/component/{events-rsvp-rac-CXp8j19Y.js → events-rsvp-rac-YBTR1tR0.js} +6 -6
- package/dist/component/{field-error-headless-S-ugOQQX.js → field-error-headless-jksFrezt.js} +10 -10
- package/dist/component/{field-label-headless-_n4I0_tX.js → field-label-headless-BBvJAVxI.js} +10 -10
- package/dist/component/{file-upload-rac-DCH_iwDg.js → file-upload-rac-CgdmfUZG.js} +168 -168
- package/dist/component/{fixed-payment-rac-CYkKJUfM.js → fixed-payment-rac-v6rKwzFs.js} +13 -13
- package/dist/component/{form-jK8ezTss.js → form-BsiK682r.js} +530 -502
- package/dist/component/form.js +1 -1
- package/dist/component/{header-field-rac-DnbjI6W5.js → header-field-rac-BuXybl7K.js} +6 -6
- package/dist/component/{header-rac-DKUICrni.js → header-rac-CDyaLosW.js} +1 -1
- package/dist/component/{image-choice-rac-B_9ponST.js → image-choice-rac-BRlMroBw.js} +41 -41
- package/dist/component/{index-BxdMzOvN.js → index-BanOeCAF.js} +242 -236
- package/dist/component/{index-ZYnsxY-a.js → index-y9URYGEE.js} +6 -6
- package/dist/component/{isObjectLike-BW-9QEQl.js → isObjectLike-BG9nJ-rx.js} +7 -7
- package/dist/component/{multiline-address-field-rac-k-P0ijWG.js → multiline-address-field-rac-DRAkxI1l.js} +342 -342
- package/dist/component/{multiline-address-rac-Bbn9mNDa.js → multiline-address-rac-JjTzWsEb.js} +1 -1
- package/dist/component/{number-input-field-rac--lom-B_X.js → number-input-field-rac-QrouG7Hv.js} +22 -22
- package/dist/component/{number-input-rac-Bhbd6T9S.js → number-input-rac-DGmE7cLv.js} +1 -1
- package/dist/component/{password-rac-BV_uTHb3.js → password-rac-DeyY228m.js} +28 -28
- package/dist/component/{payment-input-rac-cawyGN_t.js → payment-input-rac-DmIennLi.js} +45 -45
- package/dist/component/{phone-input-field-rac-CsElHRto.js → phone-input-field-rac-F7e74TGA.js} +76 -76
- package/dist/component/{phone-rac-XrHN5Nko.js → phone-rac-CQfB2CQD.js} +1 -1
- package/dist/component/{product-list-rac-cxv_xz7K.js → product-list-rac--GGG8vvO.js} +62 -62
- package/dist/component/{quiz-radio-group-rac-DGaxOPE1.js → quiz-radio-group-rac-DF2C2vNq.js} +1 -1
- package/dist/component/{radio-button-module-classes-Xv2Jn01x.js → radio-button-module-classes-DmpNo6F2.js} +17 -17
- package/dist/component/{radio-group-field-rac-DgGqgTql.js → radio-group-field-rac-BGcPYfKO.js} +6 -6
- package/dist/component/{radio-group-rac-Bh0E-oe1.js → radio-group-rac-CqysUMCE.js} +1 -1
- package/dist/component/{rating-input-field-rac-C3YLV971.js → rating-input-field-rac-D-ei917Y.js} +24 -24
- package/dist/component/{rating-input-rac-CfcC5EUh.js → rating-input-rac-a9zJ74fw.js} +1 -1
- package/dist/component/{rich-content-rac.module-DUjzLGtX.js → rich-content-rac.module-CvyLVlXL.js} +5 -5
- package/dist/component/{rich-text-field-rac-BmguoJhk.js → rich-text-field-rac-vf19nvyw.js} +7 -7
- package/dist/component/{rich-text-rac-BWhHcq25.js → rich-text-rac-Cx_wpoxC.js} +1 -1
- package/dist/component/{service-dropdown-rac-C5oX-ql7.js → service-dropdown-rac-DITzKQxd.js} +26 -26
- package/dist/component/{services-multi-choice-rac-C1fem9NB.js → services-multi-choice-rac-BtisN0Aq.js} +11 -11
- package/dist/component/{signature-rac-BtHqiWj1.js → signature-rac-DUeIoS5O.js} +226 -226
- package/dist/component/{submit-button-rac-OYeKJFF8.js → submit-button-rac-C8h6zeTw.js} +36 -36
- package/dist/component/{tags-field-rac-kA2RSijL.js → tags-field-rac-CjFuiB0n.js} +51 -51
- package/dist/component/{tags-rac-B_2qCZGu.js → tags-rac-BO7rwyLl.js} +1 -1
- package/dist/component/{text-area-field-rac-DeO609Mv.js → text-area-field-rac-CgUx3nQ0.js} +23 -23
- package/dist/component/{text-area-rac-BAQFBOZd.js → text-area-rac-WgXYXIaf.js} +1 -1
- package/dist/component/{text-input-field-rac-CCcKwuLZ.js → text-input-field-rac-DaxWFha-.js} +6 -6
- package/dist/component/{text-input-headless-D8-jkaYm.js → text-input-headless-hjuRJTZN.js} +6 -6
- package/dist/component/{text-input-rac-BVcgjj8g.js → text-input-rac-BzumrJBj.js} +1 -1
- package/dist/component/{time-input-rac-BYctyHgU.js → time-input-rac-2FEkpQ7M.js} +18 -18
- package/dist/component/{url-input-field-rac-COC9qgcs.js → url-input-field-rac-BZ9f8D8I.js} +26 -26
- package/dist/component/{url-input-rac-BZXLh0Ej.js → url-input-rac-D-AVlxkD.js} +1 -1
- package/dist/component/{use-dropdown-option-class-name-BTltqRl1.js → use-dropdown-option-class-name-DwAAtzgX.js} +11 -11
- package/dist/component/{use-dropdown-trigger-class-name-BjJZfl3i.js → use-dropdown-trigger-class-name-D-6n9YVG.js} +18 -18
- package/dist/component/{use-element-state-class-name-CkT6Ga8t.js → use-element-state-class-name-C5auxwhj.js} +3 -3
- package/dist/component/{use-hoverable-input-class-name-BkoSr6tr.js → use-hoverable-input-class-name-Nd2jqfz4.js} +2 -2
- package/dist/component/use-is-forced-open-dropdown-CKaHhCqp.js +64 -0
- package/dist/component/{use-service-options-base-Wp8RZ4Z8.js → use-service-options-base-CvluFheT.js} +3 -3
- package/dist/component/use-text-input-class-name-DGTlYJxC.js +6 -0
- package/dist/form.d.ts +19 -0
- package/package.json +2 -2
- package/dist/component/date-input-field-rac-b_T1yf8D.js +0 -309
- package/dist/component/use-is-forced-open-dropdown-fo_NCnSk.js +0 -53
- package/dist/component/use-text-input-class-name-DS7i03Gk.js +0 -6
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import t, { useState as Y, useRef as H, useMemo as
|
|
2
|
-
import
|
|
3
|
-
import { RicosViewer as
|
|
1
|
+
import t, { useState as Y, useRef as H, useMemo as pe, useEffect as ne, useCallback as M, createContext as ge, useContext as _e } from "react";
|
|
2
|
+
import Le from "@wix/editor-react-components/AnimatedIcon";
|
|
3
|
+
import { RicosViewer as he } from "@wix/ricos/viewer";
|
|
4
4
|
import A from "classnames";
|
|
5
|
-
import {
|
|
6
|
-
import { E as
|
|
5
|
+
import { bG as Ce, bU as re, bP as xe, aN as Ne, bS as ve, aG as ie, bT as De, bH as fe, bK as V, bM as ye, bE as Se, bD as Te, X as Be, al as Ie, b as we, P as Ae, Q as ce, R as Re, N as ue, M as de, I as Me, O as Ze, f as te } from "./form-BsiK682r.js";
|
|
6
|
+
import { E as Oe } from "./error-icon-hZxQ6DEy.js";
|
|
7
7
|
import { s as $ } from "./field-rac.module-ts2t4WUO.js";
|
|
8
|
-
import { u as
|
|
9
|
-
import { DropZone as
|
|
10
|
-
import { f as
|
|
11
|
-
import { b as
|
|
12
|
-
import { L as
|
|
13
|
-
const
|
|
8
|
+
import { u as me } from "./use-element-state-class-name-C5auxwhj.js";
|
|
9
|
+
import { DropZone as Ue, Text as ke, FileTrigger as Pe, Button as Ee, ProgressBar as He, VisuallyHidden as ze } from "react-aria-components";
|
|
10
|
+
import { f as h, a as G } from "./find-child-C60k4CxG.js";
|
|
11
|
+
import { b as Ve, a as Ke, D as je, E as qe } from "./field-error-headless-jksFrezt.js";
|
|
12
|
+
import { L as $e } from "./field-label-headless-BBvJAVxI.js";
|
|
13
|
+
const Ye = {
|
|
14
14
|
Video: "video/*",
|
|
15
15
|
Image: "image/*",
|
|
16
16
|
Audio: "audio/*",
|
|
17
17
|
Document: ".ai, .cdr, .csv, .doc, .docb, .docx, .dot, .dotx, .dwg, .eps, .epub, .fla, .gpx, .ical, .icalendar, .ics, .ifb, .indd, .ipynb, .key, .kml, .kmz, .mobi, .mtf, .mtx, .numbers, .odg, .odp, .ods, .odt, .otp, .ots, .ott, .oxps, .pages, .pdf, .pdn, .pkg, .pot, .potx, .pps, .ppsx, .ppt, .pptx, .psd, .pub, .rtf, .sldx, .txt, .json, .vcf, .xcf, .xls, .xlsx, .xlt, .xltx, .xlw, .xps,.xml,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel",
|
|
18
18
|
Archive: ".zip, .rar, .tar, .tar.gz, .gz, .gzip, .jar, .7z, .fgz, .webarchive",
|
|
19
19
|
Model3D: ".gltf, .glb"
|
|
20
|
-
},
|
|
20
|
+
}, Ge = (e) => {
|
|
21
21
|
const { actions: n, formId: r } = Ce();
|
|
22
22
|
return async (l, s, d) => {
|
|
23
23
|
if (!(n != null && n.uploadFile) || !l.length)
|
|
@@ -27,8 +27,8 @@ const $e = {
|
|
|
27
27
|
formId: r,
|
|
28
28
|
uploadTarget: e
|
|
29
29
|
}).then((i) => {
|
|
30
|
-
const { id:
|
|
31
|
-
fileId:
|
|
30
|
+
const { id: x, displayName: m, url: p, isPrivate: c } = i, y = {
|
|
31
|
+
fileId: x,
|
|
32
32
|
displayName: m || o.name,
|
|
33
33
|
url: c ? void 0 : p,
|
|
34
34
|
fileType: o.type || "application/octet-stream"
|
|
@@ -43,25 +43,25 @@ const $e = {
|
|
|
43
43
|
return (await Promise.all(E)).filter((o) => o !== void 0);
|
|
44
44
|
};
|
|
45
45
|
};
|
|
46
|
-
function
|
|
47
|
-
const [o, i] = Y(We(n)), [
|
|
46
|
+
function Qe({ valueSliderLimit: e, value: n, explanationText: r, target: l, onChange: s, uploadFileFormats: d, onBlur: E, onFilesCleared: C }) {
|
|
47
|
+
const [o, i] = Y(We(n)), [x, m] = Y(n || []), [p, c] = Y(), y = Ge(l), { t: N } = re(), g = xe().includes(Ne.BUTTONS_HOVER), { setFormStatus: T } = ve(), I = H(!1), B = H(s);
|
|
48
48
|
B.current = s;
|
|
49
|
-
const v =
|
|
49
|
+
const v = pe(() => o.some((f) => f.state === "uploading"), [
|
|
50
50
|
o
|
|
51
51
|
]);
|
|
52
52
|
ne(() => {
|
|
53
|
-
|
|
53
|
+
I.current !== v && (I.current = v, T(l, v ? ie.BUSY : ie.READY));
|
|
54
54
|
}, [
|
|
55
55
|
v,
|
|
56
|
-
|
|
56
|
+
T,
|
|
57
57
|
l
|
|
58
58
|
]);
|
|
59
|
-
const u =
|
|
59
|
+
const u = M(() => {
|
|
60
60
|
if (!o.length)
|
|
61
61
|
return;
|
|
62
|
-
const
|
|
63
|
-
if (
|
|
64
|
-
const f = o.filter((F) => F.state === "uploaded" && F.file.size > 0).length, L = f / (f +
|
|
62
|
+
const _ = o.filter((f) => f.state === "uploading").length;
|
|
63
|
+
if (_) {
|
|
64
|
+
const f = o.filter((F) => F.state === "uploaded" && F.file.size > 0).length, L = f / (f + _);
|
|
65
65
|
return N("form.file-upload.uploading", {
|
|
66
66
|
count: Math.round(L * 100)
|
|
67
67
|
});
|
|
@@ -72,12 +72,12 @@ function Ge({ valueSliderLimit: e, value: n, explanationText: r, target: l, onCh
|
|
|
72
72
|
}, [
|
|
73
73
|
o,
|
|
74
74
|
N
|
|
75
|
-
]),
|
|
75
|
+
]), w = M(() => o.length ? o.some((f) => f.state === "uploading") ? u() : r || u() : r, [
|
|
76
76
|
o,
|
|
77
77
|
r,
|
|
78
78
|
u
|
|
79
|
-
]),
|
|
80
|
-
await y(
|
|
79
|
+
]), S = M(async (_) => {
|
|
80
|
+
await y(_, ({ file: f, uploadedFile: L }) => {
|
|
81
81
|
i((F) => F.map((b) => b.file === f ? {
|
|
82
82
|
file: f,
|
|
83
83
|
state: "uploaded"
|
|
@@ -98,48 +98,48 @@ function Ge({ valueSliderLimit: e, value: n, explanationText: r, target: l, onCh
|
|
|
98
98
|
}, [
|
|
99
99
|
y,
|
|
100
100
|
N
|
|
101
|
-
]), j = async (
|
|
102
|
-
if (p && c(void 0),
|
|
103
|
-
if (o.length +
|
|
101
|
+
]), j = async (_) => {
|
|
102
|
+
if (p && c(void 0), _) {
|
|
103
|
+
if (o.length + _.length > e) {
|
|
104
104
|
c(N("form.file-upload.error.upload-limit", {
|
|
105
105
|
limit: e
|
|
106
106
|
}));
|
|
107
107
|
return;
|
|
108
108
|
}
|
|
109
|
-
const F = Array.from(
|
|
109
|
+
const F = Array.from(_).reduce((b, U) => (o.some((k) => k.file.name === U.name) || b.push({
|
|
110
110
|
file: U,
|
|
111
111
|
state: "uploading"
|
|
112
112
|
}), b), []);
|
|
113
113
|
i([
|
|
114
114
|
...o,
|
|
115
115
|
...F
|
|
116
|
-
]), await
|
|
116
|
+
]), await S(F);
|
|
117
117
|
}
|
|
118
|
-
}, O = (
|
|
119
|
-
const f = o[
|
|
120
|
-
if (
|
|
121
|
-
const L =
|
|
118
|
+
}, O = (_) => {
|
|
119
|
+
const f = o[_];
|
|
120
|
+
if (x && s && f.state !== "error") {
|
|
121
|
+
const L = x.filter((b) => b.displayName !== f.file.name);
|
|
122
122
|
s(L), m(L);
|
|
123
123
|
const F = o.filter((b) => b.file.name !== f.file.name);
|
|
124
|
-
i(F), F.length === 0 &&
|
|
124
|
+
i(F), F.length === 0 && C();
|
|
125
125
|
} else {
|
|
126
126
|
const L = o.filter((F) => F !== f);
|
|
127
|
-
i(L), L.length === 0 &&
|
|
127
|
+
i(L), L.length === 0 && C();
|
|
128
128
|
}
|
|
129
129
|
}, q = () => {
|
|
130
130
|
p && c(void 0), E();
|
|
131
|
-
},
|
|
131
|
+
}, Q = d.map((_) => Ye[_]).join(), J = M(() => {
|
|
132
132
|
i([]), m([]);
|
|
133
133
|
}, []);
|
|
134
|
-
return
|
|
134
|
+
return De(J), {
|
|
135
135
|
files: o,
|
|
136
136
|
limitError: p,
|
|
137
137
|
hover: g,
|
|
138
|
-
getExplanationText:
|
|
138
|
+
getExplanationText: w,
|
|
139
139
|
getStatusText: u,
|
|
140
140
|
handleChange: j,
|
|
141
141
|
handleDelete: O,
|
|
142
|
-
accept:
|
|
142
|
+
accept: Q,
|
|
143
143
|
handleBlur: q
|
|
144
144
|
};
|
|
145
145
|
}
|
|
@@ -159,26 +159,26 @@ function We(e = []) {
|
|
|
159
159
|
}
|
|
160
160
|
return [];
|
|
161
161
|
}
|
|
162
|
-
const
|
|
162
|
+
const Fe = /* @__PURE__ */ ge(void 0);
|
|
163
163
|
function K() {
|
|
164
|
-
const e =
|
|
164
|
+
const e = _e(Fe);
|
|
165
165
|
if (typeof e > "u")
|
|
166
166
|
throw new Error("FileUpload components must be used within FileUpload");
|
|
167
167
|
return e;
|
|
168
168
|
}
|
|
169
169
|
const z = ({ children: e, className: n }) => {
|
|
170
|
-
const { ariaDescribedBy: r } =
|
|
170
|
+
const { ariaDescribedBy: r } = fe(), { disabled: l, hasError: s } = V(), { handleFileChange: d, limitReached: E } = K();
|
|
171
171
|
if (E)
|
|
172
172
|
return null;
|
|
173
|
-
const
|
|
174
|
-
return /* @__PURE__ */ t.createElement(
|
|
173
|
+
const C = h(e, z.Title), o = h(e, z.Subtitle), i = h(e, z.Button);
|
|
174
|
+
return /* @__PURE__ */ t.createElement(Ue, {
|
|
175
175
|
"aria-describedby": r,
|
|
176
176
|
className: n,
|
|
177
177
|
"data-invalid": s,
|
|
178
178
|
isDisabled: l,
|
|
179
|
-
onDrop: async (
|
|
179
|
+
onDrop: async (x) => {
|
|
180
180
|
const m = [];
|
|
181
|
-
for (const p of
|
|
181
|
+
for (const p of x.items)
|
|
182
182
|
if (p.kind === "file") {
|
|
183
183
|
const c = await p.getFile();
|
|
184
184
|
c && m.push(c);
|
|
@@ -188,10 +188,10 @@ const z = ({ children: e, className: n }) => {
|
|
|
188
188
|
m.forEach((c) => p.items.add(c)), d(p.files);
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
}, /* @__PURE__ */ t.createElement(
|
|
191
|
+
}, /* @__PURE__ */ t.createElement(ke, {
|
|
192
192
|
slot: "label"
|
|
193
|
-
},
|
|
194
|
-
},
|
|
193
|
+
}, C, o), i);
|
|
194
|
+
}, Xe = ({ className: e, children: n }) => {
|
|
195
195
|
const { limitReached: r } = K();
|
|
196
196
|
return /* @__PURE__ */ t.createElement("p", {
|
|
197
197
|
className: e
|
|
@@ -206,67 +206,67 @@ const z = ({ children: e, className: n }) => {
|
|
|
206
206
|
limitReached: r
|
|
207
207
|
}));
|
|
208
208
|
}, oe = ({ className: e, children: n, "aria-roledescription": r, onHoverStart: l, onHoverEnd: s, onFocusChange: d }) => {
|
|
209
|
-
const { ariaDescribedBy: E, inputId:
|
|
210
|
-
return /* @__PURE__ */ t.createElement(
|
|
211
|
-
acceptedFileTypes:
|
|
209
|
+
const { ariaDescribedBy: E, inputId: C, labelId: o, errorId: i } = fe(), { disabled: x, required: m, onFocus: p, hasError: c, errorMessage: y } = V(), { handleFileChange: N, accept: Z, multiple: g, buttonRef: T, handleBlur: I, limitError: B, files: v } = K(), u = (v == null ? void 0 : v.some((S) => S.errorMessage)) ?? !1, w = !!(c || y || B || u);
|
|
210
|
+
return /* @__PURE__ */ t.createElement(Pe, {
|
|
211
|
+
acceptedFileTypes: Z ? Z.split(",") : void 0,
|
|
212
212
|
allowsMultiple: g,
|
|
213
|
-
onSelect: (
|
|
214
|
-
if (
|
|
215
|
-
const j = Array.from(
|
|
213
|
+
onSelect: (S) => {
|
|
214
|
+
if (S) {
|
|
215
|
+
const j = Array.from(S), O = new DataTransfer();
|
|
216
216
|
j.forEach((q) => O.items.add(q)), N(O.files);
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
|
-
}, /* @__PURE__ */ t.createElement(
|
|
220
|
-
ref:
|
|
221
|
-
id:
|
|
219
|
+
}, /* @__PURE__ */ t.createElement(Ee, {
|
|
220
|
+
ref: T,
|
|
221
|
+
id: C,
|
|
222
222
|
"aria-labelledby": o,
|
|
223
223
|
"aria-describedby": [
|
|
224
224
|
E,
|
|
225
225
|
i
|
|
226
226
|
].filter(Boolean).join(" "),
|
|
227
|
-
render: (
|
|
228
|
-
...
|
|
227
|
+
render: (S) => /* @__PURE__ */ t.createElement("button", {
|
|
228
|
+
...S,
|
|
229
229
|
"aria-roledescription": r,
|
|
230
|
-
"aria-invalid":
|
|
230
|
+
"aria-invalid": w || void 0,
|
|
231
231
|
"aria-required": m
|
|
232
232
|
}),
|
|
233
|
-
isDisabled:
|
|
233
|
+
isDisabled: x,
|
|
234
234
|
className: e,
|
|
235
235
|
onFocus: p,
|
|
236
|
-
onBlur:
|
|
236
|
+
onBlur: I,
|
|
237
237
|
onHoverStart: l,
|
|
238
238
|
onHoverEnd: s,
|
|
239
239
|
onFocusChange: d
|
|
240
240
|
}, n));
|
|
241
|
-
},
|
|
241
|
+
}, et = ({ className: e }) => {
|
|
242
242
|
const { buttonText: n } = V();
|
|
243
243
|
return /* @__PURE__ */ t.createElement("span", {
|
|
244
244
|
className: e
|
|
245
245
|
}, n);
|
|
246
246
|
};
|
|
247
|
-
oe.Text =
|
|
248
|
-
z.Title =
|
|
247
|
+
oe.Text = et;
|
|
248
|
+
z.Title = Xe;
|
|
249
249
|
z.Subtitle = Je;
|
|
250
250
|
z.Button = oe;
|
|
251
251
|
const R = ({ children: e, className: n, ...r }) => {
|
|
252
|
-
const { file: l, index: s } = r, d = l.file.name, E =
|
|
252
|
+
const { file: l, index: s } = r, d = l.file.name, E = h(e, R.Name), C = h(e, R.Remove), o = h(e, R.Spinner), i = h(e, R.Error);
|
|
253
253
|
return /* @__PURE__ */ t.createElement("div", {
|
|
254
254
|
className: n
|
|
255
255
|
}, G(E, {
|
|
256
256
|
fileName: d
|
|
257
|
-
}), l.state === "uploading" ? o : G(
|
|
257
|
+
}), l.state === "uploading" ? o : G(C, {
|
|
258
258
|
index: s,
|
|
259
259
|
fileName: d
|
|
260
260
|
}), l.errorMessage && G(i, {
|
|
261
261
|
errorMessage: l.errorMessage
|
|
262
262
|
}));
|
|
263
|
-
},
|
|
263
|
+
}, tt = ({ className: e, ...n }) => {
|
|
264
264
|
const { fileName: r } = n;
|
|
265
265
|
return /* @__PURE__ */ t.createElement("span", {
|
|
266
266
|
className: e
|
|
267
267
|
}, r);
|
|
268
|
-
},
|
|
269
|
-
const { fileName: s, index: d } = l, { disabled: E } = V(), { handleDelete:
|
|
268
|
+
}, nt = ({ className: e, "aria-label": n, children: r, ...l }) => {
|
|
269
|
+
const { fileName: s, index: d } = l, { disabled: E } = V(), { handleDelete: C, fileRemoveButtonRefs: o } = K(), i = H(null);
|
|
270
270
|
ne(() => {
|
|
271
271
|
const m = o.current, p = s;
|
|
272
272
|
return m[p] = i, () => {
|
|
@@ -276,38 +276,38 @@ const R = ({ children: e, className: n, ...r }) => {
|
|
|
276
276
|
s,
|
|
277
277
|
o
|
|
278
278
|
]);
|
|
279
|
-
const
|
|
280
|
-
|
|
279
|
+
const x = () => {
|
|
280
|
+
C(d);
|
|
281
281
|
};
|
|
282
|
-
return /* @__PURE__ */ t.createElement(
|
|
282
|
+
return /* @__PURE__ */ t.createElement(Ee, {
|
|
283
283
|
ref: i,
|
|
284
284
|
"aria-disabled": E,
|
|
285
285
|
"aria-label": n,
|
|
286
286
|
"aria-description": s,
|
|
287
|
-
onClick:
|
|
287
|
+
onClick: x,
|
|
288
288
|
className: e,
|
|
289
289
|
isDisabled: E
|
|
290
290
|
}, r);
|
|
291
|
-
},
|
|
291
|
+
}, be = ({ className: e, children: n, ...r }) => {
|
|
292
292
|
const { errorMessage: l } = r;
|
|
293
|
-
return l ? /* @__PURE__ */ t.createElement(
|
|
293
|
+
return l ? /* @__PURE__ */ t.createElement(Ke, {
|
|
294
294
|
value: l
|
|
295
295
|
}, /* @__PURE__ */ t.createElement("div", {
|
|
296
296
|
className: e,
|
|
297
297
|
role: "alert"
|
|
298
298
|
}, n)) : null;
|
|
299
|
-
},
|
|
299
|
+
}, rt = ({ className: e, "aria-label": n, children: r }) => /* @__PURE__ */ t.createElement(He, {
|
|
300
300
|
"aria-label": n,
|
|
301
301
|
className: e,
|
|
302
302
|
isIndeterminate: !0
|
|
303
303
|
}, r);
|
|
304
|
-
R.Name =
|
|
305
|
-
R.Remove =
|
|
306
|
-
R.Spinner =
|
|
307
|
-
R.Error =
|
|
308
|
-
|
|
304
|
+
R.Name = tt;
|
|
305
|
+
R.Remove = nt;
|
|
306
|
+
R.Spinner = rt;
|
|
307
|
+
R.Error = be;
|
|
308
|
+
be.Text = Ve;
|
|
309
309
|
const le = ({ children: e, className: n }) => {
|
|
310
|
-
const { files: r } = K(), l =
|
|
310
|
+
const { files: r } = K(), l = h(e, le.File);
|
|
311
311
|
return !r || r.length === 0 ? null : /* @__PURE__ */ t.createElement("div", {
|
|
312
312
|
className: n
|
|
313
313
|
}, r.map((s, d) => G(l, {
|
|
@@ -317,24 +317,24 @@ const le = ({ children: e, className: n }) => {
|
|
|
317
317
|
})));
|
|
318
318
|
};
|
|
319
319
|
le.File = R;
|
|
320
|
-
const
|
|
321
|
-
const { t: n } = re(), { id: r, value: l, onChange: s, uploadFileFormats: d, valueSliderLimit: E, target:
|
|
320
|
+
const X = (e) => e.file.name, a = ({ children: e }) => {
|
|
321
|
+
const { t: n } = re(), { id: r, value: l, onChange: s, uploadFileFormats: d, valueSliderLimit: E, target: C, explanationText: o, onBlur: i, hasError: x, errorMessage: m, FieldLayout: p } = V(), c = H(null), y = H({}), N = H(!1), Z = M(() => {
|
|
322
322
|
c.current ? c.current.focus() : N.current = !0;
|
|
323
|
-
}, []), { files: g, limitError:
|
|
323
|
+
}, []), { files: g, limitError: T, hover: I, getExplanationText: B, getStatusText: v, handleBlur: u, handleChange: w, handleDelete: S, accept: j } = Qe({
|
|
324
324
|
valueSliderLimit: E,
|
|
325
325
|
value: l,
|
|
326
326
|
explanationText: o,
|
|
327
|
-
target:
|
|
327
|
+
target: C,
|
|
328
328
|
onChange: s,
|
|
329
329
|
uploadFileFormats: d,
|
|
330
330
|
onBlur: i,
|
|
331
|
-
onFilesCleared:
|
|
332
|
-
}), O =
|
|
331
|
+
onFilesCleared: Z
|
|
332
|
+
}), O = M((k) => {
|
|
333
333
|
var se;
|
|
334
|
-
const
|
|
335
|
-
g.length > 1 && ((se = (g.filter((ee) =>
|
|
334
|
+
const W = g[k], P = X(W);
|
|
335
|
+
g.length > 1 && ((se = (g.filter((ee) => X(ee) !== P).map((ee) => y.current[X(ee)]).find(Boolean) ?? c).current) == null || se.focus()), S(k);
|
|
336
336
|
}, [
|
|
337
|
-
|
|
337
|
+
S,
|
|
338
338
|
g
|
|
339
339
|
]);
|
|
340
340
|
ne(() => {
|
|
@@ -342,54 +342,54 @@ const J = (e) => e.file.name, a = ({ children: e }) => {
|
|
|
342
342
|
}, [
|
|
343
343
|
g
|
|
344
344
|
]);
|
|
345
|
-
const q = E > 1,
|
|
346
|
-
handleFileChange:
|
|
345
|
+
const q = E > 1, Q = g.length >= E, J = pe(() => ({
|
|
346
|
+
handleFileChange: w,
|
|
347
347
|
handleBlur: u,
|
|
348
348
|
handleDelete: O,
|
|
349
349
|
files: g,
|
|
350
350
|
accept: j,
|
|
351
|
-
limitReached:
|
|
351
|
+
limitReached: Q,
|
|
352
352
|
multiple: q,
|
|
353
353
|
getExplanationText: B,
|
|
354
354
|
getStatusText: v,
|
|
355
|
-
hover:
|
|
356
|
-
limitError:
|
|
355
|
+
hover: I,
|
|
356
|
+
limitError: T,
|
|
357
357
|
buttonRef: c,
|
|
358
358
|
fileRemoveButtonRefs: y
|
|
359
359
|
}), [
|
|
360
|
-
|
|
360
|
+
w,
|
|
361
361
|
u,
|
|
362
362
|
O,
|
|
363
363
|
g,
|
|
364
364
|
j,
|
|
365
|
-
|
|
365
|
+
Q,
|
|
366
366
|
q,
|
|
367
367
|
B,
|
|
368
368
|
v,
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
]),
|
|
372
|
-
return
|
|
373
|
-
var k,
|
|
369
|
+
I,
|
|
370
|
+
T
|
|
371
|
+
]), _ = h(e, a.Label), f = h(e, a.DropZone), L = h(e, a.Button), F = h(e, a.Explanation), b = h(e, a.Files), U = h(e, a.Description), ae = h(e, a.Error);
|
|
372
|
+
return ye(() => {
|
|
373
|
+
var k, W;
|
|
374
374
|
if (c.current) {
|
|
375
375
|
c.current.focus({
|
|
376
376
|
preventScroll: !0
|
|
377
377
|
});
|
|
378
378
|
return;
|
|
379
379
|
}
|
|
380
|
-
(
|
|
380
|
+
(W = (k = g.map((P) => y.current[X(P)]).find((P) => P == null ? void 0 : P.current)) == null ? void 0 : k.current) == null || W.focus({
|
|
381
381
|
preventScroll: !0
|
|
382
382
|
});
|
|
383
|
-
}, r), /* @__PURE__ */ t.createElement(
|
|
384
|
-
value:
|
|
383
|
+
}, r), /* @__PURE__ */ t.createElement(Fe.Provider, {
|
|
384
|
+
value: J
|
|
385
385
|
}, /* @__PURE__ */ t.createElement(p, {
|
|
386
386
|
fieldId: r,
|
|
387
|
-
renderLabel: () =>
|
|
387
|
+
renderLabel: () => _,
|
|
388
388
|
renderInput: () => f ?? L,
|
|
389
389
|
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, G(ae, {
|
|
390
|
-
hasError: !!(
|
|
391
|
-
errorMessage:
|
|
392
|
-
}), /* @__PURE__ */ t.createElement(
|
|
390
|
+
hasError: !!(x || T),
|
|
391
|
+
errorMessage: T ?? m
|
|
392
|
+
}), /* @__PURE__ */ t.createElement(ze, {
|
|
393
393
|
role: "status",
|
|
394
394
|
"aria-live": "polite",
|
|
395
395
|
"aria-atomic": "true"
|
|
@@ -397,20 +397,20 @@ const J = (e) => e.file.name, a = ({ children: e }) => {
|
|
|
397
397
|
count: g.length
|
|
398
398
|
})), F, b, U)
|
|
399
399
|
}));
|
|
400
|
-
},
|
|
400
|
+
}, ot = ({ className: e, showUploadStatusOnly: n }) => {
|
|
401
401
|
const { files: r, getExplanationText: l, getStatusText: s } = K(), d = n ? s() : l();
|
|
402
402
|
return r.length === 1 || !d ? null : /* @__PURE__ */ t.createElement("p", {
|
|
403
403
|
className: e
|
|
404
404
|
}, d);
|
|
405
405
|
};
|
|
406
|
-
a.Label =
|
|
406
|
+
a.Label = $e;
|
|
407
407
|
a.DropZone = z;
|
|
408
408
|
a.Button = oe;
|
|
409
|
-
a.Explanation =
|
|
409
|
+
a.Explanation = ot;
|
|
410
410
|
a.Files = le;
|
|
411
|
-
a.Description =
|
|
412
|
-
a.Error =
|
|
413
|
-
const
|
|
411
|
+
a.Description = je;
|
|
412
|
+
a.Error = qe;
|
|
413
|
+
const lt = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
414
414
|
viewBox: "0 0 24 24",
|
|
415
415
|
width: 24,
|
|
416
416
|
height: 24,
|
|
@@ -419,7 +419,7 @@ const ot = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
419
419
|
...e
|
|
420
420
|
}, /* @__PURE__ */ t.createElement("path", {
|
|
421
421
|
d: "M12 12 12 6 11 6 11 12 5 12 5 13 11 13 11 19 12 19 12 13 18 13 18 12z"
|
|
422
|
-
})),
|
|
422
|
+
})), at = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
423
423
|
viewBox: "0 0 24 24",
|
|
424
424
|
width: 24,
|
|
425
425
|
height: 24,
|
|
@@ -428,7 +428,7 @@ const ot = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
428
428
|
...e
|
|
429
429
|
}, /* @__PURE__ */ t.createElement("path", {
|
|
430
430
|
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"
|
|
431
|
-
})),
|
|
431
|
+
})), st = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
432
432
|
viewBox: "0 0 24 24",
|
|
433
433
|
width: 24,
|
|
434
434
|
height: 24,
|
|
@@ -437,7 +437,7 @@ const ot = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
437
437
|
...e
|
|
438
438
|
}, /* @__PURE__ */ t.createElement("path", {
|
|
439
439
|
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"
|
|
440
|
-
})),
|
|
440
|
+
})), it = () => {
|
|
441
441
|
const n = "calc(50% - 2px)";
|
|
442
442
|
return /* @__PURE__ */ t.createElement("svg", {
|
|
443
443
|
fill: "none",
|
|
@@ -469,54 +469,54 @@ const ot = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
469
469
|
values: "0;360",
|
|
470
470
|
repeatCount: "indefinite"
|
|
471
471
|
})));
|
|
472
|
-
},
|
|
473
|
-
dropZone:
|
|
474
|
-
dropZoneHover:
|
|
475
|
-
dropZoneTitle:
|
|
476
|
-
dropZoneSubtitle:
|
|
477
|
-
button:
|
|
478
|
-
buttonHover:
|
|
479
|
-
explanation:
|
|
480
|
-
files:
|
|
481
|
-
file:
|
|
482
|
-
fileName:
|
|
483
|
-
buttonLabel:
|
|
484
|
-
removeButton:
|
|
485
|
-
spinner:
|
|
486
|
-
fileError:
|
|
487
|
-
}, xt = ({ content: e, locale: n }) => /* @__PURE__ */ t.createElement(
|
|
472
|
+
}, ct = "_dropZone_1rkyw_1", ut = "_dropZoneHover_1rkyw_26", dt = "_dropZoneTitle_1rkyw_63", mt = "_dropZoneSubtitle_1rkyw_68", pt = "_button_1rkyw_72", ft = "_buttonHover_1rkyw_125", Et = "_explanation_1rkyw_142", Ft = "_files_1rkyw_146", bt = "_file_1rkyw_146", gt = "_fileName_1rkyw_195", _t = "_buttonLabel_1rkyw_203", Lt = "_removeButton_1rkyw_207", ht = "_spinner_1rkyw_254", Ct = "_fileError_1rkyw_270", D = {
|
|
473
|
+
dropZone: ct,
|
|
474
|
+
dropZoneHover: ut,
|
|
475
|
+
dropZoneTitle: dt,
|
|
476
|
+
dropZoneSubtitle: mt,
|
|
477
|
+
button: pt,
|
|
478
|
+
buttonHover: ft,
|
|
479
|
+
explanation: Et,
|
|
480
|
+
files: Ft,
|
|
481
|
+
file: bt,
|
|
482
|
+
fileName: gt,
|
|
483
|
+
buttonLabel: _t,
|
|
484
|
+
removeButton: Lt,
|
|
485
|
+
spinner: ht,
|
|
486
|
+
fileError: Ct
|
|
487
|
+
}, xt = ({ content: e, locale: n }) => /* @__PURE__ */ t.createElement(he, {
|
|
488
488
|
content: e,
|
|
489
489
|
locale: n
|
|
490
|
-
}),
|
|
491
|
-
var
|
|
492
|
-
const { t: e } = re(), { disabled: n, readOnly: r } = V(), l = !n && !r, s =
|
|
493
|
-
globalClasses:
|
|
490
|
+
}), Nt = () => {
|
|
491
|
+
var T, I, B, v;
|
|
492
|
+
const { t: e } = re(), { disabled: n, readOnly: r } = V(), l = !n && !r, s = me({
|
|
493
|
+
globalClasses: ue,
|
|
494
494
|
moduleClasses: {
|
|
495
495
|
base: D.dropZone,
|
|
496
496
|
hover: D.dropZoneHover
|
|
497
497
|
}
|
|
498
|
-
}), d =
|
|
498
|
+
}), d = me({
|
|
499
499
|
globalClasses: Ze,
|
|
500
500
|
moduleClasses: {
|
|
501
501
|
base: D.button,
|
|
502
502
|
hover: D.buttonHover
|
|
503
503
|
}
|
|
504
|
-
}), E = (v = (B = (
|
|
504
|
+
}), E = (v = (B = (I = (T = Se().fileUpload) == null ? void 0 : T.elementProps) == null ? void 0 : I.uploadButton) == null ? void 0 : B.elementProps) == null ? void 0 : v.icon, { wix: C, className: o, ...i } = E ?? {}, x = Te(te.FILE_UPLOAD, te.UPLOAD_BUTTON, te.UPLOAD_BUTTON_LABEL), m = H(null), [p, c] = Y(!1), [y, N] = Y(!1), Z = M(() => {
|
|
505
505
|
var u;
|
|
506
506
|
c(!0), (u = m.current) == null || u.runAnimationForward();
|
|
507
|
-
}, []), g =
|
|
507
|
+
}, []), g = M(() => {
|
|
508
508
|
var u;
|
|
509
509
|
c(!1), (u = m.current) == null || u.runAnimationBackward();
|
|
510
510
|
}, []);
|
|
511
511
|
return /* @__PURE__ */ t.createElement(a, null, /* @__PURE__ */ t.createElement(a.Label, {
|
|
512
|
-
className: A(
|
|
512
|
+
className: A(Be, $.label)
|
|
513
513
|
}, /* @__PURE__ */ t.createElement(a.Label.Required, {
|
|
514
514
|
className: A(Ie, $.requiredMark)
|
|
515
515
|
})), /* @__PURE__ */ t.createElement(a.DropZone, {
|
|
516
|
-
className: ({ isHovered: u, isFocused:
|
|
516
|
+
className: ({ isHovered: u, isFocused: w, isDropTarget: S }) => s({
|
|
517
517
|
isSelected: !1,
|
|
518
|
-
isHovered: u ||
|
|
519
|
-
isFocused:
|
|
518
|
+
isHovered: u || S,
|
|
519
|
+
isFocused: w,
|
|
520
520
|
isInteractive: l
|
|
521
521
|
})
|
|
522
522
|
}, /* @__PURE__ */ t.createElement(a.DropZone.Title, {
|
|
@@ -524,47 +524,47 @@ const ot = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
524
524
|
}, ({ limitReached: u }) => e(u ? "file-upload.dropzone.limit-reached.title" : "file-upload.dropzone.title")), /* @__PURE__ */ t.createElement(a.DropZone.Subtitle, {
|
|
525
525
|
className: D.dropZoneSubtitle
|
|
526
526
|
}, ({ limitReached: u }) => e(u ? "file-upload.dropzone.limit-reached.subtitle" : "file-upload.dropzone.subtitle")), /* @__PURE__ */ t.createElement(a.DropZone.Button, {
|
|
527
|
-
className: ({ isHovered: u, isFocused:
|
|
527
|
+
className: ({ isHovered: u, isFocused: w }) => d({
|
|
528
528
|
isSelected: !1,
|
|
529
529
|
isHovered: u,
|
|
530
|
-
isFocused:
|
|
530
|
+
isFocused: w,
|
|
531
531
|
isInteractive: l
|
|
532
532
|
}),
|
|
533
533
|
"aria-roledescription": e("file-upload.aria-roledescription"),
|
|
534
|
-
onHoverStart:
|
|
534
|
+
onHoverStart: Z,
|
|
535
535
|
onHoverEnd: g,
|
|
536
536
|
onFocusChange: N
|
|
537
|
-
}, i.svg ? /* @__PURE__ */ t.createElement(
|
|
537
|
+
}, i.svg ? /* @__PURE__ */ t.createElement(Le, {
|
|
538
538
|
...i,
|
|
539
539
|
ref: m,
|
|
540
|
-
className: A(
|
|
541
|
-
}) : E ? null : /* @__PURE__ */ t.createElement(
|
|
542
|
-
className: A(ce.base, D.buttonLabel,
|
|
540
|
+
className: A(we, Ae, o)
|
|
541
|
+
}) : E ? null : /* @__PURE__ */ t.createElement(lt, null), /* @__PURE__ */ t.createElement(a.DropZone.Button.Text, {
|
|
542
|
+
className: A(ce.base, D.buttonLabel, x, {
|
|
543
543
|
[ce.hover]: l && (p || y)
|
|
544
544
|
})
|
|
545
545
|
}))), /* @__PURE__ */ t.createElement(a.Explanation, {
|
|
546
|
-
className: A(
|
|
546
|
+
className: A(Re, $.description, D.explanation),
|
|
547
547
|
showUploadStatusOnly: !0
|
|
548
548
|
}), /* @__PURE__ */ t.createElement(a.Files, {
|
|
549
549
|
className: D.files
|
|
550
550
|
}, /* @__PURE__ */ t.createElement(a.Files.File, {
|
|
551
|
-
className: A(
|
|
551
|
+
className: A(ue.base, D.file)
|
|
552
552
|
}, /* @__PURE__ */ t.createElement(a.Files.File.Name, {
|
|
553
553
|
className: D.fileName
|
|
554
554
|
}), /* @__PURE__ */ t.createElement(a.Files.File.Spinner, {
|
|
555
555
|
className: D.spinner,
|
|
556
556
|
"aria-label": e("file-upload.file.uploading-spinner.aria-label")
|
|
557
|
-
}, /* @__PURE__ */ t.createElement(
|
|
557
|
+
}, /* @__PURE__ */ t.createElement(it, null)), /* @__PURE__ */ t.createElement(a.Files.File.Remove, {
|
|
558
558
|
className: D.removeButton,
|
|
559
559
|
"aria-label": e("file-upload.delete-file.aria-label")
|
|
560
|
-
}, /* @__PURE__ */ t.createElement(
|
|
561
|
-
className: A(
|
|
562
|
-
}, /* @__PURE__ */ t.createElement(
|
|
563
|
-
className: A(
|
|
560
|
+
}, /* @__PURE__ */ t.createElement(st, null)), /* @__PURE__ */ t.createElement(a.Files.File.Error, {
|
|
561
|
+
className: A(de, $.error, D.fileError)
|
|
562
|
+
}, /* @__PURE__ */ t.createElement(at, null), /* @__PURE__ */ t.createElement(a.Files.File.Error.Text, null)))), /* @__PURE__ */ t.createElement(a.Description, {
|
|
563
|
+
className: A(Me, $.description)
|
|
564
564
|
}, xt), /* @__PURE__ */ t.createElement(a.Error, {
|
|
565
|
-
className: A(
|
|
566
|
-
}, /* @__PURE__ */ t.createElement(
|
|
567
|
-
},
|
|
565
|
+
className: A(de, $.error)
|
|
566
|
+
}, /* @__PURE__ */ t.createElement(Oe, null), /* @__PURE__ */ t.createElement(a.Error.Text, null)));
|
|
567
|
+
}, Ut = () => /* @__PURE__ */ t.createElement(Nt, null);
|
|
568
568
|
export {
|
|
569
|
-
|
|
569
|
+
Ut as FileUploadRAC
|
|
570
570
|
};
|