pixelize-design-library 1.1.35 → 1.1.36
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.
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { TableProps } from "./TableProps";
|
|
3
|
-
export default function Table({ data, columns, handleExportChange, onSelection, exportOptions, exportLabel, isLoading, isVisiblity, isCheckbox, headerBgColor, freezedBgColor, headerTextColor, freezedTextColor, tableBorderColor, noBorders, }: TableProps): React.JSX.Element;
|
|
3
|
+
export default function Table({ data, columns, handleExportChange, onSelection, exportOptions, exportLabel, isLoading, isVisiblity, isCheckbox, headerBgColor, freezedBgColor, headerTextColor, freezedTextColor, tableBorderColor, noBorders, isPagintaion, }: TableProps): React.JSX.Element;
|
|
@@ -60,23 +60,23 @@ var TableLoading_1 = __importDefault(require("./Components/TableLoading"));
|
|
|
60
60
|
var defaultPageSize = 5;
|
|
61
61
|
function Table(_a) {
|
|
62
62
|
var _b;
|
|
63
|
-
var data = _a.data, columns = _a.columns, handleExportChange = _a.handleExportChange, onSelection = _a.onSelection, exportOptions = _a.exportOptions, exportLabel = _a.exportLabel, isLoading = _a.isLoading, _c = _a.isVisiblity, isVisiblity = _c === void 0 ? true : _c, _d = _a.isCheckbox, isCheckbox = _d === void 0 ? false : _d, headerBgColor = _a.headerBgColor, freezedBgColor = _a.freezedBgColor, headerTextColor = _a.headerTextColor, freezedTextColor = _a.freezedTextColor, tableBorderColor = _a.tableBorderColor, _e = _a.noBorders, noBorders = _e === void 0 ? false : _e;
|
|
63
|
+
var data = _a.data, columns = _a.columns, handleExportChange = _a.handleExportChange, onSelection = _a.onSelection, exportOptions = _a.exportOptions, exportLabel = _a.exportLabel, isLoading = _a.isLoading, _c = _a.isVisiblity, isVisiblity = _c === void 0 ? true : _c, _d = _a.isCheckbox, isCheckbox = _d === void 0 ? false : _d, headerBgColor = _a.headerBgColor, freezedBgColor = _a.freezedBgColor, headerTextColor = _a.headerTextColor, freezedTextColor = _a.freezedTextColor, tableBorderColor = _a.tableBorderColor, _e = _a.noBorders, noBorders = _e === void 0 ? false : _e, _f = _a.isPagintaion, isPagintaion = _f === void 0 ? true : _f;
|
|
64
64
|
var theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
65
|
-
var
|
|
66
|
-
var
|
|
67
|
-
var
|
|
68
|
-
var
|
|
69
|
-
var
|
|
70
|
-
var
|
|
71
|
-
var
|
|
72
|
-
var
|
|
73
|
-
var
|
|
65
|
+
var _g = (0, react_4.useState)([]), selection = _g[0], setSelection = _g[1];
|
|
66
|
+
var _h = (0, react_4.useState)(0), currentPage = _h[0], setCurrentPage = _h[1];
|
|
67
|
+
var _j = (0, react_4.useState)(defaultPageSize), rowsPerPage = _j[0], setRowsPerPage = _j[1];
|
|
68
|
+
var _k = (0, react_4.useState)(false), isPopoverOpen = _k[0], setPopoverOpen = _k[1];
|
|
69
|
+
var _l = (0, react_4.useState)(null), activeHeader = _l[0], setActiveHeader = _l[1];
|
|
70
|
+
var _m = (0, react_4.useState)({}), searchTerms = _m[0], setSearchTerms = _m[1];
|
|
71
|
+
var _o = (0, react_4.useState)({}), searchOperation = _o[0], setSearchOperation = _o[1];
|
|
72
|
+
var _p = (0, react_4.useState)({}), betweenValues = _p[0], setBetweenValues = _p[1];
|
|
73
|
+
var _q = (0, react_4.useState)(columns.reduce(function (acc, curr) {
|
|
74
74
|
var _a;
|
|
75
75
|
return (__assign(__assign({}, acc), (_a = {}, _a[curr.label] = true, _a)));
|
|
76
|
-
}, {})), visibleColumns =
|
|
77
|
-
var
|
|
76
|
+
}, {})), visibleColumns = _q[0], setVisibleColumns = _q[1];
|
|
77
|
+
var _r = (0, react_4.useState)([]), columnWidths = _r[0], setColumnWidths = _r[1];
|
|
78
78
|
var headerRefs = (0, react_1.useRef)([]);
|
|
79
|
-
var
|
|
79
|
+
var _s = (0, react_4.useState)([]), columnsSort = _s[0], setColumnsSort = _s[1];
|
|
80
80
|
(0, react_1.useEffect)(function () {
|
|
81
81
|
// Measure widths after the component mounts
|
|
82
82
|
var widths = headerRefs.current.map(function (ref) { return (ref === null || ref === void 0 ? void 0 : ref.offsetWidth) || 0; });
|
|
@@ -398,6 +398,6 @@ function Table(_a) {
|
|
|
398
398
|
boxShadow: theme.shadows.lg,
|
|
399
399
|
} },
|
|
400
400
|
react_1.default.createElement(RenderTable, { columns: columns })),
|
|
401
|
-
react_1.default.createElement(Pagination_1.default, { columns: columns, currentPage: currentPage, setCurrentPage: setCurrentPage, rowsPerPage: rowsPerPage, pages: pages, paginationText: "".concat(startRow + 1, " to ").concat(endRow, " of ").concat(data.length), handlePageSizeChange: handlePageSizeChange, dataLength: data.length, visibleColumns: visibleColumns, handleColumnVisibilityChange: handleColumnVisibilityChange, isVisiblity: true })));
|
|
401
|
+
isPagintaion && (react_1.default.createElement(Pagination_1.default, { columns: columns, currentPage: currentPage, setCurrentPage: setCurrentPage, rowsPerPage: rowsPerPage, pages: pages, paginationText: "".concat(startRow + 1, " to ").concat(endRow, " of ").concat(data.length), handlePageSizeChange: handlePageSizeChange, dataLength: data.length, visibleColumns: visibleColumns, handleColumnVisibilityChange: handleColumnVisibilityChange, isVisiblity: true }))));
|
|
402
402
|
}
|
|
403
403
|
exports.default = Table;
|