revdev-components 0.19.0 → 0.20.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.
- package/build/dialog/regular/index.d.ts +2 -0
- package/build/index.js +8 -4
- package/build/styles.css +7 -0
- package/package.json +1 -1
|
@@ -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;
|
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, hideOk = _a.hideOk, 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",
|
|
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) {
|
package/build/styles.css
CHANGED