@povio/ui 2.3.0-rc.18 → 2.3.0-rc.19
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/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +6 -4
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +6 -4
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +6 -4
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +193 -185
- package/dist/components/inputs/DateTime/shared/Calendar.js +49 -47
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +199 -181
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +59 -55
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +143 -134
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +44 -43
- package/dist/config/uiConfig.context.d.ts +1 -1
- package/dist/config/uiConfig.context.js +1 -0
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ import { useEffect, useState } from "react";
|
|
|
10
10
|
import { useCalendar } from "@react-aria/calendar";
|
|
11
11
|
//#region src/components/inputs/DateTime/shared/Calendar.tsx
|
|
12
12
|
var Calendar = (t0) => {
|
|
13
|
-
const $ = c(
|
|
13
|
+
const $ = c(89);
|
|
14
14
|
let className;
|
|
15
15
|
let datePickerState;
|
|
16
16
|
let hourCycle;
|
|
@@ -226,7 +226,7 @@ var Calendar = (t0) => {
|
|
|
226
226
|
} else t14 = $[51];
|
|
227
227
|
const handleDateChange = t14;
|
|
228
228
|
let t15;
|
|
229
|
-
if ($[52] !== datePickerState || $[53] !== granularity || $[54] !== handleDateChange || $[55] !== includesTime || $[56] !==
|
|
229
|
+
if ($[52] !== datePickerState || $[53] !== granularity || $[54] !== handleDateChange || $[55] !== includesTime || $[56] !== onApply || $[57] !== onDateSelection || $[58] !== onMonthSelectionChange || $[59] !== onMonthYearChange || $[60] !== onMonthYearCommit || $[61] !== onYearSelectionChange || $[62] !== props.state || $[63] !== selectedDate || $[64] !== toggleState) {
|
|
230
230
|
t15 = () => {
|
|
231
231
|
if (!toggleState) {
|
|
232
232
|
if (granularity === "month") return /* @__PURE__ */ jsx(MonthPicker, {
|
|
@@ -246,6 +246,7 @@ var Calendar = (t0) => {
|
|
|
246
246
|
return /* @__PURE__ */ jsx(CalendarGrid, {
|
|
247
247
|
state: props.state,
|
|
248
248
|
onApply: handleDateChange,
|
|
249
|
+
onDoubleClickApply: !includesTime ? onApply : void 0,
|
|
249
250
|
onDateSelection
|
|
250
251
|
});
|
|
251
252
|
}
|
|
@@ -282,25 +283,26 @@ var Calendar = (t0) => {
|
|
|
282
283
|
$[53] = granularity;
|
|
283
284
|
$[54] = handleDateChange;
|
|
284
285
|
$[55] = includesTime;
|
|
285
|
-
$[56] =
|
|
286
|
-
$[57] =
|
|
287
|
-
$[58] =
|
|
288
|
-
$[59] =
|
|
289
|
-
$[60] =
|
|
290
|
-
$[61] =
|
|
291
|
-
$[62] =
|
|
292
|
-
$[63] =
|
|
293
|
-
$[64] =
|
|
294
|
-
|
|
286
|
+
$[56] = onApply;
|
|
287
|
+
$[57] = onDateSelection;
|
|
288
|
+
$[58] = onMonthSelectionChange;
|
|
289
|
+
$[59] = onMonthYearChange;
|
|
290
|
+
$[60] = onMonthYearCommit;
|
|
291
|
+
$[61] = onYearSelectionChange;
|
|
292
|
+
$[62] = props.state;
|
|
293
|
+
$[63] = selectedDate;
|
|
294
|
+
$[64] = toggleState;
|
|
295
|
+
$[65] = t15;
|
|
296
|
+
} else t15 = $[65];
|
|
295
297
|
const getContent = t15;
|
|
296
298
|
let t16;
|
|
297
|
-
if ($[
|
|
299
|
+
if ($[66] !== className) {
|
|
298
300
|
t16 = clsx("flex min-h-0 w-full flex-col items-center", className);
|
|
299
|
-
$[
|
|
300
|
-
$[
|
|
301
|
-
} else t16 = $[
|
|
301
|
+
$[66] = className;
|
|
302
|
+
$[67] = t16;
|
|
303
|
+
} else t16 = $[67];
|
|
302
304
|
let t17;
|
|
303
|
-
if ($[
|
|
305
|
+
if ($[68] !== datePickerState || $[69] !== granularity || $[70] !== headerNextButtonProps || $[71] !== headerPrevButtonProps || $[72] !== hourCycle || $[73] !== includesTime || $[74] !== props.state || $[75] !== toggleState) {
|
|
304
306
|
t17 = /* @__PURE__ */ jsx(CalendarHeader, {
|
|
305
307
|
calendarState: props.state,
|
|
306
308
|
datePickerState,
|
|
@@ -312,52 +314,52 @@ var Calendar = (t0) => {
|
|
|
312
314
|
toggleState,
|
|
313
315
|
setToggleState
|
|
314
316
|
});
|
|
315
|
-
$[
|
|
316
|
-
$[
|
|
317
|
-
$[
|
|
318
|
-
$[
|
|
319
|
-
$[
|
|
320
|
-
$[
|
|
321
|
-
$[
|
|
322
|
-
$[
|
|
323
|
-
$[
|
|
324
|
-
} else t17 = $[
|
|
317
|
+
$[68] = datePickerState;
|
|
318
|
+
$[69] = granularity;
|
|
319
|
+
$[70] = headerNextButtonProps;
|
|
320
|
+
$[71] = headerPrevButtonProps;
|
|
321
|
+
$[72] = hourCycle;
|
|
322
|
+
$[73] = includesTime;
|
|
323
|
+
$[74] = props.state;
|
|
324
|
+
$[75] = toggleState;
|
|
325
|
+
$[76] = t17;
|
|
326
|
+
} else t17 = $[76];
|
|
325
327
|
const t18 = toggleState !== "year" && "pb-8 md:pb-0";
|
|
326
328
|
let t19;
|
|
327
|
-
if ($[
|
|
329
|
+
if ($[77] !== t18) {
|
|
328
330
|
t19 = clsx("flex min-h-0 w-full flex-1 flex-col items-center", t18);
|
|
329
|
-
$[
|
|
330
|
-
$[
|
|
331
|
-
} else t19 = $[
|
|
331
|
+
$[77] = t18;
|
|
332
|
+
$[78] = t19;
|
|
333
|
+
} else t19 = $[78];
|
|
332
334
|
let t20;
|
|
333
|
-
if ($[
|
|
335
|
+
if ($[79] !== getContent) {
|
|
334
336
|
t20 = getContent();
|
|
335
|
-
$[
|
|
336
|
-
$[
|
|
337
|
-
} else t20 = $[
|
|
337
|
+
$[79] = getContent;
|
|
338
|
+
$[80] = t20;
|
|
339
|
+
} else t20 = $[80];
|
|
338
340
|
let t21;
|
|
339
|
-
if ($[
|
|
341
|
+
if ($[81] !== t19 || $[82] !== t20) {
|
|
340
342
|
t21 = /* @__PURE__ */ jsx("div", {
|
|
341
343
|
className: t19,
|
|
342
344
|
children: t20
|
|
343
345
|
});
|
|
344
|
-
$[
|
|
345
|
-
$[
|
|
346
|
-
$[
|
|
347
|
-
} else t21 = $[
|
|
346
|
+
$[81] = t19;
|
|
347
|
+
$[82] = t20;
|
|
348
|
+
$[83] = t21;
|
|
349
|
+
} else t21 = $[83];
|
|
348
350
|
let t22;
|
|
349
|
-
if ($[
|
|
351
|
+
if ($[84] !== calendarProps || $[85] !== t16 || $[86] !== t17 || $[87] !== t21) {
|
|
350
352
|
t22 = /* @__PURE__ */ jsxs("div", {
|
|
351
353
|
...calendarProps,
|
|
352
354
|
className: t16,
|
|
353
355
|
children: [t17, t21]
|
|
354
356
|
});
|
|
355
|
-
$[
|
|
356
|
-
$[
|
|
357
|
-
$[
|
|
358
|
-
$[
|
|
359
|
-
$[
|
|
360
|
-
} else t22 = $[
|
|
357
|
+
$[84] = calendarProps;
|
|
358
|
+
$[85] = t16;
|
|
359
|
+
$[86] = t17;
|
|
360
|
+
$[87] = t21;
|
|
361
|
+
$[88] = t22;
|
|
362
|
+
} else t22 = $[88];
|
|
361
363
|
return t22;
|
|
362
364
|
};
|
|
363
365
|
//#endregion
|
|
@@ -5,6 +5,7 @@ import { DateValue } from 'react-aria';
|
|
|
5
5
|
interface CalendarCellProps extends AriaCalendarCellProps {
|
|
6
6
|
state: CalendarState | RangeCalendarState;
|
|
7
7
|
onApply?: (selectedDate?: DateValue) => void;
|
|
8
|
+
onDoubleClickApply?: (selectedDate?: DateValue) => void;
|
|
8
9
|
shouldCloseOnSelect?: boolean;
|
|
9
10
|
onDateSelection?: (date: DateValue) => void;
|
|
10
11
|
onDateHover?: (date: DateValue | null) => void;
|
|
@@ -16,5 +17,5 @@ interface CalendarCellProps extends AriaCalendarCellProps {
|
|
|
16
17
|
hoverDate?: DateValue | null;
|
|
17
18
|
onKeyboardNavigation?: (event: KeyboardEvent, date: DateValue) => boolean;
|
|
18
19
|
}
|
|
19
|
-
export declare const CalendarCell: ({ state, onApply, shouldCloseOnSelect, onDateSelection, onDateHover, rangeSelection, hoverDate, onKeyboardNavigation, ...props }: CalendarCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare const CalendarCell: ({ state, onApply, onDoubleClickApply, shouldCloseOnSelect, onDateSelection, onDateHover, rangeSelection, hoverDate, onKeyboardNavigation, ...props }: CalendarCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
21
|
export {};
|
|
@@ -12,59 +12,75 @@ var isRange = (state) => {
|
|
|
12
12
|
return "highlightedRange" in state;
|
|
13
13
|
};
|
|
14
14
|
var CalendarCell = (t0) => {
|
|
15
|
-
const $ = c(
|
|
15
|
+
const $ = c(104);
|
|
16
16
|
let hoverDate;
|
|
17
17
|
let onApply;
|
|
18
18
|
let onDateHover;
|
|
19
19
|
let onDateSelection;
|
|
20
|
+
let onDoubleClickApply;
|
|
20
21
|
let onKeyboardNavigation;
|
|
21
22
|
let props;
|
|
22
23
|
let rangeSelection;
|
|
23
24
|
let state;
|
|
24
25
|
let t1;
|
|
25
26
|
if ($[0] !== t0) {
|
|
26
|
-
({state, onApply, shouldCloseOnSelect: t1, onDateSelection, onDateHover, rangeSelection, hoverDate, onKeyboardNavigation, ...props} = t0);
|
|
27
|
+
({state, onApply, onDoubleClickApply, shouldCloseOnSelect: t1, onDateSelection, onDateHover, rangeSelection, hoverDate, onKeyboardNavigation, ...props} = t0);
|
|
27
28
|
$[0] = t0;
|
|
28
29
|
$[1] = hoverDate;
|
|
29
30
|
$[2] = onApply;
|
|
30
31
|
$[3] = onDateHover;
|
|
31
32
|
$[4] = onDateSelection;
|
|
32
|
-
$[5] =
|
|
33
|
-
$[6] =
|
|
34
|
-
$[7] =
|
|
35
|
-
$[8] =
|
|
36
|
-
$[9] =
|
|
33
|
+
$[5] = onDoubleClickApply;
|
|
34
|
+
$[6] = onKeyboardNavigation;
|
|
35
|
+
$[7] = props;
|
|
36
|
+
$[8] = rangeSelection;
|
|
37
|
+
$[9] = state;
|
|
38
|
+
$[10] = t1;
|
|
37
39
|
} else {
|
|
38
40
|
hoverDate = $[1];
|
|
39
41
|
onApply = $[2];
|
|
40
42
|
onDateHover = $[3];
|
|
41
43
|
onDateSelection = $[4];
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
onDoubleClickApply = $[5];
|
|
45
|
+
onKeyboardNavigation = $[6];
|
|
46
|
+
props = $[7];
|
|
47
|
+
rangeSelection = $[8];
|
|
48
|
+
state = $[9];
|
|
49
|
+
t1 = $[10];
|
|
47
50
|
}
|
|
48
51
|
const shouldCloseOnSelect = t1 === void 0 ? true : t1;
|
|
49
52
|
const ref = useRef(null);
|
|
50
53
|
const { cellProps, buttonProps, formattedDate, isSelected, isDisabled, isOutsideVisibleRange } = useCalendarCell(props, state, ref);
|
|
51
54
|
const { focusProps } = useFocusRing();
|
|
52
55
|
let t2;
|
|
53
|
-
if ($[
|
|
56
|
+
if ($[11] !== buttonProps || $[12] !== isDisabled || $[13] !== onApply || $[14] !== onDateSelection || $[15] !== props.date || $[16] !== shouldCloseOnSelect) {
|
|
54
57
|
t2 = (event) => {
|
|
55
58
|
buttonProps.onClick?.(event);
|
|
56
59
|
if (onDateSelection) onDateSelection(props.date);
|
|
57
60
|
if (shouldCloseOnSelect && !isDisabled) onApply?.(props.date);
|
|
58
61
|
};
|
|
59
|
-
$[
|
|
60
|
-
$[
|
|
61
|
-
$[
|
|
62
|
-
$[
|
|
63
|
-
$[
|
|
64
|
-
$[
|
|
65
|
-
$[
|
|
66
|
-
} else t2 = $[
|
|
62
|
+
$[11] = buttonProps;
|
|
63
|
+
$[12] = isDisabled;
|
|
64
|
+
$[13] = onApply;
|
|
65
|
+
$[14] = onDateSelection;
|
|
66
|
+
$[15] = props.date;
|
|
67
|
+
$[16] = shouldCloseOnSelect;
|
|
68
|
+
$[17] = t2;
|
|
69
|
+
} else t2 = $[17];
|
|
67
70
|
const onClick = t2;
|
|
71
|
+
let t3;
|
|
72
|
+
if ($[18] !== isDisabled || $[19] !== onDoubleClickApply || $[20] !== props.date) {
|
|
73
|
+
t3 = (event_0) => {
|
|
74
|
+
if (isDisabled) return;
|
|
75
|
+
event_0.preventDefault();
|
|
76
|
+
onDoubleClickApply?.(props.date);
|
|
77
|
+
};
|
|
78
|
+
$[18] = isDisabled;
|
|
79
|
+
$[19] = onDoubleClickApply;
|
|
80
|
+
$[20] = props.date;
|
|
81
|
+
$[21] = t3;
|
|
82
|
+
} else t3 = $[21];
|
|
83
|
+
const onDoubleClick = t3;
|
|
68
84
|
let isSelectionStart;
|
|
69
85
|
let isSelectionEnd;
|
|
70
86
|
let isSelectedCell;
|
|
@@ -72,22 +88,22 @@ var CalendarCell = (t0) => {
|
|
|
72
88
|
let isHoverRange = false;
|
|
73
89
|
let isSelectingMode = false;
|
|
74
90
|
if (rangeSelection?.start) {
|
|
75
|
-
let t3;
|
|
76
|
-
if ($[17] !== props.date || $[18] !== rangeSelection.start) {
|
|
77
|
-
t3 = isSameDay(props.date, rangeSelection.start);
|
|
78
|
-
$[17] = props.date;
|
|
79
|
-
$[18] = rangeSelection.start;
|
|
80
|
-
$[19] = t3;
|
|
81
|
-
} else t3 = $[19];
|
|
82
|
-
isSelectionStart = t3;
|
|
83
91
|
let t4;
|
|
84
|
-
if ($[
|
|
85
|
-
t4 =
|
|
86
|
-
$[
|
|
87
|
-
$[
|
|
88
|
-
$[
|
|
89
|
-
} else t4 = $[
|
|
90
|
-
|
|
92
|
+
if ($[22] !== props.date || $[23] !== rangeSelection.start) {
|
|
93
|
+
t4 = isSameDay(props.date, rangeSelection.start);
|
|
94
|
+
$[22] = props.date;
|
|
95
|
+
$[23] = rangeSelection.start;
|
|
96
|
+
$[24] = t4;
|
|
97
|
+
} else t4 = $[24];
|
|
98
|
+
isSelectionStart = t4;
|
|
99
|
+
let t5;
|
|
100
|
+
if ($[25] !== props.date || $[26] !== rangeSelection.end) {
|
|
101
|
+
t5 = rangeSelection.end ? isSameDay(props.date, rangeSelection.end) : false;
|
|
102
|
+
$[25] = props.date;
|
|
103
|
+
$[26] = rangeSelection.end;
|
|
104
|
+
$[27] = t5;
|
|
105
|
+
} else t5 = $[27];
|
|
106
|
+
isSelectionEnd = t5;
|
|
91
107
|
isSelectedCell = isSelectionStart || isSelectionEnd;
|
|
92
108
|
isSelectingMode = rangeSelection.isSelecting && !rangeSelection.end;
|
|
93
109
|
if (rangeSelection.start && rangeSelection.end) {
|
|
@@ -107,44 +123,44 @@ var CalendarCell = (t0) => {
|
|
|
107
123
|
isHoverRange = isAfterStart_0 && isBeforeEnd_0;
|
|
108
124
|
}
|
|
109
125
|
} else {
|
|
110
|
-
let t3;
|
|
111
|
-
if ($[23] !== isSelected || $[24] !== props.date || $[25] !== state) {
|
|
112
|
-
t3 = isRange(state) && state.highlightedRange ? isSameDay(props.date, state.highlightedRange.start) : isSelected;
|
|
113
|
-
$[23] = isSelected;
|
|
114
|
-
$[24] = props.date;
|
|
115
|
-
$[25] = state;
|
|
116
|
-
$[26] = t3;
|
|
117
|
-
} else t3 = $[26];
|
|
118
|
-
isSelectionStart = t3;
|
|
119
126
|
let t4;
|
|
120
|
-
if ($[
|
|
121
|
-
t4 = isRange(state) && state.highlightedRange ? isSameDay(props.date, state.highlightedRange.
|
|
122
|
-
$[
|
|
123
|
-
$[
|
|
124
|
-
$[
|
|
125
|
-
$[
|
|
126
|
-
} else t4 = $[
|
|
127
|
-
|
|
127
|
+
if ($[28] !== isSelected || $[29] !== props.date || $[30] !== state) {
|
|
128
|
+
t4 = isRange(state) && state.highlightedRange ? isSameDay(props.date, state.highlightedRange.start) : isSelected;
|
|
129
|
+
$[28] = isSelected;
|
|
130
|
+
$[29] = props.date;
|
|
131
|
+
$[30] = state;
|
|
132
|
+
$[31] = t4;
|
|
133
|
+
} else t4 = $[31];
|
|
134
|
+
isSelectionStart = t4;
|
|
128
135
|
let t5;
|
|
129
|
-
if ($[
|
|
130
|
-
t5 =
|
|
131
|
-
$[
|
|
132
|
-
$[
|
|
133
|
-
$[33] = isSelectionStart;
|
|
136
|
+
if ($[32] !== isSelected || $[33] !== props.date || $[34] !== state) {
|
|
137
|
+
t5 = isRange(state) && state.highlightedRange ? isSameDay(props.date, state.highlightedRange.end) : isSelected;
|
|
138
|
+
$[32] = isSelected;
|
|
139
|
+
$[33] = props.date;
|
|
134
140
|
$[34] = state;
|
|
135
141
|
$[35] = t5;
|
|
136
142
|
} else t5 = $[35];
|
|
137
|
-
|
|
143
|
+
isSelectionEnd = t5;
|
|
138
144
|
let t6;
|
|
139
145
|
if ($[36] !== isSelected || $[37] !== isSelectionEnd || $[38] !== isSelectionStart || $[39] !== state) {
|
|
140
|
-
t6 = isRange(state) && isSelected
|
|
146
|
+
t6 = isSelectionStart || isSelectionEnd || !isRange(state) && isSelected;
|
|
141
147
|
$[36] = isSelected;
|
|
142
148
|
$[37] = isSelectionEnd;
|
|
143
149
|
$[38] = isSelectionStart;
|
|
144
150
|
$[39] = state;
|
|
145
151
|
$[40] = t6;
|
|
146
152
|
} else t6 = $[40];
|
|
147
|
-
|
|
153
|
+
isSelectedCell = t6;
|
|
154
|
+
let t7;
|
|
155
|
+
if ($[41] !== isSelected || $[42] !== isSelectionEnd || $[43] !== isSelectionStart || $[44] !== state) {
|
|
156
|
+
t7 = isRange(state) && isSelected && !isSelectionStart && !isSelectionEnd;
|
|
157
|
+
$[41] = isSelected;
|
|
158
|
+
$[42] = isSelectionEnd;
|
|
159
|
+
$[43] = isSelectionStart;
|
|
160
|
+
$[44] = state;
|
|
161
|
+
$[45] = t7;
|
|
162
|
+
} else t7 = $[45];
|
|
163
|
+
isInRange = t7;
|
|
148
164
|
if (isRange(state) && state.highlightedRange && !isSelected) {
|
|
149
165
|
const dateValue_1 = props.date;
|
|
150
166
|
const isAfterStart_1 = dateValue_1.compare(state.highlightedRange.start) > 0;
|
|
@@ -152,9 +168,9 @@ var CalendarCell = (t0) => {
|
|
|
152
168
|
isHoverRange = isAfterStart_1 && isBeforeEnd_1;
|
|
153
169
|
}
|
|
154
170
|
}
|
|
155
|
-
let
|
|
156
|
-
if ($[
|
|
157
|
-
|
|
171
|
+
let t4;
|
|
172
|
+
if ($[46] !== isHoverRange || $[47] !== isInRange || $[48] !== isSelectedCell || $[49] !== isSelectingMode || $[50] !== isSelectionEnd || $[51] !== isSelectionStart) {
|
|
173
|
+
t4 = {
|
|
158
174
|
isSelectionStart,
|
|
159
175
|
isSelectionEnd,
|
|
160
176
|
isSelectedCell,
|
|
@@ -162,152 +178,154 @@ var CalendarCell = (t0) => {
|
|
|
162
178
|
isHoverRange,
|
|
163
179
|
isSelectingMode
|
|
164
180
|
};
|
|
165
|
-
$[
|
|
166
|
-
$[
|
|
167
|
-
$[
|
|
168
|
-
$[
|
|
169
|
-
$[
|
|
170
|
-
$[
|
|
171
|
-
$[
|
|
172
|
-
} else
|
|
173
|
-
const selectionState =
|
|
174
|
-
let
|
|
175
|
-
if ($[
|
|
176
|
-
|
|
181
|
+
$[46] = isHoverRange;
|
|
182
|
+
$[47] = isInRange;
|
|
183
|
+
$[48] = isSelectedCell;
|
|
184
|
+
$[49] = isSelectingMode;
|
|
185
|
+
$[50] = isSelectionEnd;
|
|
186
|
+
$[51] = isSelectionStart;
|
|
187
|
+
$[52] = t4;
|
|
188
|
+
} else t4 = $[52];
|
|
189
|
+
const selectionState = t4;
|
|
190
|
+
let t5;
|
|
191
|
+
if ($[53] !== isOutsideVisibleRange || $[54] !== isSelected || $[55] !== onApply || $[56] !== props.date || $[57] !== shouldCloseOnSelect || $[58] !== state) {
|
|
192
|
+
t5 = (event_1, eventHandler) => {
|
|
177
193
|
if (isOutsideVisibleRange) {
|
|
178
194
|
state.selectDate(props.date);
|
|
179
195
|
state.setFocusedDate(props.date);
|
|
180
196
|
}
|
|
181
|
-
eventHandler?.(
|
|
197
|
+
eventHandler?.(event_1);
|
|
182
198
|
if (isSelected && shouldCloseOnSelect) onApply?.(props.date);
|
|
183
199
|
};
|
|
184
|
-
$[
|
|
185
|
-
$[
|
|
186
|
-
$[
|
|
187
|
-
$[51] = props.date;
|
|
188
|
-
$[52] = shouldCloseOnSelect;
|
|
189
|
-
$[53] = state;
|
|
190
|
-
$[54] = t4;
|
|
191
|
-
} else t4 = $[54];
|
|
192
|
-
const handleEvent = t4;
|
|
193
|
-
let t5;
|
|
194
|
-
if ($[55] !== onDateHover || $[56] !== props.date || $[57] !== selectionState.isSelectingMode) {
|
|
195
|
-
t5 = () => {
|
|
196
|
-
if (onDateHover && selectionState.isSelectingMode) onDateHover(props.date);
|
|
197
|
-
};
|
|
198
|
-
$[55] = onDateHover;
|
|
200
|
+
$[53] = isOutsideVisibleRange;
|
|
201
|
+
$[54] = isSelected;
|
|
202
|
+
$[55] = onApply;
|
|
199
203
|
$[56] = props.date;
|
|
200
|
-
$[57] =
|
|
201
|
-
$[58] =
|
|
202
|
-
|
|
203
|
-
|
|
204
|
+
$[57] = shouldCloseOnSelect;
|
|
205
|
+
$[58] = state;
|
|
206
|
+
$[59] = t5;
|
|
207
|
+
} else t5 = $[59];
|
|
208
|
+
const handleEvent = t5;
|
|
204
209
|
let t6;
|
|
205
|
-
if ($[
|
|
210
|
+
if ($[60] !== onDateHover || $[61] !== props.date || $[62] !== selectionState.isSelectingMode) {
|
|
206
211
|
t6 = () => {
|
|
212
|
+
if (onDateHover && selectionState.isSelectingMode) onDateHover(props.date);
|
|
213
|
+
};
|
|
214
|
+
$[60] = onDateHover;
|
|
215
|
+
$[61] = props.date;
|
|
216
|
+
$[62] = selectionState.isSelectingMode;
|
|
217
|
+
$[63] = t6;
|
|
218
|
+
} else t6 = $[63];
|
|
219
|
+
const onMouseEnter = t6;
|
|
220
|
+
let t7;
|
|
221
|
+
if ($[64] !== onDateHover || $[65] !== selectionState.isSelectingMode) {
|
|
222
|
+
t7 = () => {
|
|
207
223
|
if (onDateHover && selectionState.isSelectingMode) onDateHover(null);
|
|
208
224
|
};
|
|
209
|
-
$[
|
|
210
|
-
$[
|
|
211
|
-
$[
|
|
212
|
-
} else
|
|
213
|
-
const onMouseLeave =
|
|
225
|
+
$[64] = onDateHover;
|
|
226
|
+
$[65] = selectionState.isSelectingMode;
|
|
227
|
+
$[66] = t7;
|
|
228
|
+
} else t7 = $[66];
|
|
229
|
+
const onMouseLeave = t7;
|
|
214
230
|
const { isSelectedCell: isSelectedCell_0, isInRange: isInRange_0, isHoverRange: isHoverRange_0, isSelectingMode: isSelectingMode_0, isSelectionStart: isSelectionStart_0, isSelectionEnd: isSelectionEnd_0 } = selectionState;
|
|
215
|
-
const
|
|
216
|
-
const
|
|
217
|
-
const
|
|
218
|
-
const
|
|
219
|
-
const
|
|
220
|
-
const
|
|
221
|
-
const
|
|
222
|
-
const
|
|
223
|
-
const
|
|
224
|
-
const
|
|
225
|
-
const
|
|
226
|
-
const
|
|
227
|
-
let t19;
|
|
228
|
-
if ($[62] !== t10 || $[63] !== t11 || $[64] !== t12 || $[65] !== t13 || $[66] !== t14 || $[67] !== t15 || $[68] !== t16 || $[69] !== t17 || $[70] !== t18 || $[71] !== t7 || $[72] !== t8 || $[73] !== t9) {
|
|
229
|
-
t19 = clsx("mx-auto flex h-10 w-full max-w-10 items-center justify-center rounded-button-rounding-m p-2", "focus:outline-none focus-visible:outline-1 focus-visible:outline-interactive-contained-primary-focus focus-visible:outline-offset-1", "border border-transparent border-solid", t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18);
|
|
230
|
-
$[62] = t10;
|
|
231
|
-
$[63] = t11;
|
|
232
|
-
$[64] = t12;
|
|
233
|
-
$[65] = t13;
|
|
234
|
-
$[66] = t14;
|
|
235
|
-
$[67] = t15;
|
|
236
|
-
$[68] = t16;
|
|
237
|
-
$[69] = t17;
|
|
238
|
-
$[70] = t18;
|
|
239
|
-
$[71] = t7;
|
|
240
|
-
$[72] = t8;
|
|
241
|
-
$[73] = t9;
|
|
242
|
-
$[74] = t19;
|
|
243
|
-
} else t19 = $[74];
|
|
244
|
-
const cellClassName = t19;
|
|
231
|
+
const t8 = !isSelectedCell_0 && !isOutsideVisibleRange && "bg-elevation-fill-default-1 text-interactive-text-secondary-idle";
|
|
232
|
+
const t9 = !isSelectedCell_0 && isOutsideVisibleRange && "bg-elevation-fill-default-1 text-interactive-text-secondary-disabled";
|
|
233
|
+
const t10 = isSelectedCell_0 && !isOutsideVisibleRange && "bg-interactive-contained-primary-idle text-interactive-contained-primary-on-idle";
|
|
234
|
+
const t11 = isSelectedCell_0 && !isOutsideVisibleRange && rangeSelection && !rangeSelection.isSelecting && isSelectionStart_0 && !isSelectionEnd_0 && "rounded-r-none";
|
|
235
|
+
const t12 = isSelectedCell_0 && !isOutsideVisibleRange && rangeSelection && !rangeSelection.isSelecting && isSelectionEnd_0 && !isSelectionStart_0 && "rounded-l-none";
|
|
236
|
+
const t13 = isDisabled && !isOutsideVisibleRange && "cursor-default";
|
|
237
|
+
const t14 = isDisabled && "opacity-20";
|
|
238
|
+
const t15 = !isSelectedCell_0 && !isInRange_0 && !isHoverRange_0 && !isSelectingMode_0 && !isDisabled && !isOutsideVisibleRange && "[@media(pointer:fine)]:hover:border-elevation-outline-default-1 [@media(pointer:fine)]:hover:text-interactive-text-secondary-hover";
|
|
239
|
+
const t16 = isInRange_0 && !isOutsideVisibleRange && "!rounded-none !bg-elevation-fill-default-2 text-interactive-text-secondary-hover";
|
|
240
|
+
const t17 = isHoverRange_0 && !isOutsideVisibleRange && "!rounded-none !bg-elevation-fill-default-2 text-interactive-text-secondary-hover";
|
|
241
|
+
const t18 = !isInRange_0 && !isSelectedCell_0 && isSelectingMode_0 && "hover:bg-interactive-contained-primary-idle hover:text-interactive-text-primary-idle-inverted";
|
|
242
|
+
const t19 = isSelectingMode_0 && !isSelectedCell_0 && !isInRange_0 && !isHoverRange_0 && !isDisabled && !isOutsideVisibleRange && "transition-all duration-75 hover:border-elevation-outline-default-1";
|
|
245
243
|
let t20;
|
|
246
|
-
if ($[75] !==
|
|
247
|
-
t20 =
|
|
248
|
-
$[
|
|
249
|
-
$[
|
|
250
|
-
$[
|
|
251
|
-
|
|
244
|
+
if ($[67] !== t10 || $[68] !== t11 || $[69] !== t12 || $[70] !== t13 || $[71] !== t14 || $[72] !== t15 || $[73] !== t16 || $[74] !== t17 || $[75] !== t18 || $[76] !== t19 || $[77] !== t8 || $[78] !== t9) {
|
|
245
|
+
t20 = clsx("mx-auto flex h-10 w-full max-w-10 items-center justify-center rounded-button-rounding-m p-2", "focus:outline-none focus-visible:outline-1 focus-visible:outline-interactive-contained-primary-focus focus-visible:outline-offset-1", "border border-transparent border-solid", t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19);
|
|
246
|
+
$[67] = t10;
|
|
247
|
+
$[68] = t11;
|
|
248
|
+
$[69] = t12;
|
|
249
|
+
$[70] = t13;
|
|
250
|
+
$[71] = t14;
|
|
251
|
+
$[72] = t15;
|
|
252
|
+
$[73] = t16;
|
|
253
|
+
$[74] = t17;
|
|
254
|
+
$[75] = t18;
|
|
255
|
+
$[76] = t19;
|
|
256
|
+
$[77] = t8;
|
|
257
|
+
$[78] = t9;
|
|
258
|
+
$[79] = t20;
|
|
259
|
+
} else t20 = $[79];
|
|
260
|
+
const cellClassName = t20;
|
|
252
261
|
let t21;
|
|
253
|
-
if ($[
|
|
254
|
-
t21 = (
|
|
255
|
-
$[
|
|
256
|
-
$[
|
|
257
|
-
$[
|
|
258
|
-
} else t21 = $[
|
|
262
|
+
if ($[80] !== buttonProps || $[81] !== focusProps) {
|
|
263
|
+
t21 = mergeProps(buttonProps, focusProps);
|
|
264
|
+
$[80] = buttonProps;
|
|
265
|
+
$[81] = focusProps;
|
|
266
|
+
$[82] = t21;
|
|
267
|
+
} else t21 = $[82];
|
|
259
268
|
let t22;
|
|
260
|
-
if ($[
|
|
261
|
-
t22 = (
|
|
262
|
-
$[
|
|
263
|
-
$[
|
|
264
|
-
$[
|
|
265
|
-
|
|
266
|
-
} else t22 = $[84];
|
|
269
|
+
if ($[83] !== handleEvent || $[84] !== onClick) {
|
|
270
|
+
t22 = (e) => handleEvent(e, onClick);
|
|
271
|
+
$[83] = handleEvent;
|
|
272
|
+
$[84] = onClick;
|
|
273
|
+
$[85] = t22;
|
|
274
|
+
} else t22 = $[85];
|
|
267
275
|
let t23;
|
|
268
|
-
if ($[
|
|
269
|
-
t23 =
|
|
276
|
+
if ($[86] !== handleEvent || $[87] !== onKeyboardNavigation || $[88] !== props.date) {
|
|
277
|
+
t23 = (e_0) => handleEvent(e_0, () => onKeyboardNavigation?.(e_0, props.date));
|
|
278
|
+
$[86] = handleEvent;
|
|
279
|
+
$[87] = onKeyboardNavigation;
|
|
280
|
+
$[88] = props.date;
|
|
281
|
+
$[89] = t23;
|
|
282
|
+
} else t23 = $[89];
|
|
283
|
+
let t24;
|
|
284
|
+
if ($[90] !== formattedDate) {
|
|
285
|
+
t24 = /* @__PURE__ */ jsx(Typography, {
|
|
270
286
|
as: "span",
|
|
271
287
|
size: "label-2",
|
|
272
288
|
className: "block w-6 overflow-hidden text-ellipsis text-center",
|
|
273
289
|
children: formattedDate
|
|
274
290
|
});
|
|
275
|
-
$[
|
|
276
|
-
$[
|
|
277
|
-
} else
|
|
278
|
-
let
|
|
279
|
-
if ($[
|
|
280
|
-
|
|
291
|
+
$[90] = formattedDate;
|
|
292
|
+
$[91] = t24;
|
|
293
|
+
} else t24 = $[91];
|
|
294
|
+
let t25;
|
|
295
|
+
if ($[92] !== cellClassName || $[93] !== onDoubleClick || $[94] !== onMouseEnter || $[95] !== onMouseLeave || $[96] !== t21 || $[97] !== t22 || $[98] !== t23 || $[99] !== t24) {
|
|
296
|
+
t25 = /* @__PURE__ */ jsx("div", {
|
|
281
297
|
ref,
|
|
282
|
-
...
|
|
298
|
+
...t21,
|
|
283
299
|
"aria-disabled": void 0,
|
|
284
300
|
onMouseEnter,
|
|
285
301
|
onMouseLeave,
|
|
286
302
|
className: cellClassName,
|
|
287
|
-
onClick:
|
|
288
|
-
|
|
289
|
-
|
|
303
|
+
onClick: t22,
|
|
304
|
+
onDoubleClick,
|
|
305
|
+
onKeyDown: t23,
|
|
306
|
+
children: t24
|
|
290
307
|
});
|
|
291
|
-
$[
|
|
292
|
-
$[
|
|
293
|
-
$[
|
|
294
|
-
$[
|
|
295
|
-
$[
|
|
296
|
-
$[
|
|
297
|
-
$[
|
|
298
|
-
$[
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
308
|
+
$[92] = cellClassName;
|
|
309
|
+
$[93] = onDoubleClick;
|
|
310
|
+
$[94] = onMouseEnter;
|
|
311
|
+
$[95] = onMouseLeave;
|
|
312
|
+
$[96] = t21;
|
|
313
|
+
$[97] = t22;
|
|
314
|
+
$[98] = t23;
|
|
315
|
+
$[99] = t24;
|
|
316
|
+
$[100] = t25;
|
|
317
|
+
} else t25 = $[100];
|
|
318
|
+
let t26;
|
|
319
|
+
if ($[101] !== cellProps || $[102] !== t25) {
|
|
320
|
+
t26 = /* @__PURE__ */ jsx("td", {
|
|
303
321
|
...cellProps,
|
|
304
|
-
children:
|
|
322
|
+
children: t25
|
|
305
323
|
});
|
|
306
|
-
$[
|
|
307
|
-
$[
|
|
308
|
-
$[
|
|
309
|
-
} else
|
|
310
|
-
return
|
|
324
|
+
$[101] = cellProps;
|
|
325
|
+
$[102] = t25;
|
|
326
|
+
$[103] = t26;
|
|
327
|
+
} else t26 = $[103];
|
|
328
|
+
return t26;
|
|
311
329
|
};
|
|
312
330
|
//#endregion
|
|
313
331
|
export { CalendarCell };
|