@alfalab/core-components-bottom-sheet 4.7.0 → 4.9.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/{esm/component-1a553fe5.d.ts → component-781ae88d.d.ts} +7 -1
- package/{component-a50a831b.js → component-781ae88d.js} +33 -42
- package/component.js +2 -2
- package/components/backer/Component.d.ts +4 -0
- package/components/backer/Component.js +4 -4
- package/components/backer/index.css +3 -3
- package/components/closer/Component.d.ts +4 -0
- package/components/closer/Component.js +4 -4
- package/components/closer/index.css +3 -3
- package/components/footer/Component.js +1 -1
- package/components/footer/index.css +4 -4
- package/components/header/Component.js +2 -2
- package/components/header/index.css +17 -17
- package/components/swipeable-backdrop/Component.js +1 -1
- package/{component-a50a831b.d.ts → cssm/component-486b5783.d.ts} +7 -1
- package/cssm/{component-78755a1d.js → component-486b5783.js} +30 -39
- package/cssm/component.js +1 -1
- package/cssm/components/backer/Component.d.ts +4 -0
- package/cssm/components/backer/Component.js +2 -2
- package/cssm/components/closer/Component.d.ts +4 -0
- package/cssm/components/closer/Component.js +2 -2
- package/cssm/components/header/Component.js +1 -1
- package/cssm/index.d.ts +1 -1
- package/cssm/index.js +1 -1
- package/cssm/index.module.css +0 -3
- package/{modern/component-cc142f56.d.ts → esm/component-4ca72d9c.d.ts} +7 -1
- package/esm/{component-1a553fe5.js → component-4ca72d9c.js} +33 -42
- package/esm/component.js +2 -2
- package/esm/components/backer/Component.d.ts +4 -0
- package/esm/components/backer/Component.js +4 -4
- package/esm/components/backer/index.css +3 -3
- package/esm/components/closer/Component.d.ts +4 -0
- package/esm/components/closer/Component.js +4 -4
- package/esm/components/closer/index.css +3 -3
- package/esm/components/footer/Component.js +1 -1
- package/esm/components/footer/index.css +4 -4
- package/esm/components/header/Component.js +2 -2
- package/esm/components/header/index.css +17 -17
- package/esm/components/swipeable-backdrop/Component.js +1 -1
- package/esm/index.css +15 -18
- package/esm/index.d.ts +1 -1
- package/esm/index.js +2 -2
- package/esm/{tslib.es6-f0ff4ec2.d.ts → tslib.es6-4793cff0.d.ts} +0 -0
- package/esm/{tslib.es6-f0ff4ec2.js → tslib.es6-4793cff0.js} +0 -0
- package/index.css +15 -18
- package/index.d.ts +1 -1
- package/index.js +2 -2
- package/{cssm/component-78755a1d.d.ts → modern/component-d444787d.d.ts} +7 -1
- package/modern/{component-cc142f56.js → component-d444787d.js} +32 -41
- package/modern/component.js +1 -1
- package/modern/components/backer/Component.d.ts +4 -0
- package/modern/components/backer/Component.js +3 -3
- package/modern/components/backer/index.css +3 -3
- package/modern/components/closer/Component.d.ts +4 -0
- package/modern/components/closer/Component.js +3 -3
- package/modern/components/closer/index.css +3 -3
- package/modern/components/footer/Component.js +1 -1
- package/modern/components/footer/index.css +4 -4
- package/modern/components/header/Component.js +1 -1
- package/modern/components/header/index.css +17 -17
- package/modern/index.css +15 -18
- package/modern/index.d.ts +1 -1
- package/modern/index.js +1 -1
- package/package.json +2 -2
- package/{tslib.es6-7fdb05e4.d.ts → tslib.es6-86a36c7d.d.ts} +0 -0
- package/{tslib.es6-7fdb05e4.js → tslib.es6-86a36c7d.js} +0 -0
- package/CHANGELOG.md +0 -335
|
@@ -58,12 +58,17 @@ type HeaderProps = {
|
|
|
58
58
|
* Фиксирует шапку
|
|
59
59
|
*/
|
|
60
60
|
sticky?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
63
|
+
*/
|
|
64
|
+
dataTestId?: string;
|
|
61
65
|
/**
|
|
62
66
|
* Обработчик нажатия на стрелку назад
|
|
63
67
|
*/
|
|
64
68
|
onBack?: () => void;
|
|
65
69
|
};
|
|
66
70
|
declare const Header: FC<HeaderProps>;
|
|
71
|
+
declare const getDataTestId: (dataTestId?: string | undefined, element?: string | undefined) => string | undefined;
|
|
67
72
|
type BottomSheetTitleAlign$0 = 'center' | 'left';
|
|
68
73
|
type BottomSheetProps = {
|
|
69
74
|
/**
|
|
@@ -200,6 +205,7 @@ type BottomSheetProps = {
|
|
|
200
205
|
*/
|
|
201
206
|
disableBlockingScroll?: boolean;
|
|
202
207
|
/**
|
|
208
|
+
* @deprecated данный проп больше не используется, временно оставлен для обратной совместимости
|
|
203
209
|
* Не анимировать шторку при изменении размера вьюпорта
|
|
204
210
|
*/
|
|
205
211
|
ignoreScreenChange?: boolean;
|
|
@@ -219,4 +225,4 @@ type BottomSheetProps = {
|
|
|
219
225
|
declare const HEADER_OFFSET = 24;
|
|
220
226
|
declare const CLOSE_OFFSET = 0.2;
|
|
221
227
|
declare const BottomSheet: React.ForwardRefExoticComponent<BottomSheetProps & React.RefAttributes<HTMLDivElement>>;
|
|
222
|
-
export { HeaderProps, Header, BottomSheetTitleAlign$0 as BottomSheetTitleAlign, BottomSheetProps, HEADER_OFFSET, CLOSE_OFFSET, BottomSheet };
|
|
228
|
+
export { HeaderProps, Header, getDataTestId, BottomSheetTitleAlign$0 as BottomSheetTitleAlign, BottomSheetProps, HEADER_OFFSET, CLOSE_OFFSET, BottomSheet };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var tslib_es6 = require('./tslib.es6-
|
|
3
|
+
var tslib_es6 = require('./tslib.es6-86a36c7d.js');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var cn = require('classnames');
|
|
6
6
|
var reactDiv100vh = require('react-div-100vh');
|
|
@@ -17,12 +17,17 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
17
17
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
18
18
|
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var getDataTestId = function (dataTestId, element) {
|
|
21
|
+
var elementPart = element ? "-" + element.toLowerCase() : '';
|
|
22
|
+
return dataTestId ? "" + dataTestId + elementPart : undefined;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
var styles = {"headerWrapper":"bottom-sheet__headerWrapper_grajk","header":"bottom-sheet__header_grajk","sticky":"bottom-sheet__sticky_grajk","highlighted":"bottom-sheet__highlighted_grajk","justifyEnd":"bottom-sheet__justifyEnd_grajk","addon":"bottom-sheet__addon_grajk","addonFixed":"bottom-sheet__addonFixed_grajk","addonLeft":"bottom-sheet__addonLeft_grajk","addonRight":"bottom-sheet__addonRight_grajk","title":"bottom-sheet__title_grajk","titleCenter":"bottom-sheet__titleCenter_grajk","titleLeft":"bottom-sheet__titleLeft_grajk","trimTitle":"bottom-sheet__trimTitle_grajk","titleBigIndentHorizontal":"bottom-sheet__titleBigIndentHorizontal_grajk","titleIndentRight":"bottom-sheet__titleIndentRight_grajk","titleIndentLeft":"bottom-sheet__titleIndentLeft_grajk"};
|
|
21
26
|
require('./components/header/index.css')
|
|
22
27
|
|
|
23
28
|
var Header = function (_a) {
|
|
24
29
|
var _b, _c, _d, _e, _f;
|
|
25
|
-
var title = _a.title, headerClassName = _a.headerClassName, addonClassName = _a.addonClassName, closerClassName = _a.closerClassName, backerClassName = _a.backerClassName, leftAddons = _a.leftAddons, rightAddons = _a.rightAddons, bottomAddons = _a.bottomAddons, hasCloser = _a.hasCloser, hasBacker = _a.hasBacker, titleAlign = _a.titleAlign, trimTitle = _a.trimTitle, sticky = _a.sticky, onBack = _a.onBack;
|
|
30
|
+
var title = _a.title, headerClassName = _a.headerClassName, addonClassName = _a.addonClassName, closerClassName = _a.closerClassName, backerClassName = _a.backerClassName, leftAddons = _a.leftAddons, rightAddons = _a.rightAddons, bottomAddons = _a.bottomAddons, hasCloser = _a.hasCloser, hasBacker = _a.hasBacker, titleAlign = _a.titleAlign, trimTitle = _a.trimTitle, sticky = _a.sticky, dataTestId = _a.dataTestId, onBack = _a.onBack;
|
|
26
31
|
var _g = React.useContext(coreComponentsBaseModal.BaseModalContext), headerHighlighted = _g.headerHighlighted, setHasHeader = _g.setHasHeader, setHeaderOffset = _g.setHeaderOffset;
|
|
27
32
|
var hasLeftPart = hasBacker || leftAddons || titleAlign === 'center';
|
|
28
33
|
var hasRightPart = hasCloser || rightAddons || titleAlign === 'center';
|
|
@@ -47,27 +52,27 @@ var Header = function (_a) {
|
|
|
47
52
|
return (React__default['default'].createElement("div", { className: cn__default['default'](styles.headerWrapper, headerClassName, (_b = {},
|
|
48
53
|
_b[styles.highlighted] = headerHighlighted && sticky,
|
|
49
54
|
_b[styles.sticky] = sticky,
|
|
50
|
-
_b)) },
|
|
55
|
+
_b)), "data-test-id": getDataTestId(dataTestId) },
|
|
51
56
|
React__default['default'].createElement("div", { className: cn__default['default'](styles.header, headerClassName, (_c = {},
|
|
52
57
|
_c[styles.justifyEnd] = !title,
|
|
53
58
|
_c)) },
|
|
54
59
|
hasLeftPart && (React__default['default'].createElement("div", { className: cn__default['default'](styles.addon, addonClassName, (_d = {},
|
|
55
60
|
_d[styles.addonFixed] = !sticky,
|
|
56
61
|
_d[styles.addonLeft] = !sticky,
|
|
57
|
-
_d)) }, hasBacker ? (React__default['default'].createElement(components_backer_Component.Backer, { className: backerClassName, onClick: onBack })) : (leftAddons))),
|
|
62
|
+
_d)) }, hasBacker ? (React__default['default'].createElement(components_backer_Component.Backer, { className: backerClassName, onClick: onBack, dataTestId: getDataTestId(dataTestId, 'backer') })) : (leftAddons))),
|
|
58
63
|
hasHeaderContent && (React__default['default'].createElement(coreComponentsTypography.Typography.Text, { view: 'primary-large', weight: 'bold', className: cn__default['default'](styles.title, getTitleIndent(), (_e = {},
|
|
59
64
|
_e[styles.titleCenter] = titleAlign === 'center',
|
|
60
65
|
_e[styles.titleLeft] = titleAlign === 'left',
|
|
61
66
|
_e[styles.trimTitle] = trimTitle,
|
|
62
|
-
_e)), color: 'primary' }, title)),
|
|
67
|
+
_e)), color: 'primary', dataTestId: getDataTestId(dataTestId, 'title') }, title)),
|
|
63
68
|
hasRightPart && (React__default['default'].createElement("div", { className: cn__default['default'](styles.addon, addonClassName, (_f = {},
|
|
64
69
|
_f[styles.addonFixed] = !sticky,
|
|
65
70
|
_f[styles.addonRight] = !sticky,
|
|
66
|
-
_f)) }, hasCloser ? React__default['default'].createElement(components_closer_Component.Closer, { className: closerClassName }) : rightAddons))),
|
|
71
|
+
_f)) }, hasCloser ? (React__default['default'].createElement(components_closer_Component.Closer, { className: closerClassName, dataTestId: getDataTestId(dataTestId, 'closer') })) : (rightAddons)))),
|
|
67
72
|
bottomAddons));
|
|
68
73
|
};
|
|
69
74
|
|
|
70
|
-
var styles$1 = {"modal":"bottom-
|
|
75
|
+
var styles$1 = {"modal":"bottom-sheet__modal_1jz80","component":"bottom-sheet__component_1jz80","withTransition":"bottom-sheet__withTransition_1jz80","scrollableContainer":"bottom-sheet__scrollableContainer_1jz80","marker":"bottom-sheet__marker_1jz80","content":"bottom-sheet__content_1jz80","noHeader":"bottom-sheet__noHeader_1jz80","noFooter":"bottom-sheet__noFooter_1jz80","scrollLocked":"bottom-sheet__scrollLocked_1jz80","appear":"bottom-sheet__appear_1jz80","enter":"bottom-sheet__enter_1jz80","appearActive":"bottom-sheet__appearActive_1jz80","enterActive":"bottom-sheet__enterActive_1jz80","enterDone":"bottom-sheet__enterDone_1jz80","appearDone":"bottom-sheet__appearDone_1jz80","exit":"bottom-sheet__exit_1jz80","exitActive":"bottom-sheet__exitActive_1jz80"};
|
|
71
76
|
require('./index.css')
|
|
72
77
|
|
|
73
78
|
var TIMEOUT = 300;
|
|
@@ -80,15 +85,14 @@ var HEADER_OFFSET = 24;
|
|
|
80
85
|
var CLOSE_OFFSET = 0.2;
|
|
81
86
|
var BottomSheet = React.forwardRef(function (_a, ref) {
|
|
82
87
|
var _b, _c, _d;
|
|
83
|
-
var open = _a.open, title = _a.title, actionButton = _a.actionButton, contentClassName = _a.contentClassName, containerClassName = _a.containerClassName, containerProps = _a.containerProps, headerClassName = _a.headerClassName, footerClassName = _a.footerClassName, addonClassName = _a.addonClassName, closerClassName = _a.closerClassName, backerClassName = _a.backerClassName, modalClassName = _a.modalClassName, modalWrapperClassName = _a.modalWrapperClassName, className = _a.className, leftAddons = _a.leftAddons, rightAddons = _a.rightAddons, bottomAddons = _a.bottomAddons, hasCloser = _a.hasCloser, hasBacker = _a.hasBacker, _e = _a.titleAlign, titleAlign = _e === void 0 ? 'left' : _e, trimTitle = _a.trimTitle, stickyHeader = _a.stickyHeader, _f = _a.stickyFooter, stickyFooter = _f === void 0 ? true : _f, _g = _a.initialHeight, initialHeight = _g === void 0 ? 'default' : _g, hideOverlay = _a.hideOverlay, hideHeader = _a.hideHeader, disableOverlayClick = _a.disableOverlayClick, disableBlockingScroll = _a.disableBlockingScroll, children = _a.children, zIndex = _a.zIndex, _h = _a.transitionProps, transitionProps = _h === void 0 ? {} : _h, dataTestId = _a.dataTestId, _j = _a.swipeable, swipeable = _j === void 0 ? true : _j,
|
|
84
|
-
var
|
|
85
|
-
var
|
|
86
|
-
var
|
|
88
|
+
var open = _a.open, title = _a.title, actionButton = _a.actionButton, contentClassName = _a.contentClassName, containerClassName = _a.containerClassName, containerProps = _a.containerProps, headerClassName = _a.headerClassName, footerClassName = _a.footerClassName, addonClassName = _a.addonClassName, closerClassName = _a.closerClassName, backerClassName = _a.backerClassName, modalClassName = _a.modalClassName, modalWrapperClassName = _a.modalWrapperClassName, className = _a.className, leftAddons = _a.leftAddons, rightAddons = _a.rightAddons, bottomAddons = _a.bottomAddons, hasCloser = _a.hasCloser, hasBacker = _a.hasBacker, _e = _a.titleAlign, titleAlign = _e === void 0 ? 'left' : _e, trimTitle = _a.trimTitle, stickyHeader = _a.stickyHeader, _f = _a.stickyFooter, stickyFooter = _f === void 0 ? true : _f, _g = _a.initialHeight, initialHeight = _g === void 0 ? 'default' : _g, hideOverlay = _a.hideOverlay, hideHeader = _a.hideHeader, disableOverlayClick = _a.disableOverlayClick, disableBlockingScroll = _a.disableBlockingScroll, children = _a.children, zIndex = _a.zIndex, _h = _a.transitionProps, transitionProps = _h === void 0 ? {} : _h, dataTestId = _a.dataTestId, _j = _a.swipeable, swipeable = _j === void 0 ? true : _j, backdropProps = _a.backdropProps, onClose = _a.onClose, onBack = _a.onBack;
|
|
89
|
+
var _k = React.useState(0), sheetOffset = _k[0], setSheetOffset = _k[1];
|
|
90
|
+
var _l = React.useState(1), backdropOpacity = _l[0], setBackdropOpacity = _l[1];
|
|
91
|
+
var _m = React.useState(false), scrollLocked = _m[0], setScrollLocked = _m[1];
|
|
87
92
|
var sheetHeight = React.useRef(0);
|
|
88
93
|
var scrollableContainer = React.useRef(null);
|
|
89
94
|
var scrollableContainerScrollValue = React.useRef(0);
|
|
90
95
|
var emptyHeader = !hasCloser && !hasBacker && !leftAddons && !rightAddons && !title;
|
|
91
|
-
var _p = React.useState(styles$1.withTransition), transitionClassName = _p[0], setTransitionClassName = _p[1];
|
|
92
96
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
93
97
|
var fullHeight = reactDiv100vh.use100vh();
|
|
94
98
|
var targetHeight = fullHeight - HEADER_OFFSET + "px";
|
|
@@ -106,6 +110,7 @@ var BottomSheet = React.forwardRef(function (_a, ref) {
|
|
|
106
110
|
titleAlign: titleAlign,
|
|
107
111
|
trimTitle: trimTitle,
|
|
108
112
|
sticky: stickyHeader,
|
|
113
|
+
dataTestId: getDataTestId(dataTestId, 'header'),
|
|
109
114
|
onBack: onBack,
|
|
110
115
|
};
|
|
111
116
|
var getBackdropOpacity = function (offset) {
|
|
@@ -153,12 +158,6 @@ var BottomSheet = React.forwardRef(function (_a, ref) {
|
|
|
153
158
|
onClose();
|
|
154
159
|
}
|
|
155
160
|
else {
|
|
156
|
-
/**
|
|
157
|
-
* Установить мгновенную анимацию шторке если она не закрыта при свайпе и установлен проп ignoreScreenChange
|
|
158
|
-
*/
|
|
159
|
-
if (ignoreScreenChange) {
|
|
160
|
-
setTransitionClassName(styles$1.withZeroTransition);
|
|
161
|
-
}
|
|
162
161
|
setSheetOffset(0);
|
|
163
162
|
setBackdropOpacity(1);
|
|
164
163
|
}
|
|
@@ -182,12 +181,6 @@ var BottomSheet = React.forwardRef(function (_a, ref) {
|
|
|
182
181
|
*/
|
|
183
182
|
if (offset > 0) {
|
|
184
183
|
setScrollLocked(true);
|
|
185
|
-
/**
|
|
186
|
-
* Вернуть плавную анимацию шторке при свайпе
|
|
187
|
-
*/
|
|
188
|
-
if (transitionClassName === styles$1.withZeroTransition) {
|
|
189
|
-
setTransitionClassName(styles$1.withTransition);
|
|
190
|
-
}
|
|
191
184
|
}
|
|
192
185
|
};
|
|
193
186
|
var backdropSwipeablehandlers = reactSwipeable.useSwipeable({
|
|
@@ -221,10 +214,7 @@ var BottomSheet = React.forwardRef(function (_a, ref) {
|
|
|
221
214
|
if (!open) {
|
|
222
215
|
setSheetOffset(0);
|
|
223
216
|
}
|
|
224
|
-
|
|
225
|
-
setTransitionClassName(styles$1.withZeroTransition);
|
|
226
|
-
}
|
|
227
|
-
}, [open, ignoreScreenChange]);
|
|
217
|
+
}, [open]);
|
|
228
218
|
var getSwipeStyles = function () { return ({
|
|
229
219
|
transform: sheetOffset ? "translateY(" + sheetOffset + "px)" : '',
|
|
230
220
|
}); };
|
|
@@ -233,19 +223,20 @@ var BottomSheet = React.forwardRef(function (_a, ref) {
|
|
|
233
223
|
maxHeight: targetHeight,
|
|
234
224
|
}); };
|
|
235
225
|
return (React__default['default'].createElement(coreComponentsBaseModal.BaseModal, { open: open, ref: ref, dataTestId: dataTestId, zIndex: zIndex, onClose: onClose, scrollHandler: scrollableContainer, Backdrop: components_swipeableBackdrop_Component.SwipeableBackdrop, backdropProps: tslib_es6.__assign(tslib_es6.__assign({}, backdropProps), { opacity: backdropOpacity, handlers: swipeable ? backdropSwipeablehandlers : false, opacityTimeout: TIMEOUT, invisible: initialHeight === 'full' ? false : hideOverlay }), disableBackdropClick: hideOverlay ? true : disableOverlayClick, className: cn__default['default'](styles$1.modal, modalClassName), wrapperClassName: modalWrapperClassName, disableBlockingScroll: disableBlockingScroll, transitionProps: tslib_es6.__assign(tslib_es6.__assign({ appear: true, timeout: TIMEOUT, classNames: styles$1 }, transitionProps), { onExited: handleExited, onEntered: handleEntered }) },
|
|
236
|
-
React__default['default'].createElement("div", tslib_es6.__assign({
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
226
|
+
React__default['default'].createElement("div", { style: tslib_es6.__assign({}, getHeightStyles()) },
|
|
227
|
+
React__default['default'].createElement("div", tslib_es6.__assign({ className: cn__default['default'](styles$1.component, className, (_b = {},
|
|
228
|
+
_b[styles$1.withTransition] = !sheetOffset,
|
|
229
|
+
_b)), style: tslib_es6.__assign(tslib_es6.__assign({}, getSwipeStyles()), getHeightStyles()) }, sheetSwipeablehandlers),
|
|
230
|
+
React__default['default'].createElement("div", tslib_es6.__assign({}, containerProps, { className: cn__default['default'](styles$1.scrollableContainer, containerProps === null || containerProps === void 0 ? void 0 : containerProps.className, containerClassName, (_c = {},
|
|
231
|
+
_c[styles$1.scrollLocked] = scrollLocked,
|
|
232
|
+
_c)), ref: scrollableContainer }),
|
|
233
|
+
swipeable && React__default['default'].createElement("div", { className: cn__default['default'](styles$1.marker) }),
|
|
234
|
+
!hideHeader && !emptyHeader && React__default['default'].createElement(Header, tslib_es6.__assign({}, headerProps)),
|
|
235
|
+
React__default['default'].createElement("div", { className: cn__default['default'](styles$1.content, contentClassName, (_d = {},
|
|
236
|
+
_d[styles$1.noHeader] = hideHeader || emptyHeader,
|
|
237
|
+
_d[styles$1.noFooter] = !actionButton,
|
|
238
|
+
_d)) }, children),
|
|
239
|
+
actionButton && (React__default['default'].createElement(components_footer_Component.Footer, { sticky: stickyFooter, className: footerClassName }, actionButton)))))));
|
|
249
240
|
});
|
|
250
241
|
|
|
251
242
|
exports.BottomSheet = BottomSheet;
|
package/component.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
require('./tslib.es6-
|
|
5
|
+
require('./tslib.es6-86a36c7d.js');
|
|
6
6
|
require('react');
|
|
7
7
|
require('classnames');
|
|
8
8
|
require('react-div-100vh');
|
|
@@ -14,7 +14,7 @@ require('@alfalab/icons-glyph/CrossMIcon');
|
|
|
14
14
|
require('./components/closer/Component.js');
|
|
15
15
|
require('@alfalab/icons-glyph/ArrowBackMIcon');
|
|
16
16
|
require('./components/backer/Component.js');
|
|
17
|
-
var components_header_Component = require('./component-
|
|
17
|
+
var components_header_Component = require('./component-781ae88d.js');
|
|
18
18
|
require('./components/footer/Component.js');
|
|
19
19
|
require('@alfalab/core-components-backdrop');
|
|
20
20
|
require('./components/swipeable-backdrop/Component.js');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var tslib_es6 = require('../../tslib.es6-
|
|
5
|
+
var tslib_es6 = require('../../tslib.es6-86a36c7d.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var cn = require('classnames');
|
|
8
8
|
var coreComponentsIconButton = require('@alfalab/core-components-icon-button');
|
|
@@ -13,13 +13,13 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
13
13
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
14
|
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
15
15
|
|
|
16
|
-
var styles = {"backer":"bottom-
|
|
16
|
+
var styles = {"backer":"bottom-sheet__backer_1uutm","button":"bottom-sheet__button_1uutm"};
|
|
17
17
|
require('./index.css')
|
|
18
18
|
|
|
19
19
|
var Backer = function (_a) {
|
|
20
|
-
var className = _a.className, _b = _a.size, size = _b === void 0 ? 'xs' : _b, _c = _a.icon, icon = _c === void 0 ? ArrowBackMIcon.ArrowBackMIcon : _c, onClick = _a.onClick, restProps = tslib_es6.__rest(_a, ["className", "size", "icon", "onClick"]);
|
|
20
|
+
var className = _a.className, _b = _a.size, size = _b === void 0 ? 'xs' : _b, _c = _a.icon, icon = _c === void 0 ? ArrowBackMIcon.ArrowBackMIcon : _c, dataTestId = _a.dataTestId, onClick = _a.onClick, restProps = tslib_es6.__rest(_a, ["className", "size", "icon", "dataTestId", "onClick"]);
|
|
21
21
|
return (React__default['default'].createElement("div", { className: cn__default['default'](styles.backer, className) },
|
|
22
|
-
React__default['default'].createElement(coreComponentsIconButton.IconButton, tslib_es6.__assign({ size: size, className: styles.button, "aria-label": '\u043D\u0430\u0437\u0430\u0434', onClick: onClick, icon: icon }, restProps))));
|
|
22
|
+
React__default['default'].createElement(coreComponentsIconButton.IconButton, tslib_es6.__assign({ size: size, className: styles.button, "aria-label": '\u043D\u0430\u0437\u0430\u0434', onClick: onClick, icon: icon, dataTestId: dataTestId }, restProps))));
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
exports.Backer = Backer;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: gaaii */
|
|
2
2
|
:root {
|
|
3
3
|
--bottom-sheet-backer-bg-color: var(--color-light-bg-primary-inverted-alpha-3);
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
.bottom-
|
|
6
|
+
.bottom-sheet__backer_1uutm {
|
|
7
7
|
width: 32px;
|
|
8
8
|
height: 32px;
|
|
9
9
|
display: flex;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
color: var(--color-light-graphic-primary);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
.bottom-
|
|
16
|
+
.bottom-sheet__button_1uutm {
|
|
17
17
|
background: var(--bottom-sheet-backer-bg-color);
|
|
18
18
|
-webkit-backdrop-filter: blur(10px);
|
|
19
19
|
backdrop-filter: blur(10px);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var tslib_es6 = require('../../tslib.es6-
|
|
5
|
+
var tslib_es6 = require('../../tslib.es6-86a36c7d.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var cn = require('classnames');
|
|
8
8
|
var coreComponentsBaseModal = require('@alfalab/core-components-base-modal');
|
|
@@ -14,17 +14,17 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
14
14
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
15
15
|
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
16
16
|
|
|
17
|
-
var styles = {"closer":"bottom-
|
|
17
|
+
var styles = {"closer":"bottom-sheet__closer_602ln","button":"bottom-sheet__button_602ln"};
|
|
18
18
|
require('./index.css')
|
|
19
19
|
|
|
20
20
|
var Closer = function (_a) {
|
|
21
|
-
var className = _a.className, _b = _a.size, size = _b === void 0 ? 'xs' : _b, _c = _a.icon, icon = _c === void 0 ? CrossMIcon.CrossMIcon : _c, restProps = tslib_es6.__rest(_a, ["className", "size", "icon"]);
|
|
21
|
+
var className = _a.className, _b = _a.size, size = _b === void 0 ? 'xs' : _b, _c = _a.icon, icon = _c === void 0 ? CrossMIcon.CrossMIcon : _c, dataTestId = _a.dataTestId, restProps = tslib_es6.__rest(_a, ["className", "size", "icon", "dataTestId"]);
|
|
22
22
|
var onClose = React.useContext(coreComponentsBaseModal.BaseModalContext).onClose;
|
|
23
23
|
var handleClick = React.useCallback(function (event) {
|
|
24
24
|
onClose(event, 'closerClick');
|
|
25
25
|
}, [onClose]);
|
|
26
26
|
return (React__default['default'].createElement("div", { className: cn__default['default'](styles.closer, className) },
|
|
27
|
-
React__default['default'].createElement(coreComponentsIconButton.IconButton, tslib_es6.__assign({ size: size, className: styles.button, "aria-label": '\u0437\u0430\u043A\u0440\u044B\u0442\u044C', onClick: handleClick, icon: icon }, restProps))));
|
|
27
|
+
React__default['default'].createElement(coreComponentsIconButton.IconButton, tslib_es6.__assign({ size: size, className: styles.button, "aria-label": '\u0437\u0430\u043A\u0440\u044B\u0442\u044C', onClick: handleClick, icon: icon, dataTestId: dataTestId }, restProps))));
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
exports.Closer = Closer;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1hbm7 */
|
|
2
2
|
:root {
|
|
3
3
|
--bottom-sheet-closer-bg-color: var(--color-light-bg-primary-inverted-alpha-3);
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
.bottom-
|
|
6
|
+
.bottom-sheet__closer_602ln {
|
|
7
7
|
width: 32px;
|
|
8
8
|
height: 32px;
|
|
9
9
|
display: flex;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
color: var(--color-light-graphic-primary);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
.bottom-
|
|
16
|
+
.bottom-sheet__button_602ln {
|
|
17
17
|
background: var(--bottom-sheet-closer-bg-color);
|
|
18
18
|
-webkit-backdrop-filter: blur(10px);
|
|
19
19
|
backdrop-filter: blur(10px);
|
|
@@ -11,7 +11,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
11
11
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
12
|
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
13
13
|
|
|
14
|
-
var styles = {"footer":"bottom-
|
|
14
|
+
var styles = {"footer":"bottom-sheet__footer_x0z3h","sticky":"bottom-sheet__sticky_x0z3h","highlighted":"bottom-sheet__highlighted_x0z3h"};
|
|
15
15
|
require('./index.css')
|
|
16
16
|
|
|
17
17
|
var Footer = function (_a) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1nuye */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-bg-primary: #fff;
|
|
4
4
|
--color-light-border-primary: #dbdee1;
|
|
@@ -18,15 +18,15 @@
|
|
|
18
18
|
--bottom-sheet-footer-border-top: 1px solid var(--color-light-border-primary);
|
|
19
19
|
--bottom-sheet-footer-background-color: var(--color-light-bg-primary);
|
|
20
20
|
}
|
|
21
|
-
.bottom-
|
|
21
|
+
.bottom-sheet__footer_x0z3h {
|
|
22
22
|
padding: var(--gap-m) var(--gap-m);
|
|
23
23
|
background-color: var(--color-light-bg-primary);
|
|
24
24
|
}
|
|
25
|
-
.bottom-
|
|
25
|
+
.bottom-sheet__sticky_x0z3h {
|
|
26
26
|
position: sticky;
|
|
27
27
|
bottom: 0;
|
|
28
28
|
}
|
|
29
|
-
.bottom-
|
|
29
|
+
.bottom-sheet__highlighted_x0z3h {
|
|
30
30
|
border-top: var(--bottom-sheet-footer-border-top);
|
|
31
31
|
background-color: var(--bottom-sheet-footer-background-color);
|
|
32
32
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
require('../../tslib.es6-
|
|
5
|
+
require('../../tslib.es6-86a36c7d.js');
|
|
6
6
|
require('react');
|
|
7
7
|
require('classnames');
|
|
8
8
|
require('react-div-100vh');
|
|
@@ -14,7 +14,7 @@ require('@alfalab/icons-glyph/CrossMIcon');
|
|
|
14
14
|
require('../closer/Component.js');
|
|
15
15
|
require('@alfalab/icons-glyph/ArrowBackMIcon');
|
|
16
16
|
require('../backer/Component.js');
|
|
17
|
-
var components_header_Component = require('../../component-
|
|
17
|
+
var components_header_Component = require('../../component-781ae88d.js');
|
|
18
18
|
require('../footer/Component.js');
|
|
19
19
|
require('@alfalab/core-components-backdrop');
|
|
20
20
|
require('../swipeable-backdrop/Component.js');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: pfp38 */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-bg-primary: #fff;
|
|
4
4
|
}
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
--bottom-sheet-title-font-family: var(--font-family-system);
|
|
31
31
|
--bottom-sheet-title-margin-vertical: var(--gap-2xs);
|
|
32
32
|
}
|
|
33
|
-
.bottom-
|
|
33
|
+
.bottom-sheet__headerWrapper_grajk {
|
|
34
34
|
padding: var(--gap-xs);
|
|
35
35
|
padding-bottom: 0;
|
|
36
36
|
background-color: var(--color-light-bg-primary);
|
|
@@ -38,38 +38,38 @@
|
|
|
38
38
|
border-top-left-radius: var(--border-radius-xl);
|
|
39
39
|
z-index: 1;
|
|
40
40
|
}
|
|
41
|
-
.bottom-
|
|
41
|
+
.bottom-sheet__header_grajk {
|
|
42
42
|
display: flex;
|
|
43
43
|
}
|
|
44
|
-
.bottom-
|
|
44
|
+
.bottom-sheet__sticky_grajk {
|
|
45
45
|
position: sticky;
|
|
46
46
|
top: 0;
|
|
47
47
|
}
|
|
48
|
-
.bottom-
|
|
48
|
+
.bottom-sheet__highlighted_grajk {
|
|
49
49
|
border-bottom: var(--bottom-sheet-header-border-bottom);
|
|
50
50
|
}
|
|
51
|
-
.bottom-
|
|
51
|
+
.bottom-sheet__justifyEnd_grajk {
|
|
52
52
|
justify-content: flex-end;
|
|
53
53
|
}
|
|
54
|
-
.bottom-
|
|
54
|
+
.bottom-sheet__addon_grajk {
|
|
55
55
|
display: flex;
|
|
56
56
|
justify-content: center;
|
|
57
57
|
align-items: center;
|
|
58
58
|
min-width: 48px;
|
|
59
59
|
height: 48px;
|
|
60
60
|
}
|
|
61
|
-
.bottom-
|
|
61
|
+
.bottom-sheet__addonFixed_grajk {
|
|
62
62
|
position: fixed;
|
|
63
63
|
}
|
|
64
|
-
.bottom-
|
|
64
|
+
.bottom-sheet__addonLeft_grajk {
|
|
65
65
|
left: 0;
|
|
66
66
|
margin-left: var(--gap-xs);
|
|
67
67
|
}
|
|
68
|
-
.bottom-
|
|
68
|
+
.bottom-sheet__addonRight_grajk {
|
|
69
69
|
right: 0;
|
|
70
70
|
margin-right: var(--gap-xs);
|
|
71
71
|
}
|
|
72
|
-
.bottom-
|
|
72
|
+
.bottom-sheet__title_grajk {
|
|
73
73
|
padding: var(--gap-xs) var(--gap-xs);
|
|
74
74
|
margin: var(--bottom-sheet-title-margin-vertical) 0;
|
|
75
75
|
width: 100%;
|
|
@@ -78,23 +78,23 @@
|
|
|
78
78
|
line-height: var(--bottom-sheet-title-line-height);
|
|
79
79
|
font-family: var(--bottom-sheet-title-font-family);
|
|
80
80
|
}
|
|
81
|
-
.bottom-
|
|
81
|
+
.bottom-sheet__titleCenter_grajk {
|
|
82
82
|
text-align: center;
|
|
83
83
|
}
|
|
84
|
-
.bottom-
|
|
84
|
+
.bottom-sheet__titleLeft_grajk {
|
|
85
85
|
text-align: left;
|
|
86
86
|
}
|
|
87
|
-
.bottom-
|
|
87
|
+
.bottom-sheet__trimTitle_grajk {
|
|
88
88
|
white-space: nowrap;
|
|
89
89
|
overflow: hidden;
|
|
90
90
|
text-overflow: ellipsis;
|
|
91
91
|
}
|
|
92
|
-
.bottom-
|
|
92
|
+
.bottom-sheet__titleBigIndentHorizontal_grajk {
|
|
93
93
|
margin: var(--bottom-sheet-title-margin-vertical) var(--gap-4xl);
|
|
94
94
|
}
|
|
95
|
-
.bottom-
|
|
95
|
+
.bottom-sheet__titleIndentRight_grajk {
|
|
96
96
|
margin-right: var(--gap-4xl);
|
|
97
97
|
}
|
|
98
|
-
.bottom-
|
|
98
|
+
.bottom-sheet__titleIndentLeft_grajk {
|
|
99
99
|
margin-left: var(--gap-4xl);
|
|
100
100
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var tslib_es6 = require('../../tslib.es6-
|
|
5
|
+
var tslib_es6 = require('../../tslib.es6-86a36c7d.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var coreComponentsBackdrop = require('@alfalab/core-components-backdrop');
|
|
8
8
|
|
|
@@ -58,12 +58,17 @@ type HeaderProps = {
|
|
|
58
58
|
* Фиксирует шапку
|
|
59
59
|
*/
|
|
60
60
|
sticky?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
63
|
+
*/
|
|
64
|
+
dataTestId?: string;
|
|
61
65
|
/**
|
|
62
66
|
* Обработчик нажатия на стрелку назад
|
|
63
67
|
*/
|
|
64
68
|
onBack?: () => void;
|
|
65
69
|
};
|
|
66
70
|
declare const Header: FC<HeaderProps>;
|
|
71
|
+
declare const getDataTestId: (dataTestId?: string | undefined, element?: string | undefined) => string | undefined;
|
|
67
72
|
type BottomSheetTitleAlign$0 = 'center' | 'left';
|
|
68
73
|
type BottomSheetProps = {
|
|
69
74
|
/**
|
|
@@ -200,6 +205,7 @@ type BottomSheetProps = {
|
|
|
200
205
|
*/
|
|
201
206
|
disableBlockingScroll?: boolean;
|
|
202
207
|
/**
|
|
208
|
+
* @deprecated данный проп больше не используется, временно оставлен для обратной совместимости
|
|
203
209
|
* Не анимировать шторку при изменении размера вьюпорта
|
|
204
210
|
*/
|
|
205
211
|
ignoreScreenChange?: boolean;
|
|
@@ -219,4 +225,4 @@ type BottomSheetProps = {
|
|
|
219
225
|
declare const HEADER_OFFSET = 24;
|
|
220
226
|
declare const CLOSE_OFFSET = 0.2;
|
|
221
227
|
declare const BottomSheet: React.ForwardRefExoticComponent<BottomSheetProps & React.RefAttributes<HTMLDivElement>>;
|
|
222
|
-
export { HeaderProps, Header, BottomSheetTitleAlign$0 as BottomSheetTitleAlign, BottomSheetProps, HEADER_OFFSET, CLOSE_OFFSET, BottomSheet };
|
|
228
|
+
export { HeaderProps, Header, getDataTestId, BottomSheetTitleAlign$0 as BottomSheetTitleAlign, BottomSheetProps, HEADER_OFFSET, CLOSE_OFFSET, BottomSheet };
|