synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
75 lines (74 loc) • 2.04 kB
JavaScript
import { jsx as e, jsxs as i } from "react/jsx-runtime";
import { Select as d, MenuItem as f, Box as F, Tooltip as h, IconButton as p, Menu as x, Fade as E } from "@mui/material";
import { useState as v } from "react";
import S from "../../../IconSvg/IconSvg.js";
function g(n) {
const { menuText: t, children: o } = n;
return /* @__PURE__ */ i(
d,
{
className: "EnumFacetFilter EnumFacetFilterSelect",
value: t,
renderValue: () => t,
onChange: () => {
},
children: [
/* @__PURE__ */ e(f, { value: t, sx: { display: "none" } }),
/* @__PURE__ */ e(
F,
{
sx: {
// expand the dropdown menu width for this component only
"& .EnumFacetFilter__dropdown_menu": {
maxWidth: "100%"
}
},
children: o
}
)
]
}
);
}
function w(n) {
const { children: t, filterIsActive: o, facetTitle: c } = n, [r, l] = v(null), a = (m) => {
l(m.currentTarget);
}, s = () => {
l(null);
}, u = !!r;
return /* @__PURE__ */ i("div", { className: "EnumFacetFilter", children: [
/* @__PURE__ */ e(h, { title: `Filter by ${c}`, children: /* @__PURE__ */ e(p, { onClick: a, size: "small", children: /* @__PURE__ */ e(
S,
{
icon: "filter",
wrap: !1,
sx: {
color: o ? "primary.main" : "grey.700",
fontSize: "20px"
}
}
) }) }),
/* @__PURE__ */ e(
x,
{
anchorEl: r,
open: u,
onClose: s,
anchorOrigin: { vertical: "bottom", horizontal: "left" },
transformOrigin: { vertical: "top", horizontal: "left" },
slots: {
transition: E
},
children: t
}
)
] });
}
function T(n) {
const { dropdownType: t } = n;
return t === "SelectBox" ? /* @__PURE__ */ e(g, { ...n }) : /* @__PURE__ */ e(w, { ...n });
}
export {
T as default
};
//# sourceMappingURL=EnumFacetFilterDropdown.js.map