@alfalab/core-components-bottom-sheet 4.1.5 → 4.3.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/CHANGELOG.md +30 -0
- package/dist/{component-08541c66.d.ts → component-69e79c88.d.ts} +17 -1
- package/dist/{component-08541c66.js → component-69e79c88.js} +49 -29
- package/dist/component.js +2 -2
- package/dist/components/backer/Component.js +2 -2
- package/dist/components/backer/index.css +3 -3
- package/dist/components/closer/Component.js +2 -2
- package/dist/components/closer/index.css +3 -3
- package/dist/components/footer/Component.js +1 -1
- package/dist/components/footer/index.css +4 -4
- package/dist/components/header/Component.js +2 -2
- package/dist/components/header/index.css +19 -17
- package/dist/components/swipeable-backdrop/Component.js +1 -1
- package/dist/{esm/component-4819d33f.d.ts → cssm/component-1a32e10b.d.ts} +17 -1
- package/dist/cssm/{component-d1b19e73.js → component-1a32e10b.js} +46 -26
- package/dist/cssm/component.js +1 -1
- package/dist/cssm/components/header/Component.js +1 -1
- package/dist/cssm/components/header/index.module.css +4 -2
- package/dist/cssm/index.d.ts +1 -1
- package/dist/cssm/index.js +1 -1
- package/dist/cssm/index.module.css +3 -0
- package/dist/{cssm/component-d1b19e73.d.ts → esm/component-83588473.d.ts} +17 -1
- package/dist/esm/{component-4819d33f.js → component-83588473.js} +49 -29
- package/dist/esm/component.js +2 -2
- package/dist/esm/components/backer/Component.js +2 -2
- package/dist/esm/components/backer/index.css +3 -3
- package/dist/esm/components/closer/Component.js +2 -2
- package/dist/esm/components/closer/index.css +3 -3
- package/dist/esm/components/footer/Component.js +1 -1
- package/dist/esm/components/footer/index.css +4 -4
- package/dist/esm/components/header/Component.js +2 -2
- package/dist/esm/components/header/index.css +19 -17
- package/dist/esm/components/swipeable-backdrop/Component.js +1 -1
- package/dist/esm/index.css +18 -15
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/{tslib.es6-06f08f9d.d.ts → tslib.es6-3c98b572.d.ts} +0 -0
- package/dist/esm/{tslib.es6-06f08f9d.js → tslib.es6-3c98b572.js} +0 -0
- package/dist/index.css +18 -15
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/modern/{component-0900cda5.d.ts → component-22385132.d.ts} +17 -1
- package/dist/modern/{component-0900cda5.js → component-22385132.js} +43 -23
- package/dist/modern/component.js +1 -1
- package/dist/modern/components/backer/Component.js +1 -1
- package/dist/modern/components/backer/index.css +3 -3
- package/dist/modern/components/closer/Component.js +1 -1
- package/dist/modern/components/closer/index.css +3 -3
- package/dist/modern/components/footer/Component.js +1 -1
- package/dist/modern/components/footer/index.css +4 -4
- package/dist/modern/components/header/Component.js +1 -1
- package/dist/modern/components/header/index.css +19 -17
- package/dist/modern/index.css +18 -15
- package/dist/modern/index.d.ts +1 -1
- package/dist/modern/index.js +1 -1
- package/dist/{tslib.es6-fb4ad0bd.d.ts → tslib.es6-f3270e16.d.ts} +0 -0
- package/dist/{tslib.es6-fb4ad0bd.js → tslib.es6-f3270e16.js} +0 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,36 @@
|
|
|
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.3.0](https://github.com/core-ds/core-components/compare/@alfalab/core-components-bottom-sheet@4.2.1...@alfalab/core-components-bottom-sheet@4.3.0) (2022-06-20)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **input-autocomplete:** add new component InputAutocompleteMobile ([#96](https://github.com/core-ds/core-components/issues/96)) ([a0e9f95](https://github.com/core-ds/core-components/commit/a0e9f95edbfcd6722e99647d75a262805e81a4a7))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [4.2.1](https://github.com/core-ds/core-components/compare/@alfalab/core-components-bottom-sheet@4.2.0...@alfalab/core-components-bottom-sheet@4.2.1) (2022-06-20)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @alfalab/core-components-bottom-sheet
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# [4.2.0](https://github.com/core-ds/core-components/compare/@alfalab/core-components-bottom-sheet@4.1.5...@alfalab/core-components-bottom-sheet@4.2.0) (2022-06-16)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Features
|
|
29
|
+
|
|
30
|
+
* **BottonSheet:** prop for controlling animation on screen size chan… ([#89](https://github.com/core-ds/core-components/issues/89)) ([a69e178](https://github.com/core-ds/core-components/commit/a69e17891d1fd91ba6f35bfc097ae1fc9cbf92df))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
6
36
|
## [4.1.5](https://github.com/core-ds/core-components/compare/@alfalab/core-components-bottom-sheet@4.1.4...@alfalab/core-components-bottom-sheet@4.1.5) (2022-06-03)
|
|
7
37
|
|
|
8
38
|
**Note:** Version bump only for package @alfalab/core-components-bottom-sheet
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react-transition-group" />
|
|
2
2
|
/// <reference types="react" />
|
|
3
3
|
import React from "react";
|
|
4
|
-
import { FC, ReactNode } from "react";
|
|
4
|
+
import { FC, ReactNode, HTMLAttributes } from "react";
|
|
5
5
|
import { BottomSheetTitleAlign } from "./index";
|
|
6
6
|
import { TransitionProps } from 'react-transition-group/Transition';
|
|
7
7
|
type HeaderProps = {
|
|
@@ -33,6 +33,10 @@ type HeaderProps = {
|
|
|
33
33
|
* Слот справа
|
|
34
34
|
*/
|
|
35
35
|
rightAddons?: ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* Слот снизу
|
|
38
|
+
*/
|
|
39
|
+
bottomAddons?: ReactNode;
|
|
36
40
|
/**
|
|
37
41
|
* Наличие компонента крестика
|
|
38
42
|
*/
|
|
@@ -85,6 +89,10 @@ type BottomSheetProps = {
|
|
|
85
89
|
* Дополнительный класс
|
|
86
90
|
*/
|
|
87
91
|
contentClassName?: string;
|
|
92
|
+
/**
|
|
93
|
+
* Дополнительные пропсы на контейнер.
|
|
94
|
+
*/
|
|
95
|
+
containerProps?: HTMLAttributes<HTMLDivElement>;
|
|
88
96
|
/**
|
|
89
97
|
* Дополнительный класс
|
|
90
98
|
*/
|
|
@@ -134,6 +142,10 @@ type BottomSheetProps = {
|
|
|
134
142
|
* Слот справа
|
|
135
143
|
*/
|
|
136
144
|
rightAddons?: ReactNode;
|
|
145
|
+
/**
|
|
146
|
+
* Слот снизу
|
|
147
|
+
*/
|
|
148
|
+
bottomAddons?: ReactNode;
|
|
137
149
|
/**
|
|
138
150
|
* Наличие компонента крестика
|
|
139
151
|
*/
|
|
@@ -174,6 +186,10 @@ type BottomSheetProps = {
|
|
|
174
186
|
* Запретить закрытие шторки кликом на оверлэй
|
|
175
187
|
*/
|
|
176
188
|
disableOverlayClick?: boolean;
|
|
189
|
+
/**
|
|
190
|
+
* Не анимировать шторку при изменении размера вьюпорта
|
|
191
|
+
*/
|
|
192
|
+
ignoreScreenChange?: boolean;
|
|
177
193
|
/**
|
|
178
194
|
* Обработчик закрытия
|
|
179
195
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var tslib_es6 = require('./tslib.es6-
|
|
3
|
+
var tslib_es6 = require('./tslib.es6-f3270e16.js');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var cn = require('classnames');
|
|
6
6
|
var reactDiv100vh = require('react-div-100vh');
|
|
@@ -17,13 +17,13 @@ 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 styles = {"header":"bottom-
|
|
20
|
+
var styles = {"headerWrapper":"bottom-sheet__headerWrapper_16j1f","header":"bottom-sheet__header_16j1f","sticky":"bottom-sheet__sticky_16j1f","highlighted":"bottom-sheet__highlighted_16j1f","justifyEnd":"bottom-sheet__justifyEnd_16j1f","addon":"bottom-sheet__addon_16j1f","addonFixed":"bottom-sheet__addonFixed_16j1f","addonLeft":"bottom-sheet__addonLeft_16j1f","addonRight":"bottom-sheet__addonRight_16j1f","title":"bottom-sheet__title_16j1f","titleCenter":"bottom-sheet__titleCenter_16j1f","titleLeft":"bottom-sheet__titleLeft_16j1f","trimTitle":"bottom-sheet__trimTitle_16j1f","titleBigIndentHorizontal":"bottom-sheet__titleBigIndentHorizontal_16j1f","titleIndentRight":"bottom-sheet__titleIndentRight_16j1f","titleIndentLeft":"bottom-sheet__titleIndentLeft_16j1f"};
|
|
21
21
|
require('./components/header/index.css')
|
|
22
22
|
|
|
23
23
|
var Header = function (_a) {
|
|
24
|
-
var _b, _c, _d, _e;
|
|
25
|
-
var title = _a.title, headerClassName = _a.headerClassName, addonClassName = _a.addonClassName, closerClassName = _a.closerClassName, backerClassName = _a.backerClassName, leftAddons = _a.leftAddons, rightAddons = _a.rightAddons, hasCloser = _a.hasCloser, hasBacker = _a.hasBacker, titleAlign = _a.titleAlign, trimTitle = _a.trimTitle, sticky = _a.sticky, onBack = _a.onBack;
|
|
26
|
-
var
|
|
24
|
+
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;
|
|
26
|
+
var _g = React.useContext(coreComponentsBaseModal.BaseModalContext), headerHighlighted = _g.headerHighlighted, setHasHeader = _g.setHasHeader, setHeaderOffset = _g.setHeaderOffset;
|
|
27
27
|
var hasLeftPart = hasBacker || leftAddons || titleAlign === 'center';
|
|
28
28
|
var hasRightPart = hasCloser || rightAddons || titleAlign === 'center';
|
|
29
29
|
var hasHeaderContent = title || hasBacker || hasCloser;
|
|
@@ -44,27 +44,30 @@ var Header = function (_a) {
|
|
|
44
44
|
_a[styles.titleIndentRight] = !sticky && !titleAlignedCenter && hasRightPart,
|
|
45
45
|
_a));
|
|
46
46
|
};
|
|
47
|
-
return (React__default['default'].createElement("div", { className: cn__default['default'](styles.
|
|
48
|
-
_b[styles.justifyEnd] = !title,
|
|
47
|
+
return (React__default['default'].createElement("div", { className: cn__default['default'](styles.headerWrapper, headerClassName, (_b = {},
|
|
49
48
|
_b[styles.highlighted] = headerHighlighted && sticky,
|
|
50
49
|
_b[styles.sticky] = sticky,
|
|
51
50
|
_b)) },
|
|
52
|
-
|
|
53
|
-
_c[styles.
|
|
54
|
-
_c
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
51
|
+
React__default['default'].createElement("div", { className: cn__default['default'](styles.header, headerClassName, (_c = {},
|
|
52
|
+
_c[styles.justifyEnd] = !title,
|
|
53
|
+
_c)) },
|
|
54
|
+
hasLeftPart && (React__default['default'].createElement("div", { className: cn__default['default'](styles.addon, addonClassName, (_d = {},
|
|
55
|
+
_d[styles.addonFixed] = !sticky,
|
|
56
|
+
_d[styles.addonLeft] = !sticky,
|
|
57
|
+
_d)) }, hasBacker ? (React__default['default'].createElement(components_backer_Component.Backer, { className: backerClassName, onClick: onBack })) : (leftAddons))),
|
|
58
|
+
hasHeaderContent && (React__default['default'].createElement(coreComponentsTypography.Typography.Text, { view: 'primary-large', weight: 'bold', className: cn__default['default'](styles.title, getTitleIndent(), (_e = {},
|
|
59
|
+
_e[styles.titleCenter] = titleAlign === 'center',
|
|
60
|
+
_e[styles.titleLeft] = titleAlign === 'left',
|
|
61
|
+
_e[styles.trimTitle] = trimTitle,
|
|
62
|
+
_e)), color: 'primary' }, title)),
|
|
63
|
+
hasRightPart && (React__default['default'].createElement("div", { className: cn__default['default'](styles.addon, addonClassName, (_f = {},
|
|
64
|
+
_f[styles.addonFixed] = !sticky,
|
|
65
|
+
_f[styles.addonRight] = !sticky,
|
|
66
|
+
_f)) }, hasCloser ? React__default['default'].createElement(components_closer_Component.Closer, { className: closerClassName }) : rightAddons))),
|
|
67
|
+
bottomAddons));
|
|
65
68
|
};
|
|
66
69
|
|
|
67
|
-
var styles$1 = {"modal":"bottom-
|
|
70
|
+
var styles$1 = {"modal":"bottom-sheet__modal_fcgs7","component":"bottom-sheet__component_fcgs7","withTransition":"bottom-sheet__withTransition_fcgs7","withZeroTransition":"bottom-sheet__withZeroTransition_fcgs7","scrollableContainer":"bottom-sheet__scrollableContainer_fcgs7","marker":"bottom-sheet__marker_fcgs7","content":"bottom-sheet__content_fcgs7","noHeader":"bottom-sheet__noHeader_fcgs7","noFooter":"bottom-sheet__noFooter_fcgs7","scrollLocked":"bottom-sheet__scrollLocked_fcgs7","appear":"bottom-sheet__appear_fcgs7","enter":"bottom-sheet__enter_fcgs7","appearActive":"bottom-sheet__appearActive_fcgs7","enterActive":"bottom-sheet__enterActive_fcgs7","enterDone":"bottom-sheet__enterDone_fcgs7","appearDone":"bottom-sheet__appearDone_fcgs7","exit":"bottom-sheet__exit_fcgs7","exitActive":"bottom-sheet__exitActive_fcgs7"};
|
|
68
71
|
require('./index.css')
|
|
69
72
|
|
|
70
73
|
var TIMEOUT = 300;
|
|
@@ -77,14 +80,15 @@ var HEADER_OFFSET = 24;
|
|
|
77
80
|
var CLOSE_OFFSET = 0.2;
|
|
78
81
|
var BottomSheet = React.forwardRef(function (_a, ref) {
|
|
79
82
|
var _b, _c, _d;
|
|
80
|
-
var open = _a.open, title = _a.title, actionButton = _a.actionButton, contentClassName = _a.contentClassName, containerClassName = _a.containerClassName, headerClassName = _a.headerClassName, footerClassName = _a.footerClassName, addonClassName = _a.addonClassName, closerClassName = _a.closerClassName, backerClassName = _a.backerClassName, className = _a.className, leftAddons = _a.leftAddons, rightAddons = _a.rightAddons, 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, 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, onClose = _a.onClose, onBack = _a.onBack;
|
|
81
|
-
var
|
|
82
|
-
var
|
|
83
|
-
var
|
|
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, 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, 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, _k = _a.ignoreScreenChange, ignoreScreenChange = _k === void 0 ? false : _k, onClose = _a.onClose, onBack = _a.onBack;
|
|
84
|
+
var _l = React.useState(0), sheetOffset = _l[0], setSheetOffset = _l[1];
|
|
85
|
+
var _m = React.useState(1), backdropOpacity = _m[0], setBackdropOpacity = _m[1];
|
|
86
|
+
var _o = React.useState(false), scrollLocked = _o[0], setScrollLocked = _o[1];
|
|
84
87
|
var sheetHeight = React.useRef(0);
|
|
85
88
|
var scrollableContainer = React.useRef(null);
|
|
86
89
|
var scrollableContainerScrollValue = React.useRef(0);
|
|
87
90
|
var emptyHeader = !hasCloser && !hasBacker && !leftAddons && !rightAddons && !title;
|
|
91
|
+
var _p = React.useState(styles$1.withTransition), transitionClassName = _p[0], setTransitionClassName = _p[1];
|
|
88
92
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
89
93
|
var fullHeight = reactDiv100vh.use100vh();
|
|
90
94
|
var targetHeight = fullHeight - HEADER_OFFSET + "px";
|
|
@@ -96,6 +100,7 @@ var BottomSheet = React.forwardRef(function (_a, ref) {
|
|
|
96
100
|
backerClassName: backerClassName,
|
|
97
101
|
leftAddons: leftAddons,
|
|
98
102
|
rightAddons: rightAddons,
|
|
103
|
+
bottomAddons: bottomAddons,
|
|
99
104
|
hasCloser: hasCloser,
|
|
100
105
|
hasBacker: hasBacker,
|
|
101
106
|
titleAlign: titleAlign,
|
|
@@ -148,6 +153,12 @@ var BottomSheet = React.forwardRef(function (_a, ref) {
|
|
|
148
153
|
onClose();
|
|
149
154
|
}
|
|
150
155
|
else {
|
|
156
|
+
/**
|
|
157
|
+
* Установить мгновенную анимацию шторке если она не закрыта при свайпе и установлен проп ignoreScreenChange
|
|
158
|
+
*/
|
|
159
|
+
if (ignoreScreenChange) {
|
|
160
|
+
setTransitionClassName(styles$1.withZeroTransition);
|
|
161
|
+
}
|
|
151
162
|
setSheetOffset(0);
|
|
152
163
|
setBackdropOpacity(1);
|
|
153
164
|
}
|
|
@@ -171,6 +182,12 @@ var BottomSheet = React.forwardRef(function (_a, ref) {
|
|
|
171
182
|
*/
|
|
172
183
|
if (offset > 0) {
|
|
173
184
|
setScrollLocked(true);
|
|
185
|
+
/**
|
|
186
|
+
* Вернуть плавную анимацию шторке при свайпе
|
|
187
|
+
*/
|
|
188
|
+
if (transitionClassName === styles$1.withZeroTransition) {
|
|
189
|
+
setTransitionClassName(styles$1.withTransition);
|
|
190
|
+
}
|
|
174
191
|
}
|
|
175
192
|
};
|
|
176
193
|
var backdropSwipeablehandlers = reactSwipeable.useSwipeable({
|
|
@@ -204,7 +221,10 @@ var BottomSheet = React.forwardRef(function (_a, ref) {
|
|
|
204
221
|
if (!open) {
|
|
205
222
|
setSheetOffset(0);
|
|
206
223
|
}
|
|
207
|
-
|
|
224
|
+
if (ignoreScreenChange && open) {
|
|
225
|
+
setTransitionClassName(styles$1.withZeroTransition);
|
|
226
|
+
}
|
|
227
|
+
}, [open, ignoreScreenChange]);
|
|
208
228
|
var getSwipeStyles = function () { return ({
|
|
209
229
|
transform: sheetOffset ? "translateY(" + sheetOffset + "px)" : '',
|
|
210
230
|
}); };
|
|
@@ -219,11 +239,11 @@ var BottomSheet = React.forwardRef(function (_a, ref) {
|
|
|
219
239
|
invisible: initialHeight === 'full' ? false : hideOverlay,
|
|
220
240
|
}, disableBackdropClick: hideOverlay ? true : disableOverlayClick, className: styles$1.modal, transitionProps: tslib_es6.__assign(tslib_es6.__assign({ appear: true, timeout: TIMEOUT, classNames: styles$1 }, transitionProps), { onExited: handleExited, onEntered: handleEntered }) },
|
|
221
241
|
React__default['default'].createElement("div", tslib_es6.__assign({ className: cn__default['default'](styles$1.component, className, (_b = {},
|
|
222
|
-
_b[
|
|
242
|
+
_b[transitionClassName] = !sheetOffset,
|
|
223
243
|
_b)), style: tslib_es6.__assign(tslib_es6.__assign({}, getSwipeStyles()), getHeightStyles()) }, sheetSwipeablehandlers),
|
|
224
|
-
React__default['default'].createElement("div", { className: cn__default['default'](styles$1.scrollableContainer, containerClassName, (_c = {},
|
|
244
|
+
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 = {},
|
|
225
245
|
_c[styles$1.scrollLocked] = scrollLocked,
|
|
226
|
-
_c)), ref: scrollableContainer },
|
|
246
|
+
_c)), ref: scrollableContainer }),
|
|
227
247
|
swipeable && React__default['default'].createElement("div", { className: cn__default['default'](styles$1.marker) }),
|
|
228
248
|
!hideHeader && !emptyHeader && React__default['default'].createElement(Header, tslib_es6.__assign({}, headerProps)),
|
|
229
249
|
React__default['default'].createElement("div", { className: cn__default['default'](styles$1.content, contentClassName, (_d = {},
|
package/dist/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-f3270e16.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-69e79c88.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-f3270e16.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var cn = require('classnames');
|
|
8
8
|
var coreComponentsIconButton = require('@alfalab/core-components-icon-button');
|
|
@@ -13,7 +13,7 @@ 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_101j2","button":"bottom-sheet__button_101j2"};
|
|
17
17
|
require('./index.css')
|
|
18
18
|
|
|
19
19
|
var Backer = function (_a) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1qh00 */
|
|
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_101j2 {
|
|
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_101j2 {
|
|
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-f3270e16.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var cn = require('classnames');
|
|
8
8
|
var coreComponentsBaseModal = require('@alfalab/core-components-base-modal');
|
|
@@ -14,7 +14,7 @@ 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_gj4pc","button":"bottom-sheet__button_gj4pc"};
|
|
18
18
|
require('./index.css')
|
|
19
19
|
|
|
20
20
|
var Closer = function (_a) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 19x6e */
|
|
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_gj4pc {
|
|
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_gj4pc {
|
|
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_16uqu","sticky":"bottom-sheet__sticky_16uqu","highlighted":"bottom-sheet__highlighted_16uqu"};
|
|
15
15
|
require('./index.css')
|
|
16
16
|
|
|
17
17
|
var Footer = function (_a) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: qupz8 */
|
|
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_16uqu {
|
|
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_16uqu {
|
|
26
26
|
position: sticky;
|
|
27
27
|
bottom: 0;
|
|
28
28
|
}
|
|
29
|
-
.bottom-
|
|
29
|
+
.bottom-sheet__highlighted_16uqu {
|
|
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-f3270e16.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-69e79c88.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: 1mfxi */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-bg-primary: #fff;
|
|
4
4
|
}
|
|
@@ -30,8 +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-
|
|
34
|
-
display: flex;
|
|
33
|
+
.bottom-sheet__headerWrapper_16j1f {
|
|
35
34
|
padding: var(--gap-xs);
|
|
36
35
|
padding-bottom: 0;
|
|
37
36
|
background-color: var(--color-light-bg-primary);
|
|
@@ -39,35 +38,38 @@
|
|
|
39
38
|
border-top-left-radius: var(--border-radius-xl);
|
|
40
39
|
z-index: 1;
|
|
41
40
|
}
|
|
42
|
-
.bottom-
|
|
41
|
+
.bottom-sheet__header_16j1f {
|
|
42
|
+
display: flex;
|
|
43
|
+
}
|
|
44
|
+
.bottom-sheet__sticky_16j1f {
|
|
43
45
|
position: sticky;
|
|
44
46
|
top: 0;
|
|
45
47
|
}
|
|
46
|
-
.bottom-
|
|
48
|
+
.bottom-sheet__highlighted_16j1f {
|
|
47
49
|
border-bottom: var(--bottom-sheet-header-border-bottom);
|
|
48
50
|
}
|
|
49
|
-
.bottom-
|
|
51
|
+
.bottom-sheet__justifyEnd_16j1f {
|
|
50
52
|
justify-content: flex-end;
|
|
51
53
|
}
|
|
52
|
-
.bottom-
|
|
54
|
+
.bottom-sheet__addon_16j1f {
|
|
53
55
|
display: flex;
|
|
54
56
|
justify-content: center;
|
|
55
57
|
align-items: center;
|
|
56
58
|
min-width: 48px;
|
|
57
59
|
height: 48px;
|
|
58
60
|
}
|
|
59
|
-
.bottom-
|
|
61
|
+
.bottom-sheet__addonFixed_16j1f {
|
|
60
62
|
position: fixed;
|
|
61
63
|
}
|
|
62
|
-
.bottom-
|
|
64
|
+
.bottom-sheet__addonLeft_16j1f {
|
|
63
65
|
left: 0;
|
|
64
66
|
margin-left: var(--gap-xs);
|
|
65
67
|
}
|
|
66
|
-
.bottom-
|
|
68
|
+
.bottom-sheet__addonRight_16j1f {
|
|
67
69
|
right: 0;
|
|
68
70
|
margin-right: var(--gap-xs);
|
|
69
71
|
}
|
|
70
|
-
.bottom-
|
|
72
|
+
.bottom-sheet__title_16j1f {
|
|
71
73
|
padding: var(--gap-xs) var(--gap-xs);
|
|
72
74
|
margin: var(--bottom-sheet-title-margin-vertical) 0;
|
|
73
75
|
width: 100%;
|
|
@@ -76,23 +78,23 @@
|
|
|
76
78
|
line-height: var(--bottom-sheet-title-line-height);
|
|
77
79
|
font-family: var(--bottom-sheet-title-font-family);
|
|
78
80
|
}
|
|
79
|
-
.bottom-
|
|
81
|
+
.bottom-sheet__titleCenter_16j1f {
|
|
80
82
|
text-align: center;
|
|
81
83
|
}
|
|
82
|
-
.bottom-
|
|
84
|
+
.bottom-sheet__titleLeft_16j1f {
|
|
83
85
|
text-align: left;
|
|
84
86
|
}
|
|
85
|
-
.bottom-
|
|
87
|
+
.bottom-sheet__trimTitle_16j1f {
|
|
86
88
|
white-space: nowrap;
|
|
87
89
|
overflow: hidden;
|
|
88
90
|
text-overflow: ellipsis;
|
|
89
91
|
}
|
|
90
|
-
.bottom-
|
|
92
|
+
.bottom-sheet__titleBigIndentHorizontal_16j1f {
|
|
91
93
|
margin: var(--bottom-sheet-title-margin-vertical) var(--gap-4xl);
|
|
92
94
|
}
|
|
93
|
-
.bottom-
|
|
95
|
+
.bottom-sheet__titleIndentRight_16j1f {
|
|
94
96
|
margin-right: var(--gap-4xl);
|
|
95
97
|
}
|
|
96
|
-
.bottom-
|
|
98
|
+
.bottom-sheet__titleIndentLeft_16j1f {
|
|
97
99
|
margin-left: var(--gap-4xl);
|
|
98
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-f3270e16.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var coreComponentsBackdrop = require('@alfalab/core-components-backdrop');
|
|
8
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react-transition-group" />
|
|
2
2
|
/// <reference types="react" />
|
|
3
3
|
import React from "react";
|
|
4
|
-
import { FC, ReactNode } from "react";
|
|
4
|
+
import { FC, ReactNode, HTMLAttributes } from "react";
|
|
5
5
|
import { BottomSheetTitleAlign } from "./index";
|
|
6
6
|
import { TransitionProps } from 'react-transition-group/Transition';
|
|
7
7
|
type HeaderProps = {
|
|
@@ -33,6 +33,10 @@ type HeaderProps = {
|
|
|
33
33
|
* Слот справа
|
|
34
34
|
*/
|
|
35
35
|
rightAddons?: ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* Слот снизу
|
|
38
|
+
*/
|
|
39
|
+
bottomAddons?: ReactNode;
|
|
36
40
|
/**
|
|
37
41
|
* Наличие компонента крестика
|
|
38
42
|
*/
|
|
@@ -85,6 +89,10 @@ type BottomSheetProps = {
|
|
|
85
89
|
* Дополнительный класс
|
|
86
90
|
*/
|
|
87
91
|
contentClassName?: string;
|
|
92
|
+
/**
|
|
93
|
+
* Дополнительные пропсы на контейнер.
|
|
94
|
+
*/
|
|
95
|
+
containerProps?: HTMLAttributes<HTMLDivElement>;
|
|
88
96
|
/**
|
|
89
97
|
* Дополнительный класс
|
|
90
98
|
*/
|
|
@@ -134,6 +142,10 @@ type BottomSheetProps = {
|
|
|
134
142
|
* Слот справа
|
|
135
143
|
*/
|
|
136
144
|
rightAddons?: ReactNode;
|
|
145
|
+
/**
|
|
146
|
+
* Слот снизу
|
|
147
|
+
*/
|
|
148
|
+
bottomAddons?: ReactNode;
|
|
137
149
|
/**
|
|
138
150
|
* Наличие компонента крестика
|
|
139
151
|
*/
|
|
@@ -174,6 +186,10 @@ type BottomSheetProps = {
|
|
|
174
186
|
* Запретить закрытие шторки кликом на оверлэй
|
|
175
187
|
*/
|
|
176
188
|
disableOverlayClick?: boolean;
|
|
189
|
+
/**
|
|
190
|
+
* Не анимировать шторку при изменении размера вьюпорта
|
|
191
|
+
*/
|
|
192
|
+
ignoreScreenChange?: boolean;
|
|
177
193
|
/**
|
|
178
194
|
* Обработчик закрытия
|
|
179
195
|
*/
|