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