@wix/form-elements 1.132.0 → 1.134.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-DMYXIOL3.js → appointment-rac-CZHb5jGz.js} +246 -246
- package/dist/component/{bookings-address-rac-D6Ot6vm7.js → bookings-address-rac-F39MfGmX.js} +1 -1
- package/dist/component/{bookings-email-rac-CkPflUxK.js → bookings-email-rac-D4CurQjr.js} +1 -1
- package/dist/component/{bookings-first-name-rac-BbDv4BQw.js → bookings-first-name-rac-Bz9o1eLl.js} +1 -1
- package/dist/component/{bookings-header-rac-DJodBCf4.js → bookings-header-rac-6mfX0WGf.js} +1 -1
- package/dist/component/{bookings-last-name-rac-C4PRt2XO.js → bookings-last-name-rac-CD1-B7Ao.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-MPcFtzUB.js → bookings-login-bar-rac-2eQkfhBb.js} +17 -17
- package/dist/component/{bookings-phone-rac-BnaiOxWV.js → bookings-phone-rac-X6sSnHiH.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-Cwp6pBC_.js → bookings-rich-text-rac-f2artJnn.js} +1 -1
- package/dist/component/{calendar.module-DnhTT4QT.js → calendar.module-CKCBG_Pg.js} +11 -11
- package/dist/component/{checkbox-field-rac-BA-67OHo.js → checkbox-field-rac-DoZ9bcw3.js} +26 -25
- package/dist/component/{checkbox-group-field-headless-B20gxYEt.js → checkbox-group-field-headless-B-d37T4z.js} +32 -31
- package/dist/component/{checkbox-group-field-rac--uloIFS6.js → checkbox-group-field-rac-0qYHz3g1.js} +6 -6
- package/dist/component/{checkbox-group-rac-CYt86YIr.js → checkbox-group-rac-BqUJdAju.js} +1 -1
- package/dist/component/{checkbox-indicator-module-classes-Bqo0QILF.js → checkbox-indicator-module-classes-6173wvuW.js} +1 -1
- package/dist/component/{checkbox-rac-4FLDh24V.js → checkbox-rac-BN-qNzpH.js} +1 -1
- package/dist/component/{contacts-address-rac-BU2H0MEF.js → contacts-address-rac-B7vWOTFf.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-DXITbTMA.js → contacts-birthdate-rac-Dl0OatzW.js} +1 -1
- package/dist/component/{contacts-company-rac-D_BKjGc8.js → contacts-company-rac-DIeGU0Bf.js} +1 -1
- package/dist/component/{contacts-email-rac-CfYSUKJ3.js → contacts-email-rac-BCH6ogWv.js} +1 -1
- package/dist/component/{contacts-first-name-rac-DYZUgWsB.js → contacts-first-name-rac-Cx-USWmx.js} +1 -1
- package/dist/component/{contacts-last-name-rac-m-zqIpMB.js → contacts-last-name-rac-CUZdJI9J.js} +1 -1
- package/dist/component/{contacts-phone-rac-nJDsO_Y8.js → contacts-phone-rac-hNCW_2UC.js} +1 -1
- package/dist/component/{contacts-position-rac-CAGdJXSW.js → contacts-position-rac-CJfOgxZc.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-jwP65ngO.js → contacts-subscribe-rac-69721_c9.js} +1 -1
- package/dist/component/{contacts-tax-id-rac-DUOQlZ3c.js → contacts-tax-id-rac-CXXBqWIm.js} +1 -1
- package/dist/component/{date-availability-EbJKjV1U.js → date-availability-NQGPIrdZ.js} +1 -1
- package/dist/component/{date-input-field-rac-CZRcW-0J.js → date-input-field-rac-C-we-suG.js} +60 -60
- package/dist/component/{date-input-rac-CasoMjfj.js → date-input-rac-Cif7Bqxc.js} +1 -1
- package/dist/component/{date-picker-field-rac-V9MRWrj-.js → date-picker-field-rac-CHDkTXVH.js} +63 -63
- package/dist/component/{date-picker-rac-Cu5wTh1_.js → date-picker-rac-DdhgbY6W.js} +1 -1
- package/dist/component/{date-time-input-field-rac-YGqLIle1.js → date-time-input-field-rac-BjtDbiqE.js} +7 -7
- package/dist/component/{date-time-input-rac-DCEyREJI.js → date-time-input-rac-BDP5SN-i.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-DLB5mAwB.js → dext-checkbox-group-rac-CkF41kIR.js} +2 -2
- package/dist/component/{dext-checkbox-rac-DFV7ixAO.js → dext-checkbox-rac-DjYpsxmq.js} +1 -1
- package/dist/component/{dext-date-picker-rac-CEL2X1ID.js → dext-date-picker-rac-BxXZLogr.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-yLdCLDbQ.js → dext-date-time-input-rac-e4y_JjEx.js} +1 -1
- package/dist/component/{dext-dropdown-rac-ti_P0L_X.js → dext-dropdown-rac-DsjB3ZX7.js} +1 -1
- package/dist/component/{dext-email-rac-CnvdVz-J.js → dext-email-rac-ClPp1g4D.js} +1 -1
- package/dist/component/{dext-number-input-rac-CmGt691Y.js → dext-number-input-rac-D2nZNzyN.js} +1 -1
- package/dist/component/{dext-phone-rac-JEZkz4gZ.js → dext-phone-rac-PNiQZ-Lr.js} +1 -1
- package/dist/component/{dext-radio-group-rac-CUk6wUPl.js → dext-radio-group-rac-DUltmMHM.js} +2 -2
- package/dist/component/{dext-rating-input-rac-Q1J5oqhZ.js → dext-rating-input-rac-C_apsfGT.js} +1 -1
- package/dist/component/{dext-tags-rac-DU9FLeGu.js → dext-tags-rac-DkB_CmOD.js} +2 -2
- package/dist/component/{dext-text-area-rac-D1FOCK6O.js → dext-text-area-rac-CfoIK0S7.js} +1 -1
- package/dist/component/{dext-text-input-rac-Dzb5lQjK.js → dext-text-input-rac-CIOXlk6U.js} +1 -1
- package/dist/component/{dext-url-input-rac-cRLFpiNR.js → dext-url-input-rac-UHJAs3ck.js} +1 -1
- package/dist/component/{donation-rac-CV-PnK1D.js → donation-rac-BJfvVi_d.js} +49 -52
- package/dist/component/{dropdown-field-headless-D1e2XbNj.js → dropdown-field-headless-0DB-T-3t.js} +5 -5
- package/dist/component/{dropdown-field-rac-DkeVkP9c.js → dropdown-field-rac-DB-pd2a8.js} +5 -5
- package/dist/component/{dropdown-rac-ChlsWwyp.js → dropdown-rac-4T4zRBVy.js} +1 -1
- package/dist/component/{ecom-address-rac-DvHJ4Ym-.js → ecom-address-rac-BjWD1sRX.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-D3LX7FVx.js → ecom-subscription-checkbox-rac-CYCufut6.js} +2 -2
- package/dist/component/{email-input-field-rac-B8OCp4L9.js → email-input-field-rac-DlLoY9jB.js} +4 -4
- package/dist/component/{events-repeater-rac-BO0-VcV3.js → events-repeater-rac-CPHJbWcZ.js} +48 -47
- package/dist/component/{events-rsvp-rac-CnULPDrG.js → events-rsvp-rac-NXf8Fv3A.js} +4 -4
- package/dist/component/{field-error-headless-DwlihJqC.js → field-error-headless-C-wyL0uw.js} +1 -1
- package/dist/component/{field-label-headless-C_cMy8vP.js → field-label-headless-32mvEUId.js} +1 -1
- package/dist/component/field-rac.module-DfEb7pBp.js +25 -0
- package/dist/component/file-upload-rac-BicD_Bhj.js +566 -0
- package/dist/component/{fixed-payment-rac-ameH1syZ.js → fixed-payment-rac-DxHalHUv.js} +4 -4
- package/dist/component/{form-GcotNutn.js → form-B2wZnWX9.js} +69 -69
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +1 -1
- package/dist/component/{header-field-rac-D2fpKxIz.js → header-field-rac-C47Te_oW.js} +2 -2
- package/dist/component/{header-rac-DdWMo2xZ.js → header-rac-ChDYKTx5.js} +1 -1
- package/dist/component/{image-choice-rac-CBaUQX8m.js → image-choice-rac-CqTBWpcY.js} +56 -59
- package/dist/component/{index-nOv_Pf2O.js → index-BF_Aifc-.js} +4 -4
- package/dist/component/{index-CAktfVsx.js → index-Br8x_xx8.js} +2 -2
- package/dist/component/{isObjectLike-t9SwprFt.js → isObjectLike-D4VXbd0T.js} +1 -1
- package/dist/component/{multiline-address-field-rac-DpMPlfjM.js → multiline-address-field-rac-DYcfzGJb.js} +8 -8
- package/dist/component/{multiline-address-rac-D1XtQuAy.js → multiline-address-rac-DcGDGyL-.js} +1 -1
- package/dist/component/{number-input-field-rac-CFFU1JrK.js → number-input-field-rac-C_Fh8oeD.js} +5 -5
- package/dist/component/{number-input-rac-BDs3ngbf.js → number-input-rac-J2tCaAYx.js} +1 -1
- package/dist/component/{password-rac-jRXGfQn_.js → password-rac-wlfBhft8.js} +5 -5
- package/dist/component/{payment-input-rac-BAkJqSyU.js → payment-input-rac-DKxy3uE0.js} +5 -5
- package/dist/component/{phone-input-field-rac-D_1jDl7O.js → phone-input-field-rac-ClXUOLpB.js} +117 -117
- package/dist/component/{phone-rac-DyinFMYS.js → phone-rac-D0-Poz1e.js} +1 -1
- package/dist/component/{product-list-rac-BkUvhZMi.js → product-list-rac-TF5fgLyc.js} +69 -68
- package/dist/component/{quiz-radio-group-rac-Cha9jkTD.js → quiz-radio-group-rac-BX4V_6wg.js} +1 -1
- package/dist/component/{radio-button-module-classes-WQaDTnal.js → radio-button-module-classes-D8UpzVUK.js} +18 -17
- package/dist/component/{radio-group-field-rac-Cr35UXlg.js → radio-group-field-rac-C0zCVtjj.js} +5 -5
- package/dist/component/{radio-group-rac-BGRYJcwQ.js → radio-group-rac-DrKqgPRT.js} +1 -1
- package/dist/component/{rating-input-field-rac-C_X51vxl.js → rating-input-field-rac-DjxfTgv5.js} +35 -33
- package/dist/component/{rating-input-rac-B-usRVpy.js → rating-input-rac-DO4Bpdj3.js} +1 -1
- package/dist/component/{rich-content-rac.module-Bed3DsK7.js → rich-content-rac.module-DUNKiTkT.js} +1 -1
- package/dist/component/{rich-text-field-rac-SHHiInVy.js → rich-text-field-rac-DIOTzVwj.js} +2 -2
- package/dist/component/{rich-text-rac-CND63R3E.js → rich-text-rac-C_E_vEGz.js} +1 -1
- package/dist/component/{service-dropdown-rac-BdfxJ1Zq.js → service-dropdown-rac-B3gQT9Tj.js} +6 -6
- package/dist/component/{services-multi-choice-rac-D6BdQ2xE.js → services-multi-choice-rac-D40hZhBB.js} +7 -7
- package/dist/component/{signature-rac-xuYTsTUB.js → signature-rac-CKXpb2WN.js} +307 -301
- package/dist/component/{submit-button-rac-7YwnpPtu.js → submit-button-rac-CDS-vtXq.js} +39 -39
- package/dist/component/{tags-field-rac-ChzPiPvQ.js → tags-field-rac-CdQWq8k5.js} +72 -75
- package/dist/component/{tags-rac-BScWp3da.js → tags-rac-BwChqdGx.js} +1 -1
- package/dist/component/{text-area-field-rac-CDEJUPgV.js → text-area-field-rac-VCFJuHx4.js} +5 -5
- package/dist/component/{text-area-rac-CwiF24AW.js → text-area-rac-BICVNsdn.js} +1 -1
- package/dist/component/{text-input-field-rac-vg2b_7it.js → text-input-field-rac-C9gyRhcK.js} +4 -4
- package/dist/component/{text-input-headless-BdD-dAx2.js → text-input-headless-BdkaD-re.js} +3 -3
- package/dist/component/{text-input-rac-yX6rdvri.js → text-input-rac-B7buOGbq.js} +1 -1
- package/dist/component/{time-input-rac-B_kYmOwq.js → time-input-rac-CSFhEYi0.js} +5 -5
- package/dist/component/{url-input-field-rac-NJqyqxLi.js → url-input-field-rac-BIXokgHy.js} +5 -5
- package/dist/component/{url-input-rac-BqIKc9nY.js → url-input-rac-tTN0GaTH.js} +1 -1
- package/dist/component/{use-dropdown-option-class-name-DFW55r3E.js → use-dropdown-option-class-name-C6zB6TNA.js} +3 -3
- package/dist/component/{use-dropdown-trigger-class-name-Df-nqoeG.js → use-dropdown-trigger-class-name-CEq68SuK.js} +2 -2
- package/dist/component/use-element-state-class-name-BFZzVwqe.js +23 -0
- package/dist/component/use-hoverable-input-class-name-CzZmczhf.js +25 -0
- package/dist/component/{use-service-options-base-B64QpFwc.js → use-service-options-base-DOCVW9ax.js} +1 -1
- package/dist/component/use-text-input-class-name-BNX3qkmh.js +6 -0
- package/package.json +2 -2
- package/dist/component/field-rac.module-BIBNQEOK.js +0 -25
- package/dist/component/file-upload-rac-CjBKgUCk.js +0 -561
- package/dist/component/use-element-state-class-name-D008EeZn.js +0 -20
- package/dist/component/use-hoverable-input-class-name-CVtF0FGy.js +0 -23
- package/dist/component/use-text-input-class-name-BSDU7QEO.js +0 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/form-elements",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.134.0",
|
|
4
4
|
"description": "The Wix Forms rendering element for Builder apps, loaded at runtime as @wix/form-elements/Form",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -156,5 +156,5 @@
|
|
|
156
156
|
]
|
|
157
157
|
}
|
|
158
158
|
},
|
|
159
|
-
"falconPackageHash": "
|
|
159
|
+
"falconPackageHash": "252c4549b97ab1e357978a947a98841c846443de071d36a931c2b0cf"
|
|
160
160
|
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
const o = "_label_179ql_1", e = "_requiredMark_179ql_11", t = "_input_179ql_16", n = "_inputGroup_179ql_17", c = "_inputHover_179ql_71", _ = "_innerInput_179ql_132", r = "_dropdownTrigger_179ql_182", p = "_dropdownIcon_179ql_192", l = "_dropdownPopover_179ql_211", s = "_selectPopover_179ql_217", i = "_selectOption_179ql_244", u = "_selectOptionHover_179ql_267", d = "_selectOptionSelected_179ql_271", q = "_selectOptionWithoutFocusRing_179ql_275", h = "_description_179ql_281", b = "_error_179ql_297", k = "_checkbox_179ql_316", v = "_checkboxInput_179ql_339", I = "_checkboxInputSelected_179ql_378", x = "_checkboxInputHover_179ql_382", O = {
|
|
2
|
-
label: o,
|
|
3
|
-
requiredMark: e,
|
|
4
|
-
input: t,
|
|
5
|
-
inputGroup: n,
|
|
6
|
-
inputHover: c,
|
|
7
|
-
innerInput: _,
|
|
8
|
-
dropdownTrigger: r,
|
|
9
|
-
dropdownIcon: p,
|
|
10
|
-
dropdownPopover: l,
|
|
11
|
-
selectPopover: s,
|
|
12
|
-
selectOption: i,
|
|
13
|
-
selectOptionHover: u,
|
|
14
|
-
selectOptionSelected: d,
|
|
15
|
-
selectOptionWithoutFocusRing: q,
|
|
16
|
-
description: h,
|
|
17
|
-
error: b,
|
|
18
|
-
checkbox: k,
|
|
19
|
-
checkboxInput: v,
|
|
20
|
-
checkboxInputSelected: I,
|
|
21
|
-
checkboxInputHover: x
|
|
22
|
-
};
|
|
23
|
-
export {
|
|
24
|
-
O as s
|
|
25
|
-
};
|
|
@@ -1,561 +0,0 @@
|
|
|
1
|
-
import t, { useState as J, useRef as H, useMemo as fe, useEffect as ne, useCallback as M, createContext as xe, useContext as he } from "react";
|
|
2
|
-
import _e from "@wix/editor-react-components/AnimatedIcon";
|
|
3
|
-
import { RicosViewer as Ce } from "@wix/ricos/viewer";
|
|
4
|
-
import R from "classnames";
|
|
5
|
-
import { bd as Le, br as re, bm as Ne, ak as ve, bp as De, ad as ie, bq as Te, be as Ee, bh as k, bj as Se, bb as Be, ba as ye, I as Ze, U as Re, b as Ae, a8 as Me, a9 as ce, p as de, u as ue, v as me, a7 as Ie, f as te } from "./form-GcotNutn.js";
|
|
6
|
-
import { E as Oe } from "./error-icon-hZxQ6DEy.js";
|
|
7
|
-
import { s as K } from "./field-rac.module-BIBNQEOK.js";
|
|
8
|
-
import { u as pe } from "./use-element-state-class-name-D008EeZn.js";
|
|
9
|
-
import { DropZone as we, Text as Ue, FileTrigger as Pe, Button as be, ProgressBar as He, VisuallyHidden as je } from "react-aria-components";
|
|
10
|
-
import { f as C, a as $ } from "./find-child-C60k4CxG.js";
|
|
11
|
-
import { b as ke, a as ze, D as Ve, E as qe } from "./field-error-headless-DwlihJqC.js";
|
|
12
|
-
import { L as Ke } from "./field-label-headless-C_cMy8vP.js";
|
|
13
|
-
const $e = {
|
|
14
|
-
Video: "video/*",
|
|
15
|
-
Image: "image/*",
|
|
16
|
-
Audio: "audio/*",
|
|
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
|
-
Archive: ".zip, .rar, .tar, .tar.gz, .gz, .gzip, .jar, .7z, .fgz, .webarchive",
|
|
19
|
-
Model3D: ".gltf, .glb"
|
|
20
|
-
}, Ye = (e) => {
|
|
21
|
-
const { actions: n, formId: r } = Le();
|
|
22
|
-
return async (a, s, u) => {
|
|
23
|
-
if (!(n != null && n.uploadFile) || !a.length)
|
|
24
|
-
return n != null && n.uploadFile || console.error("No uploadFile action"), a.length || console.error("No files to upload"), [];
|
|
25
|
-
const E = a.map(({ file: o }) => n.uploadFile({
|
|
26
|
-
file: o,
|
|
27
|
-
formId: r,
|
|
28
|
-
uploadTarget: e
|
|
29
|
-
}).then((i) => {
|
|
30
|
-
const { id: N, displayName: m, url: p, isPrivate: d } = i, v = {
|
|
31
|
-
fileId: N,
|
|
32
|
-
displayName: m || o.name,
|
|
33
|
-
url: d ? void 0 : p,
|
|
34
|
-
fileType: o.type || "application/octet-stream"
|
|
35
|
-
};
|
|
36
|
-
return s({
|
|
37
|
-
file: o,
|
|
38
|
-
uploadedFile: v
|
|
39
|
-
}), v;
|
|
40
|
-
}).catch((i) => {
|
|
41
|
-
u(i, o);
|
|
42
|
-
}));
|
|
43
|
-
return (await Promise.all(E)).filter((o) => o !== void 0);
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
function We({ valueSliderLimit: e, value: n, explanationText: r, target: a, onChange: s, uploadFileFormats: u, onBlur: E, onFilesCleared: L }) {
|
|
47
|
-
const [o, i] = J(Qe(n)), [N, m] = J(n || []), [p, d] = J(), v = Ye(a), { t: h } = re(), F = Ne().includes(ve.BUTTONS_HOVER), { setFormStatus: T } = De(), y = H(!1), c = H(s);
|
|
48
|
-
c.current = s;
|
|
49
|
-
const S = fe(() => o.some((f) => f.state === "uploading"), [
|
|
50
|
-
o
|
|
51
|
-
]);
|
|
52
|
-
ne(() => {
|
|
53
|
-
y.current !== S && (y.current = S, T(a, S ? ie.BUSY : ie.READY));
|
|
54
|
-
}, [
|
|
55
|
-
S,
|
|
56
|
-
T,
|
|
57
|
-
a
|
|
58
|
-
]);
|
|
59
|
-
const Z = M(() => {
|
|
60
|
-
if (!o.length)
|
|
61
|
-
return;
|
|
62
|
-
const x = o.filter((f) => f.state === "uploading").length;
|
|
63
|
-
if (x) {
|
|
64
|
-
const f = o.filter((b) => b.state === "uploaded" && b.file.size > 0).length, _ = f / (f + x);
|
|
65
|
-
return h("form.file-upload.uploading", {
|
|
66
|
-
count: Math.round(_ * 100)
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
return h("form.file-upload.explanation-text", {
|
|
70
|
-
count: o.length
|
|
71
|
-
});
|
|
72
|
-
}, [
|
|
73
|
-
o,
|
|
74
|
-
h
|
|
75
|
-
]), B = M(() => o.length ? o.some((f) => f.state === "uploading") ? Z() : r || Z() : r, [
|
|
76
|
-
o,
|
|
77
|
-
r,
|
|
78
|
-
Z
|
|
79
|
-
]), V = M(async (x) => {
|
|
80
|
-
await v(x, ({ file: f, uploadedFile: _ }) => {
|
|
81
|
-
i((b) => b.map((g) => g.file === f ? {
|
|
82
|
-
file: f,
|
|
83
|
-
state: "uploaded"
|
|
84
|
-
} : g)), m((b) => {
|
|
85
|
-
var w;
|
|
86
|
-
const g = [
|
|
87
|
-
...b
|
|
88
|
-
].concat(_);
|
|
89
|
-
return (w = c.current) == null || w.call(c, g), g;
|
|
90
|
-
});
|
|
91
|
-
}, (f, _) => {
|
|
92
|
-
i((b) => b.map((g) => g.file === _ ? {
|
|
93
|
-
file: _,
|
|
94
|
-
state: "error",
|
|
95
|
-
errorMessage: h("form.file-upload.error.upload-failed")
|
|
96
|
-
} : g));
|
|
97
|
-
});
|
|
98
|
-
}, [
|
|
99
|
-
v,
|
|
100
|
-
h
|
|
101
|
-
]), O = async (x) => {
|
|
102
|
-
if (p && d(void 0), x) {
|
|
103
|
-
if (o.length + x.length > e) {
|
|
104
|
-
d(h("form.file-upload.error.upload-limit", {
|
|
105
|
-
limit: e
|
|
106
|
-
}));
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
const b = Array.from(x).reduce((g, w) => (o.some((U) => U.file.name === w.name) || g.push({
|
|
110
|
-
file: w,
|
|
111
|
-
state: "uploading"
|
|
112
|
-
}), g), []);
|
|
113
|
-
i([
|
|
114
|
-
...o,
|
|
115
|
-
...b
|
|
116
|
-
]), await V(b);
|
|
117
|
-
}
|
|
118
|
-
}, q = (x) => {
|
|
119
|
-
const f = o[x];
|
|
120
|
-
if (N && s && f.state !== "error") {
|
|
121
|
-
const _ = N.filter((g) => g.displayName !== f.file.name);
|
|
122
|
-
s(_), m(_);
|
|
123
|
-
const b = o.filter((g) => g.file.name !== f.file.name);
|
|
124
|
-
i(b), b.length === 0 && L();
|
|
125
|
-
} else {
|
|
126
|
-
const _ = o.filter((b) => b !== f);
|
|
127
|
-
i(_), _.length === 0 && L();
|
|
128
|
-
}
|
|
129
|
-
}, Y = () => {
|
|
130
|
-
p && d(void 0), E();
|
|
131
|
-
}, W = u.map((x) => $e[x]).join(), X = M(() => {
|
|
132
|
-
i([]), m([]);
|
|
133
|
-
}, []);
|
|
134
|
-
return Te(X), {
|
|
135
|
-
files: o,
|
|
136
|
-
limitError: p,
|
|
137
|
-
hover: F,
|
|
138
|
-
getExplanationText: B,
|
|
139
|
-
getStatusText: Z,
|
|
140
|
-
handleChange: O,
|
|
141
|
-
handleDelete: q,
|
|
142
|
-
accept: W,
|
|
143
|
-
handleBlur: Y
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
function Qe(e = []) {
|
|
147
|
-
const n = e || [];
|
|
148
|
-
try {
|
|
149
|
-
return n.map((r) => ({
|
|
150
|
-
file: new File([
|
|
151
|
-
new Int8Array(0)
|
|
152
|
-
], r.displayName, {
|
|
153
|
-
type: r.fileType
|
|
154
|
-
}),
|
|
155
|
-
state: "uploaded"
|
|
156
|
-
}));
|
|
157
|
-
} catch (r) {
|
|
158
|
-
console.error(r);
|
|
159
|
-
}
|
|
160
|
-
return [];
|
|
161
|
-
}
|
|
162
|
-
const Fe = /* @__PURE__ */ xe(void 0);
|
|
163
|
-
function z() {
|
|
164
|
-
const e = he(Fe);
|
|
165
|
-
if (typeof e > "u")
|
|
166
|
-
throw new Error("FileUpload components must be used within FileUpload");
|
|
167
|
-
return e;
|
|
168
|
-
}
|
|
169
|
-
const j = ({ children: e, className: n }) => {
|
|
170
|
-
const { ariaDescribedBy: r } = Ee(), { disabled: a, hasError: s } = k(), { handleFileChange: u, limitReached: E } = z();
|
|
171
|
-
if (E)
|
|
172
|
-
return null;
|
|
173
|
-
const L = C(e, j.Title), o = C(e, j.Subtitle), i = C(e, j.Button);
|
|
174
|
-
return /* @__PURE__ */ t.createElement(we, {
|
|
175
|
-
"aria-describedby": r,
|
|
176
|
-
className: n,
|
|
177
|
-
"data-invalid": s,
|
|
178
|
-
isDisabled: a,
|
|
179
|
-
onDrop: async (N) => {
|
|
180
|
-
const m = [];
|
|
181
|
-
for (const p of N.items)
|
|
182
|
-
if (p.kind === "file") {
|
|
183
|
-
const d = await p.getFile();
|
|
184
|
-
d && m.push(d);
|
|
185
|
-
}
|
|
186
|
-
if (m.length > 0) {
|
|
187
|
-
const p = new DataTransfer();
|
|
188
|
-
m.forEach((d) => p.items.add(d)), u(p.files);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}, /* @__PURE__ */ t.createElement(Ue, {
|
|
192
|
-
slot: "label"
|
|
193
|
-
}, L, o), i);
|
|
194
|
-
}, Ge = ({ className: e, children: n }) => {
|
|
195
|
-
const { limitReached: r } = z();
|
|
196
|
-
return /* @__PURE__ */ t.createElement("p", {
|
|
197
|
-
className: e
|
|
198
|
-
}, n({
|
|
199
|
-
limitReached: r
|
|
200
|
-
}));
|
|
201
|
-
}, Je = ({ className: e, children: n }) => {
|
|
202
|
-
const { limitReached: r } = z(), { explanationText: a } = k();
|
|
203
|
-
return /* @__PURE__ */ t.createElement("p", {
|
|
204
|
-
className: e
|
|
205
|
-
}, a || n({
|
|
206
|
-
limitReached: r
|
|
207
|
-
}));
|
|
208
|
-
}, oe = ({ className: e, children: n, "aria-roledescription": r, onHoverStart: a, onHoverEnd: s }) => {
|
|
209
|
-
const { ariaDescribedBy: u, inputId: E, labelId: L, errorId: o } = Ee(), { disabled: i, required: N, onFocus: m, hasError: p, errorMessage: d } = k(), { handleFileChange: v, accept: h, multiple: I, buttonRef: F, handleBlur: T, limitError: y, files: c } = z(), S = (c == null ? void 0 : c.some((B) => B.errorMessage)) ?? !1, Z = !!(p || d || y || S);
|
|
210
|
-
return /* @__PURE__ */ t.createElement(Pe, {
|
|
211
|
-
acceptedFileTypes: h ? h.split(",") : void 0,
|
|
212
|
-
allowsMultiple: I,
|
|
213
|
-
onSelect: (B) => {
|
|
214
|
-
if (B) {
|
|
215
|
-
const V = Array.from(B), O = new DataTransfer();
|
|
216
|
-
V.forEach((q) => O.items.add(q)), v(O.files);
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
}, /* @__PURE__ */ t.createElement(be, {
|
|
220
|
-
ref: F,
|
|
221
|
-
id: E,
|
|
222
|
-
"aria-labelledby": L,
|
|
223
|
-
"aria-describedby": [
|
|
224
|
-
u,
|
|
225
|
-
o
|
|
226
|
-
].filter(Boolean).join(" "),
|
|
227
|
-
render: (B) => /* @__PURE__ */ t.createElement("button", {
|
|
228
|
-
...B,
|
|
229
|
-
"aria-roledescription": r,
|
|
230
|
-
"aria-invalid": Z || void 0,
|
|
231
|
-
"aria-required": N
|
|
232
|
-
}),
|
|
233
|
-
isDisabled: i,
|
|
234
|
-
className: e,
|
|
235
|
-
onFocus: m,
|
|
236
|
-
onBlur: T,
|
|
237
|
-
onHoverStart: a,
|
|
238
|
-
onHoverEnd: s
|
|
239
|
-
}, n));
|
|
240
|
-
}, Xe = ({ className: e }) => {
|
|
241
|
-
const { buttonText: n } = k();
|
|
242
|
-
return /* @__PURE__ */ t.createElement("span", {
|
|
243
|
-
className: e
|
|
244
|
-
}, n);
|
|
245
|
-
};
|
|
246
|
-
oe.Text = Xe;
|
|
247
|
-
j.Title = Ge;
|
|
248
|
-
j.Subtitle = Je;
|
|
249
|
-
j.Button = oe;
|
|
250
|
-
const A = ({ children: e, className: n, ...r }) => {
|
|
251
|
-
const { file: a, index: s } = r, u = a.file.name, E = C(e, A.Name), L = C(e, A.Remove), o = C(e, A.Spinner), i = C(e, A.Error);
|
|
252
|
-
return /* @__PURE__ */ t.createElement("div", {
|
|
253
|
-
className: n
|
|
254
|
-
}, $(E, {
|
|
255
|
-
fileName: u
|
|
256
|
-
}), a.state === "uploading" ? o : $(L, {
|
|
257
|
-
index: s,
|
|
258
|
-
fileName: u
|
|
259
|
-
}), a.errorMessage && $(i, {
|
|
260
|
-
errorMessage: a.errorMessage
|
|
261
|
-
}));
|
|
262
|
-
}, et = ({ className: e, ...n }) => {
|
|
263
|
-
const { fileName: r } = n;
|
|
264
|
-
return /* @__PURE__ */ t.createElement("span", {
|
|
265
|
-
className: e
|
|
266
|
-
}, r);
|
|
267
|
-
}, tt = ({ className: e, "aria-label": n, children: r, ...a }) => {
|
|
268
|
-
const { fileName: s, index: u } = a, { disabled: E } = k(), { handleDelete: L, fileRemoveButtonRefs: o } = z(), i = H(null);
|
|
269
|
-
ne(() => {
|
|
270
|
-
const m = o.current, p = s;
|
|
271
|
-
return m[p] = i, () => {
|
|
272
|
-
m[p] === i && (m[p] = void 0);
|
|
273
|
-
};
|
|
274
|
-
}, [
|
|
275
|
-
s,
|
|
276
|
-
o
|
|
277
|
-
]);
|
|
278
|
-
const N = () => {
|
|
279
|
-
L(u);
|
|
280
|
-
};
|
|
281
|
-
return /* @__PURE__ */ t.createElement(be, {
|
|
282
|
-
ref: i,
|
|
283
|
-
"aria-disabled": E,
|
|
284
|
-
"aria-label": n,
|
|
285
|
-
"aria-description": s,
|
|
286
|
-
onClick: N,
|
|
287
|
-
className: e,
|
|
288
|
-
isDisabled: E
|
|
289
|
-
}, r);
|
|
290
|
-
}, ge = ({ className: e, children: n, ...r }) => {
|
|
291
|
-
const { errorMessage: a } = r;
|
|
292
|
-
return a ? /* @__PURE__ */ t.createElement(ze, {
|
|
293
|
-
value: a
|
|
294
|
-
}, /* @__PURE__ */ t.createElement("div", {
|
|
295
|
-
className: e,
|
|
296
|
-
role: "alert"
|
|
297
|
-
}, n)) : null;
|
|
298
|
-
}, nt = ({ className: e, "aria-label": n, children: r }) => /* @__PURE__ */ t.createElement(He, {
|
|
299
|
-
"aria-label": n,
|
|
300
|
-
className: e,
|
|
301
|
-
isIndeterminate: !0
|
|
302
|
-
}, r);
|
|
303
|
-
A.Name = et;
|
|
304
|
-
A.Remove = tt;
|
|
305
|
-
A.Spinner = nt;
|
|
306
|
-
A.Error = ge;
|
|
307
|
-
ge.Text = ke;
|
|
308
|
-
const ae = ({ children: e, className: n }) => {
|
|
309
|
-
const { files: r } = z(), a = C(e, ae.File);
|
|
310
|
-
return !r || r.length === 0 ? null : /* @__PURE__ */ t.createElement("div", {
|
|
311
|
-
className: n
|
|
312
|
-
}, r.map((s, u) => $(a, {
|
|
313
|
-
key: s.file.name || u,
|
|
314
|
-
file: s,
|
|
315
|
-
index: u
|
|
316
|
-
})));
|
|
317
|
-
};
|
|
318
|
-
ae.File = A;
|
|
319
|
-
const G = (e) => e.file.name, l = ({ children: e }) => {
|
|
320
|
-
const { t: n } = re(), { id: r, value: a, onChange: s, uploadFileFormats: u, valueSliderLimit: E, target: L, explanationText: o, onBlur: i, hasError: N, errorMessage: m, FieldLayout: p } = k(), d = H(null), v = H({}), h = H(!1), I = M(() => {
|
|
321
|
-
d.current ? d.current.focus() : h.current = !0;
|
|
322
|
-
}, []), { files: F, limitError: T, hover: y, getExplanationText: c, getStatusText: S, handleBlur: Z, handleChange: B, handleDelete: V, accept: O } = We({
|
|
323
|
-
valueSliderLimit: E,
|
|
324
|
-
value: a,
|
|
325
|
-
explanationText: o,
|
|
326
|
-
target: L,
|
|
327
|
-
onChange: s,
|
|
328
|
-
uploadFileFormats: u,
|
|
329
|
-
onBlur: i,
|
|
330
|
-
onFilesCleared: I
|
|
331
|
-
}), q = M((U) => {
|
|
332
|
-
var se;
|
|
333
|
-
const Q = F[U], P = G(Q);
|
|
334
|
-
F.length > 1 && ((se = (F.filter((ee) => G(ee) !== P).map((ee) => v.current[G(ee)]).find(Boolean) ?? d).current) == null || se.focus()), V(U);
|
|
335
|
-
}, [
|
|
336
|
-
V,
|
|
337
|
-
F
|
|
338
|
-
]);
|
|
339
|
-
ne(() => {
|
|
340
|
-
h.current && d.current && (h.current = !1, d.current.focus());
|
|
341
|
-
}, [
|
|
342
|
-
F
|
|
343
|
-
]);
|
|
344
|
-
const Y = E > 1, W = F.length >= E, X = fe(() => ({
|
|
345
|
-
handleFileChange: B,
|
|
346
|
-
handleBlur: Z,
|
|
347
|
-
handleDelete: q,
|
|
348
|
-
files: F,
|
|
349
|
-
accept: O,
|
|
350
|
-
limitReached: W,
|
|
351
|
-
multiple: Y,
|
|
352
|
-
getExplanationText: c,
|
|
353
|
-
getStatusText: S,
|
|
354
|
-
hover: y,
|
|
355
|
-
limitError: T,
|
|
356
|
-
buttonRef: d,
|
|
357
|
-
fileRemoveButtonRefs: v
|
|
358
|
-
}), [
|
|
359
|
-
B,
|
|
360
|
-
Z,
|
|
361
|
-
q,
|
|
362
|
-
F,
|
|
363
|
-
O,
|
|
364
|
-
W,
|
|
365
|
-
Y,
|
|
366
|
-
c,
|
|
367
|
-
S,
|
|
368
|
-
y,
|
|
369
|
-
T
|
|
370
|
-
]), x = C(e, l.Label), f = C(e, l.DropZone), _ = C(e, l.Button), b = C(e, l.Explanation), g = C(e, l.Files), w = C(e, l.Description), le = C(e, l.Error);
|
|
371
|
-
return Se(() => {
|
|
372
|
-
var U, Q;
|
|
373
|
-
if (d.current) {
|
|
374
|
-
d.current.focus();
|
|
375
|
-
return;
|
|
376
|
-
}
|
|
377
|
-
(Q = (U = F.map((P) => v.current[G(P)]).find((P) => P == null ? void 0 : P.current)) == null ? void 0 : U.current) == null || Q.focus();
|
|
378
|
-
}, r), /* @__PURE__ */ t.createElement(Fe.Provider, {
|
|
379
|
-
value: X
|
|
380
|
-
}, /* @__PURE__ */ t.createElement(p, {
|
|
381
|
-
fieldId: r,
|
|
382
|
-
renderLabel: () => x,
|
|
383
|
-
renderInput: () => f ?? _,
|
|
384
|
-
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, $(le, {
|
|
385
|
-
hasError: !!(N || T),
|
|
386
|
-
errorMessage: T ?? m
|
|
387
|
-
}), /* @__PURE__ */ t.createElement(je, {
|
|
388
|
-
role: "status",
|
|
389
|
-
"aria-live": "polite",
|
|
390
|
-
"aria-atomic": "true"
|
|
391
|
-
}, n("form.file-upload.explanation-text", {
|
|
392
|
-
count: F.length
|
|
393
|
-
})), b, g, w)
|
|
394
|
-
}));
|
|
395
|
-
}, rt = ({ className: e, showUploadStatusOnly: n }) => {
|
|
396
|
-
const { files: r, getExplanationText: a, getStatusText: s } = z(), u = n ? s() : a();
|
|
397
|
-
return r.length === 1 || !u ? null : /* @__PURE__ */ t.createElement("p", {
|
|
398
|
-
className: e
|
|
399
|
-
}, u);
|
|
400
|
-
};
|
|
401
|
-
l.Label = Ke;
|
|
402
|
-
l.DropZone = j;
|
|
403
|
-
l.Button = oe;
|
|
404
|
-
l.Explanation = rt;
|
|
405
|
-
l.Files = ae;
|
|
406
|
-
l.Description = Ve;
|
|
407
|
-
l.Error = qe;
|
|
408
|
-
const ot = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
409
|
-
viewBox: "0 0 24 24",
|
|
410
|
-
width: 24,
|
|
411
|
-
height: 24,
|
|
412
|
-
fill: "currentColor",
|
|
413
|
-
"aria-hidden": "true",
|
|
414
|
-
...e
|
|
415
|
-
}, /* @__PURE__ */ t.createElement("path", {
|
|
416
|
-
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"
|
|
417
|
-
})), at = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
418
|
-
viewBox: "0 0 24 24",
|
|
419
|
-
width: 24,
|
|
420
|
-
height: 24,
|
|
421
|
-
fill: "currentColor",
|
|
422
|
-
"aria-hidden": "true",
|
|
423
|
-
...e
|
|
424
|
-
}, /* @__PURE__ */ t.createElement("path", {
|
|
425
|
-
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"
|
|
426
|
-
})), lt = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
427
|
-
viewBox: "0 0 24 24",
|
|
428
|
-
width: 24,
|
|
429
|
-
height: 24,
|
|
430
|
-
fill: "currentColor",
|
|
431
|
-
"aria-hidden": "true",
|
|
432
|
-
...e
|
|
433
|
-
}, /* @__PURE__ */ t.createElement("path", {
|
|
434
|
-
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"
|
|
435
|
-
})), st = () => {
|
|
436
|
-
const n = "calc(50% - 2px)";
|
|
437
|
-
return /* @__PURE__ */ t.createElement("svg", {
|
|
438
|
-
fill: "none",
|
|
439
|
-
width: "100%",
|
|
440
|
-
height: "100%",
|
|
441
|
-
viewBox: "0 0 32 32"
|
|
442
|
-
}, /* @__PURE__ */ t.createElement("circle", {
|
|
443
|
-
cx: "50%",
|
|
444
|
-
cy: "50%",
|
|
445
|
-
r: n
|
|
446
|
-
}), /* @__PURE__ */ t.createElement("circle", {
|
|
447
|
-
cx: "50%",
|
|
448
|
-
cy: "50%",
|
|
449
|
-
r: n,
|
|
450
|
-
// Normalize the path length to 100 so we can easily set stroke-dashoffset to a fixed arc.
|
|
451
|
-
pathLength: "100",
|
|
452
|
-
// Add extra gap between dashes so the arc reads correctly in Chrome.
|
|
453
|
-
strokeDasharray: "100 200",
|
|
454
|
-
strokeDashoffset: 75,
|
|
455
|
-
strokeLinecap: "round",
|
|
456
|
-
style: {
|
|
457
|
-
rotate: "-90deg",
|
|
458
|
-
transformOrigin: "center center"
|
|
459
|
-
}
|
|
460
|
-
}, /* @__PURE__ */ t.createElement("animateTransform", {
|
|
461
|
-
attributeName: "transform",
|
|
462
|
-
type: "rotate",
|
|
463
|
-
dur: "0.75s",
|
|
464
|
-
values: "0;360",
|
|
465
|
-
repeatCount: "indefinite"
|
|
466
|
-
})));
|
|
467
|
-
}, it = "_dropZone_cj70x_1", ct = "_dropZoneHover_cj70x_30", dt = "_dropZoneTitle_cj70x_55", ut = "_dropZoneSubtitle_cj70x_60", mt = "_button_cj70x_64", pt = "_buttonHover_cj70x_114", ft = "_explanation_cj70x_131", Et = "_files_cj70x_135", bt = "_file_cj70x_135", Ft = "_fileName_cj70x_185", gt = "_removeButton_cj70x_193", xt = "_spinner_cj70x_234", ht = "_fileError_cj70x_250", D = {
|
|
468
|
-
dropZone: it,
|
|
469
|
-
dropZoneHover: ct,
|
|
470
|
-
dropZoneTitle: dt,
|
|
471
|
-
dropZoneSubtitle: ut,
|
|
472
|
-
button: mt,
|
|
473
|
-
buttonHover: pt,
|
|
474
|
-
explanation: ft,
|
|
475
|
-
files: Et,
|
|
476
|
-
file: bt,
|
|
477
|
-
fileName: Ft,
|
|
478
|
-
removeButton: gt,
|
|
479
|
-
spinner: xt,
|
|
480
|
-
fileError: ht
|
|
481
|
-
}, _t = ({ content: e, locale: n }) => /* @__PURE__ */ t.createElement(Ce, {
|
|
482
|
-
content: e,
|
|
483
|
-
locale: n
|
|
484
|
-
}), Ct = () => {
|
|
485
|
-
var I, F, T, y;
|
|
486
|
-
const { t: e } = re(), { disabled: n, readOnly: r } = k(), a = !n && !r, s = pe({
|
|
487
|
-
globalClasses: ue,
|
|
488
|
-
moduleClasses: {
|
|
489
|
-
base: D.dropZone,
|
|
490
|
-
hover: D.dropZoneHover
|
|
491
|
-
}
|
|
492
|
-
}), u = pe({
|
|
493
|
-
globalClasses: Ie,
|
|
494
|
-
moduleClasses: {
|
|
495
|
-
base: D.button,
|
|
496
|
-
hover: D.buttonHover
|
|
497
|
-
}
|
|
498
|
-
}), E = (y = (T = (F = (I = Be().dropZone) == null ? void 0 : I.elementProps) == null ? void 0 : F.uploadButton) == null ? void 0 : T.elementProps) == null ? void 0 : y.icon, { wix: L, className: o, ...i } = E ?? {}, N = ye(te.DROP_ZONE, te.UPLOAD_BUTTON, te.UPLOAD_BUTTON_LABEL), m = H(null), [p, d] = J(!1), v = M(() => {
|
|
499
|
-
var c;
|
|
500
|
-
d(!0), (c = m.current) == null || c.runAnimationForward();
|
|
501
|
-
}, []), h = M(() => {
|
|
502
|
-
var c;
|
|
503
|
-
d(!1), (c = m.current) == null || c.runAnimationBackward();
|
|
504
|
-
}, []);
|
|
505
|
-
return /* @__PURE__ */ t.createElement(l, null, /* @__PURE__ */ t.createElement(l.Label, {
|
|
506
|
-
className: R(Ze, K.label)
|
|
507
|
-
}, /* @__PURE__ */ t.createElement(l.Label.Required, {
|
|
508
|
-
className: R(Re, K.requiredMark)
|
|
509
|
-
})), /* @__PURE__ */ t.createElement(l.DropZone, {
|
|
510
|
-
className: ({ isHovered: c, isDropTarget: S }) => s({
|
|
511
|
-
isSelected: !1,
|
|
512
|
-
isHovered: c || S,
|
|
513
|
-
isInteractive: a
|
|
514
|
-
})
|
|
515
|
-
}, /* @__PURE__ */ t.createElement(l.DropZone.Title, {
|
|
516
|
-
className: D.dropZoneTitle
|
|
517
|
-
}, ({ limitReached: c }) => e(c ? "file-upload.dropzone.limit-reached.title" : "file-upload.dropzone.title")), /* @__PURE__ */ t.createElement(l.DropZone.Subtitle, {
|
|
518
|
-
className: D.dropZoneSubtitle
|
|
519
|
-
}, ({ limitReached: c }) => e(c ? "file-upload.dropzone.limit-reached.subtitle" : "file-upload.dropzone.subtitle")), /* @__PURE__ */ t.createElement(l.DropZone.Button, {
|
|
520
|
-
className: ({ isHovered: c }) => u({
|
|
521
|
-
isSelected: !1,
|
|
522
|
-
isHovered: c,
|
|
523
|
-
isInteractive: a
|
|
524
|
-
}),
|
|
525
|
-
"aria-roledescription": e("file-upload.aria-roledescription"),
|
|
526
|
-
onHoverStart: v,
|
|
527
|
-
onHoverEnd: h
|
|
528
|
-
}, i.svg ? /* @__PURE__ */ t.createElement(_e, {
|
|
529
|
-
...i,
|
|
530
|
-
ref: m,
|
|
531
|
-
className: R(Ae, Me, o)
|
|
532
|
-
}) : E ? null : /* @__PURE__ */ t.createElement(ot, null), /* @__PURE__ */ t.createElement(l.DropZone.Button.Text, {
|
|
533
|
-
className: R(ce.base, N, {
|
|
534
|
-
[ce.hover]: a && p
|
|
535
|
-
})
|
|
536
|
-
}))), /* @__PURE__ */ t.createElement(l.Explanation, {
|
|
537
|
-
className: R(de, K.description, D.explanation),
|
|
538
|
-
showUploadStatusOnly: !0
|
|
539
|
-
}), /* @__PURE__ */ t.createElement(l.Files, {
|
|
540
|
-
className: D.files
|
|
541
|
-
}, /* @__PURE__ */ t.createElement(l.Files.File, {
|
|
542
|
-
className: R(ue.base, D.file)
|
|
543
|
-
}, /* @__PURE__ */ t.createElement(l.Files.File.Name, {
|
|
544
|
-
className: D.fileName
|
|
545
|
-
}), /* @__PURE__ */ t.createElement(l.Files.File.Spinner, {
|
|
546
|
-
className: D.spinner,
|
|
547
|
-
"aria-label": e("file-upload.file.uploading-spinner.aria-label")
|
|
548
|
-
}, /* @__PURE__ */ t.createElement(st, null)), /* @__PURE__ */ t.createElement(l.Files.File.Remove, {
|
|
549
|
-
className: D.removeButton,
|
|
550
|
-
"aria-label": e("file-upload.delete-file.aria-label")
|
|
551
|
-
}, /* @__PURE__ */ t.createElement(lt, null)), /* @__PURE__ */ t.createElement(l.Files.File.Error, {
|
|
552
|
-
className: R(me, K.error, D.fileError)
|
|
553
|
-
}, /* @__PURE__ */ t.createElement(at, null), /* @__PURE__ */ t.createElement(l.Files.File.Error.Text, null)))), /* @__PURE__ */ t.createElement(l.Description, {
|
|
554
|
-
className: R(de, K.description)
|
|
555
|
-
}, _t), /* @__PURE__ */ t.createElement(l.Error, {
|
|
556
|
-
className: R(me, K.error)
|
|
557
|
-
}, /* @__PURE__ */ t.createElement(Oe, null), /* @__PURE__ */ t.createElement(l.Error.Text, null)));
|
|
558
|
-
}, Ot = () => /* @__PURE__ */ t.createElement(Ct, null);
|
|
559
|
-
export {
|
|
560
|
-
Ot as FileUploadRAC
|
|
561
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import p from "classnames";
|
|
2
|
-
import { ba as E, aJ as f } from "./form-GcotNutn.js";
|
|
3
|
-
const J = ({ globalClasses: e, moduleClasses: c }) => {
|
|
4
|
-
var d;
|
|
5
|
-
const r = ((d = E(...f(e))) == null ? void 0 : d.split(/\s+/)) ?? [], h = [
|
|
6
|
-
e.selected,
|
|
7
|
-
e.hover
|
|
8
|
-
], o = !!e.selected && r.includes(e.selected), u = r.includes(e.hover);
|
|
9
|
-
return ({ isSelected: m, isHovered: n, isInteractive: t = !0 }) => p(e.base, c.base, t ? r : r.filter((N) => !h.includes(N)), {
|
|
10
|
-
[e.hover]: t && n,
|
|
11
|
-
[c.hover]: t && (n || u)
|
|
12
|
-
}, e.selected && {
|
|
13
|
-
[e.selected]: t && m
|
|
14
|
-
}, c.selected && {
|
|
15
|
-
[c.selected]: t && (m || o)
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
export {
|
|
19
|
-
J as u
|
|
20
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { bh as i } from "./form-GcotNutn.js";
|
|
2
|
-
import { s as e } from "./field-rac.module-BIBNQEOK.js";
|
|
3
|
-
import { u as m } from "./use-element-state-class-name-D008EeZn.js";
|
|
4
|
-
const d = (s, a) => {
|
|
5
|
-
const { disabled: t, readOnly: o } = i(), r = m({
|
|
6
|
-
globalClasses: s,
|
|
7
|
-
moduleClasses: {
|
|
8
|
-
base: [
|
|
9
|
-
e.input,
|
|
10
|
-
...a
|
|
11
|
-
].join(" "),
|
|
12
|
-
hover: e.inputHover
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
return ({ isHovered: l }) => r({
|
|
16
|
-
isSelected: !1,
|
|
17
|
-
isHovered: l,
|
|
18
|
-
isInteractive: !t && !o
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
export {
|
|
22
|
-
d as u
|
|
23
|
-
};
|