@povio/ui 3.3.0 → 3.3.1
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/README.md +1 -1
- package/dist/browser-tests/checkbox/CheckboxGroupHarness.d.ts +10 -0
- package/dist/browser-tests/checkbox/CheckboxHarness.d.ts +10 -0
- package/dist/browser-tests/checkbox/checkbox-group.spec.d.ts +1 -0
- package/dist/browser-tests/checkbox/checkbox.spec.d.ts +1 -0
- package/dist/browser-tests/datetime-picker/DateTimeHarnesses.d.ts +43 -0
- package/dist/browser-tests/datetime-picker/assertions.d.ts +9 -0
- package/dist/browser-tests/datetime-picker/date-input-focus.firefox.spec.d.ts +1 -0
- package/dist/browser-tests/datetime-picker/date-picker.spec.d.ts +1 -0
- package/dist/browser-tests/datetime-picker/date-range-picker.spec.d.ts +1 -0
- package/dist/browser-tests/datetime-picker/date-time-picker.spec.d.ts +1 -0
- package/dist/browser-tests/datetime-picker/time-picker.spec.d.ts +1 -0
- package/dist/browser-tests/file-upload/FileUploadHarness.d.ts +4 -0
- package/dist/browser-tests/file-upload/file-upload.spec.d.ts +1 -0
- package/dist/browser-tests/file-upload-container/FileUploadContainerHarness.d.ts +4 -0
- package/dist/browser-tests/file-upload-container/file-upload-container.spec.d.ts +1 -0
- package/dist/browser-tests/input-upload/InputUploadHarness.d.ts +9 -0
- package/dist/browser-tests/input-upload/input-upload.spec.d.ts +1 -0
- package/dist/browser-tests/modal/ModalHarness.d.ts +5 -0
- package/dist/browser-tests/modal/modal.spec.d.ts +1 -0
- package/dist/browser-tests/number-input/NumberInputHarness.d.ts +10 -0
- package/dist/browser-tests/number-input/number-input.spec.d.ts +1 -0
- package/dist/browser-tests/number-range-input/NumberRangeInputHarness.d.ts +10 -0
- package/dist/browser-tests/number-range-input/number-range-input.spec.d.ts +1 -0
- package/dist/browser-tests/password-input/PasswordInputHarness.d.ts +6 -0
- package/dist/browser-tests/password-input/password-input.spec.d.ts +1 -0
- package/dist/browser-tests/radio-group/RadioGroupHarness.d.ts +15 -0
- package/dist/browser-tests/radio-group/radio-group.spec.d.ts +1 -0
- package/dist/browser-tests/selection/SelectionHarnesses.d.ts +61 -0
- package/dist/browser-tests/selection/autocomplete.spec.d.ts +1 -0
- package/dist/browser-tests/selection/interactions.d.ts +2 -0
- package/dist/browser-tests/selection/query-autocomplete.spec.d.ts +1 -0
- package/dist/browser-tests/selection/query-select.spec.d.ts +1 -0
- package/dist/browser-tests/selection/select.spec.d.ts +1 -0
- package/dist/browser-tests/slider/SliderHarness.d.ts +11 -0
- package/dist/browser-tests/slider/slider.spec.d.ts +1 -0
- package/dist/browser-tests/text-area/TextAreaHarness.d.ts +10 -0
- package/dist/browser-tests/text-area/text-area.spec.d.ts +1 -0
- package/dist/browser-tests/text-input/TextInputHarness.d.ts +10 -0
- package/dist/browser-tests/text-input/text-input.spec.d.ts +1 -0
- package/dist/browser-tests/toggle/ToggleHarness.d.ts +10 -0
- package/dist/browser-tests/toggle/toggle.spec.d.ts +1 -0
- package/dist/browser-tests/utils/blur.d.ts +22 -0
- package/dist/browser-tests/utils/events.d.ts +4 -0
- package/dist/browser-tests/utils/input.d.ts +10 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +206 -55
- package/dist/components/buttons/Button/button.cva.d.ts +1 -1
- package/dist/components/buttons/Button/button.cva.js +4 -4
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +34 -9
- package/dist/components/buttons/PillButton/pillButton.cva.js +4 -4
- package/dist/components/buttons/shared/ButtonContent.js +80 -22
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +24 -10
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +222 -74
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +182 -56
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +128 -41
- package/dist/components/inputs/DateTime/shared/Calendar.js +339 -139
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +308 -114
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +150 -35
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +229 -95
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +296 -115
- package/dist/components/inputs/DateTime/shared/DateField.js +306 -135
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +338 -140
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +59 -10
- package/dist/components/inputs/File/FileUpload.js +1 -1
- package/dist/components/inputs/File/InputUpload.js +261 -65
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +180 -48
- package/dist/components/inputs/File/shared/FileUploadContentError.js +265 -95
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +261 -99
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +234 -56
- package/dist/components/inputs/File/shared/ProgressBar.js +102 -15
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +313 -75
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +83 -23
- package/dist/components/inputs/Selection/Select/QuerySelect.js +96 -30
- package/dist/components/inputs/Selection/shared/SelectListBox.js +163 -51
- package/dist/components/inputs/Selection/shared/useSelectItems.js +108 -48
- package/dist/components/inputs/Skeleton/InputFrame.js +550 -177
- package/dist/components/inputs/TextEditor/TextEditor.js +389 -87
- package/dist/components/navigation/Accordion/Accordion.js +69 -22
- package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
- package/dist/components/navigation/Stepper/Stepper.js +67 -22
- package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
- package/dist/components/overlays/BottomSheet/BottomSheet.js +1 -1
- package/dist/components/overlays/Modal/Modal.d.ts +3 -2
- package/dist/components/overlays/Modal/Modal.js +3 -1
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +110 -29
- package/dist/components/shared/pagination/Pagination.js +108 -22
- package/dist/components/shared/pagination/minWidth.cva.d.ts +1 -1
- package/dist/components/status/Alert/Alert.js +97 -30
- package/dist/components/table/InfiniteTable.js +67 -16
- package/dist/components/text/Typography/Typography.js +23 -8
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/theme.context.js +98 -45
- package/dist/config/uiConfig.context.js +39 -8
- package/dist/hooks/useDebounceCallback.js +51 -17
- package/dist/hooks/useFormAutosave.js +120 -33
- package/dist/hooks/useLongPressRepeat.js +55 -20
- package/dist/vitest.setup.browser.d.ts +6 -0
- package/package.json +1 -1
|
@@ -3,160 +3,316 @@ import { CalendarHeader } from "./CalendarHeader.js";
|
|
|
3
3
|
import { MonthPicker } from "./MonthPicker.js";
|
|
4
4
|
import { TimePickerForm } from "./TimePickerForm.js";
|
|
5
5
|
import { YearPicker } from "./YearPicker.js";
|
|
6
|
+
import { c } from "react/compiler-runtime";
|
|
6
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
8
|
import { clsx } from "clsx";
|
|
8
|
-
import {
|
|
9
|
+
import { useEffect, useState } from "react";
|
|
9
10
|
import { useCalendar } from "@react-aria/calendar";
|
|
10
11
|
//#region src/components/inputs/DateTime/shared/Calendar.tsx
|
|
11
|
-
var Calendar = (
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
var Calendar = (t0) => {
|
|
13
|
+
const $ = c(92);
|
|
14
|
+
let className;
|
|
15
|
+
let datePickerState;
|
|
16
|
+
let hourCycle;
|
|
17
|
+
let includesTime;
|
|
18
|
+
let isTimeOptional;
|
|
19
|
+
let onApply;
|
|
20
|
+
let onDateSelectionChange;
|
|
21
|
+
let onMonthYearChange;
|
|
22
|
+
let onMonthYearCommit;
|
|
23
|
+
let props;
|
|
24
|
+
let selectedDate;
|
|
25
|
+
let t1;
|
|
26
|
+
let t2;
|
|
27
|
+
if ($[0] !== t0) {
|
|
28
|
+
({className, includesTime, datePickerState, hourCycle, isTimeOptional, onApply, onMonthYearChange, onMonthYearCommit, selectedDate, granularity: t1, setDateValueOnDateSelection: t2, onDateSelectionChange, ...props} = t0);
|
|
29
|
+
$[0] = t0;
|
|
30
|
+
$[1] = className;
|
|
31
|
+
$[2] = datePickerState;
|
|
32
|
+
$[3] = hourCycle;
|
|
33
|
+
$[4] = includesTime;
|
|
34
|
+
$[5] = isTimeOptional;
|
|
35
|
+
$[6] = onApply;
|
|
36
|
+
$[7] = onDateSelectionChange;
|
|
37
|
+
$[8] = onMonthYearChange;
|
|
38
|
+
$[9] = onMonthYearCommit;
|
|
39
|
+
$[10] = props;
|
|
40
|
+
$[11] = selectedDate;
|
|
41
|
+
$[12] = t1;
|
|
42
|
+
$[13] = t2;
|
|
43
|
+
} else {
|
|
44
|
+
className = $[1];
|
|
45
|
+
datePickerState = $[2];
|
|
46
|
+
hourCycle = $[3];
|
|
47
|
+
includesTime = $[4];
|
|
48
|
+
isTimeOptional = $[5];
|
|
49
|
+
onApply = $[6];
|
|
50
|
+
onDateSelectionChange = $[7];
|
|
51
|
+
onMonthYearChange = $[8];
|
|
52
|
+
onMonthYearCommit = $[9];
|
|
53
|
+
props = $[10];
|
|
54
|
+
selectedDate = $[11];
|
|
55
|
+
t1 = $[12];
|
|
56
|
+
t2 = $[13];
|
|
57
|
+
}
|
|
58
|
+
const granularity = t1 === void 0 ? "day" : t1;
|
|
59
|
+
const setDateValueOnDateSelection = t2 === void 0 ? false : t2;
|
|
60
|
+
let t3;
|
|
61
|
+
if ($[14] !== granularity) {
|
|
62
|
+
t3 = () => {
|
|
63
|
+
if (granularity === "year") return "year";
|
|
64
|
+
if (granularity === "month") return "month";
|
|
65
|
+
return null;
|
|
66
|
+
};
|
|
67
|
+
$[14] = granularity;
|
|
68
|
+
$[15] = t3;
|
|
69
|
+
} else t3 = $[15];
|
|
70
|
+
const [toggleState, setToggleState] = useState(t3);
|
|
17
71
|
const { calendarProps, prevButtonProps, nextButtonProps } = useCalendar(props.calendarProps, props.state);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
72
|
+
let t4;
|
|
73
|
+
let t5;
|
|
74
|
+
if ($[16] !== granularity || $[17] !== includesTime || $[18] !== toggleState) {
|
|
75
|
+
t4 = () => {
|
|
76
|
+
if (granularity === "year" && toggleState !== "year") {
|
|
77
|
+
setToggleState("year");
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (granularity === "month" && toggleState === null) {
|
|
81
|
+
setToggleState("month");
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (granularity === "month" && toggleState === "time") {
|
|
85
|
+
setToggleState("month");
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (granularity === "day" && toggleState === "time" && !includesTime) setToggleState(null);
|
|
89
|
+
};
|
|
90
|
+
t5 = [
|
|
91
|
+
granularity,
|
|
92
|
+
toggleState,
|
|
93
|
+
includesTime
|
|
94
|
+
];
|
|
95
|
+
$[16] = granularity;
|
|
96
|
+
$[17] = includesTime;
|
|
97
|
+
$[18] = toggleState;
|
|
98
|
+
$[19] = t4;
|
|
99
|
+
$[20] = t5;
|
|
100
|
+
} else {
|
|
101
|
+
t4 = $[19];
|
|
102
|
+
t5 = $[20];
|
|
103
|
+
}
|
|
104
|
+
useEffect(t4, t5);
|
|
105
|
+
let t6;
|
|
106
|
+
if ($[21] !== granularity) {
|
|
107
|
+
t6 = () => {
|
|
108
|
+
if (granularity === "day") {
|
|
109
|
+
setToggleState(null);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
50
112
|
setToggleState("month");
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
};
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
113
|
+
};
|
|
114
|
+
$[21] = granularity;
|
|
115
|
+
$[22] = t6;
|
|
116
|
+
} else t6 = $[22];
|
|
117
|
+
const onMonthSelectionChange = t6;
|
|
118
|
+
let t7;
|
|
119
|
+
if ($[23] !== granularity) {
|
|
120
|
+
t7 = () => {
|
|
121
|
+
if (granularity === "day") {
|
|
122
|
+
setToggleState(null);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (granularity === "month") {
|
|
126
|
+
setToggleState("month");
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
setToggleState("year");
|
|
130
|
+
};
|
|
131
|
+
$[23] = granularity;
|
|
132
|
+
$[24] = t7;
|
|
133
|
+
} else t7 = $[24];
|
|
134
|
+
const onYearSelectionChange = t7;
|
|
135
|
+
let t8;
|
|
136
|
+
if ($[25] !== onMonthYearChange || $[26] !== props.state || $[27] !== toggleState) {
|
|
137
|
+
t8 = (months) => {
|
|
138
|
+
if (toggleState) return;
|
|
139
|
+
if (!onMonthYearChange) return;
|
|
140
|
+
const focusedDate = props.state.focusedDate;
|
|
141
|
+
if (months === -1) {
|
|
142
|
+
onMonthYearChange(focusedDate.subtract({ months: 1 }));
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
onMonthYearChange(focusedDate.add({ months: 1 }));
|
|
146
|
+
};
|
|
147
|
+
$[25] = onMonthYearChange;
|
|
148
|
+
$[26] = props.state;
|
|
149
|
+
$[27] = toggleState;
|
|
150
|
+
$[28] = t8;
|
|
151
|
+
} else t8 = $[28];
|
|
152
|
+
const handleHeaderMonthNavigation = t8;
|
|
153
|
+
let t9;
|
|
154
|
+
if ($[29] !== handleHeaderMonthNavigation || $[30] !== prevButtonProps) {
|
|
155
|
+
t9 = (event) => {
|
|
68
156
|
prevButtonProps.onPress?.(event);
|
|
69
157
|
handleHeaderMonthNavigation(-1);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
158
|
+
};
|
|
159
|
+
$[29] = handleHeaderMonthNavigation;
|
|
160
|
+
$[30] = prevButtonProps;
|
|
161
|
+
$[31] = t9;
|
|
162
|
+
} else t9 = $[31];
|
|
163
|
+
let t10;
|
|
164
|
+
if ($[32] !== prevButtonProps || $[33] !== t9) {
|
|
165
|
+
t10 = {
|
|
166
|
+
...prevButtonProps,
|
|
167
|
+
onPress: t9
|
|
168
|
+
};
|
|
169
|
+
$[32] = prevButtonProps;
|
|
170
|
+
$[33] = t9;
|
|
171
|
+
$[34] = t10;
|
|
172
|
+
} else t10 = $[34];
|
|
173
|
+
const headerPrevButtonProps = t10;
|
|
174
|
+
let t11;
|
|
175
|
+
if ($[35] !== handleHeaderMonthNavigation || $[36] !== nextButtonProps) {
|
|
176
|
+
t11 = (event_0) => {
|
|
75
177
|
nextButtonProps.onPress?.(event_0);
|
|
76
178
|
handleHeaderMonthNavigation(1);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
179
|
+
};
|
|
180
|
+
$[35] = handleHeaderMonthNavigation;
|
|
181
|
+
$[36] = nextButtonProps;
|
|
182
|
+
$[37] = t11;
|
|
183
|
+
} else t11 = $[37];
|
|
184
|
+
let t12;
|
|
185
|
+
if ($[38] !== nextButtonProps || $[39] !== t11) {
|
|
186
|
+
t12 = {
|
|
187
|
+
...nextButtonProps,
|
|
188
|
+
onPress: t11
|
|
189
|
+
};
|
|
190
|
+
$[38] = nextButtonProps;
|
|
191
|
+
$[39] = t11;
|
|
192
|
+
$[40] = t12;
|
|
193
|
+
} else t12 = $[40];
|
|
194
|
+
const headerNextButtonProps = t12;
|
|
195
|
+
let t13;
|
|
196
|
+
if ($[41] !== datePickerState || $[42] !== includesTime || $[43] !== setDateValueOnDateSelection) {
|
|
197
|
+
t13 = (date) => {
|
|
198
|
+
if (!includesTime || !setDateValueOnDateSelection) return;
|
|
199
|
+
datePickerState.setDateValue(date);
|
|
200
|
+
};
|
|
201
|
+
$[41] = datePickerState;
|
|
202
|
+
$[42] = includesTime;
|
|
203
|
+
$[43] = setDateValueOnDateSelection;
|
|
204
|
+
$[44] = t13;
|
|
205
|
+
} else t13 = $[44];
|
|
206
|
+
const onDateSelection = t13;
|
|
207
|
+
let t14;
|
|
208
|
+
if ($[45] !== datePickerState || $[46] !== includesTime || $[47] !== onApply || $[48] !== onDateSelectionChange || $[49] !== props.state || $[50] !== setDateValueOnDateSelection || $[51] !== toggleState) {
|
|
209
|
+
t14 = (selectedDate_0) => {
|
|
210
|
+
const resolvedDate = selectedDate_0 ?? props.state.focusedDate;
|
|
211
|
+
if (includesTime && resolvedDate && setDateValueOnDateSelection) {
|
|
95
212
|
datePickerState.setDateValue(resolvedDate);
|
|
96
213
|
onDateSelectionChange?.(resolvedDate);
|
|
97
214
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
215
|
+
if (includesTime && toggleState !== "time") {
|
|
216
|
+
if (!setDateValueOnDateSelection && resolvedDate) {
|
|
217
|
+
datePickerState.setDateValue(resolvedDate);
|
|
218
|
+
onDateSelectionChange?.(resolvedDate);
|
|
219
|
+
}
|
|
220
|
+
setToggleState("time");
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
if (datePickerState?.value && !setDateValueOnDateSelection) onApply(resolvedDate);
|
|
224
|
+
};
|
|
225
|
+
$[45] = datePickerState;
|
|
226
|
+
$[46] = includesTime;
|
|
227
|
+
$[47] = onApply;
|
|
228
|
+
$[48] = onDateSelectionChange;
|
|
229
|
+
$[49] = props.state;
|
|
230
|
+
$[50] = setDateValueOnDateSelection;
|
|
231
|
+
$[51] = toggleState;
|
|
232
|
+
$[52] = t14;
|
|
233
|
+
} else t14 = $[52];
|
|
234
|
+
const handleDateChange = t14;
|
|
235
|
+
let t15;
|
|
236
|
+
if ($[53] !== datePickerState || $[54] !== granularity || $[55] !== handleDateChange || $[56] !== includesTime || $[57] !== onApply || $[58] !== onDateSelection || $[59] !== onMonthSelectionChange || $[60] !== onMonthYearChange || $[61] !== onMonthYearCommit || $[62] !== onYearSelectionChange || $[63] !== props.state || $[64] !== selectedDate || $[65] !== setDateValueOnDateSelection || $[66] !== toggleState) {
|
|
237
|
+
t15 = () => {
|
|
238
|
+
if (!toggleState) {
|
|
239
|
+
if (granularity === "month") return /* @__PURE__ */ jsx(MonthPicker, {
|
|
240
|
+
state: props.state,
|
|
241
|
+
onSelectionChange: onMonthSelectionChange,
|
|
242
|
+
onDateChange: onMonthYearChange,
|
|
243
|
+
onCommit: onMonthYearCommit,
|
|
244
|
+
selectedDate
|
|
245
|
+
});
|
|
246
|
+
if (granularity === "year") return /* @__PURE__ */ jsx(YearPicker, {
|
|
247
|
+
state: props.state,
|
|
248
|
+
onSelectionChange: onYearSelectionChange,
|
|
249
|
+
onDateChange: onMonthYearChange,
|
|
250
|
+
onCommit: onMonthYearCommit,
|
|
251
|
+
selectedDate
|
|
252
|
+
});
|
|
253
|
+
return /* @__PURE__ */ jsx(CalendarGrid, {
|
|
254
|
+
state: props.state,
|
|
255
|
+
onApply: handleDateChange,
|
|
256
|
+
onDoubleClickApply: !includesTime ? onApply : void 0,
|
|
257
|
+
onDateSelection,
|
|
258
|
+
shouldApplyOnDateSelection: !includesTime || setDateValueOnDateSelection
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
if (toggleState === "month") {
|
|
262
|
+
if (granularity === "year") return /* @__PURE__ */ jsx(YearPicker, {
|
|
263
|
+
state: props.state,
|
|
264
|
+
onSelectionChange: onYearSelectionChange,
|
|
265
|
+
onDateChange: onMonthYearChange,
|
|
266
|
+
onCommit: onMonthYearCommit,
|
|
267
|
+
selectedDate
|
|
268
|
+
});
|
|
269
|
+
return /* @__PURE__ */ jsx(MonthPicker, {
|
|
270
|
+
state: props.state,
|
|
271
|
+
onSelectionChange: onMonthSelectionChange,
|
|
272
|
+
onDateChange: onMonthYearChange,
|
|
273
|
+
onCommit: onMonthYearCommit,
|
|
274
|
+
selectedDate
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
if (toggleState === "year") return /* @__PURE__ */ jsx(YearPicker, {
|
|
129
278
|
state: props.state,
|
|
130
279
|
onSelectionChange: onYearSelectionChange,
|
|
131
280
|
onDateChange: onMonthYearChange,
|
|
132
281
|
onCommit: onMonthYearCommit,
|
|
133
282
|
selectedDate
|
|
134
283
|
});
|
|
135
|
-
return /* @__PURE__ */ jsx(
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
onDateChange: onMonthYearChange,
|
|
139
|
-
onCommit: onMonthYearCommit,
|
|
140
|
-
selectedDate
|
|
284
|
+
if (toggleState === "time" && includesTime) return /* @__PURE__ */ jsx("div", {
|
|
285
|
+
className: "flex h-72 w-80 items-center justify-center",
|
|
286
|
+
children: /* @__PURE__ */ jsx(TimePickerForm, { datePickerState })
|
|
141
287
|
});
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
288
|
+
return null;
|
|
289
|
+
};
|
|
290
|
+
$[53] = datePickerState;
|
|
291
|
+
$[54] = granularity;
|
|
292
|
+
$[55] = handleDateChange;
|
|
293
|
+
$[56] = includesTime;
|
|
294
|
+
$[57] = onApply;
|
|
295
|
+
$[58] = onDateSelection;
|
|
296
|
+
$[59] = onMonthSelectionChange;
|
|
297
|
+
$[60] = onMonthYearChange;
|
|
298
|
+
$[61] = onMonthYearCommit;
|
|
299
|
+
$[62] = onYearSelectionChange;
|
|
300
|
+
$[63] = props.state;
|
|
301
|
+
$[64] = selectedDate;
|
|
302
|
+
$[65] = setDateValueOnDateSelection;
|
|
303
|
+
$[66] = toggleState;
|
|
304
|
+
$[67] = t15;
|
|
305
|
+
} else t15 = $[67];
|
|
306
|
+
const getContent = t15;
|
|
307
|
+
let t16;
|
|
308
|
+
if ($[68] !== className) {
|
|
309
|
+
t16 = clsx("flex min-h-0 w-full flex-col items-center", className);
|
|
310
|
+
$[68] = className;
|
|
311
|
+
$[69] = t16;
|
|
312
|
+
} else t16 = $[69];
|
|
313
|
+
let t17;
|
|
314
|
+
if ($[70] !== datePickerState || $[71] !== granularity || $[72] !== headerNextButtonProps || $[73] !== headerPrevButtonProps || $[74] !== hourCycle || $[75] !== includesTime || $[76] !== isTimeOptional || $[77] !== props.state || $[78] !== toggleState) {
|
|
315
|
+
t17 = /* @__PURE__ */ jsx(CalendarHeader, {
|
|
160
316
|
calendarState: props.state,
|
|
161
317
|
datePickerState,
|
|
162
318
|
prevButtonProps: headerPrevButtonProps,
|
|
@@ -167,11 +323,55 @@ var Calendar = ({ className, includesTime, datePickerState, hourCycle, isTimeOpt
|
|
|
167
323
|
granularity,
|
|
168
324
|
toggleState,
|
|
169
325
|
setToggleState
|
|
170
|
-
})
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
326
|
+
});
|
|
327
|
+
$[70] = datePickerState;
|
|
328
|
+
$[71] = granularity;
|
|
329
|
+
$[72] = headerNextButtonProps;
|
|
330
|
+
$[73] = headerPrevButtonProps;
|
|
331
|
+
$[74] = hourCycle;
|
|
332
|
+
$[75] = includesTime;
|
|
333
|
+
$[76] = isTimeOptional;
|
|
334
|
+
$[77] = props.state;
|
|
335
|
+
$[78] = toggleState;
|
|
336
|
+
$[79] = t17;
|
|
337
|
+
} else t17 = $[79];
|
|
338
|
+
const t18 = toggleState !== "year" && "pb-8 md:pb-0";
|
|
339
|
+
let t19;
|
|
340
|
+
if ($[80] !== t18) {
|
|
341
|
+
t19 = clsx("flex min-h-0 w-full flex-1 flex-col items-center", t18);
|
|
342
|
+
$[80] = t18;
|
|
343
|
+
$[81] = t19;
|
|
344
|
+
} else t19 = $[81];
|
|
345
|
+
let t20;
|
|
346
|
+
if ($[82] !== getContent) {
|
|
347
|
+
t20 = getContent();
|
|
348
|
+
$[82] = getContent;
|
|
349
|
+
$[83] = t20;
|
|
350
|
+
} else t20 = $[83];
|
|
351
|
+
let t21;
|
|
352
|
+
if ($[84] !== t19 || $[85] !== t20) {
|
|
353
|
+
t21 = /* @__PURE__ */ jsx("div", {
|
|
354
|
+
className: t19,
|
|
355
|
+
children: t20
|
|
356
|
+
});
|
|
357
|
+
$[84] = t19;
|
|
358
|
+
$[85] = t20;
|
|
359
|
+
$[86] = t21;
|
|
360
|
+
} else t21 = $[86];
|
|
361
|
+
let t22;
|
|
362
|
+
if ($[87] !== calendarProps || $[88] !== t16 || $[89] !== t17 || $[90] !== t21) {
|
|
363
|
+
t22 = /* @__PURE__ */ jsxs("div", {
|
|
364
|
+
...calendarProps,
|
|
365
|
+
className: t16,
|
|
366
|
+
children: [t17, t21]
|
|
367
|
+
});
|
|
368
|
+
$[87] = calendarProps;
|
|
369
|
+
$[88] = t16;
|
|
370
|
+
$[89] = t17;
|
|
371
|
+
$[90] = t21;
|
|
372
|
+
$[91] = t22;
|
|
373
|
+
} else t22 = $[91];
|
|
374
|
+
return t22;
|
|
175
375
|
};
|
|
176
376
|
//#endregion
|
|
177
377
|
export { Calendar };
|