dry-ux 1.24.0 → 1.26.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.
|
@@ -6,5 +6,5 @@ exports.ErrorScreen = React.memo(() => (React.createElement("div", { className:
|
|
|
6
6
|
React.createElement("h1", { style: { fontSize: 70 } },
|
|
7
7
|
React.createElement("i", { className: "fa fa-exclamation-triangle" })),
|
|
8
8
|
React.createElement("h1", null, "Oops, Something went wrong!"),
|
|
9
|
-
React.createElement("h4", { className: "pull-center", style: { width: 500, maxWidth: "
|
|
9
|
+
React.createElement("h4", { className: "pull-center", style: { width: 500, maxWidth: "95%", lineHeight: 1.5 } }, "Try to refresh this page or feel free to contact us if the problem persists."),
|
|
10
10
|
React.createElement("a", { href: "/", className: "btn btn-primary mtop mbm" }, "Back to Home"))));
|
package/dist/ui-utils/Modal.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const React = require("react");
|
|
4
4
|
const react_bootstrap_1 = require("react-bootstrap");
|
|
5
|
-
const Modal = React.memo(({ handleClose, shown, options: { content, cssClass, closeBtn, title, width, onClose, titleCloseBtn = true } }) => {
|
|
5
|
+
const Modal = React.memo(({ handleClose, shown, options: { content, footerContent, cssClass, closeBtn, title, width, onClose, titleCloseBtn = true }, }) => {
|
|
6
6
|
React.useEffect(() => {
|
|
7
7
|
if (shown) {
|
|
8
8
|
$(".modal-dialog").css("width", width);
|
|
@@ -15,10 +15,13 @@ const Modal = React.memo(({ handleClose, shown, options: { content, cssClass, cl
|
|
|
15
15
|
onClose && onClose();
|
|
16
16
|
};
|
|
17
17
|
const contentToRender = typeof content == "string" ? React.createElement("div", { dangerouslySetInnerHTML: { __html: content } }) : content;
|
|
18
|
+
const showFooter = closeBtn || footerContent;
|
|
18
19
|
return (React.createElement(react_bootstrap_1.Modal, { onHide: hide, show: shown, animation: true, autoFocus: true, keyboard: false, className: cssClass, backdropStyle: { zIndex: 1040, opacity: 0.5 }, backdrop: "static" },
|
|
19
20
|
!!title && (React.createElement(react_bootstrap_1.Modal.Header, { closeButton: titleCloseBtn, onHide: hide },
|
|
20
21
|
React.createElement(react_bootstrap_1.Modal.Title, null, title))),
|
|
21
22
|
React.createElement(react_bootstrap_1.Modal.Body, null, contentToRender),
|
|
22
|
-
React.createElement(react_bootstrap_1.Modal.Footer, null,
|
|
23
|
+
showFooter && (React.createElement(react_bootstrap_1.Modal.Footer, null,
|
|
24
|
+
footerContent,
|
|
25
|
+
closeBtn && (React.createElement(react_bootstrap_1.Button, { bsClass: "btn btn-danger", onClick: hide }, "Close"))))));
|
|
23
26
|
});
|
|
24
27
|
exports.default = Modal;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.UIUtilProvider = exports.useUIUtilContext = exports.UIUtilContext = void 0;
|
|
4
4
|
const React = require("react");
|
|
5
5
|
require("../types");
|
|
6
|
+
const react_bootstrap_1 = require("react-bootstrap");
|
|
6
7
|
const defaultState = {
|
|
7
8
|
modal: {
|
|
8
9
|
show: null,
|
|
@@ -41,16 +42,15 @@ class UIUtilProvider extends React.PureComponent {
|
|
|
41
42
|
destroyOnClose: true,
|
|
42
43
|
closeBtn: true,
|
|
43
44
|
width: 400,
|
|
44
|
-
}), showConfirm: (options, onYes, onNo) => this.createModal("confirm", Object.assign(Object.assign({}, options), {
|
|
45
|
-
options.
|
|
46
|
-
React.createElement(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
React.createElement("div", { className: "text-center mtop" }, actions.map(({ content, type = "success", closeOnClick, onClick }, index) => (React.createElement("button", { className: `btn btn-${type} mright`, onClick: () => {
|
|
45
|
+
}), showConfirm: (options, onYes, onNo) => this.createModal("confirm", Object.assign(Object.assign({}, options), { footerContent: (React.createElement(React.Fragment, null,
|
|
46
|
+
options.footerContent,
|
|
47
|
+
React.createElement(react_bootstrap_1.Button, { bsClass: "btn btn-success mright", onClick: onYes }, "Yes"),
|
|
48
|
+
React.createElement(react_bootstrap_1.Button, { bsClass: "btn btn-danger", onClick: () => (onNo ? onNo() : this.toggleModalInstance("confirm", false, true)) }, "No"))) })), showActions: (options, actions) => this.createModal("actions", Object.assign(Object.assign({}, options), { footerContent: (React.createElement(React.Fragment, null,
|
|
49
|
+
options.footerContent,
|
|
50
|
+
actions.map(({ content, type = "success", closeOnClick, onClick }, index) => (React.createElement(react_bootstrap_1.Button, { bsClass: `btn btn-${type} mright`, onClick: () => {
|
|
51
51
|
onClick && onClick();
|
|
52
52
|
closeOnClick && this.toggleModalInstance("actions", false, true);
|
|
53
|
-
} }, content)))))
|
|
53
|
+
} }, content))))) })) });
|
|
54
54
|
}
|
|
55
55
|
get alertDefaults() {
|
|
56
56
|
return {
|