@helpdice/ui 1.4.0 → 1.4.2
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/index.js +99 -33
- package/dist/pagination/index.js +5 -5
- package/dist/table/data-table.d.ts +6 -1
- package/dist/table/index.js +99 -33
- package/dist/table/table.d.ts +6 -0
- package/esm/pagination/pagination-ellipsis.js +1 -1
- package/esm/pagination/pagination-item.js +1 -1
- package/esm/pagination/pagination-next.js +1 -1
- package/esm/pagination/pagination-pages.js +1 -1
- package/esm/pagination/pagination-previous.js +1 -1
- package/esm/table/data-table.d.ts +6 -1
- package/esm/table/data-table.js +29 -7
- package/esm/table/table-cell.js +3 -1
- package/esm/table/table-head.js +13 -11
- package/esm/table/table.d.ts +6 -0
- package/esm/table/table.js +50 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var reactDom = require('react-dom');
|
|
5
|
+
var Button$1 = require('components/button');
|
|
6
|
+
var Tooltip$1 = require('components/tooltip');
|
|
5
7
|
var require$$0 = require('react-is');
|
|
6
8
|
var isEqual = require('react-fast-compare');
|
|
7
9
|
|
|
@@ -22643,7 +22645,7 @@ var PaginationItem = function PaginationItem(_ref) {
|
|
|
22643
22645
|
dynamic: [theme.palette.success, theme.layout.radius, theme.palette.background, hover, theme.palette.success, theme.palette.background, theme.expressiveness.shadowSmall, activeHover, theme.expressiveness.shadowMedium, theme.palette.accents_4, theme.palette.accents_2]
|
|
22644
22646
|
}, "li.__jsx-style-dynamic-selector{margin-right:0.428em;display:inline-block;}button.__jsx-style-dynamic-selector{border:none;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;box-sizing:border-box;text-transform:capitalize;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-align:center;vertical-align:middle;box-shadow:none;outline:none;height:var(--pagination-size);min-width:var(--pagination-size);font-size:inherit;cursor:pointer;color:".concat(theme.palette.success, ";border-radius:").concat(theme.layout.radius, ";background-color:").concat(theme.palette.background, ";-webkit-transition:all linear 200ms 0ms;transition:all linear 200ms 0ms;}button.__jsx-style-dynamic-selector:hover{background-color:").concat(hover, ";}.active.__jsx-style-dynamic-selector{font-weight:bold;background-color:").concat(theme.palette.success, ";color:").concat(theme.palette.background, ";box-shadow:").concat(theme.expressiveness.shadowSmall, ";}.active.__jsx-style-dynamic-selector:hover{background-color:").concat(activeHover, ";box-shadow:").concat(theme.expressiveness.shadowMedium, ";}.disabled.__jsx-style-dynamic-selector{color:").concat(theme.palette.accents_4, ";cursor:not-allowed;}.disabled.__jsx-style-dynamic-selector:hover{background-color:").concat(theme.palette.accents_2, ";}button.__jsx-style-dynamic-selector svg{width:1.3em;height:1.3em;}")));
|
|
22645
22647
|
};
|
|
22646
|
-
PaginationItem.displayName = '
|
|
22648
|
+
PaginationItem.displayName = 'PaginationItem';
|
|
22647
22649
|
|
|
22648
22650
|
/* "use client" */
|
|
22649
22651
|
|
|
@@ -22668,7 +22670,7 @@ var PaginationPrevious = function PaginationPrevious(_ref) {
|
|
|
22668
22670
|
disabled: isFirst
|
|
22669
22671
|
}, props), children);
|
|
22670
22672
|
};
|
|
22671
|
-
PaginationPrevious.displayName = '
|
|
22673
|
+
PaginationPrevious.displayName = 'PaginationPrevious';
|
|
22672
22674
|
|
|
22673
22675
|
var _excluded$r = ["children"];
|
|
22674
22676
|
var PaginationNext = function PaginationNext(_ref) {
|
|
@@ -22684,7 +22686,7 @@ var PaginationNext = function PaginationNext(_ref) {
|
|
|
22684
22686
|
disabled: isLast
|
|
22685
22687
|
}, props), children);
|
|
22686
22688
|
};
|
|
22687
|
-
PaginationNext.displayName = '
|
|
22689
|
+
PaginationNext.displayName = 'PaginationNext';
|
|
22688
22690
|
|
|
22689
22691
|
var PaginationEllipsis = function PaginationEllipsis(_ref) {
|
|
22690
22692
|
var isBefore = _ref.isBefore,
|
|
@@ -22749,7 +22751,7 @@ var PaginationEllipsis = function PaginationEllipsis(_ref) {
|
|
|
22749
22751
|
dynamic: [isBefore ? '180deg' : '0deg']
|
|
22750
22752
|
}, "svg.__jsx-style-dynamic-selector{color:currentColor;stroke:currentColor;width:1em;height:1em;}.more.__jsx-style-dynamic-selector{-webkit-transform:rotate(".concat(isBefore ? '180deg' : '0deg', ");-ms-transform:rotate(").concat(isBefore ? '180deg' : '0deg', ");transform:rotate(").concat(isBefore ? '180deg' : '0deg', ");}")));
|
|
22751
22753
|
};
|
|
22752
|
-
PaginationEllipsis.displayName = '
|
|
22754
|
+
PaginationEllipsis.displayName = 'PaginationEllipsis';
|
|
22753
22755
|
|
|
22754
22756
|
var PaginationPages = function PaginationPages(_ref) {
|
|
22755
22757
|
var limit = _ref.limit,
|
|
@@ -22830,7 +22832,7 @@ var PaginationPages = function PaginationPages(_ref) {
|
|
|
22830
22832
|
}
|
|
22831
22833
|
}), renderItem(count, current));
|
|
22832
22834
|
};
|
|
22833
|
-
PaginationPages.displayName = '
|
|
22835
|
+
PaginationPages.displayName = 'PaginationPages';
|
|
22834
22836
|
|
|
22835
22837
|
var _excluded$q = ["page", "initialPage", "count", "limit", "children", "onChange", "className"];
|
|
22836
22838
|
var PaginationComponent = function PaginationComponent(_ref) {
|
|
@@ -42215,10 +42217,12 @@ var TableHead = function TableHead(props) {
|
|
|
42215
42217
|
});
|
|
42216
42218
|
};
|
|
42217
42219
|
return /*#__PURE__*/React.createElement(React.Fragment, null, colgroup, /*#__PURE__*/React.createElement("thead", {
|
|
42218
|
-
className: _JSXStyle.dynamic([["
|
|
42220
|
+
className: _JSXStyle.dynamic([["2156261549", [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
|
|
42219
42221
|
}, /*#__PURE__*/React.createElement("tr", {
|
|
42220
|
-
className: _JSXStyle.dynamic([["
|
|
42222
|
+
className: _JSXStyle.dynamic([["2156261549", [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
|
|
42221
42223
|
}, columns.map(function (column, index) {
|
|
42224
|
+
var _String2;
|
|
42225
|
+
var dataName = (_String2 = String(column === null || column === undefined ? undefined : column.label)) === null || _String2 === undefined ? undefined : _String2.replace(' ', '_').toLowerCase();
|
|
42222
42226
|
return /*#__PURE__*/React.createElement("th", {
|
|
42223
42227
|
style: {
|
|
42224
42228
|
// textAlign: `${column?.align} !important`,
|
|
@@ -42228,24 +42232,24 @@ var TableHead = function TableHead(props) {
|
|
|
42228
42232
|
whiteSpace: column !== null && column !== undefined && column.noWrap ? 'nowrap' : 'normal'
|
|
42229
42233
|
},
|
|
42230
42234
|
key: "table-th-".concat(column.prop.toString(), "-").concat(index),
|
|
42231
|
-
"data-column":
|
|
42232
|
-
className: _JSXStyle.dynamic([["
|
|
42235
|
+
"data-column": dataName,
|
|
42236
|
+
className: _JSXStyle.dynamic([["2156261549", [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]]) + " " + (column.className || "")
|
|
42233
42237
|
}, /*#__PURE__*/React.createElement("div", {
|
|
42234
|
-
className: _JSXStyle.dynamic([["
|
|
42238
|
+
className: _JSXStyle.dynamic([["2156261549", [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]]) + " " + "thead-box"
|
|
42235
42239
|
}, column.label, /*#__PURE__*/React.createElement("br", {
|
|
42236
|
-
className: _JSXStyle.dynamic([["
|
|
42240
|
+
className: _JSXStyle.dynamic([["2156261549", [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
|
|
42237
42241
|
}), /*#__PURE__*/React.createElement("span", {
|
|
42238
42242
|
style: {
|
|
42239
42243
|
textAlign: 'center'
|
|
42240
42244
|
},
|
|
42241
|
-
className: _JSXStyle.dynamic([["
|
|
42245
|
+
className: _JSXStyle.dynamic([["2156261549", [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
|
|
42242
42246
|
}, column.text)));
|
|
42243
42247
|
})), showFilters && /*#__PURE__*/React.createElement("tr", {
|
|
42244
|
-
className: _JSXStyle.dynamic([["
|
|
42248
|
+
className: _JSXStyle.dynamic([["2156261549", [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
|
|
42245
42249
|
}, generateFilterInputs())), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
42246
|
-
id: "
|
|
42247
|
-
dynamic: [stickyHeader && "\n position: sticky;\n top: 0;\n
|
|
42248
|
-
}, "thead.__jsx-style-dynamic-selector{border-collapse:separate;border-spacing:0;font-size:inherit;".concat(stickyHeader && "\n position: sticky;\n top: 0;\n
|
|
42250
|
+
id: "2156261549",
|
|
42251
|
+
dynamic: [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]
|
|
42252
|
+
}, "thead.__jsx-style-dynamic-selector{border-collapse:separate;border-spacing:0;background-color:#fff;font-size:inherit;".concat(stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", ";}th.__jsx-style-dynamic-selector{padding:0 0.5em;font-size:calc(0.75 * var(--table-font-size));font-weight:normal;text-align:left;-webkit-letter-spacing:0;-moz-letter-spacing:0;-ms-letter-spacing:0;letter-spacing:0;vertical-align:middle;min-height:calc(2.5 * var(--table-font-size));color:").concat(theme.palette.accents_5, ";background:").concat(theme.palette.accents_1, ";border-bottom:1px solid ").concat(theme.palette.border, ";border-top:1px solid ").concat(theme.palette.border, ";border-radius:0;}th.__jsx-style-dynamic-selector:nth-child(1){border-bottom:1px solid ").concat(theme.palette.border, ";border-left:1px solid ").concat(theme.palette.border, ";border-top:1px solid ").concat(theme.palette.border, ";border-top-left-radius:").concat(theme.layout.radius, ";border-bottom-left-radius:").concat(theme.layout.radius, ";}th.__jsx-style-dynamic-selector:last-child{border-bottom:1px solid ").concat(theme.palette.border, ";border-right:1px solid ").concat(theme.palette.border, ";border-top:1px solid ").concat(theme.palette.border, ";border-top-right-radius:").concat(theme.layout.radius, ";border-bottom-right-radius:").concat(theme.layout.radius, ";}.thead-box.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-align:center;min-height:calc(2.5 * var(--table-font-size));text-transform:uppercase;}")));
|
|
42249
42253
|
};
|
|
42250
42254
|
TableHead.displayName = 'TableHead';
|
|
42251
42255
|
|
|
@@ -42257,9 +42261,11 @@ var TableCell = function TableCell(_ref) {
|
|
|
42257
42261
|
onCellClick = _ref.onCellClick;
|
|
42258
42262
|
/* eslint-disable react/jsx-no-useless-fragment */
|
|
42259
42263
|
return /*#__PURE__*/React.createElement(React.Fragment, null, columns.map(function (column, index) {
|
|
42264
|
+
var _String;
|
|
42260
42265
|
var currentRowValue = row[column.prop];
|
|
42261
42266
|
var cellValue = currentRowValue || emptyText;
|
|
42262
42267
|
var shouldBeRenderElement = column.renderHandler(currentRowValue, row, rowIndex);
|
|
42268
|
+
var dataName = (_String = String(column === null || column === undefined ? undefined : column.label)) === null || _String === undefined ? undefined : _String.replace(' ', '_').toLowerCase();
|
|
42263
42269
|
return /*#__PURE__*/React.createElement("td", {
|
|
42264
42270
|
style: _objectSpread2({
|
|
42265
42271
|
fontSize: "".concat(column === null || column === undefined ? undefined : column.fontSize),
|
|
@@ -42270,7 +42276,7 @@ var TableCell = function TableCell(_ref) {
|
|
|
42270
42276
|
boxSizing: 'border-box',
|
|
42271
42277
|
whiteSpace: column !== null && column !== undefined && column.noWrap ? 'nowrap' : 'normal'
|
|
42272
42278
|
}, currentRowValue === null || currentRowValue === undefined ? undefined : currentRowValue.style),
|
|
42273
|
-
"data-column":
|
|
42279
|
+
"data-column": dataName,
|
|
42274
42280
|
key: "row-td-".concat(index, "-").concat(column.prop.toString()),
|
|
42275
42281
|
onClick: function onClick() {
|
|
42276
42282
|
return onCellClick && onCellClick(currentRowValue, rowIndex, index);
|
|
@@ -42885,7 +42891,15 @@ function DataTable(_ref) {
|
|
|
42885
42891
|
viewLength = _ref.viewLength,
|
|
42886
42892
|
_onPageChange = _ref.onPageChange,
|
|
42887
42893
|
_ref$disableMenu = _ref.disableMenu,
|
|
42888
|
-
disableMenu = _ref$disableMenu === undefined ? false : _ref$disableMenu
|
|
42894
|
+
disableMenu = _ref$disableMenu === undefined ? false : _ref$disableMenu,
|
|
42895
|
+
_ref$cursorPagination = _ref.cursorPagination,
|
|
42896
|
+
cursorPagination = _ref$cursorPagination === undefined ? false : _ref$cursorPagination,
|
|
42897
|
+
previousCursor = _ref.previousCursor,
|
|
42898
|
+
nextCursor = _ref.nextCursor,
|
|
42899
|
+
_ref$hasMore = _ref.hasMore,
|
|
42900
|
+
hasMore = _ref$hasMore === undefined ? false : _ref$hasMore,
|
|
42901
|
+
onNextPage = _ref.onNextPage,
|
|
42902
|
+
onPreviousPage = _ref.onPreviousPage;
|
|
42889
42903
|
var TABLE_ID = _.uniqueId('tbl');
|
|
42890
42904
|
// const [anchorEl, setAnchorEl] = useState(null);
|
|
42891
42905
|
var _useState = React.useState([]),
|
|
@@ -42919,18 +42933,22 @@ function DataTable(_ref) {
|
|
|
42919
42933
|
}, [selected]);
|
|
42920
42934
|
React.useEffect(function () {
|
|
42921
42935
|
cols.forEach(function (col) {
|
|
42936
|
+
var _String;
|
|
42937
|
+
var dataName = (_String = String(col === null || col === undefined ? undefined : col.name)) === null || _String === undefined ? undefined : _String.replace(' ', '_').toLowerCase();
|
|
42922
42938
|
if (hideColumn.includes(col.name)) {
|
|
42923
|
-
document.querySelectorAll("[data-column=\"".concat(
|
|
42939
|
+
document.querySelectorAll("[data-column=\"".concat(dataName, "\"]")).forEach(function (el) {
|
|
42924
42940
|
el.style.display = 'none !important';
|
|
42925
42941
|
});
|
|
42926
42942
|
} else {
|
|
42927
|
-
document.querySelectorAll("[data-column=\"".concat(
|
|
42943
|
+
document.querySelectorAll("[data-column=\"".concat(dataName, "\"]")).forEach(function (el) {
|
|
42928
42944
|
el.style.display = '';
|
|
42929
42945
|
});
|
|
42930
42946
|
}
|
|
42931
42947
|
});
|
|
42932
42948
|
}, [hideColumn, cols, rows]);
|
|
42933
|
-
var handleHideColumnClick = function handleHideColumnClick(_event,
|
|
42949
|
+
var handleHideColumnClick = function handleHideColumnClick(_event, _id) {
|
|
42950
|
+
var _String2;
|
|
42951
|
+
var id = (_String2 = String(_id)) === null || _String2 === undefined ? undefined : _String2.replace(' ', '_').toLowerCase();
|
|
42934
42952
|
var selectedIndex = hideColumn.indexOf(id);
|
|
42935
42953
|
var newSelected = [];
|
|
42936
42954
|
if (selectedIndex === -1) {
|
|
@@ -42980,12 +42998,16 @@ function DataTable(_ref) {
|
|
|
42980
42998
|
// };
|
|
42981
42999
|
|
|
42982
43000
|
var COLUMNS = cols.filter(function (col) {
|
|
42983
|
-
|
|
43001
|
+
var _String3;
|
|
43002
|
+
var dataName = (_String3 = String(col === null || col === undefined ? undefined : col.name)) === null || _String3 === undefined ? undefined : _String3.replace(' ', '_').toLowerCase();
|
|
43003
|
+
return !hideColumn.includes(dataName);
|
|
42984
43004
|
});
|
|
42985
43005
|
var content = function content() {
|
|
42986
43006
|
return /*#__PURE__*/React.createElement(React.Fragment, null, cols.map(function (option, index) {
|
|
43007
|
+
var _String4;
|
|
42987
43008
|
var colunqid = _.uniqueId("".concat(option.name, "-").concat(index));
|
|
42988
|
-
var
|
|
43009
|
+
var dataName = (_String4 = String(option.name)) === null || _String4 === undefined ? undefined : _String4.replace(' ', '_').toLowerCase();
|
|
43010
|
+
var isSelected = !hideColumn.includes(dataName);
|
|
42989
43011
|
return /*#__PURE__*/React.createElement(Popover.Item, {
|
|
42990
43012
|
selected: isSelected,
|
|
42991
43013
|
key: colunqid,
|
|
@@ -43132,11 +43154,17 @@ function DataTable(_ref) {
|
|
|
43132
43154
|
style: _objectSpread2({
|
|
43133
43155
|
position: 'relative',
|
|
43134
43156
|
overflowY: 'auto',
|
|
43135
|
-
maxWidth: 'calc(100vw -
|
|
43157
|
+
maxWidth: 'calc(100vw - 1.5rem)',
|
|
43136
43158
|
width: sideMenu ? 'calc(100vw - 17.2rem)' : 'inherit !important'
|
|
43137
43159
|
}, style)
|
|
43138
43160
|
}, /*#__PURE__*/React.createElement(Table, {
|
|
43139
43161
|
stickyHeader: true,
|
|
43162
|
+
cursorPagination: cursorPagination,
|
|
43163
|
+
previousCursor: previousCursor,
|
|
43164
|
+
nextCursor: nextCursor,
|
|
43165
|
+
hasMore: hasMore,
|
|
43166
|
+
onNextPage: onNextPage,
|
|
43167
|
+
onPreviousPage: onPreviousPage,
|
|
43140
43168
|
dataLength: dataLength,
|
|
43141
43169
|
viewLength: viewLength,
|
|
43142
43170
|
onPageChange: function onPageChange(page, start, end) {
|
|
@@ -43384,7 +43412,7 @@ var TableColumn = function TableColumn(columnProps) {
|
|
|
43384
43412
|
};
|
|
43385
43413
|
TableColumn.displayName = 'TableColumn';
|
|
43386
43414
|
|
|
43387
|
-
var _excluded$9 = ["children", "data", "initialData", "hover", "emptyText", "rowDraggable", "readOnly", "onRow", "onCell", "onChange", "onFilters", "onPageChange", "showFilters", "stickyHeader", "onSelected", "dataLength", "viewLength", "className", "rowClassName"];
|
|
43415
|
+
var _excluded$9 = ["children", "data", "initialData", "hover", "emptyText", "rowDraggable", "readOnly", "cursorPagination", "previousCursor", "nextCursor", "hasMore", "onNextPage", "onPreviousPage", "onRow", "onCell", "onChange", "onFilters", "onPageChange", "showFilters", "stickyHeader", "onSelected", "dataLength", "viewLength", "className", "rowClassName"];
|
|
43388
43416
|
function TableComponent(tableProps) {
|
|
43389
43417
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
43390
43418
|
var _ref = tableProps,
|
|
@@ -43400,6 +43428,13 @@ function TableComponent(tableProps) {
|
|
|
43400
43428
|
rowDraggable = _ref$rowDraggable === undefined ? false : _ref$rowDraggable,
|
|
43401
43429
|
_ref$readOnly = _ref.readOnly,
|
|
43402
43430
|
readOnly = _ref$readOnly === undefined ? false : _ref$readOnly,
|
|
43431
|
+
_ref$cursorPagination = _ref.cursorPagination,
|
|
43432
|
+
cursorPagination = _ref$cursorPagination === undefined ? false : _ref$cursorPagination,
|
|
43433
|
+
previousCursor = _ref.previousCursor,
|
|
43434
|
+
nextCursor = _ref.nextCursor;
|
|
43435
|
+
_ref.hasMore;
|
|
43436
|
+
var onNextPage = _ref.onNextPage,
|
|
43437
|
+
onPreviousPage = _ref.onPreviousPage,
|
|
43403
43438
|
onRow = _ref.onRow,
|
|
43404
43439
|
onCell = _ref.onCell;
|
|
43405
43440
|
_ref.onChange;
|
|
@@ -43475,7 +43510,7 @@ function TableComponent(tableProps) {
|
|
|
43475
43510
|
}, /*#__PURE__*/React.createElement("table", _extends({
|
|
43476
43511
|
ref: ref
|
|
43477
43512
|
}, props, {
|
|
43478
|
-
className: _JSXStyle.dynamic([["
|
|
43513
|
+
className: _JSXStyle.dynamic([["1971279331", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]]) + " " + (props && props.className != null && props.className || className || "")
|
|
43479
43514
|
}), /*#__PURE__*/React.createElement(TableHead, {
|
|
43480
43515
|
stickyHeader: stickyHeader,
|
|
43481
43516
|
columns: columns,
|
|
@@ -43492,17 +43527,48 @@ function TableComponent(tableProps) {
|
|
|
43492
43527
|
rowDraggable: rowDraggable,
|
|
43493
43528
|
readOnly: readOnly,
|
|
43494
43529
|
onSelected: onSelected
|
|
43495
|
-
}), children,
|
|
43496
|
-
className: _JSXStyle.dynamic([["
|
|
43530
|
+
}), children, cursorPagination ? /*#__PURE__*/React.createElement("tfoot", {
|
|
43531
|
+
className: _JSXStyle.dynamic([["1971279331", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]])
|
|
43497
43532
|
}, /*#__PURE__*/React.createElement("td", {
|
|
43498
43533
|
colSpan: columns === null || columns === undefined ? undefined : columns.length,
|
|
43499
|
-
className: _JSXStyle.dynamic([["
|
|
43534
|
+
className: _JSXStyle.dynamic([["1971279331", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]])
|
|
43535
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
43536
|
+
style: {
|
|
43537
|
+
display: 'flex',
|
|
43538
|
+
gap: 10,
|
|
43539
|
+
margin: '10px'
|
|
43540
|
+
},
|
|
43541
|
+
className: _JSXStyle.dynamic([["1971279331", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]])
|
|
43542
|
+
}, /*#__PURE__*/React.createElement(Tooltip$1, {
|
|
43543
|
+
text: "Previous"
|
|
43544
|
+
}, /*#__PURE__*/React.createElement(Button$1, {
|
|
43545
|
+
disabled: !previousCursor,
|
|
43546
|
+
onClick: function onClick() {
|
|
43547
|
+
return onPreviousPage && onPreviousPage(previousCursor);
|
|
43548
|
+
},
|
|
43549
|
+
auto: true,
|
|
43550
|
+
px: 0.6,
|
|
43551
|
+
iconRight: /*#__PURE__*/React.createElement(ChevronLeft$1, null)
|
|
43552
|
+
})), /*#__PURE__*/React.createElement(Tooltip$1, {
|
|
43553
|
+
text: "Next"
|
|
43554
|
+
}, /*#__PURE__*/React.createElement(Button$1, {
|
|
43555
|
+
disabled: !nextCursor,
|
|
43556
|
+
onClick: function onClick() {
|
|
43557
|
+
return onNextPage && onNextPage(nextCursor);
|
|
43558
|
+
},
|
|
43559
|
+
auto: true,
|
|
43560
|
+
px: 0.6,
|
|
43561
|
+
iconRight: /*#__PURE__*/React.createElement(ChevronRight$1, null)
|
|
43562
|
+
}))))) : dataLength && viewLength && onPageChange ? /*#__PURE__*/React.createElement("tfoot", {
|
|
43563
|
+
className: _JSXStyle.dynamic([["1971279331", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]])
|
|
43564
|
+
}, /*#__PURE__*/React.createElement("td", {
|
|
43565
|
+
colSpan: columns === null || columns === undefined ? undefined : columns.length,
|
|
43566
|
+
className: _JSXStyle.dynamic([["1971279331", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]])
|
|
43500
43567
|
}, /*#__PURE__*/React.createElement(Pagination, {
|
|
43501
43568
|
style: {
|
|
43502
43569
|
marginLeft: '10px',
|
|
43503
43570
|
marginRight: '10px',
|
|
43504
|
-
marginTop: '10px'
|
|
43505
|
-
marginBottom: '5px'
|
|
43571
|
+
marginTop: '10px'
|
|
43506
43572
|
},
|
|
43507
43573
|
onChange: function onChange(pageNumber) {
|
|
43508
43574
|
// Get the range for the current page
|
|
@@ -43514,9 +43580,9 @@ function TableComponent(tableProps) {
|
|
|
43514
43580
|
limit: 5,
|
|
43515
43581
|
count: Number(dataLength / viewLength)
|
|
43516
43582
|
}, /*#__PURE__*/React.createElement(Pagination.Next, null, /*#__PURE__*/React.createElement(ChevronRight$1, null)), /*#__PURE__*/React.createElement(Pagination.Previous, null, /*#__PURE__*/React.createElement(ChevronLeft$1, null))))) : null, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
43517
|
-
id: "
|
|
43583
|
+
id: "1971279331",
|
|
43518
43584
|
dynamic: [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]
|
|
43519
|
-
}, "table.__jsx-style-dynamic-selector{border-collapse:separate;border-spacing:0
|
|
43585
|
+
}, "table.__jsx-style-dynamic-selector{border-collapse:separate;border-spacing:0;--table-font-size:".concat(SCALES.font(1), ";font-size:var(--table-font-size);width:").concat(SCALES.width(1, '100%'), ";height:").concat(SCALES.height(1, 'auto'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}tfoot.__jsx-style-dynamic-selector td.__jsx-style-dynamic-selector{position:-webkit-sticky;position:sticky;bottom:0;z-index:2;background-color:#fff;}"))));
|
|
43520
43586
|
}
|
|
43521
43587
|
TableComponent.displayName = 'Table';
|
|
43522
43588
|
TableComponent.Column = TableColumn;
|
package/dist/pagination/index.js
CHANGED
|
@@ -1068,7 +1068,7 @@ var PaginationItem = function PaginationItem(_ref) {
|
|
|
1068
1068
|
dynamic: [theme.palette.success, theme.layout.radius, theme.palette.background, hover, theme.palette.success, theme.palette.background, theme.expressiveness.shadowSmall, activeHover, theme.expressiveness.shadowMedium, theme.palette.accents_4, theme.palette.accents_2]
|
|
1069
1069
|
}, "li.__jsx-style-dynamic-selector{margin-right:0.428em;display:inline-block;}button.__jsx-style-dynamic-selector{border:none;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;box-sizing:border-box;text-transform:capitalize;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-align:center;vertical-align:middle;box-shadow:none;outline:none;height:var(--pagination-size);min-width:var(--pagination-size);font-size:inherit;cursor:pointer;color:".concat(theme.palette.success, ";border-radius:").concat(theme.layout.radius, ";background-color:").concat(theme.palette.background, ";-webkit-transition:all linear 200ms 0ms;transition:all linear 200ms 0ms;}button.__jsx-style-dynamic-selector:hover{background-color:").concat(hover, ";}.active.__jsx-style-dynamic-selector{font-weight:bold;background-color:").concat(theme.palette.success, ";color:").concat(theme.palette.background, ";box-shadow:").concat(theme.expressiveness.shadowSmall, ";}.active.__jsx-style-dynamic-selector:hover{background-color:").concat(activeHover, ";box-shadow:").concat(theme.expressiveness.shadowMedium, ";}.disabled.__jsx-style-dynamic-selector{color:").concat(theme.palette.accents_4, ";cursor:not-allowed;}.disabled.__jsx-style-dynamic-selector:hover{background-color:").concat(theme.palette.accents_2, ";}button.__jsx-style-dynamic-selector svg{width:1.3em;height:1.3em;}")));
|
|
1070
1070
|
};
|
|
1071
|
-
PaginationItem.displayName = '
|
|
1071
|
+
PaginationItem.displayName = 'PaginationItem';
|
|
1072
1072
|
|
|
1073
1073
|
var tuple = function tuple() {
|
|
1074
1074
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
@@ -1108,7 +1108,7 @@ var PaginationPrevious = function PaginationPrevious(_ref) {
|
|
|
1108
1108
|
disabled: isFirst
|
|
1109
1109
|
}, props), children);
|
|
1110
1110
|
};
|
|
1111
|
-
PaginationPrevious.displayName = '
|
|
1111
|
+
PaginationPrevious.displayName = 'PaginationPrevious';
|
|
1112
1112
|
|
|
1113
1113
|
var _excluded$2 = ["children"];
|
|
1114
1114
|
var PaginationNext = function PaginationNext(_ref) {
|
|
@@ -1124,7 +1124,7 @@ var PaginationNext = function PaginationNext(_ref) {
|
|
|
1124
1124
|
disabled: isLast
|
|
1125
1125
|
}, props), children);
|
|
1126
1126
|
};
|
|
1127
|
-
PaginationNext.displayName = '
|
|
1127
|
+
PaginationNext.displayName = 'PaginationNext';
|
|
1128
1128
|
|
|
1129
1129
|
var PaginationEllipsis = function PaginationEllipsis(_ref) {
|
|
1130
1130
|
var isBefore = _ref.isBefore,
|
|
@@ -1189,7 +1189,7 @@ var PaginationEllipsis = function PaginationEllipsis(_ref) {
|
|
|
1189
1189
|
dynamic: [isBefore ? '180deg' : '0deg']
|
|
1190
1190
|
}, "svg.__jsx-style-dynamic-selector{color:currentColor;stroke:currentColor;width:1em;height:1em;}.more.__jsx-style-dynamic-selector{-webkit-transform:rotate(".concat(isBefore ? '180deg' : '0deg', ");-ms-transform:rotate(").concat(isBefore ? '180deg' : '0deg', ");transform:rotate(").concat(isBefore ? '180deg' : '0deg', ");}")));
|
|
1191
1191
|
};
|
|
1192
|
-
PaginationEllipsis.displayName = '
|
|
1192
|
+
PaginationEllipsis.displayName = 'PaginationEllipsis';
|
|
1193
1193
|
|
|
1194
1194
|
var PaginationPages = function PaginationPages(_ref) {
|
|
1195
1195
|
var limit = _ref.limit,
|
|
@@ -1270,7 +1270,7 @@ var PaginationPages = function PaginationPages(_ref) {
|
|
|
1270
1270
|
}
|
|
1271
1271
|
}), renderItem(count, current));
|
|
1272
1272
|
};
|
|
1273
|
-
PaginationPages.displayName = '
|
|
1273
|
+
PaginationPages.displayName = 'PaginationPages';
|
|
1274
1274
|
|
|
1275
1275
|
var useCurrentState = function useCurrentState(initialState) {
|
|
1276
1276
|
var _useState = React.useState(function () {
|
|
@@ -32,8 +32,13 @@ type DataTableProps = {
|
|
|
32
32
|
dataLength?: number;
|
|
33
33
|
viewLength?: number;
|
|
34
34
|
onPageChange?: (page: number, start: number, end: number) => void;
|
|
35
|
+
cursorPagination?: boolean;
|
|
36
|
+
previousCursor?: string;
|
|
37
|
+
nextCursor?: string;
|
|
38
|
+
onNextPage?: (next?: string) => void;
|
|
39
|
+
onPreviousPage?: (prev?: string) => void;
|
|
35
40
|
};
|
|
36
41
|
declare function DataTable({ cols, rows, readOnly, heading, filter, menu, sideMenu, style, children, onBack, onRefresh, // Function
|
|
37
|
-
onFilters, onSelectedDelete, onSelectedEdit, onSelected, disableViewColumn, rowDraggable, onDragOver, onDragEnter, onDragLeave, onDrop, onRowClick, dataLength, viewLength, onPageChange, disableMenu }: DataTableProps): React.JSX.Element;
|
|
42
|
+
onFilters, onSelectedDelete, onSelectedEdit, onSelected, disableViewColumn, rowDraggable, onDragOver, onDragEnter, onDragLeave, onDrop, onRowClick, dataLength, viewLength, onPageChange, disableMenu, cursorPagination, previousCursor, nextCursor, hasMore, onNextPage, onPreviousPage, }: DataTableProps): React.JSX.Element;
|
|
38
43
|
declare const _default: React.MemoExoticComponent<typeof DataTable>;
|
|
39
44
|
export default _default;
|
package/dist/table/index.js
CHANGED
|
@@ -4,6 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var reactDom = require('react-dom');
|
|
7
|
+
var Button$1 = require('components/button');
|
|
8
|
+
var Tooltip$1 = require('components/tooltip');
|
|
7
9
|
|
|
8
10
|
function _interopNamespaceDefault(e) {
|
|
9
11
|
var n = Object.create(null);
|
|
@@ -19973,10 +19975,12 @@ var TableHead = function TableHead(props) {
|
|
|
19973
19975
|
});
|
|
19974
19976
|
};
|
|
19975
19977
|
return /*#__PURE__*/React.createElement(React.Fragment, null, colgroup, /*#__PURE__*/React.createElement("thead", {
|
|
19976
|
-
className: _JSXStyle.dynamic([["
|
|
19978
|
+
className: _JSXStyle.dynamic([["2156261549", [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
|
|
19977
19979
|
}, /*#__PURE__*/React.createElement("tr", {
|
|
19978
|
-
className: _JSXStyle.dynamic([["
|
|
19980
|
+
className: _JSXStyle.dynamic([["2156261549", [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
|
|
19979
19981
|
}, columns.map(function (column, index) {
|
|
19982
|
+
var _String2;
|
|
19983
|
+
var dataName = (_String2 = String(column === null || column === undefined ? undefined : column.label)) === null || _String2 === undefined ? undefined : _String2.replace(' ', '_').toLowerCase();
|
|
19980
19984
|
return /*#__PURE__*/React.createElement("th", {
|
|
19981
19985
|
style: {
|
|
19982
19986
|
// textAlign: `${column?.align} !important`,
|
|
@@ -19986,24 +19990,24 @@ var TableHead = function TableHead(props) {
|
|
|
19986
19990
|
whiteSpace: column !== null && column !== undefined && column.noWrap ? 'nowrap' : 'normal'
|
|
19987
19991
|
},
|
|
19988
19992
|
key: "table-th-".concat(column.prop.toString(), "-").concat(index),
|
|
19989
|
-
"data-column":
|
|
19990
|
-
className: _JSXStyle.dynamic([["
|
|
19993
|
+
"data-column": dataName,
|
|
19994
|
+
className: _JSXStyle.dynamic([["2156261549", [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]]) + " " + (column.className || "")
|
|
19991
19995
|
}, /*#__PURE__*/React.createElement("div", {
|
|
19992
|
-
className: _JSXStyle.dynamic([["
|
|
19996
|
+
className: _JSXStyle.dynamic([["2156261549", [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]]) + " " + "thead-box"
|
|
19993
19997
|
}, column.label, /*#__PURE__*/React.createElement("br", {
|
|
19994
|
-
className: _JSXStyle.dynamic([["
|
|
19998
|
+
className: _JSXStyle.dynamic([["2156261549", [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
|
|
19995
19999
|
}), /*#__PURE__*/React.createElement("span", {
|
|
19996
20000
|
style: {
|
|
19997
20001
|
textAlign: 'center'
|
|
19998
20002
|
},
|
|
19999
|
-
className: _JSXStyle.dynamic([["
|
|
20003
|
+
className: _JSXStyle.dynamic([["2156261549", [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
|
|
20000
20004
|
}, column.text)));
|
|
20001
20005
|
})), showFilters && /*#__PURE__*/React.createElement("tr", {
|
|
20002
|
-
className: _JSXStyle.dynamic([["
|
|
20006
|
+
className: _JSXStyle.dynamic([["2156261549", [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
|
|
20003
20007
|
}, generateFilterInputs())), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
20004
|
-
id: "
|
|
20005
|
-
dynamic: [stickyHeader && "\n position: sticky;\n top: 0;\n
|
|
20006
|
-
}, "thead.__jsx-style-dynamic-selector{border-collapse:separate;border-spacing:0;font-size:inherit;".concat(stickyHeader && "\n position: sticky;\n top: 0;\n
|
|
20008
|
+
id: "2156261549",
|
|
20009
|
+
dynamic: [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]
|
|
20010
|
+
}, "thead.__jsx-style-dynamic-selector{border-collapse:separate;border-spacing:0;background-color:#fff;font-size:inherit;".concat(stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", ";}th.__jsx-style-dynamic-selector{padding:0 0.5em;font-size:calc(0.75 * var(--table-font-size));font-weight:normal;text-align:left;-webkit-letter-spacing:0;-moz-letter-spacing:0;-ms-letter-spacing:0;letter-spacing:0;vertical-align:middle;min-height:calc(2.5 * var(--table-font-size));color:").concat(theme.palette.accents_5, ";background:").concat(theme.palette.accents_1, ";border-bottom:1px solid ").concat(theme.palette.border, ";border-top:1px solid ").concat(theme.palette.border, ";border-radius:0;}th.__jsx-style-dynamic-selector:nth-child(1){border-bottom:1px solid ").concat(theme.palette.border, ";border-left:1px solid ").concat(theme.palette.border, ";border-top:1px solid ").concat(theme.palette.border, ";border-top-left-radius:").concat(theme.layout.radius, ";border-bottom-left-radius:").concat(theme.layout.radius, ";}th.__jsx-style-dynamic-selector:last-child{border-bottom:1px solid ").concat(theme.palette.border, ";border-right:1px solid ").concat(theme.palette.border, ";border-top:1px solid ").concat(theme.palette.border, ";border-top-right-radius:").concat(theme.layout.radius, ";border-bottom-right-radius:").concat(theme.layout.radius, ";}.thead-box.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-align:center;min-height:calc(2.5 * var(--table-font-size));text-transform:uppercase;}")));
|
|
20007
20011
|
};
|
|
20008
20012
|
TableHead.displayName = 'TableHead';
|
|
20009
20013
|
|
|
@@ -20015,9 +20019,11 @@ var TableCell = function TableCell(_ref) {
|
|
|
20015
20019
|
onCellClick = _ref.onCellClick;
|
|
20016
20020
|
/* eslint-disable react/jsx-no-useless-fragment */
|
|
20017
20021
|
return /*#__PURE__*/React.createElement(React.Fragment, null, columns.map(function (column, index) {
|
|
20022
|
+
var _String;
|
|
20018
20023
|
var currentRowValue = row[column.prop];
|
|
20019
20024
|
var cellValue = currentRowValue || emptyText;
|
|
20020
20025
|
var shouldBeRenderElement = column.renderHandler(currentRowValue, row, rowIndex);
|
|
20026
|
+
var dataName = (_String = String(column === null || column === undefined ? undefined : column.label)) === null || _String === undefined ? undefined : _String.replace(' ', '_').toLowerCase();
|
|
20021
20027
|
return /*#__PURE__*/React.createElement("td", {
|
|
20022
20028
|
style: _objectSpread2({
|
|
20023
20029
|
fontSize: "".concat(column === null || column === undefined ? undefined : column.fontSize),
|
|
@@ -20028,7 +20034,7 @@ var TableCell = function TableCell(_ref) {
|
|
|
20028
20034
|
boxSizing: 'border-box',
|
|
20029
20035
|
whiteSpace: column !== null && column !== undefined && column.noWrap ? 'nowrap' : 'normal'
|
|
20030
20036
|
}, currentRowValue === null || currentRowValue === undefined ? undefined : currentRowValue.style),
|
|
20031
|
-
"data-column":
|
|
20037
|
+
"data-column": dataName,
|
|
20032
20038
|
key: "row-td-".concat(index, "-").concat(column.prop.toString()),
|
|
20033
20039
|
onClick: function onClick() {
|
|
20034
20040
|
return onCellClick && onCellClick(currentRowValue, rowIndex, index);
|
|
@@ -31588,7 +31594,15 @@ function DataTable(_ref) {
|
|
|
31588
31594
|
viewLength = _ref.viewLength,
|
|
31589
31595
|
_onPageChange = _ref.onPageChange,
|
|
31590
31596
|
_ref$disableMenu = _ref.disableMenu,
|
|
31591
|
-
disableMenu = _ref$disableMenu === undefined ? false : _ref$disableMenu
|
|
31597
|
+
disableMenu = _ref$disableMenu === undefined ? false : _ref$disableMenu,
|
|
31598
|
+
_ref$cursorPagination = _ref.cursorPagination,
|
|
31599
|
+
cursorPagination = _ref$cursorPagination === undefined ? false : _ref$cursorPagination,
|
|
31600
|
+
previousCursor = _ref.previousCursor,
|
|
31601
|
+
nextCursor = _ref.nextCursor,
|
|
31602
|
+
_ref$hasMore = _ref.hasMore,
|
|
31603
|
+
hasMore = _ref$hasMore === undefined ? false : _ref$hasMore,
|
|
31604
|
+
onNextPage = _ref.onNextPage,
|
|
31605
|
+
onPreviousPage = _ref.onPreviousPage;
|
|
31592
31606
|
var TABLE_ID = _.uniqueId('tbl');
|
|
31593
31607
|
// const [anchorEl, setAnchorEl] = useState(null);
|
|
31594
31608
|
var _useState = React.useState([]),
|
|
@@ -31622,18 +31636,22 @@ function DataTable(_ref) {
|
|
|
31622
31636
|
}, [selected]);
|
|
31623
31637
|
React.useEffect(function () {
|
|
31624
31638
|
cols.forEach(function (col) {
|
|
31639
|
+
var _String;
|
|
31640
|
+
var dataName = (_String = String(col === null || col === undefined ? undefined : col.name)) === null || _String === undefined ? undefined : _String.replace(' ', '_').toLowerCase();
|
|
31625
31641
|
if (hideColumn.includes(col.name)) {
|
|
31626
|
-
document.querySelectorAll("[data-column=\"".concat(
|
|
31642
|
+
document.querySelectorAll("[data-column=\"".concat(dataName, "\"]")).forEach(function (el) {
|
|
31627
31643
|
el.style.display = 'none !important';
|
|
31628
31644
|
});
|
|
31629
31645
|
} else {
|
|
31630
|
-
document.querySelectorAll("[data-column=\"".concat(
|
|
31646
|
+
document.querySelectorAll("[data-column=\"".concat(dataName, "\"]")).forEach(function (el) {
|
|
31631
31647
|
el.style.display = '';
|
|
31632
31648
|
});
|
|
31633
31649
|
}
|
|
31634
31650
|
});
|
|
31635
31651
|
}, [hideColumn, cols, rows]);
|
|
31636
|
-
var handleHideColumnClick = function handleHideColumnClick(_event,
|
|
31652
|
+
var handleHideColumnClick = function handleHideColumnClick(_event, _id) {
|
|
31653
|
+
var _String2;
|
|
31654
|
+
var id = (_String2 = String(_id)) === null || _String2 === undefined ? undefined : _String2.replace(' ', '_').toLowerCase();
|
|
31637
31655
|
var selectedIndex = hideColumn.indexOf(id);
|
|
31638
31656
|
var newSelected = [];
|
|
31639
31657
|
if (selectedIndex === -1) {
|
|
@@ -31683,12 +31701,16 @@ function DataTable(_ref) {
|
|
|
31683
31701
|
// };
|
|
31684
31702
|
|
|
31685
31703
|
var COLUMNS = cols.filter(function (col) {
|
|
31686
|
-
|
|
31704
|
+
var _String3;
|
|
31705
|
+
var dataName = (_String3 = String(col === null || col === undefined ? undefined : col.name)) === null || _String3 === undefined ? undefined : _String3.replace(' ', '_').toLowerCase();
|
|
31706
|
+
return !hideColumn.includes(dataName);
|
|
31687
31707
|
});
|
|
31688
31708
|
var content = function content() {
|
|
31689
31709
|
return /*#__PURE__*/React.createElement(React.Fragment, null, cols.map(function (option, index) {
|
|
31710
|
+
var _String4;
|
|
31690
31711
|
var colunqid = _.uniqueId("".concat(option.name, "-").concat(index));
|
|
31691
|
-
var
|
|
31712
|
+
var dataName = (_String4 = String(option.name)) === null || _String4 === undefined ? undefined : _String4.replace(' ', '_').toLowerCase();
|
|
31713
|
+
var isSelected = !hideColumn.includes(dataName);
|
|
31692
31714
|
return /*#__PURE__*/React.createElement(Popover.Item, {
|
|
31693
31715
|
selected: isSelected,
|
|
31694
31716
|
key: colunqid,
|
|
@@ -31835,11 +31857,17 @@ function DataTable(_ref) {
|
|
|
31835
31857
|
style: _objectSpread2({
|
|
31836
31858
|
position: 'relative',
|
|
31837
31859
|
overflowY: 'auto',
|
|
31838
|
-
maxWidth: 'calc(100vw -
|
|
31860
|
+
maxWidth: 'calc(100vw - 1.5rem)',
|
|
31839
31861
|
width: sideMenu ? 'calc(100vw - 17.2rem)' : 'inherit !important'
|
|
31840
31862
|
}, style)
|
|
31841
31863
|
}, /*#__PURE__*/React.createElement(Table, {
|
|
31842
31864
|
stickyHeader: true,
|
|
31865
|
+
cursorPagination: cursorPagination,
|
|
31866
|
+
previousCursor: previousCursor,
|
|
31867
|
+
nextCursor: nextCursor,
|
|
31868
|
+
hasMore: hasMore,
|
|
31869
|
+
onNextPage: onNextPage,
|
|
31870
|
+
onPreviousPage: onPreviousPage,
|
|
31843
31871
|
dataLength: dataLength,
|
|
31844
31872
|
viewLength: viewLength,
|
|
31845
31873
|
onPageChange: function onPageChange(page, start, end) {
|
|
@@ -32163,7 +32191,7 @@ var PaginationItem = function PaginationItem(_ref) {
|
|
|
32163
32191
|
dynamic: [theme.palette.success, theme.layout.radius, theme.palette.background, hover, theme.palette.success, theme.palette.background, theme.expressiveness.shadowSmall, activeHover, theme.expressiveness.shadowMedium, theme.palette.accents_4, theme.palette.accents_2]
|
|
32164
32192
|
}, "li.__jsx-style-dynamic-selector{margin-right:0.428em;display:inline-block;}button.__jsx-style-dynamic-selector{border:none;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;box-sizing:border-box;text-transform:capitalize;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-align:center;vertical-align:middle;box-shadow:none;outline:none;height:var(--pagination-size);min-width:var(--pagination-size);font-size:inherit;cursor:pointer;color:".concat(theme.palette.success, ";border-radius:").concat(theme.layout.radius, ";background-color:").concat(theme.palette.background, ";-webkit-transition:all linear 200ms 0ms;transition:all linear 200ms 0ms;}button.__jsx-style-dynamic-selector:hover{background-color:").concat(hover, ";}.active.__jsx-style-dynamic-selector{font-weight:bold;background-color:").concat(theme.palette.success, ";color:").concat(theme.palette.background, ";box-shadow:").concat(theme.expressiveness.shadowSmall, ";}.active.__jsx-style-dynamic-selector:hover{background-color:").concat(activeHover, ";box-shadow:").concat(theme.expressiveness.shadowMedium, ";}.disabled.__jsx-style-dynamic-selector{color:").concat(theme.palette.accents_4, ";cursor:not-allowed;}.disabled.__jsx-style-dynamic-selector:hover{background-color:").concat(theme.palette.accents_2, ";}button.__jsx-style-dynamic-selector svg{width:1.3em;height:1.3em;}")));
|
|
32165
32193
|
};
|
|
32166
|
-
PaginationItem.displayName = '
|
|
32194
|
+
PaginationItem.displayName = 'PaginationItem';
|
|
32167
32195
|
|
|
32168
32196
|
/* "use client" */
|
|
32169
32197
|
|
|
@@ -32188,7 +32216,7 @@ var PaginationPrevious = function PaginationPrevious(_ref) {
|
|
|
32188
32216
|
disabled: isFirst
|
|
32189
32217
|
}, props), children);
|
|
32190
32218
|
};
|
|
32191
|
-
PaginationPrevious.displayName = '
|
|
32219
|
+
PaginationPrevious.displayName = 'PaginationPrevious';
|
|
32192
32220
|
|
|
32193
32221
|
var _excluded$2 = ["children"];
|
|
32194
32222
|
var PaginationNext = function PaginationNext(_ref) {
|
|
@@ -32204,7 +32232,7 @@ var PaginationNext = function PaginationNext(_ref) {
|
|
|
32204
32232
|
disabled: isLast
|
|
32205
32233
|
}, props), children);
|
|
32206
32234
|
};
|
|
32207
|
-
PaginationNext.displayName = '
|
|
32235
|
+
PaginationNext.displayName = 'PaginationNext';
|
|
32208
32236
|
|
|
32209
32237
|
var PaginationEllipsis = function PaginationEllipsis(_ref) {
|
|
32210
32238
|
var isBefore = _ref.isBefore,
|
|
@@ -32269,7 +32297,7 @@ var PaginationEllipsis = function PaginationEllipsis(_ref) {
|
|
|
32269
32297
|
dynamic: [isBefore ? '180deg' : '0deg']
|
|
32270
32298
|
}, "svg.__jsx-style-dynamic-selector{color:currentColor;stroke:currentColor;width:1em;height:1em;}.more.__jsx-style-dynamic-selector{-webkit-transform:rotate(".concat(isBefore ? '180deg' : '0deg', ");-ms-transform:rotate(").concat(isBefore ? '180deg' : '0deg', ");transform:rotate(").concat(isBefore ? '180deg' : '0deg', ");}")));
|
|
32271
32299
|
};
|
|
32272
|
-
PaginationEllipsis.displayName = '
|
|
32300
|
+
PaginationEllipsis.displayName = 'PaginationEllipsis';
|
|
32273
32301
|
|
|
32274
32302
|
var PaginationPages = function PaginationPages(_ref) {
|
|
32275
32303
|
var limit = _ref.limit,
|
|
@@ -32350,7 +32378,7 @@ var PaginationPages = function PaginationPages(_ref) {
|
|
|
32350
32378
|
}
|
|
32351
32379
|
}), renderItem(count, current));
|
|
32352
32380
|
};
|
|
32353
|
-
PaginationPages.displayName = '
|
|
32381
|
+
PaginationPages.displayName = 'PaginationPages';
|
|
32354
32382
|
|
|
32355
32383
|
var _excluded$1 = ["page", "initialPage", "count", "limit", "children", "onChange", "className"];
|
|
32356
32384
|
var PaginationComponent = function PaginationComponent(_ref) {
|
|
@@ -32437,7 +32465,7 @@ var Pagination = withScale(PaginationComponent);
|
|
|
32437
32465
|
Pagination.Previous = PaginationPrevious;
|
|
32438
32466
|
Pagination.Next = PaginationNext;
|
|
32439
32467
|
|
|
32440
|
-
var _excluded = ["children", "data", "initialData", "hover", "emptyText", "rowDraggable", "readOnly", "onRow", "onCell", "onChange", "onFilters", "onPageChange", "showFilters", "stickyHeader", "onSelected", "dataLength", "viewLength", "className", "rowClassName"];
|
|
32468
|
+
var _excluded = ["children", "data", "initialData", "hover", "emptyText", "rowDraggable", "readOnly", "cursorPagination", "previousCursor", "nextCursor", "hasMore", "onNextPage", "onPreviousPage", "onRow", "onCell", "onChange", "onFilters", "onPageChange", "showFilters", "stickyHeader", "onSelected", "dataLength", "viewLength", "className", "rowClassName"];
|
|
32441
32469
|
function TableComponent(tableProps) {
|
|
32442
32470
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
32443
32471
|
var _ref = tableProps,
|
|
@@ -32453,6 +32481,13 @@ function TableComponent(tableProps) {
|
|
|
32453
32481
|
rowDraggable = _ref$rowDraggable === undefined ? false : _ref$rowDraggable,
|
|
32454
32482
|
_ref$readOnly = _ref.readOnly,
|
|
32455
32483
|
readOnly = _ref$readOnly === undefined ? false : _ref$readOnly,
|
|
32484
|
+
_ref$cursorPagination = _ref.cursorPagination,
|
|
32485
|
+
cursorPagination = _ref$cursorPagination === undefined ? false : _ref$cursorPagination,
|
|
32486
|
+
previousCursor = _ref.previousCursor,
|
|
32487
|
+
nextCursor = _ref.nextCursor;
|
|
32488
|
+
_ref.hasMore;
|
|
32489
|
+
var onNextPage = _ref.onNextPage,
|
|
32490
|
+
onPreviousPage = _ref.onPreviousPage,
|
|
32456
32491
|
onRow = _ref.onRow,
|
|
32457
32492
|
onCell = _ref.onCell;
|
|
32458
32493
|
_ref.onChange;
|
|
@@ -32528,7 +32563,7 @@ function TableComponent(tableProps) {
|
|
|
32528
32563
|
}, /*#__PURE__*/React.createElement("table", _extends({
|
|
32529
32564
|
ref: ref
|
|
32530
32565
|
}, props, {
|
|
32531
|
-
className: _JSXStyle.dynamic([["
|
|
32566
|
+
className: _JSXStyle.dynamic([["1971279331", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]]) + " " + (props && props.className != null && props.className || className || "")
|
|
32532
32567
|
}), /*#__PURE__*/React.createElement(TableHead, {
|
|
32533
32568
|
stickyHeader: stickyHeader,
|
|
32534
32569
|
columns: columns,
|
|
@@ -32545,17 +32580,48 @@ function TableComponent(tableProps) {
|
|
|
32545
32580
|
rowDraggable: rowDraggable,
|
|
32546
32581
|
readOnly: readOnly,
|
|
32547
32582
|
onSelected: onSelected
|
|
32548
|
-
}), children,
|
|
32549
|
-
className: _JSXStyle.dynamic([["
|
|
32583
|
+
}), children, cursorPagination ? /*#__PURE__*/React.createElement("tfoot", {
|
|
32584
|
+
className: _JSXStyle.dynamic([["1971279331", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]])
|
|
32550
32585
|
}, /*#__PURE__*/React.createElement("td", {
|
|
32551
32586
|
colSpan: columns === null || columns === undefined ? undefined : columns.length,
|
|
32552
|
-
className: _JSXStyle.dynamic([["
|
|
32587
|
+
className: _JSXStyle.dynamic([["1971279331", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]])
|
|
32588
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
32589
|
+
style: {
|
|
32590
|
+
display: 'flex',
|
|
32591
|
+
gap: 10,
|
|
32592
|
+
margin: '10px'
|
|
32593
|
+
},
|
|
32594
|
+
className: _JSXStyle.dynamic([["1971279331", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]])
|
|
32595
|
+
}, /*#__PURE__*/React.createElement(Tooltip$1, {
|
|
32596
|
+
text: "Previous"
|
|
32597
|
+
}, /*#__PURE__*/React.createElement(Button$1, {
|
|
32598
|
+
disabled: !previousCursor,
|
|
32599
|
+
onClick: function onClick() {
|
|
32600
|
+
return onPreviousPage && onPreviousPage(previousCursor);
|
|
32601
|
+
},
|
|
32602
|
+
auto: true,
|
|
32603
|
+
px: 0.6,
|
|
32604
|
+
iconRight: /*#__PURE__*/React.createElement(ChevronLeft$1, null)
|
|
32605
|
+
})), /*#__PURE__*/React.createElement(Tooltip$1, {
|
|
32606
|
+
text: "Next"
|
|
32607
|
+
}, /*#__PURE__*/React.createElement(Button$1, {
|
|
32608
|
+
disabled: !nextCursor,
|
|
32609
|
+
onClick: function onClick() {
|
|
32610
|
+
return onNextPage && onNextPage(nextCursor);
|
|
32611
|
+
},
|
|
32612
|
+
auto: true,
|
|
32613
|
+
px: 0.6,
|
|
32614
|
+
iconRight: /*#__PURE__*/React.createElement(ChevronRight$1, null)
|
|
32615
|
+
}))))) : dataLength && viewLength && onPageChange ? /*#__PURE__*/React.createElement("tfoot", {
|
|
32616
|
+
className: _JSXStyle.dynamic([["1971279331", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]])
|
|
32617
|
+
}, /*#__PURE__*/React.createElement("td", {
|
|
32618
|
+
colSpan: columns === null || columns === undefined ? undefined : columns.length,
|
|
32619
|
+
className: _JSXStyle.dynamic([["1971279331", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]])
|
|
32553
32620
|
}, /*#__PURE__*/React.createElement(Pagination, {
|
|
32554
32621
|
style: {
|
|
32555
32622
|
marginLeft: '10px',
|
|
32556
32623
|
marginRight: '10px',
|
|
32557
|
-
marginTop: '10px'
|
|
32558
|
-
marginBottom: '5px'
|
|
32624
|
+
marginTop: '10px'
|
|
32559
32625
|
},
|
|
32560
32626
|
onChange: function onChange(pageNumber) {
|
|
32561
32627
|
// Get the range for the current page
|
|
@@ -32567,9 +32633,9 @@ function TableComponent(tableProps) {
|
|
|
32567
32633
|
limit: 5,
|
|
32568
32634
|
count: Number(dataLength / viewLength)
|
|
32569
32635
|
}, /*#__PURE__*/React.createElement(Pagination.Next, null, /*#__PURE__*/React.createElement(ChevronRight$1, null)), /*#__PURE__*/React.createElement(Pagination.Previous, null, /*#__PURE__*/React.createElement(ChevronLeft$1, null))))) : null, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
32570
|
-
id: "
|
|
32636
|
+
id: "1971279331",
|
|
32571
32637
|
dynamic: [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]
|
|
32572
|
-
}, "table.__jsx-style-dynamic-selector{border-collapse:separate;border-spacing:0
|
|
32638
|
+
}, "table.__jsx-style-dynamic-selector{border-collapse:separate;border-spacing:0;--table-font-size:".concat(SCALES.font(1), ";font-size:var(--table-font-size);width:").concat(SCALES.width(1, '100%'), ";height:").concat(SCALES.height(1, 'auto'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}tfoot.__jsx-style-dynamic-selector td.__jsx-style-dynamic-selector{position:-webkit-sticky;position:sticky;bottom:0;z-index:2;background-color:#fff;}"))));
|
|
32573
32639
|
}
|
|
32574
32640
|
TableComponent.displayName = 'Table';
|
|
32575
32641
|
TableComponent.Column = TableColumn;
|
package/dist/table/table.d.ts
CHANGED
|
@@ -20,6 +20,12 @@ interface Props<TableDataItem extends TableDataItemBase> {
|
|
|
20
20
|
dataLength?: number;
|
|
21
21
|
viewLength?: number;
|
|
22
22
|
rowClassName?: TableRowClassNameHandler<TableDataItem>;
|
|
23
|
+
cursorPagination?: boolean;
|
|
24
|
+
previousCursor?: string;
|
|
25
|
+
nextCursor?: string;
|
|
26
|
+
hasMore?: boolean;
|
|
27
|
+
onNextPage?: (next?: string) => void;
|
|
28
|
+
onPreviousPage?: (prev?: string) => void;
|
|
23
29
|
}
|
|
24
30
|
type NativeAttrs = Omit<React.TableHTMLAttributes<any>, keyof Props<any>>;
|
|
25
31
|
export type TableProps<TableDataItem extends TableDataItemBase> = Props<TableDataItem> & NativeAttrs;
|
|
@@ -65,5 +65,5 @@ var PaginationEllipsis = function PaginationEllipsis(_ref) {
|
|
|
65
65
|
dynamic: [isBefore ? '180deg' : '0deg']
|
|
66
66
|
}, "svg.__jsx-style-dynamic-selector{color:currentColor;stroke:currentColor;width:1em;height:1em;}.more.__jsx-style-dynamic-selector{-webkit-transform:rotate(".concat(isBefore ? '180deg' : '0deg', ");-ms-transform:rotate(").concat(isBefore ? '180deg' : '0deg', ");transform:rotate(").concat(isBefore ? '180deg' : '0deg', ");}")));
|
|
67
67
|
};
|
|
68
|
-
PaginationEllipsis.displayName = '
|
|
68
|
+
PaginationEllipsis.displayName = 'PaginationEllipsis';
|
|
69
69
|
export default PaginationEllipsis;
|
|
@@ -39,5 +39,5 @@ var PaginationItem = function PaginationItem(_ref) {
|
|
|
39
39
|
dynamic: [theme.palette.success, theme.layout.radius, theme.palette.background, hover, theme.palette.success, theme.palette.background, theme.expressiveness.shadowSmall, activeHover, theme.expressiveness.shadowMedium, theme.palette.accents_4, theme.palette.accents_2]
|
|
40
40
|
}, "li.__jsx-style-dynamic-selector{margin-right:0.428em;display:inline-block;}button.__jsx-style-dynamic-selector{border:none;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;box-sizing:border-box;text-transform:capitalize;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-align:center;vertical-align:middle;box-shadow:none;outline:none;height:var(--pagination-size);min-width:var(--pagination-size);font-size:inherit;cursor:pointer;color:".concat(theme.palette.success, ";border-radius:").concat(theme.layout.radius, ";background-color:").concat(theme.palette.background, ";-webkit-transition:all linear 200ms 0ms;transition:all linear 200ms 0ms;}button.__jsx-style-dynamic-selector:hover{background-color:").concat(hover, ";}.active.__jsx-style-dynamic-selector{font-weight:bold;background-color:").concat(theme.palette.success, ";color:").concat(theme.palette.background, ";box-shadow:").concat(theme.expressiveness.shadowSmall, ";}.active.__jsx-style-dynamic-selector:hover{background-color:").concat(activeHover, ";box-shadow:").concat(theme.expressiveness.shadowMedium, ";}.disabled.__jsx-style-dynamic-selector{color:").concat(theme.palette.accents_4, ";cursor:not-allowed;}.disabled.__jsx-style-dynamic-selector:hover{background-color:").concat(theme.palette.accents_2, ";}button.__jsx-style-dynamic-selector svg{width:1.3em;height:1.3em;}")));
|
|
41
41
|
};
|
|
42
|
-
PaginationItem.displayName = '
|
|
42
|
+
PaginationItem.displayName = 'PaginationItem';
|
|
43
43
|
export default PaginationItem;
|
|
@@ -17,5 +17,5 @@ var PaginationPrevious = function PaginationPrevious(_ref) {
|
|
|
17
17
|
disabled: isFirst
|
|
18
18
|
}, props), children);
|
|
19
19
|
};
|
|
20
|
-
PaginationPrevious.displayName = '
|
|
20
|
+
PaginationPrevious.displayName = 'PaginationPrevious';
|
|
21
21
|
export default PaginationPrevious;
|
|
@@ -32,8 +32,13 @@ type DataTableProps = {
|
|
|
32
32
|
dataLength?: number;
|
|
33
33
|
viewLength?: number;
|
|
34
34
|
onPageChange?: (page: number, start: number, end: number) => void;
|
|
35
|
+
cursorPagination?: boolean;
|
|
36
|
+
previousCursor?: string;
|
|
37
|
+
nextCursor?: string;
|
|
38
|
+
onNextPage?: (next?: string) => void;
|
|
39
|
+
onPreviousPage?: (prev?: string) => void;
|
|
35
40
|
};
|
|
36
41
|
declare function DataTable({ cols, rows, readOnly, heading, filter, menu, sideMenu, style, children, onBack, onRefresh, // Function
|
|
37
|
-
onFilters, onSelectedDelete, onSelectedEdit, onSelected, disableViewColumn, rowDraggable, onDragOver, onDragEnter, onDragLeave, onDrop, onRowClick, dataLength, viewLength, onPageChange, disableMenu }: DataTableProps): React.JSX.Element;
|
|
42
|
+
onFilters, onSelectedDelete, onSelectedEdit, onSelected, disableViewColumn, rowDraggable, onDragOver, onDragEnter, onDragLeave, onDrop, onRowClick, dataLength, viewLength, onPageChange, disableMenu, cursorPagination, previousCursor, nextCursor, hasMore, onNextPage, onPreviousPage, }: DataTableProps): React.JSX.Element;
|
|
38
43
|
declare const _default: React.MemoExoticComponent<typeof DataTable>;
|
|
39
44
|
export default _default;
|
package/esm/table/data-table.js
CHANGED
|
@@ -51,7 +51,15 @@ function DataTable(_ref) {
|
|
|
51
51
|
viewLength = _ref.viewLength,
|
|
52
52
|
_onPageChange = _ref.onPageChange,
|
|
53
53
|
_ref$disableMenu = _ref.disableMenu,
|
|
54
|
-
disableMenu = _ref$disableMenu === void 0 ? false : _ref$disableMenu
|
|
54
|
+
disableMenu = _ref$disableMenu === void 0 ? false : _ref$disableMenu,
|
|
55
|
+
_ref$cursorPagination = _ref.cursorPagination,
|
|
56
|
+
cursorPagination = _ref$cursorPagination === void 0 ? false : _ref$cursorPagination,
|
|
57
|
+
previousCursor = _ref.previousCursor,
|
|
58
|
+
nextCursor = _ref.nextCursor,
|
|
59
|
+
_ref$hasMore = _ref.hasMore,
|
|
60
|
+
hasMore = _ref$hasMore === void 0 ? false : _ref$hasMore,
|
|
61
|
+
onNextPage = _ref.onNextPage,
|
|
62
|
+
onPreviousPage = _ref.onPreviousPage;
|
|
55
63
|
var TABLE_ID = _.uniqueId('tbl');
|
|
56
64
|
// const [anchorEl, setAnchorEl] = useState(null);
|
|
57
65
|
var _useState = useState([]),
|
|
@@ -85,18 +93,22 @@ function DataTable(_ref) {
|
|
|
85
93
|
}, [selected]);
|
|
86
94
|
useEffect(function () {
|
|
87
95
|
cols.forEach(function (col) {
|
|
96
|
+
var _String;
|
|
97
|
+
var dataName = (_String = String(col === null || col === void 0 ? void 0 : col.name)) === null || _String === void 0 ? void 0 : _String.replace(' ', '_').toLowerCase();
|
|
88
98
|
if (hideColumn.includes(col.name)) {
|
|
89
|
-
document.querySelectorAll("[data-column=\"".concat(
|
|
99
|
+
document.querySelectorAll("[data-column=\"".concat(dataName, "\"]")).forEach(function (el) {
|
|
90
100
|
el.style.display = 'none !important';
|
|
91
101
|
});
|
|
92
102
|
} else {
|
|
93
|
-
document.querySelectorAll("[data-column=\"".concat(
|
|
103
|
+
document.querySelectorAll("[data-column=\"".concat(dataName, "\"]")).forEach(function (el) {
|
|
94
104
|
el.style.display = '';
|
|
95
105
|
});
|
|
96
106
|
}
|
|
97
107
|
});
|
|
98
108
|
}, [hideColumn, cols, rows]);
|
|
99
|
-
var handleHideColumnClick = function handleHideColumnClick(_event,
|
|
109
|
+
var handleHideColumnClick = function handleHideColumnClick(_event, _id) {
|
|
110
|
+
var _String2;
|
|
111
|
+
var id = (_String2 = String(_id)) === null || _String2 === void 0 ? void 0 : _String2.replace(' ', '_').toLowerCase();
|
|
100
112
|
var selectedIndex = hideColumn.indexOf(id);
|
|
101
113
|
var newSelected = [];
|
|
102
114
|
if (selectedIndex === -1) {
|
|
@@ -146,12 +158,16 @@ function DataTable(_ref) {
|
|
|
146
158
|
// };
|
|
147
159
|
|
|
148
160
|
var COLUMNS = cols.filter(function (col) {
|
|
149
|
-
|
|
161
|
+
var _String3;
|
|
162
|
+
var dataName = (_String3 = String(col === null || col === void 0 ? void 0 : col.name)) === null || _String3 === void 0 ? void 0 : _String3.replace(' ', '_').toLowerCase();
|
|
163
|
+
return !hideColumn.includes(dataName);
|
|
150
164
|
});
|
|
151
165
|
var content = function content() {
|
|
152
166
|
return /*#__PURE__*/React.createElement(React.Fragment, null, cols.map(function (option, index) {
|
|
167
|
+
var _String4;
|
|
153
168
|
var colunqid = _.uniqueId("".concat(option.name, "-").concat(index));
|
|
154
|
-
var
|
|
169
|
+
var dataName = (_String4 = String(option.name)) === null || _String4 === void 0 ? void 0 : _String4.replace(' ', '_').toLowerCase();
|
|
170
|
+
var isSelected = !hideColumn.includes(dataName);
|
|
155
171
|
return /*#__PURE__*/React.createElement(Popover.Item, {
|
|
156
172
|
selected: isSelected,
|
|
157
173
|
key: colunqid,
|
|
@@ -298,11 +314,17 @@ function DataTable(_ref) {
|
|
|
298
314
|
style: _extends({
|
|
299
315
|
position: 'relative',
|
|
300
316
|
overflowY: 'auto',
|
|
301
|
-
maxWidth: 'calc(100vw -
|
|
317
|
+
maxWidth: 'calc(100vw - 1.5rem)',
|
|
302
318
|
width: sideMenu ? 'calc(100vw - 17.2rem)' : 'inherit !important'
|
|
303
319
|
}, style)
|
|
304
320
|
}, /*#__PURE__*/React.createElement(Table, {
|
|
305
321
|
stickyHeader: true,
|
|
322
|
+
cursorPagination: cursorPagination,
|
|
323
|
+
previousCursor: previousCursor,
|
|
324
|
+
nextCursor: nextCursor,
|
|
325
|
+
hasMore: hasMore,
|
|
326
|
+
onNextPage: onNextPage,
|
|
327
|
+
onPreviousPage: onPreviousPage,
|
|
306
328
|
dataLength: dataLength,
|
|
307
329
|
viewLength: viewLength,
|
|
308
330
|
onPageChange: function onPageChange(page, start, end) {
|
package/esm/table/table-cell.js
CHANGED
|
@@ -8,9 +8,11 @@ var TableCell = function TableCell(_ref) {
|
|
|
8
8
|
onCellClick = _ref.onCellClick;
|
|
9
9
|
/* eslint-disable react/jsx-no-useless-fragment */
|
|
10
10
|
return /*#__PURE__*/React.createElement(React.Fragment, null, columns.map(function (column, index) {
|
|
11
|
+
var _String;
|
|
11
12
|
var currentRowValue = row[column.prop];
|
|
12
13
|
var cellValue = currentRowValue || emptyText;
|
|
13
14
|
var shouldBeRenderElement = column.renderHandler(currentRowValue, row, rowIndex);
|
|
15
|
+
var dataName = (_String = String(column === null || column === void 0 ? void 0 : column.label)) === null || _String === void 0 ? void 0 : _String.replace(' ', '_').toLowerCase();
|
|
14
16
|
return /*#__PURE__*/React.createElement("td", {
|
|
15
17
|
style: _extends({
|
|
16
18
|
fontSize: "".concat(column === null || column === void 0 ? void 0 : column.fontSize),
|
|
@@ -21,7 +23,7 @@ var TableCell = function TableCell(_ref) {
|
|
|
21
23
|
boxSizing: 'border-box',
|
|
22
24
|
whiteSpace: column !== null && column !== void 0 && column.noWrap ? 'nowrap' : 'normal'
|
|
23
25
|
}, currentRowValue === null || currentRowValue === void 0 ? void 0 : currentRowValue.style),
|
|
24
|
-
"data-column":
|
|
26
|
+
"data-column": dataName,
|
|
25
27
|
key: "row-td-".concat(index, "-").concat(column.prop.toString()),
|
|
26
28
|
onClick: function onClick() {
|
|
27
29
|
return onCellClick && onCellClick(currentRowValue, rowIndex, index);
|
package/esm/table/table-head.js
CHANGED
|
@@ -127,10 +127,12 @@ var TableHead = function TableHead(props) {
|
|
|
127
127
|
});
|
|
128
128
|
};
|
|
129
129
|
return /*#__PURE__*/React.createElement(React.Fragment, null, colgroup, /*#__PURE__*/React.createElement("thead", {
|
|
130
|
-
className: _JSXStyle.dynamic([["
|
|
130
|
+
className: _JSXStyle.dynamic([["2156261549", [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
|
|
131
131
|
}, /*#__PURE__*/React.createElement("tr", {
|
|
132
|
-
className: _JSXStyle.dynamic([["
|
|
132
|
+
className: _JSXStyle.dynamic([["2156261549", [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
|
|
133
133
|
}, columns.map(function (column, index) {
|
|
134
|
+
var _String2;
|
|
135
|
+
var dataName = (_String2 = String(column === null || column === void 0 ? void 0 : column.label)) === null || _String2 === void 0 ? void 0 : _String2.replace(' ', '_').toLowerCase();
|
|
134
136
|
return /*#__PURE__*/React.createElement("th", {
|
|
135
137
|
style: {
|
|
136
138
|
// textAlign: `${column?.align} !important`,
|
|
@@ -140,24 +142,24 @@ var TableHead = function TableHead(props) {
|
|
|
140
142
|
whiteSpace: column !== null && column !== void 0 && column.noWrap ? 'nowrap' : 'normal'
|
|
141
143
|
},
|
|
142
144
|
key: "table-th-".concat(column.prop.toString(), "-").concat(index),
|
|
143
|
-
"data-column":
|
|
144
|
-
className: _JSXStyle.dynamic([["
|
|
145
|
+
"data-column": dataName,
|
|
146
|
+
className: _JSXStyle.dynamic([["2156261549", [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]]) + " " + (column.className || "")
|
|
145
147
|
}, /*#__PURE__*/React.createElement("div", {
|
|
146
|
-
className: _JSXStyle.dynamic([["
|
|
148
|
+
className: _JSXStyle.dynamic([["2156261549", [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]]) + " " + "thead-box"
|
|
147
149
|
}, column.label, /*#__PURE__*/React.createElement("br", {
|
|
148
|
-
className: _JSXStyle.dynamic([["
|
|
150
|
+
className: _JSXStyle.dynamic([["2156261549", [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
|
|
149
151
|
}), /*#__PURE__*/React.createElement("span", {
|
|
150
152
|
style: {
|
|
151
153
|
textAlign: 'center'
|
|
152
154
|
},
|
|
153
|
-
className: _JSXStyle.dynamic([["
|
|
155
|
+
className: _JSXStyle.dynamic([["2156261549", [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
|
|
154
156
|
}, column.text)));
|
|
155
157
|
})), showFilters && /*#__PURE__*/React.createElement("tr", {
|
|
156
|
-
className: _JSXStyle.dynamic([["
|
|
158
|
+
className: _JSXStyle.dynamic([["2156261549", [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
|
|
157
159
|
}, generateFilterInputs())), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
158
|
-
id: "
|
|
159
|
-
dynamic: [stickyHeader && "\n position: sticky;\n top: 0;\n
|
|
160
|
-
}, "thead.__jsx-style-dynamic-selector{border-collapse:separate;border-spacing:0;font-size:inherit;".concat(stickyHeader && "\n position: sticky;\n top: 0;\n
|
|
160
|
+
id: "2156261549",
|
|
161
|
+
dynamic: [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]
|
|
162
|
+
}, "thead.__jsx-style-dynamic-selector{border-collapse:separate;border-spacing:0;background-color:#fff;font-size:inherit;".concat(stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", ";}th.__jsx-style-dynamic-selector{padding:0 0.5em;font-size:calc(0.75 * var(--table-font-size));font-weight:normal;text-align:left;-webkit-letter-spacing:0;-moz-letter-spacing:0;-ms-letter-spacing:0;letter-spacing:0;vertical-align:middle;min-height:calc(2.5 * var(--table-font-size));color:").concat(theme.palette.accents_5, ";background:").concat(theme.palette.accents_1, ";border-bottom:1px solid ").concat(theme.palette.border, ";border-top:1px solid ").concat(theme.palette.border, ";border-radius:0;}th.__jsx-style-dynamic-selector:nth-child(1){border-bottom:1px solid ").concat(theme.palette.border, ";border-left:1px solid ").concat(theme.palette.border, ";border-top:1px solid ").concat(theme.palette.border, ";border-top-left-radius:").concat(theme.layout.radius, ";border-bottom-left-radius:").concat(theme.layout.radius, ";}th.__jsx-style-dynamic-selector:last-child{border-bottom:1px solid ").concat(theme.palette.border, ";border-right:1px solid ").concat(theme.palette.border, ";border-top:1px solid ").concat(theme.palette.border, ";border-top-right-radius:").concat(theme.layout.radius, ";border-bottom-right-radius:").concat(theme.layout.radius, ";}.thead-box.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-align:center;min-height:calc(2.5 * var(--table-font-size));text-transform:uppercase;}")));
|
|
161
163
|
};
|
|
162
164
|
TableHead.displayName = 'TableHead';
|
|
163
165
|
export default TableHead;
|
package/esm/table/table.d.ts
CHANGED
|
@@ -20,6 +20,12 @@ interface Props<TableDataItem extends TableDataItemBase> {
|
|
|
20
20
|
dataLength?: number;
|
|
21
21
|
viewLength?: number;
|
|
22
22
|
rowClassName?: TableRowClassNameHandler<TableDataItem>;
|
|
23
|
+
cursorPagination?: boolean;
|
|
24
|
+
previousCursor?: string;
|
|
25
|
+
nextCursor?: string;
|
|
26
|
+
hasMore?: boolean;
|
|
27
|
+
onNextPage?: (next?: string) => void;
|
|
28
|
+
onPreviousPage?: (prev?: string) => void;
|
|
23
29
|
}
|
|
24
30
|
type NativeAttrs = Omit<React.TableHTMLAttributes<any>, keyof Props<any>>;
|
|
25
31
|
export type TableProps<TableDataItem extends TableDataItemBase> = Props<TableDataItem> & NativeAttrs;
|
package/esm/table/table.js
CHANGED
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["children", "data", "initialData", "hover", "emptyText", "rowDraggable", "readOnly", "onRow", "onCell", "onChange", "onFilters", "onPageChange", "showFilters", "stickyHeader", "onSelected", "dataLength", "viewLength", "className", "rowClassName"];
|
|
5
|
+
var _excluded = ["children", "data", "initialData", "hover", "emptyText", "rowDraggable", "readOnly", "cursorPagination", "previousCursor", "nextCursor", "hasMore", "onNextPage", "onPreviousPage", "onRow", "onCell", "onChange", "onFilters", "onPageChange", "showFilters", "stickyHeader", "onSelected", "dataLength", "viewLength", "className", "rowClassName"];
|
|
6
6
|
import _JSXStyle from "../styled-jsx.es.js";
|
|
7
7
|
/* "use client" */
|
|
8
8
|
|
|
@@ -16,6 +16,8 @@ import useScale, { withScale } from '../use-scale';
|
|
|
16
16
|
import TableColumn from './table-column';
|
|
17
17
|
import { ChevronLeft, ChevronRight } from '@helpdice/icons';
|
|
18
18
|
import Pagination from '../pagination';
|
|
19
|
+
import Button from 'components/button';
|
|
20
|
+
import Tooltip from 'components/tooltip';
|
|
19
21
|
function TableComponent(tableProps) {
|
|
20
22
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
21
23
|
var _ref = tableProps,
|
|
@@ -31,6 +33,14 @@ function TableComponent(tableProps) {
|
|
|
31
33
|
rowDraggable = _ref$rowDraggable === void 0 ? false : _ref$rowDraggable,
|
|
32
34
|
_ref$readOnly = _ref.readOnly,
|
|
33
35
|
readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,
|
|
36
|
+
_ref$cursorPagination = _ref.cursorPagination,
|
|
37
|
+
cursorPagination = _ref$cursorPagination === void 0 ? false : _ref$cursorPagination,
|
|
38
|
+
previousCursor = _ref.previousCursor,
|
|
39
|
+
nextCursor = _ref.nextCursor,
|
|
40
|
+
_ref$hasMore = _ref.hasMore,
|
|
41
|
+
hasMore = _ref$hasMore === void 0 ? false : _ref$hasMore,
|
|
42
|
+
onNextPage = _ref.onNextPage,
|
|
43
|
+
onPreviousPage = _ref.onPreviousPage,
|
|
34
44
|
onRow = _ref.onRow,
|
|
35
45
|
onCell = _ref.onCell,
|
|
36
46
|
onChange = _ref.onChange,
|
|
@@ -106,7 +116,7 @@ function TableComponent(tableProps) {
|
|
|
106
116
|
}, /*#__PURE__*/React.createElement("table", _extends({
|
|
107
117
|
ref: ref
|
|
108
118
|
}, props, {
|
|
109
|
-
className: _JSXStyle.dynamic([["
|
|
119
|
+
className: _JSXStyle.dynamic([["1971279331", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]]) + " " + (props && props.className != null && props.className || className || "")
|
|
110
120
|
}), /*#__PURE__*/React.createElement(TableHead, {
|
|
111
121
|
stickyHeader: stickyHeader,
|
|
112
122
|
columns: columns,
|
|
@@ -123,17 +133,48 @@ function TableComponent(tableProps) {
|
|
|
123
133
|
rowDraggable: rowDraggable,
|
|
124
134
|
readOnly: readOnly,
|
|
125
135
|
onSelected: onSelected
|
|
126
|
-
}), children,
|
|
127
|
-
className: _JSXStyle.dynamic([["
|
|
136
|
+
}), children, cursorPagination ? /*#__PURE__*/React.createElement("tfoot", {
|
|
137
|
+
className: _JSXStyle.dynamic([["1971279331", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]])
|
|
128
138
|
}, /*#__PURE__*/React.createElement("td", {
|
|
129
139
|
colSpan: columns === null || columns === void 0 ? void 0 : columns.length,
|
|
130
|
-
className: _JSXStyle.dynamic([["
|
|
140
|
+
className: _JSXStyle.dynamic([["1971279331", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]])
|
|
141
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
142
|
+
style: {
|
|
143
|
+
display: 'flex',
|
|
144
|
+
gap: 10,
|
|
145
|
+
margin: '10px'
|
|
146
|
+
},
|
|
147
|
+
className: _JSXStyle.dynamic([["1971279331", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]])
|
|
148
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
149
|
+
text: "Previous"
|
|
150
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
151
|
+
disabled: !previousCursor,
|
|
152
|
+
onClick: function onClick() {
|
|
153
|
+
return onPreviousPage && onPreviousPage(previousCursor);
|
|
154
|
+
},
|
|
155
|
+
auto: true,
|
|
156
|
+
px: 0.6,
|
|
157
|
+
iconRight: /*#__PURE__*/React.createElement(ChevronLeft, null)
|
|
158
|
+
})), /*#__PURE__*/React.createElement(Tooltip, {
|
|
159
|
+
text: "Next"
|
|
160
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
161
|
+
disabled: !nextCursor,
|
|
162
|
+
onClick: function onClick() {
|
|
163
|
+
return onNextPage && onNextPage(nextCursor);
|
|
164
|
+
},
|
|
165
|
+
auto: true,
|
|
166
|
+
px: 0.6,
|
|
167
|
+
iconRight: /*#__PURE__*/React.createElement(ChevronRight, null)
|
|
168
|
+
}))))) : dataLength && viewLength && onPageChange ? /*#__PURE__*/React.createElement("tfoot", {
|
|
169
|
+
className: _JSXStyle.dynamic([["1971279331", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]])
|
|
170
|
+
}, /*#__PURE__*/React.createElement("td", {
|
|
171
|
+
colSpan: columns === null || columns === void 0 ? void 0 : columns.length,
|
|
172
|
+
className: _JSXStyle.dynamic([["1971279331", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]])
|
|
131
173
|
}, /*#__PURE__*/React.createElement(Pagination, {
|
|
132
174
|
style: {
|
|
133
175
|
marginLeft: '10px',
|
|
134
176
|
marginRight: '10px',
|
|
135
|
-
marginTop: '10px'
|
|
136
|
-
marginBottom: '5px'
|
|
177
|
+
marginTop: '10px'
|
|
137
178
|
},
|
|
138
179
|
onChange: function onChange(pageNumber) {
|
|
139
180
|
// Get the range for the current page
|
|
@@ -145,9 +186,9 @@ function TableComponent(tableProps) {
|
|
|
145
186
|
limit: 5,
|
|
146
187
|
count: Number(dataLength / viewLength)
|
|
147
188
|
}, /*#__PURE__*/React.createElement(Pagination.Next, null, /*#__PURE__*/React.createElement(ChevronRight, null)), /*#__PURE__*/React.createElement(Pagination.Previous, null, /*#__PURE__*/React.createElement(ChevronLeft, null))))) : null, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
148
|
-
id: "
|
|
189
|
+
id: "1971279331",
|
|
149
190
|
dynamic: [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]
|
|
150
|
-
}, "table.__jsx-style-dynamic-selector{border-collapse:separate;border-spacing:0
|
|
191
|
+
}, "table.__jsx-style-dynamic-selector{border-collapse:separate;border-spacing:0;--table-font-size:".concat(SCALES.font(1), ";font-size:var(--table-font-size);width:").concat(SCALES.width(1, '100%'), ";height:").concat(SCALES.height(1, 'auto'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}tfoot.__jsx-style-dynamic-selector td.__jsx-style-dynamic-selector{position:-webkit-sticky;position:sticky;bottom:0;z-index:2;background-color:#fff;}"))));
|
|
151
192
|
}
|
|
152
193
|
TableComponent.displayName = 'Table';
|
|
153
194
|
TableComponent.Column = TableColumn;
|