@deviceinsight/ng-ui-components 7.20.0 → 7.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.
- package/dist/index.cjs +30 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +30 -10
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -191
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/modules/messageBox/messageBox.d.ts +8 -2
- package/dist/types/modules/messageBox/messageBox.d.ts.map +1 -1
- package/package.json +24 -23
package/dist/index.cjs
CHANGED
|
@@ -80,7 +80,16 @@ let _rc_component_tooltip = require("@rc-component/tooltip");
|
|
|
80
80
|
_rc_component_tooltip = __toESM(_rc_component_tooltip, 1);
|
|
81
81
|
//#region src/modules/messageBox/messageBox.tsx
|
|
82
82
|
var groupNamesToToastIds = {};
|
|
83
|
+
var DEFAULT_AUTO_CLOSE_MS = 3e3;
|
|
84
|
+
var globalMessageBoxOptions = {};
|
|
83
85
|
var globalErrorMessageBoxOptions = { autoClose: false };
|
|
86
|
+
/**
|
|
87
|
+
* Base options merged into every messageBox call (success, info, warn and error).
|
|
88
|
+
* Per-call options and, for errors, the error specific global options take precedence.
|
|
89
|
+
*/
|
|
90
|
+
var setGlobalMessageBoxOptions = (options) => {
|
|
91
|
+
globalMessageBoxOptions = options;
|
|
92
|
+
};
|
|
84
93
|
var setGlobalErrorMessageBoxOptions = (options) => {
|
|
85
94
|
globalErrorMessageBoxOptions = options;
|
|
86
95
|
};
|
|
@@ -89,19 +98,29 @@ var storeGroupName = (groupName, toastId) => {
|
|
|
89
98
|
else groupNamesToToastIds[groupName] = [toastId];
|
|
90
99
|
};
|
|
91
100
|
var messageBoxSuccess = (content, options, groupName) => {
|
|
92
|
-
const toastId = react_toastify_unstyled.toast.success(content,
|
|
101
|
+
const toastId = react_toastify_unstyled.toast.success(content, {
|
|
102
|
+
...globalMessageBoxOptions,
|
|
103
|
+
...options
|
|
104
|
+
});
|
|
93
105
|
if (groupName) storeGroupName(groupName, toastId);
|
|
94
106
|
};
|
|
95
107
|
var messageBoxInfo = (content, options, groupName) => {
|
|
96
|
-
const toastId = react_toastify_unstyled.toast.info(content,
|
|
108
|
+
const toastId = react_toastify_unstyled.toast.info(content, {
|
|
109
|
+
...globalMessageBoxOptions,
|
|
110
|
+
...options
|
|
111
|
+
});
|
|
97
112
|
if (groupName) storeGroupName(groupName, toastId);
|
|
98
113
|
};
|
|
99
114
|
var messageBoxWarn = (content, options, groupName) => {
|
|
100
|
-
const toastId = react_toastify_unstyled.toast.warn(content,
|
|
115
|
+
const toastId = react_toastify_unstyled.toast.warn(content, {
|
|
116
|
+
...globalMessageBoxOptions,
|
|
117
|
+
...options
|
|
118
|
+
});
|
|
101
119
|
if (groupName) storeGroupName(groupName, toastId);
|
|
102
120
|
};
|
|
103
121
|
var messageBoxError = (content, options, groupName) => {
|
|
104
122
|
const toastId = react_toastify_unstyled.toast.error(content, {
|
|
123
|
+
...globalMessageBoxOptions,
|
|
105
124
|
...globalErrorMessageBoxOptions,
|
|
106
125
|
...options
|
|
107
126
|
});
|
|
@@ -120,12 +139,13 @@ var messageBoxDismissAll = () => {
|
|
|
120
139
|
groupNamesToToastIds = {};
|
|
121
140
|
react_toastify_unstyled.toast.dismiss();
|
|
122
141
|
};
|
|
123
|
-
var MessageBoxContainer = () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_toastify_unstyled.ToastContainer, {
|
|
124
|
-
position
|
|
125
|
-
theme
|
|
126
|
-
autoClose
|
|
127
|
-
hideProgressBar
|
|
128
|
-
transition
|
|
142
|
+
var MessageBoxContainer = ({ position = "top-center", theme = "colored", autoClose = DEFAULT_AUTO_CLOSE_MS, hideProgressBar = true, transition = react_toastify_unstyled.Slide, ...props } = {}) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_toastify_unstyled.ToastContainer, {
|
|
143
|
+
position,
|
|
144
|
+
theme,
|
|
145
|
+
autoClose,
|
|
146
|
+
hideProgressBar,
|
|
147
|
+
transition,
|
|
148
|
+
...props
|
|
129
149
|
});
|
|
130
150
|
//#endregion
|
|
131
151
|
//#region src/modules/utils/uuidGen.ts
|
|
@@ -3627,6 +3647,7 @@ exports.messageBoxSuccess = messageBoxSuccess;
|
|
|
3627
3647
|
exports.messageBoxWarn = messageBoxWarn;
|
|
3628
3648
|
exports.nanoid10 = nanoid10;
|
|
3629
3649
|
exports.setGlobalErrorMessageBoxOptions = setGlobalErrorMessageBoxOptions;
|
|
3650
|
+
exports.setGlobalMessageBoxOptions = setGlobalMessageBoxOptions;
|
|
3630
3651
|
exports.uuidV4 = uuidV4;
|
|
3631
3652
|
exports.validateSvg = validateSvg_default;
|
|
3632
3653
|
exports.withPrompt = withPrompt;
|