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