cozy-ui 138.10.0 → 138.11.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
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [138.11.0](https://github.com/cozy/cozy-ui/compare/v138.10.0...v138.11.0) (2026-05-07)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **makeAction:** Add props `Component` and `componentProps` ([cebb6de](https://github.com/cozy/cozy-ui/commit/cebb6de))
|
|
7
|
+
|
|
1
8
|
# [138.10.0](https://github.com/cozy/cozy-ui/compare/v138.9.0...v138.10.0) (2026-05-06)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
|
@@ -5,14 +5,14 @@ import ListItemIcon from '../../ListItemIcon'
|
|
|
5
5
|
import ListItemText from '../../ListItemText'
|
|
6
6
|
import ActionsMenuItem from '../ActionsMenuItem'
|
|
7
7
|
|
|
8
|
-
const makeComponent = ({ label, icon, name }) => {
|
|
8
|
+
const makeComponent = ({ label, icon, name, componentProps }) => {
|
|
9
9
|
const Component = forwardRef((props, ref) => {
|
|
10
10
|
return (
|
|
11
11
|
<ActionsMenuItem {...props} ref={ref}>
|
|
12
12
|
<ListItemIcon>
|
|
13
|
-
<Icon icon={icon} />
|
|
13
|
+
<Icon icon={icon} {...componentProps?.Icon} />
|
|
14
14
|
</ListItemIcon>
|
|
15
|
-
<ListItemText primary={label} />
|
|
15
|
+
<ListItemText primary={label} {...componentProps?.ListItemText} />
|
|
16
16
|
</ActionsMenuItem>
|
|
17
17
|
)
|
|
18
18
|
})
|
|
@@ -28,6 +28,8 @@ export const makeAction = ({
|
|
|
28
28
|
icon,
|
|
29
29
|
disabled,
|
|
30
30
|
displayCondition,
|
|
31
|
+
Component,
|
|
32
|
+
componentProps,
|
|
31
33
|
action
|
|
32
34
|
}) => {
|
|
33
35
|
return {
|
|
@@ -37,6 +39,7 @@ export const makeAction = ({
|
|
|
37
39
|
disabled,
|
|
38
40
|
displayCondition,
|
|
39
41
|
action,
|
|
40
|
-
|
|
42
|
+
componentProps,
|
|
43
|
+
Component: Component || makeComponent({ label, icon, name, componentProps })
|
|
41
44
|
}
|
|
42
45
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
export function makeAction({ name, label, icon, disabled, displayCondition, action }: {
|
|
1
|
+
export function makeAction({ name, label, icon, disabled, displayCondition, Component, componentProps, action }: {
|
|
2
2
|
name: any;
|
|
3
3
|
label: any;
|
|
4
4
|
icon: any;
|
|
5
5
|
disabled: any;
|
|
6
6
|
displayCondition: any;
|
|
7
|
+
Component: any;
|
|
8
|
+
componentProps: any;
|
|
7
9
|
action: any;
|
|
8
10
|
}): {
|
|
9
11
|
name: any;
|
|
@@ -12,6 +14,6 @@ export function makeAction({ name, label, icon, disabled, displayCondition, acti
|
|
|
12
14
|
disabled: any;
|
|
13
15
|
displayCondition: any;
|
|
14
16
|
action: any;
|
|
15
|
-
|
|
17
|
+
componentProps: any;
|
|
18
|
+
Component: any;
|
|
16
19
|
};
|
|
17
|
-
import React from "react";
|
|
@@ -8,15 +8,16 @@ import ActionsMenuItem from "cozy-ui/transpiled/react/ActionsMenu/ActionsMenuIte
|
|
|
8
8
|
var makeComponent = function makeComponent(_ref) {
|
|
9
9
|
var label = _ref.label,
|
|
10
10
|
icon = _ref.icon,
|
|
11
|
-
name = _ref.name
|
|
11
|
+
name = _ref.name,
|
|
12
|
+
componentProps = _ref.componentProps;
|
|
12
13
|
var Component = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
13
14
|
return /*#__PURE__*/React.createElement(ActionsMenuItem, _extends({}, props, {
|
|
14
15
|
ref: ref
|
|
15
|
-
}), /*#__PURE__*/React.createElement(ListItemIcon, null, /*#__PURE__*/React.createElement(Icon, {
|
|
16
|
+
}), /*#__PURE__*/React.createElement(ListItemIcon, null, /*#__PURE__*/React.createElement(Icon, _extends({
|
|
16
17
|
icon: icon
|
|
17
|
-
})), /*#__PURE__*/React.createElement(ListItemText, {
|
|
18
|
+
}, componentProps === null || componentProps === void 0 ? void 0 : componentProps.Icon))), /*#__PURE__*/React.createElement(ListItemText, _extends({
|
|
18
19
|
primary: label
|
|
19
|
-
}));
|
|
20
|
+
}, componentProps === null || componentProps === void 0 ? void 0 : componentProps.ListItemText)));
|
|
20
21
|
});
|
|
21
22
|
Component.displayName = name;
|
|
22
23
|
return Component;
|
|
@@ -28,6 +29,8 @@ export var makeAction = function makeAction(_ref2) {
|
|
|
28
29
|
icon = _ref2.icon,
|
|
29
30
|
disabled = _ref2.disabled,
|
|
30
31
|
displayCondition = _ref2.displayCondition,
|
|
32
|
+
Component = _ref2.Component,
|
|
33
|
+
componentProps = _ref2.componentProps,
|
|
31
34
|
action = _ref2.action;
|
|
32
35
|
return {
|
|
33
36
|
name: name,
|
|
@@ -36,10 +39,12 @@ export var makeAction = function makeAction(_ref2) {
|
|
|
36
39
|
disabled: disabled,
|
|
37
40
|
displayCondition: displayCondition,
|
|
38
41
|
action: action,
|
|
39
|
-
|
|
42
|
+
componentProps: componentProps,
|
|
43
|
+
Component: Component || makeComponent({
|
|
40
44
|
label: label,
|
|
41
45
|
icon: icon,
|
|
42
|
-
name: name
|
|
46
|
+
name: name,
|
|
47
|
+
componentProps: componentProps
|
|
43
48
|
})
|
|
44
49
|
};
|
|
45
50
|
};
|