@megafon/ui-core 8.11.0 → 8.12.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.
@@ -21,6 +21,11 @@ export declare const NavTheme: {
21
21
  readonly DARK: "dark";
22
22
  };
23
23
  type NavThemeType = (typeof NavTheme)[keyof typeof NavTheme];
24
+ export declare const PaginationAlign: {
25
+ readonly CENTER: "center";
26
+ readonly LEFT: "left";
27
+ };
28
+ export type PaginationAlignType = (typeof PaginationAlign)[keyof typeof PaginationAlign];
24
29
  export declare const PaginationTheme: {
25
30
  readonly DEFAULT: "default";
26
31
  readonly LIGHT: "light";
@@ -63,8 +68,8 @@ export interface IBannerProps {
63
68
  dotSvg?: Record<string, string>;
64
69
  dotInner?: Record<string, string>;
65
70
  };
66
- /** Выравнивание блока пагинации */
67
- paginationAlign?: 'center' | 'left';
71
+ /** Выравнивание блока пагинации. DEPRECATED: 'left' */
72
+ paginationAlign?: PaginationAlignType;
68
73
  /** Цветовая тема пагинации */
69
74
  paginationTheme?: PaginationThemeType;
70
75
  /** Тип кнопок пагинации */
@@ -22,7 +22,7 @@ try {
22
22
  Autoplay = Modules.Autoplay;
23
23
  } catch (e) {
24
24
  // eslint-disable-next-line no-console
25
- console.warn("\n WARNING: megafon/ui-core is using the latest version of swiper. \n For more information about server-side rendering\n please check the Banner component documentation at:\n https://ui.megafon.ru/components/banner\n ");
25
+ console.warn("\n WARNING: megafon/ui-core is using the latest version of swiper.\n For more information about server-side rendering\n please check the Banner component documentation at:\n https://ui.megafon.ru/components/banner\n ");
26
26
  }
27
27
  export var BackgroundColor = {
28
28
  TRANSPARENT: 'transparent',
@@ -40,6 +40,10 @@ export var NavTheme = {
40
40
  LIGHT: 'light',
41
41
  DARK: 'dark'
42
42
  };
43
+ export var PaginationAlign = {
44
+ CENTER: 'center',
45
+ LEFT: 'left'
46
+ };
43
47
  export var PaginationTheme = {
44
48
  DEFAULT: 'default',
45
49
  LIGHT: 'light',
@@ -59,10 +63,9 @@ var Banner = function Banner(_ref) {
59
63
  _ref$classes = _ref.classes,
60
64
  classes = _ref$classes === void 0 ? {} : _ref$classes,
61
65
  dataAttrs = _ref.dataAttrs,
62
- paginationAlign = _ref.paginationAlign,
63
- paginationTheme = _ref.paginationTheme,
66
+ _ref$paginationAlign = _ref.paginationAlign,
67
+ paginationAlign = _ref$paginationAlign === void 0 ? PaginationAlign.CENTER : _ref$paginationAlign,
64
68
  paginationType = _ref.paginationType,
65
- paginationPosition = _ref.paginationPosition,
66
69
  _ref$withPaginationBo = _ref.withPaginationBottomOffset,
67
70
  withPaginationBottomOffset = _ref$withPaginationBo === void 0 ? false : _ref$withPaginationBo,
68
71
  _ref$autoPlay = _ref.autoPlay,
@@ -73,8 +76,7 @@ var Banner = function Banner(_ref) {
73
76
  loop = _ref$loop === void 0 ? false : _ref$loop,
74
77
  _ref$pauseOnHover = _ref.pauseOnHover,
75
78
  pauseOnHover = _ref$pauseOnHover === void 0 ? false : _ref$pauseOnHover,
76
- _ref$backgroundColor = _ref.backgroundColor,
77
- backgroundColor = _ref$backgroundColor === void 0 ? BackgroundColor.TRANSPARENT : _ref$backgroundColor,
79
+ backgroundColor = _ref.backgroundColor,
78
80
  _ref$radius = _ref.radius,
79
81
  radius = _ref$radius === void 0 ? Radius.ROUNDED : _ref$radius,
80
82
  _ref$arrowTheme = _ref.arrowTheme,
@@ -130,6 +132,20 @@ var Banner = function Banner(_ref) {
130
132
  var dotTimerDelay = delay / 1000;
131
133
  var arrowSize = arrowTheme === ArrowTheme.WHITE ? ArrowSize.LARGE : ArrowSize.MIDDLE;
132
134
  var rootRef = React.useRef(null);
135
+ var correctPaginationPosition = paginationType === PaginationButtonType.FLAT ? PaginationPositionType.TOP_IN : PaginationPositionType.BOTTOM_OUT;
136
+ var correctPaginationAlign = paginationType === PaginationButtonType.FLAT ? paginationAlign : PaginationAlign.CENTER;
137
+ var getCorrectPaginationTheme = function getCorrectPaginationTheme() {
138
+ switch (backgroundColor) {
139
+ case BackgroundColor.GREEN:
140
+ case BackgroundColor.PURPLE:
141
+ return PaginationTheme.LIGHT;
142
+ case BackgroundColor.LIGHT:
143
+ case BackgroundColor.GRADIENT:
144
+ return PaginationTheme.DARK;
145
+ default:
146
+ return PaginationTheme.DEFAULT;
147
+ }
148
+ };
133
149
  var increaseAutoplayDelay = React.useCallback(function (_ref2) {
134
150
  var params = _ref2.params,
135
151
  autoplay = _ref2.autoplay;
@@ -249,8 +265,8 @@ var Banner = function Banner(_ref) {
249
265
  var renderPagination = /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.pagination), {
250
266
  className: cn('pagination', {
251
267
  type: paginationType,
252
- align: paginationAlign,
253
- position: paginationPosition,
268
+ align: correctPaginationAlign,
269
+ position: correctPaginationPosition,
254
270
  'bottom-offset': withPaginationBottomOffset
255
271
  }, [classes.pagination])
256
272
  }), children && React.Children.map(children, function (_, i) {
@@ -267,7 +283,7 @@ var Banner = function Banner(_ref) {
267
283
  showTimer: showDotTimer,
268
284
  timerDelay: dotTimerDelay,
269
285
  type: paginationType,
270
- theme: paginationTheme,
286
+ theme: getCorrectPaginationTheme(),
271
287
  onClick: handleDotClick
272
288
  });
273
289
  }));
@@ -1 +1 @@
1
- h1,h2,h3,h4,h5{margin:0}.mfui-modal-open-body{height:100%;overflow:hidden}.mfui-modal__overlay{display:-webkit-box;display:-ms-flexbox;display:flex;left:0;position:fixed;top:0;z-index:1000;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:start;-ms-flex-pack:start;-webkit-animation:show-popup-overlay .3s ease-out forwards;animation:show-popup-overlay .3s ease-out forwards;-webkit-box-sizing:border-box;box-sizing:border-box;height:100%;justify-content:flex-start;opacity:0;padding:72px 0;width:100%}.mfui-modal__modal-content{margin:auto;position:relative}.mfui-modal_full-view .mfui-modal__overlay{display:block;padding:0}.mfui-modal_full-view .mfui-modal__modal-content{display:-webkit-box;display:-ms-flexbox;display:flex;min-height:100%;width:100%}.mfui-modal_bottom-view .mfui-modal__overlay{bottom:0;display:block;height:auto;overflow:hidden;padding-bottom:0}.mfui-modal_bottom-view .mfui-modal__modal-content{height:100%;margin:0;outline:none;overflow:hidden}.mfui-modal_native-scroll .mfui-modal__overlay{overflow-x:hidden;overflow-y:scroll}@media screen and (hover:hover){.mfui-modal_native-scroll .mfui-modal__overlay{width:calc(100% + 15px)}}.mfui-modal_transition-end .mfui-modal__overlay{-webkit-animation:hide-popup-overlay .2s ease-in;animation:hide-popup-overlay .2s ease-in}@-webkit-keyframes show-popup-overlay{0%{opacity:0}to{opacity:1}}@keyframes show-popup-overlay{0%{opacity:0}to{opacity:1}}@-webkit-keyframes hide-popup-overlay{0%{opacity:1}to{opacity:0}}@keyframes hide-popup-overlay{0%{opacity:1}to{opacity:0}}
1
+ h1,h2,h3,h4,h5{margin:0}.mfui-modal-open-body{height:100%;overflow:hidden}.mfui-modal__overlay{display:-webkit-box;display:-ms-flexbox;display:flex;left:0;position:fixed;top:0;z-index:1000;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:start;-ms-flex-pack:start;-webkit-animation:show-popup-overlay .3s ease-out forwards;animation:show-popup-overlay .3s ease-out forwards;-webkit-box-sizing:border-box;box-sizing:border-box;height:100%;justify-content:flex-start;opacity:0;padding:72px 0;width:100%}.mfui-modal__modal-content{margin:auto;position:relative}.mfui-modal_full-view .mfui-modal__overlay{display:block;padding:0}.mfui-modal_full-view .mfui-modal__modal-content{display:-webkit-box;display:-ms-flexbox;display:flex;min-height:100%;width:100%}.mfui-modal_bottom-view .mfui-modal__overlay{bottom:0;display:block;height:auto;overflow:hidden;padding-bottom:0;-ms-touch-action:none;touch-action:none}.mfui-modal_bottom-view .mfui-modal__modal-content{height:100%;margin:0;outline:none;overflow:hidden;-ms-touch-action:pan-y;touch-action:pan-y}.mfui-modal_native-scroll .mfui-modal__overlay{overflow-x:hidden;overflow-y:scroll}@media screen and (hover:hover){.mfui-modal_native-scroll .mfui-modal__overlay{width:calc(100% + 15px)}}.mfui-modal_transition-end .mfui-modal__overlay{-webkit-animation:hide-popup-overlay .2s ease-in;animation:hide-popup-overlay .2s ease-in}@-webkit-keyframes show-popup-overlay{0%{opacity:0}to{opacity:1}}@keyframes show-popup-overlay{0%{opacity:0}to{opacity:1}}@-webkit-keyframes hide-popup-overlay{0%{opacity:1}to{opacity:0}}@keyframes hide-popup-overlay{0%{opacity:1}to{opacity:0}}
@@ -161,7 +161,10 @@ var ModalContent = function ModalContent(_ref) {
161
161
  className: cn('container-inner', {
162
162
  'native-scroll': isEnabledNativeScroll
163
163
  }, classes === null || classes === void 0 ? void 0 : classes.containerInner),
164
- ref: containerInnerRef
164
+ ref: containerInnerRef,
165
+ onClick: function onClick(e) {
166
+ return e.stopPropagation();
167
+ }
165
168
  }), isStickyHeader && renderHeader, /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.containerBody), {
166
169
  className: cn('container-body', {
167
170
  'native-scroll': isEnabledNativeScroll
@@ -79,7 +79,6 @@ var ModalMobileBottom = function ModalMobileBottom(_a) {
79
79
  });
80
80
  }, [containerWrapRef, scrollBarScrollableRef, initialContainerWrapHeight, initialTouchPosition, onChangeContainerWrapTransform, onChangeTransitionStep]);
81
81
  var handleWindowTouchEnd = React.useCallback(function (e) {
82
- var _a;
83
82
  var containerWrapNode = containerWrapRef.current;
84
83
  var scrollableNode = scrollBarScrollableRef.current;
85
84
  var isScrollTop = ((scrollableNode === null || scrollableNode === void 0 ? void 0 : scrollableNode.scrollTop) || 0) === 0;
@@ -87,12 +86,28 @@ var ModalMobileBottom = function ModalMobileBottom(_a) {
87
86
  return;
88
87
  }
89
88
  window.cancelAnimationFrame(animationFrameId.current);
89
+ if (!e.changedTouches.length) {
90
+ setInitialTouchPosition(null);
91
+ return;
92
+ }
93
+ var touchStartY = initialTouchPosition;
94
+ var touchEndY = e.changedTouches[0].clientY;
95
+ if (touchStartY === null) {
96
+ setInitialTouchPosition(null);
97
+ return;
98
+ }
99
+ var deltaY = touchStartY - touchEndY;
100
+ var absDeltaY = Math.abs(deltaY);
101
+ if (absDeltaY < 5 || touchStartY > touchEndY) {
102
+ setInitialTouchPosition(null);
103
+ return;
104
+ }
90
105
  var containerCenterPosition = containerWrapNode.offsetTop + offsetHeightCenter;
91
- var isMoreHalfClosed = ((_a = e.changedTouches[0]) === null || _a === void 0 ? void 0 : _a.clientY) > containerCenterPosition;
106
+ var isMoreHalfClosed = touchEndY > containerCenterPosition;
92
107
  setInitialTouchPosition(null);
93
108
  onChangeContainerWrapTransform(isMoreHalfClosed ? 'translateY(100%)' : 'none');
94
109
  onChangeTransitionStep(isMoreHalfClosed ? MODAL_TRANSITIONS_STEPS_ENUM.MOVE_END_STEP : MODAL_TRANSITIONS_STEPS_ENUM.INITIAL_STEP);
95
- }, [containerWrapRef, scrollBarScrollableRef, isTransitionMoveStep, offsetHeightCenter, onChangeContainerWrapTransform, onChangeTransitionStep]);
110
+ }, [containerWrapRef, scrollBarScrollableRef, isTransitionMoveStep, initialTouchPosition, offsetHeightCenter, onChangeContainerWrapTransform, onChangeTransitionStep]);
96
111
  React.useEffect(function () {
97
112
  if (isSwipeDisabled) {
98
113
  return undefined;
@@ -21,6 +21,11 @@ export declare const NavTheme: {
21
21
  readonly DARK: "dark";
22
22
  };
23
23
  type NavThemeType = (typeof NavTheme)[keyof typeof NavTheme];
24
+ export declare const PaginationAlign: {
25
+ readonly CENTER: "center";
26
+ readonly LEFT: "left";
27
+ };
28
+ export type PaginationAlignType = (typeof PaginationAlign)[keyof typeof PaginationAlign];
24
29
  export declare const PaginationTheme: {
25
30
  readonly DEFAULT: "default";
26
31
  readonly LIGHT: "light";
@@ -63,8 +68,8 @@ export interface IBannerProps {
63
68
  dotSvg?: Record<string, string>;
64
69
  dotInner?: Record<string, string>;
65
70
  };
66
- /** Выравнивание блока пагинации */
67
- paginationAlign?: 'center' | 'left';
71
+ /** Выравнивание блока пагинации. DEPRECATED: 'left' */
72
+ paginationAlign?: PaginationAlignType;
68
73
  /** Цветовая тема пагинации */
69
74
  paginationTheme?: PaginationThemeType;
70
75
  /** Тип кнопок пагинации */
@@ -4,7 +4,7 @@ function _typeof3(o) { "@babel/helpers - typeof"; return _typeof3 = "function" =
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports["default"] = exports.Radius = exports.PaginationTheme = exports.PaginationPositionType = exports.PaginationButtonType = exports.NavTheme = exports.BackgroundColor = void 0;
7
+ exports["default"] = exports.Radius = exports.PaginationTheme = exports.PaginationPositionType = exports.PaginationButtonType = exports.PaginationAlign = exports.NavTheme = exports.BackgroundColor = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
10
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
@@ -32,7 +32,7 @@ try {
32
32
  Autoplay = Modules.Autoplay;
33
33
  } catch (e) {
34
34
  // eslint-disable-next-line no-console
35
- console.warn("\n WARNING: megafon/ui-core is using the latest version of swiper. \n For more information about server-side rendering\n please check the Banner component documentation at:\n https://ui.megafon.ru/components/banner\n ");
35
+ console.warn("\n WARNING: megafon/ui-core is using the latest version of swiper.\n For more information about server-side rendering\n please check the Banner component documentation at:\n https://ui.megafon.ru/components/banner\n ");
36
36
  }
37
37
  var BackgroundColor = exports.BackgroundColor = {
38
38
  TRANSPARENT: 'transparent',
@@ -50,6 +50,10 @@ var NavTheme = exports.NavTheme = {
50
50
  LIGHT: 'light',
51
51
  DARK: 'dark'
52
52
  };
53
+ var PaginationAlign = exports.PaginationAlign = {
54
+ CENTER: 'center',
55
+ LEFT: 'left'
56
+ };
53
57
  var PaginationTheme = exports.PaginationTheme = {
54
58
  DEFAULT: 'default',
55
59
  LIGHT: 'light',
@@ -69,10 +73,9 @@ var Banner = function Banner(_ref) {
69
73
  _ref$classes = _ref.classes,
70
74
  classes = _ref$classes === void 0 ? {} : _ref$classes,
71
75
  dataAttrs = _ref.dataAttrs,
72
- paginationAlign = _ref.paginationAlign,
73
- paginationTheme = _ref.paginationTheme,
76
+ _ref$paginationAlign = _ref.paginationAlign,
77
+ paginationAlign = _ref$paginationAlign === void 0 ? PaginationAlign.CENTER : _ref$paginationAlign,
74
78
  paginationType = _ref.paginationType,
75
- paginationPosition = _ref.paginationPosition,
76
79
  _ref$withPaginationBo = _ref.withPaginationBottomOffset,
77
80
  withPaginationBottomOffset = _ref$withPaginationBo === void 0 ? false : _ref$withPaginationBo,
78
81
  _ref$autoPlay = _ref.autoPlay,
@@ -83,8 +86,7 @@ var Banner = function Banner(_ref) {
83
86
  loop = _ref$loop === void 0 ? false : _ref$loop,
84
87
  _ref$pauseOnHover = _ref.pauseOnHover,
85
88
  pauseOnHover = _ref$pauseOnHover === void 0 ? false : _ref$pauseOnHover,
86
- _ref$backgroundColor = _ref.backgroundColor,
87
- backgroundColor = _ref$backgroundColor === void 0 ? BackgroundColor.TRANSPARENT : _ref$backgroundColor,
89
+ backgroundColor = _ref.backgroundColor,
88
90
  _ref$radius = _ref.radius,
89
91
  radius = _ref$radius === void 0 ? Radius.ROUNDED : _ref$radius,
90
92
  _ref$arrowTheme = _ref.arrowTheme,
@@ -140,6 +142,20 @@ var Banner = function Banner(_ref) {
140
142
  var dotTimerDelay = delay / 1000;
141
143
  var arrowSize = arrowTheme === _NavArrow.Theme.WHITE ? _NavArrow.Size.LARGE : _NavArrow.Size.MIDDLE;
142
144
  var rootRef = React.useRef(null);
145
+ var correctPaginationPosition = paginationType === PaginationButtonType.FLAT ? PaginationPositionType.TOP_IN : PaginationPositionType.BOTTOM_OUT;
146
+ var correctPaginationAlign = paginationType === PaginationButtonType.FLAT ? paginationAlign : PaginationAlign.CENTER;
147
+ var getCorrectPaginationTheme = function getCorrectPaginationTheme() {
148
+ switch (backgroundColor) {
149
+ case BackgroundColor.GREEN:
150
+ case BackgroundColor.PURPLE:
151
+ return PaginationTheme.LIGHT;
152
+ case BackgroundColor.LIGHT:
153
+ case BackgroundColor.GRADIENT:
154
+ return PaginationTheme.DARK;
155
+ default:
156
+ return PaginationTheme.DEFAULT;
157
+ }
158
+ };
143
159
  var increaseAutoplayDelay = React.useCallback(function (_ref2) {
144
160
  var params = _ref2.params,
145
161
  autoplay = _ref2.autoplay;
@@ -259,8 +275,8 @@ var Banner = function Banner(_ref) {
259
275
  var renderPagination = /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.pagination), {
260
276
  className: cn('pagination', {
261
277
  type: paginationType,
262
- align: paginationAlign,
263
- position: paginationPosition,
278
+ align: correctPaginationAlign,
279
+ position: correctPaginationPosition,
264
280
  'bottom-offset': withPaginationBottomOffset
265
281
  }, [classes.pagination])
266
282
  }), children && React.Children.map(children, function (_, i) {
@@ -277,7 +293,7 @@ var Banner = function Banner(_ref) {
277
293
  showTimer: showDotTimer,
278
294
  timerDelay: dotTimerDelay,
279
295
  type: paginationType,
280
- theme: paginationTheme,
296
+ theme: getCorrectPaginationTheme(),
281
297
  onClick: handleDotClick
282
298
  });
283
299
  }));
@@ -1 +1 @@
1
- h1,h2,h3,h4,h5{margin:0}.mfui-modal-open-body{height:100%;overflow:hidden}.mfui-modal__overlay{display:-webkit-box;display:-ms-flexbox;display:flex;left:0;position:fixed;top:0;z-index:1000;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:start;-ms-flex-pack:start;-webkit-animation:show-popup-overlay .3s ease-out forwards;animation:show-popup-overlay .3s ease-out forwards;-webkit-box-sizing:border-box;box-sizing:border-box;height:100%;justify-content:flex-start;opacity:0;padding:72px 0;width:100%}.mfui-modal__modal-content{margin:auto;position:relative}.mfui-modal_full-view .mfui-modal__overlay{display:block;padding:0}.mfui-modal_full-view .mfui-modal__modal-content{display:-webkit-box;display:-ms-flexbox;display:flex;min-height:100%;width:100%}.mfui-modal_bottom-view .mfui-modal__overlay{bottom:0;display:block;height:auto;overflow:hidden;padding-bottom:0}.mfui-modal_bottom-view .mfui-modal__modal-content{height:100%;margin:0;outline:none;overflow:hidden}.mfui-modal_native-scroll .mfui-modal__overlay{overflow-x:hidden;overflow-y:scroll}@media screen and (hover:hover){.mfui-modal_native-scroll .mfui-modal__overlay{width:calc(100% + 15px)}}.mfui-modal_transition-end .mfui-modal__overlay{-webkit-animation:hide-popup-overlay .2s ease-in;animation:hide-popup-overlay .2s ease-in}@-webkit-keyframes show-popup-overlay{0%{opacity:0}to{opacity:1}}@keyframes show-popup-overlay{0%{opacity:0}to{opacity:1}}@-webkit-keyframes hide-popup-overlay{0%{opacity:1}to{opacity:0}}@keyframes hide-popup-overlay{0%{opacity:1}to{opacity:0}}
1
+ h1,h2,h3,h4,h5{margin:0}.mfui-modal-open-body{height:100%;overflow:hidden}.mfui-modal__overlay{display:-webkit-box;display:-ms-flexbox;display:flex;left:0;position:fixed;top:0;z-index:1000;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:start;-ms-flex-pack:start;-webkit-animation:show-popup-overlay .3s ease-out forwards;animation:show-popup-overlay .3s ease-out forwards;-webkit-box-sizing:border-box;box-sizing:border-box;height:100%;justify-content:flex-start;opacity:0;padding:72px 0;width:100%}.mfui-modal__modal-content{margin:auto;position:relative}.mfui-modal_full-view .mfui-modal__overlay{display:block;padding:0}.mfui-modal_full-view .mfui-modal__modal-content{display:-webkit-box;display:-ms-flexbox;display:flex;min-height:100%;width:100%}.mfui-modal_bottom-view .mfui-modal__overlay{bottom:0;display:block;height:auto;overflow:hidden;padding-bottom:0;-ms-touch-action:none;touch-action:none}.mfui-modal_bottom-view .mfui-modal__modal-content{height:100%;margin:0;outline:none;overflow:hidden;-ms-touch-action:pan-y;touch-action:pan-y}.mfui-modal_native-scroll .mfui-modal__overlay{overflow-x:hidden;overflow-y:scroll}@media screen and (hover:hover){.mfui-modal_native-scroll .mfui-modal__overlay{width:calc(100% + 15px)}}.mfui-modal_transition-end .mfui-modal__overlay{-webkit-animation:hide-popup-overlay .2s ease-in;animation:hide-popup-overlay .2s ease-in}@-webkit-keyframes show-popup-overlay{0%{opacity:0}to{opacity:1}}@keyframes show-popup-overlay{0%{opacity:0}to{opacity:1}}@-webkit-keyframes hide-popup-overlay{0%{opacity:1}to{opacity:0}}@keyframes hide-popup-overlay{0%{opacity:1}to{opacity:0}}
@@ -170,7 +170,10 @@ var ModalContent = function ModalContent(_ref) {
170
170
  className: cn('container-inner', {
171
171
  'native-scroll': isEnabledNativeScroll
172
172
  }, classes === null || classes === void 0 ? void 0 : classes.containerInner),
173
- ref: containerInnerRef
173
+ ref: containerInnerRef,
174
+ onClick: function onClick(e) {
175
+ return e.stopPropagation();
176
+ }
174
177
  }), isStickyHeader && renderHeader, /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.containerBody), {
175
178
  className: cn('container-body', {
176
179
  'native-scroll': isEnabledNativeScroll
@@ -88,7 +88,6 @@ var ModalMobileBottom = function ModalMobileBottom(_a) {
88
88
  });
89
89
  }, [containerWrapRef, scrollBarScrollableRef, initialContainerWrapHeight, initialTouchPosition, onChangeContainerWrapTransform, onChangeTransitionStep]);
90
90
  var handleWindowTouchEnd = React.useCallback(function (e) {
91
- var _a;
92
91
  var containerWrapNode = containerWrapRef.current;
93
92
  var scrollableNode = scrollBarScrollableRef.current;
94
93
  var isScrollTop = ((scrollableNode === null || scrollableNode === void 0 ? void 0 : scrollableNode.scrollTop) || 0) === 0;
@@ -96,12 +95,28 @@ var ModalMobileBottom = function ModalMobileBottom(_a) {
96
95
  return;
97
96
  }
98
97
  window.cancelAnimationFrame(animationFrameId.current);
98
+ if (!e.changedTouches.length) {
99
+ setInitialTouchPosition(null);
100
+ return;
101
+ }
102
+ var touchStartY = initialTouchPosition;
103
+ var touchEndY = e.changedTouches[0].clientY;
104
+ if (touchStartY === null) {
105
+ setInitialTouchPosition(null);
106
+ return;
107
+ }
108
+ var deltaY = touchStartY - touchEndY;
109
+ var absDeltaY = Math.abs(deltaY);
110
+ if (absDeltaY < 5 || touchStartY > touchEndY) {
111
+ setInitialTouchPosition(null);
112
+ return;
113
+ }
99
114
  var containerCenterPosition = containerWrapNode.offsetTop + offsetHeightCenter;
100
- var isMoreHalfClosed = ((_a = e.changedTouches[0]) === null || _a === void 0 ? void 0 : _a.clientY) > containerCenterPosition;
115
+ var isMoreHalfClosed = touchEndY > containerCenterPosition;
101
116
  setInitialTouchPosition(null);
102
117
  onChangeContainerWrapTransform(isMoreHalfClosed ? 'translateY(100%)' : 'none');
103
118
  onChangeTransitionStep(isMoreHalfClosed ? _Modal.MODAL_TRANSITIONS_STEPS_ENUM.MOVE_END_STEP : _Modal.MODAL_TRANSITIONS_STEPS_ENUM.INITIAL_STEP);
104
- }, [containerWrapRef, scrollBarScrollableRef, isTransitionMoveStep, offsetHeightCenter, onChangeContainerWrapTransform, onChangeTransitionStep]);
119
+ }, [containerWrapRef, scrollBarScrollableRef, isTransitionMoveStep, initialTouchPosition, offsetHeightCenter, onChangeContainerWrapTransform, onChangeTransitionStep]);
105
120
  React.useEffect(function () {
106
121
  if (isSwipeDisabled) {
107
122
  return undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megafon/ui-core",
3
- "version": "8.11.0",
3
+ "version": "8.12.0",
4
4
  "files": [
5
5
  "dist",
6
6
  "styles"
@@ -104,5 +104,5 @@
104
104
  "simplebar-react": "^3.2.5",
105
105
  "swiper": "^11.1.1"
106
106
  },
107
- "gitHead": "8b5230c1f266abd6da16ddc142f60205cc065c42"
107
+ "gitHead": "554c37f61636b2dfef18178670158d3503a23b33"
108
108
  }