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