@wix/form-elements 1.94.0 → 1.95.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.
Files changed (109) hide show
  1. package/dist/component/{appointment-rac-CNIizm60.js → appointment-rac-mhQIjy3A.js} +309 -310
  2. package/dist/component/{bookings-address-rac-C7ukrF1D.js → bookings-address-rac-pcZeAN2d.js} +1 -1
  3. package/dist/component/{bookings-email-rac-DnzbLEmf.js → bookings-email-rac-BHdvWhcv.js} +1 -1
  4. package/dist/component/{bookings-first-name-rac-8Krm-3QK.js → bookings-first-name-rac-mPNuMBGo.js} +1 -1
  5. package/dist/component/{bookings-header-rac-WRILbKeE.js → bookings-header-rac-CUzR91gM.js} +1 -1
  6. package/dist/component/{bookings-last-name-rac-C0-yWBLa.js → bookings-last-name-rac-q2bsOPke.js} +1 -1
  7. package/dist/component/{bookings-login-bar-rac-Bc9u_rn_.js → bookings-login-bar-rac-BpwVjQwz.js} +4 -4
  8. package/dist/component/{bookings-phone-rac-BaBlg7f7.js → bookings-phone-rac-DWdDpi-n.js} +1 -1
  9. package/dist/component/{bookings-rich-text-rac-DR-Ngu_b.js → bookings-rich-text-rac-CZnGLPwv.js} +1 -1
  10. package/dist/component/{get-first-day-of-the-week-DvnsxYhQ.js → calendar.module-DnhTT4QT.js} +23 -18
  11. package/dist/component/{checkbox-field-rac-Cqr57TgJ.js → checkbox-field-rac-DRVjITJ_.js} +5 -5
  12. package/dist/component/{checkbox-group-field-headless-Bgcvavr3.js → checkbox-group-field-headless-CKXgbUdv.js} +3 -3
  13. package/dist/component/{checkbox-group-field-rac-Bcsowjwp.js → checkbox-group-field-rac-Dt3yWmua.js} +12 -12
  14. package/dist/component/{checkbox-group-rac-38j0b8_U.js → checkbox-group-rac-BTFoDjxn.js} +1 -1
  15. package/dist/component/{checkbox-rac-Bb5ZxZo7.js → checkbox-rac-Crn5HP7E.js} +1 -1
  16. package/dist/component/{contacts-address-rac-gaOhfztb.js → contacts-address-rac-c1zfBJgx.js} +1 -1
  17. package/dist/component/{contacts-birthdate-rac-DAIPR64p.js → contacts-birthdate-rac-BaaSPZgO.js} +1 -1
  18. package/dist/component/{contacts-company-rac-DVPQrcfN.js → contacts-company-rac-CzuRjr1D.js} +1 -1
  19. package/dist/component/{contacts-email-rac-qMyFjz_2.js → contacts-email-rac-hL98o3x4.js} +1 -1
  20. package/dist/component/{contacts-first-name-rac-OVPtHcde.js → contacts-first-name-rac-BXTnd1aU.js} +1 -1
  21. package/dist/component/{contacts-last-name-rac-BmLQrJ2D.js → contacts-last-name-rac-DYjmWO4_.js} +1 -1
  22. package/dist/component/{contacts-phone-rac-D7waZc1q.js → contacts-phone-rac-KMnorQhu.js} +1 -1
  23. package/dist/component/{contacts-position-rac-DnI3o3Am.js → contacts-position-rac-ylzvuGhD.js} +1 -1
  24. package/dist/component/{contacts-subscribe-rac-P8zn8_GS.js → contacts-subscribe-rac-Bi3ZazuW.js} +2 -2
  25. package/dist/component/{contacts-tax-id-rac-9CBr2KkR.js → contacts-tax-id-rac-C01LkO1D.js} +1 -1
  26. package/dist/component/{date-availability--ntpBDiI.js → date-availability-BXwnYCBt.js} +1 -1
  27. package/dist/component/{date-input-field-rac-Don2tz5U.js → date-input-field-rac-BMdPQoFk.js} +57 -56
  28. package/dist/component/{date-input-rac-Du3e8Hcu.js → date-input-rac-D2mDdJ_4.js} +1 -1
  29. package/dist/component/date-picker-field-rac-7gyRMkPp.js +317 -0
  30. package/dist/component/{date-picker-rac-BsCMkfHV.js → date-picker-rac-FyNcNbTc.js} +1 -1
  31. package/dist/component/{date-time-input-field-rac-LLF1UdUD.js → date-time-input-field-rac-BTjqn_g-.js} +53 -52
  32. package/dist/component/{date-time-input-rac-KYqrNgbb.js → date-time-input-rac-C81cN7rJ.js} +1 -1
  33. package/dist/component/{dext-checkbox-group-rac-DaOY9Cb6.js → dext-checkbox-group-rac-DAjQPdi_.js} +2 -2
  34. package/dist/component/{dext-checkbox-rac-Ceu5q9xf.js → dext-checkbox-rac-DVt9mAXM.js} +1 -1
  35. package/dist/component/{dext-date-picker-rac-iop0XEpQ.js → dext-date-picker-rac-BnaExh1i.js} +1 -1
  36. package/dist/component/{dext-date-time-input-rac-DJB_fMiN.js → dext-date-time-input-rac-DPAW4eBA.js} +1 -1
  37. package/dist/component/{dext-dropdown-rac-Dhp4CUZ5.js → dext-dropdown-rac-P9T1vh24.js} +1 -1
  38. package/dist/component/{dext-email-rac-BIr9RxhQ.js → dext-email-rac-BfEuFGaV.js} +1 -1
  39. package/dist/component/{dext-number-input-rac-Q8p3NeKN.js → dext-number-input-rac-B5eN2rLP.js} +1 -1
  40. package/dist/component/{dext-phone-rac-DRdRLIvr.js → dext-phone-rac-DA-h_tpZ.js} +1 -1
  41. package/dist/component/{dext-radio-group-rac-D1N_wBhO.js → dext-radio-group-rac-BjpkApRr.js} +2 -2
  42. package/dist/component/{dext-rating-input-rac-BQIMl7oQ.js → dext-rating-input-rac-DUMRW9uI.js} +1 -1
  43. package/dist/component/{dext-tags-rac-C52jiu1I.js → dext-tags-rac-s0WchM4X.js} +2 -2
  44. package/dist/component/{dext-text-area-rac-BWmSs4mb.js → dext-text-area-rac-BRMsiGEH.js} +1 -1
  45. package/dist/component/{dext-text-input-rac-BnAJ-7Hs.js → dext-text-input-rac-BBZi3D8V.js} +1 -1
  46. package/dist/component/{dext-url-input-rac-CvGn3KHo.js → dext-url-input-rac-jKMWbCGB.js} +1 -1
  47. package/dist/component/{donation-rac-DsFRs16V.js → donation-rac-DyeKbodo.js} +30 -30
  48. package/dist/component/{dropdown-field-headless-K0AM4AAs.js → dropdown-field-headless-BK8BN3u4.js} +4 -4
  49. package/dist/component/{dropdown-field-rac-CMEB8ZQN.js → dropdown-field-rac-B6yzL_R0.js} +5 -5
  50. package/dist/component/{dropdown-rac-BakYShkm.js → dropdown-rac-CQaMpex2.js} +1 -1
  51. package/dist/component/{ecom-address-rac-A_Aj5CX0.js → ecom-address-rac-DQr3-QeV.js} +1 -1
  52. package/dist/component/{ecom-subscription-checkbox-rac-Ddol0N03.js → ecom-subscription-checkbox-rac-CZ-pj21A.js} +3 -3
  53. package/dist/component/{email-input-field-rac-B7yOMDWB.js → email-input-field-rac-Vp0YfQOe.js} +41 -41
  54. package/dist/component/{events-repeater-rac-bp8gFHXQ.js → events-repeater-rac-BPE4Hn_G.js} +4 -4
  55. package/dist/component/{events-rsvp-rac-DfjqTM7C.js → events-rsvp-rac-u_BDmDJ2.js} +20 -20
  56. package/dist/component/{field-error-headless-CONyKitA.js → field-error-headless-BOlFtckJ.js} +1 -1
  57. package/dist/component/{field-label-headless-tf9QXhMi.js → field-label-headless-Dx3VrM-U.js} +1 -1
  58. package/dist/component/{file-upload-rac-Bng5Yew9.js → file-upload-rac-DaFuvO-g.js} +43 -43
  59. package/dist/component/{fixed-payment-rac-CXIv7_Oj.js → fixed-payment-rac-DpBwOtOf.js} +10 -10
  60. package/dist/component/{form-Lv-a47BN.js → form-Wsx4lguO.js} +69 -69
  61. package/dist/component/{form-element-classes-CLZXu-91.js → form-element-classes-BtKlobUX.js} +60 -59
  62. package/dist/component/form.css +1 -1
  63. package/dist/component/form.js +1 -1
  64. package/dist/component/{header-field-rac-BZdYszfP.js → header-field-rac-C8FlksmH.js} +3 -3
  65. package/dist/component/{header-rac-BNeqoDyT.js → header-rac-C2J-pLq-.js} +1 -1
  66. package/dist/component/{image-choice-rac-aSKDRo51.js → image-choice-rac-i4C_OXyb.js} +15 -15
  67. package/dist/component/{index-CWZfskEy.js → index-C34urqyX.js} +4 -4
  68. package/dist/component/{index-DnNA6zNR.js → index-CRI82pG6.js} +2 -2
  69. package/dist/component/{isObjectLike-C9ogbjhq.js → isObjectLike-D-9JnXmU.js} +1 -1
  70. package/dist/component/{multiline-address-field-rac-CHE1mE_b.js → multiline-address-field-rac-Dkfso46f.js} +86 -85
  71. package/dist/component/{multiline-address-rac-wxJunvdU.js → multiline-address-rac-BjrwDwOk.js} +1 -1
  72. package/dist/component/{number-input-field-rac-ore1oi9q.js → number-input-field-rac-CgHi83Q1.js} +18 -18
  73. package/dist/component/{number-input-rac-DU-rCrjJ.js → number-input-rac-BinBxOCS.js} +1 -1
  74. package/dist/component/{password-rac-Dkqv0AIm.js → password-rac-CDGqIRW5.js} +37 -37
  75. package/dist/component/{payment-input-rac-CsTcFhQ5.js → payment-input-rac-f4uuGeJF.js} +22 -22
  76. package/dist/component/{phone-input-field-rac-lIVKt7ge.js → phone-input-field-rac-IdBqjM9Q.js} +32 -31
  77. package/dist/component/{phone-rac-CZlsXHRM.js → phone-rac-VHPMrSpw.js} +1 -1
  78. package/dist/component/{product-list-rac-UebyHfhC.js → product-list-rac-Bk8q5y5L.js} +15 -15
  79. package/dist/component/{quiz-radio-group-rac-ORLTYxdR.js → quiz-radio-group-rac-kTWqvAoW.js} +2 -2
  80. package/dist/component/{radio-button-module-classes-CEQr0hKB.js → radio-button-module-classes-D77Nc48M.js} +3 -3
  81. package/dist/component/{radio-group-field-rac-t_Dj1_4p.js → radio-group-field-rac-DC-AYSOH.js} +4 -4
  82. package/dist/component/{radio-group-rac-CC_35nq4.js → radio-group-rac-BkswH1Py.js} +1 -1
  83. package/dist/component/{rating-input-field-rac-BU66cRhy.js → rating-input-field-rac-Cqgw6PjV.js} +31 -31
  84. package/dist/component/{rating-input-rac-KgNbgchh.js → rating-input-rac-CbZhlK3h.js} +1 -1
  85. package/dist/component/{rich-content-rac.module-oGcFL-hl.js → rich-content-rac.module-j_9YbXMI.js} +1 -1
  86. package/dist/component/{rich-text-field-rac-CiwMiMv7.js → rich-text-field-rac-Da1EIb3b.js} +3 -3
  87. package/dist/component/{rich-text-rac-Dmp0xxpi.js → rich-text-rac-BarNBtgP.js} +1 -1
  88. package/dist/component/{service-dropdown-rac-_QBi8_AO.js → service-dropdown-rac-DLIC_csj.js} +35 -35
  89. package/dist/component/{services-multi-choice-rac-C2e3xL9O.js → services-multi-choice-rac-vyxtwSM2.js} +12 -12
  90. package/dist/component/{signature-rac-Dj3aYMvJ.js → signature-rac-DIM2Uwsg.js} +102 -102
  91. package/dist/component/{submit-button-rac-C-BVXga7.js → submit-button-rac-DgxjomCu.js} +2 -2
  92. package/dist/component/{tags-field-rac-CcOUcsCd.js → tags-field-rac-BFlkxifd.js} +66 -66
  93. package/dist/component/{tags-rac-p68DA4Mq.js → tags-rac-D4TwrAWc.js} +1 -1
  94. package/dist/component/{text-area-field-rac-DubIcKTn.js → text-area-field-rac-Dcz7VUQ5.js} +27 -27
  95. package/dist/component/{text-area-rac-CygfUB6z.js → text-area-rac-DhloXdO2.js} +1 -1
  96. package/dist/component/{text-input-field-rac-C7JZRcCX.js → text-input-field-rac-C8e3TMxI.js} +7 -7
  97. package/dist/component/{text-input-headless-D1xcxxNE.js → text-input-headless-fl7qoZzR.js} +3 -3
  98. package/dist/component/{text-input-rac-C5lfqJCN.js → text-input-rac-CBn6bHtP.js} +1 -1
  99. package/dist/component/{time-input-rac-BNxceC-R.js → time-input-rac-Dsm7_vrf.js} +25 -25
  100. package/dist/component/{url-input-field-rac-DH_STwmd.js → url-input-field-rac-9Hfx1xzO.js} +19 -19
  101. package/dist/component/{url-input-rac-C2VOzCis.js → url-input-rac-CVlE4pcg.js} +1 -1
  102. package/dist/component/use-dropdown-option-class-name-Dsxto42_.js +21 -0
  103. package/dist/component/{use-element-state-class-name-CITSBXT8.js → use-element-state-class-name-BIqDbVvI.js} +1 -1
  104. package/dist/component/use-is-forced-open-dropdown-BMPqRDVW.js +41 -0
  105. package/dist/component/{use-service-options-base-DVBmOiRh.js → use-service-options-base-07_rqXcG.js} +1 -1
  106. package/dist/component/{use-text-input-class-name-COw61iUf.js → use-text-input-class-name-DqFt59gd.js} +3 -3
  107. package/package.json +2 -2
  108. package/dist/component/date-picker-field-rac-Wxmz-O7r.js +0 -304
  109. package/dist/component/use-dropdown-option-class-name-CKRu4ERM.js +0 -57
@@ -0,0 +1,21 @@
1
+ import a from "classnames";
2
+ import { s as o } from "./field-rac.module-DobpyqOd.js";
3
+ import { m as r } from "./form-element-classes-BtKlobUX.js";
4
+ import { u as l } from "./use-element-state-class-name-BIqDbVvI.js";
5
+ const m = {
6
+ base: o.selectOption,
7
+ selected: o.selectOptionSelected,
8
+ hover: o.selectOptionHover
9
+ }, O = ({ isSelected: e, isHovered: s, isFocused: t }) => ({
10
+ isSelected: e,
11
+ isHovered: (s || t) && !e
12
+ }), N = (...e) => {
13
+ const s = l({
14
+ globalClasses: r,
15
+ moduleClasses: m
16
+ });
17
+ return (t) => a(s(O(t)), e);
18
+ };
19
+ export {
20
+ N as u
21
+ };
@@ -1,5 +1,5 @@
1
1
  import E from "classnames";
2
- import { ad as f } from "./form-Lv-a47BN.js";
2
+ import { ad as f } from "./form-Wsx4lguO.js";
3
3
  const k = ({ globalClasses: e, moduleClasses: r }) => {
4
4
  var d;
5
5
  const c = ((d = f(...e.parent ? [
@@ -0,0 +1,41 @@
1
+ import { useContext as T, useMemo as p } from "react";
2
+ import { ae as u, l as O, ac as _, F as n } from "./form-Wsx4lguO.js";
3
+ const a = [
4
+ n.DROPDOWN,
5
+ n.DEXT_DROPDOWN,
6
+ n.SERVICES_DROPDOWN,
7
+ n.DATE_INPUT,
8
+ n.CONTACTS_BIRTHDATE,
9
+ n.DATE_TIME_INPUT,
10
+ n.DEXT_DATE_TIME_INPUT,
11
+ n.DATE_PICKER,
12
+ n.DEXT_DATE_PICKER
13
+ ], c = [
14
+ n.PHONE,
15
+ n.CONTACTS_PHONE,
16
+ n.BOOKINGS_PHONE,
17
+ n.DEXT_PHONE
18
+ ], d = [
19
+ n.MULTILINE_ADDRESS,
20
+ n.BOOKINGS_ADDRESS,
21
+ n.ECOM_ADDRESS
22
+ ], l = ({ properties: o }) => {
23
+ var t, e, s, r;
24
+ return ((r = (s = (e = (t = o.validation) == null ? void 0 : t.string) == null ? void 0 : e.phoneOptions) == null ? void 0 : s.allowedCountryCodes) == null ? void 0 : r.length) !== 1;
25
+ }, I = ({ properties: o }) => {
26
+ var t, e;
27
+ return ((e = (t = o.fieldSettings) == null ? void 0 : t.country) == null ? void 0 : e.show) !== !1;
28
+ }, P = (o, t) => c.includes(o.fieldType) ? !t && l(o) : d.includes(o.fieldType) ? I(o) : a.includes(o.fieldType), S = (o, t) => P(o, t) && !o.properties.hidden && !o.properties.disabled && !o.properties.readOnly, N = (o, t) => o.layout.row - t.layout.row || o.layout.column - t.layout.column, w = (o) => {
29
+ var E;
30
+ const t = ((E = u().dropdown) == null ? void 0 : E.open) === !0, e = T(O), { isMobile: s = !1 } = _(), r = p(() => {
31
+ var D;
32
+ return e && !e.parentId ? (D = e.fields.filter((i) => S(i, s)).sort(N)[0]) == null ? void 0 : D.id : void 0;
33
+ }, [
34
+ e,
35
+ s
36
+ ]);
37
+ return t && r === o;
38
+ };
39
+ export {
40
+ w as u
41
+ };
@@ -1,5 +1,5 @@
1
1
  import { useState as o, useCallback as D, useEffect as m, useMemo as b } from "react";
2
- import { aj as v } from "./form-Lv-a47BN.js";
2
+ import { aj as v } from "./form-Wsx4lguO.js";
3
3
  const j = (I) => {
4
4
  const { fieldType: L, isEditor: t = !1, postProcessOptions: i, customFetchLogic: a, onInitialDataLoaded: n } = I, [O, h] = o(!1), [g, p] = o([]), [E, u] = o(!1), [c, f] = o(!1), s = v(L), r = D((e) => {
5
5
  let d = e.map((l) => ({
@@ -1,7 +1,7 @@
1
- import { ak as l } from "./form-Lv-a47BN.js";
1
+ import { ak as l } from "./form-Wsx4lguO.js";
2
2
  import { s } from "./field-rac.module-DobpyqOd.js";
3
- import { a0 as m } from "./form-element-classes-CLZXu-91.js";
4
- import { u as i } from "./use-element-state-class-name-CITSBXT8.js";
3
+ import { a1 as m } from "./form-element-classes-BtKlobUX.js";
4
+ import { u as i } from "./use-element-state-class-name-BIqDbVvI.js";
5
5
  const c = (...e) => {
6
6
  const { disabled: a, readOnly: t } = l(), o = i({
7
7
  globalClasses: m,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/form-elements",
3
- "version": "1.94.0",
3
+ "version": "1.95.0",
4
4
  "description": "The Wix Forms rendering element for Builder apps, loaded at runtime as @wix/form-elements/Form",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -155,5 +155,5 @@
155
155
  ]
156
156
  }
157
157
  },
158
- "falconPackageHash": "940bd21439303f8aeb18ceea63c27b6dd5686cb6328beb6f98cfe7ad"
158
+ "falconPackageHash": "e28c46e74662494bbde43b9631a814dd26691b3df5376ffc2659f6ce"
159
159
  }
@@ -1,304 +0,0 @@
1
- import { RicosViewer as G } from "@wix/ricos/viewer";
2
- import y from "classnames";
3
- import e, { useState as z, useCallback as F, useContext as Q, useRef as L, useMemo as _ } from "react";
4
- import { D, ak as v, ah as A, ac as S, am as Z } from "./form-Lv-a47BN.js";
5
- import { parseDate as J } from "@internationalized/date";
6
- import { UNSAFE_PortalProvider as X } from "react-aria";
7
- import { I18nProvider as ee, DatePicker as te, DatePickerStateContext as re, Group as ae, DateInput as ne, DateSegment as oe, Dialog as le, Calendar as se, CalendarMonthPicker as ce, CalendarYearPicker as ie, CalendarGrid as me, CalendarCell as ue, Button as R, Select as O, SelectValue as x, ListBox as k, ListBoxItem as M } from "react-aria-components";
8
- import { g as de } from "./get-first-day-of-the-week-DvnsxYhQ.js";
9
- import { f as E, a as b } from "./find-child-C60k4CxG.js";
10
- import { D as ge, E as Ee } from "./field-error-headless-CONyKitA.js";
11
- import { L as pe } from "./field-label-headless-tf9QXhMi.js";
12
- import { D as De, N as I, S as w } from "./non-modal-popover-DtIMXHbe.js";
13
- import { i as fe } from "./date-availability--ntpBDiI.js";
14
- import { C as N } from "./chevron-down-icon-CcpVm6B-.js";
15
- import { E as Ce } from "./error-icon-hZxQ6DEy.js";
16
- import { s as p } from "./field-rac.module-DobpyqOd.js";
17
- import { B as ye, R as he, z as ve, D as Se, q as Te, i as be } from "./form-element-classes-CLZXu-91.js";
18
- const _e = [
19
- D.SUNDAY,
20
- D.MONDAY,
21
- D.TUESDAY,
22
- D.WEDNESDAY,
23
- D.THURSDAY,
24
- D.FRIDAY,
25
- D.SATURDAY
26
- ], Ne = {
27
- availableDays: _e
28
- }, a = ({ children: t }) => {
29
- const { id: r, value: n, onChange: l, disabled: i, required: c, onBlur: d, onFocus: o, FieldLayout: m, hasError: u, readOnly: f } = v(), { labelId: C } = A(), { regionalFormat: s } = S(), [T, Y] = z(null), B = F((H) => {
30
- const j = Me(H);
31
- l(j);
32
- }, [
33
- l
34
- ]), q = E(t, a.Label), V = E(t, a.Control), U = E(t, a.Calendar), W = E(t, a.Description), K = E(t, a.Error), $ = ke(n);
35
- return /* @__PURE__ */ e.createElement(m, {
36
- fieldId: r,
37
- renderLabel: () => q,
38
- renderInput: () => /* @__PURE__ */ e.createElement(ee, {
39
- locale: s
40
- }, /* @__PURE__ */ e.createElement("div", {
41
- ref: Y,
42
- style: {
43
- display: "contents"
44
- }
45
- }), /* @__PURE__ */ e.createElement(X, {
46
- getContainer: () => T
47
- }, /* @__PURE__ */ e.createElement(te, {
48
- "aria-labelledby": C,
49
- value: $,
50
- onChange: B,
51
- isDisabled: i,
52
- isInvalid: u,
53
- isReadOnly: f,
54
- isRequired: c,
55
- onBlur: d,
56
- onFocus: o
57
- }, V, U))),
58
- renderDescription: () => /* @__PURE__ */ e.createElement(e.Fragment, null, K, W)
59
- });
60
- }, Ie = ({ children: t, className: r }) => {
61
- const { inputId: n, ariaDescribedBy: l } = A(), { hasError: i, disabled: c, readOnly: d } = v(), o = Q(re), m = F((u) => {
62
- if (!o || o.isOpen || c || d)
63
- return;
64
- const f = u.target;
65
- if (f.closest("button"))
66
- return;
67
- const C = f.closest("[data-type]");
68
- C && C.getAttribute("data-type") !== "literal" || o.setOpen(!0);
69
- }, [
70
- o,
71
- c,
72
- d
73
- ]);
74
- return /* @__PURE__ */ e.createElement(ae, {
75
- id: n,
76
- "aria-describedby": l,
77
- className: r,
78
- "data-invalid": i,
79
- onPointerDownCapture: m
80
- }, t);
81
- }, Le = ({ className: t }) => {
82
- const { id: r, placeholder: n } = v(), { regionalFormat: l } = S(), i = L(null), c = L(!1);
83
- Z(() => {
84
- var o;
85
- (o = i.current) == null || o.focus();
86
- }, r);
87
- const d = _(() => we(l), [
88
- l
89
- ]);
90
- return /* @__PURE__ */ e.createElement(ne, {
91
- className: t
92
- }, (o) => {
93
- const m = o.type === d && o.isPlaceholder && !!n;
94
- return /* @__PURE__ */ e.createElement(oe, {
95
- segment: o,
96
- "data-first-segment": m || void 0,
97
- ref: (u) => {
98
- if (!u && c.current) {
99
- i.current = null, c.current = !1;
100
- return;
101
- }
102
- if (u && !c.current) {
103
- i.current = u, c.current = !0;
104
- return;
105
- }
106
- }
107
- }, (u) => !u.isPlaceholder || !n ? u.text : m ? n : u.text);
108
- });
109
- }, Pe = ({ children: t, className: r }) => /* @__PURE__ */ e.createElement(De, {
110
- className: r
111
- }, t), g = ({ children: t, className: r }) => {
112
- const { regionalFormat: n, isMobile: l } = S(), { availability: i } = v(), c = _(() => de(n), [
113
- n
114
- ]), d = _(() => (s) => {
115
- const T = new Date(s.year, s.month - 1, s.day);
116
- return !fe(T, i || Ne);
117
- }, [
118
- i
119
- ]), o = E(t, g.Day) ?? /* @__PURE__ */ e.createElement(g.Day, null), m = E(t, g.PreviousTrigger), u = E(t, g.NextTrigger), f = E(t, g.MonthTrigger), C = E(t, g.YearTrigger);
120
- return /* @__PURE__ */ e.createElement(I, {
121
- className: r,
122
- containerPadding: 0
123
- }, /* @__PURE__ */ e.createElement(le, null, /* @__PURE__ */ e.createElement(se, {
124
- firstDayOfWeek: Ye(c),
125
- isDateUnavailable: d
126
- }, /* @__PURE__ */ e.createElement("header", null, m, /* @__PURE__ */ e.createElement(ce, null, (s) => b(f, {
127
- ariaLabel: s["aria-label"],
128
- selectedKey: s.value,
129
- onSelectionChange: s.onChange,
130
- items: s.items,
131
- popoverClassName: r
132
- })), /* @__PURE__ */ e.createElement(ie, {
133
- visibleYears: 100
134
- }, (s) => b(C, {
135
- ariaLabel: s["aria-label"],
136
- selectedKey: s.value,
137
- onSelectionChange: s.onChange,
138
- items: s.items,
139
- popoverClassName: r
140
- })), u), /* @__PURE__ */ e.createElement(me, {
141
- weekdayStyle: l ? "narrow" : "short"
142
- }, (s) => b(o, {
143
- date: s
144
- })))));
145
- }, Fe = ({ className: t, ...r }) => {
146
- const { date: n } = r;
147
- return /* @__PURE__ */ e.createElement(ue, {
148
- className: t,
149
- date: n
150
- });
151
- }, Ae = ({ children: t, className: r }) => /* @__PURE__ */ e.createElement(R, {
152
- slot: "previous",
153
- className: r
154
- }, t), Re = ({ children: t, className: r }) => /* @__PURE__ */ e.createElement(R, {
155
- slot: "next",
156
- className: r
157
- }, t), Oe = ({ children: t, className: r, ...n }) => {
158
- const { ariaLabel: l, selectedKey: i, onSelectionChange: c, items: d, popoverClassName: o } = n;
159
- return /* @__PURE__ */ e.createElement(O, {
160
- "aria-label": l,
161
- selectedKey: i,
162
- onSelectionChange: c
163
- }, /* @__PURE__ */ e.createElement(w, {
164
- className: r
165
- }, /* @__PURE__ */ e.createElement(x, null), t), /* @__PURE__ */ e.createElement(I, {
166
- className: o,
167
- containerPadding: 0
168
- }, /* @__PURE__ */ e.createElement(k, {
169
- items: d
170
- }, (m) => /* @__PURE__ */ e.createElement(M, {
171
- id: m.id
172
- }, m.formatted))));
173
- }, xe = ({ children: t, className: r, ...n }) => {
174
- const { ariaLabel: l, selectedKey: i, onSelectionChange: c, items: d, popoverClassName: o } = n;
175
- return /* @__PURE__ */ e.createElement(O, {
176
- "aria-label": l,
177
- selectedKey: i,
178
- onSelectionChange: c
179
- }, /* @__PURE__ */ e.createElement(w, {
180
- className: r
181
- }, /* @__PURE__ */ e.createElement(x, null), t), /* @__PURE__ */ e.createElement(I, {
182
- className: o,
183
- containerPadding: 0
184
- }, /* @__PURE__ */ e.createElement(k, {
185
- items: d
186
- }, (m) => /* @__PURE__ */ e.createElement(M, {
187
- id: m.id
188
- }, m.formatted))));
189
- };
190
- g.Day = Fe;
191
- g.PreviousTrigger = Ae;
192
- g.NextTrigger = Re;
193
- g.MonthTrigger = Oe;
194
- g.YearTrigger = xe;
195
- a.Label = pe;
196
- a.Control = Ie;
197
- a.Input = Le;
198
- a.Trigger = Pe;
199
- a.Calendar = g;
200
- a.Description = ge;
201
- a.Error = Ee;
202
- function ke(t) {
203
- if (!t)
204
- return null;
205
- try {
206
- return J(t);
207
- } catch {
208
- return null;
209
- }
210
- }
211
- function Me(t) {
212
- if (!t)
213
- return null;
214
- const r = String(t.year).padStart(4, "0"), n = String(t.month).padStart(2, "0"), l = String(t.day).padStart(2, "0");
215
- return `${r}-${n}-${l}`;
216
- }
217
- function we(t) {
218
- var r;
219
- try {
220
- return ((r = new Intl.DateTimeFormat(t, {
221
- year: "numeric",
222
- month: "2-digit",
223
- day: "2-digit"
224
- }).formatToParts(/* @__PURE__ */ new Date()).find((l) => l.type !== "literal")) == null ? void 0 : r.type) ?? "month";
225
- } catch {
226
- return "month";
227
- }
228
- }
229
- function Ye(t) {
230
- return [
231
- "sun",
232
- "mon",
233
- "tue",
234
- "wed",
235
- "thu",
236
- "fri",
237
- "sat"
238
- ][t] || "mon";
239
- }
240
- const Be = (t) => /* @__PURE__ */ e.createElement("svg", {
241
- viewBox: "0 0 24 24",
242
- fill: "none",
243
- width: 14,
244
- height: 14,
245
- "aria-hidden": "true",
246
- ...t
247
- }, /* @__PURE__ */ e.createElement("path", {
248
- d: "M7 2v2M17 2v2M3 8h18M5 4h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Z",
249
- stroke: "currentColor",
250
- strokeWidth: "1.5",
251
- strokeLinecap: "round",
252
- strokeLinejoin: "round"
253
- })), qe = "_control_1xqv5_1", Ve = "_segments_1xqv5_14", Ue = "_trigger_1xqv5_65", We = "_calendarPopover_1xqv5_96", Ke = "_calendarDay_1xqv5_219", $e = "_mobile_1xqv5_262", h = {
254
- control: qe,
255
- segments: Ve,
256
- trigger: Ue,
257
- calendarPopover: We,
258
- calendarDay: Ke,
259
- mobile: $e
260
- }, He = ({ content: t, locale: r }) => /* @__PURE__ */ e.createElement(G, {
261
- content: t,
262
- locale: r
263
- }), je = {
264
- left: 90,
265
- right: -90
266
- }, P = ({ direction: t }) => /* @__PURE__ */ e.createElement(N, {
267
- style: {
268
- transform: `rotate(${je[t]}deg)`
269
- }
270
- }), ut = () => {
271
- const { isMobile: t } = S();
272
- return /* @__PURE__ */ e.createElement(a, null, /* @__PURE__ */ e.createElement(a.Label, {
273
- className: y(ye, p.label)
274
- }, /* @__PURE__ */ e.createElement(a.Label.Required, {
275
- className: y(he, p.requiredMark)
276
- })), /* @__PURE__ */ e.createElement(a.Control, {
277
- className: y(ve, p.input, h.control)
278
- }, /* @__PURE__ */ e.createElement(a.Trigger, {
279
- className: h.trigger
280
- }, /* @__PURE__ */ e.createElement(Be, null)), /* @__PURE__ */ e.createElement(a.Input, {
281
- className: h.segments
282
- })), /* @__PURE__ */ e.createElement(a.Calendar, {
283
- className: y(Se, p.selectPopover, h.calendarPopover, {
284
- [h.mobile]: t
285
- })
286
- }, /* @__PURE__ */ e.createElement(a.Calendar.PreviousTrigger, null, /* @__PURE__ */ e.createElement(P, {
287
- direction: "left"
288
- })), /* @__PURE__ */ e.createElement(a.Calendar.MonthTrigger, null, /* @__PURE__ */ e.createElement(N, {
289
- className: p.dropdownIcon
290
- })), /* @__PURE__ */ e.createElement(a.Calendar.YearTrigger, null, /* @__PURE__ */ e.createElement(N, {
291
- className: p.dropdownIcon
292
- })), /* @__PURE__ */ e.createElement(a.Calendar.NextTrigger, null, /* @__PURE__ */ e.createElement(P, {
293
- direction: "right"
294
- })), /* @__PURE__ */ e.createElement(a.Calendar.Day, {
295
- className: h.calendarDay
296
- })), /* @__PURE__ */ e.createElement(a.Error, {
297
- className: y(Te, p.error)
298
- }, /* @__PURE__ */ e.createElement(Ce, null), /* @__PURE__ */ e.createElement(a.Error.Text, null)), /* @__PURE__ */ e.createElement(a.Description, {
299
- className: y(be, p.description)
300
- }, He));
301
- };
302
- export {
303
- ut as D
304
- };
@@ -1,57 +0,0 @@
1
- import { useContext as l, useMemo as p } from "react";
2
- import { ae as E, l as u, ac as c, F as t } from "./form-Lv-a47BN.js";
3
- import _ from "classnames";
4
- import { s as a } from "./field-rac.module-DobpyqOd.js";
5
- import { l as S } from "./form-element-classes-CLZXu-91.js";
6
- import { u as T } from "./use-element-state-class-name-CITSBXT8.js";
7
- const d = [
8
- t.DROPDOWN,
9
- t.DEXT_DROPDOWN,
10
- t.SERVICES_DROPDOWN,
11
- t.DATE_INPUT,
12
- t.CONTACTS_BIRTHDATE,
13
- t.DATE_TIME_INPUT,
14
- t.DEXT_DATE_TIME_INPUT
15
- ], N = [
16
- t.PHONE,
17
- t.CONTACTS_PHONE,
18
- t.BOOKINGS_PHONE,
19
- t.DEXT_PHONE
20
- ], m = [
21
- t.MULTILINE_ADDRESS,
22
- t.BOOKINGS_ADDRESS,
23
- t.ECOM_ADDRESS
24
- ], P = ({ properties: o }) => {
25
- var e, s, n, r;
26
- return ((r = (n = (s = (e = o.validation) == null ? void 0 : e.string) == null ? void 0 : s.phoneOptions) == null ? void 0 : n.allowedCountryCodes) == null ? void 0 : r.length) !== 1;
27
- }, I = ({ properties: o }) => {
28
- var e, s;
29
- return ((s = (e = o.fieldSettings) == null ? void 0 : e.country) == null ? void 0 : s.show) !== !1;
30
- }, C = (o, e) => N.includes(o.fieldType) ? !e && P(o) : m.includes(o.fieldType) ? I(o) : d.includes(o.fieldType), y = (o, e) => C(o, e) && !o.properties.hidden && !o.properties.disabled && !o.properties.readOnly, w = (o, e) => o.layout.row - e.layout.row || o.layout.column - e.layout.column, b = (o) => {
31
- var O;
32
- const e = ((O = E().dropdown) == null ? void 0 : O.open) === !0, s = l(u), { isMobile: n = !1 } = c(), r = p(() => {
33
- var D;
34
- return s && !s.parentId ? (D = s.fields.filter((i) => y(i, n)).sort(w)[0]) == null ? void 0 : D.id : void 0;
35
- }, [
36
- s,
37
- n
38
- ]);
39
- return e && r === o;
40
- }, R = {
41
- base: a.selectOption,
42
- selected: a.selectOptionSelected,
43
- hover: a.selectOptionHover
44
- }, f = ({ isSelected: o, isHovered: e, isFocused: s }) => ({
45
- isSelected: o,
46
- isHovered: (e || s) && !o
47
- }), g = (...o) => {
48
- const e = T({
49
- globalClasses: S,
50
- moduleClasses: R
51
- });
52
- return (s) => _(e(f(s)), o);
53
- };
54
- export {
55
- b as a,
56
- g as u
57
- };