@wix/form-elements 1.107.0 → 1.109.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-D2F4vgf1.js → appointment-rac-C9-XwsPI.js} +295 -296
- package/dist/component/{bookings-address-rac-_5S8J8_i.js → bookings-address-rac-jrrCPWjw.js} +1 -1
- package/dist/component/{bookings-email-rac-6vmDR9nS.js → bookings-email-rac-J9-RMEbf.js} +1 -1
- package/dist/component/{bookings-first-name-rac-DtTJ4T2K.js → bookings-first-name-rac-CH7-6JmA.js} +1 -1
- package/dist/component/{bookings-header-rac-B3dsEwzR.js → bookings-header-rac-C2JV-ciN.js} +1 -1
- package/dist/component/{bookings-last-name-rac-B3idkbi8.js → bookings-last-name-rac-0a9CwiaV.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-CrRBcQwT.js → bookings-login-bar-rac-4Mb7MQYe.js} +21 -22
- package/dist/component/{bookings-phone-rac-BE0yWNnj.js → bookings-phone-rac-vYx5r5jn.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-CYo1l0-6.js → bookings-rich-text-rac-CWg1FgUp.js} +1 -1
- package/dist/component/{checkbox-field-rac-boTtXVEt.js → checkbox-field-rac-Dwx1leKA.js} +27 -28
- package/dist/component/{checkbox-group-field-headless-DnkUvDm8.js → checkbox-group-field-headless-AFWgXzx_.js} +41 -41
- package/dist/component/{checkbox-group-field-rac-DrDTgHMg.js → checkbox-group-field-rac-CO8kmWJp.js} +6 -6
- package/dist/component/{checkbox-group-rac-v3ozUBpo.js → checkbox-group-rac-_79HsFF4.js} +1 -1
- package/dist/component/{checkbox-rac-YSLE-RnG.js → checkbox-rac-B_tbMfjo.js} +1 -1
- package/dist/component/{contacts-address-rac-C653yaHZ.js → contacts-address-rac-SJ5Tvzd0.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-BeAQ6shx.js → contacts-birthdate-rac-BU1L3sbW.js} +1 -1
- package/dist/component/{contacts-company-rac-BglKOoTG.js → contacts-company-rac-Y4B8KhDa.js} +1 -1
- package/dist/component/{contacts-email-rac-D6m7ynfc.js → contacts-email-rac-CQW84o7C.js} +1 -1
- package/dist/component/{contacts-first-name-rac-Dgxn0tUJ.js → contacts-first-name-rac-Dtai-wtH.js} +1 -1
- package/dist/component/{contacts-last-name-rac-1UyIuRKH.js → contacts-last-name-rac--ixuu3ri.js} +1 -1
- package/dist/component/{contacts-phone-rac-BQ77BlW4.js → contacts-phone-rac-HOHfSvT-.js} +1 -1
- package/dist/component/{contacts-position-rac-BUDUv7lv.js → contacts-position-rac-BPMkh6yf.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-DdtA0qKW.js → contacts-subscribe-rac-D0_RMwJb.js} +1 -1
- package/dist/component/{contacts-tax-id-rac-WUaKcNl0.js → contacts-tax-id-rac-CZJmMiVf.js} +1 -1
- package/dist/component/{date-availability-XjBFq8jt.js → date-availability-C4dDHvuc.js} +1 -1
- package/dist/component/{date-input-field-rac-aY2zuuKs.js → date-input-field-rac-8oERZcqh.js} +79 -80
- package/dist/component/{date-input-rac-DRiP2_97.js → date-input-rac-CYRojmW6.js} +1 -1
- package/dist/component/{date-picker-field-rac-Bzl-d3Uj.js → date-picker-field-rac-CIspU7No.js} +87 -88
- package/dist/component/{date-picker-rac-DHHUh8vn.js → date-picker-rac-D0Y0zf2J.js} +1 -1
- package/dist/component/{date-time-input-field-rac-DP_StuLr.js → date-time-input-field-rac-0daWK65I.js} +73 -74
- package/dist/component/{date-time-input-rac-B11KIxsf.js → date-time-input-rac-BemKPk1j.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-BHZBqyWv.js → dext-checkbox-group-rac-BpFNn56W.js} +2 -2
- package/dist/component/{dext-checkbox-rac-BIlAqEvV.js → dext-checkbox-rac-DOISgubJ.js} +1 -1
- package/dist/component/{dext-date-picker-rac-CHBXNrZi.js → dext-date-picker-rac-CNGhFg_g.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-BYtliKry.js → dext-date-time-input-rac-BuUIvJRr.js} +1 -1
- package/dist/component/{dext-dropdown-rac-C2VPSFV5.js → dext-dropdown-rac-DtND-Dbo.js} +1 -1
- package/dist/component/{dext-email-rac-Fnb0Ggcs.js → dext-email-rac-CmjLFOi8.js} +1 -1
- package/dist/component/{dext-number-input-rac-DopfSyFi.js → dext-number-input-rac-DHTNg1dh.js} +1 -1
- package/dist/component/{dext-phone-rac-Rn4i_2rc.js → dext-phone-rac-BrrU5qH_.js} +1 -1
- package/dist/component/{dext-radio-group-rac-bNaskJpK.js → dext-radio-group-rac-CD3MGfAM.js} +4 -4
- package/dist/component/{dext-rating-input-rac-DL6ZZd7d.js → dext-rating-input-rac-BETGJZmt.js} +1 -1
- package/dist/component/{dext-tags-rac-TsUPoImO.js → dext-tags-rac-Coo9jN-T.js} +4 -4
- package/dist/component/{dext-text-area-rac-BIuY7LTd.js → dext-text-area-rac-CNWjqhUT.js} +1 -1
- package/dist/component/{dext-text-input-rac-CSYPW0Qi.js → dext-text-input-rac-CCWyDexv.js} +1 -1
- package/dist/component/{dext-url-input-rac-_g0lqGfW.js → dext-url-input-rac-Dtakkgmk.js} +1 -1
- package/dist/component/{donation-rac-BYKFtsyR.js → donation-rac-BboGm_k_.js} +101 -102
- package/dist/component/{dropdown-field-headless-CBaqlNZi.js → dropdown-field-headless-BTMJGUwY.js} +16 -16
- package/dist/component/{dropdown-field-rac-CCAGSMm3.js → dropdown-field-rac-CDRV8ckB.js} +5 -5
- package/dist/component/{dropdown-rac-C_EqUsZ1.js → dropdown-rac-kEuU2pXW.js} +1 -1
- package/dist/component/{ecom-address-rac-Bw9eH0iF.js → ecom-address-rac-BgKL9ElH.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-B5PVOO2a.js → ecom-subscription-checkbox-rac-CDhJsNPD.js} +6 -6
- package/dist/component/{email-input-field-rac-B2kqQ6yo.js → email-input-field-rac-DdOd86NX.js} +54 -55
- package/dist/component/{events-repeater-rac--4OnUxWE.js → events-repeater-rac-_VJ30dpB.js} +62 -63
- package/dist/component/{events-rsvp-rac-CczCoo3T.js → events-rsvp-rac-DA-261bq.js} +5 -5
- package/dist/component/{field-error-headless-D3-1L5sf.js → field-error-headless-CovyN0GI.js} +8 -8
- package/dist/component/{field-label-headless-Du4ckIVy.js → field-label-headless-DVvX2QaH.js} +11 -11
- package/dist/component/file-upload-rac-bhEPUJPs.js +561 -0
- package/dist/component/fixed-payment-rac-DmI6MeKc.js +61 -0
- package/dist/component/{form-DQauhsho.js → form-BTDgyr54.js} +3430 -3244
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +3 -3
- package/dist/component/header-field-rac-C0rUjmo0.js +24 -0
- package/dist/component/{header-rac-CR9T3Pnu.js → header-rac-DRMO22PV.js} +1 -1
- package/dist/component/{image-choice-rac-DJ_8v467.js → image-choice-rac-CQDQ7AlD.js} +32 -33
- package/dist/component/{index-CcUTIUWM.js → index-B9QlosT1.js} +12 -12
- package/dist/component/{index-BB7d_9Dv.js → index-CNWT9t6j.js} +66 -66
- package/dist/component/{isObjectLike-xvPa_08X.js → isObjectLike-c0td2WCR.js} +1 -1
- package/dist/component/{multiline-address-field-rac-CyaFOloE.js → multiline-address-field-rac-D8bVxRsD.js} +124 -125
- package/dist/component/{multiline-address-rac-CaHGUN_f.js → multiline-address-rac-g-6RB7o8.js} +1 -1
- package/dist/component/number-input-field-rac-BaOwQ5Ya.js +92 -0
- package/dist/component/{number-input-rac-DMKX6nhk.js → number-input-rac-BXv8-Pnj.js} +1 -1
- package/dist/component/{password-rac-0RUXPAn6.js → password-rac-BB9XeSSZ.js} +36 -37
- package/dist/component/{payment-input-rac-CHSZ3-Lt.js → payment-input-rac-DwnSV9rM.js} +41 -42
- package/dist/component/{phone-input-field-rac-JmIFcP1e.js → phone-input-field-rac-CC3C4ToW.js} +56 -57
- package/dist/component/{phone-rac-BLRnAPXP.js → phone-rac-DpNhSaE0.js} +1 -1
- package/dist/component/{product-list-rac-BkF5tDwt.js → product-list-rac-BAESk3B6.js} +74 -75
- package/dist/component/{quiz-radio-group-rac-32cCMTUS.js → quiz-radio-group-rac-PS6AZr63.js} +1 -1
- package/dist/component/{radio-button-module-classes-IOulhuSH.js → radio-button-module-classes-CXcn5unY.js} +30 -30
- package/dist/component/{radio-group-field-rac-CJwku6e0.js → radio-group-field-rac-pt8xbDfS.js} +6 -6
- package/dist/component/{radio-group-rac-BiW-9Abj.js → radio-group-rac-DkzkM6N_.js} +1 -1
- package/dist/component/{rating-input-field-rac-B9cwaROK.js → rating-input-field-rac-DDHBkR4x.js} +43 -44
- package/dist/component/{rating-input-rac-BpwlNvzQ.js → rating-input-rac-CcsDmLus.js} +1 -1
- package/dist/component/{rich-content-rac.module-B1uyPmtK.js → rich-content-rac.module-B2vsO6fj.js} +4 -4
- package/dist/component/rich-text-field-rac-CvKht2eC.js +21 -0
- package/dist/component/{rich-text-rac-VfeZxS27.js → rich-text-rac-CRpSffQB.js} +1 -1
- package/dist/component/{service-dropdown-rac-BCfs8IhW.js → service-dropdown-rac-BOpdXNjG.js} +36 -37
- package/dist/component/{services-multi-choice-rac-CCqdF_7P.js → services-multi-choice-rac-t0wdSt_T.js} +20 -21
- package/dist/component/{signature-rac-DOyMo3u0.js → signature-rac-2LsIYYIX.js} +141 -142
- package/dist/component/{submit-button-rac-C2uA5DeE.js → submit-button-rac-BbE8dS35.js} +26 -27
- package/dist/component/{tags-field-rac-C_uIw2by.js → tags-field-rac-BnsBxReU.js} +44 -45
- package/dist/component/{tags-rac-1pQ-fpe_.js → tags-rac-BFH4RINA.js} +1 -1
- package/dist/component/{text-area-field-rac-DqlOkm7e.js → text-area-field-rac-Ag7_gniM.js} +28 -29
- package/dist/component/{text-area-rac-DPdkrFcH.js → text-area-rac-ByUX0p2O.js} +1 -1
- package/dist/component/{text-input-field-rac-CmXm6r1w.js → text-input-field-rac-D3MZ8teu.js} +3 -3
- package/dist/component/{text-input-headless-DD__2DFf.js → text-input-headless-CwONErsY.js} +12 -12
- package/dist/component/{text-input-rac-DRHyQEH7.js → text-input-rac-DLXdAhkK.js} +1 -1
- package/dist/component/{time-input-rac-BJPIymQY.js → time-input-rac-Bs55lTON.js} +33 -34
- package/dist/component/url-input-field-rac-FG-bCh-E.js +74 -0
- package/dist/component/{url-input-rac-C0ChQUzq.js → url-input-rac-BOKuCMTe.js} +1 -1
- package/dist/component/use-dropdown-option-class-name-DjV7FW5y.js +21 -0
- package/dist/component/{use-element-state-class-name-BatTc2bw.js → use-element-state-class-name-DB1AzkvF.js} +1 -1
- package/dist/component/{use-is-forced-open-dropdown-B0jiPTmS.js → use-is-forced-open-dropdown-ifUIpuwL.js} +7 -7
- package/dist/component/{use-service-options-base-oeE7xszw.js → use-service-options-base-B11cq0HH.js} +7 -7
- package/dist/component/use-text-input-class-name-va1PzWFg.js +23 -0
- package/dist/form.d.ts +21 -1
- package/package.json +2 -2
- package/dist/component/file-upload-rac-DbdkUbWM.js +0 -484
- package/dist/component/fixed-payment-rac-f9-01iDN.js +0 -62
- package/dist/component/form-element-classes-bLFmhsKw.js +0 -137
- package/dist/component/header-field-rac-DamDk5BR.js +0 -25
- package/dist/component/number-input-field-rac-BuYUzDWV.js +0 -93
- package/dist/component/rich-text-field-rac-C_qE7Ykg.js +0 -22
- package/dist/component/url-input-field-rac-CFDYkZ6I.js +0 -75
- package/dist/component/use-dropdown-option-class-name-3L5ZmNLK.js +0 -21
- package/dist/component/use-text-input-class-name-LQ5S-NLh.js +0 -24
|
@@ -1,46 +1,45 @@
|
|
|
1
1
|
import e, { useCallback as V, useRef as v, useContext as x } from "react";
|
|
2
|
-
import { RicosViewer as
|
|
2
|
+
import { RicosViewer as q } from "@wix/ricos/viewer";
|
|
3
3
|
import c from "classnames";
|
|
4
|
-
import { parseTime as
|
|
5
|
-
import { TimeField as
|
|
6
|
-
import {
|
|
4
|
+
import { parseTime as B } from "@internationalized/date";
|
|
5
|
+
import { TimeField as U, DateInput as k, DateSegment as _, TimeFieldStateContext as j } from "react-aria-components";
|
|
6
|
+
import { b9 as p, b6 as w, bj as b, bb as Q, I as z, U as G, v as J, p as K } from "./form-BTDgyr54.js";
|
|
7
7
|
import { f as m, a as F } from "./find-child-C60k4CxG.js";
|
|
8
|
-
import { D as
|
|
9
|
-
import { L as
|
|
10
|
-
import { E as
|
|
8
|
+
import { D as W, E as X } from "./field-error-headless-CovyN0GI.js";
|
|
9
|
+
import { L as Y } from "./field-label-headless-DVvX2QaH.js";
|
|
10
|
+
import { E as Z } from "./error-icon-hZxQ6DEy.js";
|
|
11
11
|
import { H as T } from "./custom-focus-class-_483Pkwp.js";
|
|
12
12
|
import { s as f } from "./field-rac.module-B4l_0KRU.js";
|
|
13
|
-
import {
|
|
14
|
-
import { u as $ } from "./use-text-input-class-name-LQ5S-NLh.js";
|
|
13
|
+
import { u as $ } from "./use-text-input-class-name-va1PzWFg.js";
|
|
15
14
|
const r = ({ children: t }) => {
|
|
16
|
-
const { id: n, value: l, onChange: o, disabled: i, readOnly: s, required: a, onBlur: d, onFocus: E, use24HourFormat:
|
|
15
|
+
const { id: n, value: l, onChange: o, disabled: i, readOnly: s, required: a, onBlur: d, onFocus: E, use24HourFormat: S, FieldLayout: C, hasError: I } = p(), { inputId: g, ariaDescribedBy: D, labelId: L } = w(), R = V((M) => {
|
|
17
16
|
const H = ae(M);
|
|
18
17
|
o(H);
|
|
19
18
|
}, [
|
|
20
19
|
o
|
|
21
20
|
]), N = m(t, r.Label), y = m(t, r.Time), P = m(t, r.Description), A = m(t, r.Error), O = ne(l);
|
|
22
|
-
return /* @__PURE__ */ e.createElement(
|
|
21
|
+
return /* @__PURE__ */ e.createElement(C, {
|
|
23
22
|
fieldId: n,
|
|
24
23
|
renderLabel: () => N,
|
|
25
|
-
renderInput: () => /* @__PURE__ */ e.createElement(
|
|
26
|
-
"aria-labelledby":
|
|
27
|
-
id:
|
|
28
|
-
"aria-describedby":
|
|
24
|
+
renderInput: () => /* @__PURE__ */ e.createElement(U, {
|
|
25
|
+
"aria-labelledby": L,
|
|
26
|
+
id: g,
|
|
27
|
+
"aria-describedby": D,
|
|
29
28
|
value: O,
|
|
30
|
-
onChange:
|
|
29
|
+
onChange: R,
|
|
31
30
|
isDisabled: i,
|
|
32
31
|
isReadOnly: s,
|
|
33
32
|
isInvalid: I,
|
|
34
33
|
isRequired: a,
|
|
35
34
|
onBlur: d,
|
|
36
35
|
onFocus: E,
|
|
37
|
-
hourCycle:
|
|
36
|
+
hourCycle: S ? 24 : 12
|
|
38
37
|
}, y),
|
|
39
38
|
renderDescription: () => /* @__PURE__ */ e.createElement(e.Fragment, null, A, P)
|
|
40
39
|
});
|
|
41
40
|
}, u = ({ children: t, className: n }) => {
|
|
42
41
|
const { hasError: l } = p(), o = m(t, u.Hour), i = m(t, u.Minute), s = m(t, u.Period);
|
|
43
|
-
return /* @__PURE__ */ e.createElement(
|
|
42
|
+
return /* @__PURE__ */ e.createElement(k, {
|
|
44
43
|
className: n,
|
|
45
44
|
"data-invalid": l || void 0
|
|
46
45
|
}, (a) => {
|
|
@@ -66,8 +65,8 @@ const r = ({ children: t }) => {
|
|
|
66
65
|
}
|
|
67
66
|
});
|
|
68
67
|
}, ee = ({ className: t, ...n }) => {
|
|
69
|
-
const { id: l, hidePlaceholder: o } = p(), { segment: i } = n, { t: s } =
|
|
70
|
-
|
|
68
|
+
const { id: l, hidePlaceholder: o } = p(), { segment: i } = n, { t: s } = b(), a = v(null);
|
|
69
|
+
Q(() => {
|
|
71
70
|
var E;
|
|
72
71
|
(E = a.current) == null || E.focus();
|
|
73
72
|
}, l);
|
|
@@ -81,7 +80,7 @@ const r = ({ children: t }) => {
|
|
|
81
80
|
}
|
|
82
81
|
});
|
|
83
82
|
}, te = ({ className: t, ...n }) => {
|
|
84
|
-
const { hidePlaceholder: l } = p(), { segment: o } = n, { t: i } =
|
|
83
|
+
const { hidePlaceholder: l } = p(), { segment: o } = n, { t: i } = b(), s = l ? void 0 : i("field.date.placeholder.minute");
|
|
85
84
|
return /* @__PURE__ */ e.createElement(_, {
|
|
86
85
|
segment: o,
|
|
87
86
|
className: t,
|
|
@@ -90,7 +89,7 @@ const r = ({ children: t }) => {
|
|
|
90
89
|
}
|
|
91
90
|
});
|
|
92
91
|
}, re = ({ className: t, ...n }) => {
|
|
93
|
-
const { hidePlaceholder: l } = p(), { segment: o } = n, { t: i } =
|
|
92
|
+
const { hidePlaceholder: l } = p(), { segment: o } = n, { t: i } = b(), s = x(j), a = l ? void 0 : i("field.date.placeholder.period"), d = () => s == null ? void 0 : s.increment("dayPeriod");
|
|
94
93
|
return /* @__PURE__ */ e.createElement(_, {
|
|
95
94
|
segment: o,
|
|
96
95
|
className: t,
|
|
@@ -103,15 +102,15 @@ const r = ({ children: t }) => {
|
|
|
103
102
|
u.Hour = ee;
|
|
104
103
|
u.Minute = te;
|
|
105
104
|
u.Period = re;
|
|
106
|
-
r.Label =
|
|
105
|
+
r.Label = Y;
|
|
107
106
|
r.Time = u;
|
|
108
|
-
r.Description =
|
|
109
|
-
r.Error =
|
|
107
|
+
r.Description = W;
|
|
108
|
+
r.Error = X;
|
|
110
109
|
function ne(t) {
|
|
111
110
|
if (!t)
|
|
112
111
|
return null;
|
|
113
112
|
try {
|
|
114
|
-
return
|
|
113
|
+
return B(t);
|
|
115
114
|
} catch {
|
|
116
115
|
return null;
|
|
117
116
|
}
|
|
@@ -131,15 +130,15 @@ const oe = "_time_10p0h_1", se = "_hour_10p0h_14", le = "_minute_10p0h_15", ie =
|
|
|
131
130
|
hour: se,
|
|
132
131
|
minute: le,
|
|
133
132
|
period: ie
|
|
134
|
-
}, ce = ({ content: t, locale: n }) => /* @__PURE__ */ e.createElement(
|
|
133
|
+
}, ce = ({ content: t, locale: n }) => /* @__PURE__ */ e.createElement(q, {
|
|
135
134
|
content: t,
|
|
136
135
|
locale: n
|
|
137
136
|
}), me = () => {
|
|
138
137
|
const t = $(h.time);
|
|
139
138
|
return /* @__PURE__ */ e.createElement(r, null, /* @__PURE__ */ e.createElement(r.Label, {
|
|
140
|
-
className: c(
|
|
139
|
+
className: c(z, f.label)
|
|
141
140
|
}, /* @__PURE__ */ e.createElement(r.Label.Required, {
|
|
142
|
-
className: c(
|
|
141
|
+
className: c(G, f.requiredMark)
|
|
143
142
|
})), /* @__PURE__ */ e.createElement(r.Time, {
|
|
144
143
|
className: t
|
|
145
144
|
}, /* @__PURE__ */ e.createElement(r.Time.Hour, {
|
|
@@ -149,11 +148,11 @@ const oe = "_time_10p0h_1", se = "_hour_10p0h_14", le = "_minute_10p0h_15", ie =
|
|
|
149
148
|
}), /* @__PURE__ */ e.createElement(r.Time.Period, {
|
|
150
149
|
className: c(h.period, T)
|
|
151
150
|
})), /* @__PURE__ */ e.createElement(r.Error, {
|
|
152
|
-
className: c(
|
|
153
|
-
}, /* @__PURE__ */ e.createElement(
|
|
154
|
-
className: c(
|
|
151
|
+
className: c(J, f.error)
|
|
152
|
+
}, /* @__PURE__ */ e.createElement(Z, null), /* @__PURE__ */ e.createElement(r.Error.Text, null)), /* @__PURE__ */ e.createElement(r.Description, {
|
|
153
|
+
className: c(K, f.description)
|
|
155
154
|
}, ce));
|
|
156
|
-
},
|
|
155
|
+
}, ge = () => /* @__PURE__ */ e.createElement(me, null);
|
|
157
156
|
export {
|
|
158
|
-
|
|
157
|
+
ge as TimeInputRAC
|
|
159
158
|
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { RicosViewer as S } 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 { b9 as d, b6 as E, bb as v, I as B, U as T, v as g, p as k } from "./form-BTDgyr54.js";
|
|
6
|
+
import { f as c } from "./find-child-C60k4CxG.js";
|
|
7
|
+
import { D as M, E as P } from "./field-error-headless-CovyN0GI.js";
|
|
8
|
+
import { L as U } from "./field-label-headless-DVvX2QaH.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-B4l_0KRU.js";
|
|
12
|
+
import { u as w } from "./use-text-input-class-name-va1PzWFg.js";
|
|
13
|
+
const V = (t) => t ? `https://${String(t).replace(/^https?:\/\//, "")}` : "", e = ({ children: t }) => {
|
|
14
|
+
const { id: o, value: s, onChange: n, disabled: m, readOnly: a, required: l, 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), N = h(() => {
|
|
15
|
+
n(V(s)), p();
|
|
16
|
+
}, [
|
|
17
|
+
p,
|
|
18
|
+
n,
|
|
19
|
+
s
|
|
20
|
+
]);
|
|
21
|
+
return /* @__PURE__ */ r.createElement(R, {
|
|
22
|
+
fieldId: o,
|
|
23
|
+
renderLabel: () => L,
|
|
24
|
+
renderInput: () => /* @__PURE__ */ r.createElement(y, {
|
|
25
|
+
"aria-labelledby": F,
|
|
26
|
+
value: s ?? "",
|
|
27
|
+
onChange: n,
|
|
28
|
+
isDisabled: m,
|
|
29
|
+
isReadOnly: a,
|
|
30
|
+
isRequired: l,
|
|
31
|
+
isInvalid: I,
|
|
32
|
+
onBlur: N,
|
|
33
|
+
onFocus: f
|
|
34
|
+
}, D),
|
|
35
|
+
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, _, C)
|
|
36
|
+
});
|
|
37
|
+
}, W = ({ className: t }) => {
|
|
38
|
+
const { id: o, placeholder: s } = d(), { inputId: n, ariaDescribedBy: m } = E(), a = O(null);
|
|
39
|
+
return v(() => {
|
|
40
|
+
var l;
|
|
41
|
+
(l = a.current) == null || l.focus();
|
|
42
|
+
}, o), /* @__PURE__ */ r.createElement(A, {
|
|
43
|
+
ref: a,
|
|
44
|
+
id: n,
|
|
45
|
+
type: "url",
|
|
46
|
+
"aria-describedby": m,
|
|
47
|
+
className: t,
|
|
48
|
+
placeholder: s
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
e.Label = U;
|
|
52
|
+
e.Input = W;
|
|
53
|
+
e.Description = M;
|
|
54
|
+
e.Error = P;
|
|
55
|
+
const $ = ({ content: t, locale: o }) => /* @__PURE__ */ r.createElement(S, {
|
|
56
|
+
content: t,
|
|
57
|
+
locale: o
|
|
58
|
+
}), te = () => {
|
|
59
|
+
const t = w();
|
|
60
|
+
return /* @__PURE__ */ r.createElement(e, null, /* @__PURE__ */ r.createElement(e.Label, {
|
|
61
|
+
className: i(B, u.label)
|
|
62
|
+
}, /* @__PURE__ */ r.createElement(e.Label.Required, {
|
|
63
|
+
className: i(T, u.requiredMark)
|
|
64
|
+
})), /* @__PURE__ */ r.createElement(e.Input, {
|
|
65
|
+
className: t
|
|
66
|
+
}), /* @__PURE__ */ r.createElement(e.Error, {
|
|
67
|
+
className: i(g, u.error)
|
|
68
|
+
}, /* @__PURE__ */ r.createElement(x, null), /* @__PURE__ */ r.createElement(e.Error.Text, null)), /* @__PURE__ */ r.createElement(e.Description, {
|
|
69
|
+
className: i(k, u.description)
|
|
70
|
+
}, $));
|
|
71
|
+
};
|
|
72
|
+
export {
|
|
73
|
+
te as U
|
|
74
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import a from "classnames";
|
|
2
|
+
import { s as o } from "./field-rac.module-B4l_0KRU.js";
|
|
3
|
+
import { s as r } from "./form-BTDgyr54.js";
|
|
4
|
+
import { u as l } from "./use-element-state-class-name-DB1AzkvF.js";
|
|
5
|
+
const O = {
|
|
6
|
+
base: o.selectOption,
|
|
7
|
+
selected: o.selectOptionSelected,
|
|
8
|
+
hover: o.selectOptionHover
|
|
9
|
+
}, m = ({ isSelected: s, isHovered: e, isFocused: t }) => ({
|
|
10
|
+
isSelected: s,
|
|
11
|
+
isHovered: (e || t) && !s
|
|
12
|
+
}), N = (...s) => {
|
|
13
|
+
const e = l({
|
|
14
|
+
globalClasses: r,
|
|
15
|
+
moduleClasses: O
|
|
16
|
+
});
|
|
17
|
+
return (t) => a(e(m(t)), s);
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
N as u
|
|
21
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useContext as T, useMemo as p } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { b3 as u, ag as O, b1 as _, F as n } from "./form-BTDgyr54.js";
|
|
3
3
|
const a = [
|
|
4
4
|
n.DROPDOWN,
|
|
5
5
|
n.DEXT_DROPDOWN,
|
|
@@ -10,26 +10,26 @@ const a = [
|
|
|
10
10
|
n.DEXT_DATE_TIME_INPUT,
|
|
11
11
|
n.DATE_PICKER,
|
|
12
12
|
n.DEXT_DATE_PICKER
|
|
13
|
-
],
|
|
13
|
+
], d = [
|
|
14
14
|
n.PHONE,
|
|
15
15
|
n.CONTACTS_PHONE,
|
|
16
16
|
n.BOOKINGS_PHONE,
|
|
17
17
|
n.DEXT_PHONE
|
|
18
|
-
],
|
|
18
|
+
], I = [
|
|
19
19
|
n.MULTILINE_ADDRESS,
|
|
20
20
|
n.BOOKINGS_ADDRESS,
|
|
21
21
|
n.ECOM_ADDRESS
|
|
22
|
-
],
|
|
22
|
+
], P = ({ properties: o }) => {
|
|
23
23
|
var t, e, s, r;
|
|
24
24
|
return ((r = (s = (e = (t = o.validation) == null ? void 0 : t.string) == null ? void 0 : e.phoneOptions) == null ? void 0 : s.allowedCountryCodes) == null ? void 0 : r.length) !== 1;
|
|
25
|
-
},
|
|
25
|
+
}, S = ({ properties: o }) => {
|
|
26
26
|
var t, e;
|
|
27
27
|
return ((e = (t = o.fieldSettings) == null ? void 0 : t.country) == null ? void 0 : e.show) !== !1;
|
|
28
|
-
},
|
|
28
|
+
}, c = (o, t) => d.includes(o.fieldType) ? !t && P(o) : I.includes(o.fieldType) ? S(o) : a.includes(o.fieldType), l = (o, t) => c(o, t) && !o.properties.hidden && !o.properties.disabled && !o.properties.readOnly, N = (o, t) => o.layout.row - t.layout.row || o.layout.column - t.layout.column, w = (o) => {
|
|
29
29
|
var E;
|
|
30
30
|
const t = ((E = u().dropdown) == null ? void 0 : E.open) === !0, e = T(O), { isMobile: s = !1 } = _(), r = p(() => {
|
|
31
31
|
var D;
|
|
32
|
-
return e && !e.parentId ? (D = e.fields.filter((i) =>
|
|
32
|
+
return e && !e.parentId ? (D = e.fields.filter((i) => l(i, s)).sort(N)[0]) == null ? void 0 : D.id : void 0;
|
|
33
33
|
}, [
|
|
34
34
|
e,
|
|
35
35
|
s
|
package/dist/component/{use-service-options-base-oeE7xszw.js → use-service-options-base-B11cq0HH.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([]), [E, u] = o(!1), [c, f] = o(!1), s = v(L), r =
|
|
1
|
+
import { useState as o, useCallback as y, useEffect as m, useMemo as D } from "react";
|
|
2
|
+
import { b8 as v } from "./form-BTDgyr54.js";
|
|
3
|
+
const k = (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,7 +26,7 @@ const j = (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
|
]);
|
|
@@ -35,7 +35,7 @@ const j = (I) => {
|
|
|
35
35
|
options: g,
|
|
36
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 j = (I) => {
|
|
|
44
44
|
};
|
|
45
45
|
};
|
|
46
46
|
export {
|
|
47
|
-
|
|
47
|
+
k as u
|
|
48
48
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { b9 as r, _ as i } from "./form-BTDgyr54.js";
|
|
2
|
+
import { s } from "./field-rac.module-B4l_0KRU.js";
|
|
3
|
+
import { u as m } from "./use-element-state-class-name-DB1AzkvF.js";
|
|
4
|
+
const d = (...e) => {
|
|
5
|
+
const { disabled: a, readOnly: t } = r(), o = m({
|
|
6
|
+
globalClasses: i,
|
|
7
|
+
moduleClasses: {
|
|
8
|
+
base: [
|
|
9
|
+
s.input,
|
|
10
|
+
...e
|
|
11
|
+
].join(" "),
|
|
12
|
+
hover: s.inputHover
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
return ({ isHovered: l }) => o({
|
|
16
|
+
isSelected: !1,
|
|
17
|
+
isHovered: l,
|
|
18
|
+
isInteractive: !a && !t
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
d as u
|
|
23
|
+
};
|
package/dist/form.d.ts
CHANGED
|
@@ -7004,6 +7004,7 @@ type FormHandle = {
|
|
|
7004
7004
|
validateStep?: (stepId: string) => Promise<boolean>;
|
|
7005
7005
|
getValues?: () => FormValues;
|
|
7006
7006
|
};
|
|
7007
|
+
type FormState = 'success';
|
|
7007
7008
|
type FormProps = {
|
|
7008
7009
|
id?: string;
|
|
7009
7010
|
className?: string;
|
|
@@ -7011,6 +7012,7 @@ type FormProps = {
|
|
|
7011
7012
|
form?: FormSchema;
|
|
7012
7013
|
wix?: Wix;
|
|
7013
7014
|
elementProps?: ElementProps;
|
|
7015
|
+
state?: FormState;
|
|
7014
7016
|
values: FormValues;
|
|
7015
7017
|
onChange: (values: FormValues) => void;
|
|
7016
7018
|
errors: ValidationError[];
|
|
@@ -7037,10 +7039,28 @@ declare const defaultProps: {
|
|
|
7037
7039
|
};
|
|
7038
7040
|
};
|
|
7039
7041
|
};
|
|
7042
|
+
readonly dropZone: {
|
|
7043
|
+
readonly elementProps: {
|
|
7044
|
+
readonly uploadButton: {
|
|
7045
|
+
readonly elementProps: {
|
|
7046
|
+
readonly icon: {
|
|
7047
|
+
readonly svg: {
|
|
7048
|
+
readonly uri: '';
|
|
7049
|
+
readonly viewBox: '0 0 200 200';
|
|
7050
|
+
readonly contentBox: '0 0 200 200';
|
|
7051
|
+
readonly colors: {};
|
|
7052
|
+
readonly contentType: 'shape';
|
|
7053
|
+
readonly svgContent: '<svg data-bbox="20 20 160 160" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg" data-type="shape"><g><path d="M104.5 20h-9v75.5H20v9h75.5V180h9v-75.5H180v-9h-75.5V20z" fill-rule="evenodd" clip-rule="evenodd"/></g></svg>';
|
|
7054
|
+
};
|
|
7055
|
+
};
|
|
7056
|
+
};
|
|
7057
|
+
};
|
|
7058
|
+
};
|
|
7059
|
+
};
|
|
7040
7060
|
};
|
|
7041
7061
|
};
|
|
7042
7062
|
|
|
7043
7063
|
declare const Form: React.ForwardRefExoticComponent<FormProps & React.RefAttributes<FormHandle>>;
|
|
7044
7064
|
|
|
7045
7065
|
export { Form as default, defaultProps };
|
|
7046
|
-
export type { ElementProps, FormHandle, FormProps, FormSchema, FormSubmission, FormValue, FormValues, ValidationError };
|
|
7066
|
+
export type { ElementProps, FormHandle, FormProps, FormSchema, FormState, FormSubmission, FormValue, FormValues, ValidationError };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/form-elements",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.109.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": "5c1787e6efe7e1cd09c5dddbff66dc4ee9333c8f31c68bb3a28fe994"
|
|
160
160
|
}
|