@wix/form-elements 1.107.0 → 1.108.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-ZAp8oWbK.js} +289 -290
- package/dist/component/{bookings-address-rac-_5S8J8_i.js → bookings-address-rac-x-Az7vHf.js} +1 -1
- package/dist/component/{bookings-email-rac-6vmDR9nS.js → bookings-email-rac-MoF_CaqB.js} +1 -1
- package/dist/component/{bookings-first-name-rac-DtTJ4T2K.js → bookings-first-name-rac-CWh3Rb0M.js} +1 -1
- package/dist/component/{bookings-header-rac-B3dsEwzR.js → bookings-header-rac-BVTiXUWk.js} +1 -1
- package/dist/component/{bookings-last-name-rac-B3idkbi8.js → bookings-last-name-rac-kXRRlyHl.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-CrRBcQwT.js → bookings-login-bar-rac-C4Zr6kXE.js} +23 -24
- package/dist/component/{bookings-phone-rac-BE0yWNnj.js → bookings-phone-rac-2rz1m_xi.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-CYo1l0-6.js → bookings-rich-text-rac-BEjGypQw.js} +1 -1
- package/dist/component/{checkbox-field-rac-boTtXVEt.js → checkbox-field-rac-DwEQLIaz.js} +66 -67
- package/dist/component/{checkbox-group-field-headless-DnkUvDm8.js → checkbox-group-field-headless-BsOww_QB.js} +37 -37
- package/dist/component/{checkbox-group-field-rac-DrDTgHMg.js → checkbox-group-field-rac-DTcZcVS6.js} +6 -6
- package/dist/component/{checkbox-group-rac-v3ozUBpo.js → checkbox-group-rac-DQsML-pW.js} +1 -1
- package/dist/component/{checkbox-rac-YSLE-RnG.js → checkbox-rac-irEBBOxP.js} +1 -1
- package/dist/component/{contacts-address-rac-C653yaHZ.js → contacts-address-rac-B5bSAYrm.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-BeAQ6shx.js → contacts-birthdate-rac-DyScj8f4.js} +1 -1
- package/dist/component/{contacts-company-rac-BglKOoTG.js → contacts-company-rac-C5X9-jXa.js} +1 -1
- package/dist/component/{contacts-email-rac-D6m7ynfc.js → contacts-email-rac-B0vkfmrS.js} +1 -1
- package/dist/component/{contacts-first-name-rac-Dgxn0tUJ.js → contacts-first-name-rac-Cfil3U_e.js} +1 -1
- package/dist/component/{contacts-last-name-rac-1UyIuRKH.js → contacts-last-name-rac-CtPLE-7-.js} +1 -1
- package/dist/component/{contacts-phone-rac-BQ77BlW4.js → contacts-phone-rac-YkzsAoBZ.js} +1 -1
- package/dist/component/{contacts-position-rac-BUDUv7lv.js → contacts-position-rac-BS4j8QC-.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-DdtA0qKW.js → contacts-subscribe-rac-z_9VsEZL.js} +1 -1
- package/dist/component/{contacts-tax-id-rac-WUaKcNl0.js → contacts-tax-id-rac-WFkmKyZv.js} +1 -1
- package/dist/component/{date-availability-XjBFq8jt.js → date-availability-NN3rxosk.js} +1 -1
- package/dist/component/{date-input-field-rac-aY2zuuKs.js → date-input-field-rac-mdhEC3oq.js} +88 -89
- package/dist/component/{date-input-rac-DRiP2_97.js → date-input-rac-CGciuoTx.js} +1 -1
- package/dist/component/{date-picker-field-rac-Bzl-d3Uj.js → date-picker-field-rac-CRZVODfF.js} +90 -91
- package/dist/component/{date-picker-rac-DHHUh8vn.js → date-picker-rac-Bfbvjy8W.js} +1 -1
- package/dist/component/{date-time-input-field-rac-DP_StuLr.js → date-time-input-field-rac-TDWBXZ44.js} +76 -77
- package/dist/component/{date-time-input-rac-B11KIxsf.js → date-time-input-rac-DY0qdSix.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-BHZBqyWv.js → dext-checkbox-group-rac-BFGM7SOt.js} +2 -2
- package/dist/component/{dext-checkbox-rac-BIlAqEvV.js → dext-checkbox-rac-DPZvTeUZ.js} +1 -1
- package/dist/component/{dext-date-picker-rac-CHBXNrZi.js → dext-date-picker-rac-Xd5kojsQ.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-BYtliKry.js → dext-date-time-input-rac-C0RIdxJW.js} +1 -1
- package/dist/component/{dext-dropdown-rac-C2VPSFV5.js → dext-dropdown-rac-D1m8vJvm.js} +1 -1
- package/dist/component/{dext-email-rac-Fnb0Ggcs.js → dext-email-rac-BC81RFYY.js} +1 -1
- package/dist/component/{dext-number-input-rac-DopfSyFi.js → dext-number-input-rac-Z_ih9FfX.js} +1 -1
- package/dist/component/{dext-phone-rac-Rn4i_2rc.js → dext-phone-rac-s3BOnXuI.js} +1 -1
- package/dist/component/{dext-radio-group-rac-bNaskJpK.js → dext-radio-group-rac-CL3jcezs.js} +2 -2
- package/dist/component/{dext-rating-input-rac-DL6ZZd7d.js → dext-rating-input-rac-wz1EyP5b.js} +1 -1
- package/dist/component/{dext-tags-rac-TsUPoImO.js → dext-tags-rac-BY4Rf2BP.js} +2 -2
- package/dist/component/{dext-text-area-rac-BIuY7LTd.js → dext-text-area-rac-DRJzlsq8.js} +1 -1
- package/dist/component/{dext-text-input-rac-CSYPW0Qi.js → dext-text-input-rac-BGcRNNAi.js} +1 -1
- package/dist/component/{dext-url-input-rac-_g0lqGfW.js → dext-url-input-rac-CRAIm8yp.js} +1 -1
- package/dist/component/{donation-rac-BYKFtsyR.js → donation-rac-BlTfOIlE.js} +83 -84
- package/dist/component/{dropdown-field-headless-CBaqlNZi.js → dropdown-field-headless-DhzRAMcM.js} +12 -12
- package/dist/component/{dropdown-field-rac-CCAGSMm3.js → dropdown-field-rac-DXyY5we-.js} +5 -5
- package/dist/component/{dropdown-rac-C_EqUsZ1.js → dropdown-rac-C6YM6qxm.js} +1 -1
- package/dist/component/{ecom-address-rac-Bw9eH0iF.js → ecom-address-rac-CAdr7wya.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-B5PVOO2a.js → ecom-subscription-checkbox-rac-Z2VMuCbt.js} +6 -6
- package/dist/component/{email-input-field-rac-B2kqQ6yo.js → email-input-field-rac-DpkfunVK.js} +53 -54
- package/dist/component/{events-repeater-rac--4OnUxWE.js → events-repeater-rac-CuJkdrPo.js} +61 -62
- package/dist/component/{events-rsvp-rac-CczCoo3T.js → events-rsvp-rac-BKWlSeQ9.js} +8 -8
- package/dist/component/{field-error-headless-D3-1L5sf.js → field-error-headless-tsg9FQ-_.js} +12 -12
- package/dist/component/{field-label-headless-Du4ckIVy.js → field-label-headless-CB8dEat8.js} +11 -11
- package/dist/component/{file-upload-rac-DbdkUbWM.js → file-upload-rac-ZdgYt646.js} +67 -68
- package/dist/component/{fixed-payment-rac-f9-01iDN.js → fixed-payment-rac-CuIQEeHh.js} +20 -21
- package/dist/component/{form-DQauhsho.js → form-0jt4L5xo.js} +3045 -2896
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +1 -1
- package/dist/component/header-field-rac-CWVGzxKb.js +24 -0
- package/dist/component/{header-rac-CR9T3Pnu.js → header-rac-D6KsV-ko.js} +1 -1
- package/dist/component/{image-choice-rac-DJ_8v467.js → image-choice-rac-CUCyVS8c.js} +29 -30
- package/dist/component/{index-BB7d_9Dv.js → index-TJSnVtCO.js} +72 -72
- package/dist/component/{index-CcUTIUWM.js → index-iOqQidgV.js} +12 -12
- package/dist/component/{isObjectLike-xvPa_08X.js → isObjectLike-DQbx8r1c.js} +1 -1
- package/dist/component/{multiline-address-field-rac-CyaFOloE.js → multiline-address-field-rac-DtZ1NTfD.js} +186 -187
- package/dist/component/{multiline-address-rac-CaHGUN_f.js → multiline-address-rac-ub-_XzHU.js} +1 -1
- package/dist/component/number-input-field-rac-DLItn4DK.js +92 -0
- package/dist/component/{number-input-rac-DMKX6nhk.js → number-input-rac-UuxJzqEx.js} +1 -1
- package/dist/component/{password-rac-0RUXPAn6.js → password-rac-Di6q96Rn.js} +37 -38
- package/dist/component/{payment-input-rac-CHSZ3-Lt.js → payment-input-rac-CG6c4-Ge.js} +52 -53
- package/dist/component/{phone-input-field-rac-JmIFcP1e.js → phone-input-field-rac-D4JphCuT.js} +75 -76
- package/dist/component/{phone-rac-BLRnAPXP.js → phone-rac-_vDw2usa.js} +1 -1
- package/dist/component/{product-list-rac-BkF5tDwt.js → product-list-rac-CgxRlj1f.js} +73 -74
- package/dist/component/{quiz-radio-group-rac-32cCMTUS.js → quiz-radio-group-rac-bi26aGxN.js} +1 -1
- package/dist/component/{radio-button-module-classes-IOulhuSH.js → radio-button-module-classes-DDJq2ESf.js} +33 -33
- package/dist/component/{radio-group-field-rac-CJwku6e0.js → radio-group-field-rac-D1aMVO6l.js} +4 -4
- package/dist/component/{radio-group-rac-BiW-9Abj.js → radio-group-rac-HKC85M6t.js} +1 -1
- package/dist/component/{rating-input-field-rac-B9cwaROK.js → rating-input-field-rac-CpRehxFB.js} +42 -43
- package/dist/component/{rating-input-rac-BpwlNvzQ.js → rating-input-rac-BMuCZ3oj.js} +1 -1
- package/dist/component/{rich-content-rac.module-B1uyPmtK.js → rich-content-rac.module-mZ6xoAOd.js} +4 -4
- package/dist/component/rich-text-field-rac-CUK8V8Kf.js +21 -0
- package/dist/component/{rich-text-rac-VfeZxS27.js → rich-text-rac-B-7sR2FJ.js} +1 -1
- package/dist/component/{service-dropdown-rac-BCfs8IhW.js → service-dropdown-rac-1DDNT5bn.js} +43 -44
- package/dist/component/{services-multi-choice-rac-CCqdF_7P.js → services-multi-choice-rac-CB-6dwxz.js} +21 -22
- package/dist/component/{signature-rac-DOyMo3u0.js → signature-rac-7XBci6P2.js} +35 -36
- package/dist/component/{submit-button-rac-C2uA5DeE.js → submit-button-rac-B1-Mk8Gg.js} +21 -22
- package/dist/component/{tags-field-rac-C_uIw2by.js → tags-field-rac-CQ9Y7mq-.js} +49 -50
- package/dist/component/{tags-rac-1pQ-fpe_.js → tags-rac-Visic-Ml.js} +1 -1
- package/dist/component/{text-area-field-rac-DqlOkm7e.js → text-area-field-rac-C8fP1g-w.js} +31 -32
- package/dist/component/{text-area-rac-DPdkrFcH.js → text-area-rac-B6yZxzxm.js} +1 -1
- package/dist/component/{text-input-field-rac-CmXm6r1w.js → text-input-field-rac-CNjbOxD1.js} +5 -5
- package/dist/component/{text-input-headless-DD__2DFf.js → text-input-headless-Bm8PJGep.js} +12 -12
- package/dist/component/{text-input-rac-DRHyQEH7.js → text-input-rac-BEPC1Z-4.js} +1 -1
- package/dist/component/{time-input-rac-BJPIymQY.js → time-input-rac-3m6C_Jp5.js} +41 -42
- package/dist/component/url-input-field-rac-CIk_6Lf6.js +74 -0
- package/dist/component/{url-input-rac-C0ChQUzq.js → url-input-rac-DyVoygXH.js} +1 -1
- package/dist/component/use-dropdown-option-class-name-McG3ayOT.js +21 -0
- package/dist/component/{use-element-state-class-name-BatTc2bw.js → use-element-state-class-name-B9MBWX44.js} +1 -1
- package/dist/component/{use-is-forced-open-dropdown-B0jiPTmS.js → use-is-forced-open-dropdown-r5G_sZsO.js} +7 -7
- package/dist/component/{use-service-options-base-oeE7xszw.js → use-service-options-base-hcbkvhpw.js} +7 -7
- package/dist/component/use-text-input-class-name-SnurFqAr.js +23 -0
- package/dist/form.d.ts +3 -1
- package/package.json +2 -2
- 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
package/dist/component/{rating-input-field-rac-B9cwaROK.js → rating-input-field-rac-CpRehxFB.js}
RENAMED
|
@@ -1,56 +1,55 @@
|
|
|
1
1
|
import { RicosViewer as y } from "@wix/ricos/viewer";
|
|
2
2
|
import m from "classnames";
|
|
3
3
|
import e, { useCallback as N, useState as O, useRef as A } from "react";
|
|
4
|
-
import {
|
|
5
|
-
import { RadioGroup as
|
|
6
|
-
import { f as u, a as
|
|
7
|
-
import { D as
|
|
8
|
-
import { L as
|
|
9
|
-
import { E as
|
|
4
|
+
import { b5 as I, b2 as v, bf as T, H, T as M, R as w, u as B, p as P, S as q } from "./form-0jt4L5xo.js";
|
|
5
|
+
import { RadioGroup as G, RadioField as k, RadioButton as x } from "react-aria-components";
|
|
6
|
+
import { f as u, a as U } from "./find-child-C60k4CxG.js";
|
|
7
|
+
import { D as z, E as Q } from "./field-error-headless-tsg9FQ-_.js";
|
|
8
|
+
import { L as Z } from "./field-label-headless-CB8dEat8.js";
|
|
9
|
+
import { E as j } from "./error-icon-hZxQ6DEy.js";
|
|
10
10
|
import { s as g } from "./field-rac.module-B4l_0KRU.js";
|
|
11
|
-
import {
|
|
12
|
-
import { u as Z } from "./use-element-state-class-name-BatTc2bw.js";
|
|
11
|
+
import { u as J } from "./use-element-state-class-name-B9MBWX44.js";
|
|
13
12
|
const t = ({ children: a }) => {
|
|
14
|
-
const { id: n, value: r, onChange:
|
|
15
|
-
|
|
13
|
+
const { id: n, value: r, onChange: o, disabled: l, readOnly: d, required: c, hasError: i, onBlur: E, onFocus: R, FieldLayout: C } = I(), { labelId: _ } = v(), L = N((D) => o(Number(D)), [
|
|
14
|
+
o
|
|
16
15
|
]), f = u(a, t.Label), s = u(a, t.Ratings), S = u(a, t.Description), h = u(a, t.Error);
|
|
17
|
-
return /* @__PURE__ */ e.createElement(
|
|
16
|
+
return /* @__PURE__ */ e.createElement(C, {
|
|
18
17
|
fieldId: n,
|
|
19
18
|
renderLabel: () => f,
|
|
20
|
-
renderInput: () => /* @__PURE__ */ e.createElement(
|
|
19
|
+
renderInput: () => /* @__PURE__ */ e.createElement(G, {
|
|
21
20
|
"aria-labelledby": _,
|
|
22
21
|
value: r ? String(r) : void 0,
|
|
23
22
|
onChange: L,
|
|
24
|
-
isDisabled:
|
|
23
|
+
isDisabled: l,
|
|
25
24
|
isReadOnly: d,
|
|
26
25
|
isRequired: c,
|
|
27
26
|
isInvalid: i,
|
|
28
27
|
onBlur: E,
|
|
29
|
-
onFocus:
|
|
28
|
+
onFocus: R,
|
|
30
29
|
orientation: "horizontal"
|
|
31
30
|
}, s),
|
|
32
31
|
renderDescription: () => /* @__PURE__ */ e.createElement(e.Fragment, null, h, S)
|
|
33
32
|
});
|
|
34
|
-
},
|
|
35
|
-
const { value:
|
|
33
|
+
}, b = ({ children: a, className: n, getReactionLabel: r }) => {
|
|
34
|
+
const { value: o, readOnly: l, hasError: d } = I(), { inputId: c, ariaDescribedBy: i } = v(), [E, R] = O(), C = A(null), _ = u(a, b.Rating), L = [
|
|
36
35
|
"1",
|
|
37
36
|
"2",
|
|
38
37
|
"3",
|
|
39
38
|
"4",
|
|
40
39
|
"5"
|
|
41
|
-
], f = (s) => E && !
|
|
40
|
+
], f = (s) => E && !l ? E >= s : !!o && o >= Number(s);
|
|
42
41
|
return /* @__PURE__ */ e.createElement("div", {
|
|
43
|
-
ref:
|
|
42
|
+
ref: C,
|
|
44
43
|
id: c,
|
|
45
44
|
"aria-describedby": i,
|
|
46
45
|
className: n,
|
|
47
46
|
"data-invalid": d,
|
|
48
|
-
"data-readonly":
|
|
49
|
-
}, L.map((s) =>
|
|
47
|
+
"data-readonly": l
|
|
48
|
+
}, L.map((s) => U(_, {
|
|
50
49
|
key: s,
|
|
51
50
|
value: s,
|
|
52
51
|
isSelected: f(s),
|
|
53
|
-
onHoverChange: (S) =>
|
|
52
|
+
onHoverChange: (S) => R(S ? s : void 0),
|
|
54
53
|
label: r == null ? void 0 : r(Number(s))
|
|
55
54
|
})));
|
|
56
55
|
}, K = {
|
|
@@ -64,29 +63,29 @@ const t = ({ children: a }) => {
|
|
|
64
63
|
width: 1,
|
|
65
64
|
whiteSpace: "nowrap"
|
|
66
65
|
}, F = ({ className: a, children: n, ...r }) => {
|
|
67
|
-
const { value:
|
|
68
|
-
return /* @__PURE__ */ e.createElement(
|
|
69
|
-
value:
|
|
70
|
-
}, /* @__PURE__ */ e.createElement(
|
|
66
|
+
const { value: o, isSelected: l, onHoverChange: d, label: c } = r;
|
|
67
|
+
return /* @__PURE__ */ e.createElement(k, {
|
|
68
|
+
value: o
|
|
69
|
+
}, /* @__PURE__ */ e.createElement(x, {
|
|
71
70
|
className: ({ isHovered: i }) => typeof a == "function" ? a({
|
|
72
|
-
isSelected:
|
|
71
|
+
isSelected: l,
|
|
73
72
|
isHovered: i
|
|
74
73
|
}) : a ?? "",
|
|
75
|
-
"data-active":
|
|
74
|
+
"data-active": l || void 0,
|
|
76
75
|
onHoverChange: d
|
|
77
76
|
}, ({ isHovered: i }) => /* @__PURE__ */ e.createElement(e.Fragment, null, typeof n == "function" ? n({
|
|
78
|
-
isSelected:
|
|
77
|
+
isSelected: l,
|
|
79
78
|
isHovered: i
|
|
80
79
|
}) : n, c ? /* @__PURE__ */ e.createElement("span", {
|
|
81
80
|
style: K
|
|
82
81
|
}, c) : null)));
|
|
83
82
|
};
|
|
84
|
-
|
|
85
|
-
t.Label =
|
|
86
|
-
t.Ratings =
|
|
83
|
+
b.Rating = F;
|
|
84
|
+
t.Label = Z;
|
|
85
|
+
t.Ratings = b;
|
|
87
86
|
t.Rating = F;
|
|
88
|
-
t.Description =
|
|
89
|
-
t.Error =
|
|
87
|
+
t.Description = z;
|
|
88
|
+
t.Error = Q;
|
|
90
89
|
const W = (a) => /* @__PURE__ */ e.createElement("svg", {
|
|
91
90
|
viewBox: "0 0 32 32",
|
|
92
91
|
width: 32,
|
|
@@ -109,28 +108,28 @@ const W = (a) => /* @__PURE__ */ e.createElement("svg", {
|
|
|
109
108
|
base: p.rating,
|
|
110
109
|
selected: p.ratingSelected,
|
|
111
110
|
hover: p.ratingHover
|
|
112
|
-
},
|
|
113
|
-
const { t: a } =
|
|
114
|
-
globalClasses:
|
|
111
|
+
}, Ee = () => {
|
|
112
|
+
const { t: a } = T(), n = J({
|
|
113
|
+
globalClasses: q,
|
|
115
114
|
moduleClasses: te
|
|
116
115
|
});
|
|
117
116
|
return /* @__PURE__ */ e.createElement(t, null, /* @__PURE__ */ e.createElement(t.Label, {
|
|
118
|
-
className: m(
|
|
117
|
+
className: m(H, g.label)
|
|
119
118
|
}, /* @__PURE__ */ e.createElement(t.Label.Required, {
|
|
120
|
-
className: m(
|
|
119
|
+
className: m(M, g.requiredMark)
|
|
121
120
|
})), /* @__PURE__ */ e.createElement(t.Ratings, {
|
|
122
|
-
className: m(
|
|
121
|
+
className: m(w, p.ratings),
|
|
123
122
|
getReactionLabel: (r) => a("rating-input.a11y.reaction-label", {
|
|
124
123
|
count: r
|
|
125
124
|
})
|
|
126
125
|
}, /* @__PURE__ */ e.createElement(t.Rating, {
|
|
127
126
|
className: n
|
|
128
127
|
}, /* @__PURE__ */ e.createElement(W, null))), /* @__PURE__ */ e.createElement(t.Error, {
|
|
129
|
-
className: m(
|
|
130
|
-
}, /* @__PURE__ */ e.createElement(
|
|
131
|
-
className: m(
|
|
128
|
+
className: m(B, g.error)
|
|
129
|
+
}, /* @__PURE__ */ e.createElement(j, null), /* @__PURE__ */ e.createElement(t.Error.Text, null)), /* @__PURE__ */ e.createElement(t.Description, {
|
|
130
|
+
className: m(P, g.description)
|
|
132
131
|
}, ee));
|
|
133
132
|
};
|
|
134
133
|
export {
|
|
135
|
-
|
|
134
|
+
Ee as R
|
|
136
135
|
};
|
package/dist/component/{rich-content-rac.module-B1uyPmtK.js → rich-content-rac.module-mZ6xoAOd.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import c, { useState as
|
|
2
|
-
import {
|
|
1
|
+
import c, { useState as u } from "react";
|
|
2
|
+
import { b5 as a, aZ as i, bf as T } from "./form-0jt4L5xo.js";
|
|
3
3
|
import { Button as d } from "react-aria-components";
|
|
4
4
|
import { D as r } from "./data-hooks-Dkw1pbRj.js";
|
|
5
5
|
import { truncateRichContent as _ } from "@wix/ricos/content";
|
|
@@ -25,9 +25,9 @@ const O = ({ children: e }) => {
|
|
|
25
25
|
}, o);
|
|
26
26
|
};
|
|
27
27
|
function B(e, t) {
|
|
28
|
-
const [n, o] =
|
|
28
|
+
const [n, o] = u(!0);
|
|
29
29
|
function s() {
|
|
30
|
-
o((
|
|
30
|
+
o((l) => !l);
|
|
31
31
|
}
|
|
32
32
|
return {
|
|
33
33
|
displayedContent: t && n ? _(e, {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import l from "classnames";
|
|
2
|
+
import e from "react";
|
|
3
|
+
import { b5 as m, aj as i, a1 as u, aI as R, aL as T } from "./form-0jt4L5xo.js";
|
|
4
|
+
import { u as C, R as d, s as g, T as p } from "./rich-content-rac.module-mZ6xoAOd.js";
|
|
5
|
+
const h = {
|
|
6
|
+
colorPalette: T(),
|
|
7
|
+
customStyles: R()
|
|
8
|
+
}, P = ({ truncate: t = !0 } = {}) => {
|
|
9
|
+
const { content: a, maxShownParagraphs: s } = m(), { displayedContent: n, isTruncated: o, isTruncateButtonShown: r, toggleTruncate: c } = C(a, t ? s : void 0);
|
|
10
|
+
return /* @__PURE__ */ e.createElement(d, null, () => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(i, {
|
|
11
|
+
className: l(u, g.richContent),
|
|
12
|
+
content: n,
|
|
13
|
+
customTheme: h
|
|
14
|
+
}), r && /* @__PURE__ */ e.createElement(p, {
|
|
15
|
+
isTruncated: o,
|
|
16
|
+
onClick: c
|
|
17
|
+
})));
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
P as R
|
|
21
|
+
};
|
package/dist/component/{service-dropdown-rac-BCfs8IhW.js → service-dropdown-rac-1DDNT5bn.js}
RENAMED
|
@@ -1,36 +1,35 @@
|
|
|
1
|
-
import t, { useRef as
|
|
2
|
-
import { RicosViewer as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { u as
|
|
6
|
-
import { D as d } from "./dropdown-field-headless-
|
|
7
|
-
import { C as
|
|
8
|
-
import { E as
|
|
9
|
-
import { H as
|
|
1
|
+
import t, { useRef as T, useMemo as g, useCallback as D, useEffect as P } from "react";
|
|
2
|
+
import { RicosViewer as b } from "@wix/ricos/viewer";
|
|
3
|
+
import m from "classnames";
|
|
4
|
+
import { b1 as w, bf as A, F as M, b5 as y, aZ as H, a8 as V, H as x, T as U, t as W, J as k, u as q, p as B } from "./form-0jt4L5xo.js";
|
|
5
|
+
import { u as G } from "./use-service-options-base-hcbkvhpw.js";
|
|
6
|
+
import { D as d } from "./dropdown-field-headless-DhzRAMcM.js";
|
|
7
|
+
import { C as J } from "./chevron-down-icon-CcpVm6B-.js";
|
|
8
|
+
import { E as Q } from "./error-icon-hZxQ6DEy.js";
|
|
9
|
+
import { H as Y } from "./custom-focus-class-_483Pkwp.js";
|
|
10
10
|
import { s as i } from "./field-rac.module-B4l_0KRU.js";
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
const { actions: r } = A(), { t: D } = b(), { addOther: n, addOtherLabel: p } = e, c = p || D("add-other.default-other-option-label"), a = P(!0), E = L(() => {
|
|
11
|
+
import { u as Z } from "./use-dropdown-option-class-name-McG3ayOT.js";
|
|
12
|
+
const j = "00000000-0000-0000-0000-000000000000", z = (e) => {
|
|
13
|
+
const { actions: r } = w(), { t: h } = A(), { addOther: n, addOtherLabel: p } = e, c = p || h("add-other.default-other-option-label"), a = T(!0), E = g(() => {
|
|
15
14
|
var s;
|
|
16
|
-
return ((s = e.options) == null ? void 0 : s.map((
|
|
15
|
+
return ((s = e.options) == null ? void 0 : s.map((u) => u.id ?? "")) ?? [];
|
|
17
16
|
}, [
|
|
18
17
|
e.options
|
|
19
|
-
]), O =
|
|
18
|
+
]), O = D((s) => n ? [
|
|
20
19
|
...s,
|
|
21
20
|
{
|
|
22
21
|
value: c,
|
|
23
22
|
label: c,
|
|
24
|
-
id:
|
|
23
|
+
id: j
|
|
25
24
|
}
|
|
26
25
|
] : s, [
|
|
27
26
|
n,
|
|
28
27
|
c
|
|
29
|
-
]), { isLoading: f, options: l, isEmpty: C, shouldRender: I, setIsLoading: R, setOptions: _, setIsEmpty: S, processOptions:
|
|
28
|
+
]), { isLoading: f, options: l, isEmpty: C, shouldRender: I, setIsLoading: R, setOptions: _, setIsEmpty: S, processOptions: F } = G({
|
|
30
29
|
fieldType: M.SERVICES_DROPDOWN,
|
|
31
30
|
isEditor: e.isEditor,
|
|
32
31
|
postProcessOptions: O
|
|
33
|
-
}),
|
|
32
|
+
}), L = D(async () => {
|
|
34
33
|
if (a.current && (r != null && r.fetchServices) && E.length > 0) {
|
|
35
34
|
a.current = !1, R(!0);
|
|
36
35
|
let s;
|
|
@@ -38,12 +37,12 @@ const z = "00000000-0000-0000-0000-000000000000", K = (e) => {
|
|
|
38
37
|
s = await r.fetchServices({
|
|
39
38
|
serviceIds: E
|
|
40
39
|
});
|
|
41
|
-
} catch (
|
|
42
|
-
console.error(
|
|
40
|
+
} catch (u) {
|
|
41
|
+
console.error(u);
|
|
43
42
|
}
|
|
44
43
|
if (s) {
|
|
45
|
-
const
|
|
46
|
-
S(!n &&
|
|
44
|
+
const u = F(s);
|
|
45
|
+
S(!n && u.length === 0), _(u);
|
|
47
46
|
} else
|
|
48
47
|
a.current = !0;
|
|
49
48
|
R(!1);
|
|
@@ -51,13 +50,13 @@ const z = "00000000-0000-0000-0000-000000000000", K = (e) => {
|
|
|
51
50
|
}, [
|
|
52
51
|
r,
|
|
53
52
|
E,
|
|
54
|
-
|
|
53
|
+
F,
|
|
55
54
|
n,
|
|
56
55
|
R,
|
|
57
56
|
_,
|
|
58
57
|
S
|
|
59
58
|
]);
|
|
60
|
-
|
|
59
|
+
P(() => {
|
|
61
60
|
if (!e.isEditor && l.length > 0) {
|
|
62
61
|
const s = n ? l.length - 1 : l.length;
|
|
63
62
|
S(s === 0);
|
|
@@ -68,12 +67,12 @@ const z = "00000000-0000-0000-0000-000000000000", K = (e) => {
|
|
|
68
67
|
S,
|
|
69
68
|
e.isEditor
|
|
70
69
|
]);
|
|
71
|
-
const v =
|
|
72
|
-
e.onFocus && e.onFocus(), a.current &&
|
|
70
|
+
const v = D(() => {
|
|
71
|
+
e.onFocus && e.onFocus(), a.current && L();
|
|
73
72
|
}, [
|
|
74
|
-
|
|
73
|
+
L,
|
|
75
74
|
e.onFocus
|
|
76
|
-
]), N =
|
|
75
|
+
]), N = D(
|
|
77
76
|
(s) => {
|
|
78
77
|
e.onChange && e.onChange(s), a.current = !0;
|
|
79
78
|
},
|
|
@@ -91,10 +90,10 @@ const z = "00000000-0000-0000-0000-000000000000", K = (e) => {
|
|
|
91
90
|
shouldRender: I
|
|
92
91
|
};
|
|
93
92
|
}, o = ({ children: e }) => {
|
|
94
|
-
const r = y(), { addOther:
|
|
93
|
+
const r = y(), { addOther: h } = r, n = H(), p = r.isEditor || n.isEditor || n.isComposer, { isLoading: c, options: a, isEmpty: E, onFocus: O, onChange: f, shouldRender: l } = z({
|
|
95
94
|
...r,
|
|
96
95
|
isEditor: p
|
|
97
|
-
}), C =
|
|
96
|
+
}), C = g(() => ({
|
|
98
97
|
...r,
|
|
99
98
|
options: c ? [] : a,
|
|
100
99
|
isLoading: c,
|
|
@@ -107,7 +106,7 @@ const z = "00000000-0000-0000-0000-000000000000", K = (e) => {
|
|
|
107
106
|
O,
|
|
108
107
|
f
|
|
109
108
|
]);
|
|
110
|
-
return !p && E && !
|
|
109
|
+
return !p && E && !h || !l ? null : /* @__PURE__ */ t.createElement(V.Provider, {
|
|
111
110
|
value: {
|
|
112
111
|
v2: C
|
|
113
112
|
}
|
|
@@ -118,29 +117,29 @@ o.Trigger = d.Trigger;
|
|
|
118
117
|
o.Options = d.Options;
|
|
119
118
|
o.Description = d.Description;
|
|
120
119
|
o.Error = d.Error;
|
|
121
|
-
const
|
|
120
|
+
const K = ({ content: e, locale: r }) => /* @__PURE__ */ t.createElement(b, {
|
|
122
121
|
content: e,
|
|
123
122
|
locale: r
|
|
124
|
-
}),
|
|
125
|
-
const e = Y
|
|
123
|
+
}), X = () => {
|
|
124
|
+
const e = Z(Y);
|
|
126
125
|
return /* @__PURE__ */ t.createElement(o, null, /* @__PURE__ */ t.createElement(o.Label, {
|
|
127
|
-
className:
|
|
126
|
+
className: m(x, i.label)
|
|
128
127
|
}, /* @__PURE__ */ t.createElement(o.Label.Required, {
|
|
129
|
-
className:
|
|
128
|
+
className: m(U, i.requiredMark)
|
|
130
129
|
})), /* @__PURE__ */ t.createElement(o.Trigger, {
|
|
131
|
-
className:
|
|
132
|
-
}, /* @__PURE__ */ t.createElement(
|
|
130
|
+
className: m(W, i.input, i.dropdownTrigger)
|
|
131
|
+
}, /* @__PURE__ */ t.createElement(J, {
|
|
133
132
|
className: i.dropdownIcon
|
|
134
133
|
})), /* @__PURE__ */ t.createElement(o.Options, {
|
|
135
|
-
className:
|
|
134
|
+
className: m(k, i.selectPopover, i.dropdownPopover)
|
|
136
135
|
}, /* @__PURE__ */ t.createElement(o.Options.Option, {
|
|
137
136
|
className: e
|
|
138
137
|
})), /* @__PURE__ */ t.createElement(o.Error, {
|
|
139
|
-
className:
|
|
140
|
-
}, /* @__PURE__ */ t.createElement(
|
|
141
|
-
className:
|
|
142
|
-
},
|
|
143
|
-
}, ue = () => /* @__PURE__ */ t.createElement(
|
|
138
|
+
className: m(q, i.error)
|
|
139
|
+
}, /* @__PURE__ */ t.createElement(Q, null), /* @__PURE__ */ t.createElement(o.Error.Text, null)), /* @__PURE__ */ t.createElement(o.Description, {
|
|
140
|
+
className: m(B, i.description)
|
|
141
|
+
}, K));
|
|
142
|
+
}, ue = () => /* @__PURE__ */ t.createElement(X, null);
|
|
144
143
|
export {
|
|
145
144
|
ue as ServiceDropdownRAC
|
|
146
145
|
};
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import e, { useEffect as I, useMemo as L } from "react";
|
|
2
2
|
import { RicosViewer as S } from "@wix/ricos/viewer";
|
|
3
3
|
import a from "classnames";
|
|
4
|
-
import { F as R,
|
|
5
|
-
import { u as
|
|
6
|
-
import { C as n } from "./checkbox-group-field-headless-
|
|
7
|
-
import { E as
|
|
8
|
-
import { C as
|
|
4
|
+
import { F as R, b5 as d, a8 as D, H as N, T as F, i as f, k as h, u as b, p as M, j as A } from "./form-0jt4L5xo.js";
|
|
5
|
+
import { u as T } from "./use-service-options-base-hcbkvhpw.js";
|
|
6
|
+
import { C as n } from "./checkbox-group-field-headless-BsOww_QB.js";
|
|
7
|
+
import { E as v } from "./error-icon-hZxQ6DEy.js";
|
|
8
|
+
import { C as x } from "./checkbox-indicator-module-classes-BpeSpGsW.js";
|
|
9
9
|
import { s as i } from "./field-rac.module-B4l_0KRU.js";
|
|
10
|
-
import { v as h, J as b, c as M, e as A, o as v, j as x, d as P } from "./form-element-classes-bLFmhsKw.js";
|
|
11
10
|
import { o as p } from "./options-rac.module-CTDdATiz.js";
|
|
12
|
-
import { u as
|
|
13
|
-
import { u as k } from "./use-text-input-class-name-
|
|
11
|
+
import { u as P } from "./use-element-state-class-name-B9MBWX44.js";
|
|
12
|
+
import { u as k } from "./use-text-input-class-name-SnurFqAr.js";
|
|
14
13
|
const y = (s) => {
|
|
15
14
|
var O;
|
|
16
|
-
const { isLoading: o, options: r, isEmpty: l, shouldRender: E, setOptions: c, setIsEmpty: m, setHasInitialDataLoaded: u } =
|
|
15
|
+
const { isLoading: o, options: r, isEmpty: l, shouldRender: E, setOptions: c, setIsEmpty: m, setHasInitialDataLoaded: u } = T({
|
|
17
16
|
fieldType: R.SERVICES_MULTI_CHOICE,
|
|
18
17
|
isEditor: s.isEditor
|
|
19
18
|
}), C = (O = s.options) == null ? void 0 : O.every((_) => _.label && _.id);
|
|
@@ -57,33 +56,33 @@ t.Error = n.Error;
|
|
|
57
56
|
const B = ({ content: s, locale: o }) => /* @__PURE__ */ e.createElement(S, {
|
|
58
57
|
content: s,
|
|
59
58
|
locale: o
|
|
60
|
-
}),
|
|
61
|
-
const s =
|
|
62
|
-
globalClasses:
|
|
63
|
-
moduleClasses:
|
|
59
|
+
}), H = () => {
|
|
60
|
+
const s = P({
|
|
61
|
+
globalClasses: A,
|
|
62
|
+
moduleClasses: x
|
|
64
63
|
}), o = k();
|
|
65
64
|
return /* @__PURE__ */ e.createElement(t, {
|
|
66
65
|
className: p.group
|
|
67
66
|
}, /* @__PURE__ */ e.createElement(t.Label, {
|
|
68
|
-
className: a(
|
|
67
|
+
className: a(N, i.label)
|
|
69
68
|
}, /* @__PURE__ */ e.createElement(t.Label.Required, {
|
|
70
|
-
className: a(
|
|
69
|
+
className: a(F, i.requiredMark)
|
|
71
70
|
})), /* @__PURE__ */ e.createElement(t.Options, {
|
|
72
|
-
className: a(
|
|
71
|
+
className: a(f, p.options)
|
|
73
72
|
}, /* @__PURE__ */ e.createElement(t.Options.Option, null, /* @__PURE__ */ e.createElement(t.Options.Option.Checkbox, {
|
|
74
73
|
className: i.checkbox
|
|
75
74
|
}, /* @__PURE__ */ e.createElement(t.Options.Option.Checkbox.Input, {
|
|
76
75
|
className: s
|
|
77
76
|
}), /* @__PURE__ */ e.createElement(t.Options.Option.Checkbox.Label, {
|
|
78
|
-
className: a(
|
|
77
|
+
className: a(h, p.optionLabel)
|
|
79
78
|
})), /* @__PURE__ */ e.createElement(t.Options.Option.OtherInput, {
|
|
80
79
|
inputClassName: o
|
|
81
80
|
}))), /* @__PURE__ */ e.createElement(t.Error, {
|
|
82
|
-
className: a(
|
|
83
|
-
}, /* @__PURE__ */ e.createElement(
|
|
84
|
-
className: a(
|
|
81
|
+
className: a(b, i.error)
|
|
82
|
+
}, /* @__PURE__ */ e.createElement(v, null), /* @__PURE__ */ e.createElement(t.Error.Text, null)), /* @__PURE__ */ e.createElement(t.Description, {
|
|
83
|
+
className: a(M, i.description)
|
|
85
84
|
}, B));
|
|
86
|
-
},
|
|
85
|
+
}, J = () => /* @__PURE__ */ e.createElement(H, null);
|
|
87
86
|
export {
|
|
88
|
-
|
|
87
|
+
J as ServicesMultiChoiceRAC
|
|
89
88
|
};
|