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 _f = (0, react_4.useState)([]), selection = _f[0], setSelection = _f[1];
66
- var _g = (0, react_4.useState)(0), currentPage = _g[0], setCurrentPage = _g[1];
67
- var _h = (0, react_4.useState)(defaultPageSize), rowsPerPage = _h[0], setRowsPerPage = _h[1];
68
- var _j = (0, react_4.useState)(false), isPopoverOpen = _j[0], setPopoverOpen = _j[1];
69
- var _k = (0, react_4.useState)(null), activeHeader = _k[0], setActiveHeader = _k[1];
70
- var _l = (0, react_4.useState)({}), searchTerms = _l[0], setSearchTerms = _l[1];
71
- var _m = (0, react_4.useState)({}), searchOperation = _m[0], setSearchOperation = _m[1];
72
- var _o = (0, react_4.useState)({}), betweenValues = _o[0], setBetweenValues = _o[1];
73
- var _p = (0, react_4.useState)(columns.reduce(function (acc, curr) {
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 = _p[0], setVisibleColumns = _p[1];
77
- var _q = (0, react_4.useState)([]), columnWidths = _q[0], setColumnWidths = _q[1];
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 _r = (0, react_4.useState)([]), columnsSort = _r[0], setColumnsSort = _r[1];
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;
@@ -15,6 +15,7 @@ export type TableProps = {
15
15
  tableBorderColor?: string;
16
16
  noBorders?: boolean;
17
17
  onSelection?: (selected: (string | number)[]) => void;
18
+ isPagintaion?: boolean;
18
19
  };
19
20
  export type DataObject = {
20
21
  [key: string]: string | number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixelize-design-library",
3
- "version": "1.1.35",
3
+ "version": "1.1.36",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",