@megha-ui/react 1.3.98 → 1.3.101
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.
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from "react";
|
|
3
|
-
const
|
|
3
|
+
const getCurrentDate = () => {
|
|
4
|
+
const today = new Date();
|
|
5
|
+
const year = today.getFullYear();
|
|
6
|
+
const month = String(today.getMonth() + 1).padStart(2, "0");
|
|
7
|
+
const day = String(today.getDate()).padStart(2, "0");
|
|
8
|
+
return `${year}-${month}-${day}`;
|
|
9
|
+
};
|
|
10
|
+
const DateInput = ({ value = getCurrentDate(), onChange, placeholder, min, max, className, width = "100%", disabled = false, padding = "0.5rem", borderRadius = "0.25rem", fontSize = "1rem", height = "2.5rem", labelFontSize, labelFontWeight, labelMarginBottom, asteriskColor, label, required, isValid, validationErrorColor = "red", validationSuccessColor = "green", border = "1px solid var(--form-border-color, #dbdfe9)", }) => {
|
|
4
11
|
const dateInputStyle = {
|
|
5
12
|
width,
|
|
6
13
|
height: "100%",
|
|
@@ -9,7 +9,7 @@ import Button from "../button";
|
|
|
9
9
|
import { HiChevronDown } from "react-icons/hi";
|
|
10
10
|
import { FaChevronDown, FaChevronUp } from "react-icons/fa";
|
|
11
11
|
const Dropdown = ({ options, selectedValues, onChange, placeholder = "Select...", isMultiple = false, isSelectAll = false, className, style, labelAlignment = "vertical", labelFontSize, labelFontWeight, labelMarginBottom, labelClass, asteriskColor, label, disabled = false, width, searchEnabled = true, dropdownListWidth, marginBottom, marginTop, marginRight, marginLeft, required, dropdownListBG, searchBorderColor = "#2377ba", maxDropdownHeight, border = "1px solid #dbdfe9", selectedCharLength = 0, menuFrom = "left", Tooltip, DropDownIcon, onMenuClose, onMenuOpen, isClear, ClearIcon, clearId, selectedDisplay, checkboxWrapper, isSort = true, onSelectChange, isLoading = false, onApplyChange, withTooltip = false, isCreatable = false, onCreate = () => { }, autoPosition = true, compactDisplay = false, ultraCompactDisplay = false, isGrouping = false, isIcon = false, withValue = false, closeOnSelect = true, }) => {
|
|
12
|
-
var _a, _b;
|
|
12
|
+
var _a, _b, _c;
|
|
13
13
|
const { density } = useDensity();
|
|
14
14
|
const [isOpen, setIsOpen] = useState(false);
|
|
15
15
|
const [searchTerm, setSearchTerm] = useState("");
|
|
@@ -399,16 +399,7 @@ const Dropdown = ({ options, selectedValues, onChange, placeholder = "Select..."
|
|
|
399
399
|
: density === "compact"
|
|
400
400
|
? "2rem"
|
|
401
401
|
: "2.5rem"})`,
|
|
402
|
-
})), { position: "relative" }), style), children: [_jsxs("div", { style: {
|
|
403
|
-
border,
|
|
404
|
-
borderRadius: 4,
|
|
405
|
-
display: "flex",
|
|
406
|
-
alignItems: "center",
|
|
407
|
-
justifyContent: "space-between",
|
|
408
|
-
cursor: "pointer",
|
|
409
|
-
width: width ? "100%" : "max-content",
|
|
410
|
-
padding: "0.5rem",
|
|
411
|
-
}, ref: clearIconRef, onClick: handleClick, children: [_jsx("span", { style: {
|
|
402
|
+
})), { position: "relative" }), style), children: [_jsxs("div", { style: Object.assign(Object.assign({}, ({ border: (_c = style === null || style === void 0 ? void 0 : style.border) !== null && _c !== void 0 ? _c : border })), { borderRadius: 4, display: "flex", alignItems: "center", justifyContent: "space-between", cursor: "pointer", width: width ? "100%" : "max-content", padding: "0.5rem" }), ref: clearIconRef, onClick: handleClick, children: [_jsx("span", { style: {
|
|
412
403
|
display: isIcon
|
|
413
404
|
? withValue
|
|
414
405
|
? "inline-block"
|
package/package.json
CHANGED