@povio/ui 3.3.0-rc.4 → 3.4.0-rc.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 +15 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.js +55 -206
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +9 -34
- package/dist/components/buttons/shared/ButtonContent.js +22 -80
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +1 -2
- package/dist/components/inputs/Checkbox/Checkbox.js +93 -100
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +10 -24
- package/dist/components/inputs/Checkbox/CheckboxGroup.d.ts +1 -2
- package/dist/components/inputs/Checkbox/CheckboxGroup.js +109 -113
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +1 -2
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +97 -238
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +1 -2
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +88 -214
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +1 -2
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +64 -143
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +1 -2
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +275 -294
- package/dist/components/inputs/DateTime/shared/Calendar.js +139 -339
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +114 -308
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +35 -150
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +95 -229
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +115 -296
- package/dist/components/inputs/DateTime/shared/DateField.js +135 -306
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +1 -2
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +136 -343
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +10 -59
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +1 -2
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +43 -46
- package/dist/components/inputs/File/FileUpload.d.ts +1 -1
- package/dist/components/inputs/File/FileUpload.js +18 -18
- package/dist/components/inputs/File/InputUpload.d.ts +1 -1
- package/dist/components/inputs/File/InputUpload.js +82 -278
- package/dist/components/inputs/File/fileUpload.types.d.ts +1 -1
- package/dist/components/inputs/File/inputUpload.types.d.ts +1 -1
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +48 -180
- package/dist/components/inputs/File/shared/FileUploadContentError.js +95 -265
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +99 -261
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +56 -234
- package/dist/components/inputs/File/shared/ProgressBar.js +15 -102
- package/dist/components/inputs/FormField/FormField.js +34 -47
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +1 -1
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +19 -19
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +1 -1
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +93 -331
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.d.ts +1 -1
- package/dist/components/inputs/Input/TextArea/TextArea.d.ts +1 -1
- package/dist/components/inputs/Input/TextArea/TextArea.js +18 -18
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +2 -2
- package/dist/components/inputs/Input/TextInput/TextInput.js +36 -38
- package/dist/components/inputs/Inputs/Form.d.ts +4 -4
- package/dist/components/inputs/Inputs/InputItem.d.ts +22 -22
- package/dist/components/inputs/Inputs/InputItem.js +35 -36
- package/dist/components/inputs/Inputs/Inputs.d.ts +2 -2
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -2
- package/dist/components/inputs/RadioGroup/RadioGroup.js +107 -111
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +1 -1
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +26 -86
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +1 -1
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +19 -19
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +1 -1
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +1 -1
- package/dist/components/inputs/Selection/Select/QuerySelect.js +49 -115
- package/dist/components/inputs/Selection/Select/Select.d.ts +1 -1
- package/dist/components/inputs/Selection/Select/Select.js +22 -22
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +0 -1
- package/dist/components/inputs/Selection/shared/SelectBase.js +34 -37
- package/dist/components/inputs/Selection/shared/SelectInput.js +1 -0
- package/dist/components/inputs/Selection/shared/SelectListBox.js +51 -163
- package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/select.context.js +4 -8
- package/dist/components/inputs/Selection/shared/select.types.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/useSelectItems.js +48 -108
- package/dist/components/inputs/Skeleton/InputFrame.js +177 -552
- package/dist/components/inputs/Slider/Slider.d.ts +1 -1
- package/dist/components/inputs/Slider/Slider.js +18 -18
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -1
- package/dist/components/inputs/TextEditor/TextEditor.js +105 -407
- package/dist/components/inputs/Toggle/Toggle.d.ts +1 -2
- package/dist/components/inputs/Toggle/Toggle.js +59 -63
- package/dist/components/inputs/shared/InputClear.js +24 -40
- package/dist/components/inputs/shared/form.binding.d.ts +27 -0
- package/dist/components/inputs/shared/form.binding.js +57 -0
- package/dist/components/inputs/shared/form.types.d.ts +9 -8
- package/dist/components/inputs/shared/form.types.js +8 -0
- package/dist/components/navigation/Accordion/Accordion.js +22 -69
- package/dist/components/navigation/Accordion/AccordionItem.js +41 -86
- package/dist/components/navigation/Stepper/Stepper.js +22 -67
- package/dist/components/overlays/ActionModal/ActionModal.js +35 -169
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +29 -110
- package/dist/components/segment/Segment.d.ts +1 -1
- package/dist/components/segment/Segment.js +17 -17
- package/dist/components/segment/segment.types.d.ts +1 -1
- package/dist/components/shared/pagination/Pagination.js +22 -108
- package/dist/components/status/Alert/Alert.js +30 -97
- package/dist/components/table/InfiniteTable.js +16 -67
- package/dist/components/table/Table.d.ts +2 -8
- package/dist/components/table/Table.js +33 -55
- package/dist/components/text/Typography/Typography.js +8 -23
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/theme.context.js +45 -98
- package/dist/config/uiConfig.context.d.ts +5 -5
- package/dist/config/uiConfig.context.js +11 -51
- package/dist/config/uiOverrides.context.d.ts +0 -1
- package/dist/helpers/dynamicColumns.d.ts +1 -1
- package/dist/helpers/dynamicInputs.d.ts +7 -7
- package/dist/hooks/useAutosave.d.ts +4 -4
- package/dist/hooks/useAutosave.js +64 -49
- package/dist/hooks/useDebounceCallback.js +17 -51
- package/dist/hooks/useForm.d.ts +39 -15
- package/dist/hooks/useForm.js +96 -43
- package/dist/hooks/useFormAutosave.d.ts +8 -9
- package/dist/hooks/useFormAutosave.js +49 -122
- package/dist/hooks/useLongPressRepeat.js +20 -55
- package/dist/index.d.ts +2 -3
- package/dist/index.js +3 -4
- package/package.json +3 -4
- package/dist/components/inputs/FormField/formField.cva.d.ts +0 -11
- package/dist/components/inputs/FormField/formField.cva.js +0 -16
- package/dist/components/table/TableColumnFilterInput.d.ts +0 -9
- package/dist/components/table/TableColumnFilterInput.js +0 -108
- package/dist/components/table/TableColumnFilterPlaceholder.d.ts +0 -5
- package/dist/components/table/TableColumnFilterPlaceholder.js +0 -41
- package/dist/components/table/TableColumnFilterRow.d.ts +0 -16
- package/dist/components/table/TableColumnFilterRow.js +0 -68
- package/dist/hooks/useAutosave.spec.d.ts +0 -1
|
@@ -3,316 +3,160 @@ 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";
|
|
7
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
7
|
import { clsx } from "clsx";
|
|
9
|
-
import { useEffect, useState } from "react";
|
|
8
|
+
import { useCallback, useEffect, useState } from "react";
|
|
10
9
|
import { useCalendar } from "@react-aria/calendar";
|
|
11
10
|
//#region src/components/inputs/DateTime/shared/Calendar.tsx
|
|
12
|
-
var Calendar = (
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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);
|
|
11
|
+
var Calendar = ({ className, includesTime, datePickerState, hourCycle, isTimeOptional, onApply, onMonthYearChange, onMonthYearCommit, selectedDate, granularity = "day", setDateValueOnDateSelection = false, onDateSelectionChange, ...props }) => {
|
|
12
|
+
const [toggleState, setToggleState] = useState(() => {
|
|
13
|
+
if (granularity === "year") return "year";
|
|
14
|
+
if (granularity === "month") return "month";
|
|
15
|
+
return null;
|
|
16
|
+
});
|
|
71
17
|
const { calendarProps, prevButtonProps, nextButtonProps } = useCalendar(props.calendarProps, props.state);
|
|
72
|
-
|
|
73
|
-
|
|
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
|
-
}
|
|
112
|
-
setToggleState("month");
|
|
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
|
-
}
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (granularity === "year" && toggleState !== "year") {
|
|
129
20
|
setToggleState("year");
|
|
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
|
-
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (granularity === "month" && toggleState === null) {
|
|
24
|
+
setToggleState("month");
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (granularity === "month" && toggleState === "time") {
|
|
28
|
+
setToggleState("month");
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (granularity === "day" && toggleState === "time" && !includesTime) setToggleState(null);
|
|
32
|
+
}, [
|
|
33
|
+
granularity,
|
|
34
|
+
toggleState,
|
|
35
|
+
includesTime
|
|
36
|
+
]);
|
|
37
|
+
const onMonthSelectionChange = () => {
|
|
38
|
+
if (granularity === "day") {
|
|
39
|
+
setToggleState(null);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
setToggleState("month");
|
|
43
|
+
};
|
|
44
|
+
const onYearSelectionChange = () => {
|
|
45
|
+
if (granularity === "day") {
|
|
46
|
+
setToggleState(null);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (granularity === "month") {
|
|
50
|
+
setToggleState("month");
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
setToggleState("year");
|
|
54
|
+
};
|
|
55
|
+
const handleHeaderMonthNavigation = (months) => {
|
|
56
|
+
if (toggleState) return;
|
|
57
|
+
if (!onMonthYearChange) return;
|
|
58
|
+
const focusedDate = props.state.focusedDate;
|
|
59
|
+
if (months === -1) {
|
|
60
|
+
onMonthYearChange(focusedDate.subtract({ months: 1 }));
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
onMonthYearChange(focusedDate.add({ months: 1 }));
|
|
64
|
+
};
|
|
65
|
+
const headerPrevButtonProps = {
|
|
66
|
+
...prevButtonProps,
|
|
67
|
+
onPress: (event) => {
|
|
156
68
|
prevButtonProps.onPress?.(event);
|
|
157
69
|
handleHeaderMonthNavigation(-1);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
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) => {
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const headerNextButtonProps = {
|
|
73
|
+
...nextButtonProps,
|
|
74
|
+
onPress: (event_0) => {
|
|
177
75
|
nextButtonProps.onPress?.(event_0);
|
|
178
76
|
handleHeaderMonthNavigation(1);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
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) {
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
const onDateSelection = useCallback((date) => {
|
|
80
|
+
if (!includesTime || !setDateValueOnDateSelection) return;
|
|
81
|
+
datePickerState.setDateValue(date);
|
|
82
|
+
}, [
|
|
83
|
+
includesTime,
|
|
84
|
+
datePickerState,
|
|
85
|
+
setDateValueOnDateSelection
|
|
86
|
+
]);
|
|
87
|
+
const handleDateChange = (selectedDate_0) => {
|
|
88
|
+
const resolvedDate = selectedDate_0 ?? props.state.focusedDate;
|
|
89
|
+
if (includesTime && resolvedDate && setDateValueOnDateSelection) {
|
|
90
|
+
datePickerState.setDateValue(resolvedDate);
|
|
91
|
+
onDateSelectionChange?.(resolvedDate);
|
|
92
|
+
}
|
|
93
|
+
if (includesTime && toggleState !== "time") {
|
|
94
|
+
if (!setDateValueOnDateSelection && resolvedDate) {
|
|
212
95
|
datePickerState.setDateValue(resolvedDate);
|
|
213
96
|
onDateSelectionChange?.(resolvedDate);
|
|
214
97
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
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, {
|
|
98
|
+
setToggleState("time");
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
if (datePickerState?.value && !setDateValueOnDateSelection) onApply(resolvedDate);
|
|
102
|
+
};
|
|
103
|
+
const getContent = () => {
|
|
104
|
+
if (!toggleState) {
|
|
105
|
+
if (granularity === "month") return /* @__PURE__ */ jsx(MonthPicker, {
|
|
106
|
+
state: props.state,
|
|
107
|
+
onSelectionChange: onMonthSelectionChange,
|
|
108
|
+
onDateChange: onMonthYearChange,
|
|
109
|
+
onCommit: onMonthYearCommit,
|
|
110
|
+
selectedDate
|
|
111
|
+
});
|
|
112
|
+
if (granularity === "year") return /* @__PURE__ */ jsx(YearPicker, {
|
|
278
113
|
state: props.state,
|
|
279
114
|
onSelectionChange: onYearSelectionChange,
|
|
280
115
|
onDateChange: onMonthYearChange,
|
|
281
116
|
onCommit: onMonthYearCommit,
|
|
282
117
|
selectedDate
|
|
283
118
|
});
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
119
|
+
return /* @__PURE__ */ jsx(CalendarGrid, {
|
|
120
|
+
state: props.state,
|
|
121
|
+
onApply: handleDateChange,
|
|
122
|
+
onDoubleClickApply: !includesTime ? onApply : void 0,
|
|
123
|
+
onDateSelection,
|
|
124
|
+
shouldApplyOnDateSelection: !includesTime || setDateValueOnDateSelection
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
if (toggleState === "month") {
|
|
128
|
+
if (granularity === "year") return /* @__PURE__ */ jsx(YearPicker, {
|
|
129
|
+
state: props.state,
|
|
130
|
+
onSelectionChange: onYearSelectionChange,
|
|
131
|
+
onDateChange: onMonthYearChange,
|
|
132
|
+
onCommit: onMonthYearCommit,
|
|
133
|
+
selectedDate
|
|
287
134
|
});
|
|
288
|
-
return
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
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, {
|
|
135
|
+
return /* @__PURE__ */ jsx(MonthPicker, {
|
|
136
|
+
state: props.state,
|
|
137
|
+
onSelectionChange: onMonthSelectionChange,
|
|
138
|
+
onDateChange: onMonthYearChange,
|
|
139
|
+
onCommit: onMonthYearCommit,
|
|
140
|
+
selectedDate
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
if (toggleState === "year") return /* @__PURE__ */ jsx(YearPicker, {
|
|
144
|
+
state: props.state,
|
|
145
|
+
onSelectionChange: onYearSelectionChange,
|
|
146
|
+
onDateChange: onMonthYearChange,
|
|
147
|
+
onCommit: onMonthYearCommit,
|
|
148
|
+
selectedDate
|
|
149
|
+
});
|
|
150
|
+
if (toggleState === "time" && includesTime) return /* @__PURE__ */ jsx("div", {
|
|
151
|
+
className: "flex h-72 w-80 items-center justify-center",
|
|
152
|
+
children: /* @__PURE__ */ jsx(TimePickerForm, { datePickerState })
|
|
153
|
+
});
|
|
154
|
+
return null;
|
|
155
|
+
};
|
|
156
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
157
|
+
...calendarProps,
|
|
158
|
+
className: clsx("flex min-h-0 w-full flex-col items-center", className),
|
|
159
|
+
children: [/* @__PURE__ */ jsx(CalendarHeader, {
|
|
316
160
|
calendarState: props.state,
|
|
317
161
|
datePickerState,
|
|
318
162
|
prevButtonProps: headerPrevButtonProps,
|
|
@@ -323,55 +167,11 @@ var Calendar = (t0) => {
|
|
|
323
167
|
granularity,
|
|
324
168
|
toggleState,
|
|
325
169
|
setToggleState
|
|
326
|
-
})
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
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;
|
|
170
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
171
|
+
className: clsx("flex min-h-0 w-full flex-1 flex-col items-center", toggleState !== "year" && "pb-8 md:pb-0"),
|
|
172
|
+
children: getContent()
|
|
173
|
+
})]
|
|
174
|
+
});
|
|
375
175
|
};
|
|
376
176
|
//#endregion
|
|
377
177
|
export { Calendar };
|