@natoora-libs/core 0.1.16-dev-doug-9 → 0.1.16-dev-doug-11
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.
|
@@ -7116,7 +7116,7 @@ var SmartTableHeader = ({
|
|
|
7116
7116
|
order,
|
|
7117
7117
|
orderBy,
|
|
7118
7118
|
headCells,
|
|
7119
|
-
|
|
7119
|
+
numSelectedRows,
|
|
7120
7120
|
numRows,
|
|
7121
7121
|
enableCheckboxSelection = false,
|
|
7122
7122
|
headerFilters,
|
|
@@ -7136,8 +7136,8 @@ var SmartTableHeader = ({
|
|
|
7136
7136
|
{
|
|
7137
7137
|
color: "primary",
|
|
7138
7138
|
disableRipple: true,
|
|
7139
|
-
indeterminate:
|
|
7140
|
-
checked: numRows > 0 &&
|
|
7139
|
+
indeterminate: numSelectedRows > 0 && numSelectedRows < numRows,
|
|
7140
|
+
checked: numRows > 0 && numSelectedRows === numRows,
|
|
7141
7141
|
onChange: onSelectAllClick
|
|
7142
7142
|
}
|
|
7143
7143
|
) }) : null,
|
|
@@ -7758,15 +7758,19 @@ var TableDesktop = ({
|
|
|
7758
7758
|
() => rowsPerPage - numRows,
|
|
7759
7759
|
[rowsPerPage, numRows]
|
|
7760
7760
|
);
|
|
7761
|
+
const numSelectedRows = (0, import_react35.useMemo)(() => {
|
|
7762
|
+
const currentPageIds = new Set(data.map((row) => row[keyField]));
|
|
7763
|
+
return [...selectedRows].filter((id) => currentPageIds.has(id)).length;
|
|
7764
|
+
}, [data, selectedRows, keyField]);
|
|
7761
7765
|
const isEveryRowInPageSelected = (0, import_react35.useMemo)(
|
|
7762
|
-
() => numRows > 0 &&
|
|
7766
|
+
() => numRows > 0 && numSelectedRows === numRows,
|
|
7763
7767
|
[selectedRows, numRows]
|
|
7764
7768
|
);
|
|
7765
7769
|
const visibleHeadCells = (0, import_react35.useMemo)(
|
|
7766
7770
|
() => headCells.filter((headCell) => headCell?.enabled ?? true),
|
|
7767
7771
|
[headCells]
|
|
7768
7772
|
);
|
|
7769
|
-
const handleRequestSort = (
|
|
7773
|
+
const handleRequestSort = (_event, property) => {
|
|
7770
7774
|
const isAsc = orderBy === property && order === "asc";
|
|
7771
7775
|
const orderDir = isAsc ? "desc" : "asc";
|
|
7772
7776
|
setOrder(orderDir);
|
|
@@ -7776,7 +7780,7 @@ var TableDesktop = ({
|
|
|
7776
7780
|
}
|
|
7777
7781
|
};
|
|
7778
7782
|
const selectAllRowsInPage = () => {
|
|
7779
|
-
const allRowsIds = new Set(data.map((
|
|
7783
|
+
const allRowsIds = new Set(data.map((obj) => obj[keyField]));
|
|
7780
7784
|
;
|
|
7781
7785
|
setSelectedRows(allRowsIds);
|
|
7782
7786
|
};
|
|
@@ -7817,23 +7821,21 @@ var TableDesktop = ({
|
|
|
7817
7821
|
resetSelectedRows();
|
|
7818
7822
|
onApplyFilters?.(updatedFilters, shouldSave);
|
|
7819
7823
|
};
|
|
7820
|
-
const handlePageChange = (event, page) => {
|
|
7821
|
-
resetSelectedRows();
|
|
7822
|
-
footerProps?.onPageChange?.(event, page);
|
|
7823
|
-
};
|
|
7824
7824
|
(0, import_react35.useEffect)(() => {
|
|
7825
7825
|
if (!enableCheckboxSelection) {
|
|
7826
7826
|
resetSelectedRows();
|
|
7827
7827
|
}
|
|
7828
7828
|
}, [enableCheckboxSelection]);
|
|
7829
|
+
(0, import_react35.useEffect)(() => {
|
|
7830
|
+
if (isRowsFromAllPagesSelected) {
|
|
7831
|
+
selectAllRowsInPage();
|
|
7832
|
+
}
|
|
7833
|
+
}, [data, isRowsFromAllPagesSelected, keyField]);
|
|
7829
7834
|
(0, import_react35.useEffect)(() => {
|
|
7830
7835
|
if (isEveryRowInPageSelected || isRowsFromAllPagesSelected) {
|
|
7831
|
-
|
|
7832
|
-
setSelectedRows(
|
|
7833
|
-
(prev) => new Set([...prev].filter((value) => rowsIdsSet.has(value)))
|
|
7834
|
-
);
|
|
7836
|
+
setSelectedRows((prev) => new Set(prev));
|
|
7835
7837
|
}
|
|
7836
|
-
}, [
|
|
7838
|
+
}, [isEveryRowInPageSelected, isRowsFromAllPagesSelected]);
|
|
7837
7839
|
const renderBody = (0, import_react35.useMemo)(
|
|
7838
7840
|
() => rowsPerPage !== emptyRows ? /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
7839
7841
|
TableDesktopRows,
|
|
@@ -7913,7 +7915,7 @@ var TableDesktop = ({
|
|
|
7913
7915
|
{
|
|
7914
7916
|
isEveryRowInPageSelected,
|
|
7915
7917
|
isRowsFromAllPagesSelected,
|
|
7916
|
-
numSelectedRows
|
|
7918
|
+
numSelectedRows,
|
|
7917
7919
|
totalRowCount: totalDataCount ?? 0,
|
|
7918
7920
|
onSelectRowsFromAllPagesClick: handleSelectRowsFromAllPagesClick,
|
|
7919
7921
|
onClearSelectionClick: handleClearSelectionClick
|
|
@@ -7959,7 +7961,7 @@ var TableDesktop = ({
|
|
|
7959
7961
|
headCells: visibleHeadCells,
|
|
7960
7962
|
order,
|
|
7961
7963
|
orderBy,
|
|
7962
|
-
|
|
7964
|
+
numSelectedRows,
|
|
7963
7965
|
numRows,
|
|
7964
7966
|
enableCheckboxSelection,
|
|
7965
7967
|
headerFilters: headerFilters ?? {},
|
|
@@ -7984,7 +7986,7 @@ var TableDesktop = ({
|
|
|
7984
7986
|
}
|
|
7985
7987
|
),
|
|
7986
7988
|
children,
|
|
7987
|
-
footerProps ? /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(TableDesktopFooter, { ...footerProps
|
|
7989
|
+
footerProps ? /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(TableDesktopFooter, { ...footerProps }) : null
|
|
7988
7990
|
]
|
|
7989
7991
|
}
|
|
7990
7992
|
)
|
|
@@ -7993,6 +7995,7 @@ var TableDesktop = ({
|
|
|
7993
7995
|
};
|
|
7994
7996
|
|
|
7995
7997
|
// src/components/TableDesktopEditableComponent/TableDesktopEditableComponent.tsx
|
|
7998
|
+
var import_react39 = require("react");
|
|
7996
7999
|
var import_material70 = require("@mui/material");
|
|
7997
8000
|
|
|
7998
8001
|
// src/components/TableDesktopEditableComponent/TableDesktopNumericField.tsx
|
|
@@ -8184,7 +8187,7 @@ var TableDesktopTextField = ({
|
|
|
8184
8187
|
|
|
8185
8188
|
// src/components/TableDesktopEditableComponent/TableDesktopEditableComponent.tsx
|
|
8186
8189
|
var import_jsx_runtime125 = require("react/jsx-runtime");
|
|
8187
|
-
var
|
|
8190
|
+
var TableDesktopEditableComponentBase = ({
|
|
8188
8191
|
editInitialValue,
|
|
8189
8192
|
rowId,
|
|
8190
8193
|
field,
|
|
@@ -8270,9 +8273,10 @@ var TableDesktopEditableComponent = ({
|
|
|
8270
8273
|
};
|
|
8271
8274
|
return editableComponents[editableCellType];
|
|
8272
8275
|
};
|
|
8276
|
+
var TableDesktopEditableComponent = (0, import_react39.memo)(TableDesktopEditableComponentBase);
|
|
8273
8277
|
|
|
8274
8278
|
// src/components/TableDesktopCell/TableDesktopCell.tsx
|
|
8275
|
-
var
|
|
8279
|
+
var import_react40 = require("react");
|
|
8276
8280
|
var import_Check2 = __toESM(require("@mui/icons-material/Check"), 1);
|
|
8277
8281
|
var import_Close = __toESM(require("@mui/icons-material/Close"), 1);
|
|
8278
8282
|
var import_Edit = __toESM(require("@mui/icons-material/Edit"), 1);
|
|
@@ -8311,17 +8315,17 @@ var TableDesktopCell = ({
|
|
|
8311
8315
|
onUpdateEditableCell,
|
|
8312
8316
|
onCellClick
|
|
8313
8317
|
}) => {
|
|
8314
|
-
const cellRef = (0,
|
|
8315
|
-
const [isOverflowed, setIsOverflowed] = (0,
|
|
8316
|
-
const [isCellHovered, setIsCellHovered] = (0,
|
|
8317
|
-
const [isCellInEditMode, setIsCellInEditMode] = (0,
|
|
8318
|
-
(0,
|
|
8318
|
+
const cellRef = (0, import_react40.useRef)(null);
|
|
8319
|
+
const [isOverflowed, setIsOverflowed] = (0, import_react40.useState)(false);
|
|
8320
|
+
const [isCellHovered, setIsCellHovered] = (0, import_react40.useState)(false);
|
|
8321
|
+
const [isCellInEditMode, setIsCellInEditMode] = (0, import_react40.useState)(false);
|
|
8322
|
+
(0, import_react40.useEffect)(() => {
|
|
8319
8323
|
const ref = cellRef.current;
|
|
8320
8324
|
if (ref) {
|
|
8321
8325
|
setIsOverflowed(ref.scrollWidth > ref.clientWidth);
|
|
8322
8326
|
}
|
|
8323
8327
|
}, [readOnlyValue, width]);
|
|
8324
|
-
(0,
|
|
8328
|
+
(0, import_react40.useEffect)(() => {
|
|
8325
8329
|
const handleKeyDown = (e) => {
|
|
8326
8330
|
if (e.key === "Escape") {
|
|
8327
8331
|
setIsCellInEditMode(false);
|
|
@@ -8407,7 +8411,7 @@ var TableDesktopCell = ({
|
|
|
8407
8411
|
};
|
|
8408
8412
|
|
|
8409
8413
|
// src/components/TableHeader/TableHeader.tsx
|
|
8410
|
-
var
|
|
8414
|
+
var import_react41 = require("react");
|
|
8411
8415
|
var import_icons_material12 = require("@mui/icons-material");
|
|
8412
8416
|
var import_material72 = require("@mui/material");
|
|
8413
8417
|
var import_mui56 = require("tss-react/mui");
|
|
@@ -8420,9 +8424,9 @@ var useStyles50 = (0, import_mui56.makeStyles)()(() => ({
|
|
|
8420
8424
|
}
|
|
8421
8425
|
}));
|
|
8422
8426
|
var TableHeader = ({ cells, onSort = null }) => {
|
|
8423
|
-
const [sortableCells, setSortableCells] = (0,
|
|
8427
|
+
const [sortableCells, setSortableCells] = (0, import_react41.useState)([]);
|
|
8424
8428
|
const { classes } = useStyles50();
|
|
8425
|
-
(0,
|
|
8429
|
+
(0, import_react41.useEffect)(() => {
|
|
8426
8430
|
setSortableCells(cells);
|
|
8427
8431
|
}, []);
|
|
8428
8432
|
const getNewSortDirection = (direction) => {
|
|
@@ -8467,7 +8471,7 @@ var TableHeader = ({ cells, onSort = null }) => {
|
|
|
8467
8471
|
}
|
|
8468
8472
|
) : cell.label }, cell.label || key)) }) });
|
|
8469
8473
|
};
|
|
8470
|
-
var TableHeader_default = (0,
|
|
8474
|
+
var TableHeader_default = (0, import_react41.memo)(TableHeader);
|
|
8471
8475
|
|
|
8472
8476
|
// src/components/TextDivider/TextDivider.tsx
|
|
8473
8477
|
var import_material73 = require("@mui/material");
|
|
@@ -8644,7 +8648,7 @@ var ThemedDateRangePicker = ({
|
|
|
8644
8648
|
var ThemedDateRangePicker_default = ThemedDateRangePicker;
|
|
8645
8649
|
|
|
8646
8650
|
// src/components/TheToolbar/TheToolbar.tsx
|
|
8647
|
-
var
|
|
8651
|
+
var import_react42 = require("react");
|
|
8648
8652
|
var import_material74 = require("@mui/material");
|
|
8649
8653
|
var import_mui59 = require("tss-react/mui");
|
|
8650
8654
|
var import_jsx_runtime130 = require("react/jsx-runtime");
|
|
@@ -8693,7 +8697,7 @@ var TheToolbar = ({
|
|
|
8693
8697
|
LeftDrawer
|
|
8694
8698
|
] });
|
|
8695
8699
|
};
|
|
8696
|
-
var TheToolbar_default = (0,
|
|
8700
|
+
var TheToolbar_default = (0, import_react42.memo)(TheToolbar);
|
|
8697
8701
|
|
|
8698
8702
|
// src/components/ToastMessage/ToastMessage.tsx
|
|
8699
8703
|
var import_material75 = require("@mui/material");
|
|
@@ -8836,7 +8840,7 @@ var TwoButtonDialog = ({
|
|
|
8836
8840
|
var TwoButtonDialog_default = TwoButtonDialog;
|
|
8837
8841
|
|
|
8838
8842
|
// src/components/UserBust/UserBust.tsx
|
|
8839
|
-
var
|
|
8843
|
+
var import_react43 = require("react");
|
|
8840
8844
|
var import_material77 = require("@mui/material");
|
|
8841
8845
|
var import_jsx_runtime133 = require("react/jsx-runtime");
|
|
8842
8846
|
var UserBust = ({ user, avatarProps, typographyProps }) => /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { children: [
|
|
@@ -8853,7 +8857,7 @@ var UserBust = ({ user, avatarProps, typographyProps }) => /* @__PURE__ */ (0, i
|
|
|
8853
8857
|
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material77.Typography, { ...typographyProps.username, children: user.username })
|
|
8854
8858
|
] })
|
|
8855
8859
|
] });
|
|
8856
|
-
var UserBust_default = (0,
|
|
8860
|
+
var UserBust_default = (0, import_react43.memo)(UserBust);
|
|
8857
8861
|
|
|
8858
8862
|
// src/components/icons/IconChart.tsx
|
|
8859
8863
|
var import_jsx_runtime134 = require("react/jsx-runtime");
|