revdev-components 0.19.0 → 0.21.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,6 +1,8 @@
1
1
  import React from "react";
2
+ import { RegularIconName } from "../../icon";
2
3
  type AppDialogTitleHandler = (close?: React.ReactNode) => React.ReactNode;
3
4
  export interface RegularDialogProps {
5
+ titleIcon?: RegularIconName;
4
6
  titlePrefix?: string;
5
7
  title?: string | AppDialogTitleHandler;
6
8
  children: React.ReactNode;
@@ -11,7 +13,8 @@ export interface RegularDialogProps {
11
13
  cancelText?: string;
12
14
  footerClassName?: string;
13
15
  contentClassName?: string;
14
- hideOk?: boolean;
16
+ okHide?: boolean;
17
+ okDisabled?: boolean;
15
18
  onOk?: () => void;
16
19
  onClose?: () => void;
17
20
  open?: boolean;
package/build/index.js CHANGED
@@ -4811,24 +4811,28 @@ var InfoDialog = function (_a) {
4811
4811
  hideClose ? null : React.createElement(RegularIcon, { name: "cross", className: s$9.close, onClick: onClose }))));
4812
4812
  };
4813
4813
 
4814
- var s$8 = {"root":"index-module_root__BQI-i","header":"index-module_header__OUCQj","close":"index-module_close__-FN6K","content":"index-module_content__BpXha","footer":"index-module_footer__xqKte"};
4814
+ var s$8 = {"root":"index-module_root__BQI-i","header":"index-module_header__OUCQj","title":"index-module_title__HPbDC","close":"index-module_close__-FN6K","content":"index-module_content__BpXha","footer":"index-module_footer__xqKte"};
4815
4815
 
4816
4816
  var RegularDialog = function (_a) {
4817
- var titlePrefix = _a.titlePrefix, title = _a.title, children = _a.children, _b = _a.hideFooter, hideFooter = _b === void 0 ? false : _b, className = _a.className, width = _a.width, okText = _a.okText, cancelText = _a.cancelText, footerClassName = _a.footerClassName, contentClassName = _a.contentClassName, hideOk = _a.hideOk, onOk = _a.onOk, onClose = _a.onClose, _c = _a.open, open = _c === void 0 ? true : _c;
4817
+ var titleIcon = _a.titleIcon, titlePrefix = _a.titlePrefix, title = _a.title, children = _a.children, _b = _a.hideFooter, hideFooter = _b === void 0 ? false : _b, className = _a.className, width = _a.width, okText = _a.okText, cancelText = _a.cancelText, footerClassName = _a.footerClassName, contentClassName = _a.contentClassName, okHide = _a.okHide, okDisabled = _a.okDisabled, onOk = _a.onOk, onClose = _a.onClose, _c = _a.open, open = _c === void 0 ? true : _c;
4818
4818
  var close = React.useMemo(function () {
4819
4819
  return React.createElement(RegularIcon, { name: "cross", className: s$8.close, onClick: onClose });
4820
4820
  }, [onClose]);
4821
4821
  var titleContent = React.useMemo(function () {
4822
4822
  if (typeof title === "string") {
4823
4823
  return (React.createElement("div", { className: s$8.header },
4824
- React.createElement("div", null, ((titlePrefix || "") + " " || "") + title),
4824
+ React.createElement("div", { className: s$8.title },
4825
+ titleIcon && React.createElement(RegularIcon, { name: titleIcon }),
4826
+ React.createElement("span", null,
4827
+ " ",
4828
+ ((titlePrefix || "") + " " || "") + title)),
4825
4829
  close));
4826
4830
  }
4827
4831
  else if (typeof title === "function") {
4828
4832
  return title(close);
4829
4833
  }
4830
4834
  return null;
4831
- }, [s$8, title, titlePrefix, close]);
4835
+ }, [s$8, title, titlePrefix, close, titleIcon]);
4832
4836
  var style = React.useMemo(function () {
4833
4837
  var result = {};
4834
4838
  if (width) {
@@ -4847,7 +4851,7 @@ var RegularDialog = function (_a) {
4847
4851
  React.createElement("div", { className: classNames(s$8.content, contentClassName) }, children),
4848
4852
  hideFooter ? null : (React.createElement("div", { className: classNames(s$8.footer, footerClassName) },
4849
4853
  React.createElement(antd.Button, { onClick: onClose }, cancelText || "Cancel"),
4850
- hideOk ? null : (React.createElement(antd.Button, { type: "primary", onClick: handleOk }, okText || "OK"))))));
4854
+ okHide ? null : (React.createElement(antd.Button, { type: "primary", onClick: handleOk, disabled: okDisabled }, okText || "OK"))))));
4851
4855
  };
4852
4856
 
4853
4857
  var s$7 = {"root":"index-module_root__9mhio"};
package/build/styles.css CHANGED
@@ -97,6 +97,13 @@
97
97
  font-weight: 500;
98
98
  }
99
99
 
100
+ .index-module_title__HPbDC {
101
+ display: flex;
102
+ flex-direction: row;
103
+ align-items: center;
104
+ gap: 0.5em;
105
+ }
106
+
100
107
  .index-module_close__-FN6K {
101
108
  cursor: pointer;
102
109
  font-size: 20px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "revdev-components",
3
- "version": "0.19.0",
3
+ "version": "0.21.0",
4
4
  "main": "build/index.js",
5
5
  "module": "build/index.esm.js",
6
6
  "scripts": {