@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.
@@ -0,0 +1,2 @@
1
+ // export { default } from "./PageSection";
2
+ // export * from "./PageSection.types";
@@ -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
- if (!column?.id)
115
- return;
116
- const stored = localStorage.getItem(localStorageKey);
117
- if (stored) {
118
- try {
119
- const parsed = JSON.parse(stored);
120
- const existing = parsed.find((crit) => crit.searchColumn?.id === column.id);
121
- if (existing?.submittedSearchText) {
122
- const { operator, dateStr } = parseOperatorAndDate(existing.submittedSearchText);
123
- if (operator && dropdownOptions.length) {
124
- const foundOp = dropdownOptions.find((opt) => opt.value === operator);
125
- if (foundOp)
126
- setLocalOperator(foundOp);
127
- }
128
- if (!toggleStatus && dateStr) {
129
- const d = new Date(dateStr.trim());
130
- if (!isNaN(d.getTime())) {
131
- setLocalDate(d);
132
- setDateInputValue(formatDateAsMonthDayYear(d));
133
- }
134
- }
135
- else if (toggleStatus && dateStr) {
136
- const parts = dateStr.split(" - ");
137
- if (parts.length === 2) {
138
- const startDate = new Date(parts[0].trim());
139
- const endDate = new Date(parts[1].trim());
140
- if (!isNaN(startDate.getTime())) {
141
- setLocalStartDate(startDate);
142
- setStartDateInputValue(formatDateAsMonthDayYear(startDate));
143
- }
144
- if (!isNaN(endDate.getTime())) {
145
- setLocalEndDate(endDate);
146
- setEndDateInputValue(formatDateAsMonthDayYear(endDate));
147
- }
148
- }
149
- }
150
- }
151
- }
152
- catch (err) {
153
- console.error("Error loading from localStorage:", err);
154
- }
155
- }
156
- }, [column?.id, localStorageKey, dropdownOptions, toggleStatus]);
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 p-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) => {
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 p-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) ||
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);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agilant/toga-blox",
3
3
  "private": false,
4
- "version": "1.0.152",
4
+ "version": "1.0.154",
5
5
  "description": "",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",