cozy-ui 126.3.0 → 126.5.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 +19 -0
- package/package.json +1 -1
- package/react/Table/Virtualized/index.jsx +24 -12
- package/react/Table/Virtualized/virtuosoComponents.jsx +17 -17
- package/transpiled/react/Table/Virtualized/index.js +30 -20
- package/transpiled/react/Table/Virtualized/virtuosoComponents.js +14 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
# [126.5.0](https://github.com/cozy/cozy-ui/compare/v126.4.0...v126.5.0) (2025-06-19)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **VirtualizedTable:** Remove using react suspense ([a1f8030](https://github.com/cozy/cozy-ui/commit/a1f8030))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **VirtualizedTable:** Add some prop spread to better give controls ([4b080e6](https://github.com/cozy/cozy-ui/commit/4b080e6))
|
|
12
|
+
|
|
13
|
+
# [126.4.0](https://github.com/cozy/cozy-ui/compare/v126.3.0...v126.4.0) (2025-06-17)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* **VirtualizedTable:** Lazy load dragndrop components ([620846e](https://github.com/cozy/cozy-ui/commit/620846e))
|
|
19
|
+
|
|
1
20
|
# [126.3.0](https://github.com/cozy/cozy-ui/compare/v126.2.0...v126.3.0) (2025-06-17)
|
|
2
21
|
|
|
3
22
|
|
package/package.json
CHANGED
|
@@ -14,12 +14,14 @@ const VirtualizedTable = forwardRef(
|
|
|
14
14
|
columns,
|
|
15
15
|
defaultOrder,
|
|
16
16
|
secondarySort,
|
|
17
|
-
selectedItems
|
|
18
|
-
onSelect
|
|
19
|
-
onSelectAll
|
|
20
|
-
isSelectedItem
|
|
17
|
+
selectedItems,
|
|
18
|
+
onSelect,
|
|
19
|
+
onSelectAll,
|
|
20
|
+
isSelectedItem,
|
|
21
21
|
componentsProps,
|
|
22
22
|
dragProps,
|
|
23
|
+
context,
|
|
24
|
+
components,
|
|
23
25
|
...props
|
|
24
26
|
},
|
|
25
27
|
ref
|
|
@@ -51,15 +53,17 @@ const VirtualizedTable = forwardRef(
|
|
|
51
53
|
ref={ref}
|
|
52
54
|
data={data}
|
|
53
55
|
context={{
|
|
56
|
+
...context,
|
|
54
57
|
isSelectedItem,
|
|
55
58
|
selectedItems,
|
|
56
59
|
dragProps,
|
|
57
60
|
itemsInDropProcess,
|
|
58
61
|
setItemsInDropProcess
|
|
59
62
|
}}
|
|
60
|
-
components={virtuosoComponents}
|
|
63
|
+
components={components || virtuosoComponents}
|
|
61
64
|
fixedHeaderContent={() => (
|
|
62
65
|
<FixedHeaderContent
|
|
66
|
+
{...componentsProps?.FixedHeaderContent}
|
|
63
67
|
columns={columns}
|
|
64
68
|
rowCount={rows.length}
|
|
65
69
|
selectedCount={selectedItems.length}
|
|
@@ -71,6 +75,7 @@ const VirtualizedTable = forwardRef(
|
|
|
71
75
|
)}
|
|
72
76
|
itemContent={(_index, row) => (
|
|
73
77
|
<RowContent
|
|
78
|
+
{...componentsProps?.RowContent}
|
|
74
79
|
index={_index}
|
|
75
80
|
row={row}
|
|
76
81
|
columns={columns}
|
|
@@ -88,17 +93,24 @@ const VirtualizedTable = forwardRef(
|
|
|
88
93
|
|
|
89
94
|
VirtualizedTable.displayName = 'VirtualizedTable'
|
|
90
95
|
|
|
96
|
+
VirtualizedTable.defaultProps = {
|
|
97
|
+
selectedItems: [],
|
|
98
|
+
isSelectedItem: () => {},
|
|
99
|
+
onSelect: () => {},
|
|
100
|
+
onSelectAll: () => {}
|
|
101
|
+
}
|
|
102
|
+
|
|
91
103
|
const VirtuosoTableWrapper = props => {
|
|
92
104
|
if (!props.dragProps?.enabled) {
|
|
93
105
|
return <VirtualizedTable {...props} />
|
|
106
|
+
} else {
|
|
107
|
+
return (
|
|
108
|
+
<>
|
|
109
|
+
<CustomDragLayer dragId={props.dragProps.dragId} />
|
|
110
|
+
<VirtualizedTable {...props} />
|
|
111
|
+
</>
|
|
112
|
+
)
|
|
94
113
|
}
|
|
95
|
-
|
|
96
|
-
return (
|
|
97
|
-
<>
|
|
98
|
-
<CustomDragLayer dragId={props.dragProps.dragId} />
|
|
99
|
-
<VirtualizedTable {...props} />
|
|
100
|
-
</>
|
|
101
|
-
)
|
|
102
114
|
}
|
|
103
115
|
|
|
104
116
|
export default VirtuosoTableWrapper
|
|
@@ -25,13 +25,13 @@ const virtuosoComponents = {
|
|
|
25
25
|
Scroller: forwardRef(({ context, ...props }, ref) => {
|
|
26
26
|
if (!context.dragProps?.enabled) {
|
|
27
27
|
return <_TableContainer {...props} ref={ref} />
|
|
28
|
+
} else {
|
|
29
|
+
return (
|
|
30
|
+
<DnDConfigWrapper ref={ref}>
|
|
31
|
+
<_TableContainer {...props} ref={ref} />
|
|
32
|
+
</DnDConfigWrapper>
|
|
33
|
+
)
|
|
28
34
|
}
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<DnDConfigWrapper ref={ref}>
|
|
32
|
-
<_TableContainer {...props} ref={ref} />
|
|
33
|
-
</DnDConfigWrapper>
|
|
34
|
-
)
|
|
35
35
|
}),
|
|
36
36
|
Table: forwardRef((props, ref) => <Table {...props} ref={ref} />),
|
|
37
37
|
TableHead: forwardRef((props, ref) => <TableHead {...props} ref={ref} />),
|
|
@@ -43,18 +43,18 @@ const virtuosoComponents = {
|
|
|
43
43
|
|
|
44
44
|
if (!context.dragProps?.enabled) {
|
|
45
45
|
return <TableRow {...props} ref={ref} selected={isSelected} hover />
|
|
46
|
+
} else {
|
|
47
|
+
return (
|
|
48
|
+
<TableRowDnD
|
|
49
|
+
{...props}
|
|
50
|
+
item={item}
|
|
51
|
+
context={context}
|
|
52
|
+
selected={isSelected}
|
|
53
|
+
disabled={isDisabled}
|
|
54
|
+
hover
|
|
55
|
+
/>
|
|
56
|
+
)
|
|
46
57
|
}
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
<TableRowDnD
|
|
50
|
-
{...props}
|
|
51
|
-
item={item}
|
|
52
|
-
context={context}
|
|
53
|
-
selected={isSelected}
|
|
54
|
-
disabled={isDisabled}
|
|
55
|
-
hover
|
|
56
|
-
/>
|
|
57
|
-
)
|
|
58
58
|
})
|
|
59
59
|
}
|
|
60
60
|
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["rows", "columns", "defaultOrder", "secondarySort", "selectedItems", "onSelect", "onSelectAll", "isSelectedItem", "componentsProps", "dragProps"];
|
|
5
|
+
var _excluded = ["rows", "columns", "defaultOrder", "secondarySort", "selectedItems", "onSelect", "onSelectAll", "isSelectedItem", "componentsProps", "dragProps", "context", "components"];
|
|
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
|
+
|
|
5
11
|
import React, { useState, forwardRef } from 'react';
|
|
6
12
|
import { TableVirtuoso } from 'react-virtuoso';
|
|
7
13
|
import CustomDragLayer from "cozy-ui/transpiled/react/Table/Virtualized/Dnd/CustomDrag/CustomDragLayer";
|
|
@@ -14,16 +20,14 @@ var VirtualizedTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
14
20
|
columns = _ref.columns,
|
|
15
21
|
defaultOrder = _ref.defaultOrder,
|
|
16
22
|
secondarySort = _ref.secondarySort,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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,
|
|
23
|
+
selectedItems = _ref.selectedItems,
|
|
24
|
+
onSelect = _ref.onSelect,
|
|
25
|
+
onSelectAll = _ref.onSelectAll,
|
|
26
|
+
isSelectedItem = _ref.isSelectedItem,
|
|
25
27
|
componentsProps = _ref.componentsProps,
|
|
26
28
|
dragProps = _ref.dragProps,
|
|
29
|
+
context = _ref.context,
|
|
30
|
+
components = _ref.components,
|
|
27
31
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
28
32
|
|
|
29
33
|
var _useState = useState('asc'),
|
|
@@ -65,16 +69,16 @@ var VirtualizedTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
65
69
|
return /*#__PURE__*/React.createElement(TableVirtuoso, _extends({}, props, {
|
|
66
70
|
ref: ref,
|
|
67
71
|
data: data,
|
|
68
|
-
context: {
|
|
72
|
+
context: _objectSpread(_objectSpread({}, context), {}, {
|
|
69
73
|
isSelectedItem: isSelectedItem,
|
|
70
74
|
selectedItems: selectedItems,
|
|
71
75
|
dragProps: dragProps,
|
|
72
76
|
itemsInDropProcess: itemsInDropProcess,
|
|
73
77
|
setItemsInDropProcess: setItemsInDropProcess
|
|
74
|
-
},
|
|
75
|
-
components: virtuosoComponents,
|
|
78
|
+
}),
|
|
79
|
+
components: components || virtuosoComponents,
|
|
76
80
|
fixedHeaderContent: function fixedHeaderContent() {
|
|
77
|
-
return /*#__PURE__*/React.createElement(FixedHeaderContent, {
|
|
81
|
+
return /*#__PURE__*/React.createElement(FixedHeaderContent, _extends({}, componentsProps === null || componentsProps === void 0 ? void 0 : componentsProps.FixedHeaderContent, {
|
|
78
82
|
columns: columns,
|
|
79
83
|
rowCount: rows.length,
|
|
80
84
|
selectedCount: selectedItems.length,
|
|
@@ -82,34 +86,40 @@ var VirtualizedTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
82
86
|
orderBy: orderBy,
|
|
83
87
|
onClick: handleSort,
|
|
84
88
|
onSelectAllClick: handleSelectAll
|
|
85
|
-
});
|
|
89
|
+
}));
|
|
86
90
|
},
|
|
87
91
|
itemContent: function itemContent(_index, row) {
|
|
88
92
|
var _componentsProps$rowC;
|
|
89
93
|
|
|
90
|
-
return /*#__PURE__*/React.createElement(RowContent, {
|
|
94
|
+
return /*#__PURE__*/React.createElement(RowContent, _extends({}, componentsProps === null || componentsProps === void 0 ? void 0 : componentsProps.RowContent, {
|
|
91
95
|
index: _index,
|
|
92
96
|
row: row,
|
|
93
97
|
columns: columns,
|
|
94
98
|
isSelectedItem: isSelectedItem,
|
|
95
99
|
onSelectClick: onSelect
|
|
96
|
-
}, componentsProps === null || componentsProps === void 0 ? void 0 : (_componentsProps$rowC = componentsProps.rowContent) === null || _componentsProps$rowC === void 0 ? void 0 : _componentsProps$rowC.children);
|
|
100
|
+
}), componentsProps === null || componentsProps === void 0 ? void 0 : (_componentsProps$rowC = componentsProps.rowContent) === null || _componentsProps$rowC === void 0 ? void 0 : _componentsProps$rowC.children);
|
|
97
101
|
},
|
|
98
102
|
rowSpan: 2
|
|
99
103
|
}));
|
|
100
104
|
});
|
|
101
105
|
VirtualizedTable.displayName = 'VirtualizedTable';
|
|
106
|
+
VirtualizedTable.defaultProps = {
|
|
107
|
+
selectedItems: [],
|
|
108
|
+
isSelectedItem: function isSelectedItem() {},
|
|
109
|
+
onSelect: function onSelect() {},
|
|
110
|
+
onSelectAll: function onSelectAll() {}
|
|
111
|
+
};
|
|
102
112
|
|
|
103
113
|
var VirtuosoTableWrapper = function VirtuosoTableWrapper(props) {
|
|
104
114
|
var _props$dragProps;
|
|
105
115
|
|
|
106
116
|
if (!((_props$dragProps = props.dragProps) !== null && _props$dragProps !== void 0 && _props$dragProps.enabled)) {
|
|
107
117
|
return /*#__PURE__*/React.createElement(VirtualizedTable, props);
|
|
118
|
+
} else {
|
|
119
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CustomDragLayer, {
|
|
120
|
+
dragId: props.dragProps.dragId
|
|
121
|
+
}), /*#__PURE__*/React.createElement(VirtualizedTable, props));
|
|
108
122
|
}
|
|
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
123
|
};
|
|
114
124
|
|
|
115
125
|
export default VirtuosoTableWrapper;
|
|
@@ -42,13 +42,13 @@ var virtuosoComponents = {
|
|
|
42
42
|
return /*#__PURE__*/React.createElement(_TableContainer, _extends({}, props, {
|
|
43
43
|
ref: ref
|
|
44
44
|
}));
|
|
45
|
+
} else {
|
|
46
|
+
return /*#__PURE__*/React.createElement(DnDConfigWrapper, {
|
|
47
|
+
ref: ref
|
|
48
|
+
}, /*#__PURE__*/React.createElement(_TableContainer, _extends({}, props, {
|
|
49
|
+
ref: ref
|
|
50
|
+
})));
|
|
45
51
|
}
|
|
46
|
-
|
|
47
|
-
return /*#__PURE__*/React.createElement(DnDConfigWrapper, {
|
|
48
|
-
ref: ref
|
|
49
|
-
}, /*#__PURE__*/React.createElement(_TableContainer, _extends({}, props, {
|
|
50
|
-
ref: ref
|
|
51
|
-
})));
|
|
52
52
|
}),
|
|
53
53
|
Table: /*#__PURE__*/forwardRef(function (props, ref) {
|
|
54
54
|
return /*#__PURE__*/React.createElement(Table, _extends({}, props, {
|
|
@@ -86,15 +86,15 @@ var virtuosoComponents = {
|
|
|
86
86
|
selected: isSelected,
|
|
87
87
|
hover: true
|
|
88
88
|
}));
|
|
89
|
+
} else {
|
|
90
|
+
return /*#__PURE__*/React.createElement(TableRowDnD, _extends({}, props, {
|
|
91
|
+
item: item,
|
|
92
|
+
context: context,
|
|
93
|
+
selected: isSelected,
|
|
94
|
+
disabled: isDisabled,
|
|
95
|
+
hover: true
|
|
96
|
+
}));
|
|
89
97
|
}
|
|
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
98
|
})
|
|
99
99
|
};
|
|
100
100
|
export default virtuosoComponents;
|