@deviceinsight/ng-ui-components 7.17.0 → 7.17.2

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.js CHANGED
@@ -63,7 +63,16 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
63
63
  //#endregion
64
64
  //#region src/modules/messageBox/messageBox.tsx
65
65
  var groupNamesToToastIds = {};
66
+ var DEFAULT_AUTO_CLOSE_MS = 3e3;
67
+ var globalMessageBoxOptions = {};
66
68
  var globalErrorMessageBoxOptions = { autoClose: false };
69
+ /**
70
+ * Base options merged into every messageBox call (success, info, warn and error).
71
+ * Per-call options and, for errors, the error specific global options take precedence.
72
+ */
73
+ var setGlobalMessageBoxOptions = (options) => {
74
+ globalMessageBoxOptions = options;
75
+ };
67
76
  var setGlobalErrorMessageBoxOptions = (options) => {
68
77
  globalErrorMessageBoxOptions = options;
69
78
  };
@@ -72,19 +81,29 @@ var storeGroupName = (groupName, toastId) => {
72
81
  else groupNamesToToastIds[groupName] = [toastId];
73
82
  };
74
83
  var messageBoxSuccess = (content, options, groupName) => {
75
- const toastId = toast.success(content, options);
84
+ const toastId = toast.success(content, {
85
+ ...globalMessageBoxOptions,
86
+ ...options
87
+ });
76
88
  if (groupName) storeGroupName(groupName, toastId);
77
89
  };
78
90
  var messageBoxInfo = (content, options, groupName) => {
79
- const toastId = toast.info(content, options);
91
+ const toastId = toast.info(content, {
92
+ ...globalMessageBoxOptions,
93
+ ...options
94
+ });
80
95
  if (groupName) storeGroupName(groupName, toastId);
81
96
  };
82
97
  var messageBoxWarn = (content, options, groupName) => {
83
- const toastId = toast.warn(content, options);
98
+ const toastId = toast.warn(content, {
99
+ ...globalMessageBoxOptions,
100
+ ...options
101
+ });
84
102
  if (groupName) storeGroupName(groupName, toastId);
85
103
  };
86
104
  var messageBoxError = (content, options, groupName) => {
87
105
  const toastId = toast.error(content, {
106
+ ...globalMessageBoxOptions,
88
107
  ...globalErrorMessageBoxOptions,
89
108
  ...options
90
109
  });
@@ -103,12 +122,13 @@ var messageBoxDismissAll = () => {
103
122
  groupNamesToToastIds = {};
104
123
  toast.dismiss();
105
124
  };
106
- var MessageBoxContainer = () => /* @__PURE__ */ jsx(ToastContainer, {
107
- position: "top-center",
108
- theme: "colored",
109
- autoClose: 3e4,
110
- hideProgressBar: true,
111
- transition: Slide
125
+ var MessageBoxContainer = ({ position = "top-center", theme = "colored", autoClose = DEFAULT_AUTO_CLOSE_MS, hideProgressBar = true, transition = Slide, ...props } = {}) => /* @__PURE__ */ jsx(ToastContainer, {
126
+ position,
127
+ theme,
128
+ autoClose,
129
+ hideProgressBar,
130
+ transition,
131
+ ...props
112
132
  });
113
133
  //#endregion
114
134
  //#region src/modules/utils/uuidGen.ts
@@ -3563,6 +3583,6 @@ var Slider = ({ min, max, step, value, tooltip = true, labels, format, onChange,
3563
3583
  });
3564
3584
  };
3565
3585
  //#endregion
3566
- export { Chart, GridColorPicker as ColorPicker, GridColorPicker, ContentHeader, DateInput, DateTimeInput, FileUpload, GradientColorPicker, ImageUpload, InfoBox, MessageBoxContainer, MultiMenuFunctional as MultiMenu, MultiMenuItem, Pagination, PeriodPicker, Reactable, ReactableWithClientSidePagination, RouteLink, RouteTabs, SelectWithSearch, SelectWithSearchAsync, Slider, SvgImage, TreeView, UrnInput, ValidatedTextInput, getMutableNodeList_default as getMutableNodeList, getSvgElement_default as getSvgElement, getTreeNodePathById, initializeTranslation, messageBoxDismissAll, messageBoxDismissGroup, messageBoxDismissSingle, messageBoxError, messageBoxInfo, messageBoxSuccess, messageBoxWarn, nanoid10, setGlobalErrorMessageBoxOptions, uuidV4, validateSvg_default as validateSvg, withPrompt };
3586
+ export { Chart, GridColorPicker as ColorPicker, GridColorPicker, ContentHeader, DateInput, DateTimeInput, FileUpload, GradientColorPicker, ImageUpload, InfoBox, MessageBoxContainer, MultiMenuFunctional as MultiMenu, MultiMenuItem, Pagination, PeriodPicker, Reactable, ReactableWithClientSidePagination, RouteLink, RouteTabs, SelectWithSearch, SelectWithSearchAsync, Slider, SvgImage, TreeView, UrnInput, ValidatedTextInput, getMutableNodeList_default as getMutableNodeList, getSvgElement_default as getSvgElement, getTreeNodePathById, initializeTranslation, messageBoxDismissAll, messageBoxDismissGroup, messageBoxDismissSingle, messageBoxError, messageBoxInfo, messageBoxSuccess, messageBoxWarn, nanoid10, setGlobalErrorMessageBoxOptions, setGlobalMessageBoxOptions, uuidV4, validateSvg_default as validateSvg, withPrompt };
3567
3587
 
3568
3588
  //# sourceMappingURL=index.js.map