@alicloud/console-base-rc-side-panel 1.1.9 → 1.1.10-beta.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.
|
@@ -12,7 +12,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _consoleBaseRcEasyIcon = require("@alicloud/console-base-rc-easy-icon");
|
|
13
13
|
var _consoleBaseRcTooltip = require("@alicloud/console-base-rc-tooltip");
|
|
14
14
|
var _consoleBaseRcHtmlTrusted = _interopRequireDefault(require("@alicloud/console-base-rc-html-trusted"));
|
|
15
|
-
var _model = require("../../../model");
|
|
16
15
|
var _rc = require("../../rc");
|
|
17
16
|
var _excluded = ["id", "className", "style", "active", "title", "icon", "unread", "mark", "tooltip", "tooltipAsHtml", "tooltipOptions", "onlyShowIcon", "onClick", "onActiveChange"];
|
|
18
17
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -33,33 +32,29 @@ function Item(_ref) {
|
|
|
33
32
|
onClick = _ref.onClick,
|
|
34
33
|
onActiveChange = _ref.onActiveChange,
|
|
35
34
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
36
|
-
var collapsed = (0, _model.useCollapsed)();
|
|
37
35
|
var handleClick = (0, _react.useCallback)(function (e) {
|
|
38
36
|
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
39
37
|
onActiveChange === null || onActiveChange === void 0 ? void 0 : onActiveChange(!active);
|
|
40
38
|
}, [active, onClick, onActiveChange]);
|
|
41
|
-
|
|
42
|
-
return /*#__PURE__*/_react.default.createElement(_rc.SidePanelItemWrap, {
|
|
43
|
-
id: id,
|
|
44
|
-
className: className,
|
|
45
|
-
style: style
|
|
46
|
-
}, /*#__PURE__*/_react.default.createElement(_rc.SidePanelItemButton, (0, _extends2.default)({
|
|
47
|
-
active: active,
|
|
48
|
-
title: title,
|
|
49
|
-
label: (0, _consoleBaseRcEasyIcon.renderEasyIcon)(icon) || title,
|
|
50
|
-
onlyShowIcon: onlyShowIcon,
|
|
51
|
-
onClick: handleClick
|
|
52
|
-
}, rest)), /*#__PURE__*/_react.default.createElement(_rc.SidePanelItemBadge, {
|
|
53
|
-
unread: unread,
|
|
54
|
-
mark: mark
|
|
55
|
-
}));
|
|
56
|
-
};
|
|
57
|
-
return collapsed || !tooltip && !title ? renderItem() : /*#__PURE__*/_react.default.createElement(_consoleBaseRcTooltip.TooltipV1, (0, _extends2.default)({
|
|
39
|
+
return /*#__PURE__*/_react.default.createElement(_consoleBaseRcTooltip.TooltipV1, (0, _extends2.default)({
|
|
58
40
|
title: tooltipAsHtml && typeof tooltip === 'string' ? /*#__PURE__*/_react.default.createElement(_consoleBaseRcHtmlTrusted.default, {
|
|
59
41
|
text: tooltip
|
|
60
42
|
}) : tooltip || title,
|
|
61
43
|
placement: "left",
|
|
62
44
|
destroyTooltipOnHide: true,
|
|
63
45
|
fixed: true
|
|
64
|
-
}, tooltipOptions),
|
|
46
|
+
}, tooltipOptions), /*#__PURE__*/_react.default.createElement(_rc.SidePanelItemWrap, {
|
|
47
|
+
id: id,
|
|
48
|
+
className: className,
|
|
49
|
+
style: style
|
|
50
|
+
}, /*#__PURE__*/_react.default.createElement(_rc.SidePanelItemButton, (0, _extends2.default)({
|
|
51
|
+
active: active,
|
|
52
|
+
title: title,
|
|
53
|
+
label: (0, _consoleBaseRcEasyIcon.renderEasyIcon)(icon) || title,
|
|
54
|
+
onlyShowIcon: onlyShowIcon,
|
|
55
|
+
onClick: handleClick
|
|
56
|
+
}, rest)), /*#__PURE__*/_react.default.createElement(_rc.SidePanelItemBadge, {
|
|
57
|
+
unread: unread,
|
|
58
|
+
mark: mark
|
|
59
|
+
})));
|
|
65
60
|
}
|
|
@@ -5,7 +5,6 @@ import React, { useCallback } from 'react';
|
|
|
5
5
|
import { renderEasyIcon } from '@alicloud/console-base-rc-easy-icon';
|
|
6
6
|
import { TooltipV1 } from '@alicloud/console-base-rc-tooltip';
|
|
7
7
|
import HtmlTrusted from '@alicloud/console-base-rc-html-trusted';
|
|
8
|
-
import { useCollapsed } from '../../../model';
|
|
9
8
|
import { SidePanelItemWrap, SidePanelItemButton, SidePanelItemBadge } from '../../rc';
|
|
10
9
|
export default function Item(_ref) {
|
|
11
10
|
var id = _ref.id,
|
|
@@ -23,33 +22,29 @@ export default function Item(_ref) {
|
|
|
23
22
|
onClick = _ref.onClick,
|
|
24
23
|
onActiveChange = _ref.onActiveChange,
|
|
25
24
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
26
|
-
var collapsed = useCollapsed();
|
|
27
25
|
var handleClick = useCallback(function (e) {
|
|
28
26
|
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
29
27
|
onActiveChange === null || onActiveChange === void 0 ? void 0 : onActiveChange(!active);
|
|
30
28
|
}, [active, onClick, onActiveChange]);
|
|
31
|
-
|
|
32
|
-
return /*#__PURE__*/React.createElement(SidePanelItemWrap, {
|
|
33
|
-
id: id,
|
|
34
|
-
className: className,
|
|
35
|
-
style: style
|
|
36
|
-
}, /*#__PURE__*/React.createElement(SidePanelItemButton, _extends({
|
|
37
|
-
active: active,
|
|
38
|
-
title: title,
|
|
39
|
-
label: renderEasyIcon(icon) || title,
|
|
40
|
-
onlyShowIcon: onlyShowIcon,
|
|
41
|
-
onClick: handleClick
|
|
42
|
-
}, rest)), /*#__PURE__*/React.createElement(SidePanelItemBadge, {
|
|
43
|
-
unread: unread,
|
|
44
|
-
mark: mark
|
|
45
|
-
}));
|
|
46
|
-
};
|
|
47
|
-
return collapsed || !tooltip && !title ? renderItem() : /*#__PURE__*/React.createElement(TooltipV1, _extends({
|
|
29
|
+
return /*#__PURE__*/React.createElement(TooltipV1, _extends({
|
|
48
30
|
title: tooltipAsHtml && typeof tooltip === 'string' ? /*#__PURE__*/React.createElement(HtmlTrusted, {
|
|
49
31
|
text: tooltip
|
|
50
32
|
}) : tooltip || title,
|
|
51
33
|
placement: "left",
|
|
52
34
|
destroyTooltipOnHide: true,
|
|
53
35
|
fixed: true
|
|
54
|
-
}, tooltipOptions),
|
|
36
|
+
}, tooltipOptions), /*#__PURE__*/React.createElement(SidePanelItemWrap, {
|
|
37
|
+
id: id,
|
|
38
|
+
className: className,
|
|
39
|
+
style: style
|
|
40
|
+
}, /*#__PURE__*/React.createElement(SidePanelItemButton, _extends({
|
|
41
|
+
active: active,
|
|
42
|
+
title: title,
|
|
43
|
+
label: renderEasyIcon(icon) || title,
|
|
44
|
+
onlyShowIcon: onlyShowIcon,
|
|
45
|
+
onClick: handleClick
|
|
46
|
+
}, rest)), /*#__PURE__*/React.createElement(SidePanelItemBadge, {
|
|
47
|
+
unread: unread,
|
|
48
|
+
mark: mark
|
|
49
|
+
})));
|
|
55
50
|
}
|