@alfalab/core-components-base-modal 4.1.1 → 4.1.4
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 +34 -0
- package/{dist/Component.d.ts → Component.d.ts} +0 -0
- package/{dist/Component.js → Component.js} +36 -28
- package/{dist/cssm → cssm}/Component.d.ts +0 -0
- package/{dist/cssm → cssm}/Component.js +35 -27
- package/{dist/cssm → cssm}/index.d.ts +0 -0
- package/{dist/cssm → cssm}/index.js +1 -1
- package/{dist/cssm → cssm}/index.module.css +0 -0
- package/{dist/cssm → cssm}/utils.d.ts +0 -0
- package/{dist/cssm → cssm}/utils.js +0 -0
- package/{dist/esm → esm}/Component.d.ts +0 -0
- package/{dist/esm → esm}/Component.js +37 -29
- package/{dist/modern → esm}/index.css +13 -13
- package/{dist/esm → esm}/index.d.ts +0 -0
- package/{dist/esm → esm}/index.js +1 -1
- package/{dist/esm → esm}/utils.d.ts +0 -0
- package/{dist/esm → esm}/utils.js +0 -0
- package/{dist/esm/index.css → index.css} +13 -13
- package/{dist/index.d.ts → index.d.ts} +0 -0
- package/{dist/index.js → index.js} +1 -1
- package/{dist/modern → modern}/Component.d.ts +0 -0
- package/{dist/modern → modern}/Component.js +37 -29
- package/{dist → modern}/index.css +13 -13
- package/{dist/modern → modern}/index.d.ts +0 -0
- package/{dist/modern → modern}/index.js +1 -1
- package/{dist/modern → modern}/utils.d.ts +0 -0
- package/{dist/modern → modern}/utils.js +0 -0
- package/package.json +12 -15
- /package/{dist/send-stats.js → send-stats.js} +0 -0
- /package/{dist/utils.d.ts → utils.d.ts} +0 -0
- /package/{dist/utils.js → utils.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,40 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [4.1.4](https://github.com/core-ds/core-components/compare/@alfalab/core-components-base-modal@4.1.3...@alfalab/core-components-base-modal@4.1.4) (2022-07-14)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **base-modal:** fix overflow hidden bug ([#128](https://github.com/core-ds/core-components/issues/128)) ([eb953b9](https://github.com/core-ds/core-components/commit/eb953b9866dae8c28bf8265d6884cdf1544ae63c))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [4.1.3](https://github.com/core-ds/core-components/compare/@alfalab/core-components-base-modal@4.1.2...@alfalab/core-components-base-modal@4.1.3) (2022-07-11)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **base-modal:** fix using resize observer ([#136](https://github.com/core-ds/core-components/issues/136)) ([cb8f03c](https://github.com/core-ds/core-components/commit/cb8f03ca55394316189d1d4529ee3fdb691538d9))
|
|
23
|
+
* fixed 'window is not defined' error ([#126](https://github.com/core-ds/core-components/issues/126)) ([f4e9ca5](https://github.com/core-ds/core-components/commit/f4e9ca54ed52fb328d21c85b7efa8176a90dcb6e))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
## [4.1.2](https://github.com/core-ds/core-components/compare/@alfalab/core-components-base-modal@4.1.1...@alfalab/core-components-base-modal@4.1.2) (2022-07-01)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Performance Improvements
|
|
33
|
+
|
|
34
|
+
* refuse to use a resize-observer polyfill if it is not needed ([#120](https://github.com/core-ds/core-components/issues/120)) ([f2abcb2](https://github.com/core-ds/core-components/commit/f2abcb2888dd5906b345f5fc64b1624eef56ac13))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
6
40
|
## [4.1.1](https://github.com/core-ds/core-components/compare/@alfalab/core-components-base-modal@4.1.0...@alfalab/core-components-base-modal@4.1.1) (2022-06-30)
|
|
7
41
|
|
|
8
42
|
|
|
File without changes
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var cn = require('classnames');
|
|
7
7
|
var mergeRefs = require('react-merge-refs');
|
|
8
|
-
var resizeObserver = require('resize-observer');
|
|
8
|
+
var resizeObserver = require('@juggle/resize-observer');
|
|
9
9
|
var reactTransitionGroup = require('react-transition-group');
|
|
10
10
|
var FocusLock = require('react-focus-lock');
|
|
11
11
|
var coreComponentsPortal = require('@alfalab/core-components-portal');
|
|
@@ -48,7 +48,7 @@ var __assign = function () {
|
|
|
48
48
|
return __assign.apply(this, arguments);
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
var styles = {"component":"base-
|
|
51
|
+
var styles = {"component":"base-modal__component_1bawz","wrapper":"base-modal__wrapper_1bawz","content":"base-modal__content_1bawz","hidden":"base-modal__hidden_1bawz","backdrop":"base-modal__backdrop_1bawz","appear":"base-modal__appear_1bawz","enter":"base-modal__enter_1bawz","appearActive":"base-modal__appearActive_1bawz","enterActive":"base-modal__enterActive_1bawz","exit":"base-modal__exit_1bawz","exitActive":"base-modal__exitActive_1bawz","exitDone":"base-modal__exitDone_1bawz"};
|
|
52
52
|
require('./index.css')
|
|
53
53
|
|
|
54
54
|
var BaseModalContext = React__default['default'].createContext({
|
|
@@ -66,7 +66,7 @@ var BaseModalContext = React__default['default'].createContext({
|
|
|
66
66
|
});
|
|
67
67
|
var BaseModal = React.forwardRef(function (_a, ref) {
|
|
68
68
|
var open = _a.open, container = _a.container, children = _a.children, _b = _a.scrollHandler, scrollHandler = _b === void 0 ? 'wrapper' : _b, _c = _a.Backdrop, Backdrop = _c === void 0 ? coreComponentsBackdrop.Backdrop : _c, _d = _a.backdropProps, backdropProps = _d === void 0 ? {} : _d, _e = _a.transitionProps, transitionProps = _e === void 0 ? {} : _e, disableBackdropClick = _a.disableBackdropClick, _f = _a.disableAutoFocus, disableAutoFocus = _f === void 0 ? false : _f, _g = _a.disableFocusLock, disableFocusLock = _g === void 0 ? false : _g, _h = _a.disableEscapeKeyDown, disableEscapeKeyDown = _h === void 0 ? false : _h, _j = _a.disableRestoreFocus, disableRestoreFocus = _j === void 0 ? false : _j, _k = _a.keepMounted, keepMounted = _k === void 0 ? false : _k, className = _a.className, contentClassName = _a.contentClassName, wrapperClassName = _a.wrapperClassName, onBackdropClick = _a.onBackdropClick, onClose = _a.onClose, onEscapeKeyDown = _a.onEscapeKeyDown, onMount = _a.onMount, onUnmount = _a.onUnmount, dataTestId = _a.dataTestId, _l = _a.zIndex, zIndex = _l === void 0 ? coreComponentsStack.stackingOrder.MODAL : _l, _m = _a.componentRef, componentRef = _m === void 0 ? null : _m;
|
|
69
|
-
var _o = React.useState(
|
|
69
|
+
var _o = React.useState(null), exited = _o[0], setExited = _o[1];
|
|
70
70
|
var _p = React.useState(false), hasScroll = _p[0], setHasScroll = _p[1];
|
|
71
71
|
var _q = React.useState(false), hasHeader = _q[0], setHasHeader = _q[1];
|
|
72
72
|
var _r = React.useState(false), hasFooter = _r[0], setHasFooter = _r[1];
|
|
@@ -79,6 +79,7 @@ var BaseModal = React.forwardRef(function (_a, ref) {
|
|
|
79
79
|
var contentNodeRef = React.useRef(null);
|
|
80
80
|
var restoreContainerStylesRef = React.useRef(null);
|
|
81
81
|
var mouseDownTarget = React.useRef();
|
|
82
|
+
var resizeObserverRef = React.useRef();
|
|
82
83
|
var checkToHasScrollBar = function () {
|
|
83
84
|
if (scrollableNodeRef.current) {
|
|
84
85
|
var scrollExists = utils.hasScrollbar(scrollableNodeRef.current);
|
|
@@ -86,27 +87,31 @@ var BaseModal = React.forwardRef(function (_a, ref) {
|
|
|
86
87
|
setHasScroll(scrollExists);
|
|
87
88
|
}
|
|
88
89
|
};
|
|
89
|
-
var
|
|
90
|
+
var isExited = exited || exited === null;
|
|
91
|
+
var shouldRender = keepMounted || open || !isExited;
|
|
90
92
|
var getContainer = React.useCallback(function () {
|
|
91
93
|
return (container ? container() : document.body);
|
|
92
94
|
}, [container]);
|
|
93
|
-
var resizeObserver$1 = React.useMemo(function () { return new resizeObserver.ResizeObserver(checkToHasScrollBar); }, []);
|
|
94
95
|
var addResizeHandle = React.useCallback(function () {
|
|
95
|
-
if (
|
|
96
|
-
|
|
97
|
-
if (
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
96
|
+
if (!resizeObserverRef.current)
|
|
97
|
+
return;
|
|
98
|
+
if (scrollableNodeRef.current) {
|
|
99
|
+
resizeObserverRef.current.observe(scrollableNodeRef.current);
|
|
100
|
+
}
|
|
101
|
+
if (contentNodeRef.current) {
|
|
102
|
+
resizeObserverRef.current.observe(contentNodeRef.current);
|
|
103
|
+
}
|
|
104
|
+
}, []);
|
|
105
|
+
var removeResizeHandle = React.useCallback(function () { var _a; return (_a = resizeObserverRef.current) === null || _a === void 0 ? void 0 : _a.disconnect(); }, []);
|
|
103
106
|
var contentRef = React.useCallback(function (node) {
|
|
104
107
|
if (node !== null) {
|
|
105
108
|
contentNodeRef.current = node;
|
|
106
|
-
|
|
109
|
+
if (resizeObserverRef.current) {
|
|
110
|
+
resizeObserverRef.current.observe(node);
|
|
111
|
+
}
|
|
107
112
|
checkToHasScrollBar();
|
|
108
113
|
}
|
|
109
|
-
}, [
|
|
114
|
+
}, []);
|
|
110
115
|
var handleScroll = React.useCallback(function () {
|
|
111
116
|
if (!scrollableNodeRef.current || !componentNodeRef.current)
|
|
112
117
|
return;
|
|
@@ -195,25 +200,28 @@ var BaseModal = React.forwardRef(function (_a, ref) {
|
|
|
195
200
|
}, [handleScroll, onUnmount, removeResizeHandle, transitionProps]);
|
|
196
201
|
React.useEffect(function () {
|
|
197
202
|
if (open) {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
+
if (isExited) {
|
|
204
|
+
var el_1 = getContainer();
|
|
205
|
+
utils.handleContainer(el_1);
|
|
206
|
+
restoreContainerStylesRef.current = function () {
|
|
207
|
+
restoreContainerStylesRef.current = null;
|
|
208
|
+
utils.restoreContainerStyles(el_1);
|
|
209
|
+
};
|
|
210
|
+
setExited(false);
|
|
211
|
+
}
|
|
203
212
|
}
|
|
204
|
-
}, [getContainer, open]);
|
|
205
|
-
React.useEffect(function () {
|
|
206
|
-
if (open)
|
|
207
|
-
setExited(false);
|
|
208
|
-
}, [open]);
|
|
213
|
+
}, [getContainer, open, isExited]);
|
|
209
214
|
React.useEffect(function () {
|
|
215
|
+
var ResizeObserver = window.ResizeObserver || resizeObserver.ResizeObserver;
|
|
216
|
+
resizeObserverRef.current = new ResizeObserver(checkToHasScrollBar);
|
|
210
217
|
return function () {
|
|
211
218
|
if (restoreContainerStylesRef.current) {
|
|
212
219
|
restoreContainerStylesRef.current();
|
|
213
220
|
}
|
|
214
|
-
|
|
221
|
+
if (resizeObserverRef.current) {
|
|
222
|
+
resizeObserverRef.current.disconnect();
|
|
223
|
+
}
|
|
215
224
|
};
|
|
216
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
217
225
|
}, []);
|
|
218
226
|
var contextValue = React.useMemo(function () { return ({
|
|
219
227
|
hasHeader: hasHeader,
|
|
@@ -249,7 +257,7 @@ var BaseModal = React.forwardRef(function (_a, ref) {
|
|
|
249
257
|
zIndex: computedZIndex,
|
|
250
258
|
} }))),
|
|
251
259
|
React__default['default'].createElement("div", { role: 'dialog', className: cn__default['default'](styles.wrapper, wrapperClassName, (_a = {},
|
|
252
|
-
_a[styles.hidden] = !open &&
|
|
260
|
+
_a[styles.hidden] = !open && isExited,
|
|
253
261
|
_a)), ref: mergeRefs__default['default']([ref, wrapperRef]), onKeyDown: handleKeyDown, onMouseDown: handleBackdropMouseDown, onMouseUp: handleBackdropMouseUp, tabIndex: -1, "data-test-id": dataTestId, style: {
|
|
254
262
|
zIndex: computedZIndex,
|
|
255
263
|
} },
|
|
File without changes
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var cn = require('classnames');
|
|
7
7
|
var mergeRefs = require('react-merge-refs');
|
|
8
|
-
var resizeObserver = require('resize-observer');
|
|
8
|
+
var resizeObserver = require('@juggle/resize-observer');
|
|
9
9
|
var reactTransitionGroup = require('react-transition-group');
|
|
10
10
|
var FocusLock = require('react-focus-lock');
|
|
11
11
|
var coreComponentsPortal = require('@alfalab/core-components-portal/dist/cssm');
|
|
@@ -65,7 +65,7 @@ var BaseModalContext = React__default['default'].createContext({
|
|
|
65
65
|
});
|
|
66
66
|
var BaseModal = React.forwardRef(function (_a, ref) {
|
|
67
67
|
var open = _a.open, container = _a.container, children = _a.children, _b = _a.scrollHandler, scrollHandler = _b === void 0 ? 'wrapper' : _b, _c = _a.Backdrop, Backdrop = _c === void 0 ? coreComponentsBackdrop.Backdrop : _c, _d = _a.backdropProps, backdropProps = _d === void 0 ? {} : _d, _e = _a.transitionProps, transitionProps = _e === void 0 ? {} : _e, disableBackdropClick = _a.disableBackdropClick, _f = _a.disableAutoFocus, disableAutoFocus = _f === void 0 ? false : _f, _g = _a.disableFocusLock, disableFocusLock = _g === void 0 ? false : _g, _h = _a.disableEscapeKeyDown, disableEscapeKeyDown = _h === void 0 ? false : _h, _j = _a.disableRestoreFocus, disableRestoreFocus = _j === void 0 ? false : _j, _k = _a.keepMounted, keepMounted = _k === void 0 ? false : _k, className = _a.className, contentClassName = _a.contentClassName, wrapperClassName = _a.wrapperClassName, onBackdropClick = _a.onBackdropClick, onClose = _a.onClose, onEscapeKeyDown = _a.onEscapeKeyDown, onMount = _a.onMount, onUnmount = _a.onUnmount, dataTestId = _a.dataTestId, _l = _a.zIndex, zIndex = _l === void 0 ? coreComponentsStack.stackingOrder.MODAL : _l, _m = _a.componentRef, componentRef = _m === void 0 ? null : _m;
|
|
68
|
-
var _o = React.useState(
|
|
68
|
+
var _o = React.useState(null), exited = _o[0], setExited = _o[1];
|
|
69
69
|
var _p = React.useState(false), hasScroll = _p[0], setHasScroll = _p[1];
|
|
70
70
|
var _q = React.useState(false), hasHeader = _q[0], setHasHeader = _q[1];
|
|
71
71
|
var _r = React.useState(false), hasFooter = _r[0], setHasFooter = _r[1];
|
|
@@ -78,6 +78,7 @@ var BaseModal = React.forwardRef(function (_a, ref) {
|
|
|
78
78
|
var contentNodeRef = React.useRef(null);
|
|
79
79
|
var restoreContainerStylesRef = React.useRef(null);
|
|
80
80
|
var mouseDownTarget = React.useRef();
|
|
81
|
+
var resizeObserverRef = React.useRef();
|
|
81
82
|
var checkToHasScrollBar = function () {
|
|
82
83
|
if (scrollableNodeRef.current) {
|
|
83
84
|
var scrollExists = utils.hasScrollbar(scrollableNodeRef.current);
|
|
@@ -85,27 +86,31 @@ var BaseModal = React.forwardRef(function (_a, ref) {
|
|
|
85
86
|
setHasScroll(scrollExists);
|
|
86
87
|
}
|
|
87
88
|
};
|
|
88
|
-
var
|
|
89
|
+
var isExited = exited || exited === null;
|
|
90
|
+
var shouldRender = keepMounted || open || !isExited;
|
|
89
91
|
var getContainer = React.useCallback(function () {
|
|
90
92
|
return (container ? container() : document.body);
|
|
91
93
|
}, [container]);
|
|
92
|
-
var resizeObserver$1 = React.useMemo(function () { return new resizeObserver.ResizeObserver(checkToHasScrollBar); }, []);
|
|
93
94
|
var addResizeHandle = React.useCallback(function () {
|
|
94
|
-
if (
|
|
95
|
-
|
|
96
|
-
if (
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
95
|
+
if (!resizeObserverRef.current)
|
|
96
|
+
return;
|
|
97
|
+
if (scrollableNodeRef.current) {
|
|
98
|
+
resizeObserverRef.current.observe(scrollableNodeRef.current);
|
|
99
|
+
}
|
|
100
|
+
if (contentNodeRef.current) {
|
|
101
|
+
resizeObserverRef.current.observe(contentNodeRef.current);
|
|
102
|
+
}
|
|
103
|
+
}, []);
|
|
104
|
+
var removeResizeHandle = React.useCallback(function () { var _a; return (_a = resizeObserverRef.current) === null || _a === void 0 ? void 0 : _a.disconnect(); }, []);
|
|
102
105
|
var contentRef = React.useCallback(function (node) {
|
|
103
106
|
if (node !== null) {
|
|
104
107
|
contentNodeRef.current = node;
|
|
105
|
-
|
|
108
|
+
if (resizeObserverRef.current) {
|
|
109
|
+
resizeObserverRef.current.observe(node);
|
|
110
|
+
}
|
|
106
111
|
checkToHasScrollBar();
|
|
107
112
|
}
|
|
108
|
-
}, [
|
|
113
|
+
}, []);
|
|
109
114
|
var handleScroll = React.useCallback(function () {
|
|
110
115
|
if (!scrollableNodeRef.current || !componentNodeRef.current)
|
|
111
116
|
return;
|
|
@@ -194,25 +199,28 @@ var BaseModal = React.forwardRef(function (_a, ref) {
|
|
|
194
199
|
}, [handleScroll, onUnmount, removeResizeHandle, transitionProps]);
|
|
195
200
|
React.useEffect(function () {
|
|
196
201
|
if (open) {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
+
if (isExited) {
|
|
203
|
+
var el_1 = getContainer();
|
|
204
|
+
utils.handleContainer(el_1);
|
|
205
|
+
restoreContainerStylesRef.current = function () {
|
|
206
|
+
restoreContainerStylesRef.current = null;
|
|
207
|
+
utils.restoreContainerStyles(el_1);
|
|
208
|
+
};
|
|
209
|
+
setExited(false);
|
|
210
|
+
}
|
|
202
211
|
}
|
|
203
|
-
}, [getContainer, open]);
|
|
204
|
-
React.useEffect(function () {
|
|
205
|
-
if (open)
|
|
206
|
-
setExited(false);
|
|
207
|
-
}, [open]);
|
|
212
|
+
}, [getContainer, open, isExited]);
|
|
208
213
|
React.useEffect(function () {
|
|
214
|
+
var ResizeObserver = window.ResizeObserver || resizeObserver.ResizeObserver;
|
|
215
|
+
resizeObserverRef.current = new ResizeObserver(checkToHasScrollBar);
|
|
209
216
|
return function () {
|
|
210
217
|
if (restoreContainerStylesRef.current) {
|
|
211
218
|
restoreContainerStylesRef.current();
|
|
212
219
|
}
|
|
213
|
-
|
|
220
|
+
if (resizeObserverRef.current) {
|
|
221
|
+
resizeObserverRef.current.disconnect();
|
|
222
|
+
}
|
|
214
223
|
};
|
|
215
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
216
224
|
}, []);
|
|
217
225
|
var contextValue = React.useMemo(function () { return ({
|
|
218
226
|
hasHeader: hasHeader,
|
|
@@ -248,7 +256,7 @@ var BaseModal = React.forwardRef(function (_a, ref) {
|
|
|
248
256
|
zIndex: computedZIndex,
|
|
249
257
|
} }))),
|
|
250
258
|
React__default['default'].createElement("div", { role: 'dialog', className: cn__default['default'](styles__default['default'].wrapper, wrapperClassName, (_a = {},
|
|
251
|
-
_a[styles__default['default'].hidden] = !open &&
|
|
259
|
+
_a[styles__default['default'].hidden] = !open && isExited,
|
|
252
260
|
_a)), ref: mergeRefs__default['default']([ref, wrapperRef]), onKeyDown: handleKeyDown, onMouseDown: handleBackdropMouseDown, onMouseUp: handleBackdropMouseUp, tabIndex: -1, "data-test-id": dataTestId, style: {
|
|
253
261
|
zIndex: computedZIndex,
|
|
254
262
|
} },
|
|
File without changes
|
|
@@ -6,7 +6,7 @@ var Component = require('./Component.js');
|
|
|
6
6
|
require('react');
|
|
7
7
|
require('classnames');
|
|
8
8
|
require('react-merge-refs');
|
|
9
|
-
require('resize-observer');
|
|
9
|
+
require('@juggle/resize-observer');
|
|
10
10
|
require('react-transition-group');
|
|
11
11
|
require('react-focus-lock');
|
|
12
12
|
require('@alfalab/core-components-portal/dist/cssm');
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React, { forwardRef, useState, useRef, useCallback,
|
|
1
|
+
import React, { forwardRef, useState, useRef, useCallback, useEffect, useMemo } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import mergeRefs from 'react-merge-refs';
|
|
4
|
-
import { ResizeObserver } from 'resize-observer';
|
|
4
|
+
import { ResizeObserver } from '@juggle/resize-observer';
|
|
5
5
|
import { CSSTransition } from 'react-transition-group';
|
|
6
6
|
import FocusLock from 'react-focus-lock';
|
|
7
7
|
import { Portal } from '@alfalab/core-components-portal/dist/esm';
|
|
@@ -37,7 +37,7 @@ var __assign = function () {
|
|
|
37
37
|
return __assign.apply(this, arguments);
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
var styles = {"component":"base-
|
|
40
|
+
var styles = {"component":"base-modal__component_1bawz","wrapper":"base-modal__wrapper_1bawz","content":"base-modal__content_1bawz","hidden":"base-modal__hidden_1bawz","backdrop":"base-modal__backdrop_1bawz","appear":"base-modal__appear_1bawz","enter":"base-modal__enter_1bawz","appearActive":"base-modal__appearActive_1bawz","enterActive":"base-modal__enterActive_1bawz","exit":"base-modal__exit_1bawz","exitActive":"base-modal__exitActive_1bawz","exitDone":"base-modal__exitDone_1bawz"};
|
|
41
41
|
require('./index.css')
|
|
42
42
|
|
|
43
43
|
var BaseModalContext = React.createContext({
|
|
@@ -55,7 +55,7 @@ var BaseModalContext = React.createContext({
|
|
|
55
55
|
});
|
|
56
56
|
var BaseModal = forwardRef(function (_a, ref) {
|
|
57
57
|
var open = _a.open, container = _a.container, children = _a.children, _b = _a.scrollHandler, scrollHandler = _b === void 0 ? 'wrapper' : _b, _c = _a.Backdrop, Backdrop$1 = _c === void 0 ? Backdrop : _c, _d = _a.backdropProps, backdropProps = _d === void 0 ? {} : _d, _e = _a.transitionProps, transitionProps = _e === void 0 ? {} : _e, disableBackdropClick = _a.disableBackdropClick, _f = _a.disableAutoFocus, disableAutoFocus = _f === void 0 ? false : _f, _g = _a.disableFocusLock, disableFocusLock = _g === void 0 ? false : _g, _h = _a.disableEscapeKeyDown, disableEscapeKeyDown = _h === void 0 ? false : _h, _j = _a.disableRestoreFocus, disableRestoreFocus = _j === void 0 ? false : _j, _k = _a.keepMounted, keepMounted = _k === void 0 ? false : _k, className = _a.className, contentClassName = _a.contentClassName, wrapperClassName = _a.wrapperClassName, onBackdropClick = _a.onBackdropClick, onClose = _a.onClose, onEscapeKeyDown = _a.onEscapeKeyDown, onMount = _a.onMount, onUnmount = _a.onUnmount, dataTestId = _a.dataTestId, _l = _a.zIndex, zIndex = _l === void 0 ? stackingOrder.MODAL : _l, _m = _a.componentRef, componentRef = _m === void 0 ? null : _m;
|
|
58
|
-
var _o = useState(
|
|
58
|
+
var _o = useState(null), exited = _o[0], setExited = _o[1];
|
|
59
59
|
var _p = useState(false), hasScroll = _p[0], setHasScroll = _p[1];
|
|
60
60
|
var _q = useState(false), hasHeader = _q[0], setHasHeader = _q[1];
|
|
61
61
|
var _r = useState(false), hasFooter = _r[0], setHasFooter = _r[1];
|
|
@@ -68,6 +68,7 @@ var BaseModal = forwardRef(function (_a, ref) {
|
|
|
68
68
|
var contentNodeRef = useRef(null);
|
|
69
69
|
var restoreContainerStylesRef = useRef(null);
|
|
70
70
|
var mouseDownTarget = useRef();
|
|
71
|
+
var resizeObserverRef = useRef();
|
|
71
72
|
var checkToHasScrollBar = function () {
|
|
72
73
|
if (scrollableNodeRef.current) {
|
|
73
74
|
var scrollExists = hasScrollbar(scrollableNodeRef.current);
|
|
@@ -75,27 +76,31 @@ var BaseModal = forwardRef(function (_a, ref) {
|
|
|
75
76
|
setHasScroll(scrollExists);
|
|
76
77
|
}
|
|
77
78
|
};
|
|
78
|
-
var
|
|
79
|
+
var isExited = exited || exited === null;
|
|
80
|
+
var shouldRender = keepMounted || open || !isExited;
|
|
79
81
|
var getContainer = useCallback(function () {
|
|
80
82
|
return (container ? container() : document.body);
|
|
81
83
|
}, [container]);
|
|
82
|
-
var resizeObserver = useMemo(function () { return new ResizeObserver(checkToHasScrollBar); }, []);
|
|
83
84
|
var addResizeHandle = useCallback(function () {
|
|
84
|
-
if (
|
|
85
|
-
|
|
86
|
-
if (
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
85
|
+
if (!resizeObserverRef.current)
|
|
86
|
+
return;
|
|
87
|
+
if (scrollableNodeRef.current) {
|
|
88
|
+
resizeObserverRef.current.observe(scrollableNodeRef.current);
|
|
89
|
+
}
|
|
90
|
+
if (contentNodeRef.current) {
|
|
91
|
+
resizeObserverRef.current.observe(contentNodeRef.current);
|
|
92
|
+
}
|
|
93
|
+
}, []);
|
|
94
|
+
var removeResizeHandle = useCallback(function () { var _a; return (_a = resizeObserverRef.current) === null || _a === void 0 ? void 0 : _a.disconnect(); }, []);
|
|
92
95
|
var contentRef = useCallback(function (node) {
|
|
93
96
|
if (node !== null) {
|
|
94
97
|
contentNodeRef.current = node;
|
|
95
|
-
|
|
98
|
+
if (resizeObserverRef.current) {
|
|
99
|
+
resizeObserverRef.current.observe(node);
|
|
100
|
+
}
|
|
96
101
|
checkToHasScrollBar();
|
|
97
102
|
}
|
|
98
|
-
}, [
|
|
103
|
+
}, []);
|
|
99
104
|
var handleScroll = useCallback(function () {
|
|
100
105
|
if (!scrollableNodeRef.current || !componentNodeRef.current)
|
|
101
106
|
return;
|
|
@@ -184,25 +189,28 @@ var BaseModal = forwardRef(function (_a, ref) {
|
|
|
184
189
|
}, [handleScroll, onUnmount, removeResizeHandle, transitionProps]);
|
|
185
190
|
useEffect(function () {
|
|
186
191
|
if (open) {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
+
if (isExited) {
|
|
193
|
+
var el_1 = getContainer();
|
|
194
|
+
handleContainer(el_1);
|
|
195
|
+
restoreContainerStylesRef.current = function () {
|
|
196
|
+
restoreContainerStylesRef.current = null;
|
|
197
|
+
restoreContainerStyles(el_1);
|
|
198
|
+
};
|
|
199
|
+
setExited(false);
|
|
200
|
+
}
|
|
192
201
|
}
|
|
193
|
-
}, [getContainer, open]);
|
|
194
|
-
useEffect(function () {
|
|
195
|
-
if (open)
|
|
196
|
-
setExited(false);
|
|
197
|
-
}, [open]);
|
|
202
|
+
}, [getContainer, open, isExited]);
|
|
198
203
|
useEffect(function () {
|
|
204
|
+
var ResizeObserver$1 = window.ResizeObserver || ResizeObserver;
|
|
205
|
+
resizeObserverRef.current = new ResizeObserver$1(checkToHasScrollBar);
|
|
199
206
|
return function () {
|
|
200
207
|
if (restoreContainerStylesRef.current) {
|
|
201
208
|
restoreContainerStylesRef.current();
|
|
202
209
|
}
|
|
203
|
-
|
|
210
|
+
if (resizeObserverRef.current) {
|
|
211
|
+
resizeObserverRef.current.disconnect();
|
|
212
|
+
}
|
|
204
213
|
};
|
|
205
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
206
214
|
}, []);
|
|
207
215
|
var contextValue = useMemo(function () { return ({
|
|
208
216
|
hasHeader: hasHeader,
|
|
@@ -238,7 +246,7 @@ var BaseModal = forwardRef(function (_a, ref) {
|
|
|
238
246
|
zIndex: computedZIndex,
|
|
239
247
|
} }))),
|
|
240
248
|
React.createElement("div", { role: 'dialog', className: cn(styles.wrapper, wrapperClassName, (_a = {},
|
|
241
|
-
_a[styles.hidden] = !open &&
|
|
249
|
+
_a[styles.hidden] = !open && isExited,
|
|
242
250
|
_a)), ref: mergeRefs([ref, wrapperRef]), onKeyDown: handleKeyDown, onMouseDown: handleBackdropMouseDown, onMouseUp: handleBackdropMouseUp, tabIndex: -1, "data-test-id": dataTestId, style: {
|
|
243
251
|
zIndex: computedZIndex,
|
|
244
252
|
} },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1i6t2 */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-bg-primary: #fff;
|
|
4
4
|
}
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
|
|
11
11
|
/* Hard up */
|
|
12
12
|
}
|
|
13
|
-
.base-
|
|
13
|
+
.base-modal__component_1bawz {
|
|
14
14
|
position: relative;
|
|
15
15
|
box-sizing: border-box;
|
|
16
16
|
background: var(--color-light-bg-primary);
|
|
17
17
|
margin: auto;
|
|
18
18
|
flex-shrink: 0;
|
|
19
19
|
}
|
|
20
|
-
.base-
|
|
20
|
+
.base-modal__wrapper_1bawz {
|
|
21
21
|
position: fixed;
|
|
22
22
|
top: 0;
|
|
23
23
|
left: 0;
|
|
@@ -30,33 +30,33 @@
|
|
|
30
30
|
align-items: center;
|
|
31
31
|
outline: 0;
|
|
32
32
|
}
|
|
33
|
-
.base-
|
|
33
|
+
.base-modal__content_1bawz {
|
|
34
34
|
width: 100%;
|
|
35
35
|
height: 100%;
|
|
36
36
|
display: flex;
|
|
37
37
|
flex-direction: column;
|
|
38
38
|
flex: 1;
|
|
39
39
|
}
|
|
40
|
-
.base-
|
|
40
|
+
.base-modal__hidden_1bawz {
|
|
41
41
|
display: none;
|
|
42
42
|
}
|
|
43
|
-
.base-
|
|
43
|
+
.base-modal__backdrop_1bawz {
|
|
44
44
|
z-index: 0;
|
|
45
45
|
}
|
|
46
|
-
.base-
|
|
47
|
-
.base-
|
|
46
|
+
.base-modal__appear_1bawz,
|
|
47
|
+
.base-modal__enter_1bawz {
|
|
48
48
|
opacity: 0;
|
|
49
49
|
}
|
|
50
|
-
.base-
|
|
51
|
-
.base-
|
|
50
|
+
.base-modal__appearActive_1bawz,
|
|
51
|
+
.base-modal__enterActive_1bawz {
|
|
52
52
|
opacity: 1;
|
|
53
53
|
transition: opacity 200ms ease-in;
|
|
54
54
|
}
|
|
55
|
-
.base-
|
|
55
|
+
.base-modal__exit_1bawz {
|
|
56
56
|
opacity: 1;
|
|
57
57
|
}
|
|
58
|
-
.base-
|
|
59
|
-
.base-
|
|
58
|
+
.base-modal__exitActive_1bawz,
|
|
59
|
+
.base-modal__exitDone_1bawz {
|
|
60
60
|
opacity: 0;
|
|
61
61
|
transition: opacity 200ms ease-out;
|
|
62
62
|
}
|
|
File without changes
|
|
@@ -2,7 +2,7 @@ export { BaseModal, BaseModalContext } from './Component.js';
|
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'classnames';
|
|
4
4
|
import 'react-merge-refs';
|
|
5
|
-
import 'resize-observer';
|
|
5
|
+
import '@juggle/resize-observer';
|
|
6
6
|
import 'react-transition-group';
|
|
7
7
|
import 'react-focus-lock';
|
|
8
8
|
import '@alfalab/core-components-portal/dist/esm';
|
|
File without changes
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1i6t2 */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-bg-primary: #fff;
|
|
4
4
|
}
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
|
|
11
11
|
/* Hard up */
|
|
12
12
|
}
|
|
13
|
-
.base-
|
|
13
|
+
.base-modal__component_1bawz {
|
|
14
14
|
position: relative;
|
|
15
15
|
box-sizing: border-box;
|
|
16
16
|
background: var(--color-light-bg-primary);
|
|
17
17
|
margin: auto;
|
|
18
18
|
flex-shrink: 0;
|
|
19
19
|
}
|
|
20
|
-
.base-
|
|
20
|
+
.base-modal__wrapper_1bawz {
|
|
21
21
|
position: fixed;
|
|
22
22
|
top: 0;
|
|
23
23
|
left: 0;
|
|
@@ -30,33 +30,33 @@
|
|
|
30
30
|
align-items: center;
|
|
31
31
|
outline: 0;
|
|
32
32
|
}
|
|
33
|
-
.base-
|
|
33
|
+
.base-modal__content_1bawz {
|
|
34
34
|
width: 100%;
|
|
35
35
|
height: 100%;
|
|
36
36
|
display: flex;
|
|
37
37
|
flex-direction: column;
|
|
38
38
|
flex: 1;
|
|
39
39
|
}
|
|
40
|
-
.base-
|
|
40
|
+
.base-modal__hidden_1bawz {
|
|
41
41
|
display: none;
|
|
42
42
|
}
|
|
43
|
-
.base-
|
|
43
|
+
.base-modal__backdrop_1bawz {
|
|
44
44
|
z-index: 0;
|
|
45
45
|
}
|
|
46
|
-
.base-
|
|
47
|
-
.base-
|
|
46
|
+
.base-modal__appear_1bawz,
|
|
47
|
+
.base-modal__enter_1bawz {
|
|
48
48
|
opacity: 0;
|
|
49
49
|
}
|
|
50
|
-
.base-
|
|
51
|
-
.base-
|
|
50
|
+
.base-modal__appearActive_1bawz,
|
|
51
|
+
.base-modal__enterActive_1bawz {
|
|
52
52
|
opacity: 1;
|
|
53
53
|
transition: opacity 200ms ease-in;
|
|
54
54
|
}
|
|
55
|
-
.base-
|
|
55
|
+
.base-modal__exit_1bawz {
|
|
56
56
|
opacity: 1;
|
|
57
57
|
}
|
|
58
|
-
.base-
|
|
59
|
-
.base-
|
|
58
|
+
.base-modal__exitActive_1bawz,
|
|
59
|
+
.base-modal__exitDone_1bawz {
|
|
60
60
|
opacity: 0;
|
|
61
61
|
transition: opacity 200ms ease-out;
|
|
62
62
|
}
|
|
File without changes
|
|
@@ -6,7 +6,7 @@ var Component = require('./Component.js');
|
|
|
6
6
|
require('react');
|
|
7
7
|
require('classnames');
|
|
8
8
|
require('react-merge-refs');
|
|
9
|
-
require('resize-observer');
|
|
9
|
+
require('@juggle/resize-observer');
|
|
10
10
|
require('react-transition-group');
|
|
11
11
|
require('react-focus-lock');
|
|
12
12
|
require('@alfalab/core-components-portal');
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React, { forwardRef, useState, useRef, useCallback,
|
|
1
|
+
import React, { forwardRef, useState, useRef, useCallback, useEffect, useMemo } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import mergeRefs from 'react-merge-refs';
|
|
4
|
-
import { ResizeObserver } from 'resize-observer';
|
|
4
|
+
import { ResizeObserver } from '@juggle/resize-observer';
|
|
5
5
|
import { CSSTransition } from 'react-transition-group';
|
|
6
6
|
import FocusLock from 'react-focus-lock';
|
|
7
7
|
import { Portal } from '@alfalab/core-components-portal/dist/modern';
|
|
@@ -10,7 +10,7 @@ import { stackingOrder, Stack } from '@alfalab/core-components-stack/dist/modern
|
|
|
10
10
|
import '@alfalab/core-components-global-store/dist/modern';
|
|
11
11
|
import { isScrolledToTop, isScrolledToBottom, handleContainer, restoreContainerStyles, hasScrollbar } from './utils.js';
|
|
12
12
|
|
|
13
|
-
var styles = {"component":"base-
|
|
13
|
+
var styles = {"component":"base-modal__component_1bawz","wrapper":"base-modal__wrapper_1bawz","content":"base-modal__content_1bawz","hidden":"base-modal__hidden_1bawz","backdrop":"base-modal__backdrop_1bawz","appear":"base-modal__appear_1bawz","enter":"base-modal__enter_1bawz","appearActive":"base-modal__appearActive_1bawz","enterActive":"base-modal__enterActive_1bawz","exit":"base-modal__exit_1bawz","exitActive":"base-modal__exitActive_1bawz","exitDone":"base-modal__exitDone_1bawz"};
|
|
14
14
|
require('./index.css')
|
|
15
15
|
|
|
16
16
|
/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
|
|
@@ -28,7 +28,7 @@ const BaseModalContext = React.createContext({
|
|
|
28
28
|
onClose: () => null,
|
|
29
29
|
});
|
|
30
30
|
const BaseModal = forwardRef(({ open, container, children, scrollHandler = 'wrapper', Backdrop: Backdrop$1 = Backdrop, backdropProps = {}, transitionProps = {}, disableBackdropClick, disableAutoFocus = false, disableFocusLock = false, disableEscapeKeyDown = false, disableRestoreFocus = false, keepMounted = false, className, contentClassName, wrapperClassName, onBackdropClick, onClose, onEscapeKeyDown, onMount, onUnmount, dataTestId, zIndex = stackingOrder.MODAL, componentRef = null, }, ref) => {
|
|
31
|
-
const [exited, setExited] = useState(
|
|
31
|
+
const [exited, setExited] = useState(null);
|
|
32
32
|
const [hasScroll, setHasScroll] = useState(false);
|
|
33
33
|
const [hasHeader, setHasHeader] = useState(false);
|
|
34
34
|
const [hasFooter, setHasFooter] = useState(false);
|
|
@@ -41,6 +41,7 @@ const BaseModal = forwardRef(({ open, container, children, scrollHandler = 'wrap
|
|
|
41
41
|
const contentNodeRef = useRef(null);
|
|
42
42
|
const restoreContainerStylesRef = useRef(null);
|
|
43
43
|
const mouseDownTarget = useRef();
|
|
44
|
+
const resizeObserverRef = useRef();
|
|
44
45
|
const checkToHasScrollBar = () => {
|
|
45
46
|
if (scrollableNodeRef.current) {
|
|
46
47
|
const scrollExists = hasScrollbar(scrollableNodeRef.current);
|
|
@@ -48,27 +49,31 @@ const BaseModal = forwardRef(({ open, container, children, scrollHandler = 'wrap
|
|
|
48
49
|
setHasScroll(scrollExists);
|
|
49
50
|
}
|
|
50
51
|
};
|
|
51
|
-
const
|
|
52
|
+
const isExited = exited || exited === null;
|
|
53
|
+
const shouldRender = keepMounted || open || !isExited;
|
|
52
54
|
const getContainer = useCallback(() => {
|
|
53
55
|
return (container ? container() : document.body);
|
|
54
56
|
}, [container]);
|
|
55
|
-
const resizeObserver = useMemo(() => new ResizeObserver(checkToHasScrollBar), []);
|
|
56
57
|
const addResizeHandle = useCallback(() => {
|
|
57
|
-
if (
|
|
58
|
-
|
|
59
|
-
if (
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
58
|
+
if (!resizeObserverRef.current)
|
|
59
|
+
return;
|
|
60
|
+
if (scrollableNodeRef.current) {
|
|
61
|
+
resizeObserverRef.current.observe(scrollableNodeRef.current);
|
|
62
|
+
}
|
|
63
|
+
if (contentNodeRef.current) {
|
|
64
|
+
resizeObserverRef.current.observe(contentNodeRef.current);
|
|
65
|
+
}
|
|
66
|
+
}, []);
|
|
67
|
+
const removeResizeHandle = useCallback(() => resizeObserverRef.current?.disconnect(), []);
|
|
65
68
|
const contentRef = useCallback((node) => {
|
|
66
69
|
if (node !== null) {
|
|
67
70
|
contentNodeRef.current = node;
|
|
68
|
-
|
|
71
|
+
if (resizeObserverRef.current) {
|
|
72
|
+
resizeObserverRef.current.observe(node);
|
|
73
|
+
}
|
|
69
74
|
checkToHasScrollBar();
|
|
70
75
|
}
|
|
71
|
-
}, [
|
|
76
|
+
}, []);
|
|
72
77
|
const handleScroll = useCallback(() => {
|
|
73
78
|
if (!scrollableNodeRef.current || !componentNodeRef.current)
|
|
74
79
|
return;
|
|
@@ -157,25 +162,28 @@ const BaseModal = forwardRef(({ open, container, children, scrollHandler = 'wrap
|
|
|
157
162
|
}, [handleScroll, onUnmount, removeResizeHandle, transitionProps]);
|
|
158
163
|
useEffect(() => {
|
|
159
164
|
if (open) {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
+
if (isExited) {
|
|
166
|
+
const el = getContainer();
|
|
167
|
+
handleContainer(el);
|
|
168
|
+
restoreContainerStylesRef.current = () => {
|
|
169
|
+
restoreContainerStylesRef.current = null;
|
|
170
|
+
restoreContainerStyles(el);
|
|
171
|
+
};
|
|
172
|
+
setExited(false);
|
|
173
|
+
}
|
|
165
174
|
}
|
|
166
|
-
}, [getContainer, open]);
|
|
167
|
-
useEffect(() => {
|
|
168
|
-
if (open)
|
|
169
|
-
setExited(false);
|
|
170
|
-
}, [open]);
|
|
175
|
+
}, [getContainer, open, isExited]);
|
|
171
176
|
useEffect(() => {
|
|
177
|
+
const ResizeObserver$1 = window.ResizeObserver || ResizeObserver;
|
|
178
|
+
resizeObserverRef.current = new ResizeObserver$1(checkToHasScrollBar);
|
|
172
179
|
return () => {
|
|
173
180
|
if (restoreContainerStylesRef.current) {
|
|
174
181
|
restoreContainerStylesRef.current();
|
|
175
182
|
}
|
|
176
|
-
|
|
183
|
+
if (resizeObserverRef.current) {
|
|
184
|
+
resizeObserverRef.current.disconnect();
|
|
185
|
+
}
|
|
177
186
|
};
|
|
178
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
179
187
|
}, []);
|
|
180
188
|
const contextValue = useMemo(() => ({
|
|
181
189
|
hasHeader,
|
|
@@ -209,7 +217,7 @@ const BaseModal = forwardRef(({ open, container, children, scrollHandler = 'wrap
|
|
|
209
217
|
zIndex: computedZIndex,
|
|
210
218
|
} }))),
|
|
211
219
|
React.createElement("div", { role: 'dialog', className: cn(styles.wrapper, wrapperClassName, {
|
|
212
|
-
[styles.hidden]: !open &&
|
|
220
|
+
[styles.hidden]: !open && isExited,
|
|
213
221
|
}), ref: mergeRefs([ref, wrapperRef]), onKeyDown: handleKeyDown, onMouseDown: handleBackdropMouseDown, onMouseUp: handleBackdropMouseUp, tabIndex: -1, "data-test-id": dataTestId, style: {
|
|
214
222
|
zIndex: computedZIndex,
|
|
215
223
|
} },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1i6t2 */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-bg-primary: #fff;
|
|
4
4
|
}
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
|
|
11
11
|
/* Hard up */
|
|
12
12
|
}
|
|
13
|
-
.base-
|
|
13
|
+
.base-modal__component_1bawz {
|
|
14
14
|
position: relative;
|
|
15
15
|
box-sizing: border-box;
|
|
16
16
|
background: var(--color-light-bg-primary);
|
|
17
17
|
margin: auto;
|
|
18
18
|
flex-shrink: 0;
|
|
19
19
|
}
|
|
20
|
-
.base-
|
|
20
|
+
.base-modal__wrapper_1bawz {
|
|
21
21
|
position: fixed;
|
|
22
22
|
top: 0;
|
|
23
23
|
left: 0;
|
|
@@ -30,33 +30,33 @@
|
|
|
30
30
|
align-items: center;
|
|
31
31
|
outline: 0;
|
|
32
32
|
}
|
|
33
|
-
.base-
|
|
33
|
+
.base-modal__content_1bawz {
|
|
34
34
|
width: 100%;
|
|
35
35
|
height: 100%;
|
|
36
36
|
display: flex;
|
|
37
37
|
flex-direction: column;
|
|
38
38
|
flex: 1;
|
|
39
39
|
}
|
|
40
|
-
.base-
|
|
40
|
+
.base-modal__hidden_1bawz {
|
|
41
41
|
display: none;
|
|
42
42
|
}
|
|
43
|
-
.base-
|
|
43
|
+
.base-modal__backdrop_1bawz {
|
|
44
44
|
z-index: 0;
|
|
45
45
|
}
|
|
46
|
-
.base-
|
|
47
|
-
.base-
|
|
46
|
+
.base-modal__appear_1bawz,
|
|
47
|
+
.base-modal__enter_1bawz {
|
|
48
48
|
opacity: 0;
|
|
49
49
|
}
|
|
50
|
-
.base-
|
|
51
|
-
.base-
|
|
50
|
+
.base-modal__appearActive_1bawz,
|
|
51
|
+
.base-modal__enterActive_1bawz {
|
|
52
52
|
opacity: 1;
|
|
53
53
|
transition: opacity 200ms ease-in;
|
|
54
54
|
}
|
|
55
|
-
.base-
|
|
55
|
+
.base-modal__exit_1bawz {
|
|
56
56
|
opacity: 1;
|
|
57
57
|
}
|
|
58
|
-
.base-
|
|
59
|
-
.base-
|
|
58
|
+
.base-modal__exitActive_1bawz,
|
|
59
|
+
.base-modal__exitDone_1bawz {
|
|
60
60
|
opacity: 0;
|
|
61
61
|
transition: opacity 200ms ease-out;
|
|
62
62
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,35 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-base-modal",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.4",
|
|
4
4
|
"description": "BaseModal component",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"main": "
|
|
8
|
-
"files": [
|
|
9
|
-
"dist"
|
|
10
|
-
],
|
|
7
|
+
"main": "index.js",
|
|
11
8
|
"scripts": {
|
|
12
|
-
"postinstall": "node ./
|
|
9
|
+
"postinstall": "node ./send-stats.js > /dev/null 2>&1 || exit 0"
|
|
13
10
|
},
|
|
14
11
|
"publishConfig": {
|
|
15
|
-
"access": "public"
|
|
12
|
+
"access": "public",
|
|
13
|
+
"directory": "dist"
|
|
16
14
|
},
|
|
17
15
|
"dependencies": {
|
|
18
|
-
"@alfalab/core-components-backdrop": "^2.1.
|
|
19
|
-
"@alfalab/core-components-global-store": "^1.1.
|
|
20
|
-
"@alfalab/core-components-portal": "^2.0.
|
|
21
|
-
"@alfalab/core-components-stack": "^3.0.
|
|
16
|
+
"@alfalab/core-components-backdrop": "^2.1.1",
|
|
17
|
+
"@alfalab/core-components-global-store": "^1.1.2",
|
|
18
|
+
"@alfalab/core-components-portal": "^2.0.4",
|
|
19
|
+
"@alfalab/core-components-stack": "^3.0.4",
|
|
20
|
+
"@juggle/resize-observer": "^3.3.1",
|
|
22
21
|
"classnames": "^2.2.6",
|
|
23
22
|
"react-focus-lock": "^2.5.0",
|
|
24
23
|
"react-merge-refs": "^1.1.0",
|
|
25
|
-
"react-transition-group": "^4.4.1"
|
|
26
|
-
"resize-observer": "^1.0.0"
|
|
24
|
+
"react-transition-group": "^4.4.1"
|
|
27
25
|
},
|
|
28
26
|
"devDependencies": {
|
|
29
27
|
"@types/react-transition-group": "^4.2.4"
|
|
30
28
|
},
|
|
31
29
|
"peerDependencies": {
|
|
32
30
|
"react": "^16.9.0 || ^17.0.1"
|
|
33
|
-
}
|
|
34
|
-
"gitHead": "7faa1479f68e818fde406010fe07b8ee126deffb"
|
|
31
|
+
}
|
|
35
32
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|