@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.
- 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/index.css +1 -1
- package/package.json +1 -1
- package/src/tedi/components/content/calendar/calendar.cjs.js +1 -1
- package/src/tedi/components/content/calendar/calendar.d.ts +39 -3
- package/src/tedi/components/content/calendar/calendar.es.js +121 -101
- package/src/tedi/components/content/calendar/calendar.module.scss.cjs.js +1 -1
- package/src/tedi/components/content/calendar/calendar.module.scss.es.js +5 -2
- package/src/tedi/components/content/calendar/components/calendar-header/calendar-header.cjs.js +1 -1
- package/src/tedi/components/content/calendar/components/calendar-header/calendar-header.d.ts +4 -2
- package/src/tedi/components/content/calendar/components/calendar-header/calendar-header.es.js +42 -42
- package/src/tedi/components/content/calendar/components/calendar-header/calendar-header.module.scss.cjs.js +1 -1
- package/src/tedi/components/content/calendar/components/calendar-header/calendar-header.module.scss.es.js +1 -0
- package/src/tedi/components/form/date-field/date-field.cjs.js +1 -1
- package/src/tedi/components/form/date-field/date-field.d.ts +10 -1
- package/src/tedi/components/form/date-field/date-field.es.js +221 -218
- package/src/tedi/components/form/date-field/date-picker-modal/date-picker-modal.cjs.js +1 -1
- package/src/tedi/components/form/date-field/date-picker-modal/date-picker-modal.d.ts +3 -0
- 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
|
|
2
|
-
import { useFloating as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { Calendar as
|
|
6
|
-
import { MultiValueField as
|
|
7
|
-
import { TextField as
|
|
8
|
-
import
|
|
9
|
-
import { getLocaleDateParts as
|
|
10
|
-
import { DatePickerModal as
|
|
11
|
-
import { useBreakpointProps as
|
|
12
|
-
import { useLabels as
|
|
13
|
-
import { et as
|
|
14
|
-
import
|
|
15
|
-
import { autoUpdate as
|
|
16
|
-
import { offset as
|
|
17
|
-
import { dateMatchModifiers as
|
|
18
|
-
const
|
|
19
|
-
const { getCurrentBreakpointProps:
|
|
20
|
-
useNativePicker:
|
|
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:
|
|
22
|
+
calendarTrigger: $ = "button",
|
|
23
23
|
numberOfMonths: G
|
|
24
|
-
} =
|
|
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
|
-
parseDate:
|
|
37
|
+
parseDate: Ue,
|
|
38
38
|
monthYearSelectType: ye,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
dayStatus: be,
|
|
40
|
+
tagsDirection: qe,
|
|
41
|
+
showNavigation: De = !0,
|
|
42
|
+
selectionLevel: E = "days",
|
|
42
43
|
initialView: H,
|
|
43
|
-
locale:
|
|
44
|
+
locale: _e = Ht,
|
|
44
45
|
localeCode: W = "et-EE",
|
|
45
46
|
initialMonth: Y,
|
|
46
|
-
closeOnSelect:
|
|
47
|
-
footer:
|
|
47
|
+
closeOnSelect: ze,
|
|
48
|
+
footer: Ce,
|
|
48
49
|
defaultValue: S,
|
|
49
50
|
minDate: X,
|
|
50
51
|
maxDate: J,
|
|
51
|
-
disablePast:
|
|
52
|
-
disableFuture:
|
|
52
|
+
disablePast: Me,
|
|
53
|
+
disableFuture: Ae,
|
|
53
54
|
shouldDisableMonth: K,
|
|
54
55
|
shouldDisableYear: Q,
|
|
55
|
-
readOnly:
|
|
56
|
-
availableDays:
|
|
56
|
+
readOnly: O,
|
|
57
|
+
availableDays: ve,
|
|
57
58
|
inputProps: i,
|
|
58
59
|
modal: Z = !1,
|
|
59
|
-
modalProps:
|
|
60
|
-
modalTitle:
|
|
61
|
-
disabledDateErrorMessage:
|
|
62
|
-
invalidDateErrorMessage:
|
|
63
|
-
useNativePicker:
|
|
64
|
-
enableCalendar:
|
|
65
|
-
calendarTrigger:
|
|
66
|
-
numberOfMonths:
|
|
67
|
-
defaultServerBreakpoint:
|
|
68
|
-
sm:
|
|
69
|
-
md:
|
|
70
|
-
lg:
|
|
71
|
-
xl:
|
|
72
|
-
xxl:
|
|
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
|
-
} =
|
|
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
|
|
77
|
+
ae.current = e, typeof N == "function" ? N(e) : N && (N.current = e);
|
|
77
78
|
},
|
|
78
|
-
[
|
|
79
|
-
),
|
|
79
|
+
[N]
|
|
80
|
+
), tt = (e) => {
|
|
80
81
|
if (!e) return "";
|
|
81
|
-
const t = e.getFullYear(), r = String(e.getMonth() + 1).padStart(2, "0"),
|
|
82
|
-
return `${t}-${r}-${
|
|
83
|
-
},
|
|
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
|
-
|
|
86
|
-
}, [
|
|
87
|
-
|
|
88
|
-
}, [
|
|
89
|
-
|
|
90
|
-
}, [
|
|
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 =
|
|
111
|
+
), ne = ze ?? s === "single", Re = s === "multiple" && Array.isArray(o) ? o.map((e, t) => ({
|
|
111
112
|
id: t,
|
|
112
|
-
label:
|
|
113
|
+
label: d ? d(e) : M(e),
|
|
113
114
|
date: e
|
|
114
115
|
})) : [], U = me(() => {
|
|
115
116
|
const e = [];
|
|
116
|
-
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;
|
|
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
|
-
]),
|
|
127
|
-
(e) =>
|
|
127
|
+
]), x = ue(
|
|
128
|
+
(e) => Gt(e, U),
|
|
128
129
|
[U]
|
|
129
|
-
),
|
|
130
|
-
const l = s === "range" ?
|
|
131
|
-
if (u(!1),
|
|
132
|
-
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);
|
|
133
134
|
b(A);
|
|
134
135
|
} else
|
|
135
136
|
b("");
|
|
136
|
-
ne &&
|
|
137
|
-
},
|
|
138
|
-
if (
|
|
139
|
-
const t = s === "range" ? { from: e, to: void 0 } : s === "multiple" ? [...Array.isArray(
|
|
140
|
-
u(!1),
|
|
141
|
-
const r =
|
|
142
|
-
b(r), ne &&
|
|
143
|
-
},
|
|
144
|
-
const e =
|
|
145
|
-
return (
|
|
146
|
-
const l =
|
|
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((
|
|
150
|
-
A[
|
|
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
|
|
155
|
-
if (!(isNaN(
|
|
156
|
-
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;
|
|
157
158
|
};
|
|
158
|
-
}, [C]),
|
|
159
|
-
}))(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 =
|
|
165
|
-
if (!
|
|
165
|
+
const t = Ie(e);
|
|
166
|
+
if (!Ve(t)) {
|
|
166
167
|
u(!1);
|
|
167
168
|
return;
|
|
168
169
|
}
|
|
169
|
-
const
|
|
170
|
-
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))) {
|
|
171
172
|
u(!0);
|
|
172
173
|
return;
|
|
173
174
|
}
|
|
174
|
-
u(!1),
|
|
175
|
-
},
|
|
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(
|
|
181
|
+
re(!Ve(Ie(te)));
|
|
181
182
|
};
|
|
182
183
|
T(() => {
|
|
183
|
-
if (
|
|
184
|
-
const e =
|
|
184
|
+
if (f) {
|
|
185
|
+
const e = d ? d(o) : M(o);
|
|
185
186
|
b(e);
|
|
186
187
|
}
|
|
187
|
-
}, [
|
|
188
|
-
if (!
|
|
189
|
-
const e =
|
|
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
|
|
194
|
-
open:
|
|
195
|
-
onOpenChange:
|
|
196
|
-
placement:
|
|
194
|
+
const ft = vt({
|
|
195
|
+
open: h,
|
|
196
|
+
onOpenChange: R,
|
|
197
|
+
placement: $ === "input" ? "bottom-start" : "bottom-end",
|
|
197
198
|
middleware: [
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
padding:
|
|
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 = "",
|
|
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:
|
|
211
|
-
}), { refs:
|
|
212
|
-
...m && !c &&
|
|
213
|
-
|
|
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
|
-
|
|
220
|
+
Nt(q, { role: "dialog" })
|
|
220
221
|
]);
|
|
221
|
-
|
|
222
|
+
F.useEffect(() => {
|
|
222
223
|
var t, r;
|
|
223
|
-
const e = s === "multiple" ? ((t =
|
|
224
|
-
|
|
225
|
-
}, [s,
|
|
226
|
-
const
|
|
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 ||
|
|
240
|
-
},
|
|
241
|
-
if (u(!1),
|
|
242
|
-
const t =
|
|
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
|
-
},
|
|
247
|
+
}, gt = (e) => {
|
|
247
248
|
if (!e) {
|
|
248
|
-
u(!1),
|
|
249
|
+
u(!1), f || p(void 0), a == null || a(void 0, void 0, {}, {});
|
|
249
250
|
return;
|
|
250
251
|
}
|
|
251
|
-
const [t, r,
|
|
252
|
-
if (!t || !r || !
|
|
253
|
-
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);
|
|
254
255
|
if (!Number.isNaN(l.getTime())) {
|
|
255
|
-
if (
|
|
256
|
+
if (x(l)) {
|
|
256
257
|
u(!0);
|
|
257
258
|
return;
|
|
258
259
|
}
|
|
259
|
-
u(!1),
|
|
260
|
+
u(!1), f || p(l), a == null || a(l, l, {}, {});
|
|
260
261
|
}
|
|
261
|
-
},
|
|
262
|
-
|
|
262
|
+
}, yt = Be.getReferenceProps(
|
|
263
|
+
g && $ === "input" ? { onClick: () => se() } : void 0
|
|
263
264
|
), {
|
|
264
|
-
role:
|
|
265
|
-
"aria-expanded":
|
|
266
|
-
"aria-haspopup":
|
|
267
|
-
"aria-controls":
|
|
268
|
-
...
|
|
269
|
-
} =
|
|
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":
|
|
272
|
+
"aria-expanded": g ? ee : h,
|
|
272
273
|
"aria-haspopup": "dialog",
|
|
273
|
-
"aria-controls":
|
|
274
|
+
"aria-controls": Te
|
|
274
275
|
};
|
|
275
|
-
return /* @__PURE__ */
|
|
276
|
+
return /* @__PURE__ */ Mt(At, { children: [
|
|
276
277
|
/* @__PURE__ */ D(
|
|
277
278
|
"div",
|
|
278
279
|
{
|
|
279
|
-
className:
|
|
280
|
-
...
|
|
281
|
-
ref:
|
|
280
|
+
className: B(y["tedi-date-field__container"], Se),
|
|
281
|
+
...Dt,
|
|
282
|
+
ref: I.setReference,
|
|
282
283
|
children: s === "multiple" ? /* @__PURE__ */ D(
|
|
283
|
-
|
|
284
|
+
Ot,
|
|
284
285
|
{
|
|
285
286
|
...i,
|
|
286
|
-
ref:
|
|
287
|
+
ref: Oe,
|
|
287
288
|
id: pe,
|
|
288
289
|
label: he,
|
|
289
|
-
tagsDirection:
|
|
290
|
-
values:
|
|
290
|
+
tagsDirection: qe,
|
|
291
|
+
values: Re.map((e) => e.label),
|
|
291
292
|
icon: "calendar_today",
|
|
292
293
|
onIconClick: se,
|
|
293
|
-
iconButtonProps: m ?
|
|
294
|
+
iconButtonProps: m ? $e : { "aria-label": le },
|
|
294
295
|
isClearable: !0,
|
|
295
296
|
required: j,
|
|
296
297
|
onChange: (e) => {
|
|
297
|
-
if (!Array.isArray(
|
|
298
|
-
const t =
|
|
299
|
-
|
|
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:
|
|
302
|
-
[
|
|
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
|
-
|
|
307
|
+
Rt,
|
|
307
308
|
{
|
|
308
309
|
...i,
|
|
309
|
-
ref:
|
|
310
|
+
ref: et,
|
|
310
311
|
id: pe,
|
|
311
312
|
label: he,
|
|
312
|
-
readOnly:
|
|
313
|
-
value: c ?
|
|
314
|
-
placeholder:
|
|
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 ?
|
|
319
|
-
onChange: (e) => c ?
|
|
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 ||
|
|
323
|
+
c || lt(), (t = i == null ? void 0 : i.onBlur) == null || t.call(i, e);
|
|
323
324
|
},
|
|
324
325
|
required: j,
|
|
325
|
-
invalid:
|
|
326
|
+
invalid: ke || Pe || (i == null ? void 0 : i.invalid),
|
|
326
327
|
helper: (() => {
|
|
327
|
-
const e = i == null ? void 0 : i.helper, t =
|
|
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:
|
|
331
|
-
[
|
|
332
|
-
[
|
|
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 &&
|
|
338
|
+
...m && !c && $ === "input" ? {
|
|
338
339
|
role: "combobox",
|
|
339
340
|
"aria-haspopup": "dialog",
|
|
340
|
-
"aria-expanded":
|
|
341
|
-
"aria-controls":
|
|
341
|
+
"aria-expanded": g ? ee : h,
|
|
342
|
+
"aria-controls": Te
|
|
342
343
|
} : {}
|
|
343
344
|
}
|
|
344
345
|
}
|
|
345
346
|
)
|
|
346
347
|
}
|
|
347
348
|
),
|
|
348
|
-
|
|
349
|
-
|
|
349
|
+
g && /* @__PURE__ */ D(
|
|
350
|
+
$t,
|
|
350
351
|
{
|
|
351
352
|
open: ee,
|
|
352
|
-
onOpenChange:
|
|
353
|
-
value:
|
|
354
|
-
onConfirm:
|
|
353
|
+
onOpenChange: we,
|
|
354
|
+
value: o,
|
|
355
|
+
onConfirm: ht,
|
|
355
356
|
mode: s,
|
|
356
|
-
numberOfMonths:
|
|
357
|
-
locale:
|
|
357
|
+
numberOfMonths: Ee,
|
|
358
|
+
locale: _e,
|
|
358
359
|
localeCode: W,
|
|
359
360
|
showOutsideDays: ge,
|
|
360
361
|
disabledMatchers: U,
|
|
361
362
|
required: j,
|
|
362
|
-
availableDays:
|
|
363
|
-
footer:
|
|
363
|
+
availableDays: ve,
|
|
364
|
+
footer: Ce,
|
|
364
365
|
monthYearSelectType: ye,
|
|
365
|
-
|
|
366
|
-
|
|
366
|
+
dayStatus: be,
|
|
367
|
+
showNavigation: De,
|
|
368
|
+
selectionLevel: E,
|
|
367
369
|
initialView: H,
|
|
368
370
|
initialMonth: Y,
|
|
369
|
-
modalProps:
|
|
371
|
+
modalProps: Ge,
|
|
370
372
|
...xe,
|
|
371
|
-
title:
|
|
373
|
+
title: Xe
|
|
372
374
|
}
|
|
373
375
|
),
|
|
374
|
-
m && !c && !
|
|
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:
|
|
378
|
-
className:
|
|
379
|
-
[
|
|
379
|
+
ref: I.setFloating,
|
|
380
|
+
className: B({
|
|
381
|
+
[y["tedi-date-field__calendar-popover--fullwidth"]]: v
|
|
380
382
|
}),
|
|
381
|
-
...
|
|
383
|
+
...Be.getFloatingProps({
|
|
382
384
|
style: {
|
|
383
|
-
position:
|
|
384
|
-
top:
|
|
385
|
-
left:
|
|
386
|
-
right:
|
|
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
|
-
|
|
392
|
+
Et,
|
|
391
393
|
{
|
|
392
394
|
...xe,
|
|
393
|
-
numberOfMonths:
|
|
394
|
-
view:
|
|
395
|
-
selectionLevel:
|
|
396
|
-
currentMonth:
|
|
395
|
+
numberOfMonths: Ee,
|
|
396
|
+
view: Ze,
|
|
397
|
+
selectionLevel: E,
|
|
398
|
+
currentMonth: at,
|
|
397
399
|
setCurrentMonth: oe,
|
|
398
|
-
setView:
|
|
400
|
+
setView: Ne,
|
|
399
401
|
mode: s,
|
|
400
|
-
value:
|
|
401
|
-
locale:
|
|
402
|
+
value: o,
|
|
403
|
+
locale: _e,
|
|
402
404
|
localeCode: W,
|
|
403
405
|
showOutsideDays: ge,
|
|
404
406
|
disabledMatchers: U,
|
|
405
407
|
required: j,
|
|
406
|
-
availableDays:
|
|
407
|
-
footer:
|
|
408
|
+
availableDays: ve,
|
|
409
|
+
footer: Ce,
|
|
408
410
|
monthYearSelectType: ye,
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
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
|
-
|
|
424
|
+
Xt.displayName = "DateField";
|
|
422
425
|
export {
|
|
423
|
-
|
|
426
|
+
Xt as DateField
|
|
424
427
|
};
|