cozy-ui 123.2.1 → 124.0.0
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/CHANGELOG.md +29 -0
- package/package.json +11 -6
- package/react/Filename/Readme.md +10 -8
- package/react/Filename/index.jsx +56 -10
- package/react/Filename/styles.styl +3 -0
- package/react/MuiCozyTheme/overrides/makeLightNormalOverrides.js +60 -0
- package/react/Table/Readme.md +80 -0
- package/react/Table/Virtualized/Cell.jsx +41 -0
- package/react/Table/Virtualized/Dnd/CustomDrag/CustomDragLayer.jsx +45 -0
- package/react/Table/Virtualized/Dnd/CustomDrag/DragPreview.jsx +43 -0
- package/react/Table/Virtualized/Dnd/CustomDrag/DragPreviewWrapper.jsx +52 -0
- package/react/Table/Virtualized/Dnd/DnDConfigWrapper.jsx +48 -0
- package/react/Table/Virtualized/Dnd/TableRow.jsx +86 -0
- package/react/Table/Virtualized/FixedHeaderContent.jsx +58 -0
- package/react/Table/Virtualized/HeadCell.jsx +45 -0
- package/react/Table/Virtualized/RowContent.jsx +35 -0
- package/react/Table/Virtualized/helpers.js +41 -0
- package/react/Table/Virtualized/helpers.spec.js +108 -0
- package/react/Table/Virtualized/index.jsx +104 -0
- package/react/Table/Virtualized/virtuosoComponents.jsx +61 -0
- package/react/TableRow/index.js +16 -1
- package/transpiled/react/Filename/index.d.ts +2 -1
- package/transpiled/react/Filename/index.js +49 -16
- package/transpiled/react/MuiCozyTheme/overrides/makeDarkInvertedOverrides.d.ts +56 -0
- package/transpiled/react/MuiCozyTheme/overrides/makeDarkNormalOverrides.d.ts +56 -0
- package/transpiled/react/MuiCozyTheme/overrides/makeLightInvertedOverrides.d.ts +56 -0
- package/transpiled/react/MuiCozyTheme/overrides/makeLightNormalOverrides.d.ts +56 -0
- package/transpiled/react/MuiCozyTheme/overrides/makeLightNormalOverrides.js +59 -0
- package/transpiled/react/Table/Virtualized/Cell.d.ts +8 -0
- package/transpiled/react/Table/Virtualized/Cell.js +46 -0
- package/transpiled/react/Table/Virtualized/Dnd/CustomDrag/CustomDragLayer.d.ts +4 -0
- package/transpiled/react/Table/Virtualized/Dnd/CustomDrag/CustomDragLayer.js +47 -0
- package/transpiled/react/Table/Virtualized/Dnd/CustomDrag/DragPreview.d.ts +6 -0
- package/transpiled/react/Table/Virtualized/Dnd/CustomDrag/DragPreview.js +34 -0
- package/transpiled/react/Table/Virtualized/Dnd/CustomDrag/DragPreviewWrapper.d.ts +8 -0
- package/transpiled/react/Table/Virtualized/Dnd/CustomDrag/DragPreviewWrapper.js +63 -0
- package/transpiled/react/Table/Virtualized/Dnd/DnDConfigWrapper.d.ts +2 -0
- package/transpiled/react/Table/Virtualized/Dnd/DnDConfigWrapper.js +55 -0
- package/transpiled/react/Table/Virtualized/Dnd/TableRow.d.ts +8 -0
- package/transpiled/react/Table/Virtualized/Dnd/TableRow.js +130 -0
- package/transpiled/react/Table/Virtualized/FixedHeaderContent.d.ts +10 -0
- package/transpiled/react/Table/Virtualized/FixedHeaderContent.js +54 -0
- package/transpiled/react/Table/Virtualized/HeadCell.d.ts +8 -0
- package/transpiled/react/Table/Virtualized/HeadCell.js +44 -0
- package/transpiled/react/Table/Virtualized/RowContent.d.ts +10 -0
- package/transpiled/react/Table/Virtualized/RowContent.js +34 -0
- package/transpiled/react/Table/Virtualized/helpers.d.ts +2 -0
- package/transpiled/react/Table/Virtualized/helpers.js +64 -0
- package/transpiled/react/Table/Virtualized/helpers.spec.d.ts +1 -0
- package/transpiled/react/Table/Virtualized/index.d.ts +2 -0
- package/transpiled/react/Table/Virtualized/index.js +115 -0
- package/transpiled/react/Table/Virtualized/virtuosoComponents.d.ts +10 -0
- package/transpiled/react/Table/Virtualized/virtuosoComponents.js +100 -0
- package/transpiled/react/TableRow/index.d.ts +2 -1
- package/transpiled/react/TableRow/index.js +20 -1
- package/transpiled/react/stylesheet.css +1 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import TableCell from "cozy-ui/transpiled/react/TableCell";
|
|
3
|
+
import TableSortLabel from "cozy-ui/transpiled/react/TableSortLabel";
|
|
4
|
+
import { makeStyles } from "cozy-ui/transpiled/react/styles";
|
|
5
|
+
var useStyles = makeStyles({
|
|
6
|
+
root: {
|
|
7
|
+
width: function width(_ref) {
|
|
8
|
+
var column = _ref.column;
|
|
9
|
+
return column.width;
|
|
10
|
+
},
|
|
11
|
+
maxWidth: function maxWidth(_ref2) {
|
|
12
|
+
var column = _ref2.column;
|
|
13
|
+
return column.maxWidth;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
var TableHeadCell = function TableHeadCell(_ref3) {
|
|
19
|
+
var _column$textAlign;
|
|
20
|
+
|
|
21
|
+
var className = _ref3.className,
|
|
22
|
+
column = _ref3.column,
|
|
23
|
+
orderBy = _ref3.orderBy,
|
|
24
|
+
order = _ref3.order,
|
|
25
|
+
onClick = _ref3.onClick;
|
|
26
|
+
var classes = useStyles({
|
|
27
|
+
column: column
|
|
28
|
+
});
|
|
29
|
+
return /*#__PURE__*/React.createElement(TableCell, {
|
|
30
|
+
key: column.id,
|
|
31
|
+
classes: classes,
|
|
32
|
+
align: (_column$textAlign = column.textAlign) !== null && _column$textAlign !== void 0 ? _column$textAlign : 'left',
|
|
33
|
+
padding: column.disablePadding ? 'none' : 'normal',
|
|
34
|
+
sortDirection: orderBy === column.id ? order : false
|
|
35
|
+
}, column.sortable !== false ? /*#__PURE__*/React.createElement(TableSortLabel, {
|
|
36
|
+
active: orderBy === column.id,
|
|
37
|
+
direction: orderBy === column.id ? order : 'asc',
|
|
38
|
+
onClick: onClick
|
|
39
|
+
}, column.label, orderBy === column.id && /*#__PURE__*/React.createElement("span", {
|
|
40
|
+
className: className
|
|
41
|
+
}, order === 'desc' ? 'sorted descending' : 'sorted ascending')) : column.label);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export default TableHeadCell;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare var _default: React.MemoExoticComponent<({ index, row, columns, isSelectedItem, children, onSelectClick }: {
|
|
2
|
+
index: any;
|
|
3
|
+
row: any;
|
|
4
|
+
columns: any;
|
|
5
|
+
isSelectedItem: any;
|
|
6
|
+
children: any;
|
|
7
|
+
onSelectClick: any;
|
|
8
|
+
}) => JSX.Element>;
|
|
9
|
+
export default _default;
|
|
10
|
+
import React from "react";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Cell from "cozy-ui/transpiled/react/Table/Virtualized/Cell";
|
|
3
|
+
import Checkbox from "cozy-ui/transpiled/react/Checkbox";
|
|
4
|
+
import TableCell from "cozy-ui/transpiled/react/TableCell";
|
|
5
|
+
|
|
6
|
+
var RowContent = function RowContent(_ref) {
|
|
7
|
+
var index = _ref.index,
|
|
8
|
+
row = _ref.row,
|
|
9
|
+
columns = _ref.columns,
|
|
10
|
+
isSelectedItem = _ref.isSelectedItem,
|
|
11
|
+
children = _ref.children,
|
|
12
|
+
onSelectClick = _ref.onSelectClick;
|
|
13
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TableCell, {
|
|
14
|
+
align: "center",
|
|
15
|
+
padding: "checkbox"
|
|
16
|
+
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
17
|
+
checked: isSelectedItem(row),
|
|
18
|
+
inputProps: {
|
|
19
|
+
'aria-labelledby': "enhanced-table-checkbox-".concat(index)
|
|
20
|
+
},
|
|
21
|
+
onChange: function onChange() {
|
|
22
|
+
return onSelectClick(row);
|
|
23
|
+
}
|
|
24
|
+
})), columns.map(function (column) {
|
|
25
|
+
return /*#__PURE__*/React.createElement(Cell, {
|
|
26
|
+
key: column.id,
|
|
27
|
+
row: row,
|
|
28
|
+
columns: columns,
|
|
29
|
+
column: column
|
|
30
|
+
}, children);
|
|
31
|
+
}));
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export default /*#__PURE__*/React.memo(RowContent);
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var descendingComparator = function descendingComparator(_ref) {
|
|
2
|
+
var a = _ref.a,
|
|
3
|
+
b = _ref.b,
|
|
4
|
+
order = _ref.order,
|
|
5
|
+
orderBy = _ref.orderBy,
|
|
6
|
+
lang = _ref.lang;
|
|
7
|
+
var aValue = a[orderBy];
|
|
8
|
+
var bValue = b[orderBy];
|
|
9
|
+
|
|
10
|
+
if (typeof aValue === 'string') {
|
|
11
|
+
var isDate = /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}/.test(aValue);
|
|
12
|
+
var isNumber = !isNaN(parseInt(aValue));
|
|
13
|
+
|
|
14
|
+
if (isDate) {
|
|
15
|
+
return new Date(bValue) - new Date(aValue);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (isNumber) {
|
|
19
|
+
return parseInt(bValue) - parseInt(aValue);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
var _Intl$Collator = Intl.Collator(lang || 'en', {
|
|
23
|
+
caseFirst: order === 'asc' ? 'upper' : 'lower'
|
|
24
|
+
}),
|
|
25
|
+
compare = _Intl$Collator.compare;
|
|
26
|
+
|
|
27
|
+
return compare(bValue, aValue);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return bValue - aValue;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export var getComparator = function getComparator(order, orderBy, lang) {
|
|
34
|
+
return order === 'desc' ? function (a, b) {
|
|
35
|
+
return descendingComparator({
|
|
36
|
+
a: a,
|
|
37
|
+
b: b,
|
|
38
|
+
order: order,
|
|
39
|
+
orderBy: orderBy,
|
|
40
|
+
lang: lang
|
|
41
|
+
});
|
|
42
|
+
} : function (a, b) {
|
|
43
|
+
return -descendingComparator({
|
|
44
|
+
a: a,
|
|
45
|
+
b: b,
|
|
46
|
+
order: order,
|
|
47
|
+
orderBy: orderBy,
|
|
48
|
+
lang: lang
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
export var stableSort = function stableSort(array, comparator) {
|
|
53
|
+
var stabilizedThis = array.map(function (el, index) {
|
|
54
|
+
return [el, index];
|
|
55
|
+
});
|
|
56
|
+
stabilizedThis.sort(function (a, b) {
|
|
57
|
+
var order = comparator(a[0], b[0]);
|
|
58
|
+
if (order !== 0) return order;
|
|
59
|
+
return a[1] - b[1];
|
|
60
|
+
});
|
|
61
|
+
return stabilizedThis.map(function (el) {
|
|
62
|
+
return el[0];
|
|
63
|
+
});
|
|
64
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["rows", "columns", "defaultOrder", "secondarySort", "selectedItems", "onSelect", "onSelectAll", "isSelectedItem", "componentsProps", "dragProps"];
|
|
5
|
+
import React, { useState, forwardRef } from 'react';
|
|
6
|
+
import { TableVirtuoso } from 'react-virtuoso';
|
|
7
|
+
import CustomDragLayer from "cozy-ui/transpiled/react/Table/Virtualized/Dnd/CustomDrag/CustomDragLayer";
|
|
8
|
+
import FixedHeaderContent from "cozy-ui/transpiled/react/Table/Virtualized/FixedHeaderContent";
|
|
9
|
+
import RowContent from "cozy-ui/transpiled/react/Table/Virtualized/RowContent";
|
|
10
|
+
import { stableSort, getComparator } from "cozy-ui/transpiled/react/Table/Virtualized/helpers";
|
|
11
|
+
import virtuosoComponents from "cozy-ui/transpiled/react/Table/Virtualized/virtuosoComponents";
|
|
12
|
+
var VirtualizedTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
13
|
+
var rows = _ref.rows,
|
|
14
|
+
columns = _ref.columns,
|
|
15
|
+
defaultOrder = _ref.defaultOrder,
|
|
16
|
+
secondarySort = _ref.secondarySort,
|
|
17
|
+
_ref$selectedItems = _ref.selectedItems,
|
|
18
|
+
selectedItems = _ref$selectedItems === void 0 ? [] : _ref$selectedItems,
|
|
19
|
+
_ref$onSelect = _ref.onSelect,
|
|
20
|
+
onSelect = _ref$onSelect === void 0 ? function () {} : _ref$onSelect,
|
|
21
|
+
_ref$onSelectAll = _ref.onSelectAll,
|
|
22
|
+
onSelectAll = _ref$onSelectAll === void 0 ? function () {} : _ref$onSelectAll,
|
|
23
|
+
_ref$isSelectedItem = _ref.isSelectedItem,
|
|
24
|
+
isSelectedItem = _ref$isSelectedItem === void 0 ? function () {} : _ref$isSelectedItem,
|
|
25
|
+
componentsProps = _ref.componentsProps,
|
|
26
|
+
dragProps = _ref.dragProps,
|
|
27
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
28
|
+
|
|
29
|
+
var _useState = useState('asc'),
|
|
30
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
+
order = _useState2[0],
|
|
32
|
+
setOrder = _useState2[1];
|
|
33
|
+
|
|
34
|
+
var _useState3 = useState(defaultOrder),
|
|
35
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
36
|
+
orderBy = _useState4[0],
|
|
37
|
+
setOrderBy = _useState4[1];
|
|
38
|
+
|
|
39
|
+
var _useState5 = useState([]),
|
|
40
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
41
|
+
itemsInDropProcess = _useState6[0],
|
|
42
|
+
setItemsInDropProcess = _useState6[1]; // array of Ids, for dragndrop feature
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
var sortedData = stableSort(rows, getComparator(order, orderBy));
|
|
46
|
+
var data = secondarySort ? secondarySort(sortedData) : sortedData;
|
|
47
|
+
|
|
48
|
+
var handleSort = function handleSort(property) {
|
|
49
|
+
var isAsc = orderBy === property && order === 'asc';
|
|
50
|
+
setOrder(isAsc ? 'desc' : 'asc');
|
|
51
|
+
setOrderBy(property);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
var handleSelectAll = function handleSelectAll(event) {
|
|
55
|
+
var _event$target;
|
|
56
|
+
|
|
57
|
+
if (event !== null && event !== void 0 && (_event$target = event.target) !== null && _event$target !== void 0 && _event$target.checked) {
|
|
58
|
+
onSelectAll(rows);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
onSelectAll([]);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
return /*#__PURE__*/React.createElement(TableVirtuoso, _extends({}, props, {
|
|
66
|
+
ref: ref,
|
|
67
|
+
data: data,
|
|
68
|
+
context: {
|
|
69
|
+
isSelectedItem: isSelectedItem,
|
|
70
|
+
selectedItems: selectedItems,
|
|
71
|
+
dragProps: dragProps,
|
|
72
|
+
itemsInDropProcess: itemsInDropProcess,
|
|
73
|
+
setItemsInDropProcess: setItemsInDropProcess
|
|
74
|
+
},
|
|
75
|
+
components: virtuosoComponents,
|
|
76
|
+
fixedHeaderContent: function fixedHeaderContent() {
|
|
77
|
+
return /*#__PURE__*/React.createElement(FixedHeaderContent, {
|
|
78
|
+
columns: columns,
|
|
79
|
+
rowCount: rows.length,
|
|
80
|
+
selectedCount: selectedItems.length,
|
|
81
|
+
order: order,
|
|
82
|
+
orderBy: orderBy,
|
|
83
|
+
onClick: handleSort,
|
|
84
|
+
onSelectAllClick: handleSelectAll
|
|
85
|
+
});
|
|
86
|
+
},
|
|
87
|
+
itemContent: function itemContent(_index, row) {
|
|
88
|
+
var _componentsProps$rowC;
|
|
89
|
+
|
|
90
|
+
return /*#__PURE__*/React.createElement(RowContent, {
|
|
91
|
+
index: _index,
|
|
92
|
+
row: row,
|
|
93
|
+
columns: columns,
|
|
94
|
+
isSelectedItem: isSelectedItem,
|
|
95
|
+
onSelectClick: onSelect
|
|
96
|
+
}, componentsProps === null || componentsProps === void 0 ? void 0 : (_componentsProps$rowC = componentsProps.rowContent) === null || _componentsProps$rowC === void 0 ? void 0 : _componentsProps$rowC.children);
|
|
97
|
+
},
|
|
98
|
+
rowSpan: 2
|
|
99
|
+
}));
|
|
100
|
+
});
|
|
101
|
+
VirtualizedTable.displayName = 'VirtualizedTable';
|
|
102
|
+
|
|
103
|
+
var VirtuosoTableWrapper = function VirtuosoTableWrapper(props) {
|
|
104
|
+
var _props$dragProps;
|
|
105
|
+
|
|
106
|
+
if (!((_props$dragProps = props.dragProps) !== null && _props$dragProps !== void 0 && _props$dragProps.enabled)) {
|
|
107
|
+
return /*#__PURE__*/React.createElement(VirtualizedTable, props);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CustomDragLayer, {
|
|
111
|
+
dragId: props.dragProps.dragId
|
|
112
|
+
}), /*#__PURE__*/React.createElement(VirtualizedTable, props));
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export default VirtuosoTableWrapper;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default virtuosoComponents;
|
|
2
|
+
declare namespace virtuosoComponents {
|
|
3
|
+
const Scroller: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
|
|
4
|
+
const Table: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
|
|
5
|
+
const TableHead: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
|
|
6
|
+
const TableBody: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
|
|
7
|
+
const TableFooter: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
|
|
8
|
+
const TableRow: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
|
|
9
|
+
}
|
|
10
|
+
import React from "react";
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
+
var _excluded = ["context"],
|
|
5
|
+
_excluded2 = ["item", "context"];
|
|
6
|
+
|
|
7
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8
|
+
|
|
9
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10
|
+
|
|
11
|
+
import React, { forwardRef } from 'react';
|
|
12
|
+
import DnDConfigWrapper from "cozy-ui/transpiled/react/Table/Virtualized/Dnd/DnDConfigWrapper";
|
|
13
|
+
import TableRowDnD from "cozy-ui/transpiled/react/Table/Virtualized/Dnd/TableRow";
|
|
14
|
+
import Table from "cozy-ui/transpiled/react/Table";
|
|
15
|
+
import Paper from "cozy-ui/transpiled/react/Paper";
|
|
16
|
+
import TableBody from "cozy-ui/transpiled/react/TableBody";
|
|
17
|
+
import TableContainer from "cozy-ui/transpiled/react/TableContainer";
|
|
18
|
+
import TableFooter from "cozy-ui/transpiled/react/TableFooter";
|
|
19
|
+
import TableHead from "cozy-ui/transpiled/react/TableHead";
|
|
20
|
+
import TableRow from "cozy-ui/transpiled/react/TableRow";
|
|
21
|
+
|
|
22
|
+
var _TableContainer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
23
|
+
return /*#__PURE__*/React.createElement(TableContainer, _extends({}, props, {
|
|
24
|
+
ref: ref,
|
|
25
|
+
component: Paper,
|
|
26
|
+
style: _objectSpread({
|
|
27
|
+
zIndex: 'var(--zIndex-app)'
|
|
28
|
+
}, props.style),
|
|
29
|
+
elevation: 0
|
|
30
|
+
}));
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
_TableContainer.displayName = '_TableContainer';
|
|
34
|
+
var virtuosoComponents = {
|
|
35
|
+
Scroller: /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
36
|
+
var _context$dragProps;
|
|
37
|
+
|
|
38
|
+
var context = _ref.context,
|
|
39
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
40
|
+
|
|
41
|
+
if (!((_context$dragProps = context.dragProps) !== null && _context$dragProps !== void 0 && _context$dragProps.enabled)) {
|
|
42
|
+
return /*#__PURE__*/React.createElement(_TableContainer, _extends({}, props, {
|
|
43
|
+
ref: ref
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return /*#__PURE__*/React.createElement(DnDConfigWrapper, {
|
|
48
|
+
ref: ref
|
|
49
|
+
}, /*#__PURE__*/React.createElement(_TableContainer, _extends({}, props, {
|
|
50
|
+
ref: ref
|
|
51
|
+
})));
|
|
52
|
+
}),
|
|
53
|
+
Table: /*#__PURE__*/forwardRef(function (props, ref) {
|
|
54
|
+
return /*#__PURE__*/React.createElement(Table, _extends({}, props, {
|
|
55
|
+
ref: ref
|
|
56
|
+
}));
|
|
57
|
+
}),
|
|
58
|
+
TableHead: /*#__PURE__*/forwardRef(function (props, ref) {
|
|
59
|
+
return /*#__PURE__*/React.createElement(TableHead, _extends({}, props, {
|
|
60
|
+
ref: ref
|
|
61
|
+
}));
|
|
62
|
+
}),
|
|
63
|
+
TableBody: /*#__PURE__*/forwardRef(function (props, ref) {
|
|
64
|
+
return /*#__PURE__*/React.createElement(TableBody, _extends({}, props, {
|
|
65
|
+
ref: ref
|
|
66
|
+
}));
|
|
67
|
+
}),
|
|
68
|
+
TableFooter: /*#__PURE__*/forwardRef(function (props, ref) {
|
|
69
|
+
return /*#__PURE__*/React.createElement(TableFooter, _extends({}, props, {
|
|
70
|
+
ref: ref
|
|
71
|
+
}));
|
|
72
|
+
}),
|
|
73
|
+
TableRow: /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
74
|
+
var _context$dragProps2;
|
|
75
|
+
|
|
76
|
+
var item = _ref2.item,
|
|
77
|
+
context = _ref2.context,
|
|
78
|
+
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
79
|
+
|
|
80
|
+
var isSelected = context === null || context === void 0 ? void 0 : context.isSelectedItem(item);
|
|
81
|
+
var isDisabled = context === null || context === void 0 ? void 0 : context.itemsInDropProcess.includes(item._id);
|
|
82
|
+
|
|
83
|
+
if (!((_context$dragProps2 = context.dragProps) !== null && _context$dragProps2 !== void 0 && _context$dragProps2.enabled)) {
|
|
84
|
+
return /*#__PURE__*/React.createElement(TableRow, _extends({}, props, {
|
|
85
|
+
ref: ref,
|
|
86
|
+
selected: isSelected,
|
|
87
|
+
hover: true
|
|
88
|
+
}));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return /*#__PURE__*/React.createElement(TableRowDnD, _extends({}, props, {
|
|
92
|
+
item: item,
|
|
93
|
+
context: context,
|
|
94
|
+
selected: isSelected,
|
|
95
|
+
disabled: isDisabled,
|
|
96
|
+
hover: true
|
|
97
|
+
}));
|
|
98
|
+
})
|
|
99
|
+
};
|
|
100
|
+
export default virtuosoComponents;
|
|
@@ -1,2 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["disabled", "className"];
|
|
4
|
+
import MuiTableRow from '@material-ui/core/TableRow';
|
|
5
|
+
import cx from 'classnames';
|
|
6
|
+
import React, { forwardRef } from 'react';
|
|
7
|
+
var TableRow = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
8
|
+
var disabled = _ref.disabled,
|
|
9
|
+
className = _ref.className,
|
|
10
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
11
|
+
|
|
12
|
+
return /*#__PURE__*/React.createElement(MuiTableRow, _extends({}, props, {
|
|
13
|
+
className: cx(className, {
|
|
14
|
+
disabled: disabled
|
|
15
|
+
}),
|
|
16
|
+
disabled: disabled,
|
|
17
|
+
ref: ref
|
|
18
|
+
}));
|
|
19
|
+
});
|
|
20
|
+
TableRow.displayName = 'TableRow';
|
|
2
21
|
export default TableRow;
|