@linzjs/lui 17.46.0 → 17.47.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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [17.47.0](https://github.com/linz/lui/compare/v17.46.0...v17.47.0) (2023-03-29)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* Allow onClose timeout to be separately configured for LuiToastMessage ([#908](https://github.com/linz/lui/issues/908)) ([c9629a1](https://github.com/linz/lui/commit/c9629a1a7694bd712f95907fb63e3494da6a3cfd))
|
|
7
|
+
|
|
1
8
|
# [17.46.0](https://github.com/linz/lui/compare/v17.45.4...v17.46.0) (2023-03-29)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -11,6 +11,8 @@ interface ILuiToastMessageProps {
|
|
|
11
11
|
requireDismiss?: boolean;
|
|
12
12
|
/** called when all said and done, allows the consumer to remove from React Dom */
|
|
13
13
|
onClose?: () => void;
|
|
14
|
+
/** delay before calling onClose, defaults to displayTimeout */
|
|
15
|
+
onCloseDelay?: number;
|
|
14
16
|
children?: React.ReactNode;
|
|
15
17
|
type?: 'button' | 'submit' | 'reset';
|
|
16
18
|
}
|
package/dist/index.js
CHANGED
|
@@ -12992,15 +12992,15 @@ var LuiFloatingWindow = function (props) {
|
|
|
12992
12992
|
};
|
|
12993
12993
|
|
|
12994
12994
|
var LuiToastMessage = function (_a) {
|
|
12995
|
-
var level = _a.level, _b = _a.displayTimeout, displayTimeout = _b === void 0 ? 4000 : _b, _c = _a.display, display = _c === void 0 ? true : _c, requireDismiss = _a.requireDismiss, onClose = _a.onClose, children = _a.children, type = _a.type;
|
|
12996
|
-
var
|
|
12997
|
-
var
|
|
12998
|
-
var
|
|
12995
|
+
var level = _a.level, _b = _a.displayTimeout, displayTimeout = _b === void 0 ? 4000 : _b, _c = _a.display, display = _c === void 0 ? true : _c, requireDismiss = _a.requireDismiss, onClose = _a.onClose, _d = _a.onCloseDelay, onCloseDelay = _d === void 0 ? displayTimeout : _d, children = _a.children, type = _a.type;
|
|
12996
|
+
var _e = React$1.useState('lui-msg-toast-show'), className = _e[0], setClassname = _e[1];
|
|
12997
|
+
var _f = React$1.useState(undefined), fadeOutTimer = _f[0], setFadeOutTimer = _f[1];
|
|
12998
|
+
var _g = React$1.useState(undefined), removeTimer = _g[0], setRemoveTimer = _g[1];
|
|
12999
12999
|
var materialIcon = getMaterialIconForLevel(level);
|
|
13000
13000
|
var callOnCloseAfterDissolved = function () {
|
|
13001
13001
|
// This is so the caller can remove it from the dom
|
|
13002
13002
|
if (onClose) {
|
|
13003
|
-
var timer = window.setTimeout(onClose,
|
|
13003
|
+
var timer = window.setTimeout(onClose, onCloseDelay);
|
|
13004
13004
|
setRemoveTimer(timer);
|
|
13005
13005
|
}
|
|
13006
13006
|
};
|