@megafon/ui-core 8.2.1 → 8.4.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.
Files changed (78) hide show
  1. package/dist/es/components/Banner/Banner.css +1 -1
  2. package/dist/es/components/Banner/Banner.d.ts +26 -0
  3. package/dist/es/components/Banner/Banner.js +25 -1
  4. package/dist/es/components/Banner/BannerDot.css +1 -1
  5. package/dist/es/components/Banner/BannerDot.d.ts +3 -0
  6. package/dist/es/components/Banner/BannerDot.js +23 -11
  7. package/dist/es/components/Modal/_ModalContent/ModalContent.css +1 -1
  8. package/dist/es/components/Modal/_ModalContent/ModalContent.js +10 -2
  9. package/dist/es/components/Pagination/Pagination.css +1 -1
  10. package/dist/es/components/Pagination/Pagination.d.ts +18 -9
  11. package/dist/es/components/Pagination/Pagination.js +91 -19
  12. package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.css +1 -1
  13. package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.d.ts +9 -4
  14. package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.js +13 -3
  15. package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.css +1 -1
  16. package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.d.ts +12 -6
  17. package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.js +42 -25
  18. package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.css +1 -1
  19. package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.d.ts +13 -4
  20. package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.js +105 -11
  21. package/dist/es/components/Pagination/helpers.d.ts +8 -2
  22. package/dist/es/components/Pagination/helpers.js +28 -2
  23. package/dist/es/components/Pagination/types.d.ts +25 -0
  24. package/dist/es/components/Pagination/types.js +4 -0
  25. package/dist/es/components/Pagination/usePagination.d.ts +10 -5
  26. package/dist/es/components/Pagination/usePagination.js +86 -54
  27. package/dist/es/components/Tooltip/Tooltip.css +1 -1
  28. package/dist/es/components/Tooltip/Tooltip.js +21 -2
  29. package/dist/es/components/UploadForm/UploadField/UploadField.d.ts +2 -0
  30. package/dist/es/components/UploadForm/UploadField/UploadField.js +2 -0
  31. package/dist/es/components/UploadForm/UploadField/components/_UploadFieldDropArea/UploadFieldDropArea.css +1 -1
  32. package/dist/es/components/UploadForm/UploadFileItem/UploadFileItem.css +1 -1
  33. package/dist/es/components/UploadForm/UploadFileItem/UploadFileItem.d.ts +11 -0
  34. package/dist/es/components/UploadForm/UploadFileItem/UploadFileItem.js +29 -5
  35. package/dist/es/components/ValueField/ValueField.d.ts +3 -0
  36. package/dist/es/components/ValueField/ValueField.js +5 -3
  37. package/dist/es/hooks/useResolution.d.ts +1 -0
  38. package/dist/es/hooks/useResolution.js +24 -7
  39. package/dist/lib/components/Banner/Banner.css +1 -1
  40. package/dist/lib/components/Banner/Banner.d.ts +26 -0
  41. package/dist/lib/components/Banner/Banner.js +26 -2
  42. package/dist/lib/components/Banner/BannerDot.css +1 -1
  43. package/dist/lib/components/Banner/BannerDot.d.ts +3 -0
  44. package/dist/lib/components/Banner/BannerDot.js +23 -11
  45. package/dist/lib/components/Modal/_ModalContent/ModalContent.css +1 -1
  46. package/dist/lib/components/Modal/_ModalContent/ModalContent.js +10 -2
  47. package/dist/lib/components/Pagination/Pagination.css +1 -1
  48. package/dist/lib/components/Pagination/Pagination.d.ts +18 -9
  49. package/dist/lib/components/Pagination/Pagination.js +90 -18
  50. package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.css +1 -1
  51. package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.d.ts +9 -4
  52. package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.js +13 -3
  53. package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.css +1 -1
  54. package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.d.ts +12 -6
  55. package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.js +45 -25
  56. package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.css +1 -1
  57. package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.d.ts +13 -4
  58. package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.js +105 -11
  59. package/dist/lib/components/Pagination/helpers.d.ts +8 -2
  60. package/dist/lib/components/Pagination/helpers.js +29 -3
  61. package/dist/lib/components/Pagination/types.d.ts +25 -0
  62. package/dist/lib/components/Pagination/types.js +10 -0
  63. package/dist/lib/components/Pagination/usePagination.d.ts +10 -5
  64. package/dist/lib/components/Pagination/usePagination.js +87 -55
  65. package/dist/lib/components/Tooltip/Tooltip.css +1 -1
  66. package/dist/lib/components/Tooltip/Tooltip.js +21 -2
  67. package/dist/lib/components/UploadForm/UploadField/UploadField.d.ts +2 -0
  68. package/dist/lib/components/UploadForm/UploadField/UploadField.js +2 -0
  69. package/dist/lib/components/UploadForm/UploadField/components/_UploadFieldDropArea/UploadFieldDropArea.css +1 -1
  70. package/dist/lib/components/UploadForm/UploadFileItem/UploadFileItem.css +1 -1
  71. package/dist/lib/components/UploadForm/UploadFileItem/UploadFileItem.d.ts +11 -0
  72. package/dist/lib/components/UploadForm/UploadFileItem/UploadFileItem.js +29 -5
  73. package/dist/lib/components/ValueField/ValueField.d.ts +3 -0
  74. package/dist/lib/components/ValueField/ValueField.js +5 -3
  75. package/dist/lib/hooks/useResolution.d.ts +1 -0
  76. package/dist/lib/hooks/useResolution.js +24 -7
  77. package/package.json +2 -2
  78. package/styles/colors.css +9 -10
@@ -1 +1 @@
1
- h1,h2,h3,h4,h5{margin:0}.mfui-banner{position:relative}.mfui-banner .swiper-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex}.mfui-banner .mfui-banner__swiper-container{position:relative}.mfui-banner__swiper{overflow:hidden}.mfui-banner__slide{-ms-flex-negative:0;flex-shrink:0;height:500px}@media screen and (min-width:1024px) and (max-width:1279px){.mfui-banner__slide{height:420px}}@media screen and (min-width:1280px){.mfui-banner__slide{height:400px}}.mfui-banner__slide-content{border-right:1px solid transparent;margin-right:-1px}@media screen and (max-width:1023px){.mfui-banner__slide-content{height:100%}}.mfui-banner_auto-height .mfui-banner__slide{height:auto}.mfui-banner .mfui-banner__arrow{position:absolute;top:50%;-webkit-transition:scale .2s linear;transition:scale .2s linear;translate:0 -50%;z-index:10}@media screen and (max-width:767px){.mfui-banner .mfui-banner__arrow{display:none}}.mfui-banner .mfui-banner__arrow_theme_white{height:64px;width:64px}@media screen and (max-width:1023px){.mfui-banner .mfui-banner__arrow_theme_white{display:none}}.mfui-banner .mfui-banner__arrow_prev{left:12px}@media screen and (max-width:767px){.mfui-banner .mfui-banner__arrow_prev{left:8px}}@media screen and (min-width:768px) and (max-width:1023px){.mfui-banner .mfui-banner__arrow_prev{left:16px}}@media screen and (min-width:1280px){.mfui-banner .mfui-banner__arrow_prev{left:20px}}.mfui-banner .mfui-banner__arrow_next{right:12px}@media screen and (max-width:767px){.mfui-banner .mfui-banner__arrow_next{right:8px}}@media screen and (min-width:768px) and (max-width:1023px){.mfui-banner .mfui-banner__arrow_next{right:16px}}@media screen and (min-width:1280px){.mfui-banner .mfui-banner__arrow_next{right:20px}}.mfui-banner .mfui-banner__arrow_prev.mfui-banner__arrow_theme_white{left:0;translate:-50% -50%}.mfui-banner .mfui-banner__arrow_next.mfui-banner__arrow_theme_white{right:0;translate:50% -50%}.mfui-banner_no-touch .mfui-banner__arrow_theme_white:hover{scale:1.25}.mfui-banner_no-touch .mfui-banner__arrow_theme_white:active{scale:1.125}.mfui-banner__pagination{display:-webkit-box;display:-ms-flexbox;display:flex;gap:12px;left:50%;z-index:10;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin-top:32px}.mfui-banner__pagination_bottom-offset{bottom:60px;left:50%;position:absolute;-webkit-transform:translateX(-50%);transform:translateX(-50%);z-index:10}@media screen and (min-width:768px) and (max-width:1023px){.mfui-banner__pagination_bottom-offset{bottom:89px}}@media screen and (min-width:1024px) and (max-width:1279px){.mfui-banner__pagination_bottom-offset{bottom:90px}}@media screen and (min-width:1280px) and (max-width:1439px){.mfui-banner__pagination_bottom-offset{bottom:65px}}@media screen and (min-width:1440px){.mfui-banner__pagination_bottom-offset{bottom:72px}}.mfui-banner_margin-top{margin-top:24px}.mfui-banner_radius_rounded .mfui-banner__swiper{border-radius:24px}@media screen and (max-width:767px){.mfui-banner_show-next-slide .mfui-banner__swiper{border-radius:0;margin-left:-16px;margin-right:-16px;padding-left:16px;padding-right:32px}.mfui-banner_show-next-slide .mfui-banner__slide-content{border-right:none;margin-right:0}.mfui-banner_show-next-slide.mfui-banner_radius_rounded .mfui-banner__slide-content{border-radius:24px}}.mfui-banner_background-color_green .mfui-banner__swiper{background-color:var(--brandGreen)}.mfui-banner_background-color_purple .mfui-banner__swiper{background-color:var(--brandPurple)}.mfui-banner_background-color_gradient .mfui-banner__swiper{background:-webkit-gradient(linear,right top,left top,from(#ada6ba),to(#f6f2f9));background:linear-gradient(270deg,#ada6ba,#f6f2f9)}.mfui-banner_background-color_light .mfui-banner__swiper{background-color:#f6f2f9}.mfui-banner_background-color_spbSky0 .mfui-banner__swiper{background-color:var(--spbSky0)}
1
+ h1,h2,h3,h4,h5{margin:0}.mfui-banner{position:relative}.mfui-banner .swiper-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex}.mfui-banner .mfui-banner__swiper-container{position:relative}.mfui-banner__swiper{overflow:hidden}.mfui-banner__slide{-ms-flex-negative:0;flex-shrink:0;height:500px}@media screen and (min-width:1024px) and (max-width:1279px){.mfui-banner__slide{height:420px}}@media screen and (min-width:1280px){.mfui-banner__slide{height:400px}}.mfui-banner__slide-content{border-right:1px solid transparent;margin-right:-1px}@media screen and (max-width:1023px){.mfui-banner__slide-content{height:100%}}.mfui-banner_auto-height .mfui-banner__slide{height:auto}.mfui-banner .mfui-banner__arrow{position:absolute;top:50%;-webkit-transition:scale .2s linear;transition:scale .2s linear;translate:0 -50%;z-index:10}@media screen and (max-width:767px){.mfui-banner .mfui-banner__arrow{display:none}}.mfui-banner .mfui-banner__arrow_theme_white{height:64px;width:64px}@media screen and (max-width:1023px){.mfui-banner .mfui-banner__arrow_theme_white{display:none}}.mfui-banner .mfui-banner__arrow_prev{left:12px}@media screen and (max-width:767px){.mfui-banner .mfui-banner__arrow_prev{left:8px}}@media screen and (min-width:768px) and (max-width:1023px){.mfui-banner .mfui-banner__arrow_prev{left:16px}}@media screen and (min-width:1280px){.mfui-banner .mfui-banner__arrow_prev{left:20px}}.mfui-banner .mfui-banner__arrow_next{right:12px}@media screen and (max-width:767px){.mfui-banner .mfui-banner__arrow_next{right:8px}}@media screen and (min-width:768px) and (max-width:1023px){.mfui-banner .mfui-banner__arrow_next{right:16px}}@media screen and (min-width:1280px){.mfui-banner .mfui-banner__arrow_next{right:20px}}.mfui-banner .mfui-banner__arrow_prev.mfui-banner__arrow_theme_white{left:0;translate:-50% -50%}.mfui-banner .mfui-banner__arrow_next.mfui-banner__arrow_theme_white{right:0;translate:50% -50%}.mfui-banner_no-touch .mfui-banner__arrow_theme_white:hover{scale:1.25}.mfui-banner_no-touch .mfui-banner__arrow_theme_white:active{scale:1.125}.mfui-banner__pagination{display:-webkit-box;display:-ms-flexbox;display:flex;gap:12px;left:50%;z-index:10;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin-top:32px}.mfui-banner__pagination_position_top-in{left:0;margin-top:0;padding:0 24px;position:absolute;top:16px;width:100%}@media screen and (min-width:1280px){.mfui-banner__pagination_position_top-in{padding:0 80px}}.mfui-banner__pagination_type_flat{gap:4px}@media screen and (min-width:1280px){.mfui-banner__pagination_type_flat{gap:10px}}.mfui-banner__pagination_align_left{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.mfui-banner__pagination_bottom-offset{bottom:60px;left:50%;position:absolute;-webkit-transform:translateX(-50%);transform:translateX(-50%);z-index:10}@media screen and (min-width:768px) and (max-width:1023px){.mfui-banner__pagination_bottom-offset{bottom:89px}}@media screen and (min-width:1024px) and (max-width:1279px){.mfui-banner__pagination_bottom-offset{bottom:90px}}@media screen and (min-width:1280px) and (max-width:1439px){.mfui-banner__pagination_bottom-offset{bottom:65px}}@media screen and (min-width:1440px){.mfui-banner__pagination_bottom-offset{bottom:72px}}.mfui-banner_margin-top{margin-top:24px}.mfui-banner_radius_rounded .mfui-banner__swiper{border-radius:24px}@media screen and (max-width:767px){.mfui-banner_show-next-slide .mfui-banner__swiper{border-radius:0;margin-left:-16px;margin-right:-16px;padding-left:16px;padding-right:32px}.mfui-banner_show-next-slide .mfui-banner__slide-content{border-right:none;margin-right:0}.mfui-banner_show-next-slide.mfui-banner_radius_rounded .mfui-banner__slide-content{border-radius:24px}}.mfui-banner_background-color_green .mfui-banner__swiper{background-color:var(--brandGreen)}.mfui-banner_background-color_purple .mfui-banner__swiper{background-color:var(--brandPurple)}.mfui-banner_background-color_gradient .mfui-banner__swiper{background:-webkit-gradient(linear,right top,left top,from(#ada6ba),to(#f6f2f9));background:linear-gradient(270deg,#ada6ba,#f6f2f9)}.mfui-banner_background-color_light .mfui-banner__swiper{background-color:#f6f2f9}.mfui-banner_background-color_spbSky0 .mfui-banner__swiper{background-color:var(--spbSky0)}
@@ -21,6 +21,22 @@ export declare const NavTheme: {
21
21
  readonly DARK: "dark";
22
22
  };
23
23
  type NavThemeType = (typeof NavTheme)[keyof typeof NavTheme];
24
+ export declare const PaginationTheme: {
25
+ readonly DEFAULT: "default";
26
+ readonly LIGHT: "light";
27
+ readonly DARK: "dark";
28
+ };
29
+ export type PaginationThemeType = (typeof PaginationTheme)[keyof typeof PaginationTheme];
30
+ export declare const PaginationButtonType: {
31
+ readonly DOT: "dot";
32
+ readonly FLAT: "flat";
33
+ };
34
+ export type PaginationType = (typeof PaginationButtonType)[keyof typeof PaginationButtonType];
35
+ export declare const PaginationPositionType: {
36
+ readonly BOTTOM_OUT: "bottom-out";
37
+ readonly TOP_IN: "top-in";
38
+ };
39
+ type PaginationPositionType = (typeof PaginationPositionType)[keyof typeof PaginationPositionType];
24
40
  export interface IBannerProps {
25
41
  /** Сss класс для внешнего контейнера */
26
42
  className?: string;
@@ -44,7 +60,17 @@ export interface IBannerProps {
44
60
  arrowNext?: Record<string, string>;
45
61
  pagination?: Record<string, string>;
46
62
  dot?: Record<string, string>;
63
+ dotSvg?: Record<string, string>;
64
+ dotInner?: Record<string, string>;
47
65
  };
66
+ /** Выравнивание блока пагинации */
67
+ paginationAlign?: 'center' | 'left';
68
+ /** Цветовая тема пагинации */
69
+ paginationTheme?: PaginationThemeType;
70
+ /** Тип кнопок пагинации */
71
+ paginationType?: PaginationType;
72
+ /** Расположение пагинации */
73
+ paginationPosition?: PaginationPositionType;
48
74
  /** Предполагается использование с наезжанием на баннер следующего за баннером элемента */
49
75
  withPaginationBottomOffset?: boolean;
50
76
  /** Автоматическая прокрутка */
@@ -40,6 +40,19 @@ export var NavTheme = {
40
40
  LIGHT: 'light',
41
41
  DARK: 'dark'
42
42
  };
43
+ export var PaginationTheme = {
44
+ DEFAULT: 'default',
45
+ LIGHT: 'light',
46
+ DARK: 'dark'
47
+ };
48
+ export var PaginationButtonType = {
49
+ DOT: 'dot',
50
+ FLAT: 'flat'
51
+ };
52
+ export var PaginationPositionType = {
53
+ BOTTOM_OUT: 'bottom-out',
54
+ TOP_IN: 'top-in'
55
+ };
43
56
  var getAutoPlayConfig = function getAutoPlayConfig(delay) {
44
57
  return {
45
58
  delay: delay,
@@ -54,6 +67,10 @@ var Banner = function Banner(_ref) {
54
67
  _ref$classes = _ref.classes,
55
68
  classes = _ref$classes === void 0 ? {} : _ref$classes,
56
69
  dataAttrs = _ref.dataAttrs,
70
+ paginationAlign = _ref.paginationAlign,
71
+ paginationTheme = _ref.paginationTheme,
72
+ paginationType = _ref.paginationType,
73
+ paginationPosition = _ref.paginationPosition,
57
74
  _ref$withPaginationBo = _ref.withPaginationBottomOffset,
58
75
  withPaginationBottomOffset = _ref$withPaginationBo === void 0 ? false : _ref$withPaginationBo,
59
76
  _ref$autoPlay = _ref.autoPlay,
@@ -236,19 +253,26 @@ var Banner = function Banner(_ref) {
236
253
  }));
237
254
  var renderPagination = /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.pagination), {
238
255
  className: cn('pagination', {
256
+ type: paginationType,
257
+ align: paginationAlign,
258
+ position: paginationPosition,
239
259
  'bottom-offset': withPaginationBottomOffset
240
260
  }, [classes.pagination])
241
261
  }), children && React.Children.map(children, function (_, i) {
242
262
  return /*#__PURE__*/React.createElement(BannerDot, {
243
263
  className: cn('dot', [classes.dot]),
244
264
  dataAttrs: {
245
- root: _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.dot, i + 1))
265
+ root: _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.dot, i + 1)),
266
+ svg: _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.dotSvg, i + 1)),
267
+ inner: _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.dotInner, i + 1))
246
268
  },
247
269
  key: i,
248
270
  index: i,
249
271
  isActive: i === activeIndex,
250
272
  showTimer: showDotTimer,
251
273
  timerDelay: dotTimerDelay,
274
+ type: paginationType,
275
+ theme: paginationTheme,
252
276
  onClick: handleDotClick
253
277
  });
254
278
  }));
@@ -1 +1 @@
1
- h1,h2,h3,h4,h5{margin:0}.mfui-banner-dot{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;justify-content:center;margin:-2px;padding:2px}.mfui-banner-dot:before{background-color:var(--spbSky2);border-radius:4px;content:"";display:block;height:8px;width:8px}.mfui-banner-dot_active{cursor:default}.mfui-banner-dot_active:before{background-color:var(--brandGreen);width:24px}.mfui-banner-dot_active .mfui-banner-dot__timer-inner{fill:var(--brandGreen)}.mfui-banner-dot_active.mfui-banner-dot_timer:before{background-color:var(--spbSky2)}.mfui-banner-dot__timer{border-radius:4px;display:block;height:8px;position:absolute;width:24px}.mfui-banner-dot__timer-inner{-webkit-animation:timer linear;animation:timer linear;-webkit-transform:scaleX(-1);transform:scaleX(-1);-webkit-transform-origin:center;transform-origin:center}@-webkit-keyframes timer{0%{width:100%}to{width:0}}@keyframes timer{0%{width:100%}to{width:0}}
1
+ h1,h2,h3,h4,h5{margin:0}.mfui-banner-dot{background-color:var(--spbSky2);border-radius:4px;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;height:8px;position:relative;width:8px}.mfui-banner-dot_active{background-color:var(--brandGreen);cursor:default;-webkit-transition:background-color .2s linear;transition:background-color .2s linear;width:24px}.mfui-banner-dot_active .mfui-banner-dot__timer-inner{fill:var(--brandGreen)}.mfui-banner-dot_active.mfui-banner-dot_has-timer{background-color:var(--spbSky2)}.mfui-banner-dot_type_flat{-webkit-box-flex:1;border-radius:24px;-ms-flex:1 1 auto;flex:1 1 auto;height:2px;width:auto}.mfui-banner-dot_type_flat .mfui-banner-dot__timer{height:100%;width:100%}.mfui-banner-dot_type_flat .mfui-banner-dot__timer-inner{-webkit-animation:timer-reversed linear;animation:timer-reversed linear;height:100%;-webkit-transform:scale(1);transform:scale(1);width:100%}.mfui-banner-dot_theme_light,.mfui-banner-dot_theme_light .mfui-banner-dot__timer{background-color:var(--stcWhite50)}.mfui-banner-dot_theme_light .mfui-banner-dot__timer-inner{fill:var(--stcWhite)}.mfui-banner-dot_theme_light.mfui-banner-dot_active{background-color:var(--stcWhite)}.mfui-banner-dot_theme_light.mfui-banner-dot_has-timer{background-color:transparent}.mfui-banner-dot_theme_dark,.mfui-banner-dot_theme_dark .mfui-banner-dot__timer{background-color:var(--stcBlack10)}.mfui-banner-dot_theme_dark .mfui-banner-dot__timer-inner{fill:var(--stcBlack)}.mfui-banner-dot_theme_dark.mfui-banner-dot_active{background-color:var(--stcBlack)}.mfui-banner-dot_theme_dark.mfui-banner-dot_has-timer{background-color:transparent}.mfui-banner-dot__timer{border-radius:4px;display:block;height:8px;left:0;position:absolute;top:0;width:24px}.mfui-banner-dot__timer-inner{-webkit-animation:timer linear;animation:timer linear;-webkit-transform:scaleX(-1);transform:scaleX(-1);-webkit-transform-origin:center;transform-origin:center}@-webkit-keyframes timer{0%{width:100%}to{width:0}}@keyframes timer{0%{width:100%}to{width:0}}@-webkit-keyframes timer-reversed{0%{width:0}to{width:100%}}@keyframes timer-reversed{0%{width:0}to{width:100%}}
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import { type PaginationThemeType, type PaginationType } from './Banner';
2
3
  import './BannerDot.scss';
3
4
  export interface IBannerDotProps {
4
5
  className?: string;
@@ -11,6 +12,8 @@ export interface IBannerDotProps {
11
12
  svg?: Record<string, string>;
12
13
  inner?: Record<string, string>;
13
14
  };
15
+ type?: PaginationType;
16
+ theme?: PaginationThemeType;
14
17
  onClick: (index: number) => void;
15
18
  }
16
19
  declare const BannerDot: React.FC<IBannerDotProps>;
@@ -1,7 +1,17 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import * as React from 'react';
3
3
  import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
4
+ import { PaginationButtonType } from "./Banner";
4
5
  import "./BannerDot.css";
6
+ var DOT_VIEW_BOX = '0 0 250 100';
7
+ var DOT_RECT_PROPS = {
8
+ x: '0',
9
+ y: '0',
10
+ width: '250',
11
+ height: '100',
12
+ rx: '50',
13
+ ry: '50'
14
+ };
5
15
  var cn = cnCreate('mfui-banner-dot');
6
16
  var BannerDot = function BannerDot(_ref) {
7
17
  var className = _ref.className,
@@ -10,30 +20,32 @@ var BannerDot = function BannerDot(_ref) {
10
20
  isActive = _ref.isActive,
11
21
  showTimer = _ref.showTimer,
12
22
  timerDelay = _ref.timerDelay,
23
+ _ref$type = _ref.type,
24
+ type = _ref$type === void 0 ? PaginationButtonType.DOT : _ref$type,
25
+ theme = _ref.theme,
13
26
  onClick = _ref.onClick;
27
+ var viewBox = type === PaginationButtonType.DOT ? DOT_VIEW_BOX : undefined;
28
+ var rectProps = type === PaginationButtonType.DOT ? DOT_RECT_PROPS : {};
29
+ var hasTimer = showTimer && isActive;
14
30
  var handleDotClick = React.useCallback(function () {
15
31
  onClick(index);
16
32
  }, [onClick, index]);
17
33
  return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
18
34
  className: cn({
19
35
  active: isActive,
20
- timer: showTimer
36
+ type: type,
37
+ theme: theme,
38
+ 'has-timer': hasTimer
21
39
  }, className),
22
40
  onClick: handleDotClick
23
- }), showTimer && isActive && /*#__PURE__*/React.createElement("svg", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.svg), {
41
+ }), hasTimer && /*#__PURE__*/React.createElement("svg", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.svg), {
24
42
  className: cn('timer'),
25
- viewBox: "0 0 250 100"
26
- }), /*#__PURE__*/React.createElement("rect", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.inner), {
43
+ viewBox: viewBox
44
+ }), /*#__PURE__*/React.createElement("rect", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.inner), rectProps, {
27
45
  className: cn('timer-inner'),
28
46
  style: {
29
47
  animationDuration: "".concat(timerDelay, "s")
30
- },
31
- x: "0",
32
- y: "0",
33
- width: "250",
34
- height: "100",
35
- rx: "50",
36
- ry: "50"
48
+ }
37
49
  }))));
38
50
  };
39
51
  export default BannerDot;
@@ -1 +1 @@
1
- h1,h2,h3,h4,h5{margin:0}.mfui-modal-content__background{background-color:rgba(0,0,0,.8);bottom:0;left:0;position:fixed;right:0;top:0}.mfui-modal-content__container-wrap{-webkit-animation:show-popup .3s ease-out;animation:show-popup .3s ease-out;position:relative;width:100%}@media screen and (min-width:768px){.mfui-modal-content__container-wrap{-webkit-transition:height .1s;transition:height .1s;width:740px}}.mfui-modal-content__container-inner{background-color:var(--background);font-family:inherit;width:100%}.mfui-modal-content__header{position:relative}.mfui-modal-content__header_shadow{-webkit-box-shadow:0 2px 12px rgba(0,0,0,.1);box-shadow:0 2px 12px rgba(0,0,0,.1)}.mfui-modal-content__header-main{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;min-height:52px}@media screen and (min-width:768px){.mfui-modal-content__header-main{min-height:64px}}.mfui-modal-content__header-button{display:-webkit-box;display:-ms-flexbox;display:flex;position:absolute;top:12px;z-index:2;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;background:transparent;border:none;cursor:pointer;height:32px;justify-content:center;outline:none;width:32px}@media screen and (min-width:768px){.mfui-modal-content__header-button{height:40px;width:40px}}.mfui-modal-content__header-button_back{left:16px}.mfui-modal-content__header-button_close{right:16px}.mfui-modal-content__header-button_shadow{background:var(--base);border-radius:50%;-webkit-box-shadow:0 2px 12px rgba(0,0,0,.1);box-shadow:0 2px 12px rgba(0,0,0,.1)}.mfui-modal-content__header-button svg{fill:var(--content)}.mfui-modal-content__title-area{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0 48px;padding:12px}@media screen and (min-width:768px){.mfui-modal-content__title-area{margin:0 56px;padding:16px}}.mfui-modal-content__title{font-size:18px;font-weight:500;letter-spacing:.5px;line-height:24px;text-align:center}@media screen and (min-width:1280px){.mfui-modal-content__title{font-size:20px;line-height:28px}}@media screen and (min-width:768px){.mfui-modal-content__title{font-size:20px;font-weight:500;letter-spacing:.5px;line-height:28px}}.mfui-modal-content__header-additional{-webkit-box-sizing:border-box;box-sizing:border-box;padding:8px 16px;text-align:center}@media screen and (min-width:768px){.mfui-modal-content__header-additional{padding-left:32px;padding-right:32px}}.mfui-modal-content__container-body{-webkit-box-sizing:border-box;box-sizing:border-box;padding-bottom:24px;padding-right:6px}@media screen and (min-width:768px){.mfui-modal-content__container-body{padding-bottom:32px;padding-right:12px}}.mfui-modal-content__children{-webkit-box-sizing:border-box;box-sizing:border-box;padding-left:16px;padding-right:4px;padding-top:24px}@media screen and (min-width:768px){.mfui-modal-content__children{padding-left:32px;padding-right:14px}}.mfui-modal-content__container-wrap_static-header .mfui-modal-content__container-body{padding-top:24px}.mfui-modal-content__container-wrap_static-header .mfui-modal-content__children{padding-top:0}.mfui-modal-content__container-wrap_static-header .mfui-modal-content__header{margin-bottom:24px;margin-left:-16px;margin-right:-16px}@media screen and (min-width:768px){.mfui-modal-content__container-wrap_static-header .mfui-modal-content__header{margin-left:-32px;margin-right:-32px}}.mfui-modal-content__container-wrap_static-header .mfui-modal-content__header-main{min-height:40px}.mfui-modal-content__container-wrap_static-header .mfui-modal-content__header-button{top:0}.mfui-modal-content__container-wrap_static-header .mfui-modal-content__title-area{padding-bottom:4px;padding-top:4px}.mfui-modal-content__container-wrap_hide-header .mfui-modal-content__container-body{padding-top:24px}.mfui-modal-content__container-wrap_hide-header .mfui-modal-content__children{padding-top:0}.mfui-modal-content__container-wrap_sticky-footer .mfui-modal-content__container-body{padding-bottom:0}.mfui-modal-content__container-wrap_sticky-footer .mfui-modal-content__footer{padding-left:16px;padding-right:16px}@media screen and (min-width:768px){.mfui-modal-content__container-wrap_sticky-footer .mfui-modal-content__footer{padding-left:32px;padding-right:32px}}.mfui-modal-content__container-wrap_sticky-footer .mfui-modal-content__footer_shadow{-webkit-box-shadow:0 2px 12px rgba(0,0,0,.1);box-shadow:0 2px 12px rgba(0,0,0,.1)}.mfui-modal-content__container-wrap_out-side-buttons .mfui-modal-content__container-body{padding-top:24px}.mfui-modal-content__container-wrap_native-scroll .mfui-modal-content__children,.mfui-modal-content__container-wrap_native-scroll .mfui-modal-content__container-body{padding:0}.mfui-modal-content__container-wrap_transition-end{-webkit-animation:hide-popup .2s ease-in;animation:hide-popup .2s ease-in}@-webkit-keyframes show-popup{0%{-webkit-transform:scale(95%);transform:scale(95%);-webkit-transform-origin:top;transform-origin:top}to{-webkit-transform:scale(100%);transform:scale(100%)}}@keyframes show-popup{0%{-webkit-transform:scale(95%);transform:scale(95%);-webkit-transform-origin:top;transform-origin:top}to{-webkit-transform:scale(100%);transform:scale(100%)}}@-webkit-keyframes hide-popup{0%{-webkit-transform:scale(100%);transform:scale(100%)}to{-webkit-transform:scale(95%);transform:scale(95%)}}@keyframes hide-popup{0%{-webkit-transform:scale(100%);transform:scale(100%)}to{-webkit-transform:scale(95%);transform:scale(95%)}}
1
+ h1,h2,h3,h4,h5{margin:0}.mfui-modal-content__background{background-color:rgba(0,0,0,.8);bottom:0;left:0;position:fixed;right:0;top:0}.mfui-modal-content__container-wrap{-webkit-animation:show-popup .3s ease-out;animation:show-popup .3s ease-out;position:relative;width:100%}@media screen and (min-width:768px){.mfui-modal-content__container-wrap{-webkit-transition:height .1s;transition:height .1s;width:740px}}.mfui-modal-content__container-inner{background-color:var(--background);font-family:inherit;width:100%}.mfui-modal-content__header{position:relative}.mfui-modal-content__header_shadow{-webkit-box-shadow:0 2px 12px rgba(0,0,0,.1);box-shadow:0 2px 12px rgba(0,0,0,.1)}.mfui-modal-content__header-main{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;min-height:52px}@media screen and (min-width:768px){.mfui-modal-content__header-main{min-height:64px}}.mfui-modal-content__header-button{display:-webkit-box;display:-ms-flexbox;display:flex;position:absolute;top:12px;z-index:2;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;background:transparent;border:none;cursor:pointer;height:32px;justify-content:center;outline:none;width:32px}@media screen and (min-width:768px){.mfui-modal-content__header-button{height:40px;width:40px}}.mfui-modal-content__header-button_back{left:16px}.mfui-modal-content__header-button_close{right:16px}.mfui-modal-content__header-button_shadow{background:var(--base);border-radius:50%;-webkit-box-shadow:0 2px 12px rgba(0,0,0,.1);box-shadow:0 2px 12px rgba(0,0,0,.1)}.mfui-modal-content__header-icon{height:32px;min-width:32px;width:32px;fill:var(--content)}@media screen and (min-width:768px){.mfui-modal-content__header-icon{height:40px;min-width:40px;width:40px}}.mfui-modal-content__title-area{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0 48px;padding:12px}@media screen and (min-width:768px){.mfui-modal-content__title-area{margin:0 56px;padding:16px}}.mfui-modal-content__title{font-size:18px;font-weight:500;letter-spacing:.5px;line-height:24px;text-align:center}@media screen and (min-width:1280px){.mfui-modal-content__title{font-size:20px;line-height:28px}}@media screen and (min-width:768px){.mfui-modal-content__title{font-size:20px;font-weight:500;letter-spacing:.5px;line-height:28px}}.mfui-modal-content__header-additional{-webkit-box-sizing:border-box;box-sizing:border-box;padding:8px 16px;text-align:center}@media screen and (min-width:768px){.mfui-modal-content__header-additional{padding-left:32px;padding-right:32px}}.mfui-modal-content__container-body{-webkit-box-sizing:border-box;box-sizing:border-box;padding-bottom:24px;padding-right:6px}@media screen and (min-width:768px){.mfui-modal-content__container-body{padding-bottom:32px;padding-right:12px}}.mfui-modal-content__children{-webkit-box-sizing:border-box;box-sizing:border-box;padding-left:16px;padding-right:4px;padding-top:24px}@media screen and (min-width:768px){.mfui-modal-content__children{padding-left:32px;padding-right:14px}}.mfui-modal-content__container-wrap_static-header .mfui-modal-content__container-body{padding-top:24px}.mfui-modal-content__container-wrap_static-header .mfui-modal-content__children{padding-top:0}.mfui-modal-content__container-wrap_static-header .mfui-modal-content__header{margin-bottom:24px;margin-left:-16px;margin-right:-16px}@media screen and (min-width:768px){.mfui-modal-content__container-wrap_static-header .mfui-modal-content__header{margin-left:-32px;margin-right:-32px}}.mfui-modal-content__container-wrap_static-header .mfui-modal-content__header-main{min-height:40px}.mfui-modal-content__container-wrap_static-header .mfui-modal-content__header-button{top:0}.mfui-modal-content__container-wrap_static-header .mfui-modal-content__title-area{padding-bottom:4px;padding-top:4px}.mfui-modal-content__container-wrap_hide-header .mfui-modal-content__container-body{padding-top:24px}.mfui-modal-content__container-wrap_hide-header .mfui-modal-content__children{padding-top:0}.mfui-modal-content__container-wrap_sticky-footer .mfui-modal-content__container-body{padding-bottom:0}.mfui-modal-content__container-wrap_sticky-footer .mfui-modal-content__footer{padding-left:16px;padding-right:16px}@media screen and (min-width:768px){.mfui-modal-content__container-wrap_sticky-footer .mfui-modal-content__footer{padding-left:32px;padding-right:32px}}.mfui-modal-content__container-wrap_sticky-footer .mfui-modal-content__footer_shadow{-webkit-box-shadow:0 2px 12px rgba(0,0,0,.1);box-shadow:0 2px 12px rgba(0,0,0,.1)}.mfui-modal-content__container-wrap_out-side-buttons .mfui-modal-content__container-body{padding-top:24px}.mfui-modal-content__container-wrap_native-scroll .mfui-modal-content__children,.mfui-modal-content__container-wrap_native-scroll .mfui-modal-content__container-body{padding:0}.mfui-modal-content__container-wrap_transition-end{-webkit-animation:hide-popup .2s ease-in;animation:hide-popup .2s ease-in}@-webkit-keyframes show-popup{0%{-webkit-transform:scale(95%);transform:scale(95%);-webkit-transform-origin:top;transform-origin:top}to{-webkit-transform:scale(100%);transform:scale(100%)}}@keyframes show-popup{0%{-webkit-transform:scale(95%);transform:scale(95%);-webkit-transform-origin:top;transform-origin:top}to{-webkit-transform:scale(100%);transform:scale(100%)}}@-webkit-keyframes hide-popup{0%{-webkit-transform:scale(100%);transform:scale(100%)}to{-webkit-transform:scale(95%);transform:scale(95%)}}@keyframes hide-popup{0%{-webkit-transform:scale(100%);transform:scale(100%)}to{-webkit-transform:scale(95%);transform:scale(95%)}}
@@ -97,7 +97,11 @@ var ModalContent = function ModalContent(_ref) {
97
97
  }, classes === null || classes === void 0 ? void 0 : classes.headerBackButton),
98
98
  type: "button",
99
99
  onClick: onBackButtonClick
100
- }), isSmallIcon ? /*#__PURE__*/React.createElement(ArrowLeft24, null) : /*#__PURE__*/React.createElement(ArrowLeft32, null));
100
+ }), isSmallIcon ? /*#__PURE__*/React.createElement(ArrowLeft24, {
101
+ className: cn('header-icon')
102
+ }) : /*#__PURE__*/React.createElement(ArrowLeft32, {
103
+ className: cn('header-icon')
104
+ }));
101
105
  var renderCloseButton = /*#__PURE__*/React.createElement("button", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.headerCloseButton), {
102
106
  className: cn('header-button', {
103
107
  close: true,
@@ -105,7 +109,11 @@ var ModalContent = function ModalContent(_ref) {
105
109
  }, classes === null || classes === void 0 ? void 0 : classes.headerCloseButton),
106
110
  type: "button",
107
111
  onClick: onPopupClose
108
- }), isSmallIcon ? /*#__PURE__*/React.createElement(Cancel24, null) : /*#__PURE__*/React.createElement(Cancel32, null));
112
+ }), isSmallIcon ? /*#__PURE__*/React.createElement(Cancel24, {
113
+ className: cn('header-icon')
114
+ }) : /*#__PURE__*/React.createElement(Cancel32, {
115
+ className: cn('header-icon')
116
+ }));
109
117
  var renderHeader = /*#__PURE__*/React.createElement("div", {
110
118
  className: cn('header', {
111
119
  shadow: showHeaderShadow
@@ -1 +1 @@
1
- h1,h2,h3,h4,h5{margin:0}.mfui-pagination{display:-webkit-box;display:-ms-flexbox;display:flex}
1
+ h1,h2,h3,h4,h5{margin:0}.mfui-pagination{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:12px;-webkit-box-align:center;-ms-flex-align:center;align-items:center}@media screen and (max-width:767px){.mfui-pagination{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:16px}}.mfui-pagination__input,.mfui-pagination__wrapper{display:-webkit-box;display:-ms-flexbox;display:flex}.mfui-pagination__input{gap:8px;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.mfui-pagination__input-caption{min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content}.mfui-pagination__input-field{width:90px}
@@ -1,22 +1,31 @@
1
1
  import * as React from 'react';
2
+ import { PaginationTypesType, ThemeType, ValueType } from './types';
2
3
  import './Pagination.scss';
3
- import { PaginationValueType } from './components/PaginationButton/PaginationButton';
4
4
  interface IPaginationProps {
5
+ /** Общее количество страниц */
6
+ totalPages: number;
7
+ /** Номер текущей страницы */
8
+ activePage: number;
9
+ /** Тип компонента. DEPRECATED: 'classic' */
10
+ type?: PaginationTypesType;
11
+ /** Цветовая тема компонента */
12
+ theme?: ThemeType;
13
+ /** Отобразить поле ввода номера страницы */
14
+ showSelectPage?: boolean;
15
+ /** Обработчик изменения активной страницы */
16
+ onChange: (value: ValueType) => void;
17
+ /** Дополнительный класс корневого элемента */
18
+ className?: string;
5
19
  /** Дополнительные data атрибуты к внутренним элементам */
6
20
  dataAttrs?: {
7
21
  root?: Record<string, string>;
8
22
  prev?: Record<string, string>;
9
23
  next?: Record<string, string>;
10
24
  button?: Record<string, string>;
25
+ skipPrev?: Record<string, string>;
26
+ skipNext?: Record<string, string>;
27
+ input?: Record<string, string>;
11
28
  };
12
- /** Общее количество страниц */
13
- totalPages: number;
14
- /** Номер текущей страницы */
15
- activePage: number;
16
- /** Тема компонента */
17
- theme?: 'default' | 'light';
18
- /** Обработчик изменения активной страницы */
19
- onChange: (value: PaginationValueType) => void;
20
29
  }
21
30
  declare const Pagination: React.FC<IPaginationProps>;
22
31
  export default Pagination;
@@ -1,19 +1,38 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
3
  import * as React from 'react';
3
4
  import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
4
- import "./Pagination.css";
5
+ import Caption from "../Caption/Caption";
6
+ import ValueField from "../ValueField/ValueField";
5
7
  import PaginationButtons from "./components/PaginationButtons/PaginationButtons";
6
- import PaginationNavigation from "./components/PaginationNavigation/PaginationNavigation";
7
- import usePagination, { Button } from "./usePagination";
8
+ import PaginationNavigation, { HINTS } from "./components/PaginationNavigation/PaginationNavigation";
9
+ import { getInputRangeValue, removeFirstZeros, setValueFieldTheme } from "./helpers";
10
+ import { PaginationTypes } from "./types";
11
+ import usePagination, { BUTTONS } from "./usePagination";
12
+ import "./Pagination.css";
8
13
  var cn = cnCreate('mfui-pagination');
9
14
  var Pagination = function Pagination(_ref) {
10
15
  var totalPages = _ref.totalPages,
11
16
  activePage = _ref.activePage,
12
- dataAttrs = _ref.dataAttrs,
17
+ _ref$type = _ref.type,
18
+ type = _ref$type === void 0 ? PaginationTypes.CLASSIC : _ref$type,
13
19
  _ref$theme = _ref.theme,
14
20
  theme = _ref$theme === void 0 ? 'default' : _ref$theme,
15
- onChange = _ref.onChange;
16
- var paginationItems = usePagination(totalPages, activePage);
21
+ showSelectPage = _ref.showSelectPage,
22
+ onChange = _ref.onChange,
23
+ className = _ref.className,
24
+ dataAttrs = _ref.dataAttrs;
25
+ var _usePagination = usePagination(type, totalPages, activePage),
26
+ paginationItems = _usePagination.paginationItems,
27
+ skipPrevPage = _usePagination.skipPrevPage,
28
+ skipNextPage = _usePagination.skipNextPage;
29
+ var _React$useState = React.useState(''),
30
+ _React$useState2 = _slicedToArray(_React$useState, 2),
31
+ inputValue = _React$useState2[0],
32
+ setInputValue = _React$useState2[1];
33
+ var inputRef = React.useRef(null);
34
+ var isModernType = type === PaginationTypes.MODERN;
35
+ var buttonForm = isModernType ? 'brick' : 'round';
17
36
  var handleBackClick = React.useCallback(function () {
18
37
  onChange(activePage - 1);
19
38
  }, [activePage, onChange]);
@@ -21,36 +40,89 @@ var Pagination = function Pagination(_ref) {
21
40
  onChange(activePage + 1);
22
41
  }, [activePage, onChange]);
23
42
  var handlePageButtonClick = React.useCallback(function (value) {
43
+ if (value === BUTTONS.SKIP_PREV) {
44
+ onChange(skipPrevPage);
45
+ return;
46
+ }
47
+ if (value === BUTTONS.SKIP_NEXT) {
48
+ onChange(skipNextPage);
49
+ return;
50
+ }
24
51
  value && onChange(value);
25
- }, [onChange]);
52
+ }, [onChange, skipNextPage, skipPrevPage]);
53
+ var handleInputSubmit = React.useCallback(function () {
54
+ var _a;
55
+ if (!inputValue) {
56
+ return;
57
+ }
58
+ var pageNumber = getInputRangeValue(inputValue, totalPages, BUTTONS.FIRST);
59
+ onChange(pageNumber);
60
+ setInputValue('');
61
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
62
+ }, [inputValue, onChange, totalPages]);
63
+ var handleInputChange = React.useCallback(function (e) {
64
+ var targetValue = removeFirstZeros(e.target.value);
65
+ setInputValue(targetValue);
66
+ }, []);
26
67
  return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
27
- className: cn()
28
- }), /*#__PURE__*/React.createElement(PaginationNavigation, {
68
+ className: cn([className])
69
+ }), /*#__PURE__*/React.createElement("div", {
70
+ className: cn('wrapper')
71
+ }, /*#__PURE__*/React.createElement(PaginationNavigation, {
72
+ className: cn('button'),
29
73
  dataAttrs: {
30
74
  root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.prev
31
75
  },
32
76
  direction: "left",
33
- disabled: activePage === Button.FIRST,
34
- onClick: handleBackClick,
35
- className: cn('button'),
36
- theme: theme
77
+ form: buttonForm,
78
+ disabled: activePage === BUTTONS.FIRST,
79
+ hint: isModernType ? HINTS.PREV : null,
80
+ theme: theme,
81
+ onClick: handleBackClick
37
82
  }), /*#__PURE__*/React.createElement(PaginationButtons, {
38
83
  dataAttrs: {
39
- root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.button
84
+ button: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.button,
85
+ skipNext: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.skipNext,
86
+ skipPrev: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.skipPrev
40
87
  },
41
88
  items: paginationItems,
42
89
  activeButton: activePage,
43
- hiddenButton: Button.HIDDEN,
90
+ skipButtonPrev: BUTTONS.SKIP_PREV,
91
+ skipButtonNext: BUTTONS.SKIP_NEXT,
92
+ type: type,
93
+ form: buttonForm,
94
+ showHints: isModernType,
44
95
  theme: theme,
45
96
  onClick: handlePageButtonClick
46
97
  }), /*#__PURE__*/React.createElement(PaginationNavigation, {
98
+ className: cn('button'),
47
99
  dataAttrs: {
48
100
  root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.next
49
101
  },
102
+ direction: "right",
103
+ form: buttonForm,
50
104
  disabled: activePage === totalPages,
51
- onClick: handleNextClick,
52
- className: cn('button'),
53
- theme: theme
54
- }));
105
+ hint: isModernType ? HINTS.NEXT : null,
106
+ theme: theme,
107
+ onClick: handleNextClick
108
+ })), showSelectPage && /*#__PURE__*/React.createElement("div", {
109
+ className: cn('input')
110
+ }, /*#__PURE__*/React.createElement(Caption, {
111
+ className: cn('input-caption'),
112
+ color: theme === 'light' ? 'white' : 'default',
113
+ hasMargin: false
114
+ }, "\u041D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443"), /*#__PURE__*/React.createElement(ValueField, {
115
+ className: cn('input-field'),
116
+ isControlled: true,
117
+ placeholder: "\u2116",
118
+ theme: setValueFieldTheme(theme),
119
+ value: inputValue,
120
+ onChange: handleInputChange,
121
+ onBlur: handleInputSubmit,
122
+ dataAttrs: {
123
+ input: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.input
124
+ },
125
+ inputRef: inputRef
126
+ })));
55
127
  };
56
128
  export default Pagination;
@@ -1 +1 @@
1
- h1,h2,h3,h4,h5{margin:0}.mfui-pagination-button{display:-webkit-box;display:-ms-flexbox;display:flex;font-size:15px;font-weight:500;line-height:24px;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:transparent;border:1px solid transparent;border-radius:50%;cursor:pointer;height:32px;padding:0;width:32px}.mfui-pagination-button svg{width:100%}.mfui-pagination-button:disabled{pointer-events:none}.mfui-pagination-button_active{border-color:var(--brandGreen);pointer-events:none}.mfui-pagination-button_theme_default{color:var(--content)}.mfui-pagination-button_theme_default svg{fill:var(--content)}.mfui-pagination-button_theme_default:hover{background-color:var(--spbSky0)}.mfui-pagination-button_theme_default.mfui-pagination-button_active{border-color:var(--brandGreen)}.mfui-pagination-button_theme_light{color:var(--stcWhite)}.mfui-pagination-button_theme_light svg{fill:var(--stcWhite)}.mfui-pagination-button_theme_light:hover{background-color:var(--stcWhite20)}.mfui-pagination-button_theme_light.mfui-pagination-button_active{border-color:var(--stcWhite)}
1
+ h1,h2,h3,h4,h5{margin:0}.mfui-pagination-button{display:-webkit-box;display:-ms-flexbox;display:flex;font-size:15px;font-weight:500;line-height:24px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;border:1px solid transparent;border-radius:50%;height:32px;justify-content:center;padding:0;width:32px;-webkit-tap-highlight-color:rgba(0,0,0,0);background-color:transparent;cursor:pointer}.mfui-pagination-button svg{width:100%}.mfui-pagination-button:disabled{pointer-events:none}.mfui-pagination-button_form_brick{border-radius:8px;-webkit-box-sizing:border-box;box-sizing:border-box}.mfui-pagination-button_auto-width{min-width:32px;padding:0 8px;width:auto}.mfui-pagination-button_active{border-color:var(--brandGreen);pointer-events:none}.mfui-pagination-button_theme_default{color:var(--content)}.mfui-pagination-button_theme_default svg{fill:var(--content)}.mfui-pagination-button_theme_default:hover{background-color:var(--spbSky0)}.mfui-pagination-button_theme_default.mfui-pagination-button_active{border-color:var(--brandGreen);color:var(--brandGreen)}.mfui-pagination-button_theme_light{color:var(--stcWhite)}.mfui-pagination-button_theme_light svg{fill:var(--stcWhite)}.mfui-pagination-button_theme_light:hover{background-color:var(--stcWhite20)}.mfui-pagination-button_theme_light.mfui-pagination-button_active{border-color:var(--stcWhite)}.mfui-pagination-button_theme_gray{color:var(--content)}.mfui-pagination-button_theme_gray svg{fill:var(--content)}.mfui-pagination-button_theme_gray:hover{background-color:var(--base)}.mfui-pagination-button_theme_gray.mfui-pagination-button_active{border-color:var(--brandGreen);color:var(--brandGreen)}
@@ -1,17 +1,22 @@
1
1
  import React from 'react';
2
+ import { ValueType, ThemeType, ButtonFormType } from '../../types';
2
3
  import './PaginationButton.scss';
3
- export type PaginationValueType = string | number;
4
4
  export interface IPaginationButtonProps {
5
+ theme?: ThemeType;
6
+ form?: ButtonFormType;
7
+ value?: ValueType;
5
8
  disabled?: boolean;
6
9
  isActive?: boolean;
7
- theme?: 'default' | 'light';
8
- value?: PaginationValueType;
10
+ autoWidth?: boolean;
9
11
  className?: string;
10
12
  dataAttrs?: {
11
13
  root?: Record<string, string>;
12
14
  };
13
15
  children?: React.ReactNode;
14
- onClick?: (value?: PaginationValueType) => void;
16
+ onClick?: (value?: ValueType) => void;
17
+ onMouseEnter?: () => void;
18
+ onMouseLeave?: () => void;
19
+ rootRef?: React.Ref<HTMLButtonElement>;
15
20
  }
16
21
  declare const PaginationButton: React.FC<IPaginationButtonProps>;
17
22
  export default PaginationButton;
@@ -10,22 +10,32 @@ var PaginationButton = function PaginationButton(_ref) {
10
10
  isActive = _ref$isActive === void 0 ? false : _ref$isActive,
11
11
  _ref$theme = _ref.theme,
12
12
  theme = _ref$theme === void 0 ? 'default' : _ref$theme,
13
+ form = _ref.form,
14
+ autoWidth = _ref.autoWidth,
13
15
  className = _ref.className,
14
16
  children = _ref.children,
15
17
  onClick = _ref.onClick,
18
+ onMouseEnter = _ref.onMouseEnter,
19
+ onMouseLeave = _ref.onMouseLeave,
16
20
  value = _ref.value,
17
- dataAttrs = _ref.dataAttrs;
21
+ dataAttrs = _ref.dataAttrs,
22
+ rootRef = _ref.rootRef;
18
23
  var handleClick = function handleClick() {
19
24
  onClick === null || onClick === void 0 ? void 0 : onClick(value);
20
25
  };
21
26
  return /*#__PURE__*/React.createElement("button", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
22
27
  className: cn({
23
28
  active: isActive,
24
- theme: theme
29
+ theme: theme,
30
+ form: form,
31
+ 'auto-width': autoWidth
25
32
  }, className),
33
+ type: "button",
26
34
  disabled: disabled,
27
35
  onClick: handleClick,
28
- type: "button"
36
+ onMouseEnter: onMouseEnter,
37
+ onMouseLeave: onMouseLeave,
38
+ ref: rootRef
29
39
  }), children);
30
40
  };
31
41
  export default PaginationButton;
@@ -1 +1 @@
1
- .mfui-pagination-buttons{display:-webkit-box;display:-ms-flexbox;display:flex}.mfui-pagination-buttons__button{-ms-flex-negative:0;flex-shrink:0;margin:0 4px}
1
+ h1,h2,h3,h4,h5{margin:0}.mfui-pagination-buttons{display:-webkit-box;display:-ms-flexbox;display:flex}.mfui-pagination-buttons__button{-ms-flex-negative:0;flex-shrink:0;margin:0 4px}@media screen and (max-width:767px){.mfui-pagination-buttons__button{margin:0 2px}}.mfui-pagination-buttons__button_form_brick{margin:0 2px}@media screen and (max-width:767px){.mfui-pagination-buttons__button_form_brick{margin:0}}
@@ -1,15 +1,21 @@
1
1
  import React from 'react';
2
- import { PaginationValueType } from '../PaginationButton/PaginationButton';
2
+ import { ValueType, ThemeType, ButtonFormType, PaginationTypesType } from '../../types';
3
3
  import './PaginationButtons.scss';
4
- interface IPaginationButtonsProps {
4
+ export interface IPaginationButtonsProps {
5
5
  items: Array<string | number>;
6
- theme?: 'default' | 'light';
6
+ type: PaginationTypesType;
7
+ form: ButtonFormType;
8
+ theme: ThemeType;
9
+ showHints: boolean;
7
10
  activeButton: number;
8
- hiddenButton: string;
11
+ skipButtonPrev: string;
12
+ skipButtonNext: string;
9
13
  dataAttrs?: {
10
- root?: Record<string, string>;
14
+ button?: Record<string, string>;
15
+ skipNext?: Record<string, string>;
16
+ skipPrev?: Record<string, string>;
11
17
  };
12
- onClick: (value?: PaginationValueType) => void;
18
+ onClick: (value?: ValueType) => void;
13
19
  }
14
20
  declare const PaginationButtons: React.FC<IPaginationButtonsProps>;
15
21
  export default PaginationButtons;