venice-ui 2.2.11 → 2.3.1

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.
@@ -125,7 +125,7 @@ const DropdownMenu = ({ size = 'medium', iconName = 'more_vert', header = false,
125
125
  headerTitle && (react_1.default.createElement(Typography_1.TextAccent, { color: Theme_1.Theme.colors.text }, headerTitle)),
126
126
  headerSubtitle && (react_1.default.createElement(Typography_1.TextLabel, { color: Theme_1.Theme.colors.text }, headerSubtitle)))),
127
127
  react_1.default.createElement(DropdownMenu_styles_1.DropdownMenuContent, null, options &&
128
- options.map((option) => (react_1.default.createElement(DropdownMenu_styles_1.DropdownMenuOption, { key: option.label, isDisable: isDisable(option.disableID, option.diasbled), onClick: () => handleClick(option.action, option.diasbled ? option.diasbled : false, option.disableID), isActive: option.isActive }, option.label)))),
128
+ options.map((option) => (react_1.default.createElement(DropdownMenu_styles_1.DropdownMenuOption, { key: option.label, isDisable: isDisable(option.disableID, option.disabled), onClick: () => handleClick(option.action, option.disabled ? option.disabled : false, option.disableID), isActive: option.isActive }, option.label)))),
129
129
  footer && (react_1.default.createElement(DropdownMenu_styles_1.DropdownMenuFooter, null, footerText && (react_1.default.createElement(Typography_1.Text, { action: true, onClick: handleFooterAction }, footerText)))))), document.body)));
130
130
  };
131
131
  exports.DropdownMenu = DropdownMenu;
@@ -69,6 +69,8 @@ exports.InputReadOnlyElement = styled_components_1.default.div `
69
69
  exports.InputLabelElement = (0, styled_components_1.default)(Typography_1.TextLabel) `
70
70
  ${(p) => p.labelPosition === 'top' && `margin-bottom: ${Theme_1.Theme.padding.s};`}
71
71
  ${(p) => p.labelPosition === 'left' && `margin-left: ${Theme_1.Theme.padding.s};`}
72
+ ${(p) => p.labelPosition === 'left' && `margin-right: ${Theme_1.Theme.padding.s};`}
73
+ white-space: nowrap;
72
74
  `;
73
75
  exports.InputWrapper = styled_components_1.default.div `
74
76
  display: flex;
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Pagination = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const Icons_1 = require("../Icons");
9
+ const Theme_1 = require("../../Theme/Theme");
10
+ const Dropdown_1 = require("../Dropdown");
11
+ const Pagination_styles_1 = require("./Pagination.styles");
12
+ const getPageNumbers = (current, total) => {
13
+ const pages = [];
14
+ if (total <= 5) {
15
+ for (let i = 1; i <= total; i++)
16
+ pages.push(i);
17
+ }
18
+ else {
19
+ if (current <= 3) {
20
+ pages.push(1, 2, 3, '...', total);
21
+ }
22
+ else if (current >= total - 2) {
23
+ pages.push(1, '...', total - 2, total - 1, total);
24
+ }
25
+ else {
26
+ pages.push(1, '...', current - 1, current, current + 1, '...', total);
27
+ }
28
+ }
29
+ return pages;
30
+ };
31
+ const Pagination = ({ currentPage, totalPages, pageSize, onPageChange, onPageSizeChange, availableValues = [10, 20, 50], }) => {
32
+ const pageNumbers = getPageNumbers(currentPage, totalPages);
33
+ const pageSizeStr = !isNaN(pageSize) ? String(pageSize) : '10';
34
+ let dropdownOptions = availableValues.map(size => ({
35
+ value: size.toString(),
36
+ label: size.toString(),
37
+ }));
38
+ if (!dropdownOptions.some(opt => opt.value === pageSizeStr)) {
39
+ dropdownOptions = [
40
+ { value: pageSizeStr, label: pageSizeStr },
41
+ ...dropdownOptions,
42
+ ];
43
+ }
44
+ return (react_1.default.createElement(Pagination_styles_1.PaginationElement, null,
45
+ react_1.default.createElement(Icons_1.Icon, { name: 'back', size: 16, iconColor: Theme_1.Theme.colors.text, onClick: () => onPageChange(Math.max(1, currentPage - 1)), isDisabled: currentPage === 1 }),
46
+ pageNumbers.map((num, idx) => num === '...' ? (react_1.default.createElement("span", { key: `ellipsis-${idx}` }, "...")) : (react_1.default.createElement(Pagination_styles_1.PaginationButton, { key: num, onClick: () => onPageChange(Number(num)), disabled: num === currentPage }, num))),
47
+ react_1.default.createElement(Icons_1.Icon, { name: 'forward', size: 16, iconColor: Theme_1.Theme.colors.text, onClick: () => onPageChange(Math.min(totalPages, currentPage + 1)), isDisabled: currentPage === totalPages }),
48
+ react_1.default.createElement("div", null,
49
+ react_1.default.createElement(Dropdown_1.Dropdown, { size: "small", label: "Ilo\u015B\u0107 na stron\u0119:", labelPosition: "left", handleSelect: (name, value) => {
50
+ const num = Number(value);
51
+ if (!isNaN(num) && num > 0) {
52
+ onPageSizeChange(num);
53
+ }
54
+ }, name: "pageSize", value: String(pageSize), options: dropdownOptions }))));
55
+ };
56
+ exports.Pagination = Pagination;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.PaginationButton = exports.PaginationElement = void 0;
7
+ const styled_components_1 = __importDefault(require("styled-components"));
8
+ const Theme_1 = require("../../Theme/Theme");
9
+ exports.PaginationElement = styled_components_1.default.div `
10
+ margin-top: 16px;
11
+ display: flex;
12
+ justify-content: right;
13
+ align-items: center;
14
+ `;
15
+ exports.PaginationButton = styled_components_1.default.button `
16
+ font-weight: normal;
17
+ background: transparent;
18
+ border: none;
19
+ cursor: pointer;
20
+ padding: ${Theme_1.Theme.padding.s}
21
+ border-radius: 4px;
22
+ color: ${Theme_1.Theme.colors.text};
23
+ margin: 0 6px;
24
+ &:disabled {
25
+ background: ${Theme_1.Theme.colors.primary};
26
+ color: ${Theme_1.Theme.colors.white};
27
+ cursor: not-allowed;
28
+ border-radius: 4px;
29
+ }
30
+ `;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./Pagination"), exports);
@@ -10,16 +10,19 @@ const DropdownMenu_1 = require("../DropdownMenu");
10
10
  const Theme_1 = require("../../Theme");
11
11
  const date_fns_1 = require("date-fns");
12
12
  const tableHelper_1 = require("./tableHelper");
13
- const Cell = ({ header, theme = Theme_1.mainTheme, moreActions, item, marked = false, }) => {
13
+ const Cell = ({ header, theme = Theme_1.mainTheme, moreActions, item, marked = false, isDisabled = false, }) => {
14
14
  if (header.action) {
15
+ const cellAction = item.disabled
16
+ ? moreActions.map((a) => ({ ...a, disabled: true }))
17
+ : moreActions.map((a) => ({ ...a }));
15
18
  return (react_1.default.createElement(Table_styles_1.OptionTableCell, null,
16
19
  react_1.default.createElement(Table_styles_1.OptionTableCellWrapper, { onClick: (e) => e.stopPropagation() },
17
- react_1.default.createElement(DropdownMenu_1.DropdownMenu, { options: moreActions, targetID: item.id, iconName: "more_vert", iconColor: theme.tableMoreIconColor, iconHoverColor: theme.tableHoverMoreIconColor, iconBgHoverColor: "transparent", position: "right" }))));
20
+ react_1.default.createElement(DropdownMenu_1.DropdownMenu, { options: cellAction, targetID: item.id, iconName: "more_vert", iconColor: theme.tableMoreIconColor, iconHoverColor: theme.tableHoverMoreIconColor, iconBgHoverColor: "transparent", position: "right" }))));
18
21
  }
19
22
  if (header.scope) {
20
- return (react_1.default.createElement(Table_styles_1.TableCell, { marked: marked }, (0, tableHelper_1.getValueFormScope)(item[header.valueSource], header.scope)));
23
+ return (react_1.default.createElement(Table_styles_1.TableCell, { marked: marked, disabled: isDisabled }, (0, tableHelper_1.getValueFormScope)(item[header.valueSource], header.scope)));
21
24
  }
22
- return (react_1.default.createElement(Table_styles_1.TableCell, { marked: marked }, header.date
25
+ return (react_1.default.createElement(Table_styles_1.TableCell, { marked: marked, disabled: isDisabled }, header.date
23
26
  ? item[header.valueSource] !== undefined
24
27
  ? (0, date_fns_1.format)(item[header.valueSource], 'dd-MM-yyyy')
25
28
  : ''
@@ -31,10 +31,11 @@ const Theme_1 = require("../../Theme");
31
31
  const tableHelper_1 = require("./tableHelper");
32
32
  const HeaderCell_1 = require("./HeaderCell");
33
33
  const Cell_1 = require("./Cell");
34
+ const Pagination_1 = require("../Pagination");
34
35
  const Table = ({ theme = Theme_1.mainTheme, headers, elements, hover = true, selectable = true, sortable = true, sort = {
35
36
  name: '',
36
37
  order: 'none',
37
- }, moreActions = [], onRowClick, }) => {
38
+ }, pageSize = 10, ifPagination = false, moreActions = [], onRowClick, }) => {
38
39
  const checkHeaders = () => {
39
40
  const tableHeaders = [...headers];
40
41
  if (moreActions.length > 0) {
@@ -74,12 +75,23 @@ const Table = ({ theme = Theme_1.mainTheme, headers, elements, hover = true, sel
74
75
  });
75
76
  }
76
77
  };
78
+ // PAGINACJA
79
+ const [currentPage, setCurrentPage] = (0, react_1.useState)(1);
80
+ const [currentPageSize, setCurrentPageSize] = (0, react_1.useState)(pageSize || 10);
81
+ const totalPages = Math.ceil(tableProps.elements.length / currentPageSize);
82
+ const paginatedElements = tableProps.elements.slice((currentPage - 1) * currentPageSize, currentPage * currentPageSize);
83
+ (0, react_1.useEffect)(() => {
84
+ setCurrentPage(1);
85
+ }, [elements, currentPageSize]);
77
86
  return (react_1.default.createElement(styled_components_1.ThemeProvider, { theme: theme },
78
87
  react_1.default.createElement(Table_styles_1.TableWrapper, { cellPadding: "0", cellSpacing: "0" },
79
88
  react_1.default.createElement(Table_styles_1.TableHead, null,
80
89
  react_1.default.createElement(Table_styles_1.TableRow, { hover: false, selectable: false, active: false }, tableProps.headers.map((header) => (react_1.default.createElement(HeaderCell_1.HeaderCell, { key: `header_${header.name}`, header: header, sortable: sortable, handleSort: handleHeaderCellClick, sort: tableProps.sort }))))),
81
- react_1.default.createElement("tbody", null, tableProps.elements.map((item) => (react_1.default.createElement(Table_styles_1.TableRow, { key: `table_row_${item.id}`, hover: hover, active: selectedRow === item.id, selectable: selectable, onClick: () => handleRowClick(item.id) }, tableProps.headers.map((header, index) => {
82
- return (react_1.default.createElement(Cell_1.Cell, { key: `cell_${header.name}_${item.id}`, header: header, moreActions: moreActions, item: item, theme: theme, marked: item.marked && index === 0 }));
83
- }))))))));
90
+ react_1.default.createElement("tbody", null, paginatedElements.map((item) => {
91
+ return (react_1.default.createElement(Table_styles_1.TableRow, { key: `table_row_${item.id}`, hover: hover, active: selectedRow === item.id, selectable: selectable, onClick: () => handleRowClick(item.id) }, tableProps.headers.map((header, index) => {
92
+ return (react_1.default.createElement(Cell_1.Cell, { key: `cell_${header.name}_${item.id}`, header: header, moreActions: moreActions, item: item, theme: theme, marked: item.marked && index === 0, isDisabled: item.disabled }));
93
+ })));
94
+ }))),
95
+ ifPagination && (react_1.default.createElement(Pagination_1.Pagination, { currentPage: currentPage, totalPages: totalPages, pageSize: currentPageSize, onPageChange: setCurrentPage, onPageSizeChange: setCurrentPageSize }))));
84
96
  };
85
97
  exports.Table = Table;
@@ -62,6 +62,9 @@ exports.TableCell = styled_components_1.default.td `
62
62
  border-left:2px solid ${p.theme.action};
63
63
  padding-left:6px;
64
64
  `}
65
+ ${p => p.disabled && `
66
+ color: ${p.theme.inputDisabledTextColor}!important;
67
+ `}
65
68
  `;
66
69
  exports.OptionTableCell = styled_components_1.default.td `
67
70
  text-align: center;
package/dist/cjs/index.js CHANGED
@@ -34,6 +34,7 @@ __exportStar(require("./components/Input"), exports);
34
34
  __exportStar(require("./components/List"), exports);
35
35
  __exportStar(require("./components/Loader"), exports);
36
36
  __exportStar(require("./components/Modal"), exports);
37
+ __exportStar(require("./components/Pagination"), exports);
37
38
  __exportStar(require("./components/Section"), exports);
38
39
  __exportStar(require("./components/Selector"), exports);
39
40
  __exportStar(require("./components/Sidepanel"), exports);
@@ -99,6 +99,6 @@ export const DropdownMenu = ({ size = 'medium', iconName = 'more_vert', header =
99
99
  headerTitle && (React.createElement(TextAccent, { color: Theme.colors.text }, headerTitle)),
100
100
  headerSubtitle && (React.createElement(TextLabel, { color: Theme.colors.text }, headerSubtitle)))),
101
101
  React.createElement(DropdownMenuContent, null, options &&
102
- options.map((option) => (React.createElement(DropdownMenuOption, { key: option.label, isDisable: isDisable(option.disableID, option.diasbled), onClick: () => handleClick(option.action, option.diasbled ? option.diasbled : false, option.disableID), isActive: option.isActive }, option.label)))),
102
+ options.map((option) => (React.createElement(DropdownMenuOption, { key: option.label, isDisable: isDisable(option.disableID, option.disabled), onClick: () => handleClick(option.action, option.disabled ? option.disabled : false, option.disableID), isActive: option.isActive }, option.label)))),
103
103
  footer && (React.createElement(DropdownMenuFooter, null, footerText && (React.createElement(Text, { action: true, onClick: handleFooterAction }, footerText)))))), document.body)));
104
104
  };
@@ -63,6 +63,8 @@ export const InputReadOnlyElement = styled.div `
63
63
  export const InputLabelElement = styled(TextLabel) `
64
64
  ${(p) => p.labelPosition === 'top' && `margin-bottom: ${Theme.padding.s};`}
65
65
  ${(p) => p.labelPosition === 'left' && `margin-left: ${Theme.padding.s};`}
66
+ ${(p) => p.labelPosition === 'left' && `margin-right: ${Theme.padding.s};`}
67
+ white-space: nowrap;
66
68
  `;
67
69
  export const InputWrapper = styled.div `
68
70
  display: flex;
@@ -0,0 +1,49 @@
1
+ import React from 'react';
2
+ import { Icon } from '../Icons';
3
+ import { Theme } from '../../Theme/Theme';
4
+ import { Dropdown } from '../Dropdown';
5
+ import { PaginationElement, PaginationButton } from './Pagination.styles';
6
+ const getPageNumbers = (current, total) => {
7
+ const pages = [];
8
+ if (total <= 5) {
9
+ for (let i = 1; i <= total; i++)
10
+ pages.push(i);
11
+ }
12
+ else {
13
+ if (current <= 3) {
14
+ pages.push(1, 2, 3, '...', total);
15
+ }
16
+ else if (current >= total - 2) {
17
+ pages.push(1, '...', total - 2, total - 1, total);
18
+ }
19
+ else {
20
+ pages.push(1, '...', current - 1, current, current + 1, '...', total);
21
+ }
22
+ }
23
+ return pages;
24
+ };
25
+ export const Pagination = ({ currentPage, totalPages, pageSize, onPageChange, onPageSizeChange, availableValues = [10, 20, 50], }) => {
26
+ const pageNumbers = getPageNumbers(currentPage, totalPages);
27
+ const pageSizeStr = !isNaN(pageSize) ? String(pageSize) : '10';
28
+ let dropdownOptions = availableValues.map(size => ({
29
+ value: size.toString(),
30
+ label: size.toString(),
31
+ }));
32
+ if (!dropdownOptions.some(opt => opt.value === pageSizeStr)) {
33
+ dropdownOptions = [
34
+ { value: pageSizeStr, label: pageSizeStr },
35
+ ...dropdownOptions,
36
+ ];
37
+ }
38
+ return (React.createElement(PaginationElement, null,
39
+ React.createElement(Icon, { name: 'back', size: 16, iconColor: Theme.colors.text, onClick: () => onPageChange(Math.max(1, currentPage - 1)), isDisabled: currentPage === 1 }),
40
+ pageNumbers.map((num, idx) => num === '...' ? (React.createElement("span", { key: `ellipsis-${idx}` }, "...")) : (React.createElement(PaginationButton, { key: num, onClick: () => onPageChange(Number(num)), disabled: num === currentPage }, num))),
41
+ React.createElement(Icon, { name: 'forward', size: 16, iconColor: Theme.colors.text, onClick: () => onPageChange(Math.min(totalPages, currentPage + 1)), isDisabled: currentPage === totalPages }),
42
+ React.createElement("div", null,
43
+ React.createElement(Dropdown, { size: "small", label: "Ilo\u015B\u0107 na stron\u0119:", labelPosition: "left", handleSelect: (name, value) => {
44
+ const num = Number(value);
45
+ if (!isNaN(num) && num > 0) {
46
+ onPageSizeChange(num);
47
+ }
48
+ }, name: "pageSize", value: String(pageSize), options: dropdownOptions }))));
49
+ };
@@ -0,0 +1,24 @@
1
+ import styled from 'styled-components';
2
+ import { Theme } from '../../Theme/Theme';
3
+ export const PaginationElement = styled.div `
4
+ margin-top: 16px;
5
+ display: flex;
6
+ justify-content: right;
7
+ align-items: center;
8
+ `;
9
+ export const PaginationButton = styled.button `
10
+ font-weight: normal;
11
+ background: transparent;
12
+ border: none;
13
+ cursor: pointer;
14
+ padding: ${Theme.padding.s}
15
+ border-radius: 4px;
16
+ color: ${Theme.colors.text};
17
+ margin: 0 6px;
18
+ &:disabled {
19
+ background: ${Theme.colors.primary};
20
+ color: ${Theme.colors.white};
21
+ cursor: not-allowed;
22
+ border-radius: 4px;
23
+ }
24
+ `;
@@ -0,0 +1 @@
1
+ export * from './Pagination';
@@ -4,16 +4,19 @@ import { DropdownMenu } from '../DropdownMenu';
4
4
  import { mainTheme } from '../../Theme';
5
5
  import { format } from 'date-fns';
6
6
  import { getValueFormScope } from './tableHelper';
7
- export const Cell = ({ header, theme = mainTheme, moreActions, item, marked = false, }) => {
7
+ export const Cell = ({ header, theme = mainTheme, moreActions, item, marked = false, isDisabled = false, }) => {
8
8
  if (header.action) {
9
+ const cellAction = item.disabled
10
+ ? moreActions.map((a) => ({ ...a, disabled: true }))
11
+ : moreActions.map((a) => ({ ...a }));
9
12
  return (React.createElement(OptionTableCell, null,
10
13
  React.createElement(OptionTableCellWrapper, { onClick: (e) => e.stopPropagation() },
11
- React.createElement(DropdownMenu, { options: moreActions, targetID: item.id, iconName: "more_vert", iconColor: theme.tableMoreIconColor, iconHoverColor: theme.tableHoverMoreIconColor, iconBgHoverColor: "transparent", position: "right" }))));
14
+ React.createElement(DropdownMenu, { options: cellAction, targetID: item.id, iconName: "more_vert", iconColor: theme.tableMoreIconColor, iconHoverColor: theme.tableHoverMoreIconColor, iconBgHoverColor: "transparent", position: "right" }))));
12
15
  }
13
16
  if (header.scope) {
14
- return (React.createElement(TableCell, { marked: marked }, getValueFormScope(item[header.valueSource], header.scope)));
17
+ return (React.createElement(TableCell, { marked: marked, disabled: isDisabled }, getValueFormScope(item[header.valueSource], header.scope)));
15
18
  }
16
- return (React.createElement(TableCell, { marked: marked }, header.date
19
+ return (React.createElement(TableCell, { marked: marked, disabled: isDisabled }, header.date
17
20
  ? item[header.valueSource] !== undefined
18
21
  ? format(item[header.valueSource], 'dd-MM-yyyy')
19
22
  : ''
@@ -5,10 +5,11 @@ import { mainTheme } from '../../Theme';
5
5
  import { applySort, setSortParams } from './tableHelper';
6
6
  import { HeaderCell } from './HeaderCell';
7
7
  import { Cell } from './Cell';
8
+ import { Pagination } from '../Pagination';
8
9
  export const Table = ({ theme = mainTheme, headers, elements, hover = true, selectable = true, sortable = true, sort = {
9
10
  name: '',
10
11
  order: 'none',
11
- }, moreActions = [], onRowClick, }) => {
12
+ }, pageSize = 10, ifPagination = false, moreActions = [], onRowClick, }) => {
12
13
  const checkHeaders = () => {
13
14
  const tableHeaders = [...headers];
14
15
  if (moreActions.length > 0) {
@@ -48,11 +49,22 @@ export const Table = ({ theme = mainTheme, headers, elements, hover = true, sele
48
49
  });
49
50
  }
50
51
  };
52
+ // PAGINACJA
53
+ const [currentPage, setCurrentPage] = useState(1);
54
+ const [currentPageSize, setCurrentPageSize] = useState(pageSize || 10);
55
+ const totalPages = Math.ceil(tableProps.elements.length / currentPageSize);
56
+ const paginatedElements = tableProps.elements.slice((currentPage - 1) * currentPageSize, currentPage * currentPageSize);
57
+ useEffect(() => {
58
+ setCurrentPage(1);
59
+ }, [elements, currentPageSize]);
51
60
  return (React.createElement(ThemeProvider, { theme: theme },
52
61
  React.createElement(TableWrapper, { cellPadding: "0", cellSpacing: "0" },
53
62
  React.createElement(TableHead, null,
54
63
  React.createElement(TableRow, { hover: false, selectable: false, active: false }, tableProps.headers.map((header) => (React.createElement(HeaderCell, { key: `header_${header.name}`, header: header, sortable: sortable, handleSort: handleHeaderCellClick, sort: tableProps.sort }))))),
55
- React.createElement("tbody", null, tableProps.elements.map((item) => (React.createElement(TableRow, { key: `table_row_${item.id}`, hover: hover, active: selectedRow === item.id, selectable: selectable, onClick: () => handleRowClick(item.id) }, tableProps.headers.map((header, index) => {
56
- return (React.createElement(Cell, { key: `cell_${header.name}_${item.id}`, header: header, moreActions: moreActions, item: item, theme: theme, marked: item.marked && index === 0 }));
57
- }))))))));
64
+ React.createElement("tbody", null, paginatedElements.map((item) => {
65
+ return (React.createElement(TableRow, { key: `table_row_${item.id}`, hover: hover, active: selectedRow === item.id, selectable: selectable, onClick: () => handleRowClick(item.id) }, tableProps.headers.map((header, index) => {
66
+ return (React.createElement(Cell, { key: `cell_${header.name}_${item.id}`, header: header, moreActions: moreActions, item: item, theme: theme, marked: item.marked && index === 0, isDisabled: item.disabled }));
67
+ })));
68
+ }))),
69
+ ifPagination && (React.createElement(Pagination, { currentPage: currentPage, totalPages: totalPages, pageSize: currentPageSize, onPageChange: setCurrentPage, onPageSizeChange: setCurrentPageSize }))));
58
70
  };
@@ -56,6 +56,9 @@ export const TableCell = styled.td `
56
56
  border-left:2px solid ${p.theme.action};
57
57
  padding-left:6px;
58
58
  `}
59
+ ${p => p.disabled && `
60
+ color: ${p.theme.inputDisabledTextColor}!important;
61
+ `}
59
62
  `;
60
63
  export const OptionTableCell = styled.td `
61
64
  text-align: center;
package/dist/esm/index.js CHANGED
@@ -18,6 +18,7 @@ export * from './components/Input';
18
18
  export * from './components/List';
19
19
  export * from './components/Loader';
20
20
  export * from './components/Modal';
21
+ export * from './components/Pagination';
21
22
  export * from './components/Section';
22
23
  export * from './components/Selector';
23
24
  export * from './components/Sidepanel';
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ interface IPaginationProps {
3
+ currentPage: number;
4
+ totalPages: number;
5
+ pageSize: number;
6
+ onPageChange: (page: number) => void;
7
+ onPageSizeChange: (size: number) => void;
8
+ availableValues?: number[];
9
+ }
10
+ export declare const Pagination: React.FC<IPaginationProps>;
11
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const PaginationElement: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export declare const PaginationButton: import("styled-components").StyledComponent<"button", any, {}, never>;
@@ -0,0 +1 @@
1
+ export * from './Pagination';
@@ -7,6 +7,7 @@ interface ICell {
7
7
  moreActions: IAction[];
8
8
  item: any;
9
9
  marked?: boolean;
10
+ isDisabled?: boolean;
10
11
  }
11
12
  export declare const Cell: FC<ICell>;
12
13
  export {};
@@ -27,7 +27,9 @@ interface ITableProps {
27
27
  sortable?: boolean;
28
28
  filtrable?: boolean;
29
29
  sort?: ITableSortProps;
30
+ pageSize?: number;
30
31
  onRowClick?: (id: string) => void;
32
+ ifPagination?: boolean;
31
33
  }
32
34
  export declare const Table: FC<ITableProps>;
33
35
  export {};
@@ -18,6 +18,7 @@ export declare const TableRow: import("styled-components").StyledComponent<"tr",
18
18
  interface ITableCellProps {
19
19
  theme: any;
20
20
  marked: boolean;
21
+ disabled: boolean;
21
22
  }
22
23
  export declare const TableCell: import("styled-components").StyledComponent<"td", any, ITableCellProps, never>;
23
24
  export declare const OptionTableCell: import("styled-components").StyledComponent<"td", any, {}, never>;
@@ -18,6 +18,7 @@ export * from './components/Input';
18
18
  export * from './components/List';
19
19
  export * from './components/Loader';
20
20
  export * from './components/Modal';
21
+ export * from './components/Pagination';
21
22
  export * from './components/Section';
22
23
  export * from './components/Selector';
23
24
  export * from './components/Sidepanel';
@@ -8,7 +8,7 @@ export interface IAction {
8
8
  label: string | number;
9
9
  disableID?: string;
10
10
  isActive?: boolean;
11
- diasbled?: boolean;
11
+ disabled?: boolean;
12
12
  }
13
13
  export interface IIconsActions {
14
14
  iconName: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "venice-ui",
3
- "version": "2.2.11",
3
+ "version": "2.3.1",
4
4
  "description": "Component library",
5
5
  "main": "index.js",
6
6
  "module": "./dist/esm/index.js",