@agilant/toga-blox 1.0.143 → 1.0.144-t-2
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.
|
@@ -6,6 +6,7 @@ import Dropdown from "../Dropdown/Dropdown";
|
|
|
6
6
|
import ToggleButton from "../ToggleButton/ToggleButton";
|
|
7
7
|
import BaseButton from "../BaseButton";
|
|
8
8
|
import Badge from "../Badge/Badge";
|
|
9
|
+
import Text from "../Text";
|
|
9
10
|
import { getFontAwesomeIcon } from "../../utils/getFontAwesomeIcon";
|
|
10
11
|
import updateLocalStorage from "../../utils/updateLocalStorage";
|
|
11
12
|
import { getCleanedText } from "../../utils/getCleanedText";
|
|
@@ -341,7 +342,7 @@ function SearchDatePickerInput({ themeBgColor = "bg-sky-500", lightThemeBg = "bg
|
|
|
341
342
|
setIsDatePickerOpen(false);
|
|
342
343
|
setActiveInput(null);
|
|
343
344
|
}
|
|
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
|
|
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
|
|
345
346
|
? formatDateAsMonthDayYear(localDate)
|
|
346
347
|
: "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
348
|
const cleanedText = getCleanedText(item, removePattern);
|
|
@@ -354,12 +355,14 @@ function SearchDatePickerInput({ themeBgColor = "bg-sky-500", lightThemeBg = "bg
|
|
|
354
355
|
updateLocalStorage(filtered, localStorageKey);
|
|
355
356
|
return filtered;
|
|
356
357
|
});
|
|
357
|
-
}, text: (
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
358
|
+
}, text: _jsx(Text, { color: "text-red-500", size: "text-sm", tag: "span", text: cleanedText
|
|
359
|
+
? (() => {
|
|
360
|
+
const dateObj = parseUserDateInput(cleanedText);
|
|
361
|
+
return dateObj
|
|
362
|
+
? formatDateAsMonthDayYear(dateObj)
|
|
363
|
+
: cleanedText;
|
|
364
|
+
})()
|
|
365
|
+
: "mm/dd/yyyy" }), 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
366
|
}) })) : 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" })] })] }));
|
|
364
367
|
}
|
|
365
368
|
export default SearchDatePickerInput;
|