@carto/meridian-ds 2.2.1 → 2.3.1
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.
- package/CHANGELOG.md +10 -0
- package/dist/{MenuItem-BY6fuF5U.cjs → MenuItem-YpFpuljU.cjs} +3 -2
- package/dist/{MenuItem-CKrhDizf.js → MenuItem-badiQq9A.js} +3 -2
- package/dist/components/index.cjs +194 -1
- package/dist/components/index.js +196 -3
- package/dist/theme/index.cjs +1 -1
- package/dist/theme/index.js +1 -1
- package/dist/types/components/molecules/FilterDropdown/FilterDropdown.d.ts +6 -0
- package/dist/types/components/molecules/FilterDropdown/FilterDropdown.d.ts.map +1 -0
- package/dist/types/components/molecules/FilterDropdown/FilterDropdownMenuItem.d.ts +3 -0
- package/dist/types/components/molecules/FilterDropdown/FilterDropdownMenuItem.d.ts.map +1 -0
- package/dist/types/components/molecules/FilterDropdown/index.d.ts +4 -0
- package/dist/types/components/molecules/FilterDropdown/index.d.ts.map +1 -0
- package/dist/types/components/molecules/FilterDropdown/types.d.ts +56 -0
- package/dist/types/components/molecules/FilterDropdown/types.d.ts.map +1 -0
- package/dist/types/components/molecules/Menu/MenuItem.d.ts.map +1 -1
- package/dist/types/components/molecules/index.d.ts +2 -0
- package/dist/types/components/molecules/index.d.ts.map +1 -1
- package/dist/types/components/organisms/Dialog/types.d.ts +1 -1
- package/dist/types/components/organisms/Dialog/types.d.ts.map +1 -1
- package/dist/widgets/index.cjs +1 -1
- package/dist/widgets/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,8 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
- fix(widgets): FormulaWidgets doesn't display if when loading [#240](https://github.com/CartoDB/meridian-ds/pull/240)
|
|
6
|
+
|
|
5
7
|
## 2.0
|
|
6
8
|
|
|
9
|
+
### 2.3.1
|
|
10
|
+
|
|
11
|
+
- fix(widgets): FormulaWidgets doesn't display if when loading [#240](https://github.com/CartoDB/meridian-ds/pull/240)
|
|
12
|
+
|
|
13
|
+
### 2.3.0
|
|
14
|
+
|
|
15
|
+
- New FilterDropdown component [#235](https://github.com/CartoDB/meridian-ds/pull/235)
|
|
16
|
+
|
|
7
17
|
### 2.2.1
|
|
8
18
|
|
|
9
19
|
- Extend `AccordionGroup` interface to support `React.ReactNode` as `item.summary`[#237](https://github.com/CartoDB/meridian-ds/pull/237)
|
|
@@ -156,11 +156,12 @@ function _MenuItem({
|
|
|
156
156
|
extended,
|
|
157
157
|
dense,
|
|
158
158
|
fixed,
|
|
159
|
-
|
|
159
|
+
iconColor,
|
|
160
160
|
"data-destructive": destructive,
|
|
161
161
|
"data-extended": extended,
|
|
162
162
|
"data-dense": dense,
|
|
163
|
-
"data-fixed": fixed
|
|
163
|
+
"data-fixed": fixed,
|
|
164
|
+
"data-icon-color": iconColor
|
|
164
165
|
}
|
|
165
166
|
);
|
|
166
167
|
}
|
|
@@ -155,11 +155,12 @@ function _MenuItem({
|
|
|
155
155
|
extended,
|
|
156
156
|
dense,
|
|
157
157
|
fixed,
|
|
158
|
-
|
|
158
|
+
iconColor,
|
|
159
159
|
"data-destructive": destructive,
|
|
160
160
|
"data-extended": extended,
|
|
161
161
|
"data-dense": dense,
|
|
162
|
-
"data-fixed": fixed
|
|
162
|
+
"data-fixed": fixed,
|
|
163
|
+
"data-icon-color": iconColor
|
|
163
164
|
}
|
|
164
165
|
);
|
|
165
166
|
}
|
|
@@ -10,7 +10,7 @@ const Link = require("../Link-_lzRY1Ay.cjs");
|
|
|
10
10
|
const ArrowDown = require("../ArrowDown-DJ0vhbsw.cjs");
|
|
11
11
|
const OpenDiagonallyRight = require("../OpenDiagonallyRight-CpL4ROwg.cjs");
|
|
12
12
|
require("cartocolor");
|
|
13
|
-
const MenuItem = require("../MenuItem-
|
|
13
|
+
const MenuItem = require("../MenuItem-YpFpuljU.cjs");
|
|
14
14
|
const reactWindow = require("react-window");
|
|
15
15
|
const DatePicker$1 = require("@mui/x-date-pickers/DatePicker");
|
|
16
16
|
const xDatePickers = require("@mui/x-date-pickers");
|
|
@@ -1529,6 +1529,197 @@ function useAutocomplete({
|
|
|
1529
1529
|
getOptionLabel: internalGetOptionLabel
|
|
1530
1530
|
};
|
|
1531
1531
|
}
|
|
1532
|
+
const FilterDropdownMenuItem = ({
|
|
1533
|
+
item,
|
|
1534
|
+
selectedValue,
|
|
1535
|
+
dense,
|
|
1536
|
+
extended,
|
|
1537
|
+
onItemChange
|
|
1538
|
+
}) => {
|
|
1539
|
+
const {
|
|
1540
|
+
id,
|
|
1541
|
+
label,
|
|
1542
|
+
description,
|
|
1543
|
+
startAdornment,
|
|
1544
|
+
endAdornment,
|
|
1545
|
+
tooltipLabel,
|
|
1546
|
+
tooltipPlacement,
|
|
1547
|
+
disabled,
|
|
1548
|
+
"aria-label": ariaLabel,
|
|
1549
|
+
hidden,
|
|
1550
|
+
destructive,
|
|
1551
|
+
subtitle,
|
|
1552
|
+
divider,
|
|
1553
|
+
fixed,
|
|
1554
|
+
selected,
|
|
1555
|
+
iconColor
|
|
1556
|
+
} = item;
|
|
1557
|
+
const [menuItemId] = React.useState(() => `filter-dropdown-item-${uniqueId()}`);
|
|
1558
|
+
const isSelected = selected || (selectedValue == null ? void 0 : selectedValue.id) === id;
|
|
1559
|
+
if (hidden) return null;
|
|
1560
|
+
return /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: tooltipLabel, placement: tooltipPlacement, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1561
|
+
MenuItem.MenuItem,
|
|
1562
|
+
{
|
|
1563
|
+
onClick: disabled ? void 0 : (event) => onItemChange(item, event),
|
|
1564
|
+
selected: isSelected,
|
|
1565
|
+
dense,
|
|
1566
|
+
extended,
|
|
1567
|
+
disabled,
|
|
1568
|
+
destructive,
|
|
1569
|
+
subtitle,
|
|
1570
|
+
divider,
|
|
1571
|
+
fixed,
|
|
1572
|
+
iconColor,
|
|
1573
|
+
"aria-label": ariaLabel,
|
|
1574
|
+
"aria-labelledby": menuItemId,
|
|
1575
|
+
"aria-selected": isSelected,
|
|
1576
|
+
children: [
|
|
1577
|
+
startAdornment && /* @__PURE__ */ jsxRuntime.jsx(material.ListItemIcon, { children: startAdornment }),
|
|
1578
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1579
|
+
material.ListItemText,
|
|
1580
|
+
{
|
|
1581
|
+
primary: label,
|
|
1582
|
+
secondary: description,
|
|
1583
|
+
primaryTypographyProps: {
|
|
1584
|
+
variant: "body2",
|
|
1585
|
+
id: menuItemId
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
),
|
|
1589
|
+
endAdornment && /* @__PURE__ */ jsxRuntime.jsx(material.ListItemIcon, { children: endAdornment })
|
|
1590
|
+
]
|
|
1591
|
+
}
|
|
1592
|
+
) });
|
|
1593
|
+
};
|
|
1594
|
+
const ButtonWrapper = material.styled(material.Box, {
|
|
1595
|
+
shouldForwardProp: (prop) => prop !== "isOpen" && prop !== "buttonColor"
|
|
1596
|
+
})(({ isOpen, theme, buttonColor }) => ({
|
|
1597
|
+
display: "flex",
|
|
1598
|
+
alignItems: "center",
|
|
1599
|
+
justifyContent: "center",
|
|
1600
|
+
...isOpen && {
|
|
1601
|
+
"& .MuiButtonBase-root": {
|
|
1602
|
+
backgroundColor: theme.palette.action.hover
|
|
1603
|
+
}
|
|
1604
|
+
},
|
|
1605
|
+
...buttonColor === "secondary" && {
|
|
1606
|
+
"& button": {
|
|
1607
|
+
color: theme.palette.text.secondary
|
|
1608
|
+
}
|
|
1609
|
+
}
|
|
1610
|
+
}));
|
|
1611
|
+
function _FilterDropdown({
|
|
1612
|
+
menuItems,
|
|
1613
|
+
onClickItem,
|
|
1614
|
+
value,
|
|
1615
|
+
defaultValue = menuItems[0],
|
|
1616
|
+
menuTitle,
|
|
1617
|
+
placeholder,
|
|
1618
|
+
disabled,
|
|
1619
|
+
icon,
|
|
1620
|
+
label,
|
|
1621
|
+
buttonSize,
|
|
1622
|
+
buttonColor = "primary",
|
|
1623
|
+
dense = false,
|
|
1624
|
+
extended = false,
|
|
1625
|
+
"aria-label": ariaLabel,
|
|
1626
|
+
responsive,
|
|
1627
|
+
tooltipLabel,
|
|
1628
|
+
tooltipPlacement,
|
|
1629
|
+
slotProps,
|
|
1630
|
+
MenuListProps,
|
|
1631
|
+
...props
|
|
1632
|
+
}, ref) {
|
|
1633
|
+
const [selected_, setSelected] = React.useState(defaultValue || void 0);
|
|
1634
|
+
const [anchorEl, setAnchorEl] = React.useState(null);
|
|
1635
|
+
const isOpen = !!anchorEl;
|
|
1636
|
+
const selected = value ?? selected_;
|
|
1637
|
+
const isTablet = material.useMediaQuery((theme) => theme.breakpoints.down("lg"));
|
|
1638
|
+
const isIcon = Boolean(icon) && (!responsive || isTablet);
|
|
1639
|
+
const menuLabel = label || (selected == null ? void 0 : selected.alternativeLabel) || (selected == null ? void 0 : selected.label) || placeholder;
|
|
1640
|
+
const [buttonId] = React.useState(() => `filter-dropdown-button-${uniqueId()}`);
|
|
1641
|
+
const [menuId] = React.useState(() => `filter-dropdown-menu-${uniqueId()}`);
|
|
1642
|
+
const handleOpen = (event) => {
|
|
1643
|
+
setAnchorEl(event.currentTarget);
|
|
1644
|
+
};
|
|
1645
|
+
const handleClose = () => {
|
|
1646
|
+
setAnchorEl(null);
|
|
1647
|
+
};
|
|
1648
|
+
const handleChange = (item, event) => {
|
|
1649
|
+
setSelected(item);
|
|
1650
|
+
onClickItem(item, event);
|
|
1651
|
+
handleClose();
|
|
1652
|
+
};
|
|
1653
|
+
const commonButtonProps = {
|
|
1654
|
+
onClick: handleOpen,
|
|
1655
|
+
disabled,
|
|
1656
|
+
size: buttonSize,
|
|
1657
|
+
color: "default",
|
|
1658
|
+
"aria-label": ariaLabel,
|
|
1659
|
+
id: buttonId,
|
|
1660
|
+
"aria-controls": isOpen ? menuId : void 0,
|
|
1661
|
+
"aria-haspopup": !disabled,
|
|
1662
|
+
"aria-expanded": isOpen,
|
|
1663
|
+
"data-color": buttonColor
|
|
1664
|
+
};
|
|
1665
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1666
|
+
/* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: tooltipLabel, placement: tooltipPlacement, children: /* @__PURE__ */ jsxRuntime.jsx(ButtonWrapper, { isOpen, buttonColor, ref, children: isIcon ? /* @__PURE__ */ jsxRuntime.jsx(Link.IconButton, { ...commonButtonProps, icon }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1667
|
+
Button,
|
|
1668
|
+
{
|
|
1669
|
+
...commonButtonProps,
|
|
1670
|
+
endIcon: isOpen ? /* @__PURE__ */ jsxRuntime.jsx(OpenDiagonallyRight.ArrowUp, {}) : /* @__PURE__ */ jsxRuntime.jsx(ArrowDown.ArrowDown, {}),
|
|
1671
|
+
children: menuLabel
|
|
1672
|
+
}
|
|
1673
|
+
) }) }),
|
|
1674
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1675
|
+
Menu$1,
|
|
1676
|
+
{
|
|
1677
|
+
id: menuId,
|
|
1678
|
+
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
1679
|
+
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
1680
|
+
...props,
|
|
1681
|
+
anchorEl,
|
|
1682
|
+
open: isOpen,
|
|
1683
|
+
onClose: handleClose,
|
|
1684
|
+
slotProps: {
|
|
1685
|
+
...slotProps,
|
|
1686
|
+
paper: {
|
|
1687
|
+
"data-name": "filter-dropdown",
|
|
1688
|
+
...slotProps == null ? void 0 : slotProps.paper
|
|
1689
|
+
}
|
|
1690
|
+
},
|
|
1691
|
+
MenuListProps: {
|
|
1692
|
+
"aria-labelledby": buttonId,
|
|
1693
|
+
...dense && {
|
|
1694
|
+
"data-dense": dense
|
|
1695
|
+
},
|
|
1696
|
+
autoFocus: true,
|
|
1697
|
+
// To allow keyboard navigation
|
|
1698
|
+
...MenuListProps
|
|
1699
|
+
},
|
|
1700
|
+
children: [
|
|
1701
|
+
menuTitle && /* @__PURE__ */ jsxRuntime.jsx(MenuItem.MenuItem, { subtitle: true, children: menuTitle }),
|
|
1702
|
+
menuItems.map((item, index) => {
|
|
1703
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1704
|
+
FilterDropdownMenuItem,
|
|
1705
|
+
{
|
|
1706
|
+
item,
|
|
1707
|
+
selectedValue: selected,
|
|
1708
|
+
dense,
|
|
1709
|
+
extended,
|
|
1710
|
+
onItemChange: handleChange
|
|
1711
|
+
},
|
|
1712
|
+
index
|
|
1713
|
+
);
|
|
1714
|
+
})
|
|
1715
|
+
]
|
|
1716
|
+
}
|
|
1717
|
+
)
|
|
1718
|
+
] });
|
|
1719
|
+
}
|
|
1720
|
+
const FilterDropdown = React.forwardRef(
|
|
1721
|
+
_FilterDropdown
|
|
1722
|
+
);
|
|
1532
1723
|
const AccordionContainer = material.styled("div", {
|
|
1533
1724
|
shouldForwardProp: (prop) => prop !== "variant"
|
|
1534
1725
|
})(({ variant, theme }) => ({
|
|
@@ -5236,6 +5427,8 @@ exports.DialogFooter = DialogFooter;
|
|
|
5236
5427
|
exports.DialogHeader = DialogHeader;
|
|
5237
5428
|
exports.DialogPaper = DialogPaper;
|
|
5238
5429
|
exports.DialogStepper = DialogStepper;
|
|
5430
|
+
exports.FilterDropdown = FilterDropdown;
|
|
5431
|
+
exports.FilterDropdownMenuItem = FilterDropdownMenuItem;
|
|
5239
5432
|
exports.LabelWithIndicator = LabelWithIndicator;
|
|
5240
5433
|
exports.Menu = Menu$1;
|
|
5241
5434
|
exports.MenuItemFilter = MenuItemFilter;
|
package/dist/components/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React, { forwardRef, useState, useRef, useEffect, useMemo, createElement, Fragment as Fragment$1, useCallback, useImperativeHandle } from "react";
|
|
3
3
|
import { useIntl } from "react-intl";
|
|
4
|
-
import { styled, Menu as Menu$2, MenuList as MenuList$1, Link, Checkbox, Select, MenuItem as MenuItem$1, FormControl, Box, InputLabel, FormHelperText, InputAdornment, IconButton, ListItemText, Tooltip, TextField, CircularProgress, Button as Button$1, Autocomplete as Autocomplete$1, Divider, ListItemIcon, createFilterOptions, Accordion, AccordionSummary, AccordionDetails, Avatar as Avatar$1, Snackbar as Snackbar$1, Portal, Fade, Slide, Popper, Grow, Paper, ClickAwayListener, ButtonGroup as ButtonGroup$1, ToggleButtonGroup as ToggleButtonGroup$1, alpha, useTheme, Toolbar, AppBar as AppBar$1, Dialog as Dialog$1, DialogTitle as DialogTitle$1, Chip, DialogContent as DialogContent$1, DialogActions as DialogActions$1 } from "@mui/material";
|
|
4
|
+
import { styled, Menu as Menu$2, MenuList as MenuList$1, Link, Checkbox, Select, MenuItem as MenuItem$1, FormControl, Box, InputLabel, FormHelperText, InputAdornment, IconButton, ListItemText, Tooltip, TextField, CircularProgress, Button as Button$1, Autocomplete as Autocomplete$1, Divider, ListItemIcon, createFilterOptions, useMediaQuery, Accordion, AccordionSummary, AccordionDetails, Avatar as Avatar$1, Snackbar as Snackbar$1, Portal, Fade, Slide, Popper, Grow, Paper, ClickAwayListener, ButtonGroup as ButtonGroup$1, ToggleButtonGroup as ToggleButtonGroup$1, alpha, useTheme, Toolbar, AppBar as AppBar$1, Dialog as Dialog$1, DialogTitle as DialogTitle$1, Chip, DialogContent as DialogContent$1, DialogActions as DialogActions$1 } from "@mui/material";
|
|
5
5
|
import { Cancel, AddCircleOutlineOutlined, CloseOutlined, ContentCopyOutlined, VisibilityOutlined, VisibilityOffOutlined, OpenInNewOutlined, MenuOutlined, HelpOutline, TodayOutlined, MoreVertOutlined, ErrorOutline, Check } from "@mui/icons-material";
|
|
6
6
|
import { f as MENU_ITEM_SIZE_EXTENDED, u as useImperativeIntl, T as Typography, e as MENU_ITEM_SIZE_DENSE, d as MENU_LIST_MAX_SIZE, M as MENU_ITEM_SIZE_DEFAULT, c as ICON_SIZE_SMALL, N as NOTIFICATION_DURATION_IN_MS, A as APPBAR_SIZE } from "../TablePaginationActions-CCDi-BO-.js";
|
|
7
7
|
import { a } from "../TablePaginationActions-CCDi-BO-.js";
|
|
8
|
-
import {
|
|
8
|
+
import { I as IconButton$1, A as Alert$1, S as ScreenReaderOnly } from "../Link-D5fKicEY.js";
|
|
9
9
|
import { L } from "../Link-D5fKicEY.js";
|
|
10
10
|
import { A as ArrowDown } from "../ArrowDown-d6bxUL0F.js";
|
|
11
11
|
import { A as ArrowUp, O as OpenDiagonallyRight, C as CloseDiagonallyRight } from "../OpenDiagonallyRight-CGdCEXlF.js";
|
|
12
12
|
import "cartocolor";
|
|
13
|
-
import { M as MenuItem } from "../MenuItem-
|
|
13
|
+
import { M as MenuItem } from "../MenuItem-badiQq9A.js";
|
|
14
14
|
import { FixedSizeList } from "react-window";
|
|
15
15
|
import { DatePicker as DatePicker$1 } from "@mui/x-date-pickers/DatePicker";
|
|
16
16
|
import { PickersDay as PickersDay$1 } from "@mui/x-date-pickers";
|
|
@@ -1529,6 +1529,197 @@ function useAutocomplete({
|
|
|
1529
1529
|
getOptionLabel: internalGetOptionLabel
|
|
1530
1530
|
};
|
|
1531
1531
|
}
|
|
1532
|
+
const FilterDropdownMenuItem = ({
|
|
1533
|
+
item,
|
|
1534
|
+
selectedValue,
|
|
1535
|
+
dense,
|
|
1536
|
+
extended,
|
|
1537
|
+
onItemChange
|
|
1538
|
+
}) => {
|
|
1539
|
+
const {
|
|
1540
|
+
id,
|
|
1541
|
+
label,
|
|
1542
|
+
description,
|
|
1543
|
+
startAdornment,
|
|
1544
|
+
endAdornment,
|
|
1545
|
+
tooltipLabel,
|
|
1546
|
+
tooltipPlacement,
|
|
1547
|
+
disabled,
|
|
1548
|
+
"aria-label": ariaLabel,
|
|
1549
|
+
hidden,
|
|
1550
|
+
destructive,
|
|
1551
|
+
subtitle,
|
|
1552
|
+
divider,
|
|
1553
|
+
fixed,
|
|
1554
|
+
selected,
|
|
1555
|
+
iconColor
|
|
1556
|
+
} = item;
|
|
1557
|
+
const [menuItemId] = useState(() => `filter-dropdown-item-${uniqueId()}`);
|
|
1558
|
+
const isSelected = selected || (selectedValue == null ? void 0 : selectedValue.id) === id;
|
|
1559
|
+
if (hidden) return null;
|
|
1560
|
+
return /* @__PURE__ */ jsx(Tooltip, { title: tooltipLabel, placement: tooltipPlacement, children: /* @__PURE__ */ jsxs(
|
|
1561
|
+
MenuItem,
|
|
1562
|
+
{
|
|
1563
|
+
onClick: disabled ? void 0 : (event) => onItemChange(item, event),
|
|
1564
|
+
selected: isSelected,
|
|
1565
|
+
dense,
|
|
1566
|
+
extended,
|
|
1567
|
+
disabled,
|
|
1568
|
+
destructive,
|
|
1569
|
+
subtitle,
|
|
1570
|
+
divider,
|
|
1571
|
+
fixed,
|
|
1572
|
+
iconColor,
|
|
1573
|
+
"aria-label": ariaLabel,
|
|
1574
|
+
"aria-labelledby": menuItemId,
|
|
1575
|
+
"aria-selected": isSelected,
|
|
1576
|
+
children: [
|
|
1577
|
+
startAdornment && /* @__PURE__ */ jsx(ListItemIcon, { children: startAdornment }),
|
|
1578
|
+
/* @__PURE__ */ jsx(
|
|
1579
|
+
ListItemText,
|
|
1580
|
+
{
|
|
1581
|
+
primary: label,
|
|
1582
|
+
secondary: description,
|
|
1583
|
+
primaryTypographyProps: {
|
|
1584
|
+
variant: "body2",
|
|
1585
|
+
id: menuItemId
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
),
|
|
1589
|
+
endAdornment && /* @__PURE__ */ jsx(ListItemIcon, { children: endAdornment })
|
|
1590
|
+
]
|
|
1591
|
+
}
|
|
1592
|
+
) });
|
|
1593
|
+
};
|
|
1594
|
+
const ButtonWrapper = styled(Box, {
|
|
1595
|
+
shouldForwardProp: (prop) => prop !== "isOpen" && prop !== "buttonColor"
|
|
1596
|
+
})(({ isOpen, theme, buttonColor }) => ({
|
|
1597
|
+
display: "flex",
|
|
1598
|
+
alignItems: "center",
|
|
1599
|
+
justifyContent: "center",
|
|
1600
|
+
...isOpen && {
|
|
1601
|
+
"& .MuiButtonBase-root": {
|
|
1602
|
+
backgroundColor: theme.palette.action.hover
|
|
1603
|
+
}
|
|
1604
|
+
},
|
|
1605
|
+
...buttonColor === "secondary" && {
|
|
1606
|
+
"& button": {
|
|
1607
|
+
color: theme.palette.text.secondary
|
|
1608
|
+
}
|
|
1609
|
+
}
|
|
1610
|
+
}));
|
|
1611
|
+
function _FilterDropdown({
|
|
1612
|
+
menuItems,
|
|
1613
|
+
onClickItem,
|
|
1614
|
+
value,
|
|
1615
|
+
defaultValue = menuItems[0],
|
|
1616
|
+
menuTitle,
|
|
1617
|
+
placeholder,
|
|
1618
|
+
disabled,
|
|
1619
|
+
icon,
|
|
1620
|
+
label,
|
|
1621
|
+
buttonSize,
|
|
1622
|
+
buttonColor = "primary",
|
|
1623
|
+
dense = false,
|
|
1624
|
+
extended = false,
|
|
1625
|
+
"aria-label": ariaLabel,
|
|
1626
|
+
responsive,
|
|
1627
|
+
tooltipLabel,
|
|
1628
|
+
tooltipPlacement,
|
|
1629
|
+
slotProps,
|
|
1630
|
+
MenuListProps,
|
|
1631
|
+
...props
|
|
1632
|
+
}, ref) {
|
|
1633
|
+
const [selected_, setSelected] = useState(defaultValue || void 0);
|
|
1634
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
1635
|
+
const isOpen = !!anchorEl;
|
|
1636
|
+
const selected = value ?? selected_;
|
|
1637
|
+
const isTablet = useMediaQuery((theme) => theme.breakpoints.down("lg"));
|
|
1638
|
+
const isIcon = Boolean(icon) && (!responsive || isTablet);
|
|
1639
|
+
const menuLabel = label || (selected == null ? void 0 : selected.alternativeLabel) || (selected == null ? void 0 : selected.label) || placeholder;
|
|
1640
|
+
const [buttonId] = useState(() => `filter-dropdown-button-${uniqueId()}`);
|
|
1641
|
+
const [menuId] = useState(() => `filter-dropdown-menu-${uniqueId()}`);
|
|
1642
|
+
const handleOpen = (event) => {
|
|
1643
|
+
setAnchorEl(event.currentTarget);
|
|
1644
|
+
};
|
|
1645
|
+
const handleClose = () => {
|
|
1646
|
+
setAnchorEl(null);
|
|
1647
|
+
};
|
|
1648
|
+
const handleChange = (item, event) => {
|
|
1649
|
+
setSelected(item);
|
|
1650
|
+
onClickItem(item, event);
|
|
1651
|
+
handleClose();
|
|
1652
|
+
};
|
|
1653
|
+
const commonButtonProps = {
|
|
1654
|
+
onClick: handleOpen,
|
|
1655
|
+
disabled,
|
|
1656
|
+
size: buttonSize,
|
|
1657
|
+
color: "default",
|
|
1658
|
+
"aria-label": ariaLabel,
|
|
1659
|
+
id: buttonId,
|
|
1660
|
+
"aria-controls": isOpen ? menuId : void 0,
|
|
1661
|
+
"aria-haspopup": !disabled,
|
|
1662
|
+
"aria-expanded": isOpen,
|
|
1663
|
+
"data-color": buttonColor
|
|
1664
|
+
};
|
|
1665
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1666
|
+
/* @__PURE__ */ jsx(Tooltip, { title: tooltipLabel, placement: tooltipPlacement, children: /* @__PURE__ */ jsx(ButtonWrapper, { isOpen, buttonColor, ref, children: isIcon ? /* @__PURE__ */ jsx(IconButton$1, { ...commonButtonProps, icon }) : /* @__PURE__ */ jsx(
|
|
1667
|
+
Button,
|
|
1668
|
+
{
|
|
1669
|
+
...commonButtonProps,
|
|
1670
|
+
endIcon: isOpen ? /* @__PURE__ */ jsx(ArrowUp, {}) : /* @__PURE__ */ jsx(ArrowDown, {}),
|
|
1671
|
+
children: menuLabel
|
|
1672
|
+
}
|
|
1673
|
+
) }) }),
|
|
1674
|
+
/* @__PURE__ */ jsxs(
|
|
1675
|
+
Menu$1,
|
|
1676
|
+
{
|
|
1677
|
+
id: menuId,
|
|
1678
|
+
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
1679
|
+
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
1680
|
+
...props,
|
|
1681
|
+
anchorEl,
|
|
1682
|
+
open: isOpen,
|
|
1683
|
+
onClose: handleClose,
|
|
1684
|
+
slotProps: {
|
|
1685
|
+
...slotProps,
|
|
1686
|
+
paper: {
|
|
1687
|
+
"data-name": "filter-dropdown",
|
|
1688
|
+
...slotProps == null ? void 0 : slotProps.paper
|
|
1689
|
+
}
|
|
1690
|
+
},
|
|
1691
|
+
MenuListProps: {
|
|
1692
|
+
"aria-labelledby": buttonId,
|
|
1693
|
+
...dense && {
|
|
1694
|
+
"data-dense": dense
|
|
1695
|
+
},
|
|
1696
|
+
autoFocus: true,
|
|
1697
|
+
// To allow keyboard navigation
|
|
1698
|
+
...MenuListProps
|
|
1699
|
+
},
|
|
1700
|
+
children: [
|
|
1701
|
+
menuTitle && /* @__PURE__ */ jsx(MenuItem, { subtitle: true, children: menuTitle }),
|
|
1702
|
+
menuItems.map((item, index) => {
|
|
1703
|
+
return /* @__PURE__ */ jsx(
|
|
1704
|
+
FilterDropdownMenuItem,
|
|
1705
|
+
{
|
|
1706
|
+
item,
|
|
1707
|
+
selectedValue: selected,
|
|
1708
|
+
dense,
|
|
1709
|
+
extended,
|
|
1710
|
+
onItemChange: handleChange
|
|
1711
|
+
},
|
|
1712
|
+
index
|
|
1713
|
+
);
|
|
1714
|
+
})
|
|
1715
|
+
]
|
|
1716
|
+
}
|
|
1717
|
+
)
|
|
1718
|
+
] });
|
|
1719
|
+
}
|
|
1720
|
+
const FilterDropdown = forwardRef(
|
|
1721
|
+
_FilterDropdown
|
|
1722
|
+
);
|
|
1532
1723
|
const AccordionContainer = styled("div", {
|
|
1533
1724
|
shouldForwardProp: (prop) => prop !== "variant"
|
|
1534
1725
|
})(({ variant, theme }) => ({
|
|
@@ -5231,6 +5422,8 @@ export {
|
|
|
5231
5422
|
DialogHeader,
|
|
5232
5423
|
DialogPaper,
|
|
5233
5424
|
DialogStepper,
|
|
5425
|
+
FilterDropdown,
|
|
5426
|
+
FilterDropdownMenuItem,
|
|
5234
5427
|
IconButton$1 as IconButton,
|
|
5235
5428
|
LabelWithIndicator,
|
|
5236
5429
|
L as Link,
|
package/dist/theme/index.cjs
CHANGED
|
@@ -7,7 +7,7 @@ const TablePaginationActions = require("../TablePaginationActions-D2K26kdR.cjs")
|
|
|
7
7
|
const iconsMaterial = require("@mui/icons-material");
|
|
8
8
|
const ArrowDown = require("../ArrowDown-DJ0vhbsw.cjs");
|
|
9
9
|
const xDatePickers = require("@mui/x-date-pickers");
|
|
10
|
-
const MenuItem = require("../MenuItem-
|
|
10
|
+
const MenuItem = require("../MenuItem-YpFpuljU.cjs");
|
|
11
11
|
const paletteUtils = require("../paletteUtils-B9ybmwiI.cjs");
|
|
12
12
|
const tooltipArrowSize = 1;
|
|
13
13
|
const tooltipSeparation = 0.5;
|
package/dist/theme/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { f, N } from "../TablePaginationActions-CCDi-BO-.js";
|
|
|
6
6
|
import { Cancel, EventOutlined, ChevronRightOutlined, ChevronLeftOutlined, ExpandMoreOutlined, CheckCircleOutlined } from "@mui/icons-material";
|
|
7
7
|
import { A as ArrowDown } from "../ArrowDown-d6bxUL0F.js";
|
|
8
8
|
import { renderDigitalClockTimeView } from "@mui/x-date-pickers";
|
|
9
|
-
import { M as MenuItem } from "../MenuItem-
|
|
9
|
+
import { M as MenuItem } from "../MenuItem-badiQq9A.js";
|
|
10
10
|
import { c as commonPalette } from "../paletteUtils-BHqJlHm9.js";
|
|
11
11
|
import { g } from "../paletteUtils-BHqJlHm9.js";
|
|
12
12
|
const tooltipArrowSize = 1;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { default as React, ForwardedRef } from 'react';
|
|
2
|
+
import { FilterDropdownProps } from './types';
|
|
3
|
+
export declare function _FilterDropdown({ menuItems, onClickItem, value, defaultValue, menuTitle, placeholder, disabled, icon, label, buttonSize, buttonColor, dense, extended, 'aria-label': ariaLabel, responsive, tooltipLabel, tooltipPlacement, slotProps, MenuListProps, ...props }: FilterDropdownProps, ref: ForwardedRef<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare const FilterDropdown: React.ForwardRefExoticComponent<Omit<FilterDropdownProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export default FilterDropdown;
|
|
6
|
+
//# sourceMappingURL=FilterDropdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterDropdown.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/FilterDropdown/FilterDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAoC,YAAY,EAAE,MAAM,OAAO,CAAA;AAQ7E,OAAO,EAA2B,mBAAmB,EAAE,MAAM,SAAS,CAAA;AA0BtE,wBAAgB,eAAe,CAC7B,EACE,SAAS,EACT,WAAW,EACX,KAAK,EACL,YAA2B,EAC3B,SAAS,EACT,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,UAAU,EACV,WAAuB,EACvB,KAAa,EACb,QAAgB,EAChB,YAAY,EAAE,SAAS,EACvB,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,GAAG,KAAK,EACT,EAAE,mBAAmB,EACtB,GAAG,EAAE,YAAY,CAAC,cAAc,CAAC,2CAuGlC;AAID,QAAA,MAAM,cAAc,yGAEnB,CAAA;AACD,eAAe,cAAc,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { FilterDropdownMenuItemProps } from './types';
|
|
2
|
+
export declare const FilterDropdownMenuItem: ({ item, selectedValue, dense, extended, onItemChange, }: FilterDropdownMenuItemProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
3
|
+
//# sourceMappingURL=FilterDropdownMenuItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterDropdownMenuItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/FilterDropdown/FilterDropdownMenuItem.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAA;AAErD,eAAO,MAAM,sBAAsB,4DAMhC,2BAA2B,mDAsD7B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/FilterDropdown/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAEjE,mBAAmB,SAAS,CAAA"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ReactNode, MouseEvent } from 'react';
|
|
2
|
+
import { TooltipProps } from '@mui/material';
|
|
3
|
+
import { MenuItemProps, MenuProps } from '../Menu';
|
|
4
|
+
export interface FilterDropdownItemProps extends Omit<MenuItemProps, 'id' | 'hidden'> {
|
|
5
|
+
id: string | number;
|
|
6
|
+
label: ReactNode;
|
|
7
|
+
alternativeLabel?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
selected?: boolean;
|
|
10
|
+
divider?: boolean;
|
|
11
|
+
description?: ReactNode;
|
|
12
|
+
tooltipLabel?: ReactNode;
|
|
13
|
+
tooltipPlacement?: TooltipProps['placement'];
|
|
14
|
+
startAdornment?: ReactNode;
|
|
15
|
+
endAdornment?: ReactNode;
|
|
16
|
+
hidden?: boolean | null;
|
|
17
|
+
'aria-label'?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface FilterDropdownProps extends Omit<MenuProps, 'defaultValue' | 'open'> {
|
|
20
|
+
menuItems: FilterDropdownItemProps[];
|
|
21
|
+
onClickItem: (item: FilterDropdownItemProps, event?: MouseEvent) => unknown;
|
|
22
|
+
value?: FilterDropdownItemProps;
|
|
23
|
+
defaultValue?: FilterDropdownItemProps | null;
|
|
24
|
+
icon?: ReactNode;
|
|
25
|
+
label?: ReactNode;
|
|
26
|
+
menuTitle?: ReactNode;
|
|
27
|
+
placeholder?: ReactNode;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
responsive?: boolean;
|
|
30
|
+
dense?: boolean;
|
|
31
|
+
extended?: boolean;
|
|
32
|
+
buttonSize?: 'small' | 'medium' | 'large';
|
|
33
|
+
buttonColor?: 'secondary' | 'primary';
|
|
34
|
+
transformOrigin?: {
|
|
35
|
+
vertical: 'top' | 'center' | 'bottom';
|
|
36
|
+
horizontal: 'left' | 'center' | 'right';
|
|
37
|
+
};
|
|
38
|
+
anchorOrigin?: {
|
|
39
|
+
vertical: 'top' | 'center' | 'bottom';
|
|
40
|
+
horizontal: 'left' | 'center' | 'right';
|
|
41
|
+
};
|
|
42
|
+
slotProps?: {
|
|
43
|
+
paper?: React.HTMLAttributes<HTMLDivElement>;
|
|
44
|
+
};
|
|
45
|
+
'aria-label'?: string;
|
|
46
|
+
tooltipLabel?: ReactNode;
|
|
47
|
+
tooltipPlacement?: TooltipProps['placement'];
|
|
48
|
+
}
|
|
49
|
+
export interface FilterDropdownMenuItemProps {
|
|
50
|
+
item: FilterDropdownItemProps;
|
|
51
|
+
onItemChange: (item: FilterDropdownItemProps, event?: MouseEvent) => void;
|
|
52
|
+
selectedValue?: FilterDropdownItemProps;
|
|
53
|
+
dense?: boolean;
|
|
54
|
+
extended?: boolean;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/FilterDropdown/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAElD,MAAM,WAAW,uBACf,SAAQ,IAAI,CAAC,aAAa,EAAE,IAAI,GAAG,QAAQ,CAAC;IAC5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
{"version":3,"file":"MenuItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/Menu/MenuItem.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,aAAa,IAAI,gBAAgB,EAElC,MAAM,eAAe,CAAA;AAMtB,MAAM,MAAM,aAAa,GAAG,gBAAgB,GAAG;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;CAClC,CAAA;AAsLD,QAAA,MAAM,QAAQ,sHAAwB,CAAA;AACtC,eAAe,QAAQ,CAAA"}
|
|
@@ -3,6 +3,7 @@ export * from './MultipleSelectField';
|
|
|
3
3
|
export * from './Table';
|
|
4
4
|
export * from './UploadField';
|
|
5
5
|
export * from './Autocomplete';
|
|
6
|
+
export * from './FilterDropdown';
|
|
6
7
|
export { default as AccordionGroup } from './AccordionGroup';
|
|
7
8
|
export { default as Alert } from './Alert';
|
|
8
9
|
export { default as Avatar } from './Avatar';
|
|
@@ -18,4 +19,5 @@ export type * from './Autocomplete/types';
|
|
|
18
19
|
export type * from './Avatar';
|
|
19
20
|
export type * from './Snackbar';
|
|
20
21
|
export type * from './Tag';
|
|
22
|
+
export type * from './FilterDropdown/types';
|
|
21
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,uBAAuB,CAAA;AACrC,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EAAE,OAAO,IAAI,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AAsB,CAAA;AACzC,mBAAmB,UAAU,CAAA;AAC7B,mBAAmB,YAAY,CAAA;AAC/B,mBAAmB,OAAO,CAAA;AAC1B,mBAAmB,wBAAwB,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ChipProps, DialogProps as MuiDialogProps, DialogContentProps as MuiDialogContentProps, DialogActionsProps as MuiDialogActionsProps, DialogTitleProps as MuiDialogTitleProps } from '@mui/material';
|
|
3
|
-
import { AlertProps } from '
|
|
3
|
+
import { AlertProps } from '../../molecules/Alert';
|
|
4
4
|
export type DialogSize = 'small' | 'medium' | 'large' | 'xlarge';
|
|
5
5
|
export interface DialogProps extends MuiDialogProps {
|
|
6
6
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/Dialog/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EACL,SAAS,EACT,WAAW,IAAI,cAAc,EAC7B,kBAAkB,IAAI,qBAAqB,EAC3C,kBAAkB,IAAI,qBAAqB,EAC3C,gBAAgB,IAAI,mBAAmB,EACxC,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/Dialog/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EACL,SAAS,EACT,WAAW,IAAI,cAAc,EAC7B,kBAAkB,IAAI,qBAAqB,EAC3C,kBAAkB,IAAI,qBAAqB,EAC3C,gBAAgB,IAAI,mBAAmB,EACxC,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAElD,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,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,EAAE,CAAA;CACtB;AAED,MAAM,MAAM,uBAAuB,GAAG,UAAU,GAAG;IACjD,WAAW,CAAC,EAAE,MAAM,IAAI,CAAA;IACxB,OAAO,EAAE,SAAS,CAAA;IAClB,MAAM,EAAE,OAAO,CAAA;IACf,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA"}
|
package/dist/widgets/index.cjs
CHANGED
|
@@ -1333,7 +1333,7 @@ function FormulaWidgetUI({
|
|
|
1333
1333
|
}
|
|
1334
1334
|
};
|
|
1335
1335
|
}, [animation, data, setValue]);
|
|
1336
|
-
const formattedValue = formatter(value);
|
|
1336
|
+
const formattedValue = value === NO_DATA ? NO_DATA : formatter(value);
|
|
1337
1337
|
const isComplexFormat = typeof formattedValue === "object" && formattedValue !== null;
|
|
1338
1338
|
const isDisabled = formattedValue === NO_DATA;
|
|
1339
1339
|
if (showSkeleton) {
|
package/dist/widgets/index.js
CHANGED
|
@@ -1331,7 +1331,7 @@ function FormulaWidgetUI({
|
|
|
1331
1331
|
}
|
|
1332
1332
|
};
|
|
1333
1333
|
}, [animation, data, setValue]);
|
|
1334
|
-
const formattedValue = formatter(value);
|
|
1334
|
+
const formattedValue = value === NO_DATA ? NO_DATA : formatter(value);
|
|
1335
1335
|
const isComplexFormat = typeof formattedValue === "object" && formattedValue !== null;
|
|
1336
1336
|
const isDisabled = formattedValue === NO_DATA;
|
|
1337
1337
|
if (showSkeleton) {
|