@wix/form-elements 1.146.0 → 1.147.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-scUix9QX.js → appointment-rac-BG5-bIZU.js} +98 -98
- package/dist/component/{bookings-address-rac-CKemkJOO.js → bookings-address-rac-8e8PqKsp.js} +1 -1
- package/dist/component/{bookings-email-rac-CDqdhPAB.js → bookings-email-rac-CtlnU8ws.js} +1 -1
- package/dist/component/{bookings-first-name-rac-DEy_7Hjb.js → bookings-first-name-rac-CrivNlXM.js} +1 -1
- package/dist/component/{bookings-header-rac-Bl4xy9lB.js → bookings-header-rac-DWDAjfqq.js} +1 -1
- package/dist/component/{bookings-last-name-rac-CsL9xQ1W.js → bookings-last-name-rac-qAthWem2.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-DkHYQ4No.js → bookings-login-bar-rac-BNyUDqlM.js} +6 -6
- package/dist/component/{bookings-phone-rac-BoBiFwbV.js → bookings-phone-rac-Tc39XLr7.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-DZZnPKWA.js → bookings-rich-text-rac-CPNaPtFK.js} +1 -1
- package/dist/component/{checkbox-field-rac-UgLmJxB-.js → checkbox-field-rac-DEa78Tpf.js} +4 -4
- package/dist/component/{checkbox-group-field-headless-C809nB0Q.js → checkbox-group-field-headless-BxBaMg29.js} +68 -68
- package/dist/component/{checkbox-group-field-rac-u4i4wG21.js → checkbox-group-field-rac-CRRP03Qk.js} +7 -7
- package/dist/component/{checkbox-group-rac-DBAQhSo3.js → checkbox-group-rac-TOofMGl3.js} +1 -1
- package/dist/component/{checkbox-rac-FDQVsI5-.js → checkbox-rac-CHMHr8Ry.js} +1 -1
- package/dist/component/{contacts-address-rac-DnArylPa.js → contacts-address-rac-Bc5yDvTL.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-C19jhGEO.js → contacts-birthdate-rac-Ubtg5ncv.js} +1 -1
- package/dist/component/{contacts-company-rac-Dxs0hs_i.js → contacts-company-rac-BksH9IoV.js} +1 -1
- package/dist/component/{contacts-email-rac-D-H43L8r.js → contacts-email-rac-DDPEtMAm.js} +1 -1
- package/dist/component/{contacts-first-name-rac-DwV5NESk.js → contacts-first-name-rac-DUlCvEdx.js} +1 -1
- package/dist/component/{contacts-last-name-rac-C5v2xurf.js → contacts-last-name-rac-BikqNgUr.js} +1 -1
- package/dist/component/{contacts-phone-rac-D9a5x-xl.js → contacts-phone-rac-B4OEgM_8.js} +1 -1
- package/dist/component/{contacts-position-rac-DfsgOv-k.js → contacts-position-rac-BfybzySV.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-B-Hho0Kb.js → contacts-subscribe-rac-CMHb33v1.js} +1 -1
- package/dist/component/{contacts-tax-id-rac-q6TQkB4b.js → contacts-tax-id-rac-C-qEqwO5.js} +1 -1
- package/dist/component/{date-availability-CMDvf5VU.js → date-availability-DZ3J3LLm.js} +1 -1
- package/dist/component/{date-input-field-rac-C1WLUct3.js → date-input-field-rac-DeL5vuE7.js} +39 -39
- package/dist/component/{date-input-rac-cNQ-nr4D.js → date-input-rac-Di6TQvFf.js} +1 -1
- package/dist/component/{date-picker-field-rac-mx11z-MO.js → date-picker-field-rac-BcdpTkjV.js} +107 -103
- package/dist/component/{date-picker-rac-DeTz17zC.js → date-picker-rac-Brne65gr.js} +1 -1
- package/dist/component/{date-time-input-field-rac-feQ2E1eU.js → date-time-input-field-rac-BtQfAxRp.js} +49 -49
- package/dist/component/{date-time-input-rac-G0s0xP4v.js → date-time-input-rac-DM_HXiqV.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-BcTN1nJb.js → dext-checkbox-group-rac-WTVwhGG0.js} +2 -2
- package/dist/component/{dext-checkbox-rac-DX0TOrCO.js → dext-checkbox-rac-BR5YwmLQ.js} +1 -1
- package/dist/component/{dext-date-picker-rac-CpDp11oa.js → dext-date-picker-rac-DvDuRGYi.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-BRvO8izU.js → dext-date-time-input-rac-C6RgbaVv.js} +1 -1
- package/dist/component/{dext-dropdown-rac-DGZ4Yi_X.js → dext-dropdown-rac-CWjSdcZx.js} +1 -1
- package/dist/component/{dext-email-rac-B9YCFHB4.js → dext-email-rac-D-C1gVTq.js} +1 -1
- package/dist/component/{dext-number-input-rac-D890dBZf.js → dext-number-input-rac-YKzZS2ZG.js} +1 -1
- package/dist/component/{dext-phone-rac-BAQftbXo.js → dext-phone-rac-CFZlEH2a.js} +1 -1
- package/dist/component/dext-radio-group-rac-DiH0wIIl.js +18 -0
- package/dist/component/{dext-rating-input-rac-BqQKVaHo.js → dext-rating-input-rac-D0s-i0qO.js} +1 -1
- package/dist/component/{dext-tags-rac-zxxKcNUe.js → dext-tags-rac-Br48OQQ5.js} +2 -2
- package/dist/component/{dext-text-area-rac-Ctp9SwPg.js → dext-text-area-rac-6jG8gJ7i.js} +1 -1
- package/dist/component/{dext-text-input-rac-c_QMlyjr.js → dext-text-input-rac-FAJTCXuf.js} +1 -1
- package/dist/component/{dext-url-input-rac-96pv15aC.js → dext-url-input-rac-BoMP8sQB.js} +1 -1
- package/dist/component/{donation-rac-GEWKSLJY.js → donation-rac-DNi4p-v5.js} +69 -69
- package/dist/component/{dropdown-field-headless-C3OxMhLE.js → dropdown-field-headless-7SCC-xOC.js} +27 -27
- package/dist/component/{dropdown-field-rac-CCXfBmSc.js → dropdown-field-rac-CMzZh6J6.js} +8 -9
- package/dist/component/{dropdown-rac-CR7hswXE.js → dropdown-rac-qeugpHXY.js} +1 -1
- package/dist/component/{ecom-address-rac-khMuxEFD.js → ecom-address-rac-D8b_L5md.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-CAi_AHpb.js → ecom-subscription-checkbox-rac-BnAuR9La.js} +5 -5
- package/dist/component/{email-input-field-rac-B83mY2lg.js → email-input-field-rac-CunXRyc5.js} +62 -62
- package/dist/component/{events-repeater-rac-ClEwXgmb.js → events-repeater-rac-DMjyIOkB.js} +17 -17
- package/dist/component/{events-rsvp-rac-BJ5q2SVR.js → events-rsvp-rac-BsuDPq2K.js} +8 -8
- package/dist/component/{field-error-headless-CsYQCsiT.js → field-error-headless-E8WjFr_n.js} +6 -6
- package/dist/component/{field-label-headless-Yg_1PMSg.js → field-label-headless-BakLOu5E.js} +15 -15
- package/dist/component/{file-upload-rac-DJsuI_lR.js → file-upload-rac-Clu_c--0.js} +43 -43
- package/dist/component/{fixed-payment-rac-BMFe9wxU.js → fixed-payment-rac-CzAXxsb-.js} +12 -12
- package/dist/component/{form-Bed4Kfz8.js → form-DHAKwnLt.js} +311 -305
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +2 -2
- package/dist/component/{header-field-rac-DPQTrOSZ.js → header-field-rac-CwmVpz3r.js} +4 -4
- package/dist/component/{header-rac-CzXsuLmE.js → header-rac-ahkGRjSy.js} +1 -1
- package/dist/component/{image-choice-rac-R_4pbOSr.js → image-choice-rac-BwxkkdUu.js} +17 -17
- package/dist/component/{index-qSZCe_WC.js → index-BFi_n6B7.js} +2 -2
- package/dist/component/{index-DZxHlvzt.js → index-BQf23zZi.js} +91 -91
- package/dist/component/{isObjectLike-B-a5uaU-.js → isObjectLike-DHcMRYYH.js} +15 -15
- package/dist/component/{multiline-address-field-rac-rv4IZZy_.js → multiline-address-field-rac-C6xaqNOk.js} +60 -60
- package/dist/component/{multiline-address-rac-DZ7cYtgn.js → multiline-address-rac-DF4TFuDx.js} +1 -1
- package/dist/component/{number-input-field-rac-CL9iXKIf.js → number-input-field-rac-uVJ3SBv2.js} +27 -27
- package/dist/component/{number-input-rac-BeGn6qJR.js → number-input-rac-D6ERhrSM.js} +1 -1
- package/dist/component/{password-rac-DfvhdsKG.js → password-rac-CAiC0ZKl.js} +23 -23
- package/dist/component/{payment-input-rac-BmMfi5rf.js → payment-input-rac-Bu25xvby.js} +26 -26
- package/dist/component/{phone-input-field-rac-DW0a1pXs.js → phone-input-field-rac-32qUvCsC.js} +45 -45
- package/dist/component/{phone-rac-quZjJ08H.js → phone-rac-mNrpj30q.js} +1 -1
- package/dist/component/{product-list-rac-Ci0KB7sN.js → product-list-rac-zHdM9rHw.js} +53 -53
- package/dist/component/{quiz-radio-group-rac--UUtGx2t.js → quiz-radio-group-rac-BaSlT8w3.js} +1 -1
- package/dist/component/{radio-button-module-classes-CqdBGknT.js → radio-button-module-classes-BdWjkBlX.js} +9 -9
- package/dist/component/{radio-group-field-rac-w8fHpFKJ.js → radio-group-field-rac-DI0UgTBr.js} +12 -12
- package/dist/component/{radio-group-rac-jO8aghii.js → radio-group-rac-D2ESG8J4.js} +1 -1
- package/dist/component/{rating-input-field-rac-BRc2PtqE.js → rating-input-field-rac-BYT2XqOK.js} +26 -26
- package/dist/component/{rating-input-rac-D9zs06xR.js → rating-input-rac-D-5CmVAX.js} +1 -1
- package/dist/component/{rich-content-rac.module-Cv3ZmD00.js → rich-content-rac.module-Dp9Advo9.js} +8 -8
- package/dist/component/{rich-text-field-rac-BmWuIfA8.js → rich-text-field-rac-COEUwoXQ.js} +4 -4
- package/dist/component/{rich-text-rac-BnqnrvB1.js → rich-text-rac-CQZLjBQ0.js} +1 -1
- package/dist/component/{service-dropdown-rac-Cl81KfJU.js → service-dropdown-rac-BTtJVFv8.js} +44 -45
- package/dist/component/{services-multi-choice-rac-sQ1NF9hY.js → services-multi-choice-rac-hbY3g0Kb.js} +11 -11
- package/dist/component/{signature-rac-Huairu7V.js → signature-rac-CTCNclwL.js} +67 -67
- package/dist/component/{submit-button-rac-Dpg7N0TG.js → submit-button-rac-kKGeVgsG.js} +25 -25
- package/dist/component/{tags-field-rac-BQ8TEqXH.js → tags-field-rac-CVf7oQr_.js} +35 -35
- package/dist/component/{tags-rac-CFOmyCCc.js → tags-rac-DiX1_nTT.js} +1 -1
- package/dist/component/{text-area-field-rac-DNiMa7d3.js → text-area-field-rac-IhBNXiDl.js} +22 -22
- package/dist/component/{text-area-rac-kLFe-KbZ.js → text-area-rac-DHevCtFF.js} +1 -1
- package/dist/component/{text-input-field-rac-CqENSUUX.js → text-input-field-rac-Da3_wTdh.js} +5 -5
- package/dist/component/{text-input-headless-BdPkEeK2.js → text-input-headless-DcZRRXCp.js} +9 -9
- package/dist/component/{text-input-rac-uYQEfOtE.js → text-input-rac-564LIZ1_.js} +1 -1
- package/dist/component/{time-input-rac-BYoojlJ9.js → time-input-rac-p-Nnsxp_.js} +54 -54
- package/dist/component/{url-input-field-rac-BioH7kuz.js → url-input-field-rac-DjrcpRtm.js} +25 -25
- package/dist/component/{url-input-rac-D2VSSyqW.js → url-input-rac-B3brpyop.js} +1 -1
- package/dist/component/use-dropdown-trigger-class-name-BWTT7ltv.js +117 -0
- package/dist/component/{use-element-state-class-name-oiKCauK-.js → use-element-state-class-name-CUZuhFvZ.js} +3 -3
- package/dist/component/{use-hoverable-input-class-name-BW3nCyhG.js → use-hoverable-input-class-name-ugX8-g4E.js} +6 -6
- package/dist/component/use-is-forced-open-dropdown-DUZMvWpk.js +48 -0
- package/dist/component/{use-service-options-base-DXG60hA5.js → use-service-options-base-hqO9Ev38.js} +6 -6
- package/dist/component/use-text-input-class-name-wp9dzpEy.js +6 -0
- package/dist/form.d.ts +5 -0
- package/package.json +2 -2
- package/dist/component/dext-radio-group-rac-CtEjnu_X.js +0 -18
- package/dist/component/use-dropdown-option-class-name-BEmvU-Gg.js +0 -115
- package/dist/component/use-dropdown-trigger-class-name-qj9skLWZ.js +0 -40
- package/dist/component/use-text-input-class-name-BhQFcXYH.js +0 -6
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import { RicosViewer as
|
|
1
|
+
import { RicosViewer as N } from "@wix/ricos/viewer";
|
|
2
2
|
import i from "classnames";
|
|
3
3
|
import r, { useCallback as h, useRef as O } from "react";
|
|
4
4
|
import { TextField as y, Input as A } from "react-aria-components";
|
|
5
|
-
import {
|
|
5
|
+
import { bo as d, bl as E, bq as v, S as B, a0 as T, H as g, v as k } from "./form-DHAKwnLt.js";
|
|
6
6
|
import { f as c } from "./find-child-C60k4CxG.js";
|
|
7
|
-
import { D as
|
|
8
|
-
import { L as
|
|
7
|
+
import { D as q, E as M } from "./field-error-headless-E8WjFr_n.js";
|
|
8
|
+
import { L as P } from "./field-label-headless-BakLOu5E.js";
|
|
9
9
|
import { u as x } from "./use-invoke-callback-UH73A_J3.js";
|
|
10
10
|
import { E as U } from "./error-icon-hZxQ6DEy.js";
|
|
11
11
|
import { s as u } from "./field-rac.module-DfEb7pBp.js";
|
|
12
|
-
import { u as
|
|
13
|
-
const
|
|
14
|
-
const { id: o, value:
|
|
15
|
-
s(
|
|
12
|
+
import { u as w } from "./use-text-input-class-name-wp9dzpEy.js";
|
|
13
|
+
const H = (t) => t ? `https://${String(t).replace(/^https?:\/\//, "")}` : "", e = ({ children: t }) => {
|
|
14
|
+
const { id: o, value: l, onChange: s, disabled: m, readOnly: a, required: n, hasError: I, onBlur: b, onFocus: f, FieldLayout: R } = d(), { labelId: F } = E(), p = x(b), L = c(t, e.Label), D = c(t, e.Input), C = c(t, e.Description), _ = c(t, e.Error), S = h(() => {
|
|
15
|
+
s(H(l)), p();
|
|
16
16
|
}, [
|
|
17
17
|
p,
|
|
18
18
|
s,
|
|
19
|
-
|
|
19
|
+
l
|
|
20
20
|
]);
|
|
21
21
|
return /* @__PURE__ */ r.createElement(R, {
|
|
22
22
|
fieldId: o,
|
|
23
23
|
renderLabel: () => L,
|
|
24
24
|
renderInput: () => /* @__PURE__ */ r.createElement(y, {
|
|
25
25
|
"aria-labelledby": F,
|
|
26
|
-
value:
|
|
26
|
+
value: l ?? "",
|
|
27
27
|
onChange: s,
|
|
28
28
|
isDisabled: m,
|
|
29
|
-
isReadOnly:
|
|
30
|
-
isRequired:
|
|
29
|
+
isReadOnly: a,
|
|
30
|
+
isRequired: n,
|
|
31
31
|
isInvalid: I,
|
|
32
|
-
onBlur:
|
|
32
|
+
onBlur: S,
|
|
33
33
|
onFocus: f
|
|
34
34
|
}, D),
|
|
35
35
|
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, _, C)
|
|
36
36
|
});
|
|
37
37
|
}, V = ({ className: t }) => {
|
|
38
|
-
const { id: o, placeholder:
|
|
39
|
-
return
|
|
40
|
-
var
|
|
41
|
-
(
|
|
38
|
+
const { id: o, placeholder: l } = d(), { inputId: s, ariaDescribedBy: m } = E(), a = O(null);
|
|
39
|
+
return v(() => {
|
|
40
|
+
var n;
|
|
41
|
+
(n = a.current) == null || n.focus();
|
|
42
42
|
}, o), /* @__PURE__ */ r.createElement(A, {
|
|
43
|
-
ref:
|
|
43
|
+
ref: a,
|
|
44
44
|
id: s,
|
|
45
45
|
type: "url",
|
|
46
46
|
autoComplete: "url",
|
|
47
47
|
"aria-describedby": m,
|
|
48
48
|
className: t,
|
|
49
|
-
placeholder:
|
|
49
|
+
placeholder: l
|
|
50
50
|
});
|
|
51
51
|
};
|
|
52
|
-
e.Label =
|
|
52
|
+
e.Label = P;
|
|
53
53
|
e.Input = V;
|
|
54
|
-
e.Description =
|
|
55
|
-
e.Error =
|
|
56
|
-
const W = ({ content: t, locale: o }) => /* @__PURE__ */ r.createElement(
|
|
54
|
+
e.Description = q;
|
|
55
|
+
e.Error = M;
|
|
56
|
+
const W = ({ content: t, locale: o }) => /* @__PURE__ */ r.createElement(N, {
|
|
57
57
|
content: t,
|
|
58
58
|
locale: o
|
|
59
59
|
}), te = () => {
|
|
60
|
-
const t =
|
|
60
|
+
const t = w();
|
|
61
61
|
return /* @__PURE__ */ r.createElement(e, null, /* @__PURE__ */ r.createElement(e.Label, {
|
|
62
62
|
className: i(B, u.label)
|
|
63
63
|
}, /* @__PURE__ */ r.createElement(e.Label.Required, {
|
|
@@ -67,7 +67,7 @@ const W = ({ content: t, locale: o }) => /* @__PURE__ */ r.createElement(S, {
|
|
|
67
67
|
}), /* @__PURE__ */ r.createElement(e.Error, {
|
|
68
68
|
className: i(g, u.error)
|
|
69
69
|
}, /* @__PURE__ */ r.createElement(U, null), /* @__PURE__ */ r.createElement(e.Error.Text, null)), /* @__PURE__ */ r.createElement(e.Description, {
|
|
70
|
-
className: i(
|
|
70
|
+
className: i(k, u.description)
|
|
71
71
|
}, W));
|
|
72
72
|
};
|
|
73
73
|
export {
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import d, { useContext as N, useRef as x, useState as f, Children as y, useLayoutEffect as p, useMemo as I } from "react";
|
|
2
|
+
import { CollectionRendererContext as g, DefaultCollectionRenderer as E, ListBox as L } from "react-aria-components";
|
|
3
|
+
import M from "classnames";
|
|
4
|
+
import { s as R } from "./field-rac.module-DfEb7pBp.js";
|
|
5
|
+
import { z as T, G as P } from "./form-DHAKwnLt.js";
|
|
6
|
+
import { u as H } from "./use-element-state-class-name-CUZuhFvZ.js";
|
|
7
|
+
import { u as B } from "./use-hoverable-input-class-name-ugX8-g4E.js";
|
|
8
|
+
const h = 1 / 0, A = {
|
|
9
|
+
position: "absolute",
|
|
10
|
+
width: 0,
|
|
11
|
+
height: "var(--popoverMaxHeight, 240px)",
|
|
12
|
+
visibility: "hidden",
|
|
13
|
+
pointerEvents: "none"
|
|
14
|
+
}, G = (e, o) => Object.create(e, {
|
|
15
|
+
[Symbol.iterator]: {
|
|
16
|
+
value: function* () {
|
|
17
|
+
let s = 0;
|
|
18
|
+
for (const n of e) {
|
|
19
|
+
if (s >= o)
|
|
20
|
+
return;
|
|
21
|
+
s += 1, yield n;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}), S = (e) => e.querySelector('[role="option"]') !== null, V = (e, o) => {
|
|
26
|
+
const s = e.getBoundingClientRect().top - e.scrollTop;
|
|
27
|
+
let n = 0;
|
|
28
|
+
for (const r of e.querySelectorAll('[role="option"]')) {
|
|
29
|
+
const m = r.getBoundingClientRect().top - s;
|
|
30
|
+
if (n > 0 && m >= o)
|
|
31
|
+
break;
|
|
32
|
+
n += 1;
|
|
33
|
+
}
|
|
34
|
+
return n;
|
|
35
|
+
}, K = ({ isForcedOpen: e, ...o }) => {
|
|
36
|
+
const s = N(g), n = x(null), [r, m] = f(null), [c, O] = f(h), [b, _] = f(0), w = y.count(o.children);
|
|
37
|
+
p(() => {
|
|
38
|
+
O(h);
|
|
39
|
+
}, [
|
|
40
|
+
r,
|
|
41
|
+
w,
|
|
42
|
+
b
|
|
43
|
+
]), p(() => {
|
|
44
|
+
const t = n.current;
|
|
45
|
+
if (!r || !t || c !== h)
|
|
46
|
+
return;
|
|
47
|
+
const a = () => {
|
|
48
|
+
const l = r.getBoundingClientRect().height;
|
|
49
|
+
l > 0 && O(V(t, l));
|
|
50
|
+
};
|
|
51
|
+
if (S(t)) {
|
|
52
|
+
a();
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const i = new MutationObserver(() => {
|
|
56
|
+
S(t) && (i.disconnect(), a());
|
|
57
|
+
});
|
|
58
|
+
return i.observe(t, {
|
|
59
|
+
childList: !0,
|
|
60
|
+
subtree: !0
|
|
61
|
+
}), () => i.disconnect();
|
|
62
|
+
}, [
|
|
63
|
+
r,
|
|
64
|
+
c,
|
|
65
|
+
b
|
|
66
|
+
]), p(() => {
|
|
67
|
+
const t = n.current;
|
|
68
|
+
if (!r || !t || typeof ResizeObserver > "u")
|
|
69
|
+
return;
|
|
70
|
+
const a = /* @__PURE__ */ new Map(), i = new ResizeObserver((l) => {
|
|
71
|
+
l.some(({ target: u, contentRect: v }) => {
|
|
72
|
+
const C = a.get(u);
|
|
73
|
+
return a.set(u, v.height), C !== void 0 && C !== v.height;
|
|
74
|
+
}) && _((u) => u + 1);
|
|
75
|
+
});
|
|
76
|
+
return i.observe(r), t.querySelectorAll('[role="option"]').forEach((l) => i.observe(l)), () => i.disconnect();
|
|
77
|
+
}, [
|
|
78
|
+
r,
|
|
79
|
+
c
|
|
80
|
+
]);
|
|
81
|
+
const D = I(() => ({
|
|
82
|
+
...E,
|
|
83
|
+
CollectionRoot: (t) => /* @__PURE__ */ d.createElement(E.CollectionRoot, {
|
|
84
|
+
...t,
|
|
85
|
+
collection: G(t.collection, c)
|
|
86
|
+
})
|
|
87
|
+
}), [
|
|
88
|
+
c
|
|
89
|
+
]);
|
|
90
|
+
return /* @__PURE__ */ d.createElement(g.Provider, {
|
|
91
|
+
value: e ? D : s
|
|
92
|
+
}, /* @__PURE__ */ d.createElement(L, {
|
|
93
|
+
ref: n,
|
|
94
|
+
...o
|
|
95
|
+
}), e && /* @__PURE__ */ d.createElement("div", {
|
|
96
|
+
ref: m,
|
|
97
|
+
style: A
|
|
98
|
+
}));
|
|
99
|
+
}, W = {
|
|
100
|
+
base: R.selectOption,
|
|
101
|
+
selected: R.selectOptionSelected,
|
|
102
|
+
hover: R.selectOptionHover
|
|
103
|
+
}, q = ({ isSelected: e, isHovered: o, isFocused: s }) => ({
|
|
104
|
+
isSelected: e,
|
|
105
|
+
isHovered: (o || s) && !e
|
|
106
|
+
}), Q = (...e) => {
|
|
107
|
+
const o = H({
|
|
108
|
+
globalClasses: T,
|
|
109
|
+
moduleClasses: W
|
|
110
|
+
});
|
|
111
|
+
return (s) => M(o(q(s)), e);
|
|
112
|
+
}, Z = (...e) => B(P, e);
|
|
113
|
+
export {
|
|
114
|
+
K as V,
|
|
115
|
+
Z as a,
|
|
116
|
+
Q as u
|
|
117
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import i from "classnames";
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
2
|
+
import { bh as s, aQ as v } from "./form-DHAKwnLt.js";
|
|
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 = [
|
|
6
6
|
e.selected,
|
|
@@ -19,5 +19,5 @@ const S = ({ globalClasses: e, moduleClasses: r }) => {
|
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
21
|
export {
|
|
22
|
-
|
|
22
|
+
x as u
|
|
23
23
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bo as n } from "./form-DHAKwnLt.js";
|
|
2
2
|
import { s as e } from "./field-rac.module-DfEb7pBp.js";
|
|
3
|
-
import { u } from "./use-element-state-class-name-
|
|
3
|
+
import { u } from "./use-element-state-class-name-CUZuhFvZ.js";
|
|
4
4
|
const b = (s, a) => {
|
|
5
|
-
const { disabled: t, readOnly: o } =
|
|
5
|
+
const { disabled: t, readOnly: o } = n(), r = u({
|
|
6
6
|
globalClasses: s,
|
|
7
7
|
moduleClasses: {
|
|
8
8
|
base: [
|
|
@@ -12,11 +12,11 @@ const b = (s, a) => {
|
|
|
12
12
|
hover: e.inputHover
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
|
-
return ({ isHovered: l, isFocused:
|
|
15
|
+
return ({ isHovered: l, isFocused: i, isFocusWithin: m }) => r({
|
|
16
16
|
isSelected: !1,
|
|
17
17
|
isHovered: l,
|
|
18
|
-
isFocused:
|
|
19
|
-
isFocusWithin:
|
|
18
|
+
isFocused: i,
|
|
19
|
+
isFocusWithin: m,
|
|
20
20
|
isInteractive: !t && !o
|
|
21
21
|
});
|
|
22
22
|
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { useContext as i, useMemo as c } from "react";
|
|
2
|
+
import { bi as E, au as T, bg as a, F as s } from "./form-DHAKwnLt.js";
|
|
3
|
+
const u = [
|
|
4
|
+
s.DROPDOWN,
|
|
5
|
+
s.DEXT_DROPDOWN,
|
|
6
|
+
s.SERVICES_DROPDOWN,
|
|
7
|
+
s.DATE_INPUT,
|
|
8
|
+
s.CONTACTS_BIRTHDATE,
|
|
9
|
+
s.DATE_TIME_INPUT,
|
|
10
|
+
s.DEXT_DATE_TIME_INPUT
|
|
11
|
+
], d = [
|
|
12
|
+
s.DATE_PICKER,
|
|
13
|
+
s.DEXT_DATE_PICKER
|
|
14
|
+
], O = [
|
|
15
|
+
s.PHONE,
|
|
16
|
+
s.CONTACTS_PHONE,
|
|
17
|
+
s.BOOKINGS_PHONE,
|
|
18
|
+
s.DEXT_PHONE
|
|
19
|
+
], _ = [
|
|
20
|
+
s.MULTILINE_ADDRESS,
|
|
21
|
+
s.BOOKINGS_ADDRESS,
|
|
22
|
+
s.ECOM_ADDRESS
|
|
23
|
+
], I = ({ properties: e }) => {
|
|
24
|
+
var n, o, t, r;
|
|
25
|
+
return ((r = (t = (o = (n = e.validation) == null ? void 0 : n.string) == null ? void 0 : o.phoneOptions) == null ? void 0 : t.allowedCountryCodes) == null ? void 0 : r.length) !== 1;
|
|
26
|
+
}, P = ({ properties: e }) => {
|
|
27
|
+
var n, o;
|
|
28
|
+
return ((o = (n = e.fieldSettings) == null ? void 0 : n.country) == null ? void 0 : o.show) !== !1;
|
|
29
|
+
}, l = (e, n) => O.includes(e.fieldType) ? !n && I(e) : _.includes(e.fieldType) ? P(e) : u.includes(e.fieldType), p = (e) => d.includes(e.fieldType), S = ({ properties: e }) => !e.disabled && !e.readOnly, D = (e) => {
|
|
30
|
+
const n = i(T), { isMobile: o = !1 } = a();
|
|
31
|
+
return c(() => !n || n.parentId ? [] : n.fields.filter((t) => e(t, o) && S(t)).map((t) => t.id), [
|
|
32
|
+
n,
|
|
33
|
+
o,
|
|
34
|
+
e
|
|
35
|
+
]);
|
|
36
|
+
}, A = (e) => {
|
|
37
|
+
var t;
|
|
38
|
+
const n = ((t = E().dropdown) == null ? void 0 : t.open) === !0, o = D(l);
|
|
39
|
+
return n && o.includes(e);
|
|
40
|
+
}, R = (e) => {
|
|
41
|
+
var t;
|
|
42
|
+
const n = ((t = E().datePicker) == null ? void 0 : t.open) === !0, o = D(p);
|
|
43
|
+
return n && o.includes(e);
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
A as a,
|
|
47
|
+
R as u
|
|
48
|
+
};
|
package/dist/component/{use-service-options-base-DXG60hA5.js → use-service-options-base-hqO9Ev38.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useState as o, useCallback as y, useEffect as m, useMemo as D } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { bn as v } from "./form-DHAKwnLt.js";
|
|
3
3
|
const k = (I) => {
|
|
4
|
-
const { fieldType: L, isEditor: t = !1, postProcessOptions: i, customFetchLogic:
|
|
4
|
+
const { fieldType: L, isEditor: t = !1, postProcessOptions: i, customFetchLogic: n, onInitialDataLoaded: a } = 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 ?? "",
|
|
@@ -14,16 +14,16 @@ const k = (I) => {
|
|
|
14
14
|
m(() => {
|
|
15
15
|
if (s != null && s.services) {
|
|
16
16
|
const e = r(s.services);
|
|
17
|
-
p(e), u(e.length === 0), f(!0),
|
|
17
|
+
p(e), u(e.length === 0), f(!0), a && a(e);
|
|
18
18
|
}
|
|
19
19
|
}, [
|
|
20
20
|
s,
|
|
21
21
|
r,
|
|
22
|
-
|
|
22
|
+
a
|
|
23
23
|
]), m(() => {
|
|
24
|
-
|
|
24
|
+
n && !t && n();
|
|
25
25
|
}, [
|
|
26
|
-
|
|
26
|
+
n,
|
|
27
27
|
t
|
|
28
28
|
]);
|
|
29
29
|
const b = D(() => t || c, [
|
package/dist/form.d.ts
CHANGED
|
@@ -6987,6 +6987,11 @@ type ElementProps = ElementTree & {
|
|
|
6987
6987
|
}> & {
|
|
6988
6988
|
open?: boolean;
|
|
6989
6989
|
};
|
|
6990
|
+
datePicker?: ElementEntry<{
|
|
6991
|
+
calendar?: LeafEntry;
|
|
6992
|
+
}> & {
|
|
6993
|
+
open?: boolean;
|
|
6994
|
+
};
|
|
6990
6995
|
signatureContainer?: ElementEntry<ElementTree & {
|
|
6991
6996
|
signatureDropZone?: ElementEntry<{
|
|
6992
6997
|
signatureUploadButton?: ElementEntry<{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/form-elements",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.147.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": "dcde916fdec9c1773c083248f6cc45a6b733ed0fb4d29edda6c57445"
|
|
160
160
|
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import r from "react";
|
|
2
|
-
import { bn as e, ap as t } from "./form-Bed4Kfz8.js";
|
|
3
|
-
import { R as p } from "./radio-group-field-rac-w8fHpFKJ.js";
|
|
4
|
-
import { a } from "./default-limits-D7qVv_Hv.js";
|
|
5
|
-
const l = () => {
|
|
6
|
-
const o = {
|
|
7
|
-
...e(),
|
|
8
|
-
otherInputCharacterLimit: a
|
|
9
|
-
};
|
|
10
|
-
return /* @__PURE__ */ r.createElement(t.Provider, {
|
|
11
|
-
value: {
|
|
12
|
-
v2: o
|
|
13
|
-
}
|
|
14
|
-
}, /* @__PURE__ */ r.createElement(p, null));
|
|
15
|
-
};
|
|
16
|
-
export {
|
|
17
|
-
l as DextRadioGroupRAC
|
|
18
|
-
};
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import d, { useContext as _, useRef as D, useState as m, Children as L, useLayoutEffect as p, useMemo as M } from "react";
|
|
2
|
-
import { CollectionRendererContext as g, DefaultCollectionRenderer as E, ListBox as N } from "react-aria-components";
|
|
3
|
-
import P from "classnames";
|
|
4
|
-
import { s as h } from "./field-rac.module-DfEb7pBp.js";
|
|
5
|
-
import { y as T } from "./form-Bed4Kfz8.js";
|
|
6
|
-
import { u as H } from "./use-element-state-class-name-oiKCauK-.js";
|
|
7
|
-
const R = 1 / 0, I = {
|
|
8
|
-
position: "absolute",
|
|
9
|
-
width: 0,
|
|
10
|
-
height: "var(--popoverMaxHeight, 240px)",
|
|
11
|
-
visibility: "hidden",
|
|
12
|
-
pointerEvents: "none"
|
|
13
|
-
}, B = (e, o) => Object.create(e, {
|
|
14
|
-
[Symbol.iterator]: {
|
|
15
|
-
value: function* () {
|
|
16
|
-
let n = 0;
|
|
17
|
-
for (const s of e) {
|
|
18
|
-
if (n >= o)
|
|
19
|
-
return;
|
|
20
|
-
n += 1, yield s;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}), S = (e) => e.querySelector('[role="option"]') !== null, A = (e, o) => {
|
|
25
|
-
const n = e.getBoundingClientRect().top - e.scrollTop;
|
|
26
|
-
let s = 0;
|
|
27
|
-
for (const r of e.querySelectorAll('[role="option"]')) {
|
|
28
|
-
const f = r.getBoundingClientRect().top - n;
|
|
29
|
-
if (s > 0 && f >= o)
|
|
30
|
-
break;
|
|
31
|
-
s += 1;
|
|
32
|
-
}
|
|
33
|
-
return s;
|
|
34
|
-
}, X = ({ isForcedOpen: e, ...o }) => {
|
|
35
|
-
const n = _(g), s = D(null), [r, f] = m(null), [c, b] = m(R), [O, w] = m(0), y = L.count(o.children);
|
|
36
|
-
p(() => {
|
|
37
|
-
b(R);
|
|
38
|
-
}, [
|
|
39
|
-
r,
|
|
40
|
-
y,
|
|
41
|
-
O
|
|
42
|
-
]), p(() => {
|
|
43
|
-
const t = s.current;
|
|
44
|
-
if (!r || !t || c !== R)
|
|
45
|
-
return;
|
|
46
|
-
const a = () => {
|
|
47
|
-
const l = r.getBoundingClientRect().height;
|
|
48
|
-
l > 0 && b(A(t, l));
|
|
49
|
-
};
|
|
50
|
-
if (S(t)) {
|
|
51
|
-
a();
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
const i = new MutationObserver(() => {
|
|
55
|
-
S(t) && (i.disconnect(), a());
|
|
56
|
-
});
|
|
57
|
-
return i.observe(t, {
|
|
58
|
-
childList: !0,
|
|
59
|
-
subtree: !0
|
|
60
|
-
}), () => i.disconnect();
|
|
61
|
-
}, [
|
|
62
|
-
r,
|
|
63
|
-
c,
|
|
64
|
-
O
|
|
65
|
-
]), p(() => {
|
|
66
|
-
const t = s.current;
|
|
67
|
-
if (!r || !t || typeof ResizeObserver > "u")
|
|
68
|
-
return;
|
|
69
|
-
const a = /* @__PURE__ */ new Map(), i = new ResizeObserver((l) => {
|
|
70
|
-
l.some(({ target: u, contentRect: v }) => {
|
|
71
|
-
const C = a.get(u);
|
|
72
|
-
return a.set(u, v.height), C !== void 0 && C !== v.height;
|
|
73
|
-
}) && w((u) => u + 1);
|
|
74
|
-
});
|
|
75
|
-
return i.observe(r), t.querySelectorAll('[role="option"]').forEach((l) => i.observe(l)), () => i.disconnect();
|
|
76
|
-
}, [
|
|
77
|
-
r,
|
|
78
|
-
c
|
|
79
|
-
]);
|
|
80
|
-
const x = M(() => ({
|
|
81
|
-
...E,
|
|
82
|
-
CollectionRoot: (t) => /* @__PURE__ */ d.createElement(E.CollectionRoot, {
|
|
83
|
-
...t,
|
|
84
|
-
collection: B(t.collection, c)
|
|
85
|
-
})
|
|
86
|
-
}), [
|
|
87
|
-
c
|
|
88
|
-
]);
|
|
89
|
-
return /* @__PURE__ */ d.createElement(g.Provider, {
|
|
90
|
-
value: e ? x : n
|
|
91
|
-
}, /* @__PURE__ */ d.createElement(N, {
|
|
92
|
-
ref: s,
|
|
93
|
-
...o
|
|
94
|
-
}), e && /* @__PURE__ */ d.createElement("div", {
|
|
95
|
-
ref: f,
|
|
96
|
-
style: I
|
|
97
|
-
}));
|
|
98
|
-
}, V = {
|
|
99
|
-
base: h.selectOption,
|
|
100
|
-
selected: h.selectOptionSelected,
|
|
101
|
-
hover: h.selectOptionHover
|
|
102
|
-
}, q = ({ isSelected: e, isHovered: o, isFocused: n }) => ({
|
|
103
|
-
isSelected: e,
|
|
104
|
-
isHovered: (o || n) && !e
|
|
105
|
-
}), Y = (...e) => {
|
|
106
|
-
const o = H({
|
|
107
|
-
globalClasses: T,
|
|
108
|
-
moduleClasses: V
|
|
109
|
-
});
|
|
110
|
-
return (n) => P(o(q(n)), e);
|
|
111
|
-
};
|
|
112
|
-
export {
|
|
113
|
-
X as V,
|
|
114
|
-
Y as u
|
|
115
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { useContext as T, useMemo as a } from "react";
|
|
2
|
-
import { bh as p, at as O, bf as _, F as s, z as i } from "./form-Bed4Kfz8.js";
|
|
3
|
-
import { u } from "./use-hoverable-input-class-name-BW3nCyhG.js";
|
|
4
|
-
const I = [
|
|
5
|
-
s.DROPDOWN,
|
|
6
|
-
s.DEXT_DROPDOWN,
|
|
7
|
-
s.SERVICES_DROPDOWN,
|
|
8
|
-
s.DATE_INPUT,
|
|
9
|
-
s.CONTACTS_BIRTHDATE,
|
|
10
|
-
s.DATE_TIME_INPUT,
|
|
11
|
-
s.DEXT_DATE_TIME_INPUT,
|
|
12
|
-
s.DATE_PICKER,
|
|
13
|
-
s.DEXT_DATE_PICKER
|
|
14
|
-
], d = [
|
|
15
|
-
s.PHONE,
|
|
16
|
-
s.CONTACTS_PHONE,
|
|
17
|
-
s.BOOKINGS_PHONE,
|
|
18
|
-
s.DEXT_PHONE
|
|
19
|
-
], N = [
|
|
20
|
-
s.MULTILINE_ADDRESS,
|
|
21
|
-
s.BOOKINGS_ADDRESS,
|
|
22
|
-
s.ECOM_ADDRESS
|
|
23
|
-
], P = ({ properties: o }) => {
|
|
24
|
-
var e, n, t, r;
|
|
25
|
-
return ((r = (t = (n = (e = o.validation) == null ? void 0 : e.string) == null ? void 0 : n.phoneOptions) == null ? void 0 : t.allowedCountryCodes) == null ? void 0 : r.length) !== 1;
|
|
26
|
-
}, S = ({ properties: o }) => {
|
|
27
|
-
var e, n;
|
|
28
|
-
return ((n = (e = o.fieldSettings) == null ? void 0 : e.country) == null ? void 0 : n.show) !== !1;
|
|
29
|
-
}, c = (o, e) => d.includes(o.fieldType) ? !e && P(o) : N.includes(o.fieldType) ? S(o) : I.includes(o.fieldType), l = (o, e) => c(o, e) && !o.properties.disabled && !o.properties.readOnly, A = (o) => {
|
|
30
|
-
var E;
|
|
31
|
-
const e = ((E = p().dropdown) == null ? void 0 : E.open) === !0, n = T(O), { isMobile: t = !1 } = _(), r = a(() => n && !n.parentId ? n.fields.filter((D) => l(D, t)).map((D) => D.id) : [], [
|
|
32
|
-
n,
|
|
33
|
-
t
|
|
34
|
-
]);
|
|
35
|
-
return e && r.includes(o);
|
|
36
|
-
}, w = (...o) => u(i, o);
|
|
37
|
-
export {
|
|
38
|
-
A as a,
|
|
39
|
-
w as u
|
|
40
|
-
};
|