@wix/form-elements 1.160.0 → 1.162.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-BmHu56e5.js → appointment-rac-3Z1wiBX6.js} +366 -359
- package/dist/component/{bookings-address-rac-DY9l2g0h.js → bookings-address-rac-2zV-a8SW.js} +1 -1
- package/dist/component/{bookings-email-rac-B5vNSOsS.js → bookings-email-rac-C1WakVnh.js} +1 -1
- package/dist/component/{bookings-first-name-rac-CJiefCNz.js → bookings-first-name-rac-6f18uXA0.js} +1 -1
- package/dist/component/{bookings-header-rac-BFu7Ko5w.js → bookings-header-rac-BeaxlPQl.js} +1 -1
- package/dist/component/{bookings-last-name-rac-DegMM13h.js → bookings-last-name-rac-CsLZaKfO.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-DrA-5tBH.js → bookings-login-bar-rac-B3TRivWU.js} +5 -5
- package/dist/component/{bookings-phone-rac-DsaeqxCI.js → bookings-phone-rac-BnFEknvv.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-jRHiwqi8.js → bookings-rich-text-rac-CFPqDZay.js} +1 -1
- package/dist/component/{calendar.module-CKCBG_Pg.js → calendar.module-BMUyMVja.js} +19 -19
- package/dist/component/{checkbox-field-rac-CyoBb6Yf.js → checkbox-field-rac-DqGbxAd0.js} +45 -45
- package/dist/component/{checkbox-group-field-headless-Bv1gU3oL.js → checkbox-group-field-headless-CiobdaVa.js} +38 -38
- package/dist/component/{checkbox-group-field-rac-DasArcdV.js → checkbox-group-field-rac-Dxrc2F4x.js} +14 -14
- package/dist/component/{checkbox-group-rac-CzmufV1U.js → checkbox-group-rac-C3tL4YSr.js} +1 -1
- package/dist/component/{checkbox-indicator-module-classes-akWZsZNn.js → checkbox-indicator-module-classes-DUTR4mcg.js} +1 -1
- package/dist/component/{checkbox-rac-6C7XoUoZ.js → checkbox-rac-DhZsIMuk.js} +1 -1
- package/dist/component/{contacts-address-rac-BZobbFtz.js → contacts-address-rac--GiWpa6C.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-DIzf41DS.js → contacts-birthdate-rac-CmI2nPpr.js} +1 -1
- package/dist/component/{contacts-company-rac-BiBDO28r.js → contacts-company-rac-DcSLvPnR.js} +1 -1
- package/dist/component/{contacts-email-rac-5mqokCSD.js → contacts-email-rac-BLOIHGP9.js} +1 -1
- package/dist/component/{contacts-first-name-rac-BXe3_Nz5.js → contacts-first-name-rac-DgMCKLeE.js} +1 -1
- package/dist/component/{contacts-last-name-rac-Cfqgh7u1.js → contacts-last-name-rac-tcEQP1Db.js} +1 -1
- package/dist/component/{contacts-phone-rac-cmLUWnAc.js → contacts-phone-rac-CK664cfW.js} +1 -1
- package/dist/component/{contacts-position-rac-DTyvklfN.js → contacts-position-rac-B8skwXy6.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-D-ZEX1A3.js → contacts-subscribe-rac-DQZYJjMo.js} +1 -1
- package/dist/component/{contacts-tax-id-rac-B4NYJwWt.js → contacts-tax-id-rac-Ci24ixLu.js} +1 -1
- package/dist/component/{date-availability-Dach9aRC.js → date-availability-Va6_2NAZ.js} +1 -1
- package/dist/component/{date-input-field-rac-B72mHcya.js → date-input-field-rac-lAKyuHOI.js} +98 -98
- package/dist/component/{date-input-rac-CYix11gT.js → date-input-rac-ClEesupR.js} +1 -1
- package/dist/component/{date-picker-field-rac-B8pvtPir.js → date-picker-field-rac-h45jfoso.js} +72 -72
- package/dist/component/{date-picker-rac-D6cR0zH9.js → date-picker-rac-B-pvqBn0.js} +1 -1
- package/dist/component/{date-time-input-field-rac-B7Y3Yf5l.js → date-time-input-field-rac-41QpurJp.js} +72 -72
- package/dist/component/{date-time-input-rac-DMN-noQX.js → date-time-input-rac-BQOUl7It.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-Kq0GnteP.js → dext-checkbox-group-rac-C4Q6tfBD.js} +2 -2
- package/dist/component/{dext-checkbox-rac-BY9GZ4n1.js → dext-checkbox-rac-Yo2PHNDA.js} +1 -1
- package/dist/component/{dext-date-picker-rac-CXArIddp.js → dext-date-picker-rac-jM9x8W6a.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-B39TtxGq.js → dext-date-time-input-rac-BgW_4WIg.js} +1 -1
- package/dist/component/{dext-dropdown-rac-C3y0G8cS.js → dext-dropdown-rac-DCL7D6-G.js} +1 -1
- package/dist/component/{dext-email-rac-BIg3cq7Q.js → dext-email-rac-Dz7yBqkd.js} +1 -1
- package/dist/component/{dext-number-input-rac-27sHJ7yN.js → dext-number-input-rac-BdMjBpH9.js} +1 -1
- package/dist/component/{dext-phone-rac-CcohoFQp.js → dext-phone-rac-D2i9fXL3.js} +1 -1
- package/dist/component/{dext-radio-group-rac-eead3Gve.js → dext-radio-group-rac-Br2f1Ahx.js} +2 -2
- package/dist/component/{dext-rating-input-rac-B_E6OcBr.js → dext-rating-input-rac-OkfJ7Eb0.js} +1 -1
- package/dist/component/{dext-tags-rac-Yd9aAtnF.js → dext-tags-rac-43vDoDdM.js} +2 -2
- package/dist/component/{dext-text-area-rac-CMACri2C.js → dext-text-area-rac-C072pWO9.js} +1 -1
- package/dist/component/{dext-text-input-rac-sNjSCfQ-.js → dext-text-input-rac-BiHJpJCt.js} +1 -1
- package/dist/component/{dext-url-input-rac-DwhbzJty.js → dext-url-input-rac-YOGYMj5C.js} +1 -1
- package/dist/component/{donation-rac-BVAN3kMk.js → donation-rac-fCt3mddA.js} +106 -106
- package/dist/component/{dropdown-field-rac-DdoGigWx.js → dropdown-field-rac-EQrQJ2-C.js} +4 -4
- package/dist/component/{dropdown-rac-CRkt5w47.js → dropdown-rac-MPCcjrFd.js} +1 -1
- package/dist/component/{ecom-address-rac-C36hFHW0.js → ecom-address-rac-DSgpHqzV.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-BKfQ348w.js → ecom-subscription-checkbox-rac-Dw6Ke0Fb.js} +2 -2
- package/dist/component/{email-input-field-rac-MOaISYxa.js → email-input-field-rac-DVmvH4u4.js} +80 -80
- package/dist/component/{events-repeater-rac-D6p-NgE8.js → events-repeater-rac-Uwpo7XF4.js} +25 -25
- package/dist/component/{events-rsvp-rac-DVpgN8gm.js → events-rsvp-rac-D2DJAkep.js} +4 -4
- package/dist/component/{field-error-headless-XNWmDH3E.js → field-error-headless-DAc8FpKI.js} +7 -7
- package/dist/component/{field-label-headless-CORRAJGt.js → field-label-headless-DxxwJtjh.js} +17 -17
- package/dist/component/field-rac.module-ts2t4WUO.js +25 -0
- package/dist/component/{file-upload-rac-DRMr7E4b.js → file-upload-rac-CBKIeaxX.js} +194 -194
- package/dist/component/{fixed-payment-rac-BUXzNex9.js → fixed-payment-rac-BsCDoc1p.js} +20 -20
- package/dist/component/{form-DSpx-AO8.js → form-GAuLAdjq.js} +338 -347
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +1 -1
- package/dist/component/{header-field-rac-CiDXlNsa.js → header-field-rac-DtZCjzLJ.js} +6 -6
- package/dist/component/{header-rac-B5Rg-h8u.js → header-rac-B1hlVDf8.js} +1 -1
- package/dist/component/image-choice-rac-DQaCg_Xk.js +155 -0
- package/dist/component/{index-CwruESwc.js → index-BaVjVNYj.js} +5 -5
- package/dist/component/{index-Bz7ZhQsF.js → index-C1EXd9jU.js} +50 -50
- package/dist/component/{isObjectLike-C5dHxHP0.js → isObjectLike-m2dqIREj.js} +3 -3
- package/dist/component/{multiline-address-field-rac-Z-qF366L.js → multiline-address-field-rac-CMMdLb-J.js} +41 -41
- package/dist/component/{multiline-address-rac-CJIHTMw5.js → multiline-address-rac-VUQNp-Tz.js} +1 -1
- package/dist/component/{number-input-field-rac-D4vf6I6N.js → number-input-field-rac-B5bsGDKm.js} +24 -24
- package/dist/component/{number-input-rac-B2jW6JUQ.js → number-input-rac-BzzW0p9R.js} +1 -1
- package/dist/component/{password-rac-DGRZ17Jl.js → password-rac-2Rr7lvNO.js} +25 -25
- package/dist/component/{payment-input-rac-BtD-tAKv.js → payment-input-rac-CEUzIrJA.js} +31 -31
- package/dist/component/{phone-input-field-rac-KD4-APhr.js → phone-input-field-rac-BDBaqAzE.js} +59 -59
- package/dist/component/{phone-rac-Cw2yccgg.js → phone-rac-BTK8-tkq.js} +1 -1
- package/dist/component/{product-list-rac-XbzTDdbp.js → product-list-rac-1QbeT5RH.js} +43 -43
- package/dist/component/{quiz-radio-group-rac-BDw_mAw5.js → quiz-radio-group-rac-tn2CzdCu.js} +1 -1
- package/dist/component/{radio-button-module-classes-CFGf0Hzh.js → radio-button-module-classes-aK1SQcLG.js} +30 -30
- package/dist/component/{radio-group-field-rac-CXN7tyVu.js → radio-group-field-rac-DlMXhW_S.js} +7 -7
- package/dist/component/{radio-group-rac-COHzqjBh.js → radio-group-rac-BmU_5tBK.js} +1 -1
- package/dist/component/{rating-input-field-rac-DCXNZgf1.js → rating-input-field-rac-DUPJUAX2.js} +27 -27
- package/dist/component/{rating-input-rac-DwQt9ML7.js → rating-input-rac-BLhkZdj8.js} +1 -1
- package/dist/component/{rich-content-rac.module-B7rPwNns.js → rich-content-rac.module-C9bGXB69.js} +5 -5
- package/dist/component/{rich-text-field-rac-DlER7NRD.js → rich-text-field-rac-CVqmsZzZ.js} +6 -6
- package/dist/component/{rich-text-rac-CjicsHA7.js → rich-text-rac-D8K6445F.js} +1 -1
- package/dist/component/{service-dropdown-rac-B81LC_6_.js → service-dropdown-rac-PR_iLdmo.js} +31 -31
- package/dist/component/{services-multi-choice-rac-BR6gZeHk.js → services-multi-choice-rac-BvMadJCf.js} +19 -19
- package/dist/component/{signature-rac-XFj7Ddtp.js → signature-rac-Cpjv6kcl.js} +235 -235
- package/dist/component/{submit-button-rac-Bz7zs_3W.js → submit-button-rac-DpDk7cMb.js} +7 -7
- package/dist/component/{tags-field-rac-DWWkNKqc.js → tags-field-rac-DnyWNHXT.js} +67 -67
- package/dist/component/{tags-rac-BXyiQ9i1.js → tags-rac-D5Do7BNm.js} +1 -1
- package/dist/component/{text-area-field-rac-DsIRYi0d.js → text-area-field-rac-DLBgla0L.js} +27 -27
- package/dist/component/{text-area-rac-CF9pDP9d.js → text-area-rac-Bfsl2gSn.js} +1 -1
- package/dist/component/{text-input-field-rac-BwIDZACz.js → text-input-field-rac-hLsUcQNw.js} +4 -4
- package/dist/component/{text-input-headless-5kQs2_Xu.js → text-input-headless-Otd7Uy7V.js} +13 -13
- package/dist/component/{text-input-rac-CRmSuw1k.js → text-input-rac-jpnc-v91.js} +1 -1
- package/dist/component/{time-input-rac-BRMNpe51.js → time-input-rac-DnjrmZZw.js} +26 -26
- package/dist/component/url-input-field-rac-C90NYHb8.js +77 -0
- package/dist/component/{url-input-rac-Dv-kp50D.js → url-input-rac-C3wfEnqs.js} +1 -1
- package/dist/component/{use-dropdown-option-class-name-BQi_qE_-.js → use-dropdown-option-class-name-CYkLlKBs.js} +12 -12
- package/dist/component/{use-dropdown-trigger-class-name-bAK8aHiG.js → use-dropdown-trigger-class-name-CTt4Z67m.js} +17 -17
- package/dist/component/{use-element-state-class-name-rXM_lHug.js → use-element-state-class-name-ByDw6j7c.js} +1 -1
- package/dist/component/{use-hoverable-input-class-name-BnV_uerV.js → use-hoverable-input-class-name-Duhgtn2I.js} +3 -3
- package/dist/component/use-is-forced-open-dropdown-B5gNY4Zm.js +53 -0
- package/dist/component/{use-service-options-base-CLeE9-Tx.js → use-service-options-base-DE-QaNDw.js} +8 -8
- package/dist/component/use-text-input-class-name-CmxSw6bY.js +6 -0
- package/dist/form.d.ts +3 -0
- package/package.json +2 -2
- package/dist/component/field-rac.module-DP0lkkEv.js +0 -25
- package/dist/component/image-choice-rac-CtoA_KDp.js +0 -155
- package/dist/component/url-input-field-rac-CKLS3QDk.js +0 -77
- package/dist/component/use-is-forced-open-dropdown-Bp-5Xpmw.js +0 -53
- package/dist/component/use-text-input-class-name-DIKWvfkm.js +0 -6
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { RicosViewer as N } from "@wix/ricos/viewer";
|
|
2
|
+
import i from "classnames";
|
|
3
|
+
import r, { useCallback as h, useRef as y } from "react";
|
|
4
|
+
import { TextField as O, Input as A } from "react-aria-components";
|
|
5
|
+
import { by as d, bv as E, bA as v, U as B, aa as T, K as g, G as k } from "./form-GAuLAdjq.js";
|
|
6
|
+
import { f as c } from "./find-child-C60k4CxG.js";
|
|
7
|
+
import { D as M, E as P } from "./field-error-headless-DAc8FpKI.js";
|
|
8
|
+
import { L as U } from "./field-label-headless-DxxwJtjh.js";
|
|
9
|
+
import { u as q } from "./use-invoke-callback-UH73A_J3.js";
|
|
10
|
+
import { E as x } from "./error-icon-hZxQ6DEy.js";
|
|
11
|
+
import { s as u } from "./field-rac.module-ts2t4WUO.js";
|
|
12
|
+
import { u as w } from "./use-text-input-class-name-CmxSw6bY.js";
|
|
13
|
+
const V = (t) => t ? `https://${String(t).replace(/^https?:\/\//, "")}` : "", e = ({ children: t }) => {
|
|
14
|
+
const { id: o, value: l, onChange: a, disabled: m, readOnly: n, required: s, hasError: I, onBlur: b, onFocus: f, FieldLayout: R } = d(), { labelId: F } = E(), p = q(b), L = c(t, e.Label), D = c(t, e.Input), C = c(t, e.Description), _ = c(t, e.Error), S = h(() => {
|
|
15
|
+
a(V(l)), p();
|
|
16
|
+
}, [
|
|
17
|
+
p,
|
|
18
|
+
a,
|
|
19
|
+
l
|
|
20
|
+
]);
|
|
21
|
+
return /* @__PURE__ */ r.createElement(R, {
|
|
22
|
+
fieldId: o,
|
|
23
|
+
renderLabel: () => L,
|
|
24
|
+
renderInput: () => /* @__PURE__ */ r.createElement(O, {
|
|
25
|
+
"aria-labelledby": F,
|
|
26
|
+
value: l ?? "",
|
|
27
|
+
onChange: a,
|
|
28
|
+
isDisabled: m,
|
|
29
|
+
isReadOnly: n,
|
|
30
|
+
isRequired: s,
|
|
31
|
+
isInvalid: I,
|
|
32
|
+
onBlur: S,
|
|
33
|
+
onFocus: f
|
|
34
|
+
}, D),
|
|
35
|
+
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, _, C)
|
|
36
|
+
});
|
|
37
|
+
}, W = ({ className: t }) => {
|
|
38
|
+
const { id: o, placeholder: l } = d(), { inputId: a, ariaDescribedBy: m } = E(), n = y(null);
|
|
39
|
+
return v(() => {
|
|
40
|
+
var s;
|
|
41
|
+
(s = n.current) == null || s.focus({
|
|
42
|
+
preventScroll: !0
|
|
43
|
+
});
|
|
44
|
+
}, o), /* @__PURE__ */ r.createElement(A, {
|
|
45
|
+
ref: n,
|
|
46
|
+
id: a,
|
|
47
|
+
type: "url",
|
|
48
|
+
autoComplete: "url",
|
|
49
|
+
"aria-describedby": m,
|
|
50
|
+
className: t,
|
|
51
|
+
placeholder: l
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
e.Label = U;
|
|
55
|
+
e.Input = W;
|
|
56
|
+
e.Description = M;
|
|
57
|
+
e.Error = P;
|
|
58
|
+
const $ = ({ content: t, locale: o }) => /* @__PURE__ */ r.createElement(N, {
|
|
59
|
+
content: t,
|
|
60
|
+
locale: o
|
|
61
|
+
}), te = () => {
|
|
62
|
+
const t = w();
|
|
63
|
+
return /* @__PURE__ */ r.createElement(e, null, /* @__PURE__ */ r.createElement(e.Label, {
|
|
64
|
+
className: i(B, u.label)
|
|
65
|
+
}, /* @__PURE__ */ r.createElement(e.Label.Required, {
|
|
66
|
+
className: i(T, u.requiredMark)
|
|
67
|
+
})), /* @__PURE__ */ r.createElement(e.Input, {
|
|
68
|
+
className: t
|
|
69
|
+
}), /* @__PURE__ */ r.createElement(e.Error, {
|
|
70
|
+
className: i(g, u.error)
|
|
71
|
+
}, /* @__PURE__ */ r.createElement(x, null), /* @__PURE__ */ r.createElement(e.Error.Text, null)), /* @__PURE__ */ r.createElement(e.Description, {
|
|
72
|
+
className: i(k, u.description)
|
|
73
|
+
}, $));
|
|
74
|
+
};
|
|
75
|
+
export {
|
|
76
|
+
te as U
|
|
77
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import d, { useContext as _, useRef as L, useState as m, Children as N, useLayoutEffect as p, useMemo as D } from "react";
|
|
2
2
|
import { CollectionRendererContext as g, DefaultCollectionRenderer as E, ListBox as M } from "react-aria-components";
|
|
3
|
-
import
|
|
4
|
-
import { s as h } from "./field-rac.module-
|
|
5
|
-
import {
|
|
6
|
-
import { u as
|
|
7
|
-
const R = 1 / 0,
|
|
3
|
+
import I from "classnames";
|
|
4
|
+
import { s as h } from "./field-rac.module-ts2t4WUO.js";
|
|
5
|
+
import { I as P } from "./form-GAuLAdjq.js";
|
|
6
|
+
import { u as T } from "./use-element-state-class-name-ByDw6j7c.js";
|
|
7
|
+
const R = 1 / 0, H = {
|
|
8
8
|
position: "absolute",
|
|
9
9
|
width: 0,
|
|
10
10
|
height: "var(--popoverMaxHeight, 240px)",
|
|
@@ -31,7 +31,7 @@ const R = 1 / 0, I = {
|
|
|
31
31
|
t += 1;
|
|
32
32
|
}
|
|
33
33
|
return t;
|
|
34
|
-
},
|
|
34
|
+
}, Y = ({ isForcedOpen: e, ...n }) => {
|
|
35
35
|
const s = _(g), t = L(null), [r, f] = m(null), [l, O] = m(R), [b, w] = m(0), x = N.count(n.children);
|
|
36
36
|
p(() => {
|
|
37
37
|
O(R);
|
|
@@ -93,7 +93,7 @@ const R = 1 / 0, I = {
|
|
|
93
93
|
...n
|
|
94
94
|
}), e && /* @__PURE__ */ d.createElement("div", {
|
|
95
95
|
ref: f,
|
|
96
|
-
style:
|
|
96
|
+
style: H
|
|
97
97
|
}));
|
|
98
98
|
}, V = {
|
|
99
99
|
base: h.selectOption,
|
|
@@ -103,14 +103,14 @@ const R = 1 / 0, I = {
|
|
|
103
103
|
isSelected: e,
|
|
104
104
|
isHovered: (n || s) && !e
|
|
105
105
|
}), W = (e, ...n) => {
|
|
106
|
-
const s =
|
|
106
|
+
const s = T({
|
|
107
107
|
globalClasses: e,
|
|
108
108
|
moduleClasses: V
|
|
109
109
|
});
|
|
110
|
-
return (t) =>
|
|
111
|
-
},
|
|
110
|
+
return (t) => I(s(q(t)), n);
|
|
111
|
+
}, J = (...e) => W(P, ...e);
|
|
112
112
|
export {
|
|
113
|
-
|
|
113
|
+
Y as V,
|
|
114
114
|
W as a,
|
|
115
|
-
|
|
115
|
+
J as u
|
|
116
116
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import n, { useState as b, useCallback as g, useRef as M } from "react";
|
|
2
2
|
import { UNSAFE_PortalProvider as k } from "react-aria";
|
|
3
3
|
import { Select as q, SelectValue as G, ListBoxItem as H } from "react-aria-components";
|
|
4
|
-
import {
|
|
4
|
+
import { by as E, bv as O, bA as J, J as U } from "./form-GAuLAdjq.js";
|
|
5
5
|
import { f as d, a as F } from "./find-child-C60k4CxG.js";
|
|
6
|
-
import { D as
|
|
7
|
-
import { L as
|
|
8
|
-
import { E as
|
|
9
|
-
import { a as X } from "./use-is-forced-open-dropdown-
|
|
10
|
-
import { V as Z } from "./use-dropdown-option-class-name-
|
|
11
|
-
import { u as $ } from "./use-hoverable-input-class-name-
|
|
6
|
+
import { D as W, E as Y } from "./field-error-headless-DAc8FpKI.js";
|
|
7
|
+
import { L as j } from "./field-label-headless-DxxwJtjh.js";
|
|
8
|
+
import { E as z, S as K, N as Q } from "./non-modal-popover-D-u13tmp.js";
|
|
9
|
+
import { a as X } from "./use-is-forced-open-dropdown-B5gNY4Zm.js";
|
|
10
|
+
import { V as Z } from "./use-dropdown-option-class-name-CYkLlKBs.js";
|
|
11
|
+
import { u as $ } from "./use-hoverable-input-class-name-Duhgtn2I.js";
|
|
12
12
|
const r = ({ children: e }) => {
|
|
13
|
-
const { id: l, value: a, defaultValue: o, options: u = [], readOnly: s, onChange: t, placeholder: m, disabled: i, required: v, onBlur: D, onFocus: C, FieldLayout: L, hasError:
|
|
13
|
+
const { id: l, value: a, defaultValue: o, options: u = [], readOnly: s, onChange: t, placeholder: m, disabled: i, required: v, onBlur: D, onFocus: C, FieldLayout: L, hasError: y } = E(), [I, N] = b(!1), p = X(l), [P, R] = b(null), T = a && u.some((c) => (c.value ?? c.label) === a) ? a : o || null, { labelId: h } = O(), S = g((c) => {
|
|
14
14
|
s || t(typeof c == "string" ? c : null);
|
|
15
15
|
}, [
|
|
16
16
|
t,
|
|
@@ -32,13 +32,13 @@ const r = ({ children: e }) => {
|
|
|
32
32
|
}, /* @__PURE__ */ n.createElement(q, {
|
|
33
33
|
"aria-labelledby": h,
|
|
34
34
|
value: T,
|
|
35
|
-
isOpen: p ||
|
|
35
|
+
isOpen: p || I && !i && !s,
|
|
36
36
|
onOpenChange: p ? void 0 : B,
|
|
37
37
|
onChange: S,
|
|
38
38
|
isDisabled: i,
|
|
39
|
-
isInvalid:
|
|
39
|
+
isInvalid: y,
|
|
40
40
|
isRequired: v,
|
|
41
|
-
placeholder: m ||
|
|
41
|
+
placeholder: m || z,
|
|
42
42
|
onBlur: D,
|
|
43
43
|
onFocus: C
|
|
44
44
|
}, _, F(w, {
|
|
@@ -48,12 +48,12 @@ const r = ({ children: e }) => {
|
|
|
48
48
|
});
|
|
49
49
|
}, ee = ({ children: e, className: l }) => {
|
|
50
50
|
const { inputId: a, ariaDescribedBy: o } = O(), { id: u, hasError: s, isLoading: t } = E(), m = M(null);
|
|
51
|
-
return
|
|
51
|
+
return J(() => {
|
|
52
52
|
var i;
|
|
53
53
|
(i = m.current) == null || i.focus({
|
|
54
54
|
preventScroll: !0
|
|
55
55
|
});
|
|
56
|
-
}, u), /* @__PURE__ */ n.createElement(
|
|
56
|
+
}, u), /* @__PURE__ */ n.createElement(K, {
|
|
57
57
|
ref: m,
|
|
58
58
|
id: a,
|
|
59
59
|
"aria-describedby": o,
|
|
@@ -84,12 +84,12 @@ const r = ({ children: e }) => {
|
|
|
84
84
|
}, o);
|
|
85
85
|
};
|
|
86
86
|
f.Option = ne;
|
|
87
|
-
r.Label =
|
|
87
|
+
r.Label = j;
|
|
88
88
|
r.Trigger = ee;
|
|
89
89
|
r.Options = f;
|
|
90
|
-
r.Description =
|
|
91
|
-
r.Error =
|
|
92
|
-
const pe = (...e) => $(
|
|
90
|
+
r.Description = W;
|
|
91
|
+
r.Error = Y;
|
|
92
|
+
const pe = (...e) => $(U, e);
|
|
93
93
|
export {
|
|
94
94
|
r as D,
|
|
95
95
|
pe as u
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import i from "classnames";
|
|
2
|
-
import {
|
|
2
|
+
import { br as s, a_ as v } from "./form-GAuLAdjq.js";
|
|
3
3
|
const x = ({ globalClasses: e, moduleClasses: r }) => {
|
|
4
4
|
var d;
|
|
5
5
|
const c = ((d = s(...v(e))) == null ? void 0 : d.split(/\s+/)) ?? [], o = [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { s as e } from "./field-rac.module-
|
|
3
|
-
import { u } from "./use-element-state-class-name-
|
|
1
|
+
import { by as n } from "./form-GAuLAdjq.js";
|
|
2
|
+
import { s as e } from "./field-rac.module-ts2t4WUO.js";
|
|
3
|
+
import { u } from "./use-element-state-class-name-ByDw6j7c.js";
|
|
4
4
|
const b = (s, a) => {
|
|
5
5
|
const { disabled: t, readOnly: o } = n(), r = u({
|
|
6
6
|
globalClasses: s,
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { useContext as c, useMemo as i } from "react";
|
|
2
|
+
import { bs as r, aE as a, bq as d, F as o } from "./form-GAuLAdjq.js";
|
|
3
|
+
const u = [
|
|
4
|
+
o.DROPDOWN,
|
|
5
|
+
o.DEXT_DROPDOWN,
|
|
6
|
+
o.SERVICES_DROPDOWN,
|
|
7
|
+
o.DATE_INPUT,
|
|
8
|
+
o.CONTACTS_BIRTHDATE,
|
|
9
|
+
o.DATE_TIME_INPUT,
|
|
10
|
+
o.DEXT_DATE_TIME_INPUT
|
|
11
|
+
], T = [
|
|
12
|
+
o.DATE_PICKER,
|
|
13
|
+
o.DEXT_DATE_PICKER
|
|
14
|
+
], O = [
|
|
15
|
+
o.PHONE,
|
|
16
|
+
o.CONTACTS_PHONE,
|
|
17
|
+
o.BOOKINGS_PHONE,
|
|
18
|
+
o.DEXT_PHONE
|
|
19
|
+
], p = [
|
|
20
|
+
o.MULTILINE_ADDRESS,
|
|
21
|
+
o.BOOKINGS_ADDRESS,
|
|
22
|
+
o.ECOM_ADDRESS
|
|
23
|
+
], _ = ({ properties: e }) => {
|
|
24
|
+
var n, t, s, D;
|
|
25
|
+
return ((D = (s = (t = (n = e.validation) == null ? void 0 : n.string) == null ? void 0 : t.phoneOptions) == null ? void 0 : s.allowedCountryCodes) == null ? void 0 : D.length) !== 1;
|
|
26
|
+
}, I = ({ properties: e }) => {
|
|
27
|
+
var n, t;
|
|
28
|
+
return ((t = (n = e.fieldSettings) == null ? void 0 : n.country) == null ? void 0 : t.show) !== !1;
|
|
29
|
+
}, P = (e, n) => O.includes(e.fieldType) && !n && _(e), l = (e) => p.includes(e.fieldType) ? I(e) : u.includes(e.fieldType), S = (e) => T.includes(e.fieldType), C = ({ properties: e }) => !e.disabled && !e.readOnly, E = (e) => {
|
|
30
|
+
const n = c(a), { isMobile: t = !1 } = d();
|
|
31
|
+
return i(() => !n || n.parentId ? [] : n.fields.filter((s) => e(s, t) && C(s)).map((s) => s.id), [
|
|
32
|
+
n,
|
|
33
|
+
t,
|
|
34
|
+
e
|
|
35
|
+
]);
|
|
36
|
+
}, R = (e) => {
|
|
37
|
+
var s;
|
|
38
|
+
const n = ((s = r().dropdown) == null ? void 0 : s.open) === !0, t = E(l);
|
|
39
|
+
return n && t.includes(e);
|
|
40
|
+
}, f = (e) => {
|
|
41
|
+
var s;
|
|
42
|
+
const n = ((s = r().phone) == null ? void 0 : s.open) === !0, t = E(P);
|
|
43
|
+
return n && t.includes(e);
|
|
44
|
+
}, h = (e) => {
|
|
45
|
+
var s;
|
|
46
|
+
const n = ((s = r().datePicker) == null ? void 0 : s.open) === !0, t = E(S);
|
|
47
|
+
return n && t.includes(e);
|
|
48
|
+
};
|
|
49
|
+
export {
|
|
50
|
+
R as a,
|
|
51
|
+
f as b,
|
|
52
|
+
h as u
|
|
53
|
+
};
|
package/dist/component/{use-service-options-base-CLeE9-Tx.js → use-service-options-base-DE-QaNDw.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useState as o, useCallback as
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
const { fieldType: L, isEditor: t = !1, postProcessOptions: i, customFetchLogic: a, onInitialDataLoaded: n } = I, [O, h] = o(!1), [g, p] = o([]), [
|
|
1
|
+
import { useState as o, useCallback as y, useEffect as m, useMemo as D } from "react";
|
|
2
|
+
import { bx as v } from "./form-GAuLAdjq.js";
|
|
3
|
+
const S = (I) => {
|
|
4
|
+
const { fieldType: L, isEditor: t = !1, postProcessOptions: i, customFetchLogic: a, onInitialDataLoaded: n } = I, [O, h] = o(!1), [g, p] = o([]), [E, u] = o(!1), [c, f] = o(!1), s = v(L), r = y((e) => {
|
|
5
5
|
let d = e.map((l) => ({
|
|
6
6
|
value: l.id ?? "",
|
|
7
7
|
label: l.name ?? "",
|
|
@@ -26,16 +26,16 @@ const k = (I) => {
|
|
|
26
26
|
a,
|
|
27
27
|
t
|
|
28
28
|
]);
|
|
29
|
-
const
|
|
29
|
+
const b = D(() => t || c, [
|
|
30
30
|
t,
|
|
31
31
|
c
|
|
32
32
|
]);
|
|
33
33
|
return {
|
|
34
34
|
isLoading: O,
|
|
35
35
|
options: g,
|
|
36
|
-
isEmpty:
|
|
36
|
+
isEmpty: E,
|
|
37
37
|
hasInitialDataLoaded: c,
|
|
38
|
-
shouldRender:
|
|
38
|
+
shouldRender: b,
|
|
39
39
|
setIsLoading: h,
|
|
40
40
|
setOptions: p,
|
|
41
41
|
setIsEmpty: u,
|
|
@@ -44,5 +44,5 @@ const k = (I) => {
|
|
|
44
44
|
};
|
|
45
45
|
};
|
|
46
46
|
export {
|
|
47
|
-
|
|
47
|
+
S as u
|
|
48
48
|
};
|
package/dist/form.d.ts
CHANGED
|
@@ -7000,6 +7000,9 @@ type ElementProps = ElementTree & {
|
|
|
7000
7000
|
}> & {
|
|
7001
7001
|
open?: boolean;
|
|
7002
7002
|
};
|
|
7003
|
+
appointment?: ElementEntry & {
|
|
7004
|
+
noAvailability?: boolean;
|
|
7005
|
+
};
|
|
7003
7006
|
signature?: ElementEntry<ElementTree & {
|
|
7004
7007
|
dropZone?: ElementEntry<{
|
|
7005
7008
|
uploadButton?: ElementEntry<{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/form-elements",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.162.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": "8c3d920c64ec11241965dd5e436df9dd6770d4b56befe8c533bfd2aa"
|
|
160
160
|
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
const t = "_label_t702n_1", o = "_requiredMark_t702n_11", e = "_input_t702n_16", n = "_inputGroup_t702n_17", c = "_inputHover_t702n_70", _ = "_innerInput_t702n_151", r = "_dropdownTrigger_t702n_201", p = "_dropdownIcon_t702n_211", s = "_dropdownPopover_t702n_230", i = "_selectPopover_t702n_236", u = "_selectOption_t702n_263", d = "_selectOptionHover_t702n_286", l = "_selectOptionSelected_t702n_290", h = "_selectOptionWithoutFocusRing_t702n_294", b = "_description_t702n_300", k = "_error_t702n_316", v = "_checkbox_t702n_335", I = "_checkboxInput_t702n_358", x = "_checkboxInputSelected_t702n_397", O = "_checkboxInputHover_t702n_401", g = {
|
|
2
|
-
label: t,
|
|
3
|
-
requiredMark: o,
|
|
4
|
-
input: e,
|
|
5
|
-
inputGroup: n,
|
|
6
|
-
inputHover: c,
|
|
7
|
-
innerInput: _,
|
|
8
|
-
dropdownTrigger: r,
|
|
9
|
-
dropdownIcon: p,
|
|
10
|
-
dropdownPopover: s,
|
|
11
|
-
selectPopover: i,
|
|
12
|
-
selectOption: u,
|
|
13
|
-
selectOptionHover: d,
|
|
14
|
-
selectOptionSelected: l,
|
|
15
|
-
selectOptionWithoutFocusRing: h,
|
|
16
|
-
description: b,
|
|
17
|
-
error: k,
|
|
18
|
-
checkbox: v,
|
|
19
|
-
checkboxInput: I,
|
|
20
|
-
checkboxInputSelected: x,
|
|
21
|
-
checkboxInputHover: O
|
|
22
|
-
};
|
|
23
|
-
export {
|
|
24
|
-
g as s
|
|
25
|
-
};
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import e, { useMemo as H, useCallback as T, useRef as G } from "react";
|
|
2
|
-
import { RicosViewer as k } from "@wix/ricos/viewer";
|
|
3
|
-
import I from "classnames";
|
|
4
|
-
import { bz as b, bw as x, bB as B, bs as P, V as q, ab as U, R as w, T as z, L as V, z as K, S as Q, f } from "./form-DSpx-AO8.js";
|
|
5
|
-
import { CheckboxGroup as Y, CheckboxField as $, CheckboxButton as j } from "react-aria-components";
|
|
6
|
-
import { f as m, a as F } from "./find-child-C60k4CxG.js";
|
|
7
|
-
import { L as J, g as W } from "./field-label-headless-CORRAJGt.js";
|
|
8
|
-
import { D as X, E as Z } from "./field-error-headless-XNWmDH3E.js";
|
|
9
|
-
import { F as ee } from "./fieldset-headless-CD3fds9J.js";
|
|
10
|
-
import { E as te } from "./error-icon-hZxQ6DEy.js";
|
|
11
|
-
import { s as O } from "./field-rac.module-DP0lkkEv.js";
|
|
12
|
-
import { u as oe } from "./use-element-state-class-name-rXM_lHug.js";
|
|
13
|
-
const o = ({ children: t, className: n }) => {
|
|
14
|
-
const { id: s, value: a, onChange: i, disabled: l, readOnly: r, required: c, onBlur: u, onFocus: p, hasError: C, FieldLayout: L } = b(), { inputId: g, labelId: _, ariaDescribedBy: h } = x(), N = m(t, o.Label), S = m(t, o.Options), A = m(t, o.Description), D = m(t, o.Error), M = H(() => a || [], [
|
|
15
|
-
a
|
|
16
|
-
]), v = T((y) => {
|
|
17
|
-
i == null || i(y);
|
|
18
|
-
}, [
|
|
19
|
-
i
|
|
20
|
-
]);
|
|
21
|
-
return /* @__PURE__ */ e.createElement(L, {
|
|
22
|
-
fieldId: s,
|
|
23
|
-
renderLabel: () => N,
|
|
24
|
-
renderInput: () => /* @__PURE__ */ e.createElement(ee, {
|
|
25
|
-
id: g,
|
|
26
|
-
ariaLabelledBy: _,
|
|
27
|
-
ariaDescribedBy: h,
|
|
28
|
-
required: c,
|
|
29
|
-
onBlur: u,
|
|
30
|
-
onFocus: p
|
|
31
|
-
}, /* @__PURE__ */ e.createElement(Y, {
|
|
32
|
-
className: n,
|
|
33
|
-
"aria-labelledby": _,
|
|
34
|
-
value: M,
|
|
35
|
-
onChange: v,
|
|
36
|
-
isDisabled: l,
|
|
37
|
-
isReadOnly: r,
|
|
38
|
-
isRequired: c,
|
|
39
|
-
isInvalid: C
|
|
40
|
-
}, S)),
|
|
41
|
-
renderDescription: () => /* @__PURE__ */ e.createElement(e.Fragment, null, D, A)
|
|
42
|
-
});
|
|
43
|
-
}, R = ({ children: t, className: n }) => {
|
|
44
|
-
const { id: s, options: a, numberOfColumns: i } = b(), l = m(t, R.Option);
|
|
45
|
-
return /* @__PURE__ */ e.createElement("div", {
|
|
46
|
-
className: n,
|
|
47
|
-
"data-columns": i
|
|
48
|
-
}, a == null ? void 0 : a.map((r, c) => F(l, {
|
|
49
|
-
key: r.id || r.label,
|
|
50
|
-
option: r,
|
|
51
|
-
isFirst: c === 0,
|
|
52
|
-
fieldId: s
|
|
53
|
-
})));
|
|
54
|
-
}, ae = ({ className: t }) => /* @__PURE__ */ e.createElement("div", {
|
|
55
|
-
"aria-hidden": "true",
|
|
56
|
-
className: t
|
|
57
|
-
}), ne = ({ className: t, ...n }) => {
|
|
58
|
-
var u, p;
|
|
59
|
-
const { option: s } = n, { choiceImageResize: a, choiceImageAlignment: i } = b(), l = (u = s.media) == null ? void 0 : u.image, r = l && W(l, l.width, l.height);
|
|
60
|
-
if (!l || !r)
|
|
61
|
-
return /* @__PURE__ */ e.createElement("div", {
|
|
62
|
-
className: t,
|
|
63
|
-
"data-placeholder": !0,
|
|
64
|
-
"data-hook": "image-choice-option-image"
|
|
65
|
-
});
|
|
66
|
-
const c = ((p = s.media) == null ? void 0 : p.altText) || s.altText || l.altText || "";
|
|
67
|
-
return /* @__PURE__ */ e.createElement("img", {
|
|
68
|
-
className: t,
|
|
69
|
-
src: r,
|
|
70
|
-
alt: c,
|
|
71
|
-
"data-fit": a,
|
|
72
|
-
"data-alignment": i,
|
|
73
|
-
"data-hook": "image-choice-option-image"
|
|
74
|
-
});
|
|
75
|
-
}, se = ({ className: t, ...n }) => {
|
|
76
|
-
const { option: s } = n;
|
|
77
|
-
return !s.label || s.isLabelHidden ? null : /* @__PURE__ */ e.createElement("span", {
|
|
78
|
-
className: t
|
|
79
|
-
}, s.label);
|
|
80
|
-
}, E = ({ children: t, className: n, ...s }) => {
|
|
81
|
-
const { option: a, isFirst: i = !1, fieldId: l } = s, { disabled: r, readOnly: c, hasError: u } = b(), p = G(null);
|
|
82
|
-
B(() => {
|
|
83
|
-
var _;
|
|
84
|
-
i && ((_ = p.current) == null || _.focus({
|
|
85
|
-
preventScroll: !0
|
|
86
|
-
}));
|
|
87
|
-
}, l);
|
|
88
|
-
const C = m(t, E.Input), L = m(t, E.Image), g = m(t, E.Label);
|
|
89
|
-
return /* @__PURE__ */ e.createElement($, {
|
|
90
|
-
value: a.label,
|
|
91
|
-
isDisabled: r,
|
|
92
|
-
isReadOnly: c,
|
|
93
|
-
isInvalid: u
|
|
94
|
-
}, /* @__PURE__ */ e.createElement(j, {
|
|
95
|
-
ref: p,
|
|
96
|
-
"aria-label": a.isLabelHidden ? a.label : void 0,
|
|
97
|
-
className: n,
|
|
98
|
-
"data-hook": `image-choice-${a.label}`
|
|
99
|
-
}, C, F(L, {
|
|
100
|
-
option: a
|
|
101
|
-
}), F(g, {
|
|
102
|
-
option: a
|
|
103
|
-
})));
|
|
104
|
-
};
|
|
105
|
-
E.Input = ae;
|
|
106
|
-
E.Image = ne;
|
|
107
|
-
E.Label = se;
|
|
108
|
-
o.Label = J;
|
|
109
|
-
o.Options = R;
|
|
110
|
-
R.Option = E;
|
|
111
|
-
o.Description = X;
|
|
112
|
-
o.Error = Z;
|
|
113
|
-
const le = "_options_1h2d0_1", ie = "_optionInput_1h2d0_33", re = "_option_1h2d0_1", ce = "_optionHover_1h2d0_67", me = "_optionSelected_1h2d0_67", pe = "_optionLabel_1h2d0_107", de = "_optionImage_1h2d0_152", d = {
|
|
114
|
-
options: le,
|
|
115
|
-
optionInput: ie,
|
|
116
|
-
option: re,
|
|
117
|
-
optionHover: ce,
|
|
118
|
-
optionSelected: me,
|
|
119
|
-
optionLabel: pe,
|
|
120
|
-
optionImage: de
|
|
121
|
-
}, Ee = ({ content: t, locale: n }) => /* @__PURE__ */ e.createElement(k, {
|
|
122
|
-
content: t,
|
|
123
|
-
locale: n
|
|
124
|
-
}), ue = {
|
|
125
|
-
base: d.option,
|
|
126
|
-
selected: d.optionSelected,
|
|
127
|
-
hover: d.optionHover
|
|
128
|
-
}, Ie = () => {
|
|
129
|
-
const t = oe({
|
|
130
|
-
globalClasses: Q,
|
|
131
|
-
moduleClasses: ue
|
|
132
|
-
}), n = P(f.IMAGE_CHOICE, f.IMAGE_CHOICE_OPTION, f.IMAGE_CHOICE_OPTION_IMAGE);
|
|
133
|
-
return /* @__PURE__ */ e.createElement(o, null, /* @__PURE__ */ e.createElement(o.Label, {
|
|
134
|
-
className: I(q, O.label)
|
|
135
|
-
}, /* @__PURE__ */ e.createElement(o.Label.Required, {
|
|
136
|
-
className: I(U, O.requiredMark)
|
|
137
|
-
})), /* @__PURE__ */ e.createElement(o.Options, {
|
|
138
|
-
className: I(w, d.options)
|
|
139
|
-
}, /* @__PURE__ */ e.createElement(o.Options.Option, {
|
|
140
|
-
className: t
|
|
141
|
-
}, /* @__PURE__ */ e.createElement(o.Options.Option.Input, {
|
|
142
|
-
className: d.optionInput
|
|
143
|
-
}), /* @__PURE__ */ e.createElement(o.Options.Option.Image, {
|
|
144
|
-
className: I(z, d.optionImage, n)
|
|
145
|
-
}), /* @__PURE__ */ e.createElement(o.Options.Option.Label, {
|
|
146
|
-
className: d.optionLabel
|
|
147
|
-
}))), /* @__PURE__ */ e.createElement(o.Error, {
|
|
148
|
-
className: I(V, O.error)
|
|
149
|
-
}, /* @__PURE__ */ e.createElement(te, null), /* @__PURE__ */ e.createElement(o.Error.Text, null)), /* @__PURE__ */ e.createElement(o.Description, {
|
|
150
|
-
className: I(K, O.description)
|
|
151
|
-
}, Ee));
|
|
152
|
-
}, Ae = () => /* @__PURE__ */ e.createElement(Ie, null);
|
|
153
|
-
export {
|
|
154
|
-
Ae as ImageChoiceRAC
|
|
155
|
-
};
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { RicosViewer as N } from "@wix/ricos/viewer";
|
|
2
|
-
import i from "classnames";
|
|
3
|
-
import r, { useCallback as h, useRef as O } from "react";
|
|
4
|
-
import { TextField as y, Input as A } from "react-aria-components";
|
|
5
|
-
import { bz as d, bw as E, bB as B, V as v, ab as T, L as g, z as k } from "./form-DSpx-AO8.js";
|
|
6
|
-
import { f as c } from "./find-child-C60k4CxG.js";
|
|
7
|
-
import { D as M, E as P } from "./field-error-headless-XNWmDH3E.js";
|
|
8
|
-
import { L as q } from "./field-label-headless-CORRAJGt.js";
|
|
9
|
-
import { u as x } from "./use-invoke-callback-UH73A_J3.js";
|
|
10
|
-
import { E as U } from "./error-icon-hZxQ6DEy.js";
|
|
11
|
-
import { s as u } from "./field-rac.module-DP0lkkEv.js";
|
|
12
|
-
import { u as w } from "./use-text-input-class-name-DIKWvfkm.js";
|
|
13
|
-
const V = (t) => t ? `https://${String(t).replace(/^https?:\/\//, "")}` : "", e = ({ children: t }) => {
|
|
14
|
-
const { id: o, value: l, onChange: n, disabled: m, readOnly: s, required: a, hasError: I, onBlur: b, onFocus: f, FieldLayout: L } = d(), { labelId: R } = E(), p = x(b), F = c(t, e.Label), D = c(t, e.Input), C = c(t, e.Description), _ = c(t, e.Error), S = h(() => {
|
|
15
|
-
n(V(l)), p();
|
|
16
|
-
}, [
|
|
17
|
-
p,
|
|
18
|
-
n,
|
|
19
|
-
l
|
|
20
|
-
]);
|
|
21
|
-
return /* @__PURE__ */ r.createElement(L, {
|
|
22
|
-
fieldId: o,
|
|
23
|
-
renderLabel: () => F,
|
|
24
|
-
renderInput: () => /* @__PURE__ */ r.createElement(y, {
|
|
25
|
-
"aria-labelledby": R,
|
|
26
|
-
value: l ?? "",
|
|
27
|
-
onChange: n,
|
|
28
|
-
isDisabled: m,
|
|
29
|
-
isReadOnly: s,
|
|
30
|
-
isRequired: a,
|
|
31
|
-
isInvalid: I,
|
|
32
|
-
onBlur: S,
|
|
33
|
-
onFocus: f
|
|
34
|
-
}, D),
|
|
35
|
-
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, _, C)
|
|
36
|
-
});
|
|
37
|
-
}, z = ({ className: t }) => {
|
|
38
|
-
const { id: o, placeholder: l } = d(), { inputId: n, ariaDescribedBy: m } = E(), s = O(null);
|
|
39
|
-
return B(() => {
|
|
40
|
-
var a;
|
|
41
|
-
(a = s.current) == null || a.focus({
|
|
42
|
-
preventScroll: !0
|
|
43
|
-
});
|
|
44
|
-
}, o), /* @__PURE__ */ r.createElement(A, {
|
|
45
|
-
ref: s,
|
|
46
|
-
id: n,
|
|
47
|
-
type: "url",
|
|
48
|
-
autoComplete: "url",
|
|
49
|
-
"aria-describedby": m,
|
|
50
|
-
className: t,
|
|
51
|
-
placeholder: l
|
|
52
|
-
});
|
|
53
|
-
};
|
|
54
|
-
e.Label = q;
|
|
55
|
-
e.Input = z;
|
|
56
|
-
e.Description = M;
|
|
57
|
-
e.Error = P;
|
|
58
|
-
const W = ({ content: t, locale: o }) => /* @__PURE__ */ r.createElement(N, {
|
|
59
|
-
content: t,
|
|
60
|
-
locale: o
|
|
61
|
-
}), te = () => {
|
|
62
|
-
const t = w();
|
|
63
|
-
return /* @__PURE__ */ r.createElement(e, null, /* @__PURE__ */ r.createElement(e.Label, {
|
|
64
|
-
className: i(v, u.label)
|
|
65
|
-
}, /* @__PURE__ */ r.createElement(e.Label.Required, {
|
|
66
|
-
className: i(T, u.requiredMark)
|
|
67
|
-
})), /* @__PURE__ */ r.createElement(e.Input, {
|
|
68
|
-
className: t
|
|
69
|
-
}), /* @__PURE__ */ r.createElement(e.Error, {
|
|
70
|
-
className: i(g, u.error)
|
|
71
|
-
}, /* @__PURE__ */ r.createElement(U, null), /* @__PURE__ */ r.createElement(e.Error.Text, null)), /* @__PURE__ */ r.createElement(e.Description, {
|
|
72
|
-
className: i(k, u.description)
|
|
73
|
-
}, W));
|
|
74
|
-
};
|
|
75
|
-
export {
|
|
76
|
-
te as U
|
|
77
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { useContext as c, useMemo as i } from "react";
|
|
2
|
-
import { bt as r, aF as a, br as d, F as t } from "./form-DSpx-AO8.js";
|
|
3
|
-
const u = [
|
|
4
|
-
t.DROPDOWN,
|
|
5
|
-
t.DEXT_DROPDOWN,
|
|
6
|
-
t.SERVICES_DROPDOWN,
|
|
7
|
-
t.DATE_INPUT,
|
|
8
|
-
t.CONTACTS_BIRTHDATE,
|
|
9
|
-
t.DATE_TIME_INPUT,
|
|
10
|
-
t.DEXT_DATE_TIME_INPUT
|
|
11
|
-
], T = [
|
|
12
|
-
t.DATE_PICKER,
|
|
13
|
-
t.DEXT_DATE_PICKER
|
|
14
|
-
], O = [
|
|
15
|
-
t.PHONE,
|
|
16
|
-
t.CONTACTS_PHONE,
|
|
17
|
-
t.BOOKINGS_PHONE,
|
|
18
|
-
t.DEXT_PHONE
|
|
19
|
-
], p = [
|
|
20
|
-
t.MULTILINE_ADDRESS,
|
|
21
|
-
t.BOOKINGS_ADDRESS,
|
|
22
|
-
t.ECOM_ADDRESS
|
|
23
|
-
], _ = ({ properties: e }) => {
|
|
24
|
-
var n, o, s, D;
|
|
25
|
-
return ((D = (s = (o = (n = e.validation) == null ? void 0 : n.string) == null ? void 0 : o.phoneOptions) == null ? void 0 : s.allowedCountryCodes) == null ? void 0 : D.length) !== 1;
|
|
26
|
-
}, I = ({ properties: e }) => {
|
|
27
|
-
var n, o;
|
|
28
|
-
return ((o = (n = e.fieldSettings) == null ? void 0 : n.country) == null ? void 0 : o.show) !== !1;
|
|
29
|
-
}, P = (e, n) => O.includes(e.fieldType) && !n && _(e), l = (e) => p.includes(e.fieldType) ? I(e) : u.includes(e.fieldType), S = (e) => T.includes(e.fieldType), C = ({ properties: e }) => !e.disabled && !e.readOnly, E = (e) => {
|
|
30
|
-
const n = c(a), { isMobile: o = !1 } = d();
|
|
31
|
-
return i(() => !n || n.parentId ? [] : n.fields.filter((s) => e(s, o) && C(s)).map((s) => s.id), [
|
|
32
|
-
n,
|
|
33
|
-
o,
|
|
34
|
-
e
|
|
35
|
-
]);
|
|
36
|
-
}, R = (e) => {
|
|
37
|
-
var s;
|
|
38
|
-
const n = ((s = r().dropdown) == null ? void 0 : s.open) === !0, o = E(l);
|
|
39
|
-
return n && o.includes(e);
|
|
40
|
-
}, F = (e) => {
|
|
41
|
-
var s;
|
|
42
|
-
const n = ((s = r().phone) == null ? void 0 : s.open) === !0, o = E(P);
|
|
43
|
-
return n && o.includes(e);
|
|
44
|
-
}, f = (e) => {
|
|
45
|
-
var s;
|
|
46
|
-
const n = ((s = r().datePicker) == null ? void 0 : s.open) === !0, o = E(S);
|
|
47
|
-
return n && o.includes(e);
|
|
48
|
-
};
|
|
49
|
-
export {
|
|
50
|
-
R as a,
|
|
51
|
-
F as b,
|
|
52
|
-
f as u
|
|
53
|
-
};
|