@wix/form-elements 1.80.0 → 1.81.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-BYisg594.js → appointment-rac-DmwbqZse.js} +82 -82
- package/dist/component/{bookings-address-rac-CsILj67y.js → bookings-address-rac-RCzVU87c.js} +1 -1
- package/dist/component/{bookings-email-rac-CVmAPK_5.js → bookings-email-rac-Df_Wte1_.js} +1 -1
- package/dist/component/{bookings-first-name-rac-Dh41-RQ_.js → bookings-first-name-rac-BmdRGYxF.js} +1 -1
- package/dist/component/{bookings-header-rac-B6Fgfiz5.js → bookings-header-rac-DewQWtkZ.js} +1 -1
- package/dist/component/{bookings-last-name-rac-CuY8aaXv.js → bookings-last-name-rac-DmmNBuqy.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-B8JBcGs8.js → bookings-login-bar-rac-QskvFo0C.js} +5 -5
- package/dist/component/{bookings-phone-rac-Bspc3F7g.js → bookings-phone-rac-7wn8IXna.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-B1o0ZcfK.js → bookings-rich-text-rac-B5nk0BlD.js} +1 -1
- package/dist/component/{checkbox-field-rac-thaR4lXB.js → checkbox-field-rac-BnVNfYWL.js} +5 -5
- package/dist/component/{checkbox-group-field-headless-DryeaW7l.js → checkbox-group-field-headless-Bx5Y-RMP.js} +3 -3
- package/dist/component/{checkbox-group-field-rac-CJfbT13O.js → checkbox-group-field-rac-CZW28rj5.js} +7 -7
- package/dist/component/{checkbox-group-rac-BwI7UHzO.js → checkbox-group-rac-B20t8dTB.js} +1 -1
- package/dist/component/{checkbox-rac-HRTKCRY4.js → checkbox-rac-ifC6qSE8.js} +1 -1
- package/dist/component/{contacts-address-rac-BIn9plXb.js → contacts-address-rac-XJRKvPlp.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-oGP8bO3I.js → contacts-birthdate-rac-CKYESrPO.js} +1 -1
- package/dist/component/{contacts-company-rac-ChdjTt8-.js → contacts-company-rac-BXwEeb0p.js} +1 -1
- package/dist/component/{contacts-email-rac-BUluFo-o.js → contacts-email-rac-D8Yspo_m.js} +1 -1
- package/dist/component/{contacts-first-name-rac-tmboINSq.js → contacts-first-name-rac-mvCGP1LJ.js} +1 -1
- package/dist/component/{contacts-last-name-rac-BaD5OBVf.js → contacts-last-name-rac-Clg9RXal.js} +1 -1
- package/dist/component/{contacts-phone-rac-BoX2-IEP.js → contacts-phone-rac-qEwjhByI.js} +1 -1
- package/dist/component/{contacts-position-rac-BNDskehr.js → contacts-position-rac-Bh8fvf2M.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-CVaQG4Qy.js → contacts-subscribe-rac-DEQ2XkZo.js} +2 -2
- package/dist/component/{contacts-tax-id-rac-Dxgxcv7c.js → contacts-tax-id-rac-0DUZ4tJz.js} +1 -1
- package/dist/component/{date-availability-BbrBYxgL.js → date-availability-2ek2RtXx.js} +1 -1
- package/dist/component/{date-input-field-rac-oibxt2dz.js → date-input-field-rac-Bp4SQB-t.js} +29 -29
- package/dist/component/{date-input-rac-h2vrPoah.js → date-input-rac-CYsJcMe5.js} +1 -1
- package/dist/component/{date-picker-field-rac-Cr9PMglz.js → date-picker-field-rac-BGQvnSYI.js} +9 -9
- package/dist/component/{date-picker-rac-8BOHRpaJ.js → date-picker-rac-BVncggYR.js} +1 -1
- package/dist/component/{date-time-input-field-rac-C7CZ4i6-.js → date-time-input-field-rac-B1mggelc.js} +33 -33
- package/dist/component/{date-time-input-rac-BARK1BJc.js → date-time-input-rac-DzdCno0L.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-CWc0W-zr.js → dext-checkbox-group-rac-CNCpeolD.js} +2 -2
- package/dist/component/{dext-checkbox-rac-NKcTYwpg.js → dext-checkbox-rac-BYDQ58Mo.js} +1 -1
- package/dist/component/{dext-date-picker-rac-SllyCpYt.js → dext-date-picker-rac-aYYk8Nrl.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-JT9Pa7TG.js → dext-date-time-input-rac-v2v974p5.js} +1 -1
- package/dist/component/{dext-dropdown-rac-aBU9t_U4.js → dext-dropdown-rac-C846KZCe.js} +1 -1
- package/dist/component/{dext-email-rac-DKoJiyjE.js → dext-email-rac-izjbfME9.js} +1 -1
- package/dist/component/{dext-number-input-rac-BHkzAyzd.js → dext-number-input-rac-CnOFsD7l.js} +1 -1
- package/dist/component/{dext-phone-rac-Ou-fxcN5.js → dext-phone-rac-D8GMXD88.js} +1 -1
- package/dist/component/{dext-radio-group-rac-CH0WlRsF.js → dext-radio-group-rac-BtiyGCRh.js} +2 -2
- package/dist/component/{dext-rating-input-rac-D_jXx_VN.js → dext-rating-input-rac-BHJ1kitb.js} +1 -1
- package/dist/component/{dext-tags-rac-DBaT-lQT.js → dext-tags-rac-CvNjwS5R.js} +2 -2
- package/dist/component/{dext-text-area-rac-DWcCktYi.js → dext-text-area-rac-X5L0Q3sC.js} +1 -1
- package/dist/component/{dext-text-input-rac-CBX2wgW-.js → dext-text-input-rac-swkyAJqC.js} +1 -1
- package/dist/component/{dext-url-input-rac-DaqWDzIt.js → dext-url-input-rac-BYlXOAkz.js} +1 -1
- package/dist/component/donation-rac-CDWLBZZM.js +318 -0
- package/dist/component/{dropdown-field-headless-D7mOjVEJ.js → dropdown-field-headless-JJzbZvps.js} +3 -3
- package/dist/component/{dropdown-field-rac-DsRuMFo4.js → dropdown-field-rac-BodpIQ9Q.js} +5 -5
- package/dist/component/{dropdown-rac-8Fe66UGi.js → dropdown-rac-Bfbxxx9k.js} +1 -1
- package/dist/component/{ecom-address-rac-DbR_WEgu.js → ecom-address-rac-BCnsL5tr.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-ByQsK79_.js → ecom-subscription-checkbox-rac-CNSdI_ty.js} +3 -3
- package/dist/component/{email-input-field-rac-BS0bFS0-.js → email-input-field-rac-Btaa4O5T.js} +48 -48
- package/dist/component/{events-repeater-rac-xhXarOw_.js → events-repeater-rac-xBwqJddt.js} +10 -10
- package/dist/component/{events-rsvp-rac-BLq-ro2E.js → events-rsvp-rac-D90PwkHd.js} +3 -3
- package/dist/component/{field-error-headless-C7IUibkK.js → field-error-headless-BErhh9GG.js} +1 -1
- package/dist/component/{field-label-headless-BQFy2iAr.js → field-label-headless-BGyK-5xW.js} +1 -1
- package/dist/component/{file-upload-rac-B84R44Bt.js → file-upload-rac-MxH3CVml.js} +21 -21
- package/dist/component/{fixed-payment-rac-D7Asu-Ws.js → fixed-payment-rac-DpBA9irF.js} +10 -10
- package/dist/component/{form-element-classes-BuM-vthE.js → form-element-classes-jC8D0LnK.js} +77 -63
- package/dist/component/{form-BmioUKtQ.js → form-f0tqdMye.js} +69 -69
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +1 -1
- package/dist/component/{header-field-rac-CN5SyZpH.js → header-field-rac-BXxFqu9u.js} +3 -3
- package/dist/component/{header-rac-B9ITu2YO.js → header-rac-BN70esac.js} +1 -1
- package/dist/component/image-choice-rac-DLBGIBXL.js +158 -0
- package/dist/component/{index-3q1aCLZ8.js → index-BvB-uE1H.js} +2 -2
- package/dist/component/{index-CvWMG1x1.js → index-DXLEHYlA.js} +4 -4
- package/dist/component/{isObjectLike-xDv2bEeI.js → isObjectLike-BYOX5XY4.js} +1 -1
- package/dist/component/{multiline-address-field-rac-BLDqei5I.js → multiline-address-field-rac-fcQYnPlO.js} +52 -52
- package/dist/component/{multiline-address-rac-Dy9Km8P8.js → multiline-address-rac-D82Gbj3n.js} +1 -1
- package/dist/component/{number-input-field-rac-Dxu4WHzh.js → number-input-field-rac-B0-4Rz3w.js} +16 -16
- package/dist/component/{number-input-rac-hHEmwPao.js → number-input-rac-Bnsvb-SO.js} +1 -1
- package/dist/component/{password-rac-CEylicEt.js → password-rac-BdBjFa8y.js} +15 -15
- package/dist/component/{payment-input-rac-bvK_YQ78.js → payment-input-rac-DkAGOvaF.js} +18 -18
- package/dist/component/{phone-input-field-rac-CqYNWmiA.js → phone-input-field-rac-Ce_wuE46.js} +54 -54
- package/dist/component/{phone-rac-C72xrPL6.js → phone-rac-DslINtcH.js} +1 -1
- package/dist/component/{product-list-rac-DbftZgIh.js → product-list-rac-C4P_SOyG.js} +25 -25
- package/dist/component/{quiz-radio-group-rac-Bkg5poft.js → quiz-radio-group-rac-noy4fmD8.js} +2 -2
- package/dist/component/{radio-button-module-classes-Do4JmHrh.js → radio-button-module-classes-DXQ1UlmI.js} +3 -3
- package/dist/component/{radio-group-field-rac-BkoqJYp4.js → radio-group-field-rac-CYBDq7R1.js} +5 -5
- package/dist/component/{radio-group-rac-BGp1iRNt.js → radio-group-rac-CGHQFyJY.js} +1 -1
- package/dist/component/{rating-input-field-rac-Bozwq2E7.js → rating-input-field-rac-elaferlI.js} +18 -18
- package/dist/component/{rating-input-rac-Cxha4VPg.js → rating-input-rac-fnOtTKN8.js} +1 -1
- package/dist/component/{rich-content-rac.module-ZXCfVPY-.js → rich-content-rac.module-DbwuwQeo.js} +1 -1
- package/dist/component/{rich-text-field-rac-Ct4KowMZ.js → rich-text-field-rac-DtcQC8zU.js} +3 -3
- package/dist/component/{rich-text-rac-Cek5wjXa.js → rich-text-rac-CuT97sby.js} +1 -1
- package/dist/component/{service-dropdown-rac-B3K93XxF.js → service-dropdown-rac-rk2tzikX.js} +24 -24
- package/dist/component/{services-multi-choice-rac-2RTQqyG6.js → services-multi-choice-rac-BMQyF_xs.js} +7 -7
- package/dist/component/{signature-rac-BIbRkW1j.js → signature-rac-DeV9C6ta.js} +41 -41
- package/dist/component/{submit-button-rac-DofUaqHk.js → submit-button-rac-BpN-FYtM.js} +2 -2
- package/dist/component/tags-field-rac-ByC9DnyH.js +217 -0
- package/dist/component/{tags-rac-DuMX91gd.js → tags-rac-Dabz4jHd.js} +1 -1
- package/dist/component/{text-area-field-rac-BbHdTAJP.js → text-area-field-rac-CtSa8XW_.js} +14 -14
- package/dist/component/{text-area-rac-B9lDzZAb.js → text-area-rac-CDLF-_56.js} +1 -1
- package/dist/component/{text-input-field-rac-B_csZjOh.js → text-input-field-rac-C6fQYKhI.js} +5 -5
- package/dist/component/{text-input-headless-CVOWyi55.js → text-input-headless-BwVLU9cp.js} +3 -3
- package/dist/component/{text-input-rac-DowwSRpa.js → text-input-rac-CoGTzfo1.js} +1 -1
- package/dist/component/{time-input-rac-D9SXITBr.js → time-input-rac-DQDupKTA.js} +17 -17
- package/dist/component/{url-input-field-rac-BxT0Lgly.js → url-input-field-rac-4T8gcMHH.js} +8 -8
- package/dist/component/{url-input-rac-GX9rvIJd.js → url-input-rac-_d6XRdKX.js} +1 -1
- package/dist/component/{use-element-state-class-name-nCwOVSGM.js → use-element-state-class-name-BqmaTba3.js} +1 -1
- package/dist/component/{use-service-options-base-BO3Ackpl.js → use-service-options-base-CRgxxz7b.js} +1 -1
- package/package.json +2 -2
- package/dist/component/donation-rac-D1rcPi17.js +0 -307
- package/dist/component/image-choice-rac-9ncRxwZd.js +0 -146
- package/dist/component/tags-field-rac-DTOthwA5.js +0 -206
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import e, { useMemo as M, useCallback as y, useRef as x } from "react";
|
|
2
|
-
import { RicosViewer as T } from "@wix/ricos/viewer";
|
|
3
|
-
import d from "classnames";
|
|
4
|
-
import { ai as L, af as k, ab as B, ak as H, ac as P } from "./form-BmioUKtQ.js";
|
|
5
|
-
import { CheckboxGroup as q, CheckboxField as G, CheckboxButton as U } from "react-aria-components";
|
|
6
|
-
import { f as p, a as g } from "./find-child-C60k4CxG.js";
|
|
7
|
-
import { L as w, g as z } from "./field-label-headless-BQFy2iAr.js";
|
|
8
|
-
import { D as V, E as K } from "./field-error-headless-C7IUibkK.js";
|
|
9
|
-
import { F as Q } from "./fieldset-headless-CD3fds9J.js";
|
|
10
|
-
import { E as Y } from "./error-icon-hZxQ6DEy.js";
|
|
11
|
-
import { s as b } from "./field-rac.module-ColNPUt0.js";
|
|
12
|
-
import { z as $, P as j, t as J, u as W, v as X, p as Z, i as ee, F as te } from "./form-element-classes-BuM-vthE.js";
|
|
13
|
-
const a = ({ children: t }) => {
|
|
14
|
-
const { id: s, value: o, onChange: n, disabled: l, readOnly: i, required: r, onBlur: c, onFocus: m, hasError: E, FieldLayout: f } = L(), { inputId: C, labelId: _, ariaDescribedBy: O } = k(), R = p(t, a.Label), D = p(t, a.Options), N = p(t, a.Description), S = p(t, a.Error), A = M(() => o || [], [
|
|
15
|
-
o
|
|
16
|
-
]), h = y((v) => {
|
|
17
|
-
n == null || n(v);
|
|
18
|
-
}, [
|
|
19
|
-
n
|
|
20
|
-
]);
|
|
21
|
-
return /* @__PURE__ */ e.createElement(f, {
|
|
22
|
-
fieldId: s,
|
|
23
|
-
renderLabel: () => R,
|
|
24
|
-
renderInput: () => /* @__PURE__ */ e.createElement(Q, {
|
|
25
|
-
id: C,
|
|
26
|
-
ariaLabelledBy: _,
|
|
27
|
-
ariaDescribedBy: O,
|
|
28
|
-
required: r,
|
|
29
|
-
onBlur: c,
|
|
30
|
-
onFocus: m
|
|
31
|
-
}, /* @__PURE__ */ e.createElement(q, {
|
|
32
|
-
"aria-labelledby": _,
|
|
33
|
-
value: A,
|
|
34
|
-
onChange: h,
|
|
35
|
-
isDisabled: l,
|
|
36
|
-
isReadOnly: i,
|
|
37
|
-
isRequired: r,
|
|
38
|
-
isInvalid: E
|
|
39
|
-
}, D)),
|
|
40
|
-
renderDescription: () => /* @__PURE__ */ e.createElement(e.Fragment, null, S, N)
|
|
41
|
-
});
|
|
42
|
-
}, F = ({ children: t, className: s }) => {
|
|
43
|
-
const { isMobile: o } = B(), { id: n, options: l, numberOfColumns: i } = L(), r = p(t, F.Option);
|
|
44
|
-
return /* @__PURE__ */ e.createElement("div", {
|
|
45
|
-
className: s,
|
|
46
|
-
"data-columns": o ? 1 : i
|
|
47
|
-
}, l == null ? void 0 : l.map((c, m) => g(r, {
|
|
48
|
-
key: c.id || c.label,
|
|
49
|
-
option: c,
|
|
50
|
-
isFirst: m === 0,
|
|
51
|
-
fieldId: n
|
|
52
|
-
})));
|
|
53
|
-
}, ae = ({ className: t }) => /* @__PURE__ */ e.createElement("div", {
|
|
54
|
-
"aria-hidden": "true",
|
|
55
|
-
className: t
|
|
56
|
-
}), ne = ({ className: t, ...s }) => {
|
|
57
|
-
var m, E;
|
|
58
|
-
const { option: o } = s, { choiceImageResize: n, choiceImageAlignment: l } = L(), i = (m = o.media) == null ? void 0 : m.image;
|
|
59
|
-
if (!i)
|
|
60
|
-
return null;
|
|
61
|
-
const r = z(i, i.width, i.height);
|
|
62
|
-
if (!r)
|
|
63
|
-
return null;
|
|
64
|
-
const c = ((E = o.media) == null ? void 0 : E.altText) || o.altText || i.altText || "";
|
|
65
|
-
return /* @__PURE__ */ e.createElement("img", {
|
|
66
|
-
className: t,
|
|
67
|
-
src: r,
|
|
68
|
-
alt: c,
|
|
69
|
-
"data-fit": n,
|
|
70
|
-
"data-alignment": l,
|
|
71
|
-
"data-hook": "image-choice-option-image"
|
|
72
|
-
});
|
|
73
|
-
}, oe = ({ className: t, ...s }) => {
|
|
74
|
-
const { option: o } = s;
|
|
75
|
-
return !o.label || o.isLabelHidden ? null : /* @__PURE__ */ e.createElement("span", {
|
|
76
|
-
className: t
|
|
77
|
-
}, o.label);
|
|
78
|
-
}, u = ({ children: t, className: s, ...o }) => {
|
|
79
|
-
const { option: n, isFirst: l = !1, fieldId: i } = o, { disabled: r, readOnly: c, hasError: m } = L(), E = x(null);
|
|
80
|
-
H(() => {
|
|
81
|
-
var O;
|
|
82
|
-
l && ((O = E.current) == null || O.focus({
|
|
83
|
-
preventScroll: !0
|
|
84
|
-
}));
|
|
85
|
-
}, i);
|
|
86
|
-
const f = p(t, u.Input), C = p(t, u.Image), _ = p(t, u.Label);
|
|
87
|
-
return /* @__PURE__ */ e.createElement(G, {
|
|
88
|
-
value: n.label,
|
|
89
|
-
isDisabled: r,
|
|
90
|
-
isReadOnly: c,
|
|
91
|
-
isInvalid: m
|
|
92
|
-
}, /* @__PURE__ */ e.createElement(U, {
|
|
93
|
-
ref: E,
|
|
94
|
-
"aria-label": n.isLabelHidden ? n.label : void 0,
|
|
95
|
-
className: s,
|
|
96
|
-
"data-hook": `image-choice-${n.label}`
|
|
97
|
-
}, f, g(C, {
|
|
98
|
-
option: n
|
|
99
|
-
}), g(_, {
|
|
100
|
-
option: n
|
|
101
|
-
})));
|
|
102
|
-
};
|
|
103
|
-
u.Input = ae;
|
|
104
|
-
u.Image = ne;
|
|
105
|
-
u.Label = oe;
|
|
106
|
-
a.Label = w;
|
|
107
|
-
a.Options = F;
|
|
108
|
-
F.Option = u;
|
|
109
|
-
a.Description = V;
|
|
110
|
-
a.Error = K;
|
|
111
|
-
const se = "_options_v6xi4_1", ie = "_optionInput_v6xi4_25", le = "_option_v6xi4_1", re = "_optionLabel_v6xi4_95", ce = "_optionImage_v6xi4_128", I = {
|
|
112
|
-
options: se,
|
|
113
|
-
optionInput: ie,
|
|
114
|
-
option: le,
|
|
115
|
-
optionLabel: re,
|
|
116
|
-
optionImage: ce
|
|
117
|
-
}, me = ({ content: t, locale: s }) => /* @__PURE__ */ e.createElement(T, {
|
|
118
|
-
content: t,
|
|
119
|
-
locale: s
|
|
120
|
-
}), pe = () => {
|
|
121
|
-
const t = P(te.IMAGE_CHOICE_OPTION);
|
|
122
|
-
return /* @__PURE__ */ e.createElement(a, null, /* @__PURE__ */ e.createElement(a.Label, {
|
|
123
|
-
className: d($, b.label)
|
|
124
|
-
}, /* @__PURE__ */ e.createElement(a.Label.Required, {
|
|
125
|
-
className: d(j, b.requiredMark)
|
|
126
|
-
})), /* @__PURE__ */ e.createElement(a.Options, {
|
|
127
|
-
className: d(J, I.options)
|
|
128
|
-
}, /* @__PURE__ */ e.createElement(a.Options.Option, {
|
|
129
|
-
className: ({ isSelected: s }) => d(W, I.option, t, {
|
|
130
|
-
[X]: s
|
|
131
|
-
})
|
|
132
|
-
}, /* @__PURE__ */ e.createElement(a.Options.Option.Input, {
|
|
133
|
-
className: I.optionInput
|
|
134
|
-
}), /* @__PURE__ */ e.createElement(a.Options.Option.Image, {
|
|
135
|
-
className: I.optionImage
|
|
136
|
-
}), /* @__PURE__ */ e.createElement(a.Options.Option.Label, {
|
|
137
|
-
className: I.optionLabel
|
|
138
|
-
}))), /* @__PURE__ */ e.createElement(a.Error, {
|
|
139
|
-
className: d(Z, b.error)
|
|
140
|
-
}, /* @__PURE__ */ e.createElement(Y, null), /* @__PURE__ */ e.createElement(a.Error.Text, null)), /* @__PURE__ */ e.createElement(a.Description, {
|
|
141
|
-
className: d(ee, b.description)
|
|
142
|
-
}, me));
|
|
143
|
-
}, Re = () => /* @__PURE__ */ e.createElement(pe, null);
|
|
144
|
-
export {
|
|
145
|
-
Re as ImageChoiceRAC
|
|
146
|
-
};
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
import { RicosViewer as z } from "@wix/ricos/viewer";
|
|
2
|
-
import _ from "classnames";
|
|
3
|
-
import e, { useMemo as F, useState as K, useRef as V, useLayoutEffect as Q, useCallback as k } from "react";
|
|
4
|
-
import { ai as y, af as Y, as as T, ab as j, ak as w, ac as J } from "./form-BmioUKtQ.js";
|
|
5
|
-
import { CheckboxGroup as X, TextField as Z, Input as ee, CheckboxField as te, CheckboxButton as ae } from "react-aria-components";
|
|
6
|
-
import { f, a as P } from "./find-child-C60k4CxG.js";
|
|
7
|
-
import { E as x, D as B } from "./field-error-headless-C7IUibkK.js";
|
|
8
|
-
import { L as $ } from "./field-label-headless-BQFy2iAr.js";
|
|
9
|
-
import { F as ne } from "./fieldset-headless-CD3fds9J.js";
|
|
10
|
-
import { N as g } from "./options-layout-constants-DEfIEJWD.js";
|
|
11
|
-
import { E as se } from "./error-icon-hZxQ6DEy.js";
|
|
12
|
-
import { s as S } from "./field-rac.module-ColNPUt0.js";
|
|
13
|
-
import { z as oe, P as re, $ as le, a0 as ie, a1 as ce, y as ue, p as de, i as me, F as pe } from "./form-element-classes-BuM-vthE.js";
|
|
14
|
-
import { o as Ee } from "./options-rac.module-KM-VT_KY.js";
|
|
15
|
-
const N = "Other", he = (a, t) => {
|
|
16
|
-
const c = t.length + 2;
|
|
17
|
-
return (a.find((s) => s.startsWith(`${t}: `)) || "").slice(c);
|
|
18
|
-
}, Oe = (a) => a.map((t) => t.value ?? t.label), W = ({ className: a, ...t }) => {
|
|
19
|
-
const { label: l } = t;
|
|
20
|
-
return /* @__PURE__ */ e.createElement("span", {
|
|
21
|
-
className: a
|
|
22
|
-
}, l);
|
|
23
|
-
}, q = ({ className: a }) => {
|
|
24
|
-
const { value: t, onChange: l, addOtherLabel: c, addOtherPlaceholder: i, otherInputCharacterLimit: s, disabled: u, readOnly: b, hasError: d } = y(), { t: m } = T(), o = c || m("add-other.default-other-option-label") || N, p = F(() => he(t || [], o), [
|
|
25
|
-
t,
|
|
26
|
-
o
|
|
27
|
-
]), [n, L] = K(p), E = V(l);
|
|
28
|
-
Q(() => {
|
|
29
|
-
E.current = l;
|
|
30
|
-
});
|
|
31
|
-
const I = k((h) => {
|
|
32
|
-
L(h);
|
|
33
|
-
const C = (t || []).filter((O) => !O.startsWith(`${o}:`) && O !== o), R = h ? `${o}: ${h}` : o;
|
|
34
|
-
E.current([
|
|
35
|
-
...C,
|
|
36
|
-
R
|
|
37
|
-
]);
|
|
38
|
-
}, [
|
|
39
|
-
t,
|
|
40
|
-
o
|
|
41
|
-
]);
|
|
42
|
-
return /* @__PURE__ */ e.createElement(Z, {
|
|
43
|
-
value: n,
|
|
44
|
-
onChange: I,
|
|
45
|
-
isDisabled: u,
|
|
46
|
-
isReadOnly: b,
|
|
47
|
-
isInvalid: d,
|
|
48
|
-
"aria-label": o
|
|
49
|
-
}, /* @__PURE__ */ e.createElement(ee, {
|
|
50
|
-
"data-hook": "tags-other-input",
|
|
51
|
-
"data-filled": n ? !0 : void 0,
|
|
52
|
-
placeholder: i,
|
|
53
|
-
maxLength: s,
|
|
54
|
-
className: a
|
|
55
|
-
}));
|
|
56
|
-
}, v = ({ children: a, className: t, ...l }) => {
|
|
57
|
-
const { value: c, label: i, isOther: s, isFirstOption: u } = l, { id: b, value: d, onChange: m, options: o, disabled: p, readOnly: n, hasError: L } = y(), E = V(null);
|
|
58
|
-
w(() => {
|
|
59
|
-
var O;
|
|
60
|
-
u && ((O = E.current) == null || O.focus({
|
|
61
|
-
preventScroll: !0
|
|
62
|
-
}));
|
|
63
|
-
}, b);
|
|
64
|
-
const I = f(a, W), h = F(() => d || [], [
|
|
65
|
-
d
|
|
66
|
-
]), C = F(() => s ? h.find((O) => O === i || O.startsWith(`${i}: `)) || i : c, [
|
|
67
|
-
s,
|
|
68
|
-
h,
|
|
69
|
-
i,
|
|
70
|
-
c
|
|
71
|
-
]), R = k((O) => {
|
|
72
|
-
const U = Oe(o || []), M = h.filter((H) => U.includes(H));
|
|
73
|
-
m(O ? [
|
|
74
|
-
...M,
|
|
75
|
-
i
|
|
76
|
-
] : M);
|
|
77
|
-
}, [
|
|
78
|
-
i,
|
|
79
|
-
m,
|
|
80
|
-
o,
|
|
81
|
-
h
|
|
82
|
-
]);
|
|
83
|
-
return /* @__PURE__ */ e.createElement(te, {
|
|
84
|
-
inputRef: E,
|
|
85
|
-
value: C,
|
|
86
|
-
onChange: s ? R : void 0,
|
|
87
|
-
isDisabled: p,
|
|
88
|
-
isReadOnly: n,
|
|
89
|
-
isInvalid: L
|
|
90
|
-
}, /* @__PURE__ */ e.createElement(ae, {
|
|
91
|
-
className: t,
|
|
92
|
-
"data-hook": `tags-${s ? N : c}`
|
|
93
|
-
}, P(I, {
|
|
94
|
-
value: c,
|
|
95
|
-
label: i,
|
|
96
|
-
isOther: s,
|
|
97
|
-
isFirstOption: u
|
|
98
|
-
})));
|
|
99
|
-
}, A = ({ children: a, className: t }) => {
|
|
100
|
-
const { options: l, addOther: c, addOtherLabel: i, numberOfColumns: s = g.FREE_FLOW } = y(), { isMobile: u } = j(), { t: b } = T(), d = u && s !== g.FREE_FLOW ? g.ONE : s, m = i || b("add-other.default-other-option-label") || N, o = f(a, v), p = F(() => {
|
|
101
|
-
const n = l || [];
|
|
102
|
-
return c ? [
|
|
103
|
-
...n,
|
|
104
|
-
{
|
|
105
|
-
label: m,
|
|
106
|
-
value: m,
|
|
107
|
-
isOther: !0
|
|
108
|
-
}
|
|
109
|
-
] : n;
|
|
110
|
-
}, [
|
|
111
|
-
l,
|
|
112
|
-
c,
|
|
113
|
-
m
|
|
114
|
-
]);
|
|
115
|
-
return p.length === 0 ? null : /* @__PURE__ */ e.createElement("div", {
|
|
116
|
-
className: t,
|
|
117
|
-
"data-columns": d
|
|
118
|
-
}, p.map((n, L) => {
|
|
119
|
-
const E = n.value ?? n.label;
|
|
120
|
-
return P(o, {
|
|
121
|
-
key: n.isOther ? N : E,
|
|
122
|
-
value: E,
|
|
123
|
-
label: n.label,
|
|
124
|
-
isOther: n.isOther,
|
|
125
|
-
isFirstOption: L === 0
|
|
126
|
-
});
|
|
127
|
-
}));
|
|
128
|
-
}, G = ({ children: a, className: t }) => {
|
|
129
|
-
const { addOther: l, addOtherLabel: c, hasError: i, readOnly: s, value: u } = y(), { t: b } = T(), d = c || b("add-other.default-other-option-label") || N, m = f(a, A), o = f(a, q), p = F(() => !l || !u ? !1 : u.some((n) => n === d || n.startsWith(`${d}:`)), [
|
|
130
|
-
l,
|
|
131
|
-
u,
|
|
132
|
-
d
|
|
133
|
-
]);
|
|
134
|
-
return /* @__PURE__ */ e.createElement("div", {
|
|
135
|
-
className: t,
|
|
136
|
-
"data-invalid": i,
|
|
137
|
-
"data-readonly": s
|
|
138
|
-
}, m, p && o);
|
|
139
|
-
}, r = ({ children: a }) => {
|
|
140
|
-
const { id: t, value: l, onChange: c, FieldLayout: i, required: s, disabled: u, readOnly: b, hasError: d, onBlur: m, onFocus: o } = y(), { inputId: p, labelId: n, ariaDescribedBy: L } = Y(), E = F(() => l || [], [
|
|
141
|
-
l
|
|
142
|
-
]), I = f(a, $), h = f(a, G), C = f(a, B), R = f(a, x);
|
|
143
|
-
return /* @__PURE__ */ e.createElement(i, {
|
|
144
|
-
fieldId: t,
|
|
145
|
-
renderLabel: () => I,
|
|
146
|
-
renderInput: () => /* @__PURE__ */ e.createElement(ne, {
|
|
147
|
-
id: p,
|
|
148
|
-
ariaLabelledBy: n,
|
|
149
|
-
ariaDescribedBy: L,
|
|
150
|
-
required: s,
|
|
151
|
-
onBlur: m,
|
|
152
|
-
onFocus: o
|
|
153
|
-
}, /* @__PURE__ */ e.createElement(X, {
|
|
154
|
-
"aria-labelledby": n,
|
|
155
|
-
value: E,
|
|
156
|
-
onChange: c,
|
|
157
|
-
isDisabled: u,
|
|
158
|
-
isReadOnly: b,
|
|
159
|
-
isRequired: s,
|
|
160
|
-
isInvalid: d
|
|
161
|
-
}, h)),
|
|
162
|
-
renderDescription: () => /* @__PURE__ */ e.createElement(e.Fragment, null, R, C)
|
|
163
|
-
});
|
|
164
|
-
};
|
|
165
|
-
A.Option = v;
|
|
166
|
-
v.Label = W;
|
|
167
|
-
r.Label = $;
|
|
168
|
-
r.Control = G;
|
|
169
|
-
r.Options = A;
|
|
170
|
-
r.OtherInput = q;
|
|
171
|
-
r.Description = B;
|
|
172
|
-
r.Error = x;
|
|
173
|
-
const be = "_control_1t32y_1", fe = "_options_1t32y_7", Le = "_option_1t32y_7", D = {
|
|
174
|
-
control: be,
|
|
175
|
-
options: fe,
|
|
176
|
-
option: Le
|
|
177
|
-
}, _e = ({ content: a, locale: t }) => /* @__PURE__ */ e.createElement(z, {
|
|
178
|
-
content: a,
|
|
179
|
-
locale: t
|
|
180
|
-
}), ke = () => {
|
|
181
|
-
const a = J(pe.TAGS_OPTION);
|
|
182
|
-
return /* @__PURE__ */ e.createElement(r, null, /* @__PURE__ */ e.createElement(r.Label, {
|
|
183
|
-
className: _(oe, S.label)
|
|
184
|
-
}, /* @__PURE__ */ e.createElement(r.Label.Required, {
|
|
185
|
-
className: _(re, S.requiredMark)
|
|
186
|
-
})), /* @__PURE__ */ e.createElement(r.Control, {
|
|
187
|
-
className: D.control
|
|
188
|
-
}, /* @__PURE__ */ e.createElement(r.Options, {
|
|
189
|
-
className: _(le, D.options)
|
|
190
|
-
}, /* @__PURE__ */ e.createElement(r.Options.Option, {
|
|
191
|
-
className: ({ isSelected: t }) => _(ie, D.option, a, {
|
|
192
|
-
[ce]: t
|
|
193
|
-
})
|
|
194
|
-
}, /* @__PURE__ */ e.createElement(r.Options.Option.Label, {
|
|
195
|
-
className: Ee.optionLabel
|
|
196
|
-
}))), /* @__PURE__ */ e.createElement(r.OtherInput, {
|
|
197
|
-
className: _(ue, S.input)
|
|
198
|
-
})), /* @__PURE__ */ e.createElement(r.Error, {
|
|
199
|
-
className: _(de, S.error)
|
|
200
|
-
}, /* @__PURE__ */ e.createElement(se, null), /* @__PURE__ */ e.createElement(r.Error.Text, null)), /* @__PURE__ */ e.createElement(r.Description, {
|
|
201
|
-
className: _(me, S.description)
|
|
202
|
-
}, _e));
|
|
203
|
-
};
|
|
204
|
-
export {
|
|
205
|
-
ke as T
|
|
206
|
-
};
|