@lobehub/ui 1.38.2 → 1.38.4
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/es/ActionIcon/index.d.ts
CHANGED
|
@@ -33,10 +33,6 @@ export interface ActionIconProps extends DivProps {
|
|
|
33
33
|
* @description Set the loading status of ActionIcon
|
|
34
34
|
*/
|
|
35
35
|
loading?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* @description Handle click action
|
|
38
|
-
*/
|
|
39
|
-
onClick?: () => void;
|
|
40
36
|
/**
|
|
41
37
|
* @description The position of the tooltip relative to the target
|
|
42
38
|
* @enum ["top","left","right","bottom","topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]
|
|
@@ -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,
|
|
@@ -26,18 +26,10 @@ var ThemeProvider = /*#__PURE__*/memo(function (_ref) {
|
|
|
26
26
|
});
|
|
27
27
|
}, []);
|
|
28
28
|
var stylish = useCallback(function (theme) {
|
|
29
|
-
|
|
30
|
-
if (customStylish) {
|
|
31
|
-
stylish = customStylish(theme);
|
|
32
|
-
}
|
|
33
|
-
return _objectSpread(_objectSpread({}, lobeCustomStylish(theme)), stylish);
|
|
29
|
+
return _objectSpread(_objectSpread({}, lobeCustomStylish(theme)), customStylish === null || customStylish === void 0 ? void 0 : customStylish(theme));
|
|
34
30
|
}, [customStylish]);
|
|
35
31
|
var token = useCallback(function (theme) {
|
|
36
|
-
|
|
37
|
-
if (customToken) {
|
|
38
|
-
token = customToken(theme);
|
|
39
|
-
}
|
|
40
|
-
return _objectSpread(_objectSpread({}, lobeCustomToken(theme)), token);
|
|
32
|
+
return _objectSpread(_objectSpread({}, lobeCustomToken(theme)), customToken === null || customToken === void 0 ? void 0 : customToken(theme));
|
|
41
33
|
}, [customToken]);
|
|
42
34
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
43
35
|
children: [enableWebfonts && (webfonts === null || webfonts === void 0 ? void 0 : webfonts.length) > 0 && webfonts.map(function (webfont, index) {
|