@wix/form-elements 1.62.0 → 1.63.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-B1VVk_Ui.js} +3 -3
- package/dist/component/{bookings-address-rac-E-qq4-KG.js → bookings-address-rac-IQeHFdHT.js} +1 -1
- package/dist/component/{bookings-email-rac-DA_Hwn2j.js → bookings-email-rac-z26A790r.js} +1 -1
- package/dist/component/{bookings-first-name-rac-o1n3lnRo.js → bookings-first-name-rac-Djf0GPP4.js} +1 -1
- package/dist/component/{bookings-header-rac-DQ0YvhxZ.js → bookings-header-rac-CXOzAOpz.js} +1 -1
- package/dist/component/{bookings-last-name-rac-BqL_84Sg.js → bookings-last-name-rac-CbB8alM9.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-CAN7roRc.js → bookings-login-bar-rac-CXrLx7Pn.js} +16 -16
- package/dist/component/{bookings-phone-rac-CCJVdvkd.js → bookings-phone-rac-DGYx7h5g.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-CCklquEC.js → bookings-rich-text-rac-viJG57XF.js} +1 -1
- package/dist/component/checkbox-field-rac-e-RAmupX.js +1312 -0
- package/dist/component/{checkbox-group-field-headless-EGVW3vG0.js → checkbox-group-field-headless-Cvia4lL6.js} +30 -30
- package/dist/component/{checkbox-group-field-rac-DUDWNOwV.js → checkbox-group-field-rac-BXxk90dk.js} +1 -1
- package/dist/component/{checkbox-group-rac-DWPClKpf.js → checkbox-group-rac-CDfDTWqz.js} +1 -1
- package/dist/component/{checkbox-rac-CvbOws2U.js → checkbox-rac-BRBKYD_5.js} +1 -1
- package/dist/component/{contacts-address-rac-CWFHC5LT.js → contacts-address-rac-BtWWQi77.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-DPmJPp8M.js → contacts-birthdate-rac-DaEUXJTf.js} +1 -1
- package/dist/component/{contacts-company-rac-UWP9uDqI.js → contacts-company-rac-IgRyjtcM.js} +1 -1
- package/dist/component/{contacts-email-rac-BCkkWYhr.js → contacts-email-rac-BS1MDrMk.js} +1 -1
- package/dist/component/{contacts-first-name-rac-KNRf92yT.js → contacts-first-name-rac-BAvXypDF.js} +1 -1
- package/dist/component/{contacts-last-name-rac-C_EotEpo.js → contacts-last-name-rac-C289RYPl.js} +1 -1
- package/dist/component/{contacts-phone-rac-DJGEWLsl.js → contacts-phone-rac-DIpyskam.js} +1 -1
- package/dist/component/{contacts-position-rac-s1pZ662O.js → contacts-position-rac-nPeh3lKU.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-D_2wIX9p.js → contacts-subscribe-rac-Ci5OLk68.js} +1 -1
- package/dist/component/{contacts-tax-id-rac-3MUvKEqW.js → contacts-tax-id-rac-C4WB-SR0.js} +1 -1
- package/dist/component/{date-availability-CRsSX5_d.js → date-availability-HHjPx4Uv.js} +1 -1
- package/dist/component/{date-input-field-rac-DPo7waqI.js → date-input-field-rac-GFgFcpX2.js} +17 -17
- package/dist/component/{date-input-rac-DsY8ehb1.js → date-input-rac-B9BUEIA-.js} +1 -1
- package/dist/component/{date-picker-field-rac-BtzlxVDB.js → date-picker-field-rac-BfjYIIuY.js} +4 -4
- package/dist/component/{date-picker-rac-C-Aw6W87.js → date-picker-rac-Bd2UN0ZF.js} +1 -1
- package/dist/component/{date-time-input-field-rac-zre1vJ2m.js → date-time-input-field-rac-CAXnxLQP.js} +78 -78
- package/dist/component/{date-time-input-rac-CUvTUzbT.js → date-time-input-rac-BuJ3Awlh.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-D4mhJU8E.js → dext-checkbox-group-rac-DKp4cBVa.js} +2 -2
- package/dist/component/{dext-checkbox-rac-BeYmKpAZ.js → dext-checkbox-rac-BMu_k06A.js} +1 -1
- package/dist/component/{dext-date-picker-rac-Mr0M3sNQ.js → dext-date-picker-rac-L3sdldhT.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-dgxfrHUw.js → dext-date-time-input-rac-UmabFzDN.js} +1 -1
- package/dist/component/{dext-dropdown-rac-CdZOoA5M.js → dext-dropdown-rac-DbjgYaG-.js} +1 -1
- package/dist/component/{dext-email-rac-TBiHlKjv.js → dext-email-rac-rNudrOOK.js} +1 -1
- package/dist/component/{dext-number-input-rac-S78swyZ9.js → dext-number-input-rac-hw1FTrJL.js} +1 -1
- package/dist/component/{dext-phone-rac-BhIaSHez.js → dext-phone-rac-DrZ_Vwv2.js} +1 -1
- package/dist/component/{dext-radio-group-rac-B4xG4N8A.js → dext-radio-group-rac-DAt2ax-I.js} +2 -2
- package/dist/component/{dext-rating-input-rac-Bp2Pi5cP.js → dext-rating-input-rac-BW2Ike11.js} +1 -1
- package/dist/component/{dext-tags-rac-Bnjgmyk-.js → dext-tags-rac-DDzwlKrR.js} +2 -2
- package/dist/component/{dext-text-area-rac-f1nJTM_n.js → dext-text-area-rac-D0xf4z3z.js} +1 -1
- package/dist/component/{dext-text-input-rac-B9m6oI-e.js → dext-text-input-rac-Da04OLmq.js} +1 -1
- package/dist/component/{dext-url-input-rac-CfEUdRdY.js → dext-url-input-rac-B-g4xTqh.js} +1 -1
- package/dist/component/{donation-rac-BqKbQD_H.js → donation-rac-gKeq72jg.js} +10 -10
- package/dist/component/{dropdown-field-headless-CzoD076g.js → dropdown-field-headless-Js5TxdU4.js} +14 -14
- package/dist/component/{dropdown-field-rac-5kD98Ubc.js → dropdown-field-rac-BDxcvX00.js} +1 -1
- package/dist/component/{dropdown-rac-C9NpsRYi.js → dropdown-rac-B5UHNzV-.js} +1 -1
- package/dist/component/{ecom-address-rac-DdvJEnAO.js → ecom-address-rac-0zm4bX37.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-D7Lf1ETL.js → ecom-subscription-checkbox-rac-DCXoI33l.js} +2 -2
- package/dist/component/{email-input-field-rac-DUordV5X.js → email-input-field-rac-svf6hUHF.js} +2 -2
- package/dist/component/{events-repeater-rac-B1yDrnvJ.js → events-repeater-rac-DMIqzuVK.js} +29 -29
- package/dist/component/{events-rsvp-rac-B65NtAMH.js → events-rsvp-rac-B_YD4ckO.js} +1 -1
- package/dist/component/{field-error-headless-DP4WSQU3.js → field-error-headless-DTKnr5Zx.js} +6 -6
- package/dist/component/{field-label-headless-BKmi7Fjg.js → field-label-headless-DV4aNd5Y.js} +5 -5
- package/dist/component/{file-upload-rac-DAg_G0_l.js → file-upload-rac-lGKJjG3m.js} +49 -49
- package/dist/component/{fixed-payment-rac-yO1w1gE2.js → fixed-payment-rac-BVS6glii.js} +13 -13
- package/dist/component/{form-D6A2hUbV.js → form-DzjdnO7t.js} +2262 -2259
- 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-tzBH-8Yh.js} +5 -5
- package/dist/component/{header-rac-Blv89pdS.js → header-rac-6thQAvVF.js} +1 -1
- package/dist/component/{image-choice-rac-BLUZRNm0.js → image-choice-rac-Dx1b-saW.js} +23 -23
- package/dist/component/{index-BiYk1mJi.js → index-DIP7KB8P.js} +2 -2
- package/dist/component/{index-Cv3_acT1.js → index-Lnx0829a.js} +4 -4
- package/dist/component/isObjectLike-B_1KizZV.js +86 -0
- package/dist/component/multiline-address-field-rac-BY2SUp2d.js +1613 -0
- package/dist/component/{multiline-address-rac-B9yHNebZ.js → multiline-address-rac-BL8Yp4F0.js} +1 -1
- package/dist/component/{number-input-field-rac-SaC7jFUi.js → number-input-field-rac-x0yFmXbe.js} +14 -14
- package/dist/component/{number-input-rac-KYcJJPrs.js → number-input-rac-pJXc2YsD.js} +1 -1
- package/dist/component/{password-rac-CD5bSL2g.js → password-rac-B4XCP64b.js} +19 -19
- package/dist/component/{payment-input-rac-BlAscmFz.js → payment-input-rac-CZdOAjK4.js} +12 -12
- package/dist/component/{phone-input-field-rac-D-AosrgV.js → phone-input-field-rac-DO_V5Z_T.js} +19 -19
- package/dist/component/{phone-rac-DXLYlz5G.js → phone-rac-D16nLDjP.js} +1 -1
- package/dist/component/{product-list-rac-CGt4Gnj4.js → product-list-rac-DER8gVqy.js} +44 -44
- package/dist/component/{quiz-radio-group-rac-DaStzNZZ.js → quiz-radio-group-rac-BgTmHHi4.js} +1 -1
- package/dist/component/{radio-group-field-rac-D8NS7qDq.js → radio-group-field-rac-Dt2pU0VV.js} +1 -1
- package/dist/component/{radio-group-field-rac.module-wK26tCZq.js → radio-group-field-rac.module--sO0VqCA.js} +12 -12
- package/dist/component/{radio-group-rac-HalDjwk1.js → radio-group-rac-CqCmtkNQ.js} +1 -1
- package/dist/component/{rating-input-field-rac-BBhMkSyL.js → rating-input-field-rac-xDrHHcL2.js} +10 -10
- package/dist/component/{rating-input-rac-BpgFnNoD.js → rating-input-rac-Bo5E9N87.js} +1 -1
- package/dist/component/{rich-content-rac.module-BgJ2fteu.js → rich-content-rac.module-CJXbNca9.js} +4 -4
- package/dist/component/{rich-text-field-rac-BZfCgvHc.js → rich-text-field-rac-CkV0Z9F-.js} +5 -5
- package/dist/component/{rich-text-rac-CG3V04Gr.js → rich-text-rac-59DbKpXz.js} +1 -1
- package/dist/component/{service-dropdown-rac-Bc_y-R5O.js → service-dropdown-rac-BLnflnUr.js} +25 -25
- package/dist/component/{services-multi-choice-rac-BeBdZpRV.js → services-multi-choice-rac-C-bFjwx8.js} +6 -6
- package/dist/component/{signature-rac-DNdpHxFp.js → signature-rac-Bb5IaS28.js} +15 -15
- package/dist/component/{submit-button-rac-Bogk1xYc.js → submit-button-rac-Bjyi8sUA.js} +12 -12
- package/dist/component/{tags-field-rac-COJG3T_9.js → tags-field-rac-C_VO3_69.js} +12 -12
- package/dist/component/{tags-rac-DsaUqJ4w.js → tags-rac-CKiutCWe.js} +1 -1
- package/dist/component/{text-area-field-rac-BVq5p83p.js → text-area-field-rac-Cg-vIhFe.js} +12 -12
- package/dist/component/{text-area-rac-D-uiOy62.js → text-area-rac-tMFx38UD.js} +1 -1
- package/dist/component/{text-input-field-rac-wYvY_eBR.js → text-input-field-rac-CgN_2hOD.js} +1 -1
- package/dist/component/{text-input-headless-BsL6OYhp.js → text-input-headless-CkhvKrFp.js} +6 -6
- package/dist/component/{text-input-rac-Bu8kXhrN.js → text-input-rac-BsyBgd3b.js} +1 -1
- package/dist/component/{time-input-rac-PWXUi1qL.js → time-input-rac-BxRVJtHE.js} +12 -12
- package/dist/component/{url-input-field-rac-B4qgrssx.js → url-input-field-rac-B_1yVniS.js} +12 -12
- package/dist/component/{url-input-rac-Bo51kTsG.js → url-input-rac-D8VrKYVe.js} +1 -1
- package/dist/component/{use-service-options-base-Du6B6AP9.js → use-service-options-base-Ci9gIluo.js} +7 -7
- package/package.json +2 -14
- package/dist/component/checkbox-field-rac-DhAEMdL9.js +0 -625
- package/dist/component/isObject-BAwJJxQ3.js +0 -34
- package/dist/component/multiline-address-field-rac-_Sb56AEM.js +0 -1574
package/dist/component/{dropdown-field-headless-CzoD076g.js → dropdown-field-headless-Js5TxdU4.js}
RENAMED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import e, { useState as E, useCallback as g, useRef as q } from "react";
|
|
2
2
|
import { UNSAFE_PortalProvider as A } from "react-aria";
|
|
3
|
-
import { Select as
|
|
4
|
-
import {
|
|
3
|
+
import { Select as j, SelectValue as w, ListBox as M, ListBoxItem as U } from "react-aria-components";
|
|
4
|
+
import { ah as p, ae as b, aj as _ } from "./form-DzjdnO7t.js";
|
|
5
5
|
import { f as d, a as z } from "./find-child-C60k4CxG.js";
|
|
6
|
-
import { D as G, E as H } from "./field-error-headless-
|
|
7
|
-
import { L as J } from "./field-label-headless-
|
|
6
|
+
import { D as G, E as H } from "./field-error-headless-DTKnr5Zx.js";
|
|
7
|
+
import { L as J } from "./field-label-headless-DV4aNd5Y.js";
|
|
8
8
|
import { S as K, N as Q } from "./non-modal-popover-DtIMXHbe.js";
|
|
9
9
|
const n = ({ children: t }) => {
|
|
10
|
-
const { id: o, value: r, defaultValue: l, options: a = [], readOnly: s, onChange: u, placeholder: m, disabled: i, required: v, onBlur: O, onFocus: y, FieldLayout: F, hasError:
|
|
10
|
+
const { id: o, value: r, defaultValue: l, options: a = [], readOnly: s, onChange: u, placeholder: m, disabled: i, required: v, onBlur: O, onFocus: y, FieldLayout: F, hasError: h } = p(), [C, D] = E(!1), [L, I] = E(null), B = r && a.some((c) => (c.value ?? c.label) === r) ? r : l || null, { labelId: N } = b(), P = g((c) => {
|
|
11
11
|
s || u(typeof c == "string" ? c : null);
|
|
12
12
|
}, [
|
|
13
13
|
u,
|
|
14
14
|
s
|
|
15
|
-
]), S = g((c) =>
|
|
15
|
+
]), S = g((c) => D(c && !i && !s), [
|
|
16
16
|
i,
|
|
17
17
|
s
|
|
18
18
|
]), T = d(t, n.Label), x = d(t, n.Trigger), V = d(t, n.Options), R = d(t, n.Description), k = d(t, n.Error);
|
|
@@ -25,15 +25,15 @@ const n = ({ children: t }) => {
|
|
|
25
25
|
display: "contents"
|
|
26
26
|
}
|
|
27
27
|
}), /* @__PURE__ */ e.createElement(A, {
|
|
28
|
-
getContainer: () =>
|
|
29
|
-
}, /* @__PURE__ */ e.createElement(
|
|
28
|
+
getContainer: () => L
|
|
29
|
+
}, /* @__PURE__ */ e.createElement(j, {
|
|
30
30
|
"aria-labelledby": N,
|
|
31
31
|
value: B,
|
|
32
|
-
isOpen:
|
|
32
|
+
isOpen: C && !i && !s,
|
|
33
33
|
onOpenChange: S,
|
|
34
34
|
onChange: P,
|
|
35
35
|
isDisabled: i,
|
|
36
|
-
isInvalid:
|
|
36
|
+
isInvalid: h,
|
|
37
37
|
isRequired: v,
|
|
38
38
|
placeholder: m,
|
|
39
39
|
onBlur: O,
|
|
@@ -43,7 +43,7 @@ const n = ({ children: t }) => {
|
|
|
43
43
|
});
|
|
44
44
|
}, W = ({ children: t, className: o }) => {
|
|
45
45
|
const { inputId: r, ariaDescribedBy: l } = b(), { id: a, hasError: s, isLoading: u } = p(), m = q(null);
|
|
46
|
-
return
|
|
46
|
+
return _(() => {
|
|
47
47
|
var i;
|
|
48
48
|
(i = m.current) == null || i.focus();
|
|
49
49
|
}, a), /* @__PURE__ */ e.createElement(K, {
|
|
@@ -53,21 +53,21 @@ const n = ({ children: t }) => {
|
|
|
53
53
|
className: o,
|
|
54
54
|
"data-invalid": s || void 0,
|
|
55
55
|
"data-loading": u || void 0
|
|
56
|
-
}, /* @__PURE__ */ e.createElement(
|
|
56
|
+
}, /* @__PURE__ */ e.createElement(w, null), t);
|
|
57
57
|
}, f = ({ children: t, className: o }) => {
|
|
58
58
|
const { options: r = [] } = p(), l = d(t, f.Option);
|
|
59
59
|
return /* @__PURE__ */ e.createElement(Q, {
|
|
60
60
|
className: o,
|
|
61
61
|
containerPadding: 0,
|
|
62
62
|
offset: 0
|
|
63
|
-
}, /* @__PURE__ */ e.createElement(
|
|
63
|
+
}, /* @__PURE__ */ e.createElement(M, null, r.map((a) => z(l, {
|
|
64
64
|
key: a.value ?? a.label,
|
|
65
65
|
value: a.value ?? a.label,
|
|
66
66
|
label: a.label
|
|
67
67
|
}))));
|
|
68
68
|
}, X = ({ className: t, ...o }) => {
|
|
69
69
|
const { value: r, label: l } = o;
|
|
70
|
-
return /* @__PURE__ */ e.createElement(
|
|
70
|
+
return /* @__PURE__ */ e.createElement(U, {
|
|
71
71
|
className: t,
|
|
72
72
|
id: r,
|
|
73
73
|
textValue: l
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RicosViewer as l } from "@wix/ricos/viewer";
|
|
2
2
|
import t from "classnames";
|
|
3
3
|
import e from "react";
|
|
4
|
-
import { D as o } from "./dropdown-field-headless-
|
|
4
|
+
import { D as o } from "./dropdown-field-headless-Js5TxdU4.js";
|
|
5
5
|
import { C as m } from "./chevron-down-icon-CcpVm6B-.js";
|
|
6
6
|
import { E as n } from "./error-icon-hZxQ6DEy.js";
|
|
7
7
|
import { H as c } from "./custom-focus-class-_483Pkwp.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import o, { useMemo as a } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { C } from "./checkbox-field-rac-
|
|
2
|
+
import { ah as n, ar as c, h as i } from "./form-DzjdnO7t.js";
|
|
3
|
+
import { C } from "./checkbox-field-rac-e-RAmupX.js";
|
|
4
4
|
import { j as l, k as p, i as m } from "./form-element-classes-Bi-nNM8q.js";
|
|
5
5
|
const _ = (e) => ({
|
|
6
6
|
nodes: [
|
package/dist/component/{email-input-field-rac-DUordV5X.js → email-input-field-rac-svf6hUHF.js}
RENAMED
|
@@ -2,7 +2,7 @@ import { RicosViewer as ie } from "@wix/ricos/viewer";
|
|
|
2
2
|
import x from "classnames";
|
|
3
3
|
import u, { createContext as z, useContext as Z, createElement as H, isValidElement as U, cloneElement as R, useState as le, useCallback as me, useEffect as ue } from "react";
|
|
4
4
|
import { TextField as pe } from "react-aria-components";
|
|
5
|
-
import {
|
|
5
|
+
import { ae as fe, ar as ge, ac as ve, c as ye, ah as Ee, al as de, af as be, f as Se } from "./form-DzjdnO7t.js";
|
|
6
6
|
import { f as L } from "./find-child-C60k4CxG.js";
|
|
7
7
|
import ee from "@babel/runtime/helpers/objectWithoutProperties";
|
|
8
8
|
import M from "@babel/runtime/helpers/typeof";
|
|
@@ -10,7 +10,7 @@ import Oe from "@babel/runtime/helpers/defineProperty";
|
|
|
10
10
|
import he from "html-parse-stringify";
|
|
11
11
|
import Ie from "@babel/runtime/helpers/classCallCheck";
|
|
12
12
|
import Ne from "@babel/runtime/helpers/createClass";
|
|
13
|
-
import { T as B } from "./text-input-headless-
|
|
13
|
+
import { T as B } from "./text-input-headless-CkhvKrFp.js";
|
|
14
14
|
import { E as Ae } from "./error-icon-hZxQ6DEy.js";
|
|
15
15
|
import { s as C } from "./field-rac.module-DtugsLiL.js";
|
|
16
16
|
import { r as Fe, H as ke, q as Te, l as De, h as xe, R as je } from "./form-element-classes-Bi-nNM8q.js";
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import t, { useState as q, useMemo as B, useCallback as V, useRef as M } from "react";
|
|
2
2
|
import v from "classnames";
|
|
3
3
|
import { NumberField as z, Input as J, CheckboxField as Q, CheckboxButton as W, Button as w } from "react-aria-components";
|
|
4
|
-
import {
|
|
4
|
+
import { an as P, ao as U, ad as j, ai as H, u as Y, ah as D, ae as K, aj as X, j as Z } from "./form-DzjdnO7t.js";
|
|
5
5
|
import { f as F, a as R } from "./find-child-C60k4CxG.js";
|
|
6
|
-
import { L as ee } from "./field-label-headless-
|
|
6
|
+
import { L as ee } from "./field-label-headless-DV4aNd5Y.js";
|
|
7
7
|
import { u as te } from "./use-invoke-callback-UH73A_J3.js";
|
|
8
8
|
import { C as x } from "./chevron-down-icon-CcpVm6B-.js";
|
|
9
9
|
import { s as L } from "./field-rac.module-DtugsLiL.js";
|
|
10
10
|
import { r as se, q as ne, m as oe, n as re, o as ae } from "./form-element-classes-Bi-nNM8q.js";
|
|
11
|
-
const
|
|
11
|
+
const le = [], ce = ({ id: e, fields: n, layout: l, value: r, onChange: s, errors: m = le, validation: c }) => {
|
|
12
12
|
const [i, E] = q((r == null ? void 0 : r.length) || 0), a = B(() => r ?? [], [
|
|
13
13
|
r
|
|
14
|
-
]), g = P(), C = U(), d =
|
|
14
|
+
]), g = P(), C = U(), d = j(), { validateFields: u } = H(), G = c.predefined.objectArrayOptions.maxItems, _ = B(() => Y({
|
|
15
15
|
form: {
|
|
16
16
|
fields: n,
|
|
17
17
|
steps: [
|
|
18
18
|
{
|
|
19
|
-
layout:
|
|
19
|
+
layout: l
|
|
20
20
|
}
|
|
21
21
|
]
|
|
22
22
|
},
|
|
@@ -24,7 +24,7 @@ const ce = [], le = ({ id: e, fields: n, layout: c, value: r, onChange: s, error
|
|
|
24
24
|
recursive: !1
|
|
25
25
|
}), [
|
|
26
26
|
n,
|
|
27
|
-
|
|
27
|
+
l,
|
|
28
28
|
e
|
|
29
29
|
]), f = B(() => m.reduce((p, I) => {
|
|
30
30
|
const [S, N] = I.errorPath.split("/"), A = parseInt(S, 10);
|
|
@@ -70,7 +70,7 @@ const ce = [], le = ({ id: e, fields: n, layout: c, value: r, onChange: s, error
|
|
|
70
70
|
changeGuestField: T
|
|
71
71
|
};
|
|
72
72
|
}, ue = [], me = {}, o = ({ children: e, className: n }) => {
|
|
73
|
-
const
|
|
73
|
+
const l = D(), { id: r, FieldLayout: s } = l, { guestLimit: m, guestCount: c, guests: i, errorsByIndex: E, formView: a, changeGuestCount: g, changeGuestField: C } = ce(l), d = F(e, o.Label), u = F(e, o.GuestCount), G = F(e, o.GuestToggle), _ = F(e, o.Guests), f = m > 1;
|
|
74
74
|
return /* @__PURE__ */ t.createElement(s, {
|
|
75
75
|
fieldId: r,
|
|
76
76
|
renderLabel: () => f ? d : null,
|
|
@@ -78,13 +78,13 @@ const ce = [], le = ({ id: e, fields: n, layout: c, value: r, onChange: s, error
|
|
|
78
78
|
className: n
|
|
79
79
|
}, f ? R(u, {
|
|
80
80
|
guestLimit: m,
|
|
81
|
-
guestCount:
|
|
81
|
+
guestCount: c,
|
|
82
82
|
onGuestCountChange: g
|
|
83
83
|
}) : R(G, {
|
|
84
|
-
guestCount:
|
|
84
|
+
guestCount: c,
|
|
85
85
|
onGuestCountChange: g
|
|
86
86
|
}), R(_, {
|
|
87
|
-
guestCount:
|
|
87
|
+
guestCount: c,
|
|
88
88
|
guests: i,
|
|
89
89
|
errorsByIndex: E,
|
|
90
90
|
formView: a,
|
|
@@ -94,18 +94,18 @@ const ce = [], le = ({ id: e, fields: n, layout: c, value: r, onChange: s, error
|
|
|
94
94
|
});
|
|
95
95
|
}, ie = ({ className: e }) => /* @__PURE__ */ t.createElement(ee, {
|
|
96
96
|
className: e
|
|
97
|
-
}, null), h = ({ children: e, className: n, groupClassName:
|
|
98
|
-
const { guestLimit: s, guestCount: m, onGuestCountChange:
|
|
99
|
-
|
|
97
|
+
}, null), h = ({ children: e, className: n, groupClassName: l, ...r }) => {
|
|
98
|
+
const { guestLimit: s, guestCount: m, onGuestCountChange: c } = r, { id: i, label: E, disabled: a, readOnly: g, onBlur: C, onFocus: d } = D(), { inputId: u, ariaDescribedBy: G } = K(), _ = te(C), f = M(null);
|
|
99
|
+
X(() => {
|
|
100
100
|
var p;
|
|
101
101
|
(p = f.current) == null || p.focus();
|
|
102
102
|
}, i);
|
|
103
103
|
const b = F(e, h.Decrement), T = F(e, h.Increment);
|
|
104
104
|
return /* @__PURE__ */ t.createElement(z, {
|
|
105
|
-
className:
|
|
105
|
+
className: l,
|
|
106
106
|
"aria-label": E,
|
|
107
107
|
value: m,
|
|
108
|
-
onChange:
|
|
108
|
+
onChange: c,
|
|
109
109
|
minValue: 0,
|
|
110
110
|
maxValue: s,
|
|
111
111
|
step: 1,
|
|
@@ -126,9 +126,9 @@ const ce = [], le = ({ id: e, fields: n, layout: c, value: r, onChange: s, error
|
|
|
126
126
|
}, e), pe = ({ children: e, className: n }) => /* @__PURE__ */ t.createElement(w, {
|
|
127
127
|
slot: "increment",
|
|
128
128
|
className: n
|
|
129
|
-
}, e), O = ({ children: e, className: n, ...
|
|
130
|
-
const { guestCount: r, onGuestCountChange: s } =
|
|
131
|
-
|
|
129
|
+
}, e), O = ({ children: e, className: n, ...l }) => {
|
|
130
|
+
const { guestCount: r, onGuestCountChange: s } = l, { id: m, label: c, disabled: i, readOnly: E, onBlur: a, onFocus: g } = D(), { inputId: C, ariaDescribedBy: d } = K(), u = M(null);
|
|
131
|
+
X(() => {
|
|
132
132
|
var b;
|
|
133
133
|
(b = u.current) == null || b.focus();
|
|
134
134
|
}, m);
|
|
@@ -150,20 +150,20 @@ const ce = [], le = ({ id: e, fields: n, layout: c, value: r, onChange: s, error
|
|
|
150
150
|
}, /* @__PURE__ */ t.createElement(W, {
|
|
151
151
|
className: n
|
|
152
152
|
}, G, R(_, {
|
|
153
|
-
label:
|
|
153
|
+
label: c
|
|
154
154
|
})));
|
|
155
155
|
}, Ee = ({ className: e }) => /* @__PURE__ */ t.createElement("div", {
|
|
156
156
|
"aria-hidden": "true",
|
|
157
157
|
className: e
|
|
158
158
|
}), ge = ({ className: e, ...n }) => {
|
|
159
|
-
const { label:
|
|
159
|
+
const { label: l } = n;
|
|
160
160
|
return /* @__PURE__ */ t.createElement("span", {
|
|
161
161
|
className: e
|
|
162
|
-
},
|
|
163
|
-
}, k = ({ children: e, className: n, ...
|
|
164
|
-
const { guestCount: r, guests: s, errorsByIndex: m, formView:
|
|
165
|
-
...
|
|
166
|
-
fields:
|
|
162
|
+
}, l);
|
|
163
|
+
}, k = ({ children: e, className: n, ...l }) => {
|
|
164
|
+
const { guestCount: r, guests: s, errorsByIndex: m, formView: c, onGuestFieldChange: i } = l, { disabled: E, readOnly: a } = D(), g = B(() => ({
|
|
165
|
+
...c,
|
|
166
|
+
fields: c.fields.map((d) => ({
|
|
167
167
|
...d,
|
|
168
168
|
properties: {
|
|
169
169
|
...d.properties,
|
|
@@ -172,7 +172,7 @@ const ce = [], le = ({ id: e, fields: n, layout: c, value: r, onChange: s, error
|
|
|
172
172
|
}
|
|
173
173
|
}))
|
|
174
174
|
}), [
|
|
175
|
-
|
|
175
|
+
c,
|
|
176
176
|
E,
|
|
177
177
|
a
|
|
178
178
|
]), C = F(e, k.Guest);
|
|
@@ -189,17 +189,17 @@ const ce = [], le = ({ id: e, fields: n, layout: c, value: r, onChange: s, error
|
|
|
189
189
|
onFieldChange: i(u)
|
|
190
190
|
}))) : null;
|
|
191
191
|
}, Ce = ({ className: e, ...n }) => {
|
|
192
|
-
const { index:
|
|
192
|
+
const { index: l, formView: r, values: s, errors: m, onFieldChange: c } = n, i = P(), E = U(), a = j(), { validateFields: g } = H();
|
|
193
193
|
return /* @__PURE__ */ t.createElement("div", {
|
|
194
194
|
className: e,
|
|
195
|
-
"data-hook": `guest-${
|
|
195
|
+
"data-hook": `guest-${l}`
|
|
196
196
|
}, /* @__PURE__ */ t.createElement(Z, {
|
|
197
197
|
form: r,
|
|
198
198
|
formSchema: i,
|
|
199
199
|
values: s,
|
|
200
200
|
errors: m,
|
|
201
201
|
validateFields: g,
|
|
202
|
-
onFieldChange:
|
|
202
|
+
onFieldChange: c,
|
|
203
203
|
fields: E,
|
|
204
204
|
fieldActions: a
|
|
205
205
|
}));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "react";
|
|
2
2
|
import { RicosViewer as c } from "@wix/ricos/viewer";
|
|
3
3
|
import r from "classnames";
|
|
4
|
-
import { R as a, s as o } from "./radio-group-field-rac.module
|
|
4
|
+
import { R as a, s as o } from "./radio-group-field-rac.module--sO0VqCA.js";
|
|
5
5
|
import { E as m } from "./error-icon-hZxQ6DEy.js";
|
|
6
6
|
import { s } from "./field-rac.module-DtugsLiL.js";
|
|
7
7
|
import { r as i, H as E, I as p, K as R, J as _, l as L, h as O } from "./form-element-classes-Bi-nNM8q.js";
|
package/dist/component/{field-error-headless-DP4WSQU3.js → field-error-headless-DTKnr5Zx.js}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import t, { createContext as m, useContext as M } from "react";
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
2
|
+
import { ah as c, ae as i, ab as f, T as h, U as x } from "./form-DzjdnO7t.js";
|
|
3
|
+
const b = ({ className: r, children: e }) => {
|
|
4
4
|
const { description: s, target: o } = c(), { descriptionId: a } = i(), { language: n } = f();
|
|
5
5
|
return s ? /* @__PURE__ */ t.createElement("div", {
|
|
6
6
|
className: r,
|
|
7
7
|
id: a,
|
|
8
|
-
"data-hook":
|
|
8
|
+
"data-hook": h(o)
|
|
9
9
|
}, e({
|
|
10
10
|
content: s,
|
|
11
11
|
locale: n
|
|
@@ -16,18 +16,18 @@ const N = ({ className: r, children: e }) => {
|
|
|
16
16
|
className: r
|
|
17
17
|
}, e ?? "");
|
|
18
18
|
}, k = ({ className: r, children: e, ...s }) => {
|
|
19
|
-
const { hasError: o, errorMessage: a } = s, { target: n, hasError:
|
|
19
|
+
const { hasError: o, errorMessage: a } = s, { target: n, hasError: E, errorMessage: d } = c(), { errorId: g } = i(), u = o ?? E, p = a ?? d;
|
|
20
20
|
return u ? /* @__PURE__ */ t.createElement(v, {
|
|
21
21
|
value: p
|
|
22
22
|
}, /* @__PURE__ */ t.createElement("div", {
|
|
23
23
|
id: g,
|
|
24
|
-
"data-hook":
|
|
24
|
+
"data-hook": x(n),
|
|
25
25
|
className: r
|
|
26
26
|
}, e)) : null;
|
|
27
27
|
};
|
|
28
28
|
k.Text = D;
|
|
29
29
|
export {
|
|
30
|
-
|
|
30
|
+
b as D,
|
|
31
31
|
k as E,
|
|
32
32
|
v as a,
|
|
33
33
|
D as b
|
package/dist/component/{field-label-headless-BKmi7Fjg.js → field-label-headless-DV4aNd5Y.js}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ah as m, R as d, q as p, ae as D, ar as B } from "./form-DzjdnO7t.js";
|
|
2
2
|
import l from "react";
|
|
3
|
-
import { f as
|
|
4
|
-
import { sdk as
|
|
3
|
+
import { f as L } from "./find-child-C60k4CxG.js";
|
|
4
|
+
import { sdk as R } from "@wix/image-kit";
|
|
5
5
|
function N({ id: e, width: t, height: n }, a, r, o = "fill") {
|
|
6
|
-
return (o === "fit" ?
|
|
6
|
+
return (o === "fit" ? R.getScaleToFitImageURL : R.getScaleToFillImageURL)(e, t, n, typeof a == "number" ? a : parseInt(a, 10), typeof r == "number" ? r : parseInt(r, 10));
|
|
7
7
|
}
|
|
8
8
|
var u = /* @__PURE__ */ (function(e) {
|
|
9
9
|
return e.TOP = "top", e.BOTTOM = "bottom", e;
|
|
@@ -15,7 +15,7 @@ const S = {
|
|
|
15
15
|
margin: 0,
|
|
16
16
|
padding: 0
|
|
17
17
|
}, U = "", i = ({ children: e, className: t, ...n }) => {
|
|
18
|
-
const { as: a = "label", requiredIndicatorHidden: r = !1, label: o } = n, { label: T, required:
|
|
18
|
+
const { as: a = "label", requiredIndicatorHidden: r = !1, label: o } = n, { label: T, required: g = !1, hideLabel: q = !1, requiredIndicatorType: F = d.ASTERISK, requiredIndicatorPlacement: O = p.AFTER_FIELD_TITLE, media: y, mediaSettings: s } = m(), { labelId: A, inputId: P } = D(), _ = a, E = g && !r ? L(e, i.Required) : null, c = y ? L(e, i.Image) : null, f = (s == null ? void 0 : s.imagePosition) ?? u.TOP, h = F === d.ASTERISK && O === p.BEFORE_FIELD_TITLE, I = (o ?? T) || U, b = /* @__PURE__ */ l.createElement(_, {
|
|
19
19
|
id: A,
|
|
20
20
|
htmlFor: a === "label" ? P : void 0,
|
|
21
21
|
className: t,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import t, { useState as Q, useRef as z, 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 {
|
|
4
|
+
import { ad as Fe, ar as ie, am as he, i as ge, ap as xe, e as re, aq as be, ae as ce, ah as j, aj as Ce } from "./form-DzjdnO7t.js";
|
|
5
|
+
import { E as Le } from "./error-icon-hZxQ6DEy.js";
|
|
5
6
|
import { s as I } from "./field-rac.module-DtugsLiL.js";
|
|
6
|
-
import { r as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { L as Be } from "./field-label-headless-BKmi7Fjg.js";
|
|
7
|
+
import { r as ne, H as De, V as Ne, h as le, l as ae } from "./form-element-classes-Bi-nNM8q.js";
|
|
8
|
+
import { f as g, a as V } from "./find-child-C60k4CxG.js";
|
|
9
|
+
import { b as ve, a as ye, D as _e, E as Te } from "./field-error-headless-DTKnr5Zx.js";
|
|
10
|
+
import { L as Be } from "./field-label-headless-DV4aNd5Y.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,13 +43,13 @@ 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] = Q(Ue(r)), [b, m] = Q(r || []), [c, N] = Q(), v = Ae(o), { t: E } = ie(), U =
|
|
46
|
+
const [l, s] = Q(Ue(r)), [b, m] = Q(r || []), [c, N] = Q(), v = Ae(o), { t: E } = ie(), U = he().includes(ge.BUTTONS_HOVER), { setFormStatus: y } = xe(), S = z(!1), _ = z(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,
|
|
@@ -60,9 +60,9 @@ function Ze({ valueSliderLimit: e, value: r, explanationText: n, target: o, onCh
|
|
|
60
60
|
return n;
|
|
61
61
|
const F = l.filter((u) => u.state === "uploading").length;
|
|
62
62
|
if (F) {
|
|
63
|
-
const u = l.filter((p) => p.state === "uploaded" && p.file.size > 0).length,
|
|
63
|
+
const u = l.filter((p) => p.state === "uploaded" && p.file.size > 0).length, h = u / (u + F);
|
|
64
64
|
return E("form.file-upload.uploading", {
|
|
65
|
-
count: Math.round(
|
|
65
|
+
count: Math.round(h * 100)
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
68
|
return n || E("form.file-upload.explanation-text", {
|
|
@@ -73,7 +73,7 @@ function Ze({ valueSliderLimit: e, value: r, explanationText: n, target: o, onCh
|
|
|
73
73
|
n,
|
|
74
74
|
E
|
|
75
75
|
]), M = P(async (F) => {
|
|
76
|
-
await v(F, ({ file: u, uploadedFile:
|
|
76
|
+
await v(F, ({ file: u, uploadedFile: h }) => {
|
|
77
77
|
s((p) => p.map((f) => f.file === u ? {
|
|
78
78
|
file: u,
|
|
79
79
|
state: "uploaded"
|
|
@@ -81,12 +81,12 @@ function Ze({ valueSliderLimit: e, value: r, explanationText: n, target: o, onCh
|
|
|
81
81
|
var L;
|
|
82
82
|
const f = [
|
|
83
83
|
...p
|
|
84
|
-
].concat(
|
|
84
|
+
].concat(h);
|
|
85
85
|
return (L = _.current) == null || L.call(_, f), f;
|
|
86
86
|
});
|
|
87
|
-
}, (u,
|
|
88
|
-
s((p) => p.map((f) => f.file ===
|
|
89
|
-
file:
|
|
87
|
+
}, (u, h) => {
|
|
88
|
+
s((p) => p.map((f) => f.file === h ? {
|
|
89
|
+
file: h,
|
|
90
90
|
state: "error",
|
|
91
91
|
errorMessage: E("form.file-upload.error.upload-failed")
|
|
92
92
|
} : f));
|
|
@@ -111,29 +111,29 @@ 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
|
-
const
|
|
118
|
-
i(
|
|
117
|
+
const h = b.filter((f) => f.displayName !== u.file.name);
|
|
118
|
+
i(h), m(h);
|
|
119
119
|
const p = l.filter((f) => f.file.name !== u.file.name);
|
|
120
120
|
s(p), p.length === 0 && D();
|
|
121
121
|
} else {
|
|
122
|
-
const
|
|
123
|
-
s(
|
|
122
|
+
const h = l.filter((p) => p !== u);
|
|
123
|
+
s(h), h.length === 0 && D();
|
|
124
124
|
}
|
|
125
125
|
}, $ = () => {
|
|
126
126
|
c && N(void 0), x();
|
|
127
127
|
}, K = d.map((F) => we[F]).join(), H = P(() => {
|
|
128
128
|
s([]), m([]);
|
|
129
129
|
}, []);
|
|
130
|
-
return
|
|
130
|
+
return be(H), {
|
|
131
131
|
files: l,
|
|
132
132
|
limitError: c,
|
|
133
133
|
hover: U,
|
|
134
134
|
getExplanationText: k,
|
|
135
135
|
handleChange: O,
|
|
136
|
-
handleDelete:
|
|
136
|
+
handleDelete: q,
|
|
137
137
|
accept: K,
|
|
138
138
|
handleBlur: $
|
|
139
139
|
};
|
|
@@ -162,7 +162,7 @@ function Z() {
|
|
|
162
162
|
return e;
|
|
163
163
|
}
|
|
164
164
|
const A = ({ children: e, className: r }) => {
|
|
165
|
-
const { ariaDescribedBy: n } = ce(), { disabled: o, hasError: i } =
|
|
165
|
+
const { ariaDescribedBy: n } = ce(), { disabled: o, hasError: i } = j(), { handleFileChange: d } = Z(), x = g(e, A.Title), D = g(e, A.Subtitle), l = g(e, A.Button);
|
|
166
166
|
return /* @__PURE__ */ t.createElement(Re, {
|
|
167
167
|
"aria-describedby": n,
|
|
168
168
|
className: r,
|
|
@@ -198,7 +198,7 @@ const A = ({ children: e, className: r }) => {
|
|
|
198
198
|
limitReached: n
|
|
199
199
|
}));
|
|
200
200
|
}, J = ({ 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 } =
|
|
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: U, files: y } = Z(), S = (y == null ? void 0 : y.some((C) => C.errorMessage)) ?? !1, _ = !!(b || m || U || S);
|
|
202
202
|
return /* @__PURE__ */ t.createElement(Me, {
|
|
203
203
|
acceptedFileTypes: N ? N.split(",") : void 0,
|
|
204
204
|
allowsMultiple: v,
|
|
@@ -228,7 +228,7 @@ 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);
|
|
@@ -238,7 +238,7 @@ A.Title = ke;
|
|
|
238
238
|
A.Subtitle = Oe;
|
|
239
239
|
A.Button = J;
|
|
240
240
|
const T = ({ children: e, className: r, ...n }) => {
|
|
241
|
-
const { file: o, index: i } = n, d = o.file.name, x =
|
|
241
|
+
const { file: o, index: i } = n, d = o.file.name, x = g(e, T.Name), D = g(e, T.Remove), l = g(e, T.Spinner), s = g(e, T.Error);
|
|
242
242
|
return /* @__PURE__ */ t.createElement("div", {
|
|
243
243
|
className: r
|
|
244
244
|
}, V(x, {
|
|
@@ -255,7 +255,7 @@ const T = ({ children: e, className: r, ...n }) => {
|
|
|
255
255
|
className: e
|
|
256
256
|
}, n);
|
|
257
257
|
}, ze = ({ className: e, "aria-label": r, children: n, ...o }) => {
|
|
258
|
-
const { fileName: i, index: d } = o, { disabled: x } =
|
|
258
|
+
const { fileName: i, index: d } = o, { disabled: x } = j(), { handleDelete: D, fileRemoveButtonRefs: l } = Z(), s = z(null);
|
|
259
259
|
se(() => {
|
|
260
260
|
const m = l.current, c = i;
|
|
261
261
|
return m[c] = s, () => {
|
|
@@ -285,18 +285,18 @@ const T = ({ children: e, className: r, ...n }) => {
|
|
|
285
285
|
className: e,
|
|
286
286
|
role: "alert"
|
|
287
287
|
}, r)) : null;
|
|
288
|
-
},
|
|
288
|
+
}, 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
293
|
T.Name = Ve;
|
|
294
294
|
T.Remove = ze;
|
|
295
|
-
T.Spinner =
|
|
295
|
+
T.Spinner = je;
|
|
296
296
|
T.Error = ue;
|
|
297
297
|
ue.Text = ve;
|
|
298
298
|
const X = ({ children: e, className: r }) => {
|
|
299
|
-
const { files: n } = Z(), o =
|
|
299
|
+
const { files: n } = Z(), o = g(e, X.File);
|
|
300
300
|
return !n || n.length === 0 ? null : /* @__PURE__ */ t.createElement("div", {
|
|
301
301
|
className: r
|
|
302
302
|
}, n.map((i, d) => V(o, {
|
|
@@ -307,7 +307,7 @@ const X = ({ children: e, className: r }) => {
|
|
|
307
307
|
};
|
|
308
308
|
X.File = T;
|
|
309
309
|
const G = (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 } =
|
|
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 = z(null), N = z({}), v = P(() => {
|
|
311
311
|
var L;
|
|
312
312
|
(L = c.current) == null || L.focus();
|
|
313
313
|
}, []), { files: E, limitError: R, hover: U, getExplanationText: y, handleBlur: S, handleChange: _, handleDelete: C, accept: k } = Ze({
|
|
@@ -326,13 +326,13 @@ const G = (e) => e.file.name, a = ({ children: e }) => {
|
|
|
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
334
|
accept: k,
|
|
335
|
-
limitReached:
|
|
335
|
+
limitReached: q,
|
|
336
336
|
multiple: O,
|
|
337
337
|
getExplanationText: y,
|
|
338
338
|
hover: U,
|
|
@@ -345,13 +345,13 @@ const G = (e) => e.file.name, a = ({ children: e }) => {
|
|
|
345
345
|
M,
|
|
346
346
|
E,
|
|
347
347
|
k,
|
|
348
|
-
|
|
348
|
+
q,
|
|
349
349
|
O,
|
|
350
350
|
y,
|
|
351
351
|
U,
|
|
352
352
|
R
|
|
353
|
-
]), K =
|
|
354
|
-
return
|
|
353
|
+
]), K = g(e, a.Label), H = g(e, a.DropZone), F = g(e, a.Button), u = g(e, a.Explanation), h = g(e, a.Files), p = g(e, a.Description), f = g(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, {
|
|
@@ -363,9 +363,9 @@ const G = (e) => e.file.name, a = ({ children: e }) => {
|
|
|
363
363
|
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, V(f, {
|
|
364
364
|
hasError: !!(s || R),
|
|
365
365
|
errorMessage: R ?? b
|
|
366
|
-
}), p, u,
|
|
366
|
+
}), p, u, h)
|
|
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
|
|
@@ -374,7 +374,7 @@ const G = (e) => e.file.name, a = ({ children: e }) => {
|
|
|
374
374
|
a.Label = Be;
|
|
375
375
|
a.DropZone = A;
|
|
376
376
|
a.Button = J;
|
|
377
|
-
a.Explanation =
|
|
377
|
+
a.Explanation = qe;
|
|
378
378
|
a.Files = X;
|
|
379
379
|
a.Description = _e;
|
|
380
380
|
a.Error = Te;
|
|
@@ -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, {
|
|
@@ -472,12 +472,12 @@ const $e = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
472
472
|
className: w.removeButton,
|
|
473
473
|
"aria-label": e("file-upload.delete-file.aria-label")
|
|
474
474
|
}, /* @__PURE__ */ t.createElement(He, null)), /* @__PURE__ */ t.createElement(a.Files.File.Error, {
|
|
475
|
-
className: B(
|
|
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
|