revdev-components 0.168.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.
@@ -3,7 +3,7 @@ import { ButtonProps as AntdButtonProps } from "antd";
3
3
  import { TooltipPlacement } from "antd/es/tooltip";
4
4
  import { RegularIconName } from "../icon";
5
5
  interface ButtonContentProps extends Omit<AntdButtonProps, "icon" | "rightIcon"> {
6
- icon?: RegularIconName;
6
+ icon?: RegularIconName | React.ReactElement;
7
7
  rightIcon?: RegularIconName;
8
8
  isPrimary?: boolean;
9
9
  }
@@ -1,10 +1,13 @@
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;
10
+ loading?: boolean;
8
11
  }
9
12
  interface ClickHeaderActionProps extends BaseHeaderActionProps {
10
13
  onClick: () => void;
package/build/index.js CHANGED
@@ -5494,17 +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, label = _a.label, loading = _a.loading, tooltipPlacement = _a.tooltipPlacement, tooltip = _a.tooltip;
5498
+ var iconElement = loading ? React.createElement(antd.Spin, null) : icon;
5497
5499
  if (content === null || content === void 0 ? void 0 : content.content) {
5498
5500
  return React.createElement(React.Fragment, { key: i }, content === null || content === void 0 ? void 0 : content.content);
5499
5501
  }
5500
5502
  else if (typeof (button === null || button === void 0 ? void 0 : button.onClick) === "function") {
5501
- var icon = button.icon, label = button.label, tooltip = button.tooltip, confirmText = button.confirmText, onClick = button.onClick;
5503
+ var confirmText = button.confirmText, onClick = button.onClick;
5502
5504
  return confirmText ? (React.createElement(antd.Popconfirm, { key: i, title: confirmText, onConfirm: onClick, okText: "Yes", cancelText: "No" },
5503
- React.createElement(Button, { key: i, icon: icon, tooltip: tooltip, className: s$4.button, size: size }, label))) : (React.createElement(Button, { key: i, icon: icon, onClick: onClick, tooltip: tooltip, className: s$4.button, size: size }, 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));
5504
5506
  }
5505
5507
  else if (typeof (link === null || link === void 0 ? void 0 : link.href) === "string") {
5506
- var icon = link.icon, label = link.label, tooltip = link.tooltip, href = link.href;
5507
- return (React.createElement(Button, { key: i, icon: icon, tooltip: tooltip, href: href, className: s$4.link, size: size }, 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));
5508
5510
  }
5509
5511
  }))) : null;
5510
5512
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "revdev-components",
3
- "version": "0.168.0",
3
+ "version": "0.170.0",
4
4
  "main": "build/index.js",
5
5
  "module": "build/index.esm.js",
6
6
  "scripts": {