revdev-components 0.169.0 → 0.170.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.
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { SizeType } from "antd/es/config-provider/SizeContext";
|
|
3
|
+
import { TooltipPlacement } from "antd/es/tooltip";
|
|
3
4
|
import { RegularIconName } from "src/icon/regular";
|
|
4
5
|
interface BaseHeaderActionProps {
|
|
5
6
|
icon: RegularIconName;
|
|
6
7
|
label?: string;
|
|
7
8
|
tooltip?: string;
|
|
9
|
+
tooltipPlacement?: TooltipPlacement;
|
|
8
10
|
loading?: boolean;
|
|
9
11
|
}
|
|
10
12
|
interface ClickHeaderActionProps extends BaseHeaderActionProps {
|
package/build/index.js
CHANGED
|
@@ -5494,19 +5494,19 @@ var HeaderActionPanel = function (_a) {
|
|
|
5494
5494
|
var content = action;
|
|
5495
5495
|
var button = action;
|
|
5496
5496
|
var link = action;
|
|
5497
|
-
var _a = action, icon = _a.icon, loading = _a.loading;
|
|
5497
|
+
var _a = action, icon = _a.icon, label = _a.label, loading = _a.loading, tooltipPlacement = _a.tooltipPlacement, tooltip = _a.tooltip;
|
|
5498
5498
|
var iconElement = loading ? React.createElement(antd.Spin, null) : icon;
|
|
5499
5499
|
if (content === null || content === void 0 ? void 0 : content.content) {
|
|
5500
5500
|
return React.createElement(React.Fragment, { key: i }, content === null || content === void 0 ? void 0 : content.content);
|
|
5501
5501
|
}
|
|
5502
5502
|
else if (typeof (button === null || button === void 0 ? void 0 : button.onClick) === "function") {
|
|
5503
|
-
var
|
|
5503
|
+
var confirmText = button.confirmText, onClick = button.onClick;
|
|
5504
5504
|
return confirmText ? (React.createElement(antd.Popconfirm, { key: i, title: confirmText, onConfirm: onClick, okText: "Yes", cancelText: "No" },
|
|
5505
|
-
React.createElement(Button, { key: i, icon: iconElement, tooltip: tooltip, className: s$4.button, size: size, disabled: loading }, label))) : (React.createElement(Button, { key: i, icon: iconElement, onClick: onClick, tooltip: tooltip, className: s$4.button, size: size, disabled: loading }, label));
|
|
5505
|
+
React.createElement(Button, { key: i, icon: iconElement, tooltip: tooltip, tooltipPlacement: tooltipPlacement, className: s$4.button, size: size, disabled: loading }, label))) : (React.createElement(Button, { key: i, icon: iconElement, onClick: onClick, tooltip: tooltip, tooltipPlacement: tooltipPlacement, className: s$4.button, size: size, disabled: loading }, label));
|
|
5506
5506
|
}
|
|
5507
5507
|
else if (typeof (link === null || link === void 0 ? void 0 : link.href) === "string") {
|
|
5508
|
-
var
|
|
5509
|
-
return (React.createElement(Button, { key: i, icon: iconElement, tooltip: tooltip, href: href, className: s$4.link, size: size, disabled: loading }, label));
|
|
5508
|
+
var href = link.href;
|
|
5509
|
+
return (React.createElement(Button, { key: i, icon: iconElement, tooltip: tooltip, tooltipPlacement: tooltipPlacement, href: href, className: s$4.link, size: size, disabled: loading }, label));
|
|
5510
5510
|
}
|
|
5511
5511
|
}))) : null;
|
|
5512
5512
|
};
|