revdev-components 0.18.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.
|
@@ -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
|
@@ -4746,6 +4746,7 @@ function useAppFormRules() {
|
|
|
4746
4746
|
onlyKey: function (message) { return ({ pattern: /^([a-z\d]*[-])*[a-z\d]+$/i, message: message }); },
|
|
4747
4747
|
maxLength: function (message, length) { return ({ max: length, message: message }); },
|
|
4748
4748
|
minLength: function (message, length) { return ({ min: length, message: message }); },
|
|
4749
|
+
length: function (message, length) { return ({ len: length, message: message }); },
|
|
4749
4750
|
};
|
|
4750
4751
|
}, []);
|
|
4751
4752
|
}
|
|
@@ -4810,24 +4811,28 @@ var InfoDialog = function (_a) {
|
|
|
4810
4811
|
hideClose ? null : React.createElement(RegularIcon, { name: "cross", className: s$9.close, onClick: onClose }))));
|
|
4811
4812
|
};
|
|
4812
4813
|
|
|
4813
|
-
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"};
|
|
4814
4815
|
|
|
4815
4816
|
var RegularDialog = function (_a) {
|
|
4816
|
-
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;
|
|
4817
4818
|
var close = React.useMemo(function () {
|
|
4818
4819
|
return React.createElement(RegularIcon, { name: "cross", className: s$8.close, onClick: onClose });
|
|
4819
4820
|
}, [onClose]);
|
|
4820
4821
|
var titleContent = React.useMemo(function () {
|
|
4821
4822
|
if (typeof title === "string") {
|
|
4822
4823
|
return (React.createElement("div", { className: s$8.header },
|
|
4823
|
-
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)),
|
|
4824
4829
|
close));
|
|
4825
4830
|
}
|
|
4826
4831
|
else if (typeof title === "function") {
|
|
4827
4832
|
return title(close);
|
|
4828
4833
|
}
|
|
4829
4834
|
return null;
|
|
4830
|
-
}, [s$8, title, titlePrefix, close]);
|
|
4835
|
+
}, [s$8, title, titlePrefix, close, titleIcon]);
|
|
4831
4836
|
var style = React.useMemo(function () {
|
|
4832
4837
|
var result = {};
|
|
4833
4838
|
if (width) {
|
package/build/styles.css
CHANGED