@steroidsjs/core 2.2.61 → 2.2.62

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steroidsjs/core",
3
- "version": "2.2.61",
3
+ "version": "2.2.62",
4
4
  "description": "",
5
5
  "author": "Vladimir Kozhin <hello@kozhindev.com>",
6
6
  "repository": {
@@ -25,12 +25,16 @@ export interface IModalProps {
25
25
  */
26
26
  controls?: IControlItem[];
27
27
  /**
28
- * Время, через которое произойдет закрытие Modal.
29
- * В этот отрезок времени должны происходить все анимации закрытия компонента.
28
+ * Время, в течение которого будет происходить анимация закрытия Modal.
30
29
  * Переопределяет отрезок времени, заданный в ModalPortal
31
30
  * @example 300
32
31
  */
33
32
  closeTimeoutMs?: number;
33
+ /**
34
+ * Время, через которое автоматически произойдет закрытие Modal.
35
+ * @example 1000
36
+ */
37
+ closeAfterMs?: number;
34
38
  /**
35
39
  * Группа Modal
36
40
  * @example 'modal'
@@ -36,6 +36,11 @@ function Modal(props) {
36
36
  var components = hooks_1.useComponents();
37
37
  var ModalView = props.view || components.ui.getView('modal.ModalView');
38
38
  var ContentComponent = props.component;
39
+ React.useEffect(function () {
40
+ if (props.closeAfterMs) {
41
+ setTimeout(function () { return props.onClose(); }, props.closeAfterMs);
42
+ }
43
+ }, []);
39
44
  return (React.createElement(ModalView, __assign({}, props), (ContentComponent && (React.createElement(ContentComponent, __assign({}, props, props.componentProps)))) || (props.children)));
40
45
  }
41
46
  Modal.defaultProps = {