@cognite/aura 0.3.1 → 0.3.2
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 +1517 -2
- package/README.md +21 -0
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.js +37 -35
- package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.js +64 -75
- package/dist/components/ui/core/date-time-pickers/date-picker/types.d.ts +1 -2
- package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.js +38 -49
- package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js +64 -75
- package/dist/components/ui/core/date-time-pickers/date-range-picker/types.d.ts +1 -2
- package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.js +51 -64
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js +146 -161
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/types.d.ts +1 -2
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.js +124 -137
- package/dist/components/ui/core/date-time-pickers/index.d.ts +2 -0
- package/dist/components/ui/core/date-time-pickers/index.js +6 -4
- package/dist/components/ui/core/date-time-pickers/shared/calendar/calendar.js +8 -8
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.d.ts +1 -1
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.js +1 -1
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.d.ts +0 -2
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.js +18 -34
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/index.d.ts +2 -0
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.d.ts +19 -0
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.js +41 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/index.d.ts +3 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.d.ts +16 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.js +100 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/types.d.ts +23 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.d.ts +3 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.js +64 -0
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +17 -15
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +83 -85
- package/dist/lib/use-controllable-state.js +17 -17
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,99 +1,88 @@
|
|
|
1
1
|
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
2
|
-
import { cn as
|
|
3
|
-
import { Popover as
|
|
4
|
-
import { Calendar as
|
|
5
|
-
import { DateTimeInput as
|
|
6
|
-
import { ShortcutsPanel as
|
|
7
|
-
import { useDateRangePicker as
|
|
8
|
-
const
|
|
9
|
-
value:
|
|
2
|
+
import { cn as S } from "../../../../../lib/utils.js";
|
|
3
|
+
import { Popover as M, PopoverTrigger as N, PopoverContent as w } from "../../popover/popover.js";
|
|
4
|
+
import { Calendar as Y } from "../shared/calendar/calendar.js";
|
|
5
|
+
import { DateTimeInput as O } from "../shared/date-time-input/date-time-input.js";
|
|
6
|
+
import { ShortcutsPanel as j } from "../shared/shortcuts-panel/shortcuts-panel.js";
|
|
7
|
+
import { useDateRangePicker as y } from "./use-date-range-picker.js";
|
|
8
|
+
const z = ({
|
|
9
|
+
value: n,
|
|
10
10
|
onChange: d,
|
|
11
11
|
format: p = "DD/MM/YYYY",
|
|
12
12
|
placeholder: c,
|
|
13
13
|
displayWeekNumber: h = !1,
|
|
14
|
-
shortcuts:
|
|
14
|
+
shortcuts: t,
|
|
15
15
|
defaultDate: m,
|
|
16
16
|
className: s
|
|
17
17
|
}) => {
|
|
18
18
|
const {
|
|
19
19
|
isOpen: a,
|
|
20
|
-
step:
|
|
20
|
+
step: r,
|
|
21
21
|
displayedMonth: v,
|
|
22
|
-
tempStart:
|
|
22
|
+
tempStart: o,
|
|
23
23
|
tempEnd: l,
|
|
24
24
|
hoverDate: f,
|
|
25
|
-
|
|
26
|
-
handleCancel: C,
|
|
25
|
+
handleOpenChange: g,
|
|
27
26
|
handleDateClick: D,
|
|
28
27
|
handleMonthChange: u,
|
|
29
|
-
handleDateHover:
|
|
30
|
-
handleSetStep:
|
|
31
|
-
handleApplyShortcut:
|
|
32
|
-
inputRef:
|
|
33
|
-
popoverRef:
|
|
34
|
-
} =
|
|
28
|
+
handleDateHover: C,
|
|
29
|
+
handleSetStep: k,
|
|
30
|
+
handleApplyShortcut: P,
|
|
31
|
+
inputRef: R,
|
|
32
|
+
popoverRef: x
|
|
33
|
+
} = y({ value: n, onChange: d, defaultDate: m });
|
|
35
34
|
return /* @__PURE__ */ e(
|
|
36
35
|
"div",
|
|
37
36
|
{
|
|
38
37
|
"data-slot": "date-range-picker",
|
|
39
|
-
className:
|
|
40
|
-
children: /* @__PURE__ */ i(
|
|
41
|
-
w,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
onMonthChange: u,
|
|
85
|
-
onDateHover: k
|
|
86
|
-
}
|
|
87
|
-
) })
|
|
88
|
-
] })
|
|
89
|
-
}
|
|
90
|
-
)
|
|
91
|
-
]
|
|
92
|
-
}
|
|
93
|
-
)
|
|
38
|
+
className: S("relative w-full", s),
|
|
39
|
+
children: /* @__PURE__ */ i(M, { open: a, onOpenChange: g, children: [
|
|
40
|
+
/* @__PURE__ */ e(N, { render: /* @__PURE__ */ e("div", { ref: R, className: "w-full" }), children: /* @__PURE__ */ e(
|
|
41
|
+
O,
|
|
42
|
+
{
|
|
43
|
+
value: a ? [o, l] : n,
|
|
44
|
+
format: p,
|
|
45
|
+
placeholder: c,
|
|
46
|
+
isOpen: a,
|
|
47
|
+
variant: "date",
|
|
48
|
+
activeRangePart: a ? r : void 0,
|
|
49
|
+
onRangePartClick: a ? k : void 0
|
|
50
|
+
}
|
|
51
|
+
) }),
|
|
52
|
+
/* @__PURE__ */ e(
|
|
53
|
+
w,
|
|
54
|
+
{
|
|
55
|
+
ref: x,
|
|
56
|
+
className: "rounded-xl w-auto p-0",
|
|
57
|
+
side: "bottom",
|
|
58
|
+
align: "start",
|
|
59
|
+
children: /* @__PURE__ */ i("div", { "data-slot": "date-range-picker-content", className: "flex flex-row", children: [
|
|
60
|
+
t && t.length > 0 && /* @__PURE__ */ e(
|
|
61
|
+
j,
|
|
62
|
+
{
|
|
63
|
+
shortcuts: t,
|
|
64
|
+
onShortcutClick: P
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
/* @__PURE__ */ e("div", { className: "p-3", children: /* @__PURE__ */ e(
|
|
68
|
+
Y,
|
|
69
|
+
{
|
|
70
|
+
displayedMonth: v,
|
|
71
|
+
selectedRange: [o, l],
|
|
72
|
+
hoverDate: r === "end" ? f : null,
|
|
73
|
+
displayWeekNumber: h,
|
|
74
|
+
onDateClick: D,
|
|
75
|
+
onMonthChange: u,
|
|
76
|
+
onDateHover: C
|
|
77
|
+
}
|
|
78
|
+
) })
|
|
79
|
+
] })
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
] })
|
|
94
83
|
}
|
|
95
84
|
);
|
|
96
85
|
};
|
|
97
86
|
export {
|
|
98
|
-
|
|
87
|
+
z as DateRangePicker
|
|
99
88
|
};
|
|
@@ -13,8 +13,7 @@ export interface UseDateRangePickerReturn {
|
|
|
13
13
|
tempStart: Dayjs | null;
|
|
14
14
|
tempEnd: Dayjs | null;
|
|
15
15
|
hoverDate: Dayjs | null;
|
|
16
|
-
|
|
17
|
-
handleCancel: () => void;
|
|
16
|
+
handleOpenChange: (open: boolean) => void;
|
|
18
17
|
handleDateClick: (date: Dayjs) => void;
|
|
19
18
|
handleMonthChange: (month: Dayjs) => void;
|
|
20
19
|
handleDateHover: (date: Dayjs | null) => void;
|
package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.js
CHANGED
|
@@ -1,82 +1,69 @@
|
|
|
1
|
-
import { useRef as
|
|
2
|
-
import
|
|
3
|
-
import { usePopoverState as
|
|
4
|
-
import { useRangeDateState as
|
|
5
|
-
import { useRangeStepManager as
|
|
6
|
-
const
|
|
1
|
+
import { useRef as E, useCallback as c, useEffect as x } from "react";
|
|
2
|
+
import P from "dayjs";
|
|
3
|
+
import { usePopoverState as b } from "../shared/hooks/use-popover-state.js";
|
|
4
|
+
import { useRangeDateState as j } from "../shared/hooks/use-range-date-state.js";
|
|
5
|
+
import { useRangeStepManager as H } from "../shared/hooks/use-range-step-manager.js";
|
|
6
|
+
const L = ({
|
|
7
7
|
value: r,
|
|
8
8
|
onChange: t,
|
|
9
|
-
defaultDate:
|
|
9
|
+
defaultDate: S = P()
|
|
10
10
|
}) => {
|
|
11
|
-
const
|
|
12
|
-
}),
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
setIsOpen: a,
|
|
16
|
-
popoverRef: R,
|
|
17
|
-
inputRef: v,
|
|
18
|
-
handleTogglePopover: y
|
|
19
|
-
} = j({
|
|
20
|
-
onClose: s(() => d.current(), []),
|
|
21
|
-
onBackspace: s(() => f.current(), [])
|
|
22
|
-
}), A = I(), { step: o, handleBack: c, handleNext: h, resetStep: n } = A, C = H({
|
|
11
|
+
const p = E(() => {
|
|
12
|
+
}), { isOpen: m, setIsOpen: s, popoverRef: u, inputRef: k } = b({
|
|
13
|
+
onBackspace: c(() => p.current(), [])
|
|
14
|
+
}), D = H(), { step: n, handleBack: o, handleNext: d, resetStep: a } = D, R = j({
|
|
23
15
|
value: r,
|
|
24
|
-
defaultDate:
|
|
25
|
-
onEndDateSelected:
|
|
26
|
-
(e,
|
|
27
|
-
t([e,
|
|
16
|
+
defaultDate: S,
|
|
17
|
+
onEndDateSelected: c(
|
|
18
|
+
(e, l) => {
|
|
19
|
+
t([e, l]), s(!1), a();
|
|
28
20
|
},
|
|
29
|
-
[t,
|
|
21
|
+
[t, s, a]
|
|
30
22
|
)
|
|
31
23
|
}), {
|
|
32
|
-
tempStart:
|
|
33
|
-
tempEnd:
|
|
34
|
-
displayedMonth:
|
|
35
|
-
hoverDate:
|
|
36
|
-
handleDateClick:
|
|
37
|
-
handleDateHover:
|
|
38
|
-
handleMonthChange:
|
|
39
|
-
clearActiveSegment:
|
|
40
|
-
resetDates:
|
|
41
|
-
} =
|
|
42
|
-
|
|
43
|
-
}, [
|
|
44
|
-
const e =
|
|
45
|
-
e === null ?
|
|
46
|
-
}, [
|
|
47
|
-
return
|
|
48
|
-
|
|
49
|
-
}, [
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
handleTogglePopover: () => {
|
|
59
|
-
i || l(), y();
|
|
60
|
-
},
|
|
61
|
-
handleCancel: () => {
|
|
62
|
-
l(), a(!1);
|
|
24
|
+
tempStart: y,
|
|
25
|
+
tempEnd: A,
|
|
26
|
+
displayedMonth: B,
|
|
27
|
+
hoverDate: C,
|
|
28
|
+
handleDateClick: M,
|
|
29
|
+
handleDateHover: O,
|
|
30
|
+
handleMonthChange: g,
|
|
31
|
+
clearActiveSegment: i,
|
|
32
|
+
resetDates: h
|
|
33
|
+
} = R, v = c(() => {
|
|
34
|
+
h(r), a();
|
|
35
|
+
}, [h, a, r]), f = c(() => {
|
|
36
|
+
const e = i(n);
|
|
37
|
+
e === null ? o() : e[0] === null && e[1] === null && t(e);
|
|
38
|
+
}, [i, n, o, t]);
|
|
39
|
+
return x(() => {
|
|
40
|
+
p.current = f;
|
|
41
|
+
}, [f]), {
|
|
42
|
+
isOpen: m,
|
|
43
|
+
step: n,
|
|
44
|
+
displayedMonth: B,
|
|
45
|
+
tempStart: y,
|
|
46
|
+
tempEnd: A,
|
|
47
|
+
hoverDate: C,
|
|
48
|
+
handleOpenChange: (e) => {
|
|
49
|
+
v(), s(e);
|
|
63
50
|
},
|
|
64
51
|
handleDateClick: (e) => {
|
|
65
|
-
|
|
52
|
+
M(e, n), n === "start" && d();
|
|
66
53
|
},
|
|
67
|
-
handleMonthChange:
|
|
68
|
-
handleDateHover:
|
|
54
|
+
handleMonthChange: g,
|
|
55
|
+
handleDateHover: O,
|
|
69
56
|
handleSetStep: (e) => {
|
|
70
|
-
e === "start" ?
|
|
57
|
+
e === "start" ? o() : d();
|
|
71
58
|
},
|
|
72
59
|
handleApplyShortcut: (e) => {
|
|
73
|
-
const
|
|
74
|
-
t(
|
|
60
|
+
const l = Array.isArray(e) ? e : [e, e];
|
|
61
|
+
t(l), s(!1), a();
|
|
75
62
|
},
|
|
76
|
-
inputRef:
|
|
77
|
-
popoverRef:
|
|
63
|
+
inputRef: k,
|
|
64
|
+
popoverRef: u
|
|
78
65
|
};
|
|
79
66
|
};
|
|
80
67
|
export {
|
|
81
|
-
|
|
68
|
+
L as useDateRangePicker
|
|
82
69
|
};
|
package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js
CHANGED
|
@@ -1,190 +1,175 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { Popover as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
const He = ({
|
|
1
|
+
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as te } from "react";
|
|
3
|
+
import { cn as ne } from "../../../../../lib/utils.js";
|
|
4
|
+
import { Button as p } from "../../button/button.js";
|
|
5
|
+
import { Popover as re, PopoverTrigger as ae, PopoverContent as oe } from "../../popover/popover.js";
|
|
6
|
+
import { Calendar as le } from "../shared/calendar/calendar.js";
|
|
7
|
+
import { DateTimeInput as ie } from "../shared/date-time-input/date-time-input.js";
|
|
8
|
+
import { ShortcutsPanel as de } from "../shared/shortcuts-panel/shortcuts-panel.js";
|
|
9
|
+
import { TimePickerPanel as k } from "../shared/time-picker-panel/time-picker-panel.js";
|
|
10
|
+
import { convert12HourTo24Hour as b } from "../utils/time-utils.js";
|
|
11
|
+
import { useDateTimeRangePicker as ce } from "./use-date-time-range-picker.js";
|
|
12
|
+
const be = ({
|
|
14
13
|
value: x,
|
|
15
|
-
onChange:
|
|
16
|
-
format:
|
|
17
|
-
placeholder:
|
|
18
|
-
displayWeekNumber:
|
|
14
|
+
onChange: H,
|
|
15
|
+
format: M = "DD/MM/YYYY HH:mm",
|
|
16
|
+
placeholder: D,
|
|
17
|
+
displayWeekNumber: S = !1,
|
|
19
18
|
shortcuts: c,
|
|
20
|
-
timeFormat:
|
|
21
|
-
defaultDate:
|
|
22
|
-
className:
|
|
19
|
+
timeFormat: n = "24h",
|
|
20
|
+
defaultDate: A,
|
|
21
|
+
className: N
|
|
23
22
|
}) => {
|
|
24
23
|
const {
|
|
25
24
|
isOpen: l,
|
|
26
|
-
step:
|
|
27
|
-
displayedMonth:
|
|
28
|
-
tempStart:
|
|
29
|
-
tempEnd:
|
|
30
|
-
hoverDate:
|
|
25
|
+
step: t,
|
|
26
|
+
displayedMonth: T,
|
|
27
|
+
tempStart: r,
|
|
28
|
+
tempEnd: a,
|
|
29
|
+
hoverDate: y,
|
|
31
30
|
tempStartHour: i,
|
|
32
|
-
tempStartMinute:
|
|
31
|
+
tempStartMinute: m,
|
|
33
32
|
tempEndHour: d,
|
|
34
33
|
tempEndMinute: h,
|
|
35
|
-
startAmPm:
|
|
36
|
-
endAmPm:
|
|
37
|
-
|
|
38
|
-
handleSetStep:
|
|
39
|
-
handleDateClick:
|
|
34
|
+
startAmPm: s,
|
|
35
|
+
endAmPm: u,
|
|
36
|
+
handleOpenChange: f,
|
|
37
|
+
handleSetStep: R,
|
|
38
|
+
handleDateClick: E,
|
|
40
39
|
handleMonthChange: w,
|
|
41
|
-
handleDateHover:
|
|
42
|
-
handleStartHourChange:
|
|
43
|
-
handleStartMinuteChange:
|
|
44
|
-
handleEndHourChange:
|
|
45
|
-
handleEndMinuteChange:
|
|
46
|
-
handleStartAmPmChange:
|
|
47
|
-
handleEndAmPmChange:
|
|
48
|
-
handleNext:
|
|
49
|
-
handleApply:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
} = me({
|
|
40
|
+
handleDateHover: Y,
|
|
41
|
+
handleStartHourChange: j,
|
|
42
|
+
handleStartMinuteChange: B,
|
|
43
|
+
handleEndHourChange: O,
|
|
44
|
+
handleEndMinuteChange: W,
|
|
45
|
+
handleStartAmPmChange: I,
|
|
46
|
+
handleEndAmPmChange: L,
|
|
47
|
+
handleNext: V,
|
|
48
|
+
handleApply: q,
|
|
49
|
+
handleBack: z,
|
|
50
|
+
handleApplyShortcut: G,
|
|
51
|
+
popoverRef: J,
|
|
52
|
+
inputRef: K
|
|
53
|
+
} = ce({
|
|
56
54
|
value: x,
|
|
57
|
-
onChange:
|
|
58
|
-
timeFormat:
|
|
59
|
-
defaultDate:
|
|
60
|
-
}),
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
).minute(
|
|
64
|
-
|
|
55
|
+
onChange: H,
|
|
56
|
+
timeFormat: n,
|
|
57
|
+
defaultDate: A
|
|
58
|
+
}), Q = t === "start" ? r !== null : a !== null, U = t === "start" ? "Next" : "Apply", X = t === "start" ? V : q, g = t === "start" ? i : d, v = t === "start" ? m : h, Z = t === "start" ? s : u, C = t === "start" ? j : O, P = t === "start" ? B : W, _ = t === "start" ? I : L, $ = te(() => {
|
|
59
|
+
const F = r ? r.hour(
|
|
60
|
+
n === "12h" ? b(i, s) : i
|
|
61
|
+
).minute(m) : null, ee = a ? a.hour(
|
|
62
|
+
n === "12h" ? b(d, u) : d
|
|
65
63
|
).minute(h) : null;
|
|
66
|
-
return [
|
|
64
|
+
return [F, ee];
|
|
67
65
|
}, [
|
|
66
|
+
r,
|
|
68
67
|
a,
|
|
69
|
-
o,
|
|
70
68
|
i,
|
|
71
|
-
|
|
69
|
+
m,
|
|
72
70
|
d,
|
|
73
71
|
h,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
72
|
+
s,
|
|
73
|
+
u,
|
|
74
|
+
n
|
|
77
75
|
]);
|
|
78
76
|
return /* @__PURE__ */ e(
|
|
79
77
|
"div",
|
|
80
78
|
{
|
|
81
79
|
"data-slot": "date-time-range-picker",
|
|
82
|
-
className:
|
|
83
|
-
children: /* @__PURE__ */
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
ie,
|
|
80
|
+
className: ne("relative w-full", N),
|
|
81
|
+
children: /* @__PURE__ */ o(re, { open: l, onOpenChange: f, children: [
|
|
82
|
+
/* @__PURE__ */ e(ae, { render: /* @__PURE__ */ e("div", { ref: K, className: "w-full" }), children: /* @__PURE__ */ e(
|
|
83
|
+
ie,
|
|
84
|
+
{
|
|
85
|
+
value: $,
|
|
86
|
+
format: M,
|
|
87
|
+
placeholder: D,
|
|
88
|
+
isOpen: l,
|
|
89
|
+
variant: "datetime",
|
|
90
|
+
activeRangePart: l ? t : void 0,
|
|
91
|
+
onRangePartClick: l ? R : void 0
|
|
92
|
+
}
|
|
93
|
+
) }),
|
|
94
|
+
/* @__PURE__ */ e(
|
|
95
|
+
oe,
|
|
96
|
+
{
|
|
97
|
+
ref: J,
|
|
98
|
+
className: "rounded-xl w-auto p-0",
|
|
99
|
+
side: "bottom",
|
|
100
|
+
align: "start",
|
|
101
|
+
children: /* @__PURE__ */ o(
|
|
102
|
+
"div",
|
|
106
103
|
{
|
|
107
|
-
|
|
108
|
-
className: "
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
{
|
|
169
|
-
variant: "secondary",
|
|
170
|
-
onClick: Q,
|
|
171
|
-
disabled: !J,
|
|
172
|
-
children: K
|
|
173
|
-
}
|
|
174
|
-
)
|
|
175
|
-
] })
|
|
176
|
-
] })
|
|
177
|
-
]
|
|
178
|
-
}
|
|
179
|
-
)
|
|
104
|
+
"data-slot": "date-time-range-picker-content",
|
|
105
|
+
className: "flex flex-col",
|
|
106
|
+
children: [
|
|
107
|
+
/* @__PURE__ */ o("div", { className: "flex flex-row", children: [
|
|
108
|
+
c && c.length > 0 && /* @__PURE__ */ e(
|
|
109
|
+
de,
|
|
110
|
+
{
|
|
111
|
+
shortcuts: c,
|
|
112
|
+
onShortcutClick: G
|
|
113
|
+
}
|
|
114
|
+
),
|
|
115
|
+
/* @__PURE__ */ e("div", { className: "p-3 border-r border-border", children: /* @__PURE__ */ e(
|
|
116
|
+
le,
|
|
117
|
+
{
|
|
118
|
+
displayedMonth: T,
|
|
119
|
+
selectedRange: [r, a],
|
|
120
|
+
hoverDate: t === "end" ? y : null,
|
|
121
|
+
displayWeekNumber: S,
|
|
122
|
+
onDateClick: E,
|
|
123
|
+
onMonthChange: w,
|
|
124
|
+
onDateHover: Y
|
|
125
|
+
}
|
|
126
|
+
) }),
|
|
127
|
+
n === "12h" ? /* @__PURE__ */ e(
|
|
128
|
+
k,
|
|
129
|
+
{
|
|
130
|
+
hour: g,
|
|
131
|
+
minute: v,
|
|
132
|
+
amPm: Z,
|
|
133
|
+
timeFormat: "12h",
|
|
134
|
+
onHourChange: C,
|
|
135
|
+
onMinuteChange: P,
|
|
136
|
+
onAmPmChange: _
|
|
137
|
+
}
|
|
138
|
+
) : /* @__PURE__ */ e(
|
|
139
|
+
k,
|
|
140
|
+
{
|
|
141
|
+
hour: g,
|
|
142
|
+
minute: v,
|
|
143
|
+
timeFormat: "24h",
|
|
144
|
+
onHourChange: C,
|
|
145
|
+
onMinuteChange: P
|
|
146
|
+
}
|
|
147
|
+
)
|
|
148
|
+
] }),
|
|
149
|
+
/* @__PURE__ */ o("div", { className: "flex p-2 justify-between items-center self-stretch border-t border-border", children: [
|
|
150
|
+
/* @__PURE__ */ e(p, { variant: "ghost", onClick: () => f(!1), children: "Cancel" }),
|
|
151
|
+
/* @__PURE__ */ o("div", { className: "flex gap-2", children: [
|
|
152
|
+
t === "end" && /* @__PURE__ */ e(p, { variant: "ghost", onClick: z, children: "Back" }),
|
|
153
|
+
/* @__PURE__ */ e(
|
|
154
|
+
p,
|
|
155
|
+
{
|
|
156
|
+
variant: "secondary",
|
|
157
|
+
onClick: X,
|
|
158
|
+
disabled: !Q,
|
|
159
|
+
children: U
|
|
160
|
+
}
|
|
161
|
+
)
|
|
162
|
+
] })
|
|
163
|
+
] })
|
|
164
|
+
]
|
|
180
165
|
}
|
|
181
166
|
)
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
)
|
|
167
|
+
}
|
|
168
|
+
)
|
|
169
|
+
] })
|
|
185
170
|
}
|
|
186
171
|
);
|
|
187
172
|
};
|
|
188
173
|
export {
|
|
189
|
-
|
|
174
|
+
be as DateTimeRangePicker
|
|
190
175
|
};
|