@agilant/toga-blox 1.0.141 → 1.0.143
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.
|
@@ -229,7 +229,6 @@ function SearchDatePickerInput({ themeBgColor = "bg-sky-500", lightThemeBg = "bg
|
|
|
229
229
|
const dateStr = localDate
|
|
230
230
|
? formatDateAsYearMonthDay(localDate)
|
|
231
231
|
: "";
|
|
232
|
-
console.log(dateStr, "HERE");
|
|
233
232
|
finalText = localOperator.value + dateStr;
|
|
234
233
|
onDateSelect?.(localDate);
|
|
235
234
|
}
|
|
@@ -342,25 +341,25 @@ function SearchDatePickerInput({ themeBgColor = "bg-sky-500", lightThemeBg = "bg
|
|
|
342
341
|
setIsDatePickerOpen(false);
|
|
343
342
|
setActiveInput(null);
|
|
344
343
|
}
|
|
345
|
-
}, firstIcon: getFontAwesomeIcon("calendar", "regular"), required: false, additionalClasses: "border-2 px-3 py-2 flex-auto h-10 text-left rounded-r min-w-52 max-w-52", hasAutoFocus: true, firstIconTop: firstIconTop, placeHolderColor: placeHolderColor }) })) : (_jsx(_Fragment, { children: _jsxs("button", { onClick: openSinglePicker, className: `${buttonPlaceHolderTextColor} border-2 px-3 py-2 flex-auto h-10 text-left rounded-r min-w-52 max-w-52 rounded`, children: [_jsx("span", { className: "pr-2", children: getFontAwesomeIcon("calendar", "regular") }), localDate
|
|
344
|
+
}, firstIcon: getFontAwesomeIcon("calendar", "regular"), required: false, additionalClasses: "border-2 px-3 py-2 flex-auto h-10 text-left rounded-r min-w-52 max-w-52", hasAutoFocus: true, firstIconTop: firstIconTop, placeHolderColor: placeHolderColor }) })) : (_jsx(_Fragment, { children: _jsxs("button", { onClick: openSinglePicker, className: `${buttonPlaceHolderTextColor} border-2 px-3 py-2 flex-auto h-10 text-left rounded-r min-w-52 max-w-52 rounded-r`, children: [_jsx("span", { className: "pr-2", children: getFontAwesomeIcon("calendar", "regular") }), localDate
|
|
346
345
|
? formatDateAsMonthDayYear(localDate)
|
|
347
|
-
: "mm/dd/yyyy"] }) }))] })) }), dayPicker,
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
346
|
+
: "mm/dd/yyyy"] }) }))] })) }), dayPicker, searchItems?.length ? (_jsx("div", { className: "flex flex-wrap bg-white py-2 px-2 mt-2 rounded-md", children: searchItems.map((item, index) => {
|
|
347
|
+
const cleanedText = getCleanedText(item, removePattern);
|
|
348
|
+
return (_jsx(Badge, { backgroundColor: pillColor, borderRadius: "rounded-full", hasRightIcon: true, icon: _jsx("div", { className: "text-white text-xxs", children: getFontAwesomeIcon("xmark", "solid") }), iconSize: "text-sm", onClick: () => {
|
|
349
|
+
const newSearchItems = searchItems.filter((it) => it !== item);
|
|
350
|
+
setSearchItems?.(newSearchItems);
|
|
351
|
+
setSearchCriteria?.((prev) => {
|
|
352
|
+
const filtered = prev.filter((crit) => crit.submittedSearchText !==
|
|
353
|
+
item);
|
|
354
|
+
updateLocalStorage(filtered, localStorageKey);
|
|
355
|
+
return filtered;
|
|
356
|
+
});
|
|
357
|
+
}, text: (() => {
|
|
358
|
+
const parts = cleanedText.split("-");
|
|
359
|
+
return parts.length === 3
|
|
360
|
+
? `${parts[1]}/${parts[2]}/${parts[0]}`
|
|
361
|
+
: cleanedText;
|
|
362
|
+
})(), badgeContainerClasses: `${pillColor} p-1 max-w-fit min-w-20 rounded-full flex justify-between items-center text-white text-xs px-4 border-none mr-4 mb-1`, type: "span" }, index));
|
|
363
|
+
}) })) : null, _jsxs("div", { className: "flex justify-between items-end bg-white px-2 rounded-md mt-4", children: [_jsx(ToggleButton, { initialStatus: toggleStatus, onClick: () => setToggleStatus?.(!toggleStatus), activeColorBackground: toggleColor, activeColorBorder: activeColorBorder, activeLabel: "Range", activeTextColor: toggleTextColor, additionalClasses: "flex items-center", inactiveColorBackground: inactiveColorBackground, inactiveColorBorder: inactiveColorBorder, inactiveLabel: "Range", inactiveTextColor: "text-gray-500", pillHeight: "h-8", textPosition: "right", textSize: "text-sm", smallToggle: true, borderStyle: true, inactiveCircleColor: inactiveCircleColor, activeCircleColor: activeCircleColor }), _jsx(BaseButton, { text: buttonText, backgroundColor: themeBgColor, additionalClasses: "py-0.5 px-6 text-white", borderColor: "border-none", onClick: handleFilterClick, shape: "rounded-full" })] })] }));
|
|
365
364
|
}
|
|
366
365
|
export default SearchDatePickerInput;
|