@alfalab/core-components-modal 8.0.9 → 8.1.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/Component.js +3 -3
- package/components/content/Component.js +3 -3
- package/components/content/desktop.css +7 -7
- package/components/content/index.css +4 -4
- package/components/content/mobile.css +3 -3
- package/components/footer/Component.js +4 -4
- package/components/footer/desktop.css +9 -9
- package/components/footer/index.css +4 -4
- package/components/footer/layout.css +29 -29
- package/components/footer/mobile.css +3 -3
- package/components/header/Component.js +3 -3
- package/components/header/desktop.css +15 -15
- package/components/header/index.css +4 -4
- package/components/header/mobile.css +4 -4
- package/cssm/desktop/index.d.ts +2 -0
- package/cssm/desktop/index.js +34 -0
- package/cssm/mobile/index.d.ts +2 -0
- package/cssm/mobile/index.js +34 -0
- package/cssm/shared/index.d.ts +1 -0
- package/cssm/{shared.js → shared/index.js} +1 -1
- package/cssm/utils.d.ts +1 -5
- package/cssm/utils.js +0 -78
- package/desktop/index.d.ts +2 -0
- package/{desktop.js → desktop/index.js} +7 -7
- package/desktop/package.json +3 -0
- package/desktop.css +9 -9
- package/esm/Component.js +3 -3
- package/esm/components/content/Component.js +3 -3
- package/esm/components/content/desktop.css +7 -7
- package/esm/components/content/index.css +4 -4
- package/esm/components/content/mobile.css +3 -3
- package/esm/components/footer/Component.js +4 -4
- package/esm/components/footer/desktop.css +9 -9
- package/esm/components/footer/index.css +4 -4
- package/esm/components/footer/layout.css +29 -29
- package/esm/components/footer/mobile.css +3 -3
- package/esm/components/header/Component.js +3 -3
- package/esm/components/header/desktop.css +15 -15
- package/esm/components/header/index.css +4 -4
- package/esm/components/header/mobile.css +4 -4
- package/esm/desktop/index.d.ts +2 -0
- package/esm/desktop/index.js +13 -0
- package/esm/desktop.css +9 -9
- package/esm/mobile/index.d.ts +2 -0
- package/esm/mobile/index.js +13 -0
- package/esm/mobile.css +2 -2
- package/esm/shared/index.d.ts +1 -0
- package/esm/{shared.js → shared/index.js} +1 -1
- package/esm/transitions.css +8 -8
- package/esm/utils.d.ts +1 -5
- package/esm/utils.js +0 -72
- package/mobile/index.d.ts +2 -0
- package/{mobile.js → mobile/index.js} +7 -7
- package/mobile/package.json +3 -0
- package/mobile.css +2 -2
- package/modern/Component.js +3 -3
- package/modern/components/content/Component.js +3 -3
- package/modern/components/content/desktop.css +7 -7
- package/modern/components/content/index.css +4 -4
- package/modern/components/content/mobile.css +3 -3
- package/modern/components/footer/Component.js +4 -4
- package/modern/components/footer/desktop.css +9 -9
- package/modern/components/footer/index.css +4 -4
- package/modern/components/footer/layout.css +29 -29
- package/modern/components/footer/mobile.css +3 -3
- package/modern/components/header/Component.js +3 -3
- package/modern/components/header/desktop.css +15 -15
- package/modern/components/header/index.css +4 -4
- package/modern/components/header/mobile.css +4 -4
- package/modern/desktop/index.d.ts +2 -0
- package/modern/desktop/index.js +12 -0
- package/modern/desktop.css +9 -9
- package/modern/mobile/index.d.ts +2 -0
- package/modern/mobile/index.js +12 -0
- package/modern/mobile.css +2 -2
- package/modern/shared/index.d.ts +1 -0
- package/modern/{shared.js → shared/index.js} +1 -1
- package/modern/transitions.css +8 -8
- package/modern/utils.d.ts +1 -5
- package/modern/utils.js +0 -71
- package/package.json +3 -27
- package/shared/index.d.ts +1 -0
- package/{shared.js → shared/index.js} +1 -1
- package/shared/package.json +3 -0
- package/src/desktop/index.ts +2 -0
- package/src/desktop/package.json +3 -0
- package/src/mobile/index.ts +2 -0
- package/src/mobile/package.json +3 -0
- package/src/shared/index.ts +1 -0
- package/src/shared/package.json +3 -0
- package/src/utils.ts +0 -90
- package/transitions.css +8 -8
- package/utils.d.ts +1 -5
- package/utils.js +0 -78
- package/cssm/desktop.d.ts +0 -2
- package/cssm/desktop.js +0 -34
- package/cssm/mobile.d.ts +0 -2
- package/cssm/mobile.js +0 -34
- package/cssm/shared.d.ts +0 -1
- package/desktop.d.ts +0 -2
- package/esm/desktop.d.ts +0 -2
- package/esm/desktop.js +0 -13
- package/esm/mobile.d.ts +0 -2
- package/esm/mobile.js +0 -13
- package/esm/shared.d.ts +0 -1
- package/mobile.d.ts +0 -2
- package/modern/desktop.d.ts +0 -2
- package/modern/desktop.js +0 -12
- package/modern/mobile.d.ts +0 -2
- package/modern/mobile.js +0 -12
- package/modern/shared.d.ts +0 -1
- package/shared.d.ts +0 -1
- package/src/desktop.ts +0 -2
- package/src/mobile.ts +0 -2
- package/src/shared.ts +0 -1
package/modern/desktop.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 175a4 */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
4
4
|
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
@@ -35,25 +35,25 @@
|
|
|
35
35
|
/* mobile */
|
|
36
36
|
|
|
37
37
|
/* paddings */
|
|
38
|
-
} .
|
|
38
|
+
} .modal__wrapper_167uq {
|
|
39
39
|
padding-top: var(--modal-vertical-padding);
|
|
40
40
|
padding-bottom: var(--modal-vertical-padding);
|
|
41
|
-
} .
|
|
41
|
+
} .modal__component_167uq {
|
|
42
42
|
width: 100%;
|
|
43
43
|
max-width: 100%;
|
|
44
44
|
border-radius: var(--modal-border-radius);
|
|
45
|
-
} .
|
|
45
|
+
} .modal__fullscreen_167uq {
|
|
46
46
|
padding-top: 0;
|
|
47
47
|
padding-bottom: 0
|
|
48
|
-
} .
|
|
48
|
+
} .modal__fullscreen_167uq .modal__component_167uq {
|
|
49
49
|
flex: 1;
|
|
50
50
|
border-radius: 0;
|
|
51
|
-
} .
|
|
51
|
+
} .modal__s_167uq {
|
|
52
52
|
width: var(--modal-s-width);
|
|
53
|
-
} .
|
|
53
|
+
} .modal__m_167uq {
|
|
54
54
|
width: var(--modal-m-width);
|
|
55
|
-
} .
|
|
55
|
+
} .modal__l_167uq {
|
|
56
56
|
width: var(--modal-l-width);
|
|
57
|
-
} .
|
|
57
|
+
} .modal__xl_167uq {
|
|
58
58
|
width: var(--modal-xl-width);
|
|
59
59
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { ModalMobile } from '../Component.mobile.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '../components/content/Component.js';
|
|
4
|
+
import 'classnames';
|
|
5
|
+
import '../Context.js';
|
|
6
|
+
import '@alfalab/core-components-base-modal/modern';
|
|
7
|
+
import '../ResponsiveContext.js';
|
|
8
|
+
import '../components/footer/Component.js';
|
|
9
|
+
import '../components/header/Component.js';
|
|
10
|
+
import '@alfalab/core-components-navigation-bar/modern';
|
|
11
|
+
import '../Component.js';
|
|
12
|
+
import 'react-merge-refs';
|
package/modern/mobile.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: twr8l */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
4
4
|
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
/* mobile */
|
|
28
28
|
|
|
29
29
|
/* paddings */
|
|
30
|
-
} .
|
|
30
|
+
} .modal__component_5uq6m {
|
|
31
31
|
flex: 1;
|
|
32
32
|
width: 100%;
|
|
33
33
|
max-width: 600px;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ModalContext } from "../Context";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ModalContext } from '
|
|
1
|
+
export { ModalContext } from '../Context.js';
|
|
2
2
|
import '@alfalab/core-components-base-modal/modern';
|
package/modern/transitions.css
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
/* hash:
|
|
2
|
-
.
|
|
3
|
-
.
|
|
1
|
+
/* hash: 8q831 */
|
|
2
|
+
.modal__appear_1gfnf,
|
|
3
|
+
.modal__enter_1gfnf {
|
|
4
4
|
opacity: 0;
|
|
5
5
|
transform: translateY(15px);
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
.
|
|
9
|
-
.
|
|
8
|
+
.modal__appearActive_1gfnf,
|
|
9
|
+
.modal__enterActive_1gfnf {
|
|
10
10
|
opacity: 1;
|
|
11
11
|
transform: translateY(0);
|
|
12
12
|
transition: opacity 200ms ease-in, transform 200ms ease-in;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
.
|
|
15
|
+
.modal__exit_1gfnf {
|
|
16
16
|
opacity: 1;
|
|
17
17
|
transform: translateY(0);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
.
|
|
21
|
-
.
|
|
20
|
+
.modal__exitActive_1gfnf,
|
|
21
|
+
.modal__exitDone_1gfnf {
|
|
22
22
|
opacity: 0;
|
|
23
23
|
transform: translateY(15px);
|
|
24
24
|
transition: opacity 200ms ease-out, transform 200ms ease-out;
|
package/modern/utils.d.ts
CHANGED
|
@@ -1,5 +1 @@
|
|
|
1
|
-
|
|
2
|
-
declare function isScrolledToBottom(target: HTMLElement): boolean;
|
|
3
|
-
declare function hasScrollbar(target: HTMLElement): boolean;
|
|
4
|
-
declare const handleContainer: (container: HTMLElement) => () => void;
|
|
5
|
-
export { isScrolledToTop, isScrolledToBottom, hasScrollbar, handleContainer };
|
|
1
|
+
export {};
|
package/modern/utils.js
CHANGED
|
@@ -1,72 +1 @@
|
|
|
1
|
-
function isScrolledToTop(target) {
|
|
2
|
-
return target.scrollTop === 0;
|
|
3
|
-
}
|
|
4
|
-
function isScrolledToBottom(target) {
|
|
5
|
-
return target.scrollHeight - target.offsetHeight === target.scrollTop;
|
|
6
|
-
}
|
|
7
|
-
function hasScrollbar(target) {
|
|
8
|
-
return target.scrollHeight > target.clientHeight;
|
|
9
|
-
}
|
|
10
|
-
const getScrollbarSize = () => {
|
|
11
|
-
const scrollDiv = document.createElement('div');
|
|
12
|
-
scrollDiv.style.width = '99px';
|
|
13
|
-
scrollDiv.style.height = '99px';
|
|
14
|
-
scrollDiv.style.position = 'absolute';
|
|
15
|
-
scrollDiv.style.top = '-9999px';
|
|
16
|
-
scrollDiv.style.overflow = 'scroll';
|
|
17
|
-
document.body.appendChild(scrollDiv);
|
|
18
|
-
const scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth;
|
|
19
|
-
document.body.removeChild(scrollDiv);
|
|
20
|
-
return scrollbarSize;
|
|
21
|
-
};
|
|
22
|
-
const isOverflowing = (container) => {
|
|
23
|
-
if (document.body === container) {
|
|
24
|
-
return window.innerWidth > document.documentElement.clientWidth;
|
|
25
|
-
}
|
|
26
|
-
return container.scrollHeight > container.clientHeight;
|
|
27
|
-
};
|
|
28
|
-
const getPaddingRight = (node) => parseInt(window.getComputedStyle(node).paddingRight, 10) || 0;
|
|
29
|
-
const handleContainer = (container) => {
|
|
30
|
-
const restoreStyle = [];
|
|
31
|
-
if (isOverflowing(container)) {
|
|
32
|
-
// Вычисляет размер до применения `overflow hidden` для избежания скачков
|
|
33
|
-
const scrollbarSize = getScrollbarSize();
|
|
34
|
-
restoreStyle.push({
|
|
35
|
-
value: container.style.paddingRight,
|
|
36
|
-
key: 'padding-right',
|
|
37
|
-
el: container,
|
|
38
|
-
});
|
|
39
|
-
// Вычисляем стили, чтобы получить реальный `padding` c шириной сколлбара
|
|
40
|
-
// eslint-disable-next-line no-param-reassign
|
|
41
|
-
container.style.paddingRight = `${getPaddingRight(container) + scrollbarSize}px`;
|
|
42
|
-
}
|
|
43
|
-
const parent = container.parentElement;
|
|
44
|
-
const scrollContainer =
|
|
45
|
-
// TODO: заменить на optional chaining
|
|
46
|
-
parent &&
|
|
47
|
-
parent.nodeName === 'HTML' &&
|
|
48
|
-
window.getComputedStyle(parent).overflowY === 'scroll'
|
|
49
|
-
? parent
|
|
50
|
-
: container;
|
|
51
|
-
// Блокируем скролл даже если отсутствует скроллбар
|
|
52
|
-
if (scrollContainer.style.overflow !== 'hidden') {
|
|
53
|
-
restoreStyle.push({
|
|
54
|
-
value: scrollContainer.style.overflow,
|
|
55
|
-
key: 'overflow',
|
|
56
|
-
el: scrollContainer,
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
scrollContainer.style.overflow = 'hidden';
|
|
60
|
-
return () => {
|
|
61
|
-
restoreStyle.forEach(({ value, el, key }) => {
|
|
62
|
-
if (value) {
|
|
63
|
-
el.style.setProperty(key, value);
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
el.style.removeProperty(key);
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
1
|
|
|
72
|
-
export { handleContainer, hasScrollbar, isScrolledToBottom, isScrolledToTop };
|
package/package.json
CHANGED
|
@@ -1,42 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-modal",
|
|
3
|
-
"version": "8.0
|
|
3
|
+
"version": "8.1.0",
|
|
4
4
|
"description": "Modal component",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"module": "./esm/index.js",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"import": "./esm/index.js",
|
|
12
|
-
"require": "./index.js"
|
|
13
|
-
},
|
|
14
|
-
"./mobile": {
|
|
15
|
-
"import": "./esm/mobile.js",
|
|
16
|
-
"require": "./mobile.js"
|
|
17
|
-
},
|
|
18
|
-
"./desktop": {
|
|
19
|
-
"import": "./esm/desktop.js",
|
|
20
|
-
"require": "./desktop.js"
|
|
21
|
-
},
|
|
22
|
-
"./shared": {
|
|
23
|
-
"import": "./esm/shared.js",
|
|
24
|
-
"require": "./shared.js"
|
|
25
|
-
},
|
|
26
|
-
"./esm": "./esm/index.js",
|
|
27
|
-
"./cssm": "./cssm/index.js",
|
|
28
|
-
"./modern": "./modern/index.js",
|
|
29
|
-
"./esm/*": "./esm/*",
|
|
30
|
-
"./cssm/*": "./cssm/*",
|
|
31
|
-
"./modern/*": "./modern/*"
|
|
32
|
-
},
|
|
33
9
|
"publishConfig": {
|
|
34
10
|
"access": "public",
|
|
35
11
|
"directory": "dist"
|
|
36
12
|
},
|
|
37
13
|
"dependencies": {
|
|
38
|
-
"@alfalab/core-components-base-modal": "^5.
|
|
39
|
-
"@alfalab/core-components-navigation-bar": "^0.5.
|
|
14
|
+
"@alfalab/core-components-base-modal": "^5.5.0",
|
|
15
|
+
"@alfalab/core-components-navigation-bar": "^0.5.9",
|
|
40
16
|
"@alfalab/hooks": "^1.13.0",
|
|
41
17
|
"classnames": "^2.3.1",
|
|
42
18
|
"react-merge-refs": "^1.1.0",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ModalContext } from "../Context";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ModalContext } from '../Context';
|
package/src/utils.ts
CHANGED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
export function isScrolledToTop(target: HTMLElement) {
|
|
2
|
-
return target.scrollTop === 0;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
export function isScrolledToBottom(target: HTMLElement) {
|
|
6
|
-
return target.scrollHeight - target.offsetHeight === target.scrollTop;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function hasScrollbar(target: HTMLElement) {
|
|
10
|
-
return target.scrollHeight > target.clientHeight;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const getScrollbarSize = () => {
|
|
14
|
-
const scrollDiv = document.createElement('div');
|
|
15
|
-
|
|
16
|
-
scrollDiv.style.width = '99px';
|
|
17
|
-
scrollDiv.style.height = '99px';
|
|
18
|
-
scrollDiv.style.position = 'absolute';
|
|
19
|
-
scrollDiv.style.top = '-9999px';
|
|
20
|
-
scrollDiv.style.overflow = 'scroll';
|
|
21
|
-
|
|
22
|
-
document.body.appendChild(scrollDiv);
|
|
23
|
-
const scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth;
|
|
24
|
-
|
|
25
|
-
document.body.removeChild(scrollDiv);
|
|
26
|
-
|
|
27
|
-
return scrollbarSize;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const isOverflowing = (container: Element) => {
|
|
31
|
-
if (document.body === container) {
|
|
32
|
-
return window.innerWidth > document.documentElement.clientWidth;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return container.scrollHeight > container.clientHeight;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const getPaddingRight = (node: Element) =>
|
|
39
|
-
parseInt(window.getComputedStyle(node).paddingRight, 10) || 0;
|
|
40
|
-
|
|
41
|
-
export const handleContainer = (container: HTMLElement) => {
|
|
42
|
-
const restoreStyle: Array<{
|
|
43
|
-
value: string;
|
|
44
|
-
key: string;
|
|
45
|
-
el: HTMLElement;
|
|
46
|
-
}> = [];
|
|
47
|
-
|
|
48
|
-
if (isOverflowing(container)) {
|
|
49
|
-
// Вычисляет размер до применения `overflow hidden` для избежания скачков
|
|
50
|
-
const scrollbarSize = getScrollbarSize();
|
|
51
|
-
|
|
52
|
-
restoreStyle.push({
|
|
53
|
-
value: container.style.paddingRight,
|
|
54
|
-
key: 'padding-right',
|
|
55
|
-
el: container,
|
|
56
|
-
});
|
|
57
|
-
// Вычисляем стили, чтобы получить реальный `padding` c шириной сколлбара
|
|
58
|
-
// eslint-disable-next-line no-param-reassign
|
|
59
|
-
container.style.paddingRight = `${getPaddingRight(container) + scrollbarSize}px`;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const parent = container.parentElement;
|
|
63
|
-
const scrollContainer =
|
|
64
|
-
// TODO: заменить на optional chaining
|
|
65
|
-
parent &&
|
|
66
|
-
parent.nodeName === 'HTML' &&
|
|
67
|
-
window.getComputedStyle(parent).overflowY === 'scroll'
|
|
68
|
-
? parent
|
|
69
|
-
: container;
|
|
70
|
-
|
|
71
|
-
// Блокируем скролл даже если отсутствует скроллбар
|
|
72
|
-
if (scrollContainer.style.overflow !== 'hidden') {
|
|
73
|
-
restoreStyle.push({
|
|
74
|
-
value: scrollContainer.style.overflow,
|
|
75
|
-
key: 'overflow',
|
|
76
|
-
el: scrollContainer,
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
scrollContainer.style.overflow = 'hidden';
|
|
80
|
-
|
|
81
|
-
return () => {
|
|
82
|
-
restoreStyle.forEach(({ value, el, key }) => {
|
|
83
|
-
if (value) {
|
|
84
|
-
el.style.setProperty(key, value);
|
|
85
|
-
} else {
|
|
86
|
-
el.style.removeProperty(key);
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
};
|
|
90
|
-
};
|
package/transitions.css
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
/* hash:
|
|
2
|
-
.
|
|
3
|
-
.
|
|
1
|
+
/* hash: 8q831 */
|
|
2
|
+
.modal__appear_1gfnf,
|
|
3
|
+
.modal__enter_1gfnf {
|
|
4
4
|
opacity: 0;
|
|
5
5
|
transform: translateY(15px);
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
.
|
|
9
|
-
.
|
|
8
|
+
.modal__appearActive_1gfnf,
|
|
9
|
+
.modal__enterActive_1gfnf {
|
|
10
10
|
opacity: 1;
|
|
11
11
|
transform: translateY(0);
|
|
12
12
|
transition: opacity 200ms ease-in, transform 200ms ease-in;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
.
|
|
15
|
+
.modal__exit_1gfnf {
|
|
16
16
|
opacity: 1;
|
|
17
17
|
transform: translateY(0);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
.
|
|
21
|
-
.
|
|
20
|
+
.modal__exitActive_1gfnf,
|
|
21
|
+
.modal__exitDone_1gfnf {
|
|
22
22
|
opacity: 0;
|
|
23
23
|
transform: translateY(15px);
|
|
24
24
|
transition: opacity 200ms ease-out, transform 200ms ease-out;
|
package/utils.d.ts
CHANGED
|
@@ -1,5 +1 @@
|
|
|
1
|
-
|
|
2
|
-
declare function isScrolledToBottom(target: HTMLElement): boolean;
|
|
3
|
-
declare function hasScrollbar(target: HTMLElement): boolean;
|
|
4
|
-
declare const handleContainer: (container: HTMLElement) => () => void;
|
|
5
|
-
export { isScrolledToTop, isScrolledToBottom, hasScrollbar, handleContainer };
|
|
1
|
+
export {};
|
package/utils.js
CHANGED
|
@@ -1,80 +1,2 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
function isScrolledToTop(target) {
|
|
6
|
-
return target.scrollTop === 0;
|
|
7
|
-
}
|
|
8
|
-
function isScrolledToBottom(target) {
|
|
9
|
-
return target.scrollHeight - target.offsetHeight === target.scrollTop;
|
|
10
|
-
}
|
|
11
|
-
function hasScrollbar(target) {
|
|
12
|
-
return target.scrollHeight > target.clientHeight;
|
|
13
|
-
}
|
|
14
|
-
var getScrollbarSize = function () {
|
|
15
|
-
var scrollDiv = document.createElement('div');
|
|
16
|
-
scrollDiv.style.width = '99px';
|
|
17
|
-
scrollDiv.style.height = '99px';
|
|
18
|
-
scrollDiv.style.position = 'absolute';
|
|
19
|
-
scrollDiv.style.top = '-9999px';
|
|
20
|
-
scrollDiv.style.overflow = 'scroll';
|
|
21
|
-
document.body.appendChild(scrollDiv);
|
|
22
|
-
var scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth;
|
|
23
|
-
document.body.removeChild(scrollDiv);
|
|
24
|
-
return scrollbarSize;
|
|
25
|
-
};
|
|
26
|
-
var isOverflowing = function (container) {
|
|
27
|
-
if (document.body === container) {
|
|
28
|
-
return window.innerWidth > document.documentElement.clientWidth;
|
|
29
|
-
}
|
|
30
|
-
return container.scrollHeight > container.clientHeight;
|
|
31
|
-
};
|
|
32
|
-
var getPaddingRight = function (node) { return parseInt(window.getComputedStyle(node).paddingRight, 10) || 0; };
|
|
33
|
-
var handleContainer = function (container) {
|
|
34
|
-
var restoreStyle = [];
|
|
35
|
-
if (isOverflowing(container)) {
|
|
36
|
-
// Вычисляет размер до применения `overflow hidden` для избежания скачков
|
|
37
|
-
var scrollbarSize = getScrollbarSize();
|
|
38
|
-
restoreStyle.push({
|
|
39
|
-
value: container.style.paddingRight,
|
|
40
|
-
key: 'padding-right',
|
|
41
|
-
el: container,
|
|
42
|
-
});
|
|
43
|
-
// Вычисляем стили, чтобы получить реальный `padding` c шириной сколлбара
|
|
44
|
-
// eslint-disable-next-line no-param-reassign
|
|
45
|
-
container.style.paddingRight = "".concat(getPaddingRight(container) + scrollbarSize, "px");
|
|
46
|
-
}
|
|
47
|
-
var parent = container.parentElement;
|
|
48
|
-
var scrollContainer =
|
|
49
|
-
// TODO: заменить на optional chaining
|
|
50
|
-
parent &&
|
|
51
|
-
parent.nodeName === 'HTML' &&
|
|
52
|
-
window.getComputedStyle(parent).overflowY === 'scroll'
|
|
53
|
-
? parent
|
|
54
|
-
: container;
|
|
55
|
-
// Блокируем скролл даже если отсутствует скроллбар
|
|
56
|
-
if (scrollContainer.style.overflow !== 'hidden') {
|
|
57
|
-
restoreStyle.push({
|
|
58
|
-
value: scrollContainer.style.overflow,
|
|
59
|
-
key: 'overflow',
|
|
60
|
-
el: scrollContainer,
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
scrollContainer.style.overflow = 'hidden';
|
|
64
|
-
return function () {
|
|
65
|
-
restoreStyle.forEach(function (_a) {
|
|
66
|
-
var value = _a.value, el = _a.el, key = _a.key;
|
|
67
|
-
if (value) {
|
|
68
|
-
el.style.setProperty(key, value);
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
el.style.removeProperty(key);
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
exports.handleContainer = handleContainer;
|
|
78
|
-
exports.hasScrollbar = hasScrollbar;
|
|
79
|
-
exports.isScrolledToBottom = isScrolledToBottom;
|
|
80
|
-
exports.isScrolledToTop = isScrolledToTop;
|
package/cssm/desktop.d.ts
DELETED
package/cssm/desktop.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var Component_desktop = require('./Component.desktop.js');
|
|
6
|
-
require('tslib');
|
|
7
|
-
require('react');
|
|
8
|
-
require('./components/content/Component.js');
|
|
9
|
-
require('classnames');
|
|
10
|
-
require('./Context.js');
|
|
11
|
-
require('@alfalab/core-components-base-modal/cssm');
|
|
12
|
-
require('./ResponsiveContext.js');
|
|
13
|
-
require('./components/content/desktop.module.css');
|
|
14
|
-
require('./components/content/index.module.css');
|
|
15
|
-
require('./components/content/mobile.module.css');
|
|
16
|
-
require('./components/footer/Component.js');
|
|
17
|
-
require('./components/footer/desktop.module.css');
|
|
18
|
-
require('./components/footer/index.module.css');
|
|
19
|
-
require('./components/footer/layout.module.css');
|
|
20
|
-
require('./components/footer/mobile.module.css');
|
|
21
|
-
require('./components/header/Component.js');
|
|
22
|
-
require('@alfalab/core-components-navigation-bar/cssm');
|
|
23
|
-
require('./components/header/desktop.module.css');
|
|
24
|
-
require('./components/header/index.module.css');
|
|
25
|
-
require('./components/header/mobile.module.css');
|
|
26
|
-
require('./Component.js');
|
|
27
|
-
require('react-merge-refs');
|
|
28
|
-
require('./desktop.module.css');
|
|
29
|
-
require('./mobile.module.css');
|
|
30
|
-
require('./transitions.module.css');
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
exports.ModalDesktop = Component_desktop.ModalDesktop;
|
package/cssm/mobile.d.ts
DELETED
package/cssm/mobile.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var Component_mobile = require('./Component.mobile.js');
|
|
6
|
-
require('tslib');
|
|
7
|
-
require('react');
|
|
8
|
-
require('./components/content/Component.js');
|
|
9
|
-
require('classnames');
|
|
10
|
-
require('./Context.js');
|
|
11
|
-
require('@alfalab/core-components-base-modal/cssm');
|
|
12
|
-
require('./ResponsiveContext.js');
|
|
13
|
-
require('./components/content/desktop.module.css');
|
|
14
|
-
require('./components/content/index.module.css');
|
|
15
|
-
require('./components/content/mobile.module.css');
|
|
16
|
-
require('./components/footer/Component.js');
|
|
17
|
-
require('./components/footer/desktop.module.css');
|
|
18
|
-
require('./components/footer/index.module.css');
|
|
19
|
-
require('./components/footer/layout.module.css');
|
|
20
|
-
require('./components/footer/mobile.module.css');
|
|
21
|
-
require('./components/header/Component.js');
|
|
22
|
-
require('@alfalab/core-components-navigation-bar/cssm');
|
|
23
|
-
require('./components/header/desktop.module.css');
|
|
24
|
-
require('./components/header/index.module.css');
|
|
25
|
-
require('./components/header/mobile.module.css');
|
|
26
|
-
require('./Component.js');
|
|
27
|
-
require('react-merge-refs');
|
|
28
|
-
require('./desktop.module.css');
|
|
29
|
-
require('./mobile.module.css');
|
|
30
|
-
require('./transitions.module.css');
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
exports.ModalMobile = Component_mobile.ModalMobile;
|
package/cssm/shared.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ModalContext } from "./Context";
|
package/desktop.d.ts
DELETED
package/esm/desktop.d.ts
DELETED
package/esm/desktop.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export { ModalDesktop } from './Component.desktop.js';
|
|
2
|
-
import 'tslib';
|
|
3
|
-
import 'react';
|
|
4
|
-
import './components/content/Component.js';
|
|
5
|
-
import 'classnames';
|
|
6
|
-
import './Context.js';
|
|
7
|
-
import '@alfalab/core-components-base-modal/esm';
|
|
8
|
-
import './ResponsiveContext.js';
|
|
9
|
-
import './components/footer/Component.js';
|
|
10
|
-
import './components/header/Component.js';
|
|
11
|
-
import '@alfalab/core-components-navigation-bar/esm';
|
|
12
|
-
import './Component.js';
|
|
13
|
-
import 'react-merge-refs';
|
package/esm/mobile.d.ts
DELETED
package/esm/mobile.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export { ModalMobile } from './Component.mobile.js';
|
|
2
|
-
import 'tslib';
|
|
3
|
-
import 'react';
|
|
4
|
-
import './components/content/Component.js';
|
|
5
|
-
import 'classnames';
|
|
6
|
-
import './Context.js';
|
|
7
|
-
import '@alfalab/core-components-base-modal/esm';
|
|
8
|
-
import './ResponsiveContext.js';
|
|
9
|
-
import './components/footer/Component.js';
|
|
10
|
-
import './components/header/Component.js';
|
|
11
|
-
import '@alfalab/core-components-navigation-bar/esm';
|
|
12
|
-
import './Component.js';
|
|
13
|
-
import 'react-merge-refs';
|
package/esm/shared.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ModalContext } from "./Context";
|
package/mobile.d.ts
DELETED
package/modern/desktop.d.ts
DELETED
package/modern/desktop.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export { ModalDesktop } from './Component.desktop.js';
|
|
2
|
-
import 'react';
|
|
3
|
-
import './components/content/Component.js';
|
|
4
|
-
import 'classnames';
|
|
5
|
-
import './Context.js';
|
|
6
|
-
import '@alfalab/core-components-base-modal/modern';
|
|
7
|
-
import './ResponsiveContext.js';
|
|
8
|
-
import './components/footer/Component.js';
|
|
9
|
-
import './components/header/Component.js';
|
|
10
|
-
import '@alfalab/core-components-navigation-bar/modern';
|
|
11
|
-
import './Component.js';
|
|
12
|
-
import 'react-merge-refs';
|