@tedi-design-system/react 18.2.0-rc.2 → 18.2.0-rc.4

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 (31) hide show
  1. package/bundle-stats.html +1 -1
  2. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.cjs.js +1 -1
  3. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.es.js +1 -1
  4. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
  5. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.es.js +1 -1
  6. package/external/hoist-non-react-statics/external/react-is/index.cjs.js +1 -1
  7. package/external/hoist-non-react-statics/external/react-is/index.es.js +1 -1
  8. package/external/prop-types/external/react-is/cjs/react-is.development.cjs.js +1 -1
  9. package/external/prop-types/external/react-is/cjs/react-is.development.es.js +1 -1
  10. package/external/prop-types/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
  11. package/external/prop-types/external/react-is/cjs/react-is.production.min.es.js +1 -1
  12. package/external/prop-types/external/react-is/index.cjs.js +1 -1
  13. package/external/prop-types/external/react-is/index.es.js +1 -1
  14. package/index.css +1 -1
  15. package/package.json +1 -1
  16. package/src/tedi/components/content/calendar/calendar.cjs.js +1 -1
  17. package/src/tedi/components/content/calendar/calendar.d.ts +39 -3
  18. package/src/tedi/components/content/calendar/calendar.es.js +121 -101
  19. package/src/tedi/components/content/calendar/calendar.module.scss.cjs.js +1 -1
  20. package/src/tedi/components/content/calendar/calendar.module.scss.es.js +5 -2
  21. package/src/tedi/components/content/calendar/components/calendar-header/calendar-header.cjs.js +1 -1
  22. package/src/tedi/components/content/calendar/components/calendar-header/calendar-header.d.ts +4 -2
  23. package/src/tedi/components/content/calendar/components/calendar-header/calendar-header.es.js +42 -42
  24. package/src/tedi/components/content/calendar/components/calendar-header/calendar-header.module.scss.cjs.js +1 -1
  25. package/src/tedi/components/content/calendar/components/calendar-header/calendar-header.module.scss.es.js +1 -0
  26. package/src/tedi/components/form/date-field/date-field.cjs.js +1 -1
  27. package/src/tedi/components/form/date-field/date-field.d.ts +10 -1
  28. package/src/tedi/components/form/date-field/date-field.es.js +221 -218
  29. package/src/tedi/components/form/date-field/date-picker-modal/date-picker-modal.cjs.js +1 -1
  30. package/src/tedi/components/form/date-field/date-picker-modal/date-picker-modal.d.ts +3 -0
  31. package/src/tedi/components/form/date-field/date-picker-modal/date-picker-modal.es.js +41 -39
@@ -1,93 +1,94 @@
1
- import { jsxs as Ct, Fragment as Mt, jsx as D } from "react/jsx-runtime";
2
- import { useFloating as At, useClick as xt, useInteractions as Ft, useDismiss as vt, useRole as wt, FloatingPortal as Nt, FloatingFocusManager as kt } from "../../../../../external/@floating-ui/react/dist/floating-ui.react.es.js";
3
- import V from "../../../../../external/classnames/index.es.js";
4
- import B, { useState as _, useCallback as ue, useEffect as T, useMemo as me } from "react";
5
- import { Calendar as Pt } from "../../content/calendar/calendar.es.js";
6
- import { MultiValueField as Et } from "../multi-value-field/multi-value-field.es.js";
7
- import { TextField as Ot } from "../textfield/textfield.es.js";
8
- import g from "./date-field.module.scss.es.js";
9
- import { getLocaleDateParts as Rt, buildDateRegexSource as It, resolveRangeSelection as Vt, CALENDAR_POPOVER_OFFSET as Bt, CALENDAR_POPOVER_PADDING as $e } from "./date-field-helpers.es.js";
10
- import { DatePickerModal as Tt } from "./date-picker-modal/date-picker-modal.es.js";
11
- import { useBreakpointProps as $t } from "../../../helpers/hooks/use-breakpoint-props.es.js";
12
- import { useLabels as Lt } from "../../../providers/label-provider/use-labels.es.js";
13
- import { et as jt } from "../../../../../external/react-day-picker/dist/esm/locale/et.es.js";
14
- import Ht, { isBreakpointBelow as Le } from "../../../helpers/hooks/use-breakpoint.es.js";
15
- import { autoUpdate as Wt } from "../../../../../external/@floating-ui/dom/dist/floating-ui.dom.es.js";
16
- import { offset as Yt, flip as St, shift as Ut, size as qt } from "../../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.es.js";
17
- import { dateMatchModifiers as zt } from "../../../../../external/react-day-picker/dist/esm/utils/dateMatchModifiers.es.js";
18
- const Gt = B.forwardRef(($, v) => {
19
- const { getCurrentBreakpointProps: je } = $t($.defaultServerBreakpoint), { getLabel: z } = Lt(), {
20
- useNativePicker: He = !1,
1
+ import { jsxs as Mt, Fragment as At, jsx as D } from "react/jsx-runtime";
2
+ import { useFloating as vt, useClick as xt, useInteractions as Ft, useDismiss as wt, useRole as Nt, FloatingPortal as kt, FloatingFocusManager as Pt } from "../../../../../external/@floating-ui/react/dist/floating-ui.react.es.js";
3
+ import B from "../../../../../external/classnames/index.es.js";
4
+ import F, { useState as _, useCallback as ue, useEffect as T, useMemo as me } from "react";
5
+ import { Calendar as Et } from "../../content/calendar/calendar.es.js";
6
+ import { MultiValueField as Ot } from "../multi-value-field/multi-value-field.es.js";
7
+ import { TextField as Rt } from "../textfield/textfield.es.js";
8
+ import y from "./date-field.module.scss.es.js";
9
+ import { getLocaleDateParts as It, buildDateRegexSource as Vt, resolveRangeSelection as Bt, CALENDAR_POPOVER_OFFSET as Tt, CALENDAR_POPOVER_PADDING as Le } from "./date-field-helpers.es.js";
10
+ import { DatePickerModal as $t } from "./date-picker-modal/date-picker-modal.es.js";
11
+ import { useBreakpointProps as Lt } from "../../../helpers/hooks/use-breakpoint-props.es.js";
12
+ import { useLabels as jt } from "../../../providers/label-provider/use-labels.es.js";
13
+ import { et as Ht } from "../../../../../external/react-day-picker/dist/esm/locale/et.es.js";
14
+ import Wt, { isBreakpointBelow as je } from "../../../helpers/hooks/use-breakpoint.es.js";
15
+ import { autoUpdate as Yt } from "../../../../../external/@floating-ui/dom/dist/floating-ui.dom.es.js";
16
+ import { offset as St, flip as Ut, shift as qt, size as zt } from "../../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.es.js";
17
+ import { dateMatchModifiers as Gt } from "../../../../../external/react-day-picker/dist/esm/utils/dateMatchModifiers.es.js";
18
+ const Xt = F.forwardRef((w, N) => {
19
+ const { getCurrentBreakpointProps: He } = Lt(w.defaultServerBreakpoint), { getLabel: z } = jt(), {
20
+ useNativePicker: We = !1,
21
21
  enableCalendar: m = !0,
22
- calendarTrigger: L = "button",
22
+ calendarTrigger: $ = "button",
23
23
  numberOfMonths: G
24
- } = je($), {
24
+ } = He(w), {
25
25
  id: pe,
26
26
  mode: s = "single",
27
27
  label: he,
28
- selected: w,
28
+ selected: L,
29
29
  onSelect: a,
30
- disabled: N,
31
- disabledMatchers: k,
32
- placeholder: We,
33
- className: Ye,
34
- formatDate: f,
30
+ disabled: k,
31
+ disabledMatchers: P,
32
+ placeholder: Ye,
33
+ className: Se,
34
+ formatDate: d,
35
35
  required: j,
36
36
  showOutsideDays: ge = !0,
37
- parseDate: Se,
37
+ parseDate: Ue,
38
38
  monthYearSelectType: ye,
39
- tagsDirection: Ue,
40
- showNavigation: be = !0,
41
- selectionLevel: P = "days",
39
+ dayStatus: be,
40
+ tagsDirection: qe,
41
+ showNavigation: De = !0,
42
+ selectionLevel: E = "days",
42
43
  initialView: H,
43
- locale: De = jt,
44
+ locale: _e = Ht,
44
45
  localeCode: W = "et-EE",
45
46
  initialMonth: Y,
46
- closeOnSelect: qe,
47
- footer: _e,
47
+ closeOnSelect: ze,
48
+ footer: Ce,
48
49
  defaultValue: S,
49
50
  minDate: X,
50
51
  maxDate: J,
51
- disablePast: Ce,
52
- disableFuture: Me,
52
+ disablePast: Me,
53
+ disableFuture: Ae,
53
54
  shouldDisableMonth: K,
54
55
  shouldDisableYear: Q,
55
- readOnly: E,
56
- availableDays: Ae,
56
+ readOnly: O,
57
+ availableDays: ve,
57
58
  inputProps: i,
58
59
  modal: Z = !1,
59
- modalProps: ze,
60
- modalTitle: Ge,
61
- disabledDateErrorMessage: Xe = z("dateField.disabledDateError"),
62
- invalidDateErrorMessage: Je = z("dateField.invalidDateError"),
63
- useNativePicker: Xt,
64
- enableCalendar: Jt,
65
- calendarTrigger: Kt,
66
- numberOfMonths: Qt,
67
- defaultServerBreakpoint: Zt,
68
- sm: er,
69
- md: tr,
70
- lg: rr,
71
- xl: ar,
72
- xxl: ir,
60
+ modalProps: Ge,
61
+ modalTitle: Xe,
62
+ disabledDateErrorMessage: Je = z("dateField.disabledDateError"),
63
+ invalidDateErrorMessage: Ke = z("dateField.invalidDateError"),
64
+ useNativePicker: Jt,
65
+ enableCalendar: Kt,
66
+ calendarTrigger: Qt,
67
+ numberOfMonths: Zt,
68
+ defaultServerBreakpoint: er,
69
+ sm: tr,
70
+ md: rr,
71
+ lg: ar,
72
+ xl: ir,
73
+ xxl: or,
73
74
  ...xe
74
- } = $, c = He && s === "single", Fe = Ht($.defaultServerBreakpoint), x = Le(Fe, "md"), [Ke, y] = _(w ?? S), [p, O] = _(!1), [ee, ve] = _(!1), [Qe, we] = _(H ?? P), [te, b] = _(""), [Ne, u] = _(!1), [ke, re] = _(!1), h = m && !c && !E && (Z === !0 || typeof Z == "string" && Le(Fe, Z)), Pe = x && !h && typeof G == "number" && G > 1 ? 1 : G, d = w !== void 0, n = d ? w : Ke, ae = B.useRef(null), Ee = B.useRef(null), Ze = B.useCallback(
75
+ } = w, c = We && s === "single", Fe = Wt(w.defaultServerBreakpoint), v = je(Fe, "md"), [Qe, p] = _(L ?? S), [h, R] = _(!1), [ee, we] = _(!1), [Ze, Ne] = _(H ?? E), [te, b] = _(""), [ke, u] = _(!1), [Pe, re] = _(!1), g = m && !c && !O && (Z === !0 || typeof Z == "string" && je(Fe, Z)), Ee = v && !g && typeof G == "number" && G > 1 ? 1 : G, { current: f } = F.useRef("selected" in w), o = f ? L : Qe, ae = F.useRef(null), Oe = F.useRef(null), et = F.useCallback(
75
76
  (e) => {
76
- ae.current = e, typeof v == "function" ? v(e) : v && (v.current = e);
77
+ ae.current = e, typeof N == "function" ? N(e) : N && (N.current = e);
77
78
  },
78
- [v]
79
- ), et = (e) => {
79
+ [N]
80
+ ), tt = (e) => {
80
81
  if (!e) return "";
81
- const t = e.getFullYear(), r = String(e.getMonth() + 1).padStart(2, "0"), o = String(e.getDate()).padStart(2, "0");
82
- return `${t}-${r}-${o}`;
83
- }, tt = c && n instanceof Date ? et(n) : "", ie = ue((e, t) => e instanceof Date ? e : Array.isArray(e) && e.length > 0 ? [...e].sort((r, o) => r.getTime() - o.getTime())[0] : e && typeof e == "object" && "from" in e && e.from instanceof Date ? e.from : e && typeof e == "object" && "to" in e && e.to instanceof Date ? e.to : t ?? /* @__PURE__ */ new Date(), []), [rt, oe] = _(() => ie(n, Y));
82
+ const t = e.getFullYear(), r = String(e.getMonth() + 1).padStart(2, "0"), n = String(e.getDate()).padStart(2, "0");
83
+ return `${t}-${r}-${n}`;
84
+ }, rt = c && o instanceof Date ? tt(o) : "", ie = ue((e, t) => e instanceof Date ? e : Array.isArray(e) && e.length > 0 ? [...e].sort((r, n) => r.getTime() - n.getTime())[0] : e && typeof e == "object" && "from" in e && e.from instanceof Date ? e.from : e && typeof e == "object" && "to" in e && e.to instanceof Date ? e.to : t ?? /* @__PURE__ */ new Date(), []), [at, oe] = _(() => ie(o, Y));
84
85
  T(() => {
85
- p || oe(ie(n, Y));
86
- }, [n, Y, p, ie]), T(() => {
87
- p && we(H ?? P);
88
- }, [p, P, H]), T(() => {
89
- d && y(w);
90
- }, [w, d]);
86
+ h || oe(ie(o, Y));
87
+ }, [o, Y, h, ie]), T(() => {
88
+ h && Ne(H ?? E);
89
+ }, [h, E, H]), T(() => {
90
+ f && p(L);
91
+ }, [L, f]);
91
92
  const C = me(
92
93
  () => new Intl.DateTimeFormat(W, {
93
94
  day: "2-digit",
@@ -107,123 +108,123 @@ const Gt = B.forwardRef(($, v) => {
107
108
  return "";
108
109
  },
109
110
  [C]
110
- ), ne = qe ?? s === "single", Oe = s === "multiple" && Array.isArray(n) ? n.map((e, t) => ({
111
+ ), ne = ze ?? s === "single", Re = s === "multiple" && Array.isArray(o) ? o.map((e, t) => ({
111
112
  id: t,
112
- label: f ? f(e) : M(e),
113
+ label: d ? d(e) : M(e),
113
114
  date: e
114
115
  })) : [], U = me(() => {
115
116
  const e = [];
116
- return N && (Array.isArray(N) ? e.push(...N) : e.push(N)), k && (Array.isArray(k) ? e.push(...k) : e.push(k)), X && e.push({ before: X }), J && e.push({ after: J }), Ce && e.push({ before: /* @__PURE__ */ new Date() }), Me && e.push({ after: /* @__PURE__ */ new Date() }), K && e.push((t) => K(t)), Q && e.push((t) => Q(t)), e;
117
+ return k && (Array.isArray(k) ? e.push(...k) : e.push(k)), P && (Array.isArray(P) ? e.push(...P) : e.push(P)), X && e.push({ before: X }), J && e.push({ after: J }), Me && e.push({ before: /* @__PURE__ */ new Date() }), Ae && e.push({ after: /* @__PURE__ */ new Date() }), K && e.push((t) => K(t)), Q && e.push((t) => Q(t)), e;
117
118
  }, [
118
- N,
119
119
  k,
120
+ P,
120
121
  X,
121
122
  J,
122
- Ce,
123
123
  Me,
124
+ Ae,
124
125
  K,
125
126
  Q
126
- ]), F = ue(
127
- (e) => zt(e, U),
127
+ ]), x = ue(
128
+ (e) => Gt(e, U),
128
129
  [U]
129
- ), at = (e, t, r, o) => {
130
- const l = s === "range" ? Vt(e, n, t) : e;
131
- if (u(!1), d || y(l), a == null || a(l, t, r, o), l) {
132
- const A = f ? f(l) : M(l);
130
+ ), it = (e, t, r, n) => {
131
+ const l = s === "range" ? Bt(e, o, t) : e;
132
+ if (u(!1), f || p(l), a == null || a(l, t, r, n), l) {
133
+ const A = d ? d(l) : M(l);
133
134
  b(A);
134
135
  } else
135
136
  b("");
136
- ne && O(!1);
137
- }, it = (e) => {
138
- if (F(e)) return;
139
- const t = s === "range" ? { from: e, to: void 0 } : s === "multiple" ? [...Array.isArray(n) ? n : [], e] : e;
140
- u(!1), d || y(t), a == null || a(t, e, {}, {});
141
- const r = f ? f(t) : M(t);
142
- b(r), ne && O(!1);
143
- }, ot = me(() => {
144
- const e = Rt(C), t = new RegExp(`^${It(e)}$`), { fieldOrder: r } = e;
145
- return (o) => {
146
- const l = o.match(t);
137
+ ne && R(!1);
138
+ }, ot = (e) => {
139
+ if (x(e)) return;
140
+ const t = s === "range" ? { from: e, to: void 0 } : s === "multiple" ? [...Array.isArray(o) ? o : [], e] : e;
141
+ u(!1), f || p(t), a == null || a(t, e, {}, {});
142
+ const r = d ? d(t) : M(t);
143
+ b(r), ne && R(!1);
144
+ }, nt = me(() => {
145
+ const e = It(C), t = new RegExp(`^${Vt(e)}$`), { fieldOrder: r } = e;
146
+ return (n) => {
147
+ const l = n.match(t);
147
148
  if (!l) return;
148
149
  const A = {};
149
- r.forEach((Dt, _t) => {
150
- A[Dt] = Number(l[_t + 1]);
150
+ r.forEach((_t, Ct) => {
151
+ A[_t] = Number(l[Ct + 1]);
151
152
  });
152
153
  const { day: fe, month: de, year: ce } = A;
153
154
  if (fe === void 0 || de === void 0 || ce === void 0) return;
154
- const I = new Date(ce, de - 1, fe);
155
- if (!(isNaN(I.getTime()) || I.getFullYear() !== ce || I.getMonth() !== de - 1 || I.getDate() !== fe))
156
- return I;
155
+ const V = new Date(ce, de - 1, fe);
156
+ if (!(isNaN(V.getTime()) || V.getFullYear() !== ce || V.getMonth() !== de - 1 || V.getDate() !== fe))
157
+ return V;
157
158
  };
158
- }, [C]), Re = (e) => (Se ?? (s === "single" ? ot : () => {
159
- }))(e), Ie = (e) => s === "single" && e instanceof Date || s === "multiple" && Array.isArray(e) || s === "range" && !!e && !Array.isArray(e) && "from" in e, nt = (e) => {
159
+ }, [C]), Ie = (e) => (Ue ?? (s === "single" ? nt : () => {
160
+ }))(e), Ve = (e) => s === "single" && e instanceof Date || s === "multiple" && Array.isArray(e) || s === "range" && !!e && !Array.isArray(e) && "from" in e, st = (e) => {
160
161
  if (b(e), re(!1), e.trim() === "") {
161
- u(!1);
162
+ u(!1), o !== void 0 && (f || p(void 0), a == null || a(void 0, void 0, {}, {}));
162
163
  return;
163
164
  }
164
- const t = Re(e);
165
- if (!Ie(t)) {
165
+ const t = Ie(e);
166
+ if (!Ve(t)) {
166
167
  u(!1);
167
168
  return;
168
169
  }
169
- const o = t && !Array.isArray(t) && "from" in t ? t : null;
170
- if (t instanceof Date && F(t) || Array.isArray(t) && t.some((A) => A instanceof Date && F(A)) || !!o && (o.from && F(o.from) || o.to && F(o.to))) {
170
+ const n = t && !Array.isArray(t) && "from" in t ? t : null;
171
+ if (t instanceof Date && x(t) || Array.isArray(t) && t.some((A) => A instanceof Date && x(A)) || !!n && (n.from && x(n.from) || n.to && x(n.to))) {
171
172
  u(!0);
172
173
  return;
173
174
  }
174
- u(!1), d || y(t), a == null || a(t, t, {}, {}), t instanceof Date && oe(t), ne && O(!1);
175
- }, st = () => {
175
+ u(!1), f || p(t), a == null || a(t, t, {}, {}), t instanceof Date && oe(t), ne && R(!1);
176
+ }, lt = () => {
176
177
  if (te.trim() === "") {
177
178
  re(!1);
178
179
  return;
179
180
  }
180
- re(!Ie(Re(te)));
181
+ re(!Ve(Ie(te)));
181
182
  };
182
183
  T(() => {
183
- if (d) {
184
- const e = f ? f(n) : M(n);
184
+ if (f) {
185
+ const e = d ? d(o) : M(o);
185
186
  b(e);
186
187
  }
187
- }, [n, d, f, M]), T(() => {
188
- if (!d && S) {
189
- const e = f ? f(S) : M(S);
188
+ }, [o, f, d, M]), T(() => {
189
+ if (!f && S) {
190
+ const e = d ? d(S) : M(S);
190
191
  b(e);
191
192
  }
192
193
  }, []);
193
- const lt = At({
194
- open: p,
195
- onOpenChange: O,
196
- placement: L === "input" ? "bottom-start" : "bottom-end",
194
+ const ft = vt({
195
+ open: h,
196
+ onOpenChange: R,
197
+ placement: $ === "input" ? "bottom-start" : "bottom-end",
197
198
  middleware: [
198
- Yt(Bt),
199
- St(),
200
- Ut({ padding: $e }),
201
- qt({
202
- padding: $e,
199
+ St(Tt),
200
+ Ut(),
201
+ qt({ padding: Le }),
202
+ zt({
203
+ padding: Le,
203
204
  apply({ availableWidth: e, elements: t }) {
204
205
  const r = t.floating;
205
- if (r.style.width = "", r.style.maxWidth = "", r.style.overflowX = "", x) return;
206
+ if (r.style.width = "", r.style.maxWidth = "", r.style.overflowX = "", v) return;
206
207
  r.style.width = "max-content", r.getBoundingClientRect().width > e && (r.style.width = "min-content", r.style.maxWidth = `${e}px`);
207
208
  }
208
209
  })
209
210
  ],
210
- whileElementsMounted: Wt
211
- }), { refs: R, context: q, x: ft, y: dt, strategy: ct } = lt, ut = xt(q), Ve = Ft([
212
- ...m && !c && L === "input" && !h ? [ut] : [],
213
- vt(q, {
211
+ whileElementsMounted: Yt
212
+ }), { refs: I, context: q, x: dt, y: ct, strategy: ut } = ft, mt = xt(q), Be = Ft([
213
+ ...m && !c && $ === "input" && !g ? [mt] : [],
214
+ wt(q, {
214
215
  outsidePress: (e) => {
215
216
  const t = e.target;
216
217
  return !(t != null && t.closest('[role="menu"], [role="listbox"]'));
217
218
  }
218
219
  }),
219
- wt(q, { role: "dialog" })
220
+ Nt(q, { role: "dialog" })
220
221
  ]);
221
- B.useEffect(() => {
222
+ F.useEffect(() => {
222
223
  var t, r;
223
- const e = s === "multiple" ? ((t = Ee.current) == null ? void 0 : t.wrapper) ?? null : ((r = ae.current) == null ? void 0 : r.input) ?? null;
224
- R.setPositionReference(e ?? R.reference.current);
225
- }, [s, p, R]);
226
- const mt = () => {
224
+ const e = s === "multiple" ? ((t = Oe.current) == null ? void 0 : t.wrapper) ?? null : ((r = ae.current) == null ? void 0 : r.input) ?? null;
225
+ I.setPositionReference(e ?? I.reference.current);
226
+ }, [s, h, I]);
227
+ const pt = () => {
227
228
  var t;
228
229
  const e = (t = ae.current) == null ? void 0 : t.input;
229
230
  if (e) {
@@ -236,181 +237,183 @@ const Gt = B.forwardRef(($, v) => {
236
237
  e.focus();
237
238
  }
238
239
  }, se = () => {
239
- !m || E || (c ? mt() : h ? ve(!0) : O((e) => !e));
240
- }, pt = (e) => {
241
- if (u(!1), d || y(e), a == null || a(e, e, {}, {}), e) {
242
- const t = f ? f(e) : M(e);
240
+ !m || O || (c ? pt() : g ? we(!0) : R((e) => !e));
241
+ }, ht = (e) => {
242
+ if (u(!1), f || p(e), a == null || a(e, e, {}, {}), e) {
243
+ const t = d ? d(e) : M(e);
243
244
  b(t);
244
245
  } else
245
246
  b("");
246
- }, ht = (e) => {
247
+ }, gt = (e) => {
247
248
  if (!e) {
248
- u(!1), d || y(void 0), a == null || a(void 0, void 0, {}, {});
249
+ u(!1), f || p(void 0), a == null || a(void 0, void 0, {}, {});
249
250
  return;
250
251
  }
251
- const [t, r, o] = e.split("-").map(Number);
252
- if (!t || !r || !o) return;
253
- const l = new Date(t, r - 1, o);
252
+ const [t, r, n] = e.split("-").map(Number);
253
+ if (!t || !r || !n) return;
254
+ const l = new Date(t, r - 1, n);
254
255
  if (!Number.isNaN(l.getTime())) {
255
- if (F(l)) {
256
+ if (x(l)) {
256
257
  u(!0);
257
258
  return;
258
259
  }
259
- u(!1), d || y(l), a == null || a(l, l, {}, {});
260
+ u(!1), f || p(l), a == null || a(l, l, {}, {});
260
261
  }
261
- }, gt = Ve.getReferenceProps(
262
- h && L === "input" ? { onClick: () => se() } : void 0
262
+ }, yt = Be.getReferenceProps(
263
+ g && $ === "input" ? { onClick: () => se() } : void 0
263
264
  ), {
264
- role: or,
265
- "aria-expanded": nr,
266
- "aria-haspopup": sr,
267
- "aria-controls": yt,
268
- ...bt
269
- } = gt, Be = h ? void 0 : yt, le = z("dateField.openCalendar"), Te = {
265
+ role: nr,
266
+ "aria-expanded": sr,
267
+ "aria-haspopup": lr,
268
+ "aria-controls": bt,
269
+ ...Dt
270
+ } = yt, Te = g ? void 0 : bt, le = z("dateField.openCalendar"), $e = {
270
271
  "aria-label": le,
271
- "aria-expanded": h ? ee : p,
272
+ "aria-expanded": g ? ee : h,
272
273
  "aria-haspopup": "dialog",
273
- "aria-controls": Be
274
+ "aria-controls": Te
274
275
  };
275
- return /* @__PURE__ */ Ct(Mt, { children: [
276
+ return /* @__PURE__ */ Mt(At, { children: [
276
277
  /* @__PURE__ */ D(
277
278
  "div",
278
279
  {
279
- className: V(g["tedi-date-field__container"], Ye),
280
- ...bt,
281
- ref: R.setReference,
280
+ className: B(y["tedi-date-field__container"], Se),
281
+ ...Dt,
282
+ ref: I.setReference,
282
283
  children: s === "multiple" ? /* @__PURE__ */ D(
283
- Et,
284
+ Ot,
284
285
  {
285
286
  ...i,
286
- ref: Ee,
287
+ ref: Oe,
287
288
  id: pe,
288
289
  label: he,
289
- tagsDirection: Ue,
290
- values: Oe.map((e) => e.label),
290
+ tagsDirection: qe,
291
+ values: Re.map((e) => e.label),
291
292
  icon: "calendar_today",
292
293
  onIconClick: se,
293
- iconButtonProps: m ? Te : { "aria-label": le },
294
+ iconButtonProps: m ? $e : { "aria-label": le },
294
295
  isClearable: !0,
295
296
  required: j,
296
297
  onChange: (e) => {
297
- if (!Array.isArray(n)) return;
298
- const t = Oe.filter((r) => e.includes(r.label)).map((r) => r.date);
299
- d || y(t), a == null || a(t, {}, {}, {});
298
+ if (!Array.isArray(o)) return;
299
+ const t = Re.filter((r) => e.includes(r.label)).map((r) => r.date);
300
+ f || p(t), a == null || a(t, {}, {}, {});
300
301
  },
301
- className: V(g["tedi-date-field__textfield"], {
302
- [g["tedi-date-field__icon--disabled"]]: !m || E
302
+ className: B(y["tedi-date-field__textfield"], {
303
+ [y["tedi-date-field__icon--disabled"]]: !m || O
303
304
  })
304
305
  }
305
306
  ) : /* @__PURE__ */ D(
306
- Ot,
307
+ Rt,
307
308
  {
308
309
  ...i,
309
- ref: Ze,
310
+ ref: et,
310
311
  id: pe,
311
312
  label: he,
312
- readOnly: E,
313
- value: c ? tt : te,
314
- placeholder: We,
313
+ readOnly: O,
314
+ value: c ? rt : te,
315
+ placeholder: Ye,
315
316
  icon: "calendar_today",
316
317
  isClearable: !0,
317
318
  onIconClick: se,
318
- iconButtonProps: m && !c ? Te : { "aria-label": le },
319
- onChange: (e) => c ? ht(e) : nt(e),
319
+ iconButtonProps: m && !c ? $e : { "aria-label": le },
320
+ onChange: (e) => c ? gt(e) : st(e),
320
321
  onBlur: (e) => {
321
322
  var t;
322
- c || st(), (t = i == null ? void 0 : i.onBlur) == null || t.call(i, e);
323
+ c || lt(), (t = i == null ? void 0 : i.onBlur) == null || t.call(i, e);
323
324
  },
324
325
  required: j,
325
- invalid: Ne || ke || (i == null ? void 0 : i.invalid),
326
+ invalid: ke || Pe || (i == null ? void 0 : i.invalid),
326
327
  helper: (() => {
327
- const e = i == null ? void 0 : i.helper, t = Ne ? Xe : ke ? Je : null, r = t ? { text: t, type: "error" } : null;
328
+ const e = i == null ? void 0 : i.helper, t = ke ? Je : Pe ? Ke : null, r = t ? { text: t, type: "error" } : null;
328
329
  return r ? e ? Array.isArray(e) ? [...e, r] : [e, r] : r : e;
329
330
  })(),
330
- className: V(g["tedi-date-field__textfield"], {
331
- [g["tedi-date-field__textfield--disabled"]]: i == null ? void 0 : i.disabled,
332
- [g["tedi-date-field__icon--disabled"]]: !m || E
331
+ className: B(y["tedi-date-field__textfield"], {
332
+ [y["tedi-date-field__textfield--disabled"]]: i == null ? void 0 : i.disabled,
333
+ [y["tedi-date-field__icon--disabled"]]: !m || O
333
334
  }),
334
335
  input: {
335
336
  ...i == null ? void 0 : i.input,
336
337
  ...c && { type: "date" },
337
- ...m && !c && L === "input" ? {
338
+ ...m && !c && $ === "input" ? {
338
339
  role: "combobox",
339
340
  "aria-haspopup": "dialog",
340
- "aria-expanded": h ? ee : p,
341
- "aria-controls": Be
341
+ "aria-expanded": g ? ee : h,
342
+ "aria-controls": Te
342
343
  } : {}
343
344
  }
344
345
  }
345
346
  )
346
347
  }
347
348
  ),
348
- h && /* @__PURE__ */ D(
349
- Tt,
349
+ g && /* @__PURE__ */ D(
350
+ $t,
350
351
  {
351
352
  open: ee,
352
- onOpenChange: ve,
353
- value: n,
354
- onConfirm: pt,
353
+ onOpenChange: we,
354
+ value: o,
355
+ onConfirm: ht,
355
356
  mode: s,
356
- numberOfMonths: Pe,
357
- locale: De,
357
+ numberOfMonths: Ee,
358
+ locale: _e,
358
359
  localeCode: W,
359
360
  showOutsideDays: ge,
360
361
  disabledMatchers: U,
361
362
  required: j,
362
- availableDays: Ae,
363
- footer: _e,
363
+ availableDays: ve,
364
+ footer: Ce,
364
365
  monthYearSelectType: ye,
365
- showNavigation: be,
366
- selectionLevel: P,
366
+ dayStatus: be,
367
+ showNavigation: De,
368
+ selectionLevel: E,
367
369
  initialView: H,
368
370
  initialMonth: Y,
369
- modalProps: ze,
371
+ modalProps: Ge,
370
372
  ...xe,
371
- title: Ge
373
+ title: Xe
372
374
  }
373
375
  ),
374
- m && !c && !h && /* @__PURE__ */ D(Nt, { children: p && /* @__PURE__ */ D(kt, { context: q, modal: !1, initialFocus: -1, children: /* @__PURE__ */ D(
376
+ m && !c && !g && /* @__PURE__ */ D(kt, { children: h && /* @__PURE__ */ D(Pt, { context: q, modal: !1, initialFocus: -1, children: /* @__PURE__ */ D(
375
377
  "div",
376
378
  {
377
- ref: R.setFloating,
378
- className: V({
379
- [g["tedi-date-field__calendar-popover--fullwidth"]]: x
379
+ ref: I.setFloating,
380
+ className: B({
381
+ [y["tedi-date-field__calendar-popover--fullwidth"]]: v
380
382
  }),
381
- ...Ve.getFloatingProps({
383
+ ...Be.getFloatingProps({
382
384
  style: {
383
- position: ct,
384
- top: dt ?? 0,
385
- left: x ? 0 : ft ?? 0,
386
- right: x ? 0 : void 0
385
+ position: ut,
386
+ top: ct ?? 0,
387
+ left: v ? 0 : dt ?? 0,
388
+ right: v ? 0 : void 0
387
389
  }
388
390
  }),
389
391
  children: /* @__PURE__ */ D(
390
- Pt,
392
+ Et,
391
393
  {
392
394
  ...xe,
393
- numberOfMonths: Pe,
394
- view: Qe,
395
- selectionLevel: P,
396
- currentMonth: rt,
395
+ numberOfMonths: Ee,
396
+ view: Ze,
397
+ selectionLevel: E,
398
+ currentMonth: at,
397
399
  setCurrentMonth: oe,
398
- setView: we,
400
+ setView: Ne,
399
401
  mode: s,
400
- value: n,
401
- locale: De,
402
+ value: o,
403
+ locale: _e,
402
404
  localeCode: W,
403
405
  showOutsideDays: ge,
404
406
  disabledMatchers: U,
405
407
  required: j,
406
- availableDays: Ae,
407
- footer: _e,
408
+ availableDays: ve,
409
+ footer: Ce,
408
410
  monthYearSelectType: ye,
409
- showNavigation: be,
410
- handleSelect: at,
411
- applyValue: it,
412
- className: V(g["tedi-date-field__calendar"], {
413
- [g["tedi-date-field__calendar--fullwidth"]]: x
411
+ dayStatus: be,
412
+ showNavigation: De,
413
+ handleSelect: it,
414
+ applyValue: ot,
415
+ className: B(y["tedi-date-field__calendar"], {
416
+ [y["tedi-date-field__calendar--fullwidth"]]: v
414
417
  })
415
418
  }
416
419
  )
@@ -418,7 +421,7 @@ const Gt = B.forwardRef(($, v) => {
418
421
  ) }) })
419
422
  ] });
420
423
  });
421
- Gt.displayName = "DateField";
424
+ Xt.displayName = "DateField";
422
425
  export {
423
- Gt as DateField
426
+ Xt as DateField
424
427
  };