@bluemarble/bm-components 0.0.83 → 0.0.85

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
@@ -14976,7 +14976,7 @@ const FormikSwitch = (_a) => {
14976
14976
  const onChange = (_, value) => {
14977
14977
  setValue(value);
14978
14978
  };
14979
- return (React__default.createElement(FormControlLabel, Object.assign({ label: label, onChange: onChange, control: React__default.createElement(Switch$1, Object.assign({}, props, { defaultChecked: value })) }, field, FormControlLabelProps)));
14979
+ return (React__default.createElement(FormControlLabel, Object.assign({ label: label, onChange: onChange, control: React__default.createElement(Switch$1, Object.assign({ defaultChecked: value }, props)) }, field, FormControlLabelProps)));
14980
14980
  };
14981
14981
 
14982
14982
  const Radio = (_a) => {
@@ -15033,18 +15033,43 @@ const GridPagination = ({ currentPage, totalNumberOfPages, onPageChange, rowsPer
15033
15033
  React__default.createElement(MdArrowForwardIos, { size: 8 * 2 })))));
15034
15034
  };
15035
15035
 
15036
- function BaseGrid({ columns, children, fixedColumns, paperProps, tableBodyProps, tableHeadProps, tableProps, sortedDirection, sortedBy, onSortBy, dense = true, striped, bordered, currentPage, totalNumberOfPages, onPageChange, rowsPerPage, setRowsPerPage, rowsPerPageOptions, hideFooter, isLoading }) {
15037
- return (React__default.createElement(Paper, Object.assign({}, paperProps, { sx: Object.assign({ 'tr td': {
15038
- py: dense ? 0.23 : 0.7
15039
- }, 'tr td:not(:last-child), tr th:not(:last-child)': {
15040
- borderRight: bordered ? '1px solid' : '',
15036
+ const styles = {
15037
+ rowGap: function (dense) {
15038
+ return {
15039
+ py: dense ? 0.23 : 0.7
15040
+ };
15041
+ },
15042
+ bordered: function (active) {
15043
+ if (!active)
15044
+ return {};
15045
+ return {
15046
+ 'tr td:not(:last-child), tr th:not(:last-child)': {
15047
+ borderRight: '1px solid',
15041
15048
  borderColor: 'divider'
15042
- }, 'tr:nth-of-type(even)': {
15049
+ }
15050
+ };
15051
+ },
15052
+ striped: function (active) {
15053
+ if (!active)
15054
+ return {};
15055
+ return {
15056
+ 'tr:nth-of-type(even)': {
15043
15057
  transition: 'background-color ease 200ms',
15044
- bgcolor: striped ? 'divider' : 'initial'
15045
- }, 'tbody tr:last-child td': {
15046
- borderBottomWidth: hideFooter ? 0 : 1
15047
- } }, paperProps === null || paperProps === void 0 ? void 0 : paperProps.sx) }),
15058
+ bgcolor: 'divider'
15059
+ }
15060
+ };
15061
+ },
15062
+ lastRowBorder: function (active) {
15063
+ return {
15064
+ 'tbody tr:last-child td': {
15065
+ borderBottomWidth: active ? 0 : 1
15066
+ }
15067
+ };
15068
+ }
15069
+ };
15070
+
15071
+ function BaseGrid({ columns, children, fixedColumns, paperProps, tableBodyProps, tableHeadProps, tableProps, sortedDirection, sortedBy, onSortBy, dense = true, striped, bordered, currentPage, totalNumberOfPages, onPageChange, rowsPerPage, setRowsPerPage, rowsPerPageOptions, hideFooter, isLoading }) {
15072
+ return (React__default.createElement(Paper, Object.assign({}, paperProps, { sx: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, styles.rowGap(dense)), styles.bordered(bordered)), styles.striped(striped)), styles.lastRowBorder(hideFooter)), paperProps === null || paperProps === void 0 ? void 0 : paperProps.sx) }),
15048
15073
  React__default.createElement(Table, Object.assign({ size: "small", stickyHeader: true }, tableProps, { sx: Object.assign({}, tableProps === null || tableProps === void 0 ? void 0 : tableProps.sx) }),
15049
15074
  React__default.createElement(TableHead, Object.assign({}, tableHeadProps),
15050
15075
  React__default.createElement(TableRow, null, columns.map((column) => (React__default.createElement(TableCell, { key: column.name, padding: dense ? 'none' : 'normal', sx: Object.assign({ pl: 2 }, column === null || column === void 0 ? void 0 : column.sx) }, column.children ? (column.children) : (React__default.createElement(TableSortLabel, { active: sortedBy === column.name, direction: sortedDirection, onClick: () => onSortBy(column.name), disabled: column.canSort === false }, column.label)))))),