cozy-ui 135.7.0 → 136.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 +24 -0
- package/package.json +1 -1
- package/react/MuiCozyTheme/makePalette.js +4 -4
- package/react/Table/Readme.md +8 -2
- package/react/Table/Virtualized/RowContent.jsx +2 -0
- package/react/Table/Virtualized/TableRow.jsx +0 -8
- package/react/Table/Virtualized/index.jsx +6 -0
- package/transpiled/react/MuiCozyTheme/makePalette.js +4 -4
- package/transpiled/react/Table/Virtualized/RowContent.d.ts +2 -1
- package/transpiled/react/Table/Virtualized/RowContent.js +2 -0
- package/transpiled/react/Table/Virtualized/TableRow.js +1 -12
- package/transpiled/react/Table/Virtualized/index.js +9 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
# [136.0.0](https://github.com/cozy/cozy-ui/compare/v135.8.0...v136.0.0) (2026-02-04)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **Table:** Remove implicit selection on click when `withCheckbox` false ([f972ce8](https://github.com/cozy/cozy-ui/commit/f972ce8))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **Table:** Add `disableCheckbox` prop ([726a235](https://github.com/cozy/cozy-ui/commit/726a235))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### BREAKING CHANGES
|
|
15
|
+
|
|
16
|
+
* **Table:** You must now use `componentsProps.rowContent.onClick` prop to use selection on click
|
|
17
|
+
|
|
18
|
+
# [135.8.0](https://github.com/cozy/cozy-ui/compare/v135.7.0...v135.8.0) (2026-02-02)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* Change selected items opacity ([e4cfe52](https://github.com/cozy/cozy-ui/commit/e4cfe52))
|
|
24
|
+
|
|
1
25
|
# [135.7.0](https://github.com/cozy/cozy-ui/compare/v135.6.0...v135.7.0) (2026-02-02)
|
|
2
26
|
|
|
3
27
|
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@ const opacityByTheme = {
|
|
|
7
7
|
normal: {
|
|
8
8
|
action: {
|
|
9
9
|
hoverOpacity: 0.04,
|
|
10
|
-
selectedOpacity: 0.
|
|
10
|
+
selectedOpacity: 0.18,
|
|
11
11
|
disabledOpacity: 0.32,
|
|
12
12
|
focusOpacity: 0.12,
|
|
13
13
|
activatedOpacity: 0.12,
|
|
@@ -25,7 +25,7 @@ const opacityByTheme = {
|
|
|
25
25
|
inverted: {
|
|
26
26
|
action: {
|
|
27
27
|
hoverOpacity: 0.08,
|
|
28
|
-
selectedOpacity: 0.
|
|
28
|
+
selectedOpacity: 0.18,
|
|
29
29
|
disabledOpacity: 0.32,
|
|
30
30
|
focusOpacity: 0.25,
|
|
31
31
|
activatedOpacity: 0.24,
|
|
@@ -45,7 +45,7 @@ const opacityByTheme = {
|
|
|
45
45
|
normal: {
|
|
46
46
|
action: {
|
|
47
47
|
hoverOpacity: 0.08,
|
|
48
|
-
selectedOpacity: 0.
|
|
48
|
+
selectedOpacity: 0.18,
|
|
49
49
|
disabledOpacity: 0.32,
|
|
50
50
|
focusOpacity: 0.24,
|
|
51
51
|
activatedOpacity: 0.24,
|
|
@@ -63,7 +63,7 @@ const opacityByTheme = {
|
|
|
63
63
|
inverted: {
|
|
64
64
|
action: {
|
|
65
65
|
hoverOpacity: 0.04,
|
|
66
|
-
selectedOpacity: 0.
|
|
66
|
+
selectedOpacity: 0.18,
|
|
67
67
|
disabledOpacity: 0.32,
|
|
68
68
|
focusOpacity: 0.12,
|
|
69
69
|
activatedOpacity: 0.12,
|
package/react/Table/Readme.md
CHANGED
|
@@ -96,12 +96,18 @@ const ExampleTable = ({ variant, ...props }) => {
|
|
|
96
96
|
selectedItems={selectedItemsId}
|
|
97
97
|
isSelectedItem={row => isSelectedItem(row.id)}
|
|
98
98
|
onSelect={(row, event, index) => toggleSelectedItem(row.id)}
|
|
99
|
-
onSelectAll={rows => toggleSelectAllItems(rows.map(item => item.id))}
|
|
99
|
+
onSelectAll={rows => toggleSelectAllItems(rows.map(item => item.id !== 1 ? item.id : undefined))}
|
|
100
100
|
onSortChange={onSortChange}
|
|
101
101
|
withCheckbox={variant.withCheckbox}
|
|
102
102
|
componentsProps={{
|
|
103
103
|
rowContent: {
|
|
104
|
-
|
|
104
|
+
disableCheckbox: row => row.id === 1,
|
|
105
|
+
onClick: (row, column) => {
|
|
106
|
+
if (!variant.withCheckbox) {
|
|
107
|
+
return toggleSelectedItem(row.id)
|
|
108
|
+
}
|
|
109
|
+
console.info(`click on cell. Row ${row['id']}, Column ${column['id']}`)
|
|
110
|
+
},
|
|
105
111
|
onLongPress: (row, column) => { console.info(`long press on cell. Row ${row['id']}, Column ${column['id']}`) },
|
|
106
112
|
},
|
|
107
113
|
}}
|
|
@@ -11,6 +11,7 @@ const RowContent = ({
|
|
|
11
11
|
columns,
|
|
12
12
|
context,
|
|
13
13
|
children,
|
|
14
|
+
disableCheckbox,
|
|
14
15
|
onSelectClick,
|
|
15
16
|
onLongPress,
|
|
16
17
|
onClick
|
|
@@ -26,6 +27,7 @@ const RowContent = ({
|
|
|
26
27
|
visible: selectedCount > 0,
|
|
27
28
|
checked: context.isSelectedItem(row)
|
|
28
29
|
})}
|
|
30
|
+
disabled={disableCheckbox?.(row)}
|
|
29
31
|
checked={context.isSelectedItem(row)}
|
|
30
32
|
inputProps={{
|
|
31
33
|
'aria-labelledby': `enhanced-table-checkbox-${index}`
|
|
@@ -7,20 +7,12 @@ const TableRow = ({ item, context, className, ...props }) => {
|
|
|
7
7
|
const _item = item || context.data[props['data-item-index']]
|
|
8
8
|
const isSelected = context.isSelectedItem(_item)
|
|
9
9
|
|
|
10
|
-
const handleClick = () => {
|
|
11
|
-
if (!context.withCheckbox && _item) {
|
|
12
|
-
const index = props['data-item-index']
|
|
13
|
-
context.onSelect?.(_item, null, index)
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
10
|
return (
|
|
18
11
|
<TableRowClassic
|
|
19
12
|
{...props}
|
|
20
13
|
className={cx(className, 'virtualized')}
|
|
21
14
|
selected={isSelected}
|
|
22
15
|
hover
|
|
23
|
-
onClick={!context.withCheckbox ? handleClick : props.onClick}
|
|
24
16
|
/>
|
|
25
17
|
)
|
|
26
18
|
}
|
|
@@ -136,6 +136,12 @@ VirtualizedTable.propTypes = {
|
|
|
136
136
|
direction: PropTypes.oneOf(['asc', 'desc']),
|
|
137
137
|
by: PropTypes.string
|
|
138
138
|
}),
|
|
139
|
+
/** Context object passed down to children and virtuoso */
|
|
140
|
+
context: PropTypes.object,
|
|
141
|
+
/** Props passed to child components */
|
|
142
|
+
componentsProps: PropTypes.object,
|
|
143
|
+
/** Custom components used by react-virtuoso */
|
|
144
|
+
components: PropTypes.object,
|
|
139
145
|
/** Sort files by type to put directory and trash before files */
|
|
140
146
|
secondarySort: PropTypes.func,
|
|
141
147
|
/** Array of selected items */
|
|
@@ -5,7 +5,7 @@ var opacityByTheme = {
|
|
|
5
5
|
normal: {
|
|
6
6
|
action: {
|
|
7
7
|
hoverOpacity: 0.04,
|
|
8
|
-
selectedOpacity: 0.
|
|
8
|
+
selectedOpacity: 0.18,
|
|
9
9
|
disabledOpacity: 0.32,
|
|
10
10
|
focusOpacity: 0.12,
|
|
11
11
|
activatedOpacity: 0.12,
|
|
@@ -23,7 +23,7 @@ var opacityByTheme = {
|
|
|
23
23
|
inverted: {
|
|
24
24
|
action: {
|
|
25
25
|
hoverOpacity: 0.08,
|
|
26
|
-
selectedOpacity: 0.
|
|
26
|
+
selectedOpacity: 0.18,
|
|
27
27
|
disabledOpacity: 0.32,
|
|
28
28
|
focusOpacity: 0.25,
|
|
29
29
|
activatedOpacity: 0.24,
|
|
@@ -43,7 +43,7 @@ var opacityByTheme = {
|
|
|
43
43
|
normal: {
|
|
44
44
|
action: {
|
|
45
45
|
hoverOpacity: 0.08,
|
|
46
|
-
selectedOpacity: 0.
|
|
46
|
+
selectedOpacity: 0.18,
|
|
47
47
|
disabledOpacity: 0.32,
|
|
48
48
|
focusOpacity: 0.24,
|
|
49
49
|
activatedOpacity: 0.24,
|
|
@@ -61,7 +61,7 @@ var opacityByTheme = {
|
|
|
61
61
|
inverted: {
|
|
62
62
|
action: {
|
|
63
63
|
hoverOpacity: 0.04,
|
|
64
|
-
selectedOpacity: 0.
|
|
64
|
+
selectedOpacity: 0.18,
|
|
65
65
|
disabledOpacity: 0.32,
|
|
66
66
|
focusOpacity: 0.12,
|
|
67
67
|
activatedOpacity: 0.12,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
declare var _default: React.MemoExoticComponent<({ index, row, columns, context, children, onSelectClick, onLongPress, onClick }: {
|
|
1
|
+
declare var _default: React.MemoExoticComponent<({ index, row, columns, context, children, disableCheckbox, onSelectClick, onLongPress, onClick }: {
|
|
2
2
|
index: any;
|
|
3
3
|
row: any;
|
|
4
4
|
columns: any;
|
|
5
5
|
context: any;
|
|
6
6
|
children: any;
|
|
7
|
+
disableCheckbox: any;
|
|
7
8
|
onSelectClick: any;
|
|
8
9
|
onLongPress: any;
|
|
9
10
|
onClick: any;
|
|
@@ -10,6 +10,7 @@ var RowContent = function RowContent(_ref) {
|
|
|
10
10
|
columns = _ref.columns,
|
|
11
11
|
context = _ref.context,
|
|
12
12
|
children = _ref.children,
|
|
13
|
+
disableCheckbox = _ref.disableCheckbox,
|
|
13
14
|
onSelectClick = _ref.onSelectClick,
|
|
14
15
|
onLongPress = _ref.onLongPress,
|
|
15
16
|
onClick = _ref.onClick;
|
|
@@ -22,6 +23,7 @@ var RowContent = function RowContent(_ref) {
|
|
|
22
23
|
visible: selectedCount > 0,
|
|
23
24
|
checked: context.isSelectedItem(row)
|
|
24
25
|
}),
|
|
26
|
+
disabled: disableCheckbox === null || disableCheckbox === void 0 ? void 0 : disableCheckbox(row),
|
|
25
27
|
checked: context.isSelectedItem(row),
|
|
26
28
|
inputProps: {
|
|
27
29
|
'aria-labelledby': "enhanced-table-checkbox-".concat(index)
|
|
@@ -14,21 +14,10 @@ var TableRow = function TableRow(_ref) {
|
|
|
14
14
|
var _item = item || context.data[props['data-item-index']];
|
|
15
15
|
|
|
16
16
|
var isSelected = context.isSelectedItem(_item);
|
|
17
|
-
|
|
18
|
-
var handleClick = function handleClick() {
|
|
19
|
-
if (!context.withCheckbox && _item) {
|
|
20
|
-
var _context$onSelect;
|
|
21
|
-
|
|
22
|
-
var index = props['data-item-index'];
|
|
23
|
-
(_context$onSelect = context.onSelect) === null || _context$onSelect === void 0 ? void 0 : _context$onSelect.call(context, _item, null, index);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
|
|
27
17
|
return /*#__PURE__*/React.createElement(TableRowClassic, _extends({}, props, {
|
|
28
18
|
className: cx(className, 'virtualized'),
|
|
29
19
|
selected: isSelected,
|
|
30
|
-
hover: true
|
|
31
|
-
onClick: !context.withCheckbox ? handleClick : props.onClick
|
|
20
|
+
hover: true
|
|
32
21
|
}));
|
|
33
22
|
};
|
|
34
23
|
|
|
@@ -152,6 +152,15 @@ VirtualizedTable.propTypes = {
|
|
|
152
152
|
by: PropTypes.string
|
|
153
153
|
}),
|
|
154
154
|
|
|
155
|
+
/** Context object passed down to children and virtuoso */
|
|
156
|
+
context: PropTypes.object,
|
|
157
|
+
|
|
158
|
+
/** Props passed to child components */
|
|
159
|
+
componentsProps: PropTypes.object,
|
|
160
|
+
|
|
161
|
+
/** Custom components used by react-virtuoso */
|
|
162
|
+
components: PropTypes.object,
|
|
163
|
+
|
|
155
164
|
/** Sort files by type to put directory and trash before files */
|
|
156
165
|
secondarySort: PropTypes.func,
|
|
157
166
|
|