@wix/form-elements 1.83.0 → 1.85.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-ky2cE6hE.js → appointment-rac-CCaJ6P5r.js} +78 -78
- package/dist/component/{bookings-address-rac-Bxc6H9Pb.js → bookings-address-rac-DEt9SGPG.js} +1 -1
- package/dist/component/{bookings-email-rac-Dw1Xttdx.js → bookings-email-rac-BydOvOUZ.js} +1 -1
- package/dist/component/{bookings-first-name-rac-dgHOrJaJ.js → bookings-first-name-rac-BoQki0Pb.js} +1 -1
- package/dist/component/{bookings-header-rac-Bl9RYGWo.js → bookings-header-rac-DK-EcXrk.js} +1 -1
- package/dist/component/{bookings-last-name-rac-BeqYpbZq.js → bookings-last-name-rac-BuGIyd43.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-C1k6o0A5.js → bookings-login-bar-rac-Cr500ehb.js} +6 -6
- package/dist/component/{bookings-phone-rac-ByhaJrwE.js → bookings-phone-rac-Bq2zdMxo.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-Mw5-ZiIn.js → bookings-rich-text-rac-DRmfusX9.js} +1 -1
- package/dist/component/{checkbox-field-rac-CMEI5t4Y.js → checkbox-field-rac-b9mcZlMP.js} +5 -5
- package/dist/component/{checkbox-group-field-headless-CP21R7_s.js → checkbox-group-field-headless-BSNhdCfs.js} +30 -30
- package/dist/component/{checkbox-group-field-rac-DGOZjSIY.js → checkbox-group-field-rac-BObfui8r.js} +6 -6
- package/dist/component/{checkbox-group-rac-CEGtshrl.js → checkbox-group-rac-CBNMgBHU.js} +1 -1
- package/dist/component/{checkbox-rac-DCnRh1WF.js → checkbox-rac-DXh-i6Ot.js} +1 -1
- package/dist/component/{contacts-address-rac-CZb_5N5o.js → contacts-address-rac-BDQLFakc.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-DZlwSyp5.js → contacts-birthdate-rac-BUMVVVfb.js} +1 -1
- package/dist/component/{contacts-company-rac-BNEF6LjB.js → contacts-company-rac-CidGcaA3.js} +1 -1
- package/dist/component/{contacts-email-rac-CAgk_zfN.js → contacts-email-rac-GePAhKDQ.js} +1 -1
- package/dist/component/{contacts-first-name-rac-DyTVcmrX.js → contacts-first-name-rac-kw5sIBEE.js} +1 -1
- package/dist/component/{contacts-last-name-rac-DrFcDcGr.js → contacts-last-name-rac-DzoZKs1n.js} +1 -1
- package/dist/component/{contacts-phone-rac-UAPALlFx.js → contacts-phone-rac-CxVW4Zp0.js} +1 -1
- package/dist/component/{contacts-position-rac-CJ1M4kJJ.js → contacts-position-rac-CXFxlSty.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-1cEd5s1l.js → contacts-subscribe-rac-kpRGeELB.js} +2 -2
- package/dist/component/{contacts-tax-id-rac-CqnO__fd.js → contacts-tax-id-rac-B5qw-rtP.js} +1 -1
- package/dist/component/{date-availability-COM2EaRy.js → date-availability-BCDMem-_.js} +1 -1
- package/dist/component/{date-input-field-rac-CuuWbw42.js → date-input-field-rac-BLDZ4_Mw.js} +43 -43
- package/dist/component/{date-input-rac-DfVmj9Gc.js → date-input-rac-B1WGYKOp.js} +1 -1
- package/dist/component/{date-picker-field-rac-BFCZik9T.js → date-picker-field-rac-BNd8aZ0c.js} +20 -20
- package/dist/component/{date-picker-rac-C2vajJpb.js → date-picker-rac-ItWxSngw.js} +1 -1
- package/dist/component/date-time-input-field-rac-Ch8z0NRT.js +423 -0
- package/dist/component/{date-time-input-rac-D4FEieQz.js → date-time-input-rac-FebIovNN.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-BDBBTNNo.js → dext-checkbox-group-rac-BXYHMQ3R.js} +2 -2
- package/dist/component/{dext-checkbox-rac-DAAhNboR.js → dext-checkbox-rac-C78ScIGY.js} +1 -1
- package/dist/component/{dext-date-picker-rac-me7XbR5z.js → dext-date-picker-rac-BptT4fhe.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-DLsUl2Eg.js → dext-date-time-input-rac-RWJ51IjA.js} +1 -1
- package/dist/component/{dext-dropdown-rac-C3vVIRir.js → dext-dropdown-rac-DZDOtSIG.js} +1 -1
- package/dist/component/{dext-email-rac-a8qXYTLP.js → dext-email-rac-CJceqZsw.js} +1 -1
- package/dist/component/{dext-number-input-rac-DdDnL_fX.js → dext-number-input-rac-buSXk49E.js} +1 -1
- package/dist/component/{dext-phone-rac-ByaxbHpO.js → dext-phone-rac-CeHUOWck.js} +1 -1
- package/dist/component/{dext-radio-group-rac-Bzubt7Uy.js → dext-radio-group-rac-CNyNSfeP.js} +2 -2
- package/dist/component/{dext-rating-input-rac-BZ1EvOkG.js → dext-rating-input-rac-mmdh9tYT.js} +1 -1
- package/dist/component/{dext-tags-rac-C_R89noV.js → dext-tags-rac-CqJ4iv-V.js} +2 -2
- package/dist/component/{dext-text-area-rac-DRpYeQ-K.js → dext-text-area-rac-P1EzLNDE.js} +1 -1
- package/dist/component/{dext-text-input-rac-D_RtbQQ-.js → dext-text-input-rac-Dtz4ZLj7.js} +1 -1
- package/dist/component/{dext-url-input-rac-BSSjSbIo.js → dext-url-input-rac-DUVbW2yl.js} +1 -1
- package/dist/component/{donation-rac-De0KyyGR.js → donation-rac-Nn7z8_to.js} +43 -43
- package/dist/component/{dropdown-field-headless-DNhnTDlD.js → dropdown-field-headless-CT4uSCPR.js} +11 -11
- package/dist/component/{dropdown-field-rac-Bq_FNv9a.js → dropdown-field-rac-CUiyFJi_.js} +5 -5
- package/dist/component/{dropdown-rac-0UIyqF15.js → dropdown-rac-Bs_PVy1q.js} +1 -1
- package/dist/component/{ecom-address-rac-7IVbvs3J.js → ecom-address-rac-BTXwDlMM.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-DilgIpiG.js → ecom-subscription-checkbox-rac-CGI84A37.js} +3 -3
- package/dist/component/{email-input-field-rac-CHJ6RSGy.js → email-input-field-rac-DKD7FsQX.js} +54 -54
- package/dist/component/{events-repeater-rac-v18FFLC7.js → events-repeater-rac-B7yIRlyt.js} +30 -30
- package/dist/component/{events-rsvp-rac-BpGLrxsf.js → events-rsvp-rac-C7FOuFmH.js} +3 -3
- package/dist/component/{field-error-headless-DAy-1oAQ.js → field-error-headless-BHTkMu35.js} +1 -1
- package/dist/component/{field-label-headless-BWxHmO0c.js → field-label-headless-D3DwX65k.js} +7 -7
- package/dist/component/{file-upload-rac-BfWN27JT.js → file-upload-rac-B3n_LYYK.js} +85 -85
- package/dist/component/{fixed-payment-rac-Bha61SB4.js → fixed-payment-rac-C6jsiS4-.js} +12 -12
- package/dist/component/{form-D0eeH0lX.js → form-BkmOXzqo.js} +2510 -2487
- package/dist/component/{form-element-classes-Ct1UaxuQ.js → form-element-classes-BsXkFtp2.js} +90 -57
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +1 -1
- package/dist/component/{header-field-rac-uNzfDMbv.js → header-field-rac-FG9EP9--.js} +5 -5
- package/dist/component/{header-rac-B91q4fHl.js → header-rac-DZZgqFjW.js} +1 -1
- package/dist/component/{image-choice-rac-BKcnNGPp.js → image-choice-rac-CXgE6z_f.js} +42 -42
- package/dist/component/{index-BWHymomM.js → index-CSwTHDCX.js} +2 -2
- package/dist/component/{index-BvzLLTKc.js → index-DKV2sNhD.js} +4 -4
- package/dist/component/{isObjectLike-D7Mkqoju.js → isObjectLike-DYfHbEQ3.js} +1 -1
- package/dist/component/{multiline-address-field-rac-Avd9Vlv1.js → multiline-address-field-rac-DnCOKW8F.js} +128 -128
- package/dist/component/{multiline-address-rac-BwQOoejw.js → multiline-address-rac-BZRlzLZq.js} +1 -1
- package/dist/component/{number-input-field-rac-CRqPXDl0.js → number-input-field-rac-BOJNJ50c.js} +30 -30
- package/dist/component/{number-input-rac-0Y8K4e6K.js → number-input-rac-D8ZcIPwq.js} +1 -1
- package/dist/component/{password-rac-C7F6sEB3.js → password-rac-T9PR5j2v.js} +19 -19
- package/dist/component/{payment-input-rac-CTJr4QTK.js → payment-input-rac-C9N3LZOZ.js} +17 -17
- package/dist/component/{phone-input-field-rac-jjSmYCI1.js → phone-input-field-rac-BxUiCV5Z.js} +40 -40
- package/dist/component/{phone-rac-BwSnmgYF.js → phone-rac-BjKFrr86.js} +1 -1
- package/dist/component/{product-list-rac-CTN2wvHE.js → product-list-rac-BG-VK_Hz.js} +41 -41
- package/dist/component/{quiz-radio-group-rac-CZHEDJxr.js → quiz-radio-group-rac-B1x7Yatu.js} +2 -2
- package/dist/component/{radio-button-module-classes-DCz6XS1X.js → radio-button-module-classes-BXWANbga.js} +7 -7
- package/dist/component/{radio-group-field-rac-60MF_9DO.js → radio-group-field-rac-DmEOydAr.js} +4 -4
- package/dist/component/{radio-group-rac-Dqo-Earp.js → radio-group-rac-DAcU_lkj.js} +1 -1
- package/dist/component/{rating-input-field-rac-CzWTwWT8.js → rating-input-field-rac-Cazqeqzw.js} +16 -16
- package/dist/component/{rating-input-rac-Nq4tll2Z.js → rating-input-rac-KJ8FnJTj.js} +1 -1
- package/dist/component/{rich-content-rac.module-sUUSbcSy.js → rich-content-rac.module-PZgMV2M7.js} +1 -1
- package/dist/component/{rich-text-field-rac-BvLfS4I5.js → rich-text-field-rac-DNEeY_m8.js} +3 -3
- package/dist/component/{rich-text-rac-BWkTbWk3.js → rich-text-rac-g9upYD25.js} +1 -1
- package/dist/component/{service-dropdown-rac-DZ3USe7_.js → service-dropdown-rac-CmmWetDa.js} +20 -20
- package/dist/component/{services-multi-choice-rac-D-og7fMo.js → services-multi-choice-rac-D0PJNlq2.js} +7 -7
- package/dist/component/{signature-rac-D3c4fnvN.js → signature-rac-Q4G3uEhw.js} +41 -41
- package/dist/component/submit-button-rac-DdLPGJ6v.js +141 -0
- package/dist/component/{tags-field-rac-DXmZBcpO.js → tags-field-rac-PZ8Vfmsn.js} +72 -72
- package/dist/component/{tags-rac-CoXWx42D.js → tags-rac-DLjeR5G1.js} +1 -1
- package/dist/component/{text-area-field-rac-Cy0Mr29Z.js → text-area-field-rac-BNVK0R0Z.js} +25 -25
- package/dist/component/{text-area-rac-C3Mjmgpa.js → text-area-rac-CNOLe3Vx.js} +1 -1
- package/dist/component/{text-input-field-rac-D1TB9B_M.js → text-input-field-rac-DjdW6TCf.js} +3 -3
- package/dist/component/{text-input-headless-BUa59Rgn.js → text-input-headless-DFWQwZAN.js} +10 -10
- package/dist/component/{text-input-rac-BQ3Z9ws4.js → text-input-rac-GXPtQEjT.js} +1 -1
- package/dist/component/time-input-rac-B_g-erqu.js +159 -0
- package/dist/component/{url-input-field-rac-DINXfZdf.js → url-input-field-rac-CXWYeQLf.js} +19 -19
- package/dist/component/{url-input-rac-Ch9eTIF_.js → url-input-rac-DX-vjyXj.js} +1 -1
- package/dist/component/use-element-state-class-name-lZnP6sE6.js +22 -0
- package/dist/component/{use-service-options-base-BJZhzDyO.js → use-service-options-base-BJE86Rzo.js} +5 -5
- package/dist/component/{use-text-input-class-name-8gMUWeCb.js → use-text-input-class-name-B-GYaltW.js} +5 -5
- package/dist/form.d.ts +58 -2
- package/package.json +5 -3
- package/dist/component/date-time-input-field-rac-B7ne2emo.js +0 -423
- package/dist/component/submit-button-rac-Dn_BGt1n.js +0 -116
- package/dist/component/time-input-rac-Wi0oD5YF.js +0 -155
- package/dist/component/use-element-state-class-name-j8W1zbdG.js +0 -20
|
@@ -1,423 +0,0 @@
|
|
|
1
|
-
import { RicosViewer as re } from "@wix/ricos/viewer";
|
|
2
|
-
import p from "classnames";
|
|
3
|
-
import t, { useMemo as L, useState as q, useCallback as H, useRef as U, useContext as oe } from "react";
|
|
4
|
-
import { ai as g, af as Q, ab as w, J as W, a1 as X, r as d, as as O, a5 as G, O as le, x as se, a8 as ie, y as j, ak as z } from "./form-D0eeH0lX.js";
|
|
5
|
-
import { parseTime as ce } from "@internationalized/date";
|
|
6
|
-
import { UNSAFE_PortalProvider as me } from "react-aria";
|
|
7
|
-
import { ListBoxItem as de, ListBox as ue, Select as pe, TextField as Z, TimeField as Ee, SelectValue as he, Input as ee, DateInput as fe, DateSegment as B, TimeFieldStateContext as be } from "react-aria-components";
|
|
8
|
-
import { f as u, a as R } from "./find-child-C60k4CxG.js";
|
|
9
|
-
import { g as ge } from "./helpers-HmkkXrh2.js";
|
|
10
|
-
import { D as Ie, E as _e } from "./field-error-headless-DAy-1oAQ.js";
|
|
11
|
-
import { L as ye } from "./field-label-headless-BWxHmO0c.js";
|
|
12
|
-
import { F as De } from "./fieldset-headless-CD3fds9J.js";
|
|
13
|
-
import { N as Ne, S as Te } from "./non-modal-popover-DtIMXHbe.js";
|
|
14
|
-
import { C as Le } from "./chevron-down-icon-CcpVm6B-.js";
|
|
15
|
-
import { E as Oe } from "./error-icon-hZxQ6DEy.js";
|
|
16
|
-
import { H as Y } from "./custom-focus-class-_483Pkwp.js";
|
|
17
|
-
import { s as E } from "./field-rac.module-D06m9T9x.js";
|
|
18
|
-
import { y as S, O as Fe, x as J, A as Ce, o as Pe, i as Me } from "./form-element-classes-Ct1UaxuQ.js";
|
|
19
|
-
import { u as K } from "./use-text-input-class-name-8gMUWeCb.js";
|
|
20
|
-
const l = ({ children: e, className: a }) => {
|
|
21
|
-
const { id: n, required: o, onBlur: s, onFocus: r, FieldLayout: i } = g(), { inputId: m, labelId: c, ariaDescribedBy: f } = Q(), { regionalFormat: b } = w(), y = L(() => W(b).filter(X).map((M) => M.toUpperCase()), [
|
|
22
|
-
b
|
|
23
|
-
]), P = u(e, l.Label), v = u(e, l.Description), T = u(e, l.Error), _ = {
|
|
24
|
-
[d.MONTH]: u(e, l.Month),
|
|
25
|
-
[d.DAY]: u(e, l.Day),
|
|
26
|
-
[d.YEAR]: u(e, l.Year)
|
|
27
|
-
}, D = u(e, l.Time);
|
|
28
|
-
return /* @__PURE__ */ t.createElement(i, {
|
|
29
|
-
fieldId: n,
|
|
30
|
-
renderLabel: () => R(P, {
|
|
31
|
-
as: "div"
|
|
32
|
-
}),
|
|
33
|
-
renderInput: () => /* @__PURE__ */ t.createElement(De, {
|
|
34
|
-
id: m,
|
|
35
|
-
ariaLabelledBy: c,
|
|
36
|
-
ariaDescribedBy: f,
|
|
37
|
-
required: o,
|
|
38
|
-
onBlur: s,
|
|
39
|
-
onFocus: r,
|
|
40
|
-
className: a
|
|
41
|
-
}, _[y[0]], _[y[1]], _[y[2]], D),
|
|
42
|
-
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, T, v)
|
|
43
|
-
});
|
|
44
|
-
}, F = ({ children: e, className: a }) => {
|
|
45
|
-
const { disabled: n, readOnly: o, showDateLabels: s, hidePlaceholder: r } = g(), { labelId: i } = N(d.MONTH), { partValue: m, partError: c, onPartChange: f } = C(d.MONTH), { t: b } = O(), [y, P] = q(!1), [v, T] = q(null), _ = r ? void 0 : b("field.date.placeholder.month"), D = H((V) => {
|
|
46
|
-
o || f(typeof V == "string" ? V : "");
|
|
47
|
-
}, [
|
|
48
|
-
f,
|
|
49
|
-
o
|
|
50
|
-
]), M = H((V) => {
|
|
51
|
-
P(V && !o);
|
|
52
|
-
}, [
|
|
53
|
-
o
|
|
54
|
-
]), te = u(e, F.Label), ae = u(e, F.Trigger), ne = u(e, F.Options);
|
|
55
|
-
return /* @__PURE__ */ t.createElement("div", {
|
|
56
|
-
className: a,
|
|
57
|
-
"data-date-field": !0
|
|
58
|
-
}, s ? te : null, /* @__PURE__ */ t.createElement("div", {
|
|
59
|
-
ref: T,
|
|
60
|
-
style: {
|
|
61
|
-
display: "contents"
|
|
62
|
-
}
|
|
63
|
-
}), /* @__PURE__ */ t.createElement(me, {
|
|
64
|
-
getContainer: () => v
|
|
65
|
-
}, /* @__PURE__ */ t.createElement(pe, {
|
|
66
|
-
"aria-labelledby": s ? i : void 0,
|
|
67
|
-
value: m || null,
|
|
68
|
-
onChange: D,
|
|
69
|
-
isDisabled: n,
|
|
70
|
-
isInvalid: c,
|
|
71
|
-
placeholder: _,
|
|
72
|
-
isOpen: y,
|
|
73
|
-
onOpenChange: M
|
|
74
|
-
}, ae, ne)));
|
|
75
|
-
}, Se = ({ className: e }) => /* @__PURE__ */ t.createElement($, {
|
|
76
|
-
datePart: d.MONTH,
|
|
77
|
-
className: e
|
|
78
|
-
}), Re = ({ children: e, className: a }) => {
|
|
79
|
-
const { id: n, readOnly: o } = g(), { inputId: s } = N(d.MONTH), { partError: r, isFirstPart: i } = C(d.MONTH), m = U(null);
|
|
80
|
-
return z(() => {
|
|
81
|
-
var c;
|
|
82
|
-
i && ((c = m.current) == null || c.focus());
|
|
83
|
-
}, n), /* @__PURE__ */ t.createElement(Te, {
|
|
84
|
-
ref: m,
|
|
85
|
-
id: s,
|
|
86
|
-
className: a,
|
|
87
|
-
"data-hook": d.MONTH,
|
|
88
|
-
"data-invalid": r || void 0,
|
|
89
|
-
"data-readonly": o || void 0
|
|
90
|
-
}, /* @__PURE__ */ t.createElement(he, null), e);
|
|
91
|
-
}, x = ({ children: e, className: a }) => {
|
|
92
|
-
const { language: n } = w(), o = L(() => ge(n), [
|
|
93
|
-
n
|
|
94
|
-
]), s = u(e, x.Option) ?? /* @__PURE__ */ t.createElement(x.Option, null);
|
|
95
|
-
return /* @__PURE__ */ t.createElement(Ne, {
|
|
96
|
-
className: a,
|
|
97
|
-
containerPadding: 0,
|
|
98
|
-
offset: 0
|
|
99
|
-
}, /* @__PURE__ */ t.createElement(ue, null, o.map((r, i) => R(s, {
|
|
100
|
-
key: String(i + 1),
|
|
101
|
-
value: String(i + 1),
|
|
102
|
-
label: r
|
|
103
|
-
}))));
|
|
104
|
-
}, Ae = ({ className: e, ...a }) => {
|
|
105
|
-
const { value: n, label: o } = a;
|
|
106
|
-
return /* @__PURE__ */ t.createElement(de, {
|
|
107
|
-
className: e,
|
|
108
|
-
id: n,
|
|
109
|
-
textValue: o
|
|
110
|
-
}, o);
|
|
111
|
-
};
|
|
112
|
-
F.Label = Se;
|
|
113
|
-
F.Trigger = Re;
|
|
114
|
-
F.Options = x;
|
|
115
|
-
x.Option = Ae;
|
|
116
|
-
const A = ({ children: e, className: a }) => {
|
|
117
|
-
const { disabled: n, readOnly: o, showDateLabels: s } = g(), { labelId: r } = N(d.DAY), { partValue: i, partError: m, onPartChange: c } = C(d.DAY), f = u(e, A.Label), b = u(e, A.Input);
|
|
118
|
-
return /* @__PURE__ */ t.createElement("div", {
|
|
119
|
-
className: a,
|
|
120
|
-
"data-date-field": !0
|
|
121
|
-
}, s && f, /* @__PURE__ */ t.createElement(Z, {
|
|
122
|
-
"aria-labelledby": s ? r : void 0,
|
|
123
|
-
value: i,
|
|
124
|
-
onChange: c,
|
|
125
|
-
isDisabled: n,
|
|
126
|
-
isReadOnly: o,
|
|
127
|
-
isInvalid: m
|
|
128
|
-
}, b));
|
|
129
|
-
}, ke = ({ className: e }) => /* @__PURE__ */ t.createElement($, {
|
|
130
|
-
datePart: d.DAY,
|
|
131
|
-
className: e
|
|
132
|
-
}), ve = ({ className: e }) => {
|
|
133
|
-
const { id: a, hidePlaceholder: n } = g(), { inputId: o } = N(d.DAY), { isFirstPart: s } = C(d.DAY), { t: r } = O(), i = U(null), m = n ? void 0 : r("field.date.placeholder.day");
|
|
134
|
-
return z(() => {
|
|
135
|
-
var c;
|
|
136
|
-
s && ((c = i.current) == null || c.focus());
|
|
137
|
-
}, a), /* @__PURE__ */ t.createElement(ee, {
|
|
138
|
-
ref: i,
|
|
139
|
-
id: o,
|
|
140
|
-
className: e,
|
|
141
|
-
placeholder: m,
|
|
142
|
-
maxLength: 2,
|
|
143
|
-
inputMode: "numeric",
|
|
144
|
-
"data-hook": d.DAY
|
|
145
|
-
});
|
|
146
|
-
};
|
|
147
|
-
A.Label = ke;
|
|
148
|
-
A.Input = ve;
|
|
149
|
-
const k = ({ children: e, className: a }) => {
|
|
150
|
-
const { disabled: n, readOnly: o, showDateLabels: s } = g(), { labelId: r } = N(d.YEAR), { partValue: i, partError: m, onPartChange: c } = C(d.YEAR), f = u(e, k.Label), b = u(e, k.Input);
|
|
151
|
-
return /* @__PURE__ */ t.createElement("div", {
|
|
152
|
-
className: a,
|
|
153
|
-
"data-date-field": !0
|
|
154
|
-
}, s && f, /* @__PURE__ */ t.createElement(Z, {
|
|
155
|
-
"aria-labelledby": s ? r : void 0,
|
|
156
|
-
value: i,
|
|
157
|
-
onChange: c,
|
|
158
|
-
isDisabled: n,
|
|
159
|
-
isReadOnly: o,
|
|
160
|
-
isInvalid: m
|
|
161
|
-
}, b));
|
|
162
|
-
}, Ve = ({ className: e }) => /* @__PURE__ */ t.createElement($, {
|
|
163
|
-
datePart: d.YEAR,
|
|
164
|
-
className: e
|
|
165
|
-
}), Ye = ({ className: e }) => {
|
|
166
|
-
const { id: a, hidePlaceholder: n } = g(), { inputId: o } = N(d.YEAR), { isFirstPart: s } = C(d.YEAR), { t: r } = O(), i = U(null), m = n ? void 0 : r("field.date.placeholder.year");
|
|
167
|
-
return z(() => {
|
|
168
|
-
var c;
|
|
169
|
-
s && ((c = i.current) == null || c.focus());
|
|
170
|
-
}, a), /* @__PURE__ */ t.createElement(ee, {
|
|
171
|
-
ref: i,
|
|
172
|
-
id: o,
|
|
173
|
-
className: e,
|
|
174
|
-
placeholder: m,
|
|
175
|
-
maxLength: 4,
|
|
176
|
-
inputMode: "numeric",
|
|
177
|
-
"data-hook": d.YEAR
|
|
178
|
-
});
|
|
179
|
-
};
|
|
180
|
-
k.Label = Ve;
|
|
181
|
-
k.Input = Ye;
|
|
182
|
-
const I = ({ children: e, className: a }) => {
|
|
183
|
-
const { disabled: n, readOnly: o, use24HourFormat: s, showDateLabels: r } = g(), { labelId: i } = N("time"), { partValue: m, partError: c, onPartChange: f } = C("time"), b = u(e, I.Label), y = u(e, I.Input);
|
|
184
|
-
return /* @__PURE__ */ t.createElement("div", {
|
|
185
|
-
className: a,
|
|
186
|
-
"data-date-field": !0
|
|
187
|
-
}, r && b, /* @__PURE__ */ t.createElement(Ee, {
|
|
188
|
-
"aria-labelledby": r ? i : void 0,
|
|
189
|
-
value: m,
|
|
190
|
-
onChange: f,
|
|
191
|
-
isDisabled: n,
|
|
192
|
-
isReadOnly: o,
|
|
193
|
-
isInvalid: c,
|
|
194
|
-
hourCycle: s ? 24 : 12
|
|
195
|
-
}, y));
|
|
196
|
-
}, He = ({ className: e }) => {
|
|
197
|
-
const { inputId: a, labelId: n } = N("time"), { t: o } = O(), s = o("field.date.label.time");
|
|
198
|
-
return /* @__PURE__ */ t.createElement("label", {
|
|
199
|
-
id: n,
|
|
200
|
-
htmlFor: a,
|
|
201
|
-
className: e
|
|
202
|
-
}, s);
|
|
203
|
-
}, xe = ({ children: e, className: a }) => {
|
|
204
|
-
const n = u(e, I.Hour), o = u(e, I.Minute), s = u(e, I.Period);
|
|
205
|
-
return /* @__PURE__ */ t.createElement(fe, {
|
|
206
|
-
className: a,
|
|
207
|
-
"data-hook": "time"
|
|
208
|
-
}, (r) => {
|
|
209
|
-
switch (r.type) {
|
|
210
|
-
case "hour":
|
|
211
|
-
return R(n, {
|
|
212
|
-
segment: r
|
|
213
|
-
}) || /* @__PURE__ */ t.createElement(t.Fragment, null);
|
|
214
|
-
case "minute":
|
|
215
|
-
return R(o, {
|
|
216
|
-
segment: r
|
|
217
|
-
}) || /* @__PURE__ */ t.createElement(t.Fragment, null);
|
|
218
|
-
case "dayPeriod":
|
|
219
|
-
return R(s, {
|
|
220
|
-
segment: r
|
|
221
|
-
}) || /* @__PURE__ */ t.createElement(t.Fragment, null);
|
|
222
|
-
case "literal":
|
|
223
|
-
return /* @__PURE__ */ t.createElement(B, {
|
|
224
|
-
segment: r
|
|
225
|
-
});
|
|
226
|
-
default:
|
|
227
|
-
return /* @__PURE__ */ t.createElement(t.Fragment, null);
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
}, we = ({ className: e, ...a }) => {
|
|
231
|
-
const { hidePlaceholder: n } = g(), { segment: o } = a, { t: s } = O(), r = n ? void 0 : s("field.date.placeholder.hour");
|
|
232
|
-
return /* @__PURE__ */ t.createElement(B, {
|
|
233
|
-
segment: o,
|
|
234
|
-
className: e,
|
|
235
|
-
...r && {
|
|
236
|
-
placeholder: r
|
|
237
|
-
}
|
|
238
|
-
});
|
|
239
|
-
}, Be = ({ className: e, ...a }) => {
|
|
240
|
-
const { hidePlaceholder: n } = g(), { segment: o } = a, { t: s } = O(), r = n ? void 0 : s("field.date.placeholder.minute");
|
|
241
|
-
return /* @__PURE__ */ t.createElement(B, {
|
|
242
|
-
segment: o,
|
|
243
|
-
className: e,
|
|
244
|
-
...r && {
|
|
245
|
-
placeholder: r
|
|
246
|
-
}
|
|
247
|
-
});
|
|
248
|
-
}, Ue = ({ className: e, ...a }) => {
|
|
249
|
-
const { hidePlaceholder: n } = g(), { segment: o } = a, { t: s } = O(), r = oe(be), i = n ? void 0 : s("field.date.placeholder.period"), m = () => r == null ? void 0 : r.increment("dayPeriod");
|
|
250
|
-
return /* @__PURE__ */ t.createElement(B, {
|
|
251
|
-
segment: o,
|
|
252
|
-
className: e,
|
|
253
|
-
onClick: m,
|
|
254
|
-
...i && {
|
|
255
|
-
placeholder: i
|
|
256
|
-
}
|
|
257
|
-
});
|
|
258
|
-
};
|
|
259
|
-
I.Label = He;
|
|
260
|
-
I.Input = xe;
|
|
261
|
-
I.Hour = we;
|
|
262
|
-
I.Minute = Be;
|
|
263
|
-
I.Period = Ue;
|
|
264
|
-
l.Label = ye;
|
|
265
|
-
l.Month = F;
|
|
266
|
-
l.Day = A;
|
|
267
|
-
l.Year = k;
|
|
268
|
-
l.Time = I;
|
|
269
|
-
l.Description = Ie;
|
|
270
|
-
l.Error = _e;
|
|
271
|
-
function N(e) {
|
|
272
|
-
const { inputId: a } = Q();
|
|
273
|
-
return L(() => {
|
|
274
|
-
const n = e.toLowerCase();
|
|
275
|
-
return {
|
|
276
|
-
inputId: `${a}-${n}-input`,
|
|
277
|
-
labelId: `${a}-${n}-label`
|
|
278
|
-
};
|
|
279
|
-
}, [
|
|
280
|
-
a,
|
|
281
|
-
e
|
|
282
|
-
]);
|
|
283
|
-
}
|
|
284
|
-
function C(e) {
|
|
285
|
-
const { value: a, onChange: n, hasError: o = !1 } = g(), { regionalFormat: s } = w(), [r, i] = L(() => G(a ?? ""), [
|
|
286
|
-
a
|
|
287
|
-
]), m = L(() => le(o, a ?? ""), [
|
|
288
|
-
a,
|
|
289
|
-
o
|
|
290
|
-
]), c = L(() => se(r), [
|
|
291
|
-
r
|
|
292
|
-
]), f = L(() => ze(i), [
|
|
293
|
-
i
|
|
294
|
-
]), b = H((T) => {
|
|
295
|
-
const _ = $e(T), D = j(r, _);
|
|
296
|
-
n(D);
|
|
297
|
-
}, [
|
|
298
|
-
n,
|
|
299
|
-
r
|
|
300
|
-
]), y = H((T) => {
|
|
301
|
-
const [, _] = G(a ?? ""), D = ie(T, e, c), M = j(D, _);
|
|
302
|
-
n(M);
|
|
303
|
-
}, [
|
|
304
|
-
n,
|
|
305
|
-
a,
|
|
306
|
-
c,
|
|
307
|
-
e
|
|
308
|
-
]), P = L(() => e === "time" ? !1 : W(s).filter(X).map((D) => D.toUpperCase())[0] === e, [
|
|
309
|
-
s,
|
|
310
|
-
e
|
|
311
|
-
]);
|
|
312
|
-
return e === "time" ? {
|
|
313
|
-
partValue: f,
|
|
314
|
-
partError: m.TIME,
|
|
315
|
-
onPartChange: b,
|
|
316
|
-
isFirstPart: !1
|
|
317
|
-
} : {
|
|
318
|
-
partValue: c[e] || "",
|
|
319
|
-
partError: m[e],
|
|
320
|
-
onPartChange: y,
|
|
321
|
-
isFirstPart: P
|
|
322
|
-
};
|
|
323
|
-
}
|
|
324
|
-
function $({ datePart: e, className: a }) {
|
|
325
|
-
const { inputId: n, labelId: o } = N(e), { t: s } = O(), r = `field.date.label.${e.toLowerCase()}`, i = s(r);
|
|
326
|
-
return /* @__PURE__ */ t.createElement("label", {
|
|
327
|
-
id: o,
|
|
328
|
-
htmlFor: n,
|
|
329
|
-
className: a
|
|
330
|
-
}, i);
|
|
331
|
-
}
|
|
332
|
-
function ze(e) {
|
|
333
|
-
if (!e)
|
|
334
|
-
return null;
|
|
335
|
-
try {
|
|
336
|
-
return ce(e);
|
|
337
|
-
} catch {
|
|
338
|
-
return null;
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
function $e(e) {
|
|
342
|
-
if (!e)
|
|
343
|
-
return null;
|
|
344
|
-
const a = String(e.hour).padStart(2, "0"), n = String(e.minute).padStart(2, "0"), o = String(e.second).padStart(2, "0");
|
|
345
|
-
return [
|
|
346
|
-
a,
|
|
347
|
-
n,
|
|
348
|
-
o
|
|
349
|
-
].join(":");
|
|
350
|
-
}
|
|
351
|
-
const qe = "_fields_1khoa_1", Ge = "_month_1khoa_10", je = "_day_1khoa_11", Je = "_year_1khoa_12", Ke = "_timeGroup_1khoa_13", Qe = "_mobile_1khoa_32", We = "_dayInput_1khoa_45", Xe = "_yearInput_1khoa_46", Ze = "_monthTrigger_1khoa_50", et = "_monthOption_1khoa_70", tt = "_time_1khoa_13", at = "_hour_1khoa_89", nt = "_minute_1khoa_90", rt = "_period_1khoa_91", h = {
|
|
352
|
-
fields: qe,
|
|
353
|
-
month: Ge,
|
|
354
|
-
day: je,
|
|
355
|
-
year: Je,
|
|
356
|
-
timeGroup: Ke,
|
|
357
|
-
mobile: Qe,
|
|
358
|
-
dayInput: We,
|
|
359
|
-
yearInput: Xe,
|
|
360
|
-
monthTrigger: Ze,
|
|
361
|
-
monthOption: et,
|
|
362
|
-
time: tt,
|
|
363
|
-
hour: at,
|
|
364
|
-
minute: nt,
|
|
365
|
-
period: rt
|
|
366
|
-
}, ot = ({ content: e, locale: a }) => /* @__PURE__ */ t.createElement(re, {
|
|
367
|
-
content: e,
|
|
368
|
-
locale: a
|
|
369
|
-
}), Lt = () => {
|
|
370
|
-
const { isMobile: e } = w(), a = K(h.dayInput), n = K(h.yearInput);
|
|
371
|
-
return /* @__PURE__ */ t.createElement(l, {
|
|
372
|
-
className: p(h.fields, {
|
|
373
|
-
[h.mobile]: e
|
|
374
|
-
})
|
|
375
|
-
}, /* @__PURE__ */ t.createElement(l.Label, {
|
|
376
|
-
className: p(S, E.label)
|
|
377
|
-
}, /* @__PURE__ */ t.createElement(l.Label.Required, {
|
|
378
|
-
className: p(Fe, E.requiredMark)
|
|
379
|
-
})), /* @__PURE__ */ t.createElement(l.Month, {
|
|
380
|
-
className: h.month
|
|
381
|
-
}, /* @__PURE__ */ t.createElement(l.Month.Label, {
|
|
382
|
-
className: p(S, E.label)
|
|
383
|
-
}), /* @__PURE__ */ t.createElement(l.Month.Trigger, {
|
|
384
|
-
className: p(J, E.input, h.monthTrigger)
|
|
385
|
-
}, /* @__PURE__ */ t.createElement(Le, {
|
|
386
|
-
className: E.dropdownIcon
|
|
387
|
-
})), /* @__PURE__ */ t.createElement(l.Month.Options, {
|
|
388
|
-
className: p(Ce, E.selectPopover, E.dropdownPopover)
|
|
389
|
-
}, /* @__PURE__ */ t.createElement(l.Month.Options.Option, {
|
|
390
|
-
className: p(E.selectOption, h.monthOption, Y)
|
|
391
|
-
}))), /* @__PURE__ */ t.createElement(l.Day, {
|
|
392
|
-
className: h.day
|
|
393
|
-
}, /* @__PURE__ */ t.createElement(l.Day.Label, {
|
|
394
|
-
className: p(S, E.label)
|
|
395
|
-
}), /* @__PURE__ */ t.createElement(l.Day.Input, {
|
|
396
|
-
className: a
|
|
397
|
-
})), /* @__PURE__ */ t.createElement(l.Year, {
|
|
398
|
-
className: h.year
|
|
399
|
-
}, /* @__PURE__ */ t.createElement(l.Year.Label, {
|
|
400
|
-
className: p(S, E.label)
|
|
401
|
-
}), /* @__PURE__ */ t.createElement(l.Year.Input, {
|
|
402
|
-
className: n
|
|
403
|
-
})), /* @__PURE__ */ t.createElement(l.Time, {
|
|
404
|
-
className: h.timeGroup
|
|
405
|
-
}, /* @__PURE__ */ t.createElement(l.Time.Label, {
|
|
406
|
-
className: p(S, E.label)
|
|
407
|
-
}), /* @__PURE__ */ t.createElement(l.Time.Input, {
|
|
408
|
-
className: p(J, E.input, h.time)
|
|
409
|
-
}, /* @__PURE__ */ t.createElement(l.Time.Hour, {
|
|
410
|
-
className: p(h.hour, Y)
|
|
411
|
-
}), /* @__PURE__ */ t.createElement(l.Time.Minute, {
|
|
412
|
-
className: p(h.minute, Y)
|
|
413
|
-
}), /* @__PURE__ */ t.createElement(l.Time.Period, {
|
|
414
|
-
className: p(h.period, Y)
|
|
415
|
-
}))), /* @__PURE__ */ t.createElement(l.Error, {
|
|
416
|
-
className: p(Pe, E.error)
|
|
417
|
-
}, /* @__PURE__ */ t.createElement(Oe, null), /* @__PURE__ */ t.createElement(l.Error.Text, null)), /* @__PURE__ */ t.createElement(l.Description, {
|
|
418
|
-
className: p(Me, E.description)
|
|
419
|
-
}, ot));
|
|
420
|
-
};
|
|
421
|
-
export {
|
|
422
|
-
Lt as D
|
|
423
|
-
};
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import t from "react";
|
|
2
|
-
import l from "classnames";
|
|
3
|
-
import { ai as c } from "./form-D0eeH0lX.js";
|
|
4
|
-
import { ProgressBar as g, Button as b } from "react-aria-components";
|
|
5
|
-
import { f as i } from "./find-child-C60k4CxG.js";
|
|
6
|
-
import { a4 as v, a3 as N, a6 as f } from "./form-element-classes-Ct1UaxuQ.js";
|
|
7
|
-
function C(e) {
|
|
8
|
-
const s = "calc(50% - 2px)";
|
|
9
|
-
return /* @__PURE__ */ t.createElement(g, {
|
|
10
|
-
...e,
|
|
11
|
-
isIndeterminate: !0
|
|
12
|
-
}, ({ percentage: o, isIndeterminate: a }) => /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("svg", {
|
|
13
|
-
fill: "none",
|
|
14
|
-
width: "100%",
|
|
15
|
-
height: "100%",
|
|
16
|
-
viewBox: "0 0 32 32"
|
|
17
|
-
}, /* @__PURE__ */ t.createElement("circle", {
|
|
18
|
-
cx: "50%",
|
|
19
|
-
cy: "50%",
|
|
20
|
-
r: s
|
|
21
|
-
}), /* @__PURE__ */ t.createElement("circle", {
|
|
22
|
-
cx: "50%",
|
|
23
|
-
cy: "50%",
|
|
24
|
-
r: s,
|
|
25
|
-
// Normalize the path length to 100 so we can easily set stroke-dasharray/-offset to a percentage.
|
|
26
|
-
pathLength: "100",
|
|
27
|
-
strokeDasharray: a || o == null ? "25 100" : "100 100",
|
|
28
|
-
strokeDashoffset: a || o == null ? 0 : 100 - o,
|
|
29
|
-
strokeLinecap: "round"
|
|
30
|
-
}, a && /* @__PURE__ */ t.createElement("animateTransform", {
|
|
31
|
-
attributeName: "transform",
|
|
32
|
-
type: "rotate",
|
|
33
|
-
// Rotate around the circle's own center (viewBox is 32x32), not the SVG origin.
|
|
34
|
-
values: "0 16 16;360 16 16",
|
|
35
|
-
dur: "0.75s",
|
|
36
|
-
repeatCount: "indefinite"
|
|
37
|
-
})))));
|
|
38
|
-
}
|
|
39
|
-
const u = ({ children: e }) => {
|
|
40
|
-
const { id: n, FieldLayout: s } = c(), o = i(e, u.SubmitButton);
|
|
41
|
-
return /* @__PURE__ */ t.createElement(s, {
|
|
42
|
-
fieldId: n,
|
|
43
|
-
renderLabel: () => null,
|
|
44
|
-
renderInput: () => /* @__PURE__ */ t.createElement(t.Fragment, null, o),
|
|
45
|
-
renderDescription: () => null
|
|
46
|
-
});
|
|
47
|
-
}, m = ({ className: e, children: n }) => {
|
|
48
|
-
const s = i(n, d), o = i(n, x), a = i(n, B);
|
|
49
|
-
return /* @__PURE__ */ t.createElement("div", {
|
|
50
|
-
className: e
|
|
51
|
-
}, s, o, a);
|
|
52
|
-
}, d = ({ className: e }) => {
|
|
53
|
-
const { showPreviousButton: n, onPreviousClick: s, previousText: o } = c();
|
|
54
|
-
return n ? /* @__PURE__ */ t.createElement(b, {
|
|
55
|
-
className: e,
|
|
56
|
-
onPress: s
|
|
57
|
-
}, o) : null;
|
|
58
|
-
}, x = ({ className: e }) => {
|
|
59
|
-
const { showNextButton: n, onNextClick: s, nextText: o } = c();
|
|
60
|
-
return n ? /* @__PURE__ */ t.createElement(b, {
|
|
61
|
-
className: e,
|
|
62
|
-
onPress: s
|
|
63
|
-
}, o) : null;
|
|
64
|
-
}, B = ({ className: e, children: n }) => {
|
|
65
|
-
const { showSubmitButton: s, onSubmitClick: o, submitText: a, isDisabled: E, isInProgress: p, isSubmitting: h } = c();
|
|
66
|
-
if (!s)
|
|
67
|
-
return null;
|
|
68
|
-
const _ = i(n, B.Loader), S = h || p;
|
|
69
|
-
return /* @__PURE__ */ t.createElement(b, {
|
|
70
|
-
className: e,
|
|
71
|
-
onPress: S ? void 0 : o,
|
|
72
|
-
isDisabled: E && !S,
|
|
73
|
-
"aria-disabled": S || void 0,
|
|
74
|
-
"data-in-progress": p
|
|
75
|
-
}, p && _ ? _ : a);
|
|
76
|
-
}, P = ({ className: e }) => /* @__PURE__ */ t.createElement("span", {
|
|
77
|
-
className: e
|
|
78
|
-
}, /* @__PURE__ */ t.createElement(C, null));
|
|
79
|
-
B.Loader = P;
|
|
80
|
-
m.PreviousButton = d;
|
|
81
|
-
m.NextButton = x;
|
|
82
|
-
m.SubmitButton = B;
|
|
83
|
-
u.SubmitButton = m;
|
|
84
|
-
const T = "_navigationContainer_1thzx_1", L = "_rowSpacing_1thzx_6", w = "_navigationButton_1thzx_10", z = "_nextButton_1thzx_24", k = "_previousButton_1thzx_47", y = "_button_1thzx_90", F = "_buttonNoSteps_1thzx_122", O = "_buttonWithSteps_1thzx_126", R = "_progress_1thzx_154", r = {
|
|
85
|
-
navigationContainer: T,
|
|
86
|
-
rowSpacing: L,
|
|
87
|
-
navigationButton: w,
|
|
88
|
-
nextButton: z,
|
|
89
|
-
previousButton: k,
|
|
90
|
-
button: y,
|
|
91
|
-
buttonNoSteps: F,
|
|
92
|
-
buttonWithSteps: O,
|
|
93
|
-
progress: R
|
|
94
|
-
}, W = () => {
|
|
95
|
-
const { hasSteps: e, showPreviousButton: n } = c();
|
|
96
|
-
return /* @__PURE__ */ t.createElement(u, null, /* @__PURE__ */ t.createElement(u.SubmitButton, {
|
|
97
|
-
className: l({
|
|
98
|
-
[r.navigationContainer]: e,
|
|
99
|
-
[r.rowSpacing]: n
|
|
100
|
-
})
|
|
101
|
-
}, /* @__PURE__ */ t.createElement(u.SubmitButton.PreviousButton, {
|
|
102
|
-
className: l(v, r.navigationButton, r.previousButton)
|
|
103
|
-
}), /* @__PURE__ */ t.createElement(u.SubmitButton.NextButton, {
|
|
104
|
-
className: l(N, r.navigationButton, r.nextButton)
|
|
105
|
-
}), /* @__PURE__ */ t.createElement(u.SubmitButton.SubmitButton, {
|
|
106
|
-
className: l(f, r.button, {
|
|
107
|
-
[r.buttonNoSteps]: !e,
|
|
108
|
-
[r.buttonWithSteps]: e
|
|
109
|
-
})
|
|
110
|
-
}, /* @__PURE__ */ t.createElement(u.SubmitButton.SubmitButton.Loader, {
|
|
111
|
-
className: r.progress
|
|
112
|
-
}))));
|
|
113
|
-
}, X = () => /* @__PURE__ */ t.createElement(W, null);
|
|
114
|
-
export {
|
|
115
|
-
X as SubmitButtonRAC
|
|
116
|
-
};
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import e, { useCallback as H, useRef as V, useContext as x } from "react";
|
|
2
|
-
import { RicosViewer as k } from "@wix/ricos/viewer";
|
|
3
|
-
import c from "classnames";
|
|
4
|
-
import { parseTime as q } from "@internationalized/date";
|
|
5
|
-
import { TimeField as v, DateInput as B, DateSegment as h, TimeFieldStateContext as U } from "react-aria-components";
|
|
6
|
-
import { ai as p, af as j, as as T, ak as Q } from "./form-D0eeH0lX.js";
|
|
7
|
-
import { f as m, a as F } from "./find-child-C60k4CxG.js";
|
|
8
|
-
import { D as z, E as G } from "./field-error-headless-DAy-1oAQ.js";
|
|
9
|
-
import { L as J } from "./field-label-headless-BWxHmO0c.js";
|
|
10
|
-
import { E as K } from "./error-icon-hZxQ6DEy.js";
|
|
11
|
-
import { H as S } from "./custom-focus-class-_483Pkwp.js";
|
|
12
|
-
import { s as E } from "./field-rac.module-D06m9T9x.js";
|
|
13
|
-
import { y as W, O as X, x as Y, o as Z, i as $ } from "./form-element-classes-Ct1UaxuQ.js";
|
|
14
|
-
const r = ({ children: t }) => {
|
|
15
|
-
const { id: n, value: l, onChange: o, disabled: i, readOnly: s, required: a, onBlur: d, onFocus: f, use24HourFormat: b, FieldLayout: I, hasError: C } = p(), { inputId: L, ariaDescribedBy: g, labelId: D } = j(), R = H((M) => {
|
|
16
|
-
const w = ae(M);
|
|
17
|
-
o(w);
|
|
18
|
-
}, [
|
|
19
|
-
o
|
|
20
|
-
]), y = m(t, r.Label), N = m(t, r.Time), O = m(t, r.Description), P = m(t, r.Error), A = ne(l);
|
|
21
|
-
return /* @__PURE__ */ e.createElement(I, {
|
|
22
|
-
fieldId: n,
|
|
23
|
-
renderLabel: () => y,
|
|
24
|
-
renderInput: () => /* @__PURE__ */ e.createElement(v, {
|
|
25
|
-
"aria-labelledby": D,
|
|
26
|
-
id: L,
|
|
27
|
-
"aria-describedby": g,
|
|
28
|
-
value: A,
|
|
29
|
-
onChange: R,
|
|
30
|
-
isDisabled: i,
|
|
31
|
-
isReadOnly: s,
|
|
32
|
-
isInvalid: C,
|
|
33
|
-
isRequired: a,
|
|
34
|
-
onBlur: d,
|
|
35
|
-
onFocus: f,
|
|
36
|
-
hourCycle: b ? 24 : 12
|
|
37
|
-
}, N),
|
|
38
|
-
renderDescription: () => /* @__PURE__ */ e.createElement(e.Fragment, null, P, O)
|
|
39
|
-
});
|
|
40
|
-
}, u = ({ children: t, className: n }) => {
|
|
41
|
-
const { hasError: l } = p(), o = m(t, u.Hour), i = m(t, u.Minute), s = m(t, u.Period);
|
|
42
|
-
return /* @__PURE__ */ e.createElement(B, {
|
|
43
|
-
className: n,
|
|
44
|
-
"data-invalid": l || void 0
|
|
45
|
-
}, (a) => {
|
|
46
|
-
switch (a.type) {
|
|
47
|
-
case "hour":
|
|
48
|
-
return F(o, {
|
|
49
|
-
segment: a
|
|
50
|
-
}) || /* @__PURE__ */ e.createElement(e.Fragment, null);
|
|
51
|
-
case "minute":
|
|
52
|
-
return F(i, {
|
|
53
|
-
segment: a
|
|
54
|
-
}) || /* @__PURE__ */ e.createElement(e.Fragment, null);
|
|
55
|
-
case "dayPeriod":
|
|
56
|
-
return F(s, {
|
|
57
|
-
segment: a
|
|
58
|
-
}) || /* @__PURE__ */ e.createElement(e.Fragment, null);
|
|
59
|
-
case "literal":
|
|
60
|
-
return /* @__PURE__ */ e.createElement(h, {
|
|
61
|
-
segment: a
|
|
62
|
-
});
|
|
63
|
-
default:
|
|
64
|
-
return /* @__PURE__ */ e.createElement(e.Fragment, null);
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
}, ee = ({ className: t, ...n }) => {
|
|
68
|
-
const { id: l, hidePlaceholder: o } = p(), { segment: i } = n, { t: s } = T(), a = V(null);
|
|
69
|
-
Q(() => {
|
|
70
|
-
var f;
|
|
71
|
-
(f = a.current) == null || f.focus();
|
|
72
|
-
}, l);
|
|
73
|
-
const d = o ? void 0 : s("field.date.placeholder.hour");
|
|
74
|
-
return /* @__PURE__ */ e.createElement(h, {
|
|
75
|
-
ref: a,
|
|
76
|
-
segment: i,
|
|
77
|
-
className: t,
|
|
78
|
-
...d && {
|
|
79
|
-
placeholder: d
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
}, te = ({ className: t, ...n }) => {
|
|
83
|
-
const { hidePlaceholder: l } = p(), { segment: o } = n, { t: i } = T(), s = l ? void 0 : i("field.date.placeholder.minute");
|
|
84
|
-
return /* @__PURE__ */ e.createElement(h, {
|
|
85
|
-
segment: o,
|
|
86
|
-
className: t,
|
|
87
|
-
...s && {
|
|
88
|
-
placeholder: s
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
}, re = ({ className: t, ...n }) => {
|
|
92
|
-
const { hidePlaceholder: l } = p(), { segment: o } = n, { t: i } = T(), s = x(U), a = l ? void 0 : i("field.date.placeholder.period"), d = () => s == null ? void 0 : s.increment("dayPeriod");
|
|
93
|
-
return /* @__PURE__ */ e.createElement(h, {
|
|
94
|
-
segment: o,
|
|
95
|
-
className: t,
|
|
96
|
-
onClick: d,
|
|
97
|
-
...a && {
|
|
98
|
-
placeholder: a
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
};
|
|
102
|
-
u.Hour = ee;
|
|
103
|
-
u.Minute = te;
|
|
104
|
-
u.Period = re;
|
|
105
|
-
r.Label = J;
|
|
106
|
-
r.Time = u;
|
|
107
|
-
r.Description = z;
|
|
108
|
-
r.Error = G;
|
|
109
|
-
function ne(t) {
|
|
110
|
-
if (!t)
|
|
111
|
-
return null;
|
|
112
|
-
try {
|
|
113
|
-
return q(t);
|
|
114
|
-
} catch {
|
|
115
|
-
return null;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
function ae(t) {
|
|
119
|
-
if (!t)
|
|
120
|
-
return null;
|
|
121
|
-
const n = String(t.hour).padStart(2, "0"), l = String(t.minute).padStart(2, "0"), o = String(t.second).padStart(2, "0");
|
|
122
|
-
return [
|
|
123
|
-
n,
|
|
124
|
-
l,
|
|
125
|
-
o
|
|
126
|
-
].join(":");
|
|
127
|
-
}
|
|
128
|
-
const oe = "_time_1wbmw_1", se = "_hour_1wbmw_14", le = "_minute_1wbmw_15", ie = "_period_1wbmw_16", _ = {
|
|
129
|
-
time: oe,
|
|
130
|
-
hour: se,
|
|
131
|
-
minute: le,
|
|
132
|
-
period: ie
|
|
133
|
-
}, ce = ({ content: t, locale: n }) => /* @__PURE__ */ e.createElement(k, {
|
|
134
|
-
content: t,
|
|
135
|
-
locale: n
|
|
136
|
-
}), me = () => /* @__PURE__ */ e.createElement(r, null, /* @__PURE__ */ e.createElement(r.Label, {
|
|
137
|
-
className: c(W, E.label)
|
|
138
|
-
}, /* @__PURE__ */ e.createElement(r.Label.Required, {
|
|
139
|
-
className: c(X, E.requiredMark)
|
|
140
|
-
})), /* @__PURE__ */ e.createElement(r.Time, {
|
|
141
|
-
className: c(Y, E.input, _.time)
|
|
142
|
-
}, /* @__PURE__ */ e.createElement(r.Time.Hour, {
|
|
143
|
-
className: c(_.hour, S)
|
|
144
|
-
}), /* @__PURE__ */ e.createElement(r.Time.Minute, {
|
|
145
|
-
className: c(_.minute, S)
|
|
146
|
-
}), /* @__PURE__ */ e.createElement(r.Time.Period, {
|
|
147
|
-
className: c(_.period, S)
|
|
148
|
-
})), /* @__PURE__ */ e.createElement(r.Error, {
|
|
149
|
-
className: c(Z, E.error)
|
|
150
|
-
}, /* @__PURE__ */ e.createElement(K, null), /* @__PURE__ */ e.createElement(r.Error.Text, null)), /* @__PURE__ */ e.createElement(r.Description, {
|
|
151
|
-
className: c($, E.description)
|
|
152
|
-
}, ce)), Le = () => /* @__PURE__ */ e.createElement(me, null);
|
|
153
|
-
export {
|
|
154
|
-
Le as TimeInputRAC
|
|
155
|
-
};
|