@bluemarble/bm-components 0.0.42 → 0.0.44
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/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { memo, useState, useRef, useMemo, useEffect, useCallback } from 'react';
|
|
3
|
-
import { TableHead, TableRow, TableCell, TableSortLabel, Chip, Tooltip, IconButton, Paper, LinearProgress, TableContainer, Table, TableBody, TablePagination, Popover, Box as Box$2, Typography, Autocomplete as Autocomplete$1, TextField, Button, FormControl, Select as Select$1, InputLabel, FormControlLabel, Checkbox as Checkbox$1, Switch as Switch$1, FormLabel, RadioGroup, Radio as Radio$1, CircularProgress, Stack, MenuItem } from '@mui/material';
|
|
3
|
+
import { TableHead, TableRow, TableCell, TableSortLabel, Chip, Tooltip, IconButton, Paper, LinearProgress, TableContainer, Table, TableBody, TablePagination, Popover, Box as Box$2, Typography, Autocomplete as Autocomplete$1, TextField, Button, FormControl, Select as Select$1, InputLabel, FormControlLabel, Checkbox as Checkbox$1, Switch as Switch$1, FormLabel, RadioGroup, Radio as Radio$1, CircularProgress, Stack, MenuItem, Modal as Modal$1 } from '@mui/material';
|
|
4
4
|
import emStyled from '@emotion/styled';
|
|
5
5
|
import '@emotion/react';
|
|
6
6
|
import { Field, useField } from 'formik';
|
|
@@ -15066,17 +15066,17 @@ function Grid({ columns: columnsData, children, fixedColumns, paperProps, tableB
|
|
|
15066
15066
|
useEvent("mouseup", () => {
|
|
15067
15067
|
setDraggingColumn(-1);
|
|
15068
15068
|
});
|
|
15069
|
-
return (React__default.createElement(Paper, Object.assign({}, paperProps, { sx: Object.assign({ "tr td": {
|
|
15069
|
+
return (React__default.createElement(Paper, Object.assign({}, paperProps, { sx: Object.assign({ "tbody tr td": {
|
|
15070
15070
|
py: dense ? 0.23 : 0.7,
|
|
15071
15071
|
border: bordered ? "1px solid" : "",
|
|
15072
15072
|
borderColor: "divider",
|
|
15073
|
-
}, "tr:nth-of-type(even)": {
|
|
15073
|
+
}, "tbody tr:nth-of-type(even)": {
|
|
15074
15074
|
transition: "background-color ease 200ms",
|
|
15075
15075
|
bgcolor: striped ? "divider" : "initial",
|
|
15076
15076
|
}, width: fixedColumns ? "fit-content" : "100%" }, paperProps === null || paperProps === void 0 ? void 0 : paperProps.sx) }),
|
|
15077
15077
|
React__default.createElement(Table, Object.assign({ size: "small", stickyHeader: true }, tableProps, { sx: Object.assign(Object.assign({}, getTableWidth()), tableProps === null || tableProps === void 0 ? void 0 : tableProps.sx) }),
|
|
15078
15078
|
React__default.createElement(TableHead, Object.assign({}, tableHeadProps),
|
|
15079
|
-
React__default.createElement(TableRow, { ref: columnsRef }, columns.map((column, index) => (React__default.createElement(TableCell, { key: column.name, padding: dense ? "none" : "normal", sx: Object.assign({ border: "1px solid", borderColor: "divider", width: column.width || 100, minWidth: getColWidth((column === null || column === void 0 ? void 0 : column.width) || 100), maxWidth: getColWidth((column === null || column === void 0 ? void 0 : column.width) || 100), pl: 2, zIndex: columns.length - index }, column === null || column === void 0 ? void 0 : column.sx) },
|
|
15079
|
+
React__default.createElement(TableRow, { ref: columnsRef }, columns.map((column, index) => (React__default.createElement(TableCell, { key: column.name, padding: dense ? "none" : "normal", sx: Object.assign(Object.assign({ border: "1px solid", borderColor: "divider", width: column.width || 100, minWidth: getColWidth((column === null || column === void 0 ? void 0 : column.width) || 100), maxWidth: getColWidth((column === null || column === void 0 ? void 0 : column.width) || 100), pl: 2, zIndex: columns.length - index }, column === null || column === void 0 ? void 0 : column.sx), { position: tableProps.stickyHeader ? "sticky" : "relative" }) },
|
|
15080
15080
|
React__default.createElement(TableSortLabel, { active: sortedBy === column.name, direction: sortedDirection, onClick: () => onSortBy(column.name), disabled: column.canSort === false, sx: { position: "relative", right: "-9px" } }, column.label),
|
|
15081
15081
|
index < columns.length && (React__default.createElement(Box$2, { id: `resize-col-${index}`, sx: {
|
|
15082
15082
|
width: "4px",
|
|
@@ -15257,5 +15257,32 @@ function useGrid({ columns, filters = [], rowsPerPageOptions = [30, 60, 100], })
|
|
|
15257
15257
|
};
|
|
15258
15258
|
}
|
|
15259
15259
|
|
|
15260
|
-
|
|
15260
|
+
function useLoading() {
|
|
15261
|
+
const [state, setState] = useState([]);
|
|
15262
|
+
const isLoading = (prop) => state.includes(prop);
|
|
15263
|
+
const setLoading = (prop, remove) => {
|
|
15264
|
+
if (remove)
|
|
15265
|
+
setState((prevState) => prevState.filter((state) => state !== prop));
|
|
15266
|
+
else
|
|
15267
|
+
setState((prevState) => [...prevState, prop]);
|
|
15268
|
+
};
|
|
15269
|
+
return { isLoading, setLoading };
|
|
15270
|
+
}
|
|
15271
|
+
|
|
15272
|
+
const Modal = (_a) => {
|
|
15273
|
+
var { open, onClose } = _a, rest = __rest(_a, ["open", "onClose"]);
|
|
15274
|
+
return (React__default.createElement(Modal$1, Object.assign({ open: open, onClose: onClose, disableEnforceFocus: true }, rest),
|
|
15275
|
+
React__default.createElement(Box$2, { sx: {
|
|
15276
|
+
outline: "none",
|
|
15277
|
+
backgroundColor: "white",
|
|
15278
|
+
position: "absolute",
|
|
15279
|
+
top: "50%",
|
|
15280
|
+
left: "50%",
|
|
15281
|
+
transform: "translate(-50%, -50%)",
|
|
15282
|
+
borderRadius: 1,
|
|
15283
|
+
} },
|
|
15284
|
+
React__default.createElement(React__default.Fragment, null, rest.children))));
|
|
15285
|
+
};
|
|
15286
|
+
|
|
15287
|
+
export { Autocomplete, Grid as BaseGrid, Checkbox, EditableTableCell, Grid$1 as Grid, Input, InputMask, LargeButton, Modal, Radio, Select, Switch, TabPanel, Td, Tr, createFilter, filterData, getTabProps, useEvent, useFilter, useGrid, useLoading };
|
|
15261
15288
|
//# sourceMappingURL=index.js.map
|