@agilant/toga-blox 1.0.152 → 1.0.154
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.
|
File without changes
|
|
File without changes
|
|
@@ -110,50 +110,56 @@ function SearchDatePickerInput({ themeBgColor = "bg-sky-500", lightThemeBg = "bg
|
|
|
110
110
|
setActiveInput(null);
|
|
111
111
|
};
|
|
112
112
|
// Load from localStorage if there's an existing criterion for this column.
|
|
113
|
-
useEffect(() => {
|
|
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
|
-
}
|
|
113
|
+
// useEffect(() => {
|
|
114
|
+
// if (!column?.id) return;
|
|
115
|
+
// const stored = localStorage.getItem(localStorageKey);
|
|
116
|
+
// if (stored) {
|
|
117
|
+
// try {
|
|
118
|
+
// const parsed = JSON.parse(stored);
|
|
119
|
+
// const existing = parsed.find(
|
|
120
|
+
// (crit: any) => crit.searchColumn?.id === column.id
|
|
121
|
+
// );
|
|
122
|
+
// if (existing?.submittedSearchText) {
|
|
123
|
+
// const { operator, dateStr } = parseOperatorAndDate(
|
|
124
|
+
// existing.submittedSearchText
|
|
125
|
+
// );
|
|
126
|
+
// if (operator && dropdownOptions.length) {
|
|
127
|
+
// const foundOp = dropdownOptions.find(
|
|
128
|
+
// (opt) => opt.value === operator
|
|
129
|
+
// );
|
|
130
|
+
// if (foundOp) setLocalOperator(foundOp);
|
|
131
|
+
// }
|
|
132
|
+
// if (!toggleStatus && dateStr) {
|
|
133
|
+
// const d = new Date(dateStr.trim());
|
|
134
|
+
// if (!isNaN(d.getTime())) {
|
|
135
|
+
// setLocalDate(d);
|
|
136
|
+
// setDateInputValue(formatDateAsMonthDayYear(d));
|
|
137
|
+
// }
|
|
138
|
+
// } else if (toggleStatus && dateStr) {
|
|
139
|
+
// const parts = dateStr.split(" - ");
|
|
140
|
+
// if (parts.length === 2) {
|
|
141
|
+
// const startDate = new Date(parts[0].trim());
|
|
142
|
+
// const endDate = new Date(parts[1].trim());
|
|
143
|
+
// if (!isNaN(startDate.getTime())) {
|
|
144
|
+
// setLocalStartDate(startDate);
|
|
145
|
+
// setStartDateInputValue(
|
|
146
|
+
// formatDateAsMonthDayYear(startDate)
|
|
147
|
+
// );
|
|
148
|
+
// }
|
|
149
|
+
// if (!isNaN(endDate.getTime())) {
|
|
150
|
+
// setLocalEndDate(endDate);
|
|
151
|
+
// setEndDateInputValue(
|
|
152
|
+
// formatDateAsMonthDayYear(endDate)
|
|
153
|
+
// );
|
|
154
|
+
// }
|
|
155
|
+
// }
|
|
156
|
+
// }
|
|
157
|
+
// }
|
|
158
|
+
// } catch (err) {
|
|
159
|
+
// console.error("Error loading from localStorage:", err);
|
|
160
|
+
// }
|
|
161
|
+
// }
|
|
162
|
+
// }, [column?.id, localStorageKey, dropdownOptions, toggleStatus]);
|
|
157
163
|
// Sync props with local state—but only update if the user isn’t actively editing.
|
|
158
164
|
useEffect(() => {
|
|
159
165
|
if (selectedDate && activeInput !== "single") {
|
|
@@ -312,7 +318,7 @@ function SearchDatePickerInput({ themeBgColor = "bg-sky-500", lightThemeBg = "bg
|
|
|
312
318
|
}, [isDatePickerOpen]);
|
|
313
319
|
// Render the DayPicker – for both single and range modes.
|
|
314
320
|
const dayPicker = !toggleStatus
|
|
315
|
-
? isDatePickerOpen && (_jsxs("div", { className: "absolute
|
|
321
|
+
? isDatePickerOpen && (_jsxs("div", { className: "absolute py-4 top-16 w-auto z-50 shadow-lg bg-white", children: [_jsx("div", { onClick: handlePickerClose, className: "hover:cursor-pointer text-right pr-3", children: getFontAwesomeIcon("x", "regular") }), _jsx(DayPicker, { mode: "single", selected: parseUserDateInput(dateInputValue) || localDate, onSelect: (day) => {
|
|
316
322
|
if (day) {
|
|
317
323
|
setLocalDate(day);
|
|
318
324
|
setDateInputValue(formatDateAsMonthDayYear(day));
|
|
@@ -322,7 +328,7 @@ function SearchDatePickerInput({ themeBgColor = "bg-sky-500", lightThemeBg = "bg
|
|
|
322
328
|
setActiveInput(null);
|
|
323
329
|
} })] }))
|
|
324
330
|
: isDatePickerOpen &&
|
|
325
|
-
activeInput && (_jsx("div", { className: "absolute
|
|
331
|
+
activeInput && (_jsx("div", { className: "absolute py-4 top-16 w-auto z-50 shadow-lg bg-white", children: activeInput === "start" ? (_jsxs(_Fragment, { children: [_jsx("div", { onClick: handlePickerClose, className: "hover:cursor-pointer text-right pr-3", children: getFontAwesomeIcon("x", "regular") }), _jsx(DayPicker, { mode: "single", selected: parseUserDateInput(startDateInputValue) ||
|
|
326
332
|
localStartDate, onSelect: (day) => {
|
|
327
333
|
if (day) {
|
|
328
334
|
setLocalStartDate(day);
|