@tedi-design-system/react 19.0.1-rc.2 → 19.1.0-rc.10
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/DESIGN.md +308 -0
- package/README.md +28 -0
- package/_virtual/index.es13.js +2 -2
- package/_virtual/index.es14.js +2 -2
- package/bundle-stats.html +1 -1
- package/component.manifest.json +1191 -0
- 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/external/react-is/index.cjs.js +1 -1
- package/external/react-is/index.es.js +1 -1
- package/external/toposort/index.cjs.js +1 -1
- package/external/toposort/index.es.js +1 -1
- package/index.css +1 -1
- package/package.json +2 -2
- package/src/community/components/layout/sidenav/sidenav.cjs.js +1 -1
- package/src/community/components/layout/sidenav/sidenav.es.js +38 -40
- package/src/community/components/map-components/base-map-selection/base-map-option.cjs.js +1 -1
- package/src/community/components/map-components/base-map-selection/base-map-option.d.ts +8 -5
- package/src/community/components/map-components/base-map-selection/base-map-option.es.js +63 -65
- package/src/community/components/map-components/base-map-selection/base-map-selection.cjs.js +1 -1
- package/src/community/components/map-components/base-map-selection/base-map-selection.d.ts +1 -4
- package/src/community/components/map-components/base-map-selection/base-map-selection.es.js +55 -55
- package/src/community/components/map-components/map-button/map-button.cjs.js +1 -1
- package/src/community/components/map-components/map-button/map-button.d.ts +2 -3
- package/src/community/components/map-components/map-button/map-button.es.js +37 -36
- package/src/community/components/map-components/map-dropdown/map-dropdown.cjs.js +1 -1
- package/src/community/components/map-components/map-dropdown/map-dropdown.es.js +51 -49
- package/src/community/components/vertical-stepper/step-item/step-item.d.ts +6 -0
- package/src/community/components/vertical-stepper/sub-item/sub-item.d.ts +6 -0
- package/src/community/components/vertical-stepper/vertical-stepper.d.ts +6 -0
- package/src/tedi/components/content/card/card.module.scss.cjs.js +1 -1
- package/src/tedi/components/content/card/card.module.scss.es.js +3 -2
- package/src/tedi/components/content/collapse/collapse.cjs.js +1 -1
- package/src/tedi/components/content/collapse/collapse.d.ts +9 -0
- package/src/tedi/components/content/collapse/collapse.es.js +44 -35
- package/src/tedi/components/filter/filter/filter.cjs.js +1 -1
- package/src/tedi/components/filter/filter/filter.d.ts +5 -0
- package/src/tedi/components/filter/filter/filter.es.js +154 -144
- package/src/tedi/components/filter/filter/filter.module.scss.cjs.js +1 -1
- package/src/tedi/components/filter/filter/filter.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 +12 -19
- package/src/tedi/components/form/date-field/date-field-helpers.es.js +27 -21
- package/src/tedi/components/form/date-field/date-field.cjs.js +1 -1
- package/src/tedi/components/form/date-field/date-field.d.ts +1 -1
- package/src/tedi/components/form/date-field/date-field.es.js +169 -164
- package/src/tedi/components/form/textfield/textfield.cjs.js +1 -1
- package/src/tedi/components/form/textfield/textfield.es.js +21 -21
- package/src/tedi/components/form/time-field/time-field.cjs.js +1 -1
- package/src/tedi/components/form/time-field/time-field.es.js +126 -124
- package/src/tedi/components/layout/sidenav/components/sidenav-item/sidenav-item.cjs.js +1 -1
- package/src/tedi/components/layout/sidenav/components/sidenav-item/sidenav-item.es.js +82 -85
- package/src/tedi/components/layout/sidenav/sidenav.cjs.js +1 -1
- package/src/tedi/components/layout/sidenav/sidenav.es.js +16 -16
- package/src/tedi/components/layout/top-nav/components/top-nav-item/top-nav-item.cjs.js +1 -1
- package/src/tedi/components/layout/top-nav/components/top-nav-item/top-nav-item.es.js +6 -7
- package/src/tedi/components/layout/top-nav/components/top-nav-separator/top-nav-separator.cjs.js +1 -1
- package/src/tedi/components/layout/top-nav/components/top-nav-separator/top-nav-separator.es.js +2 -2
- package/src/tedi/components/layout/top-nav/top-nav.cjs.js +1 -1
- package/src/tedi/components/layout/top-nav/top-nav.es.js +9 -8
- package/src/tedi/components/misc/affix/affix.cjs.js +1 -1
- package/src/tedi/components/misc/affix/affix.es.js +20 -8
- package/src/tedi/components/navigation/card-stepper/card-stepper-step.cjs.js +1 -0
- package/src/tedi/components/navigation/card-stepper/card-stepper-step.d.ts +86 -0
- package/src/tedi/components/navigation/card-stepper/card-stepper-step.es.js +5 -0
- package/src/tedi/components/navigation/card-stepper/card-stepper.cjs.js +1 -0
- package/src/tedi/components/navigation/card-stepper/card-stepper.d.ts +130 -0
- package/src/tedi/components/navigation/card-stepper/card-stepper.es.js +200 -0
- package/src/tedi/components/navigation/card-stepper/card-stepper.module.scss.cjs.js +1 -0
- package/src/tedi/components/navigation/card-stepper/card-stepper.module.scss.es.js +26 -0
- package/src/tedi/components/navigation/card-stepper/index.d.ts +2 -0
- package/src/tedi/components/navigation/table-of-contents/components/table-of-contents-collapsible/table-of-contents-collapsible.cjs.js +1 -1
- package/src/tedi/components/navigation/table-of-contents/components/table-of-contents-collapsible/table-of-contents-collapsible.d.ts +9 -1
- package/src/tedi/components/navigation/table-of-contents/components/table-of-contents-collapsible/table-of-contents-collapsible.es.js +82 -65
- package/src/tedi/components/navigation/table-of-contents/components/table-of-contents-item/table-of-contents-item.d.ts +6 -0
- 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.es.js +23 -28
- 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 +32 -21
- package/src/tedi/components/navigation/table-of-contents/table-of-contents.es.js +58 -55
- package/src/tedi/components/navigation/table-of-contents/table-of-contents.module.scss.cjs.js +1 -1
- package/src/tedi/components/navigation/table-of-contents/table-of-contents.module.scss.es.js +4 -1
- package/src/tedi/components/navigation/vertical-stepper/index.d.ts +3 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-context.cjs.js +1 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-context.d.ts +10 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-context.es.js +8 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-item.cjs.js +1 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-item.d.ts +74 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-item.es.js +109 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-sub-item.cjs.js +1 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-sub-item.d.ts +47 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-sub-item.es.js +65 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper.cjs.js +1 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper.d.ts +28 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper.es.js +32 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper.module.scss.cjs.js +1 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper.module.scss.es.js +34 -0
- package/src/tedi/components/overlays/dropdown/dropdown.cjs.js +1 -1
- package/src/tedi/components/overlays/dropdown/dropdown.d.ts +8 -0
- package/src/tedi/components/overlays/dropdown/dropdown.es.js +82 -74
- package/src/tedi/components/overlays/dropdown/dropdown.module.scss.cjs.js +1 -1
- package/src/tedi/components/overlays/dropdown/dropdown.module.scss.es.js +1 -0
- package/src/tedi/components/overlays/overlay/overlay-trigger.cjs.js +1 -1
- package/src/tedi/components/overlays/overlay/overlay-trigger.es.js +22 -21
- package/src/tedi/components/overlays/sheet/sheet.cjs.js +1 -0
- package/src/tedi/components/overlays/sheet/sheet.d.ts +65 -0
- package/src/tedi/components/overlays/sheet/sheet.es.js +41 -0
- package/src/tedi/components/overlays/sheet/sheet.module.scss.cjs.js +1 -0
- package/src/tedi/components/overlays/sheet/sheet.module.scss.es.js +8 -0
- package/src/tedi/helpers/hooks/use-safe-id.cjs.js +1 -0
- package/src/tedi/helpers/hooks/use-safe-id.d.ts +16 -0
- package/src/tedi/helpers/hooks/use-safe-id.es.js +5 -0
- package/src/tedi/helpers/index.d.ts +1 -0
- package/src/tedi/index.d.ts +2 -0
- package/src/tedi/providers/label-provider/labels-map.cjs.js +1 -1
- package/src/tedi/providers/label-provider/labels-map.d.ts +56 -0
- package/src/tedi/providers/label-provider/labels-map.es.js +127 -71
- package/tedi.cjs.js +1 -1
- package/tedi.es.js +284 -272
|
@@ -1,235 +1,245 @@
|
|
|
1
1
|
import { jsxs as p, Fragment as g, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { Icon as
|
|
5
|
-
import { Button as
|
|
6
|
-
import { Checkbox as
|
|
7
|
-
import { Search as
|
|
2
|
+
import Q from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import Qe, { forwardRef as Ue, useContext as Ve, useRef as Xe, useState as P, useMemo as _, useEffect as Ye, useCallback as y } from "react";
|
|
4
|
+
import { Icon as pe } from "../../base/icon/icon.es.js";
|
|
5
|
+
import { Button as U } from "../../buttons/button/button.es.js";
|
|
6
|
+
import { Checkbox as ve } from "../../form/checkbox/checkbox.es.js";
|
|
7
|
+
import { Search as et } from "../../form/search/search.es.js";
|
|
8
8
|
import { Dropdown as c } from "../../overlays/dropdown/dropdown.es.js";
|
|
9
|
-
import { StatusBadge as
|
|
10
|
-
import
|
|
11
|
-
import { FilterGroupContext as
|
|
12
|
-
import { useBreakpointProps as
|
|
13
|
-
import { useLabels as
|
|
14
|
-
const
|
|
15
|
-
const v =
|
|
16
|
-
return
|
|
17
|
-
},
|
|
18
|
-
const { getCurrentBreakpointProps:
|
|
9
|
+
import { StatusBadge as tt } from "../../tags/status-badge/status-badge.es.js";
|
|
10
|
+
import r from "./filter.module.scss.es.js";
|
|
11
|
+
import { FilterGroupContext as lt } from "./filter-group-context.es.js";
|
|
12
|
+
import { useBreakpointProps as rt } from "../../../helpers/hooks/use-breakpoint-props.es.js";
|
|
13
|
+
import { useLabels as it } from "../../../providers/label-provider/use-labels.es.js";
|
|
14
|
+
const be = (S) => S === "large" ? 24 : 18, nt = (S) => {
|
|
15
|
+
const v = Qe.useId();
|
|
16
|
+
return S ?? `tedi-filter-${v.replace(/[^a-zA-Z0-9-]/g, "")}`;
|
|
17
|
+
}, st = Ue((S, v) => {
|
|
18
|
+
const { getCurrentBreakpointProps: ge } = rt(S.defaultServerBreakpoint), {
|
|
19
19
|
text: w,
|
|
20
|
-
value:
|
|
21
|
-
disabled:
|
|
22
|
-
className:
|
|
23
|
-
id:
|
|
24
|
-
selected:
|
|
25
|
-
defaultSelected:
|
|
20
|
+
value: C,
|
|
21
|
+
disabled: _e = !1,
|
|
22
|
+
className: Se,
|
|
23
|
+
id: V,
|
|
24
|
+
selected: k,
|
|
25
|
+
defaultSelected: X = !1,
|
|
26
26
|
onSelectedChange: I,
|
|
27
|
-
selectedValue:
|
|
28
|
-
defaultSelectedValue:
|
|
27
|
+
selectedValue: x,
|
|
28
|
+
defaultSelectedValue: we,
|
|
29
29
|
onSelectedValueChange: d,
|
|
30
|
-
multiselect:
|
|
30
|
+
multiselect: Y = !1,
|
|
31
31
|
selectedValues: u,
|
|
32
|
-
defaultSelectedValues:
|
|
32
|
+
defaultSelectedValues: xe,
|
|
33
33
|
onSelectedValuesChange: s,
|
|
34
34
|
options: N = [],
|
|
35
|
-
searchable:
|
|
36
|
-
showSelectAll:
|
|
37
|
-
selectAllLabel:
|
|
38
|
-
showClear:
|
|
39
|
-
clearLabel:
|
|
40
|
-
preserveLabel:
|
|
41
|
-
children:
|
|
42
|
-
onClear:
|
|
43
|
-
prepend:
|
|
44
|
-
hidePrependWhenSelected:
|
|
45
|
-
append:
|
|
46
|
-
placement:
|
|
47
|
-
variant:
|
|
48
|
-
size:
|
|
49
|
-
searchLabel:
|
|
50
|
-
|
|
51
|
-
$
|
|
35
|
+
searchable: Ne = !1,
|
|
36
|
+
showSelectAll: Le = !1,
|
|
37
|
+
selectAllLabel: ye,
|
|
38
|
+
showClear: ee = !1,
|
|
39
|
+
clearLabel: Ce,
|
|
40
|
+
preserveLabel: te = !1,
|
|
41
|
+
children: le,
|
|
42
|
+
onClear: T,
|
|
43
|
+
prepend: R,
|
|
44
|
+
hidePrependWhenSelected: ke = !0,
|
|
45
|
+
append: G,
|
|
46
|
+
placement: Ie = "bottom-start",
|
|
47
|
+
variant: $e = "primary",
|
|
48
|
+
size: H = "default",
|
|
49
|
+
searchLabel: re,
|
|
50
|
+
maxHeight: z
|
|
51
|
+
} = ge(S), { getLabel: ie } = it(), Be = ye ?? ie("filter.select-all"), ne = Ce ?? ie("filter.clear-selection"), $ = z === void 0 ? void 0 : typeof z == "number" ? `${z}px` : z, n = Ve(lt), B = nt(V), Fe = Xe(null), D = N.length > 0, F = !!le, b = D || F, f = D && !Y, m = D && Y, O = !!(n != null && n.isManaged) && C !== void 0 && !b, j = O && !(n != null && n.multiselect), se = _e || ((n == null ? void 0 : n.disabled) ?? !1), [Oe, Pe] = P(X), [Te, oe] = P(we ?? ""), [ze, E] = P(xe ?? []);
|
|
52
|
+
F && (X || I) && k === void 0 && console.warn(
|
|
52
53
|
"[Filter] `defaultSelected` and `onSelectedChange` are not honoured in custom-content mode (when `children` is provided). Drive the selected state yourself via the controlled `selected` prop, e.g. `selected={Boolean(value)}`."
|
|
53
54
|
);
|
|
54
|
-
const
|
|
55
|
+
const A = k !== void 0 ? k : Oe, h = x !== void 0 ? x : Te, i = u !== void 0 ? u : ze, L = _(() => O ? n.isSelected(C) : m ? i.length > 0 : f ? h !== "" : A, [O, C, n, m, i, f, h, A]), M = _(() => {
|
|
55
56
|
var e;
|
|
56
57
|
return !f || !h ? null : ((e = N.find((l) => l.value === h)) == null ? void 0 : e.label) ?? null;
|
|
57
|
-
}, [f, h, N]),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}, [
|
|
61
|
-
const
|
|
62
|
-
const e =
|
|
58
|
+
}, [f, h, N]), Ae = _(() => f ? M && te ? `${w}: ${M}` : M ?? w : w, [f, M, te, w]), [W, ae] = P(!1), [Z, ce] = P("");
|
|
59
|
+
Ye(() => {
|
|
60
|
+
W || ce("");
|
|
61
|
+
}, [W]);
|
|
62
|
+
const q = _(() => {
|
|
63
|
+
const e = Z.trim().toLowerCase();
|
|
63
64
|
return e ? N.filter((l) => l.label.toLowerCase().includes(e)) : N;
|
|
64
|
-
}, [
|
|
65
|
-
if (
|
|
66
|
-
const e =
|
|
67
|
-
return e > 0 && e <
|
|
68
|
-
}, [
|
|
65
|
+
}, [Z, N]), o = _(() => q.filter((e) => !e.disabled), [q]), J = _(() => o.length === 0 ? !1 : o.every((e) => i.includes(e.value)), [o, i]), Me = _(() => {
|
|
66
|
+
if (o.length === 0) return !1;
|
|
67
|
+
const e = o.filter((l) => i.includes(l.value)).length;
|
|
68
|
+
return e > 0 && e < o.length;
|
|
69
|
+
}, [o, i]), Re = y(
|
|
69
70
|
(e) => {
|
|
70
|
-
|
|
71
|
+
Fe.current = e, typeof v == "function" ? v(e) : v && (v.current = e);
|
|
71
72
|
},
|
|
72
73
|
[v]
|
|
73
|
-
),
|
|
74
|
-
if (
|
|
75
|
-
n.selectFilter(
|
|
74
|
+
), Ge = y(() => {
|
|
75
|
+
if (O) {
|
|
76
|
+
n.selectFilter(C);
|
|
76
77
|
return;
|
|
77
78
|
}
|
|
78
|
-
const e = !
|
|
79
|
-
|
|
80
|
-
}, [
|
|
79
|
+
const e = !A;
|
|
80
|
+
k === void 0 && Pe(e), I == null || I(e);
|
|
81
|
+
}, [O, n, C, A, k, I]), He = y(
|
|
81
82
|
(e) => {
|
|
82
83
|
const l = h === e ? "" : e;
|
|
83
|
-
|
|
84
|
+
x === void 0 && oe(l), d == null || d(l);
|
|
84
85
|
},
|
|
85
|
-
[h,
|
|
86
|
-
),
|
|
86
|
+
[h, x, d]
|
|
87
|
+
), De = y(
|
|
87
88
|
(e) => {
|
|
88
|
-
const l =
|
|
89
|
-
u === void 0 &&
|
|
89
|
+
const l = i.includes(e) ? i.filter((a) => a !== e) : [...i, e];
|
|
90
|
+
u === void 0 && E(l), s == null || s(l);
|
|
90
91
|
},
|
|
91
|
-
[
|
|
92
|
-
),
|
|
92
|
+
[i, u, s]
|
|
93
|
+
), je = y(() => {
|
|
93
94
|
let e;
|
|
94
|
-
if (
|
|
95
|
-
const l = new Set(
|
|
96
|
-
e =
|
|
95
|
+
if (J) {
|
|
96
|
+
const l = new Set(o.map((a) => a.value));
|
|
97
|
+
e = i.filter((a) => !l.has(a));
|
|
97
98
|
} else {
|
|
98
|
-
const l = new Set(
|
|
99
|
-
|
|
99
|
+
const l = new Set(i);
|
|
100
|
+
o.forEach((a) => l.add(a.value)), e = [...l];
|
|
100
101
|
}
|
|
101
|
-
u === void 0 &&
|
|
102
|
-
}, [
|
|
103
|
-
|
|
102
|
+
u === void 0 && E(e), s == null || s(e);
|
|
103
|
+
}, [J, o, i, u, s]), de = y(() => {
|
|
104
|
+
F ? T == null || T() : m ? (u === void 0 && E([]), s == null || s([])) : f && (x === void 0 && oe(""), d == null || d("")), ae(!1);
|
|
104
105
|
}, [
|
|
105
|
-
|
|
106
|
-
|
|
106
|
+
F,
|
|
107
|
+
T,
|
|
107
108
|
m,
|
|
108
109
|
u,
|
|
109
110
|
s,
|
|
110
111
|
f,
|
|
111
|
-
|
|
112
|
+
x,
|
|
112
113
|
d
|
|
113
|
-
]),
|
|
114
|
-
!b &&
|
|
115
|
-
|
|
114
|
+
]), Ee = L && ke, We = j ? "radio" : void 0, Ze = j ? L : void 0, qe = !b && !j ? L : void 0, Je = /* @__PURE__ */ p(g, { children: [
|
|
115
|
+
!b && L && /* @__PURE__ */ t(pe, { className: r["tedi-filter__icon"], name: "check", size: be(H), color: "inherit" }),
|
|
116
|
+
R != null && /* @__PURE__ */ t(
|
|
116
117
|
"span",
|
|
117
118
|
{
|
|
118
|
-
className:
|
|
119
|
-
[
|
|
119
|
+
className: Q(r["tedi-filter__prepend"], {
|
|
120
|
+
[r["tedi-filter__prepend--hidden"]]: Ee
|
|
120
121
|
}),
|
|
121
|
-
children:
|
|
122
|
+
children: R
|
|
122
123
|
}
|
|
123
124
|
),
|
|
124
|
-
/* @__PURE__ */ t("span", { className:
|
|
125
|
-
|
|
126
|
-
m &&
|
|
125
|
+
/* @__PURE__ */ t("span", { className: r["tedi-filter__text"], children: Ae }),
|
|
126
|
+
G != null && /* @__PURE__ */ t("span", { className: r["tedi-filter__append"], children: G }),
|
|
127
|
+
m && L && i.length > 0 && /* @__PURE__ */ t(tt, { className: r["tedi-filter__count"], color: se ? "neutral" : "brand", children: String(i.length) }),
|
|
127
128
|
b && /* @__PURE__ */ t(
|
|
128
|
-
|
|
129
|
+
pe,
|
|
129
130
|
{
|
|
130
|
-
className:
|
|
131
|
+
className: r["tedi-filter__icon"],
|
|
131
132
|
name: "arrow_drop_down",
|
|
132
133
|
filled: !0,
|
|
133
|
-
size:
|
|
134
|
+
size: be(H),
|
|
134
135
|
color: "inherit"
|
|
135
136
|
}
|
|
136
137
|
)
|
|
137
|
-
] }),
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
),
|
|
144
|
-
|
|
138
|
+
] }), ue = Q(
|
|
139
|
+
r["tedi-filter"],
|
|
140
|
+
r[`tedi-filter--${$e}`],
|
|
141
|
+
H === "large" && r["tedi-filter--large"],
|
|
142
|
+
L && r["tedi-filter--selected"],
|
|
143
|
+
Se
|
|
144
|
+
), fe = /* @__PURE__ */ t(
|
|
145
|
+
U,
|
|
145
146
|
{
|
|
146
|
-
ref:
|
|
147
|
-
id:
|
|
147
|
+
ref: Re,
|
|
148
|
+
id: V,
|
|
148
149
|
type: "button",
|
|
149
|
-
disabled:
|
|
150
|
-
className:
|
|
151
|
-
onClick: b ? void 0 :
|
|
152
|
-
role: b ? void 0 :
|
|
153
|
-
"aria-checked":
|
|
154
|
-
"aria-pressed":
|
|
150
|
+
disabled: se,
|
|
151
|
+
className: r["tedi-filter__button"],
|
|
152
|
+
onClick: b ? void 0 : Ge,
|
|
153
|
+
role: b ? void 0 : We,
|
|
154
|
+
"aria-checked": Ze,
|
|
155
|
+
"aria-pressed": qe,
|
|
155
156
|
noStyle: !0,
|
|
156
|
-
children:
|
|
157
|
+
children: Je
|
|
157
158
|
}
|
|
158
159
|
);
|
|
159
160
|
if (!b)
|
|
160
|
-
return /* @__PURE__ */ t("div", { className:
|
|
161
|
-
const
|
|
162
|
-
const
|
|
163
|
-
return m ? /* @__PURE__ */ t(c.Item, { index:
|
|
164
|
-
|
|
161
|
+
return /* @__PURE__ */ t("div", { className: ue, children: fe });
|
|
162
|
+
const K = m && Le ? 0 : null, Ke = K !== null ? 1 : 0, me = () => q.map((e, l) => {
|
|
163
|
+
const a = m ? i.includes(e.value) : h === e.value, he = l + Ke;
|
|
164
|
+
return m ? /* @__PURE__ */ t(c.Item, { index: he, asChild: !0, disabled: e.disabled, closeOnSelect: !1, children: /* @__PURE__ */ t(
|
|
165
|
+
ve,
|
|
165
166
|
{
|
|
166
167
|
id: `${B}-option-${l}`,
|
|
167
168
|
label: e.label,
|
|
168
169
|
value: e.value,
|
|
169
|
-
checked:
|
|
170
|
+
checked: a,
|
|
170
171
|
disabled: e.disabled,
|
|
171
|
-
onChange: () =>
|
|
172
|
+
onChange: () => De(e.value),
|
|
172
173
|
name: `${B}-options`
|
|
173
174
|
}
|
|
174
175
|
) }, e.value) : /* @__PURE__ */ t(
|
|
175
176
|
c.Item,
|
|
176
177
|
{
|
|
177
|
-
index:
|
|
178
|
+
index: he,
|
|
178
179
|
disabled: e.disabled,
|
|
179
|
-
active:
|
|
180
|
-
onClick: () =>
|
|
180
|
+
active: a,
|
|
181
|
+
onClick: () => He(e.value),
|
|
181
182
|
children: e.label
|
|
182
183
|
},
|
|
183
184
|
e.value
|
|
184
185
|
);
|
|
185
186
|
});
|
|
186
|
-
return /* @__PURE__ */ t("div", { className:
|
|
187
|
-
/* @__PURE__ */ t(c.Trigger, { children:
|
|
188
|
-
/* @__PURE__ */ t(c.Content, { children:
|
|
189
|
-
/* @__PURE__ */ t(
|
|
190
|
-
|
|
187
|
+
return /* @__PURE__ */ t("div", { className: ue, children: /* @__PURE__ */ p(c, { open: W, onOpenChange: ae, placement: Ie, width: "auto", children: [
|
|
188
|
+
/* @__PURE__ */ t(c.Trigger, { children: fe }),
|
|
189
|
+
/* @__PURE__ */ t(c.Content, { children: F ? /* @__PURE__ */ p(g, { children: [
|
|
190
|
+
/* @__PURE__ */ t(
|
|
191
|
+
"div",
|
|
192
|
+
{
|
|
193
|
+
className: Q(r["tedi-filter-dropdown__custom-content"], {
|
|
194
|
+
[r["tedi-filter-dropdown__options"]]: $ !== void 0
|
|
195
|
+
}),
|
|
196
|
+
style: $ !== void 0 ? { maxHeight: $ } : void 0,
|
|
197
|
+
children: le
|
|
198
|
+
}
|
|
199
|
+
),
|
|
200
|
+
ee && /* @__PURE__ */ p(g, { children: [
|
|
191
201
|
/* @__PURE__ */ t(c.Separator, {}),
|
|
192
|
-
/* @__PURE__ */ t("div", { className:
|
|
202
|
+
/* @__PURE__ */ t("div", { className: r["tedi-filter-dropdown__clear"], children: /* @__PURE__ */ t(U, { visualType: "neutral", size: "small", type: "button", iconLeft: "refresh", onClick: de, children: ne }) })
|
|
193
203
|
] })
|
|
194
204
|
] }) : /* @__PURE__ */ p(g, { children: [
|
|
195
|
-
|
|
196
|
-
/* @__PURE__ */ t("div", { className:
|
|
197
|
-
|
|
205
|
+
Ne && /* @__PURE__ */ p(g, { children: [
|
|
206
|
+
/* @__PURE__ */ t("div", { className: r["tedi-filter-dropdown__search"], children: /* @__PURE__ */ t(
|
|
207
|
+
et,
|
|
198
208
|
{
|
|
199
209
|
id: `${B}-search`,
|
|
200
|
-
label:
|
|
210
|
+
label: re ?? w,
|
|
201
211
|
hideLabel: !0,
|
|
202
|
-
ariaLabel:
|
|
203
|
-
value:
|
|
204
|
-
onChange:
|
|
212
|
+
ariaLabel: re ?? w,
|
|
213
|
+
value: Z,
|
|
214
|
+
onChange: ce
|
|
205
215
|
}
|
|
206
216
|
) }),
|
|
207
217
|
/* @__PURE__ */ t(c.Separator, {})
|
|
208
218
|
] }),
|
|
209
|
-
|
|
210
|
-
/* @__PURE__ */ t(c.Item, { index:
|
|
211
|
-
|
|
219
|
+
K !== null && /* @__PURE__ */ p(g, { children: [
|
|
220
|
+
/* @__PURE__ */ t(c.Item, { index: K, asChild: !0, closeOnSelect: !1, children: /* @__PURE__ */ t(
|
|
221
|
+
ve,
|
|
212
222
|
{
|
|
213
223
|
id: `${B}-select-all`,
|
|
214
|
-
label:
|
|
224
|
+
label: Be,
|
|
215
225
|
value: "select-all",
|
|
216
|
-
checked:
|
|
217
|
-
indeterminate:
|
|
218
|
-
onChange:
|
|
226
|
+
checked: J,
|
|
227
|
+
indeterminate: Me,
|
|
228
|
+
onChange: je,
|
|
219
229
|
name: `${B}-select-all`
|
|
220
230
|
}
|
|
221
231
|
) }),
|
|
222
232
|
/* @__PURE__ */ t(c.Separator, {})
|
|
223
233
|
] }),
|
|
224
|
-
|
|
225
|
-
|
|
234
|
+
$ !== void 0 ? /* @__PURE__ */ t("div", { className: r["tedi-filter-dropdown__options"], style: { maxHeight: $ }, children: me() }) : me(),
|
|
235
|
+
ee && /* @__PURE__ */ p(g, { children: [
|
|
226
236
|
/* @__PURE__ */ t(c.Separator, {}),
|
|
227
|
-
/* @__PURE__ */ t("div", { className:
|
|
237
|
+
/* @__PURE__ */ t("div", { className: r["tedi-filter-dropdown__clear"], children: /* @__PURE__ */ t(U, { visualType: "neutral", size: "small", type: "button", iconLeft: "refresh", onClick: de, children: ne }) })
|
|
228
238
|
] })
|
|
229
239
|
] }) })
|
|
230
240
|
] }) });
|
|
231
241
|
});
|
|
232
|
-
|
|
242
|
+
st.displayName = "Filter";
|
|
233
243
|
export {
|
|
234
|
-
|
|
244
|
+
st as Filter
|
|
235
245
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-filter":"tedi-filter-e3f2f618","tedi-filter__button":"tedi-filter__button-b7abc5ed","tedi-filter__text":"tedi-filter__text-2c4eaab6","tedi-filter__icon":"tedi-filter__icon-1b8e93f2","tedi-filter__prepend":"tedi-filter__prepend-68dc0007","tedi-filter__append":"tedi-filter__append-bdb27679","tedi-filter__prepend--hidden":"tedi-filter__prepend--hidden-5039af1e","tedi-filter__count":"tedi-filter__count-d72acead","tedi-filter--primary":"tedi-filter--primary-837108e8","tedi-filter--selected":"tedi-filter--selected-7273f310","tedi-filter--secondary":"tedi-filter--secondary-8aaf488e","tedi-filter--large":"tedi-filter--large-f7f46174","tedi-filter-group":"tedi-filter-group-9d16304d","tedi-filter-dropdown__custom-content":"tedi-filter-dropdown__custom-content-6e851b26","tedi-filter-dropdown__search":"tedi-filter-dropdown__search-dbb4e1a3","tedi-filter-dropdown__clear":"tedi-filter-dropdown__clear-fa4e6a11"};exports.default=e;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-filter":"tedi-filter-e3f2f618","tedi-filter__button":"tedi-filter__button-b7abc5ed","tedi-filter__text":"tedi-filter__text-2c4eaab6","tedi-filter__icon":"tedi-filter__icon-1b8e93f2","tedi-filter__prepend":"tedi-filter__prepend-68dc0007","tedi-filter__append":"tedi-filter__append-bdb27679","tedi-filter__prepend--hidden":"tedi-filter__prepend--hidden-5039af1e","tedi-filter__count":"tedi-filter__count-d72acead","tedi-filter--primary":"tedi-filter--primary-837108e8","tedi-filter--selected":"tedi-filter--selected-7273f310","tedi-filter--secondary":"tedi-filter--secondary-8aaf488e","tedi-filter--large":"tedi-filter--large-f7f46174","tedi-filter-group":"tedi-filter-group-9d16304d","tedi-filter-dropdown__custom-content":"tedi-filter-dropdown__custom-content-6e851b26","tedi-filter-dropdown__search":"tedi-filter-dropdown__search-dbb4e1a3","tedi-filter-dropdown__clear":"tedi-filter-dropdown__clear-fa4e6a11","tedi-filter-dropdown__options":"tedi-filter-dropdown__options-45f2e9a4"};exports.default=e;
|
|
@@ -14,7 +14,8 @@ const e = {
|
|
|
14
14
|
"tedi-filter-group": "tedi-filter-group-9d16304d",
|
|
15
15
|
"tedi-filter-dropdown__custom-content": "tedi-filter-dropdown__custom-content-6e851b26",
|
|
16
16
|
"tedi-filter-dropdown__search": "tedi-filter-dropdown__search-dbb4e1a3",
|
|
17
|
-
"tedi-filter-dropdown__clear": "tedi-filter-dropdown__clear-fa4e6a11"
|
|
17
|
+
"tedi-filter-dropdown__clear": "tedi-filter-dropdown__clear-fa4e6a11",
|
|
18
|
+
"tedi-filter-dropdown__options": "tedi-filter-dropdown__options-45f2e9a4"
|
|
18
19
|
};
|
|
19
20
|
export {
|
|
20
21
|
e as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=4,n=8,l=e=>!!e&&!Array.isArray(e)&&!(e instanceof Date)&&"from"in e,D=(e,a,t)=>{if(t&&l(a)&&a.from&&a.to)return{from:t,to:void 0};if(!l(e))return;const r=!!e.from&&!!e.to&&e.from.getTime()===e.to.getTime(),o=l(a)&&!!a.from&&!a.to;return r&&!o?{from:e.from,to:void 0}:e},c=e=>{const a=[];return e.disabled&&(Array.isArray(e.disabled)?a.push(...e.disabled):a.push(e.disabled)),e.minDate&&a.push({before:e.minDate}),e.maxDate&&a.push({after:e.maxDate}),e.disablePast&&a.push({before:new Date}),e.disableFuture&&a.push({after:new Date}),e.shouldDisableMonth&&a.push(t=>{var r;return((r=e.shouldDisableMonth)==null?void 0:r.call(e,t))??!1}),e.shouldDisableYear&&a.push(t=>{var r;return((r=e.shouldDisableYear)==null?void 0:r.call(e,t))??!1}),a},d=e=>{const a=new Date(2099,11,31),t=e.formatToParts(a),r=[],o=[];for(const s of t)s.type==="day"||s.type==="month"||s.type==="year"?r.push(s.type):s.type==="literal"&&r.length>0&&o.length<2&&o.push(s.value);return{fieldOrder:r,separators:o}},i=({fieldOrder:e,separators:a})=>{const t=r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return e.map((r,o)=>{const s=r==="year"?"\\d{4}":"\\d{2}";return`${o>0?t(a[o-1]??""):""}(${s})`}).join("")};exports.CALENDAR_POPOVER_OFFSET=f;exports.CALENDAR_POPOVER_PADDING=n;exports.buildDateRegexSource=i;exports.buildDisabledMatchers=c;exports.getLocaleDateParts=d;exports.resolveRangeSelection=D;
|
|
@@ -13,27 +13,22 @@ export declare const CALENDAR_POPOVER_OFFSET = 4;
|
|
|
13
13
|
export declare const CALENDAR_POPOVER_PADDING = 8;
|
|
14
14
|
export type SelectedValueLike = Date | Date[] | DateRange | undefined;
|
|
15
15
|
/**
|
|
16
|
-
* Range-selection click resolver
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* start instead drags the existing end. That surprises users who expect a
|
|
20
|
-
* fresh click to begin a new range.
|
|
16
|
+
* Range-selection click resolver that fixes two quirks in react-day-picker's default `addToRange`:
|
|
17
|
+
* clicking on a completed range drags an existing end instead of starting over, and the first click
|
|
18
|
+
* on an empty range returns a same-day `{ from, to }` that reads as already-complete (issue #813).
|
|
21
19
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
20
|
+
* So: a click on a complete range starts a new one (`from` set, `to` cleared); the first click on an
|
|
21
|
+
* empty range becomes a `to`-less start (re-clicking the same day keeps a single-day range);
|
|
22
|
+
* otherwise DayPicker's result passes through.
|
|
25
23
|
*
|
|
26
24
|
* @param computed - the range react-day-picker derived from the click
|
|
27
|
-
* @param previous - the range
|
|
28
|
-
* @param clickedDay - the day
|
|
25
|
+
* @param previous - the range selected before this click
|
|
26
|
+
* @param clickedDay - the day just clicked
|
|
29
27
|
*/
|
|
30
28
|
export declare const resolveRangeSelection: (computed: SelectedValueLike, previous: SelectedValueLike, clickedDay: Date | undefined) => DateRange | undefined;
|
|
31
29
|
/**
|
|
32
|
-
* Resolves the month the calendar should
|
|
33
|
-
*
|
|
34
|
-
* `DateTimeField` (single Date or `{from, to}` range). For arrays the
|
|
35
|
-
* earliest date wins; for ranges the `from` (or `to` if `from` is unset)
|
|
36
|
-
* wins. Falls back to the explicit `fallback` and finally `new Date()`.
|
|
30
|
+
* Resolves the month the calendar should open on for any selection shape: a single `Date`, an array
|
|
31
|
+
* (earliest date wins), or a range (`from`, else `to`). Falls back to `fallback`, then `new Date()`.
|
|
37
32
|
*/
|
|
38
33
|
export declare const getInitialMonth: (val: SelectedValueLike, fallback?: Date) => Date;
|
|
39
34
|
/**
|
|
@@ -58,10 +53,8 @@ export interface DisabledMatcherInputs {
|
|
|
58
53
|
*/
|
|
59
54
|
export declare const buildDisabledMatchers: (inputs: DisabledMatcherInputs) => Matcher[];
|
|
60
55
|
/**
|
|
61
|
-
* Field order + literal separators extracted from a locale's date format
|
|
62
|
-
*
|
|
63
|
-
* `DateField` (date-only) and `DateTimeField` (date + " HH:mm") to build
|
|
64
|
-
* a regex that round-trips the displayed value in any locale.
|
|
56
|
+
* Field order + literal separators extracted from a locale's date format (via
|
|
57
|
+
* `Intl.DateTimeFormat.formatToParts`), used to build a locale-aware parsing regex.
|
|
65
58
|
*/
|
|
66
59
|
export interface LocaleDateParts {
|
|
67
60
|
fieldOrder: ('day' | 'month' | 'year')[];
|
|
@@ -1,29 +1,35 @@
|
|
|
1
|
-
const
|
|
1
|
+
const n = 4, h = 8, f = (e) => !!e && !Array.isArray(e) && !(e instanceof Date) && "from" in e, D = (e, a, t) => {
|
|
2
|
+
if (t && f(a) && a.from && a.to)
|
|
3
|
+
return { from: t, to: void 0 };
|
|
4
|
+
if (!f(e)) return;
|
|
5
|
+
const r = !!e.from && !!e.to && e.from.getTime() === e.to.getTime(), o = f(a) && !!a.from && !a.to;
|
|
6
|
+
return r && !o ? { from: e.from, to: void 0 } : e;
|
|
7
|
+
}, d = (e) => {
|
|
2
8
|
const a = [];
|
|
3
|
-
return e.disabled && (Array.isArray(e.disabled) ? a.push(...e.disabled) : a.push(e.disabled)), e.minDate && a.push({ before: e.minDate }), e.maxDate && a.push({ after: e.maxDate }), e.disablePast && a.push({ before: /* @__PURE__ */ new Date() }), e.disableFuture && a.push({ after: /* @__PURE__ */ new Date() }), e.shouldDisableMonth && a.push((
|
|
9
|
+
return e.disabled && (Array.isArray(e.disabled) ? a.push(...e.disabled) : a.push(e.disabled)), e.minDate && a.push({ before: e.minDate }), e.maxDate && a.push({ after: e.maxDate }), e.disablePast && a.push({ before: /* @__PURE__ */ new Date() }), e.disableFuture && a.push({ after: /* @__PURE__ */ new Date() }), e.shouldDisableMonth && a.push((t) => {
|
|
4
10
|
var r;
|
|
5
|
-
return ((r = e.shouldDisableMonth) == null ? void 0 : r.call(e,
|
|
6
|
-
}), e.shouldDisableYear && a.push((
|
|
11
|
+
return ((r = e.shouldDisableMonth) == null ? void 0 : r.call(e, t)) ?? !1;
|
|
12
|
+
}), e.shouldDisableYear && a.push((t) => {
|
|
7
13
|
var r;
|
|
8
|
-
return ((r = e.shouldDisableYear) == null ? void 0 : r.call(e,
|
|
14
|
+
return ((r = e.shouldDisableYear) == null ? void 0 : r.call(e, t)) ?? !1;
|
|
9
15
|
}), a;
|
|
10
|
-
},
|
|
11
|
-
const a = new Date(2099, 11, 31),
|
|
12
|
-
for (const
|
|
13
|
-
|
|
14
|
-
return { fieldOrder: r, separators:
|
|
15
|
-
},
|
|
16
|
-
const
|
|
17
|
-
return e.map((r,
|
|
18
|
-
const
|
|
19
|
-
return `${
|
|
16
|
+
}, c = (e) => {
|
|
17
|
+
const a = new Date(2099, 11, 31), t = e.formatToParts(a), r = [], o = [];
|
|
18
|
+
for (const s of t)
|
|
19
|
+
s.type === "day" || s.type === "month" || s.type === "year" ? r.push(s.type) : s.type === "literal" && r.length > 0 && o.length < 2 && o.push(s.value);
|
|
20
|
+
return { fieldOrder: r, separators: o };
|
|
21
|
+
}, i = ({ fieldOrder: e, separators: a }) => {
|
|
22
|
+
const t = (r) => r.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
23
|
+
return e.map((r, o) => {
|
|
24
|
+
const s = r === "year" ? "\\d{4}" : "\\d{2}";
|
|
25
|
+
return `${o > 0 ? t(a[o - 1] ?? "") : ""}(${s})`;
|
|
20
26
|
}).join("");
|
|
21
27
|
};
|
|
22
28
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
n as CALENDAR_POPOVER_OFFSET,
|
|
30
|
+
h as CALENDAR_POPOVER_PADDING,
|
|
31
|
+
i as buildDateRegexSource,
|
|
32
|
+
d as buildDisabledMatchers,
|
|
33
|
+
c as getLocaleDateParts,
|
|
34
|
+
D as resolveRangeSelection
|
|
29
35
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react/jsx-runtime"),A=require("../../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),I=require("../../../../../external/classnames/index.cjs.js"),a=require("react"),At=require("../../content/calendar/calendar.cjs.js"),Ft=require("../multi-value-field/multi-value-field.cjs.js"),kt=require("../textfield/textfield.cjs.js"),D=require("./date-field.module.scss.cjs.js"),v=require("./date-field-helpers.cjs.js"),vt=require("./date-picker-modal/date-picker-modal.cjs.js"),Pt=require("../../../helpers/hooks/use-breakpoint-props.cjs.js"),wt=require("../../../providers/label-provider/use-labels.cjs.js"),Nt=require("../../../../../external/react-day-picker/dist/esm/locale/et.cjs.js"),me=require("../../../helpers/hooks/use-breakpoint.cjs.js"),Et=require("../../../../../external/@floating-ui/dom/dist/floating-ui.dom.cjs.js"),G=require("../../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs.js"),Ot=require("../../../../../external/react-day-picker/dist/esm/utils/dateMatchModifiers.cjs.js"),$e=a.forwardRef((P,w)=>{const{getCurrentBreakpointProps:He}=Pt.useBreakpointProps(P.defaultServerBreakpoint),{getLabel:z}=wt.useLabels(),{useNativePicker:Ye=!1,enableCalendar:h=!0,calendarTrigger:T="button",numberOfMonths:X,clearable:pe=!0}=He(P),{id:he,mode:l="single",label:ge,selected:j,onSelect:i,disabled:N,disabledMatchers:E,placeholder:Ue,className:We,formatDate:c,required:S,showOutsideDays:be=!0,parseDate:Ge,monthYearSelectType:ye,minYear:De,maxYear:_e,dayStatus:xe,tagsDirection:ze,showNavigation:Me=!0,selectionLevel:O="days",initialView:L,locale:Ce=Nt.et,localeCode:$="et-EE",initialMonth:H,closeOnSelect:Xe,footer:Ae,defaultValue:Y,minDate:J,maxDate:K,disablePast:Fe,disableFuture:ke,shouldDisableMonth:Q,shouldDisableYear:Z,readOnly:R,availableDays:ve,inputProps:n,modal:ee=!1,modalProps:Je,modalTitle:Ke,disabledDateErrorMessage:Qe=z("dateField.disabledDateError"),invalidDateErrorMessage:Ze=z("dateField.invalidDateError"),useNativePicker:Rt,enableCalendar:Vt,calendarTrigger:qt,numberOfMonths:Bt,defaultServerBreakpoint:It,sm:Tt,md:jt,lg:St,xl:Lt,xxl:$t,...Pe}=P,f=Ye&&l==="single",we=me.default(P.defaultServerBreakpoint),F=me.isBreakpointBelow(we,"md"),[et,g]=a.useState(j??Y),[b,V]=a.useState(!1),[te,Ne]=a.useState(!1),[tt,Ee]=a.useState(L??O),[re,_]=a.useState(""),[Oe,m]=a.useState(!1),[Re,ae]=a.useState(!1),y=h&&!f&&!R&&(ee===!0||typeof ee=="string"&&me.isBreakpointBelow(we,ee)),Ve=F&&!y&&typeof X=="number"&&X>1?1:X,{current:u}=a.useRef("selected"in P),s=u?j:et,ie=a.useRef(null),qe=a.useRef(null),rt=a.useCallback(e=>{ie.current=e,typeof w=="function"?w(e):w&&(w.current=e)},[w]),at=e=>{if(!e)return"";const t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),o=String(e.getDate()).padStart(2,"0");return`${t}-${r}-${o}`},it=f&&s instanceof Date?at(s):"",ne=a.useCallback((e,t)=>e instanceof Date?e:Array.isArray(e)&&e.length>0?[...e].sort((r,o)=>r.getTime()-o.getTime())[0]:e&&typeof e=="object"&&"from"in e&&e.from instanceof Date?e.from:e&&typeof e=="object"&&"to"in e&&e.to instanceof Date?e.to:t??new Date,[]),[nt,se]=a.useState(()=>ne(s,H));a.useEffect(()=>{b||se(ne(s,H))},[s,H,b,ne]),a.useEffect(()=>{b&&Ee(L??O)},[b,O,L]),a.useEffect(()=>{u&&g(j)},[j,u]);const x=a.useMemo(()=>new Intl.DateTimeFormat($,{day:"2-digit",month:"2-digit",year:"numeric"}),[$]),M=a.useCallback(e=>{if(!e)return"";if(e instanceof Date)return x.format(e);if(Array.isArray(e))return e.map(t=>x.format(t)).join(", ");if(e.from){const t=x.format(e.from);return e.to?`${t} – ${x.format(e.to)}`:t}return""},[x]),oe=Xe??l==="single",Be=l==="multiple"&&Array.isArray(s)?s.map((e,t)=>({id:t,label:c?c(e):M(e),date:e})):[],U=a.useMemo(()=>{const e=[];return N&&(Array.isArray(N)?e.push(...N):e.push(N)),E&&(Array.isArray(E)?e.push(...E):e.push(E)),J&&e.push({before:J}),K&&e.push({after:K}),Fe&&e.push({before:new Date}),ke&&e.push({after:new Date}),Q&&e.push(t=>Q(t)),Z&&e.push(t=>Z(t)),e},[N,E,J,K,Fe,ke,Q,Z]),k=a.useCallback(e=>Ot.dateMatchModifiers(e,U),[U]),st=(e,t,r,o)=>{const d=l==="range"?v.resolveRangeSelection(e,s,t):e;if(m(!1),u||g(d),i==null||i(d,t,r,o),d){const C=c?c(d):M(d);_(C)}else _("");oe&&V(!1)},ot=e=>{if(k(e))return;const t=l==="range"?{from:e,to:void 0}:l==="multiple"?[...Array.isArray(s)?s:[],e]:e;m(!1),u||g(t),i==null||i(t,e,{},{});const r=c?c(t):M(t);_(r),oe&&V(!1)},lt=a.useMemo(()=>{const e=v.getLocaleDateParts(x),t=new RegExp(`^${v.buildDateRegexSource(e)}$`),{fieldOrder:r}=e;return o=>{const d=o.match(t);if(!d)return;const C={};r.forEach((Mt,Ct)=>{C[Mt]=Number(d[Ct+1])});const{day:ue,month:ce,year:fe}=C;if(ue===void 0||ce===void 0||fe===void 0)return;const B=new Date(fe,ce-1,ue);if(!(isNaN(B.getTime())||B.getFullYear()!==fe||B.getMonth()!==ce-1||B.getDate()!==ue))return B}},[x]),Ie=e=>(Ge??(l==="single"?lt:()=>{}))(e),Te=e=>l==="single"&&e instanceof Date||l==="multiple"&&Array.isArray(e)||l==="range"&&!!e&&!Array.isArray(e)&&"from"in e,dt=e=>{if(_(e),ae(!1),e.trim()===""){m(!1),s!==void 0&&(u||g(void 0),i==null||i(void 0,void 0,{},{}));return}const t=Ie(e);if(!Te(t)){m(!1);return}const o=t&&!Array.isArray(t)&&"from"in t?t:null;if(t instanceof Date&&k(t)||Array.isArray(t)&&t.some(C=>C instanceof Date&&k(C))||!!o&&(o.from&&k(o.from)||o.to&&k(o.to))){m(!0);return}m(!1),u||g(t),i==null||i(t,t,{},{}),t instanceof Date&&se(t),oe&&V(!1)},ut=()=>{if(re.trim()===""){ae(!1);return}ae(!Te(Ie(re)))};a.useEffect(()=>{if(u){const e=c?c(s):M(s);_(e)}},[s,u,c,M]),a.useEffect(()=>{if(!u&&Y){const e=c?c(Y):M(Y);_(e)}},[]);const ct=A.useFloating({open:b,onOpenChange:V,placement:T==="input"?"bottom-start":"bottom-end",middleware:[G.offset(v.CALENDAR_POPOVER_OFFSET),G.flip(),G.shift({padding:v.CALENDAR_POPOVER_PADDING}),G.size({padding:v.CALENDAR_POPOVER_PADDING,apply({availableWidth:e,elements:t}){const r=t.floating;if(r.style.width="",r.style.maxWidth="",r.style.overflowX="",F)return;r.style.width="max-content",r.getBoundingClientRect().width>e&&(r.style.width="min-content",r.style.maxWidth=`${e}px`)}})],whileElementsMounted:Et.autoUpdate}),{refs:q,context:W,x:ft,y:mt,strategy:pt}=ct,ht=A.useClick(W),je=A.useInteractions([...h&&!f&&T==="input"&&!y?[ht]:[],A.useDismiss(W,{outsidePress:e=>{const t=e.target;return!(t!=null&&t.closest('[role="menu"], [role="listbox"]'))}}),A.useRole(W,{role:"dialog"})]);a.useEffect(()=>{var t,r;const e=l==="multiple"?((t=qe.current)==null?void 0:t.wrapper)??null:((r=ie.current)==null?void 0:r.input)??null;q.setPositionReference(e??q.reference.current)},[l,b,q]);const gt=()=>{var t;const e=(t=ie.current)==null?void 0:t.input;if(e){if(typeof e.showPicker=="function")try{e.showPicker();return}catch{}e.focus()}},le=()=>{!h||R||(f?gt():y?Ne(!0):V(e=>!e))},bt=e=>{if(m(!1),u||g(e),i==null||i(e,e,{},{}),e){const t=c?c(e):M(e);_(t)}else _("")},yt=e=>{if(!e){m(!1),u||g(void 0),i==null||i(void 0,void 0,{},{});return}const[t,r,o]=e.split("-").map(Number);if(!t||!r||!o)return;const d=new Date(t,r-1,o);if(!Number.isNaN(d.getTime())){if(k(d)){m(!0);return}m(!1),u||g(d),i==null||i(d,d,{},{})}},Dt=je.getReferenceProps(y&&T==="input"?{onClick:()=>le()}:void 0),{role:Ht,"aria-expanded":Yt,"aria-haspopup":Ut,"aria-controls":_t,...xt}=Dt,Se=y?void 0:_t,de=z("dateField.openCalendar"),Le={"aria-label":de,"aria-expanded":y?te:b,"aria-haspopup":"dialog","aria-controls":Se};return p.jsxs(p.Fragment,{children:[p.jsx("div",{className:I.default(D.default["tedi-date-field__container"],We),...xt,ref:q.setReference,children:l==="multiple"?p.jsx(Ft.MultiValueField,{...n,ref:qe,id:he,label:ge,tagsDirection:ze,values:Be.map(e=>e.label),icon:"calendar_today",onIconClick:le,iconButtonProps:h?Le:{"aria-label":de},isClearable:pe,required:S,onChange:e=>{if(!Array.isArray(s))return;const t=Be.filter(r=>e.includes(r.label)).map(r=>r.date);u||g(t),i==null||i(t,{},{},{})},className:I.default(D.default["tedi-date-field__textfield"],{[D.default["tedi-date-field__icon--disabled"]]:!h||R})}):p.jsx(kt.TextField,{...n,ref:rt,id:he,label:ge,readOnly:R,value:f?it:re,placeholder:Ue,icon:"calendar_today",isClearable:pe,onIconClick:le,iconButtonProps:h&&!f?Le:{"aria-label":de},onChange:e=>f?yt(e):dt(e),onBlur:e=>{var t;f||ut(),(t=n==null?void 0:n.onBlur)==null||t.call(n,e)},required:S,invalid:Oe||Re||(n==null?void 0:n.invalid),helper:(()=>{const e=n==null?void 0:n.helper,t=Oe?Qe:Re?Ze:null,r=t?{text:t,type:"error"}:null;return r?e?Array.isArray(e)?[...e,r]:[e,r]:r:e})(),className:I.default(D.default["tedi-date-field__textfield"],{[D.default["tedi-date-field__textfield--disabled"]]:n==null?void 0:n.disabled,[D.default["tedi-date-field__icon--disabled"]]:!h||R}),input:{...n==null?void 0:n.input,...f&&{type:"date"},...h&&!f&&T==="input"?{role:"combobox","aria-haspopup":"dialog","aria-expanded":y?te:b,"aria-controls":Se}:{}}})}),y&&p.jsx(vt.DatePickerModal,{open:te,onOpenChange:Ne,value:s,onConfirm:bt,mode:l,numberOfMonths:Ve,locale:Ce,localeCode:$,showOutsideDays:be,disabledMatchers:U,required:S,availableDays:ve,footer:Ae,monthYearSelectType:ye,minYear:De,maxYear:_e,dayStatus:xe,showNavigation:Me,selectionLevel:O,initialView:L,initialMonth:H,modalProps:Je,...Pe,title:Ke}),h&&!f&&!y&&p.jsx(A.FloatingPortal,{children:b&&p.jsx(A.FloatingFocusManager,{context:W,modal:!1,initialFocus:-1,children:p.jsx("div",{ref:q.setFloating,className:I.default({[D.default["tedi-date-field__calendar-popover--fullwidth"]]:F}),...je.getFloatingProps({style:{position:pt,top:mt??0,left:F?0:ft??0,right:F?0:void 0}}),children:p.jsx(At.Calendar,{...Pe,numberOfMonths:Ve,view:tt,selectionLevel:O,currentMonth:nt,setCurrentMonth:se,setView:Ee,mode:l,value:s,locale:Ce,localeCode:$,showOutsideDays:be,disabledMatchers:U,required:S,availableDays:ve,footer:Ae,monthYearSelectType:ye,minYear:De,maxYear:_e,dayStatus:xe,showNavigation:Me,handleSelect:st,applyValue:ot,className:I.default(D.default["tedi-date-field__calendar"],{[D.default["tedi-date-field__calendar--fullwidth"]]:F})})})})})]})});$e.displayName="DateField";exports.DateField=$e;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react/jsx-runtime"),A=require("../../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),I=require("../../../../../external/classnames/index.cjs.js"),a=require("react"),At=require("../../content/calendar/calendar.cjs.js"),Ft=require("../multi-value-field/multi-value-field.cjs.js"),kt=require("../textfield/textfield.cjs.js"),D=require("./date-field.module.scss.cjs.js"),v=require("./date-field-helpers.cjs.js"),vt=require("./date-picker-modal/date-picker-modal.cjs.js"),Pt=require("../../../helpers/hooks/use-breakpoint-props.cjs.js"),wt=require("../../../providers/label-provider/use-labels.cjs.js"),Nt=require("../../../../../external/react-day-picker/dist/esm/locale/et.cjs.js"),pe=require("../../../helpers/hooks/use-breakpoint.cjs.js"),Et=require("../../../../../external/@floating-ui/dom/dist/floating-ui.dom.cjs.js"),z=require("../../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs.js"),Ot=require("../../../../../external/react-day-picker/dist/esm/utils/dateMatchModifiers.cjs.js"),He=a.forwardRef((P,w)=>{const{getCurrentBreakpointProps:Ye}=Pt.useBreakpointProps(P.defaultServerBreakpoint),{getLabel:X}=wt.useLabels(),{useNativePicker:Ue=!1,enableCalendar:g=!0,calendarTrigger:T="button",numberOfMonths:J,clearable:ge=!0}=Ye(P),{id:he,mode:s="single",label:be,selected:j,onSelect:i,disabled:N,disabledMatchers:E,placeholder:We,className:Ge,formatDate:c,required:S,showOutsideDays:ye=!0,parseDate:K,monthYearSelectType:De,minYear:_e,maxYear:xe,dayStatus:Me,tagsDirection:ze,showNavigation:Ce=!0,selectionLevel:O="days",initialView:L,locale:Ae=Nt.et,localeCode:$="et-EE",initialMonth:H,closeOnSelect:Xe,footer:Fe,defaultValue:Y,minDate:Q,maxDate:Z,disablePast:ke,disableFuture:ve,shouldDisableMonth:ee,shouldDisableYear:te,readOnly:R,availableDays:Pe,inputProps:n,modal:re=!1,modalProps:Je,modalTitle:Ke,disabledDateErrorMessage:Qe=X("dateField.disabledDateError"),invalidDateErrorMessage:Ze=X("dateField.invalidDateError"),useNativePicker:Rt,enableCalendar:Vt,calendarTrigger:qt,numberOfMonths:Bt,defaultServerBreakpoint:It,sm:Tt,md:jt,lg:St,xl:Lt,xxl:$t,...we}=P,f=Ue&&s==="single",Ne=pe.default(P.defaultServerBreakpoint),F=pe.isBreakpointBelow(Ne,"md"),[et,h]=a.useState(j??Y),[b,V]=a.useState(!1),[ae,Ee]=a.useState(!1),[tt,Oe]=a.useState(L??O),[ie,_]=a.useState(""),[Re,m]=a.useState(!1),[Ve,U]=a.useState(!1),y=g&&!f&&!R&&(re===!0||typeof re=="string"&&pe.isBreakpointBelow(Ne,re)),qe=F&&!y&&typeof J=="number"&&J>1?1:J,{current:u}=a.useRef("selected"in P),o=u?j:et,ne=a.useRef(null),Be=a.useRef(null),rt=a.useCallback(e=>{ne.current=e,typeof w=="function"?w(e):w&&(w.current=e)},[w]),at=e=>{if(!e)return"";const t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),l=String(e.getDate()).padStart(2,"0");return`${t}-${r}-${l}`},it=f&&o instanceof Date?at(o):"",se=a.useCallback((e,t)=>e instanceof Date?e:Array.isArray(e)&&e.length>0?[...e].sort((r,l)=>r.getTime()-l.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??new Date,[]),[nt,oe]=a.useState(()=>se(o,H));a.useEffect(()=>{b||oe(se(o,H))},[o,H,b,se]),a.useEffect(()=>{b&&Oe(L??O)},[b,O,L]),a.useEffect(()=>{u&&h(j)},[j,u]);const x=a.useMemo(()=>new Intl.DateTimeFormat($,{day:"2-digit",month:"2-digit",year:"numeric"}),[$]),M=a.useCallback(e=>{if(!e)return"";if(e instanceof Date)return x.format(e);if(Array.isArray(e))return e.map(t=>x.format(t)).join(", ");if(e.from){const t=x.format(e.from);return e.to?`${t} – ${x.format(e.to)}`:t}return""},[x]),le=Xe??s==="single",Ie=s==="multiple"&&Array.isArray(o)?o.map((e,t)=>({id:t,label:c?c(e):M(e),date:e})):[],W=a.useMemo(()=>{const e=[];return N&&(Array.isArray(N)?e.push(...N):e.push(N)),E&&(Array.isArray(E)?e.push(...E):e.push(E)),Q&&e.push({before:Q}),Z&&e.push({after:Z}),ke&&e.push({before:new Date}),ve&&e.push({after:new Date}),ee&&e.push(t=>ee(t)),te&&e.push(t=>te(t)),e},[N,E,Q,Z,ke,ve,ee,te]),k=a.useCallback(e=>Ot.dateMatchModifiers(e,W),[W]),st=(e,t,r,l)=>{const d=s==="range"?v.resolveRangeSelection(e,o,t):e;if(m(!1),u||h(d),i==null||i(d,t,r,l),d){const C=c?c(d):M(d);_(C)}else _("");le&&V(!1)},ot=e=>{if(k(e))return;const t=s==="range"?{from:e,to:void 0}:s==="multiple"?[...Array.isArray(o)?o:[],e]:e;m(!1),u||h(t),i==null||i(t,e,{},{});const r=c?c(t):M(t);_(r),le&&V(!1)},lt=a.useMemo(()=>{const e=v.getLocaleDateParts(x),t=new RegExp(`^${v.buildDateRegexSource(e)}$`),{fieldOrder:r}=e;return l=>{const d=l.match(t);if(!d)return;const C={};r.forEach((Mt,Ct)=>{C[Mt]=Number(d[Ct+1])});const{day:ce,month:fe,year:me}=C;if(ce===void 0||fe===void 0||me===void 0)return;const B=new Date(me,fe-1,ce);if(!(isNaN(B.getTime())||B.getFullYear()!==me||B.getMonth()!==fe-1||B.getDate()!==ce))return B}},[x]),Te=e=>(K??(s==="single"?lt:()=>{}))(e),je=e=>s==="single"&&e instanceof Date||s==="multiple"&&Array.isArray(e)||s==="range"&&!!e&&!Array.isArray(e)&&"from"in e,dt=e=>{if(_(e),U(!1),e.trim()===""){m(!1),o!==void 0&&(u||h(void 0),i==null||i(void 0,void 0,{},{}));return}const t=Te(e);if(!je(t)){m(!1);return}const l=t&&!Array.isArray(t)&&"from"in t?t:null;if(t instanceof Date&&k(t)||Array.isArray(t)&&t.some(C=>C instanceof Date&&k(C))||!!l&&(l.from&&k(l.from)||l.to&&k(l.to))){m(!0);return}m(!1),u||h(t),i==null||i(t,t,{},{}),t instanceof Date&&oe(t),le&&V(!1)},ut=()=>{if(ie.trim()===""){U(!1);return}if(!K&&s!=="single"){U(!1);return}U(!je(Te(ie)))};a.useEffect(()=>{if(u){const e=c?c(o):M(o);_(e)}},[o,u,c,M]),a.useEffect(()=>{if(!u&&Y){const e=c?c(Y):M(Y);_(e)}},[]);const ct=A.useFloating({open:b,onOpenChange:V,placement:T==="input"?"bottom-start":"bottom-end",middleware:[z.offset(v.CALENDAR_POPOVER_OFFSET),z.flip(),z.shift({padding:v.CALENDAR_POPOVER_PADDING}),z.size({padding:v.CALENDAR_POPOVER_PADDING,apply({availableWidth:e,elements:t}){const r=t.floating;if(r.style.width="",r.style.maxWidth="",r.style.overflowX="",F)return;r.style.width="max-content",r.getBoundingClientRect().width>e&&(r.style.width="min-content",r.style.maxWidth=`${e}px`)}})],whileElementsMounted:Et.autoUpdate}),{refs:q,context:G,x:ft,y:mt,strategy:pt}=ct,gt=A.useClick(G),Se=A.useInteractions([...g&&!f&&T==="input"&&!y?[gt]:[],A.useDismiss(G,{outsidePress:e=>{const t=e.target;return!(t!=null&&t.closest('[role="menu"], [role="listbox"]'))}}),A.useRole(G,{role:"dialog"})]);a.useEffect(()=>{var t,r;const e=s==="multiple"?((t=Be.current)==null?void 0:t.wrapper)??null:((r=ne.current)==null?void 0:r.input)??null;q.setPositionReference(e??q.reference.current)},[s,b,q]);const ht=()=>{var t;const e=(t=ne.current)==null?void 0:t.input;if(e){if(typeof e.showPicker=="function")try{e.showPicker();return}catch{}e.focus()}},de=()=>{!g||R||(f?ht():y?Ee(!0):V(e=>!e))},bt=e=>{if(m(!1),u||h(e),i==null||i(e,e,{},{}),e){const t=c?c(e):M(e);_(t)}else _("")},yt=e=>{if(!e){m(!1),u||h(void 0),i==null||i(void 0,void 0,{},{});return}const[t,r,l]=e.split("-").map(Number);if(!t||!r||!l)return;const d=new Date(t,r-1,l);if(!Number.isNaN(d.getTime())){if(k(d)){m(!0);return}m(!1),u||h(d),i==null||i(d,d,{},{})}},Dt=Se.getReferenceProps(y&&T==="input"?{onClick:()=>de()}:void 0),{role:Ht,"aria-expanded":Yt,"aria-haspopup":Ut,"aria-controls":_t,...xt}=Dt,Le=y?void 0:_t,ue=X("dateField.openCalendar"),$e={"aria-label":ue,"aria-expanded":y?ae:b,"aria-haspopup":"dialog","aria-controls":Le};return p.jsxs(p.Fragment,{children:[p.jsx("div",{className:I.default(D.default["tedi-date-field__container"],Ge),...xt,ref:q.setReference,children:s==="multiple"?p.jsx(Ft.MultiValueField,{...n,ref:Be,id:he,label:be,tagsDirection:ze,values:Ie.map(e=>e.label),icon:"calendar_today",onIconClick:de,iconButtonProps:g?$e:{"aria-label":ue},isClearable:ge,required:S,onChange:e=>{if(!Array.isArray(o))return;const t=Ie.filter(r=>e.includes(r.label)).map(r=>r.date);u||h(t),i==null||i(t,{},{},{})},className:I.default(D.default["tedi-date-field__textfield"],{[D.default["tedi-date-field__icon--disabled"]]:!g||R})}):p.jsx(kt.TextField,{...n,ref:rt,id:he,label:be,readOnly:R,value:f?it:ie,placeholder:We,icon:"calendar_today",isClearable:ge,onIconClick:de,iconButtonProps:g&&!f?$e:{"aria-label":ue},onChange:e=>f?yt(e):dt(e),onBlur:e=>{var t;f||ut(),(t=n==null?void 0:n.onBlur)==null||t.call(n,e)},required:S,invalid:Re||Ve||(n==null?void 0:n.invalid),helper:(()=>{const e=n==null?void 0:n.helper,t=Re?Qe:Ve?Ze:null,r=t?{text:t,type:"error"}:null;return r?e?Array.isArray(e)?[...e,r]:[e,r]:r:e})(),className:I.default(D.default["tedi-date-field__textfield"],{[D.default["tedi-date-field__textfield--disabled"]]:n==null?void 0:n.disabled,[D.default["tedi-date-field__icon--disabled"]]:!g||R}),input:{...n==null?void 0:n.input,...!K&&s!=="single"&&{readOnly:!0},...f&&{type:"date"},...g&&!f&&T==="input"?{role:"combobox","aria-haspopup":"dialog","aria-expanded":y?ae:b,"aria-controls":Le}:{}}})}),y&&p.jsx(vt.DatePickerModal,{open:ae,onOpenChange:Ee,value:o,onConfirm:bt,mode:s,numberOfMonths:qe,locale:Ae,localeCode:$,showOutsideDays:ye,disabledMatchers:W,required:S,availableDays:Pe,footer:Fe,monthYearSelectType:De,minYear:_e,maxYear:xe,dayStatus:Me,showNavigation:Ce,selectionLevel:O,initialView:L,initialMonth:H,modalProps:Je,...we,title:Ke}),g&&!f&&!y&&p.jsx(A.FloatingPortal,{children:b&&p.jsx(A.FloatingFocusManager,{context:G,modal:!1,initialFocus:-1,children:p.jsx("div",{ref:q.setFloating,className:I.default({[D.default["tedi-date-field__calendar-popover--fullwidth"]]:F}),...Se.getFloatingProps({style:{position:pt,top:mt??0,left:F?0:ft??0,right:F?0:void 0}}),children:p.jsx(At.Calendar,{...we,numberOfMonths:qe,view:tt,selectionLevel:O,currentMonth:nt,setCurrentMonth:oe,setView:Oe,mode:s,value:o,locale:Ae,localeCode:$,showOutsideDays:ye,disabledMatchers:W,required:S,availableDays:Pe,footer:Fe,monthYearSelectType:De,minYear:_e,maxYear:xe,dayStatus:Me,showNavigation:Ce,handleSelect:st,applyValue:ot,className:I.default(D.default["tedi-date-field__calendar"],{[D.default["tedi-date-field__calendar--fullwidth"]]:F})})})})})]})});He.displayName="DateField";exports.DateField=He;
|
|
@@ -116,7 +116,7 @@ export interface DateFieldProps extends BreakpointSupport<DateFieldBreakpointPro
|
|
|
116
116
|
showOutsideDays?: boolean;
|
|
117
117
|
/**
|
|
118
118
|
* Custom date parsing function for user input. Receives the input string and should return a `Date`, an array of `Date`s, a `DateRange`, or `undefined` if the input is invalid or cleared.
|
|
119
|
-
* If not provided,
|
|
119
|
+
* If not provided, `mode="single"` falls back to a built-in `dd.MM.yyyy` parser and stays typeable. `mode="multiple"` and `mode="range"` cannot be parsed automatically, so their input is read-only and dates are selected via the calendar only.
|
|
120
120
|
*/
|
|
121
121
|
parseDate?: (value: string) => Date | Date[] | DateRange | undefined;
|
|
122
122
|
/**
|