@lobehub/ui 1.38.2 → 1.38.3
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.
|
@@ -24,7 +24,7 @@ export interface ActionIconGroupProps extends DivProps {
|
|
|
24
24
|
* @default []
|
|
25
25
|
*/
|
|
26
26
|
items?: ActionIconGroupItems[];
|
|
27
|
-
onActionClick
|
|
27
|
+
onActionClick?: (key: string) => void;
|
|
28
28
|
/**
|
|
29
29
|
* @description The position of the tooltip relative to the target
|
|
30
30
|
* @enum ["top","left","right","bottom","topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]
|
|
@@ -22,8 +22,7 @@ var ActionIconGroup = /*#__PURE__*/memo(function (_ref) {
|
|
|
22
22
|
direction = _ref$direction === void 0 ? 'row' : _ref$direction,
|
|
23
23
|
_ref$dropdownMenu = _ref.dropdownMenu,
|
|
24
24
|
dropdownMenu = _ref$dropdownMenu === void 0 ? [] : _ref$dropdownMenu,
|
|
25
|
-
|
|
26
|
-
onActionClick = _ref$onActionClick === void 0 ? function () {} : _ref$onActionClick,
|
|
25
|
+
onActionClick = _ref.onActionClick,
|
|
27
26
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
28
27
|
var _useStyles = useStyles({
|
|
29
28
|
direction: direction,
|
|
@@ -37,9 +36,9 @@ var ActionIconGroup = /*#__PURE__*/memo(function (_ref) {
|
|
|
37
36
|
children: [spotlight && /*#__PURE__*/_jsx(Spotlight, {}), items.map(function (item) {
|
|
38
37
|
return /*#__PURE__*/_jsx(ActionIcon, {
|
|
39
38
|
icon: item.icon,
|
|
40
|
-
onClick: function
|
|
41
|
-
return onActionClick(item.key);
|
|
42
|
-
},
|
|
39
|
+
onClick: onActionClick ? function () {
|
|
40
|
+
return onActionClick === null || onActionClick === void 0 ? void 0 : onActionClick(item.key);
|
|
41
|
+
} : undefined,
|
|
43
42
|
placement: tooltipsPlacement,
|
|
44
43
|
size: "small",
|
|
45
44
|
title: item.label
|
|
@@ -53,9 +52,9 @@ var ActionIconGroup = /*#__PURE__*/memo(function (_ref) {
|
|
|
53
52
|
icon: item.icon,
|
|
54
53
|
size: "small"
|
|
55
54
|
}),
|
|
56
|
-
onClick: function
|
|
55
|
+
onClick: onActionClick ? function () {
|
|
57
56
|
return onActionClick(item.key);
|
|
58
|
-
}
|
|
57
|
+
} : undefined
|
|
59
58
|
});
|
|
60
59
|
})
|
|
61
60
|
},
|
package/es/ChatList/index.js
CHANGED
|
@@ -9,8 +9,7 @@ import ActionsBar from "./ActionsBar";
|
|
|
9
9
|
import { useStyles } from "./style";
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
11
|
var ChatList = /*#__PURE__*/memo(function (_ref) {
|
|
12
|
-
var
|
|
13
|
-
_onActionClick = _ref$onActionClick === void 0 ? function () {} : _ref$onActionClick,
|
|
12
|
+
var onActionClick = _ref.onActionClick,
|
|
14
13
|
className = _ref.className,
|
|
15
14
|
data = _ref.data,
|
|
16
15
|
_ref$type = _ref.type,
|
|
@@ -26,9 +25,9 @@ var ChatList = /*#__PURE__*/memo(function (_ref) {
|
|
|
26
25
|
children: data.map(function (item) {
|
|
27
26
|
return /*#__PURE__*/_jsx(ChatItem, {
|
|
28
27
|
actions: /*#__PURE__*/_jsx(ActionsBar, {
|
|
29
|
-
onActionClick: function
|
|
30
|
-
return
|
|
31
|
-
},
|
|
28
|
+
onActionClick: onActionClick ? function (actionKey) {
|
|
29
|
+
return onActionClick === null || onActionClick === void 0 ? void 0 : onActionClick(actionKey, item.id);
|
|
30
|
+
} : undefined,
|
|
32
31
|
primary: item.role === 'user'
|
|
33
32
|
}),
|
|
34
33
|
avatar: item.meta,
|