@reltio/components 1.4.1470 → 1.4.1472
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.
|
@@ -63,11 +63,7 @@ var ramda_1 = require("ramda");
|
|
|
63
63
|
var useCollapsibleTableRows_1 = __importDefault(require("./hooks/useCollapsibleTableRows"));
|
|
64
64
|
var BasicTable = (0, react_1.forwardRef)(function (_a, ref) {
|
|
65
65
|
var columnsData = _a.columnsData, rowsData = _a.rowsData, context = _a.context, sorting = _a.sorting, onSort = _a.onSort, _b = _a.renderRowCell, renderRowCell = _b === void 0 ? defaultRenderRowCell_1.default : _b, _c = _a.getRowCellHeight, getRowCellHeight = _c === void 0 ? defaultGetRowCellHeight_1.default : _c, filters = _a.filters, onFilter = _a.onFilter, headRowHeight = _a.headRowHeight, _d = _a.maxRowValuesCount, maxRowValuesCount = _d === void 0 ? Infinity : _d, autosizing = _a.autosizing, maxHeight = _a.maxHeight, otherProps = __rest(_a, ["columnsData", "rowsData", "context", "sorting", "onSort", "renderRowCell", "getRowCellHeight", "filters", "onFilter", "headRowHeight", "maxRowValuesCount", "autosizing", "maxHeight"]);
|
|
66
|
-
var tableHeadData = (0, react_1.useMemo)(function () { return (0, dataHelpers_1.getTableHeadData)(columnsData, filters, onFilter); }, [
|
|
67
|
-
columnsData,
|
|
68
|
-
filters,
|
|
69
|
-
onFilter
|
|
70
|
-
]);
|
|
66
|
+
var tableHeadData = (0, react_1.useMemo)(function () { return (0, dataHelpers_1.getTableHeadData)(columnsData, filters, onFilter); }, [columnsData, filters, onFilter]);
|
|
71
67
|
var _e = (0, useCollapsibleTableRows_1.default)({
|
|
72
68
|
rowsData: rowsData,
|
|
73
69
|
columnsData: columnsData,
|
|
@@ -75,6 +71,9 @@ var BasicTable = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
75
71
|
getRowCellHeight: getRowCellHeight,
|
|
76
72
|
maxRowValuesCount: maxRowValuesCount
|
|
77
73
|
}), tableRowsData = _e.tableRowsData, collapseContextValue = _e.collapseContextValue;
|
|
74
|
+
if (!tableHeadData.length) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
78
77
|
return (react_1.default.createElement(RowCollapseContext_1.RowCollapseContext.Provider, { value: collapseContextValue },
|
|
79
78
|
react_1.default.createElement(TableContext_1.TableContext.Provider, { value: context },
|
|
80
79
|
react_1.default.createElement(Table_1.default, __assign({ autosizing: autosizing, maxHeight: maxHeight, defaultRowHeight: 48 }, otherProps, { fixHead: tableRowsData.length > 0, headData: tableHeadData, rowsData: tableRowsData, sortField: (0, ramda_1.prop)('field', sorting), sortOrder: (0, ramda_1.prop)('order', sorting), onSort: onSort, headRowHeight: filters ? headRowHeight + styles_1.COLUMN_FILTER_HEIGHT : headRowHeight, ref: ref })))));
|
|
@@ -34,11 +34,7 @@ import { prop } from 'ramda';
|
|
|
34
34
|
import useCollapsibleTableRows from './hooks/useCollapsibleTableRows';
|
|
35
35
|
var BasicTable = forwardRef(function (_a, ref) {
|
|
36
36
|
var columnsData = _a.columnsData, rowsData = _a.rowsData, context = _a.context, sorting = _a.sorting, onSort = _a.onSort, _b = _a.renderRowCell, renderRowCell = _b === void 0 ? defaultRenderRowCell : _b, _c = _a.getRowCellHeight, getRowCellHeight = _c === void 0 ? defaultGetRowCellHeight : _c, filters = _a.filters, onFilter = _a.onFilter, headRowHeight = _a.headRowHeight, _d = _a.maxRowValuesCount, maxRowValuesCount = _d === void 0 ? Infinity : _d, autosizing = _a.autosizing, maxHeight = _a.maxHeight, otherProps = __rest(_a, ["columnsData", "rowsData", "context", "sorting", "onSort", "renderRowCell", "getRowCellHeight", "filters", "onFilter", "headRowHeight", "maxRowValuesCount", "autosizing", "maxHeight"]);
|
|
37
|
-
var tableHeadData = useMemo(function () { return getTableHeadData(columnsData, filters, onFilter); }, [
|
|
38
|
-
columnsData,
|
|
39
|
-
filters,
|
|
40
|
-
onFilter
|
|
41
|
-
]);
|
|
37
|
+
var tableHeadData = useMemo(function () { return getTableHeadData(columnsData, filters, onFilter); }, [columnsData, filters, onFilter]);
|
|
42
38
|
var _e = useCollapsibleTableRows({
|
|
43
39
|
rowsData: rowsData,
|
|
44
40
|
columnsData: columnsData,
|
|
@@ -46,6 +42,9 @@ var BasicTable = forwardRef(function (_a, ref) {
|
|
|
46
42
|
getRowCellHeight: getRowCellHeight,
|
|
47
43
|
maxRowValuesCount: maxRowValuesCount
|
|
48
44
|
}), tableRowsData = _e.tableRowsData, collapseContextValue = _e.collapseContextValue;
|
|
45
|
+
if (!tableHeadData.length) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
49
48
|
return (React.createElement(RowCollapseContext.Provider, { value: collapseContextValue },
|
|
50
49
|
React.createElement(TableContext.Provider, { value: context },
|
|
51
50
|
React.createElement(Table, __assign({ autosizing: autosizing, maxHeight: maxHeight, defaultRowHeight: 48 }, otherProps, { fixHead: tableRowsData.length > 0, headData: tableHeadData, rowsData: tableRowsData, sortField: prop('field', sorting), sortOrder: prop('order', sorting), onSort: onSort, headRowHeight: filters ? headRowHeight + COLUMN_FILTER_HEIGHT : headRowHeight, ref: ref })))));
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1472",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE FILE",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./esm/index.js",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@date-io/moment": "^1.3.5",
|
|
9
9
|
"@react-google-maps/api": "2.7.0",
|
|
10
|
-
"@reltio/mdm-module": "^1.4.
|
|
11
|
-
"@reltio/mdm-sdk": "^1.4.
|
|
10
|
+
"@reltio/mdm-module": "^1.4.1472",
|
|
11
|
+
"@reltio/mdm-sdk": "^1.4.1472",
|
|
12
12
|
"classnames": "^2.2.5",
|
|
13
13
|
"d3-cloud": "^1.2.5",
|
|
14
14
|
"d3-geo": "^2.0.1",
|