@sima-land/ui-nucleons 44.0.1 → 44.2.1
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/carousel/index.js +1 -1
- package/chips/chips.module.scss +7 -4
- package/clean-buttons/index.d.ts +6 -0
- package/clean-buttons/index.js +3 -2
- package/expandable/expandable-group.module.scss +20 -0
- package/expandable/index.d.ts +40 -0
- package/expandable/index.js +90 -0
- package/expandable/utils.d.ts +28 -0
- package/expandable/utils.js +86 -0
- package/modal/index.js +6 -4
- package/modal/slots.js +2 -1
- package/package.json +1 -1
package/carousel/index.js
CHANGED
|
@@ -101,7 +101,7 @@ class Carousel extends react_1.Component {
|
|
|
101
101
|
static defaultRenderControl({ canUse, onUse, type, vertical }, props = { size: 's' }) {
|
|
102
102
|
const forward = vertical ? 'down' : 'right';
|
|
103
103
|
const backward = vertical ? 'up' : 'left';
|
|
104
|
-
return (react_1.default.createElement(arrow_button_1.ArrowButton, Object.assign({}, props, { className: cx('control', vertical && 'vertical', type), direction: type === 'forward' ? forward : backward, onClick: onUse, disabled: !canUse })));
|
|
104
|
+
return (react_1.default.createElement(arrow_button_1.ArrowButton, Object.assign({}, props, { className: cx('control', vertical && 'vertical', type, props.className), direction: type === 'forward' ? forward : backward, onClick: onUse, disabled: !canUse })));
|
|
105
105
|
}
|
|
106
106
|
/**
|
|
107
107
|
* Возвращает функцию для поиска наиболее отдаленного элемента карусели от стартовой границы viewport'а.
|
package/chips/chips.module.scss
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
@use '../colors';
|
|
2
2
|
|
|
3
|
-
$gutter: 8px;
|
|
4
|
-
|
|
5
3
|
.list {
|
|
6
4
|
display: flex;
|
|
7
5
|
flex-wrap: wrap;
|
|
8
|
-
|
|
6
|
+
--chips-gutter: 8px;
|
|
7
|
+
margin-right: calc(-1 * var(--chips-gutter));
|
|
8
|
+
margin-bottom: calc(-1 * var(--chips-gutter));
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.item {
|
|
@@ -15,7 +15,10 @@ $gutter: 8px;
|
|
|
15
15
|
display: flex;
|
|
16
16
|
align-items: center;
|
|
17
17
|
height: 32px;
|
|
18
|
-
|
|
18
|
+
|
|
19
|
+
// по умолчанию 0 чтобы вне Chips отступов не было
|
|
20
|
+
margin-right: var(--chips-gutter, 0);
|
|
21
|
+
margin-bottom: var(--chips-gutter, 0);
|
|
19
22
|
overflow: hidden;
|
|
20
23
|
outline: 0;
|
|
21
24
|
border: 0;
|
package/clean-buttons/index.d.ts
CHANGED
|
@@ -12,6 +12,12 @@ export interface CleanGroupProps {
|
|
|
12
12
|
/** Содержимое. */
|
|
13
13
|
children?: React.ReactNode;
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Компонент группы прозрачных кнопок.
|
|
17
|
+
* @param props Свойства.
|
|
18
|
+
* @return Элемент.
|
|
19
|
+
*/
|
|
20
|
+
export declare const CleanGroup: React.FC<CleanGroupProps>;
|
|
15
21
|
export declare const Clean: {
|
|
16
22
|
Group: React.FC<CleanGroupProps>;
|
|
17
23
|
Button: ({ size, href, asLink, ...restProps }: CleanButtonProps) => JSX.Element;
|
package/clean-buttons/index.js
CHANGED
|
@@ -37,7 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.Clean = void 0;
|
|
40
|
+
exports.Clean = exports.CleanGroup = void 0;
|
|
41
41
|
const react_1 = __importStar(require("react"));
|
|
42
42
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
43
43
|
const link_1 = require("../link");
|
|
@@ -55,6 +55,7 @@ const CleanGroup = ({ size: sizeFromProps, children }) => {
|
|
|
55
55
|
const size = sizeFromProps || sizeFromContext;
|
|
56
56
|
return (react_1.default.createElement("div", { className: cx('group') }, react_1.Children.toArray(children).map(item => (0, react_1.isValidElement)(item) && item.type === CleanButton ? (0, react_1.cloneElement)(item, { size }) : null)));
|
|
57
57
|
};
|
|
58
|
+
exports.CleanGroup = CleanGroup;
|
|
58
59
|
/**
|
|
59
60
|
* Компонент прозрачной кнопки.
|
|
60
61
|
* @param props Свойства.
|
|
@@ -65,6 +66,6 @@ const CleanButton = (_a) => {
|
|
|
65
66
|
return (react_1.default.createElement(link_1.Link, Object.assign({ pseudo: !asLink, className: cx('button', `size-${size}`), href: href }, restProps)));
|
|
66
67
|
};
|
|
67
68
|
exports.Clean = {
|
|
68
|
-
Group: CleanGroup,
|
|
69
|
+
Group: exports.CleanGroup,
|
|
69
70
|
Button: CleanButton,
|
|
70
71
|
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React, { ReactNode, MouseEventHandler, CSSProperties } from 'react';
|
|
2
|
+
export interface ExpandableGroupProps {
|
|
3
|
+
/** Расстояние между элементами группы в пикселях. */
|
|
4
|
+
gap?: number;
|
|
5
|
+
/** Высота каждого элемента группы в пикселях. */
|
|
6
|
+
itemHeight?: number;
|
|
7
|
+
/** Развернут ли список по умолчанию. */
|
|
8
|
+
defaultExpanded?: boolean;
|
|
9
|
+
/** Количество строк в свернутом состоянии группы. */
|
|
10
|
+
lineLimit?: number;
|
|
11
|
+
/** Содержимое. */
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
/** Функция, возвращающая содержимое кнопки разворачивания списка. */
|
|
14
|
+
opener?: (data: {
|
|
15
|
+
hiddenCount: number;
|
|
16
|
+
}) => ReactNode;
|
|
17
|
+
/** Сработает при разворачивании списка. */
|
|
18
|
+
onExpand?: () => void;
|
|
19
|
+
/** CSS-класс корневого элемента. */
|
|
20
|
+
className?: string;
|
|
21
|
+
/** Стили корневого элемента. */
|
|
22
|
+
style?: CSSProperties;
|
|
23
|
+
/** Нужно ли выводить список развернутым. */
|
|
24
|
+
expanded?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface GroupItemProps {
|
|
27
|
+
children?: ReactNode;
|
|
28
|
+
onClick?: MouseEventHandler;
|
|
29
|
+
'data-testid'?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Группа элементов с ограничением на число выводимых строк и возможностью показать все.
|
|
33
|
+
* @param props Свойства.
|
|
34
|
+
* @return Элемент.
|
|
35
|
+
*/
|
|
36
|
+
export declare function ExpandableGroup({ gap, itemHeight, lineLimit, defaultExpanded, children, onExpand, opener, className, style, expanded: expandedProp, }: ExpandableGroupProps): JSX.Element;
|
|
37
|
+
export declare const Expandable: {
|
|
38
|
+
readonly Group: typeof ExpandableGroup;
|
|
39
|
+
readonly Item: React.ForwardRefExoticComponent<GroupItemProps & React.RefAttributes<HTMLLIElement>>;
|
|
40
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.Expandable = exports.ExpandableGroup = void 0;
|
|
30
|
+
const react_1 = __importStar(require("react"));
|
|
31
|
+
const utils_1 = require("./utils");
|
|
32
|
+
const bind_1 = __importDefault(require("classnames/bind"));
|
|
33
|
+
const expandable_group_module_scss_1 = __importDefault(require("./expandable-group.module.scss"));
|
|
34
|
+
const cx = bind_1.default.bind(expandable_group_module_scss_1.default);
|
|
35
|
+
const GroupContext = (0, react_1.createContext)({ gap: 8, itemHeight: 32 });
|
|
36
|
+
/**
|
|
37
|
+
* Группа элементов с ограничением на число выводимых строк и возможностью показать все.
|
|
38
|
+
* @param props Свойства.
|
|
39
|
+
* @return Элемент.
|
|
40
|
+
*/
|
|
41
|
+
function ExpandableGroup({ gap = 8, itemHeight = 32, lineLimit = 2, defaultExpanded = false, children, onExpand, opener = data => react_1.default.createElement(react_1.default.Fragment, null,
|
|
42
|
+
"\u0415\u0449\u0451 ",
|
|
43
|
+
data.hiddenCount), className, style, expanded: expandedProp, }) {
|
|
44
|
+
const wrapperRef = (0, react_1.useRef)(null);
|
|
45
|
+
const containerRef = (0, react_1.useRef)(null);
|
|
46
|
+
const openerRef = (0, react_1.useRef)(null);
|
|
47
|
+
const [mounted, setMounted] = (0, react_1.useState)(false);
|
|
48
|
+
const [expanded, setExpanded] = (0, react_1.useState)(defaultExpanded);
|
|
49
|
+
const items = react_1.Children.toArray(children).reduce((result, child) => {
|
|
50
|
+
if ((0, react_1.isValidElement)(child) && child.type === ExpandableItem) {
|
|
51
|
+
result.push(child);
|
|
52
|
+
}
|
|
53
|
+
return result;
|
|
54
|
+
}, []);
|
|
55
|
+
(0, react_1.useEffect)(() => {
|
|
56
|
+
setMounted(true);
|
|
57
|
+
}, []);
|
|
58
|
+
(0, react_1.useEffect)(() => {
|
|
59
|
+
expandedProp !== undefined && setExpanded(expandedProp);
|
|
60
|
+
}, [expandedProp]);
|
|
61
|
+
(0, react_1.useEffect)(() => {
|
|
62
|
+
setMounted(true);
|
|
63
|
+
}, []);
|
|
64
|
+
const { hiddenCount } = (0, utils_1.useExpandable)({
|
|
65
|
+
expanded,
|
|
66
|
+
wrapperRef,
|
|
67
|
+
containerRef,
|
|
68
|
+
openerRef,
|
|
69
|
+
});
|
|
70
|
+
return (react_1.default.createElement(GroupContext.Provider, { value: { gap, itemHeight } },
|
|
71
|
+
react_1.default.createElement("div", { ref: wrapperRef, className: cx('root', className), style: Object.assign(Object.assign({}, style), { maxHeight: expanded ? undefined : `${itemHeight * lineLimit + gap * (lineLimit - 1)}px` }) },
|
|
72
|
+
react_1.default.createElement("ul", { ref: containerRef, className: expandable_group_module_scss_1.default.inner, style: { marginRight: `${-gap}px`, marginBottom: `${-gap}px` } },
|
|
73
|
+
items,
|
|
74
|
+
mounted && !expanded && (react_1.default.createElement(ExpandableItem, { ref: openerRef, onClick: () => {
|
|
75
|
+
setExpanded(true);
|
|
76
|
+
onExpand === null || onExpand === void 0 ? void 0 : onExpand();
|
|
77
|
+
}, "data-testid": 'expandable:opener' }, opener({ hiddenCount })))))));
|
|
78
|
+
}
|
|
79
|
+
exports.ExpandableGroup = ExpandableGroup;
|
|
80
|
+
const ExpandableItem = (0, react_1.forwardRef)(({ children, onClick, 'data-testid': testId = 'expandable:item' }, ref) => {
|
|
81
|
+
const { gap, itemHeight } = (0, react_1.useContext)(GroupContext);
|
|
82
|
+
return (react_1.default.createElement("li", { ref: ref, className: cx('item'), "data-testid": testId, onClick: onClick, style: {
|
|
83
|
+
height: `${itemHeight}px`,
|
|
84
|
+
margin: `0 ${gap}px ${gap}px 0`,
|
|
85
|
+
} }, children));
|
|
86
|
+
});
|
|
87
|
+
exports.Expandable = {
|
|
88
|
+
Group: ExpandableGroup,
|
|
89
|
+
Item: ExpandableItem,
|
|
90
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
export interface ViewState {
|
|
3
|
+
lastVisibleIndex: number;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Хук состояния группы элементов ограниченных несколькими строками с возможностью показать все.
|
|
7
|
+
* @param options.expanded Развернут ли список.
|
|
8
|
+
* @param options.wrapperRef Реф элемента, формирующего ограничение по высоте.
|
|
9
|
+
* @param options.containerRef Реф элемента, содержащего список.
|
|
10
|
+
* @param options.openerRef Реф элемента "открывашки".
|
|
11
|
+
* @return Рассчитанные данные: кол-во скрытых элементов.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useExpandable({ expanded, wrapperRef, containerRef, openerRef, }: {
|
|
14
|
+
expanded: boolean;
|
|
15
|
+
wrapperRef: RefObject<HTMLElement>;
|
|
16
|
+
containerRef: RefObject<HTMLElement>;
|
|
17
|
+
openerRef: RefObject<HTMLElement>;
|
|
18
|
+
}): {
|
|
19
|
+
hiddenCount: number;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Определяет индекс последнего видимого элемента для свернутого списка.
|
|
23
|
+
* @param wrapper Элемент, формирующий ограничение по высоте.
|
|
24
|
+
* @param items Элементы, все кроме "закрывашки".
|
|
25
|
+
* @param opener Элемент "закрывашки".
|
|
26
|
+
* @return Состояние.
|
|
27
|
+
*/
|
|
28
|
+
export declare function defineViewState(wrapper: HTMLElement, items: Element[], opener: HTMLElement): ViewState;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.defineViewState = exports.useExpandable = void 0;
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const hooks_1 = require("../hooks");
|
|
9
|
+
const on_1 = __importDefault(require("../helpers/on"));
|
|
10
|
+
const expandable_group_module_scss_1 = __importDefault(require("./expandable-group.module.scss"));
|
|
11
|
+
/**
|
|
12
|
+
* Хук состояния группы элементов ограниченных несколькими строками с возможностью показать все.
|
|
13
|
+
* @param options.expanded Развернут ли список.
|
|
14
|
+
* @param options.wrapperRef Реф элемента, формирующего ограничение по высоте.
|
|
15
|
+
* @param options.containerRef Реф элемента, содержащего список.
|
|
16
|
+
* @param options.openerRef Реф элемента "открывашки".
|
|
17
|
+
* @return Рассчитанные данные: кол-во скрытых элементов.
|
|
18
|
+
*/
|
|
19
|
+
function useExpandable({ expanded, wrapperRef, containerRef, openerRef, }) {
|
|
20
|
+
const [hiddenCount, setHiddenCount] = (0, react_1.useState)(0);
|
|
21
|
+
const calc = (0, react_1.useCallback)(() => {
|
|
22
|
+
const wrapperEl = wrapperRef.current;
|
|
23
|
+
const containerEl = containerRef.current;
|
|
24
|
+
const openerEl = openerRef.current;
|
|
25
|
+
if (expanded) {
|
|
26
|
+
if (containerEl) {
|
|
27
|
+
for (const item of containerEl.children) {
|
|
28
|
+
item.classList.remove(expandable_group_module_scss_1.default.hidden);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
if (wrapperEl && containerEl && openerEl) {
|
|
34
|
+
const items = [...containerEl.children].filter(child => child !== openerEl);
|
|
35
|
+
// делаем все элементы списка видимыми чтобы правильно считать размеры
|
|
36
|
+
for (const item of items) {
|
|
37
|
+
item.classList.remove(expandable_group_module_scss_1.default.hidden);
|
|
38
|
+
}
|
|
39
|
+
// определяем какие элементы не влезли в ограничение по высоте
|
|
40
|
+
const state = defineViewState(wrapperEl, items, openerEl);
|
|
41
|
+
// делаем невидимыми элементы списка которые не влезли
|
|
42
|
+
for (const [index, item] of items.entries()) {
|
|
43
|
+
if (item !== openerEl && index >= state.lastVisibleIndex) {
|
|
44
|
+
item.classList.add(expandable_group_module_scss_1.default.hidden);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
setHiddenCount(items.length - state.lastVisibleIndex);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}, [expanded]);
|
|
51
|
+
// пересчитываем после каждого rerender'а
|
|
52
|
+
(0, hooks_1.useIsomorphicLayoutEffect)(calc);
|
|
53
|
+
// пересчитываем при resize
|
|
54
|
+
(0, react_1.useEffect)(() => (0, on_1.default)(window, 'resize', calc), [calc]);
|
|
55
|
+
return { hiddenCount };
|
|
56
|
+
}
|
|
57
|
+
exports.useExpandable = useExpandable;
|
|
58
|
+
/**
|
|
59
|
+
* Определяет индекс последнего видимого элемента для свернутого списка.
|
|
60
|
+
* @param wrapper Элемент, формирующий ограничение по высоте.
|
|
61
|
+
* @param items Элементы, все кроме "закрывашки".
|
|
62
|
+
* @param opener Элемент "закрывашки".
|
|
63
|
+
* @return Состояние.
|
|
64
|
+
*/
|
|
65
|
+
function defineViewState(wrapper, items, opener) {
|
|
66
|
+
const state = { lastVisibleIndex: -1 };
|
|
67
|
+
const parentRect = wrapper.getBoundingClientRect();
|
|
68
|
+
const firstHiddenNodeIndex = items.findIndex(child => {
|
|
69
|
+
const childRect = child.getBoundingClientRect();
|
|
70
|
+
return childRect.top - parentRect.top >= parentRect.height;
|
|
71
|
+
});
|
|
72
|
+
if (firstHiddenNodeIndex !== -1) {
|
|
73
|
+
const lastVisibleIndex = firstHiddenNodeIndex - 1;
|
|
74
|
+
const lastVisible = items[lastVisibleIndex];
|
|
75
|
+
if (lastVisible) {
|
|
76
|
+
const rightBound = lastVisible.getBoundingClientRect().right;
|
|
77
|
+
const rightContainerBound = wrapper.getBoundingClientRect().right;
|
|
78
|
+
// проверяем, хватает ли кнопке места (с запасом в половину) после последнего видимого дочернего элемента
|
|
79
|
+
const isOpenerFit = rightContainerBound - rightBound >= opener.clientWidth * 1.5;
|
|
80
|
+
// если хватает места - ставим кнопку после последнего, иначе - вместо
|
|
81
|
+
state.lastVisibleIndex = lastVisibleIndex + Number(isOpenerFit);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return state;
|
|
85
|
+
}
|
|
86
|
+
exports.defineViewState = defineViewState;
|
package/modal/index.js
CHANGED
|
@@ -35,17 +35,17 @@ const shadows_1 = require("../styling/shadows");
|
|
|
35
35
|
const lodash_1 = require("lodash");
|
|
36
36
|
const slots_1 = require("./slots");
|
|
37
37
|
const layer_1 = require("../helpers/layer");
|
|
38
|
-
const bind_1 = __importDefault(require("classnames/bind"));
|
|
39
|
-
const modal_module_scss_1 = __importDefault(require("./modal.module.scss"));
|
|
40
38
|
const define_slots_1 = require("../helpers/define-slots");
|
|
41
39
|
const body_scroll_1 = require("../_internal/body-scroll");
|
|
40
|
+
const bind_1 = __importDefault(require("classnames/bind"));
|
|
41
|
+
const modal_module_scss_1 = __importDefault(require("./modal.module.scss"));
|
|
42
42
|
const cx = bind_1.default.bind(modal_module_scss_1.default);
|
|
43
43
|
/**
|
|
44
44
|
* Компонент модального окна.
|
|
45
45
|
* @param props Свойства.
|
|
46
46
|
* @return Элемент.
|
|
47
47
|
*/
|
|
48
|
-
const Modal = ({ children, height, onClose, scrollDisableOptions
|
|
48
|
+
const Modal = ({ children, height, onClose, scrollDisableOptions, size = 'm', withScrollDisable = false, 'data-testid': testId = 'modal', }) => {
|
|
49
49
|
const layer = (0, layer_1.useLayer)() + 100;
|
|
50
50
|
const rootRef = (0, react_1.useRef)(null);
|
|
51
51
|
const bind = (0, utils_1.useCloseHandler)(onClose);
|
|
@@ -67,7 +67,9 @@ const Modal = ({ children, height, onClose, scrollDisableOptions = { reserveScro
|
|
|
67
67
|
'--header-height': `${headerHeight}px`,
|
|
68
68
|
'--footer-height': `${footerHeight}px`,
|
|
69
69
|
};
|
|
70
|
-
(0, body_scroll_1.useBodyScrollLock)(rootRef, withScrollDisable,
|
|
70
|
+
(0, body_scroll_1.useBodyScrollLock)(rootRef, withScrollDisable, Object.assign({
|
|
71
|
+
// defaults
|
|
72
|
+
reserveScrollBarGap: true, allowTouchMove: body_scroll_1.allowTouchMove }, scrollDisableOptions));
|
|
71
73
|
return (react_1.default.createElement("div", Object.assign({ ref: rootRef, className: cx('overlay'), "data-testid": 'modal:overlay', style: { zIndex: layer } }, bind),
|
|
72
74
|
react_1.default.createElement("div", { className: cx('modal', `size-${size}`, !fullscreen && shadows_1.BoxShadow.z4), style: style, "data-testid": testId },
|
|
73
75
|
header &&
|
package/modal/slots.js
CHANGED
|
@@ -46,6 +46,7 @@ const bottom_bar_1 = require("../bottom-bar");
|
|
|
46
46
|
const custom_scrollbar_1 = require("../_internal/custom-scrollbar");
|
|
47
47
|
const modal_module_scss_1 = __importDefault(require("./modal.module.scss"));
|
|
48
48
|
const viewport_1 = require("../context/viewport");
|
|
49
|
+
const constants_1 = require("../constants");
|
|
49
50
|
/**
|
|
50
51
|
* Шапка окна.
|
|
51
52
|
* @param props Свойства.
|
|
@@ -77,7 +78,7 @@ const ModalBody = ({ children, onFullScroll, fullScrollThreshold, }) => {
|
|
|
77
78
|
const ref = (0, react_1.useRef)(null);
|
|
78
79
|
return (react_1.default.createElement(custom_scrollbar_1.CustomScrollbar, { inFlexBox: true, className: modal_module_scss_1.default.body, overflow: { x: 'h', y: 's' }, onFullScroll: onFullScroll, fullScrollThreshold: fullScrollThreshold },
|
|
79
80
|
react_1.default.createElement(viewport_1.ViewportContext.Provider, { value: ref },
|
|
80
|
-
react_1.default.createElement("div", { className: modal_module_scss_1.default.main, ref: ref }, children))));
|
|
81
|
+
react_1.default.createElement("div", Object.assign({ className: modal_module_scss_1.default.main, ref: ref }, { [constants_1.BSL_IGNORE_ATTR]: true }), children))));
|
|
81
82
|
};
|
|
82
83
|
exports.ModalBody = ModalBody;
|
|
83
84
|
/**
|