@megafon/ui-core 2.0.0-beta.165 → 2.0.0-beta.169

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 (54) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/dist/es/components/Accordion/Accordion.d.ts +2 -2
  3. package/dist/es/components/Accordion/Accordion.js +1 -1
  4. package/dist/es/components/Button/Button.js +2 -0
  5. package/dist/es/components/Calendar/Calendar.js +11 -7
  6. package/dist/es/components/Carousel/Carousel.js +26 -1
  7. package/dist/es/components/Carousel/checkBreakpointsPropTypes.d.ts +1 -1
  8. package/dist/es/components/ContentArea/ContentArea.d.ts +13 -20
  9. package/dist/es/components/ContentArea/ContentArea.js +31 -55
  10. package/dist/es/components/Link/Link.d.ts +1 -13
  11. package/dist/es/components/Link/Link.js +7 -34
  12. package/dist/es/components/Logo/Logo.d.ts +1 -12
  13. package/dist/es/components/Logo/Logo.js +24 -56
  14. package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.js +2 -1
  15. package/dist/es/components/Search/Search.css +12 -3
  16. package/dist/es/components/Search/Search.d.ts +2 -0
  17. package/dist/es/components/Search/Search.js +19 -6
  18. package/dist/es/components/Select/Select.css +16 -27
  19. package/dist/es/components/Select/Select.d.ts +14 -12
  20. package/dist/es/components/Select/Select.js +12 -18
  21. package/dist/es/components/Tabs/Tab.js +1 -0
  22. package/dist/es/components/TextField/TextField.js +43 -43
  23. package/dist/es/components/TextLink/TextLink.css +0 -4
  24. package/dist/es/components/TextLink/TextLink.d.ts +4 -14
  25. package/dist/es/components/TextLink/TextLink.js +24 -57
  26. package/dist/es/components/Tooltip/Tooltip.d.ts +1 -1
  27. package/dist/es/components/Tooltip/Tooltip.js +44 -6
  28. package/dist/lib/components/Accordion/Accordion.d.ts +2 -2
  29. package/dist/lib/components/Accordion/Accordion.js +1 -1
  30. package/dist/lib/components/Button/Button.js +2 -0
  31. package/dist/lib/components/Calendar/Calendar.js +11 -7
  32. package/dist/lib/components/Carousel/Carousel.js +27 -1
  33. package/dist/lib/components/Carousel/checkBreakpointsPropTypes.d.ts +1 -1
  34. package/dist/lib/components/ContentArea/ContentArea.d.ts +13 -20
  35. package/dist/lib/components/ContentArea/ContentArea.js +31 -88
  36. package/dist/lib/components/Link/Link.d.ts +1 -13
  37. package/dist/lib/components/Link/Link.js +7 -67
  38. package/dist/lib/components/Logo/Logo.d.ts +1 -12
  39. package/dist/lib/components/Logo/Logo.js +24 -87
  40. package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.js +2 -1
  41. package/dist/lib/components/Search/Search.css +12 -3
  42. package/dist/lib/components/Search/Search.d.ts +2 -0
  43. package/dist/lib/components/Search/Search.js +20 -6
  44. package/dist/lib/components/Select/Select.css +16 -27
  45. package/dist/lib/components/Select/Select.d.ts +14 -12
  46. package/dist/lib/components/Select/Select.js +12 -18
  47. package/dist/lib/components/Tabs/Tab.js +1 -0
  48. package/dist/lib/components/TextField/TextField.js +44 -43
  49. package/dist/lib/components/TextLink/TextLink.css +0 -4
  50. package/dist/lib/components/TextLink/TextLink.d.ts +4 -14
  51. package/dist/lib/components/TextLink/TextLink.js +26 -90
  52. package/dist/lib/components/Tooltip/Tooltip.d.ts +1 -1
  53. package/dist/lib/components/Tooltip/Tooltip.js +44 -6
  54. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -3,6 +3,81 @@
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
+ # [2.0.0-beta.169](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@2.0.0-beta.168...@megafon/ui-core@2.0.0-beta.169) (2021-11-29)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **carousel:** slides carousel to focusable slide ([f31c806](https://github.com/MegafonWebLab/megafon-ui/commit/f31c806387e3cef6cc1d4c98e2af2d65015eef3c))
12
+ * **search:** fix items container position ([178eeed](https://github.com/MegafonWebLab/megafon-ui/commit/178eeed58c79f30ddfcca4c33c394f7333e2cc7a))
13
+ * **select:** remove arrow and arrows wrap classes ([2811796](https://github.com/MegafonWebLab/megafon-ui/commit/28117968f55430ce92198559a8b55174d9791368))
14
+ * **select:** update keyboard focus ([59999df](https://github.com/MegafonWebLab/megafon-ui/commit/59999dfac0aee425a0a445ed5e93702e78f11a21))
15
+ * **textlink:** fix double underline for dashed and border style ([da41c55](https://github.com/MegafonWebLab/megafon-ui/commit/da41c55f23e3953efdca24e576633a0d07269c3d))
16
+ * **tooltip:** add keyboard accessibility for tooltip open ([f4c97b8](https://github.com/MegafonWebLab/megafon-ui/commit/f4c97b8a8d9a29669e475bda670550d72a3b49e4))
17
+
18
+
19
+ ### Features
20
+
21
+ * **search:** add disabled prop ([bc32588](https://github.com/MegafonWebLab/megafon-ui/commit/bc32588f1964ecd93f1f8a2aec1479959ef9d131))
22
+
23
+
24
+ ### BREAKING CHANGES
25
+
26
+ * **select:** arrow display by pseudo element now, props and element removed from component
27
+
28
+
29
+
30
+
31
+
32
+ # [2.0.0-beta.168](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@2.0.0-beta.167...@megafon/ui-core@2.0.0-beta.168) (2021-11-23)
33
+
34
+
35
+ ### Features
36
+
37
+ * **carousel:** fix effect fade ([359fd55](https://github.com/MegafonWebLab/megafon-ui/commit/359fd55990ac7e018917301bb4b3ae12d0e133e0))
38
+ * **select:** update items prop typings ([280d581](https://github.com/MegafonWebLab/megafon-ui/commit/280d5818aee2a8b8f596bb25b3752e5729a8edb3))
39
+
40
+
41
+ ### BREAKING CHANGES
42
+
43
+ * **select:** items prop reuired and has exact structure in propType
44
+
45
+
46
+
47
+
48
+
49
+ # [2.0.0-beta.167](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@2.0.0-beta.166...@megafon/ui-core@2.0.0-beta.167) (2021-11-15)
50
+
51
+
52
+ ### Bug Fixes
53
+
54
+ * **select:** restore keyboard controls ([d78031b](https://github.com/MegafonWebLab/megafon-ui/commit/d78031baf4ee70a69866446f9d32f009f1fcd346))
55
+
56
+
57
+
58
+
59
+
60
+ # [2.0.0-beta.166](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@2.0.0-beta.165...@megafon/ui-core@2.0.0-beta.166) (2021-11-15)
61
+
62
+
63
+ ### Bug Fixes
64
+
65
+ * **textfield:** set empty string as default value ([1bba2bb](https://github.com/MegafonWebLab/megafon-ui/commit/1bba2bbb577acf34fa3bc3c694999ac26f900ef7))
66
+ * **ui-core:** enable some eslint rules and fix problems ([ee8fd03](https://github.com/MegafonWebLab/megafon-ui/commit/ee8fd03d6620cbcff25915f279e481db2193a6d1))
67
+ * **ui-core:** fix ContentArea props ([dbede1d](https://github.com/MegafonWebLab/megafon-ui/commit/dbede1d1a021cc13c2c1872f1b86a8c6a5813b95))
68
+ * **ui-core:** fix RadioButton tests ([f3410f7](https://github.com/MegafonWebLab/megafon-ui/commit/f3410f7b1dd2007d40f17f8ec54905bff76ff994))
69
+ * **ui-core:** fix RedioButton default value ([df1fe2c](https://github.com/MegafonWebLab/megafon-ui/commit/df1fe2c37fc51d10c2ee459cdd5badb6c1ee48fb))
70
+ * **ui-core:** restore defaultProps ([5e2ef7c](https://github.com/MegafonWebLab/megafon-ui/commit/5e2ef7c18c30fb1873b8b7638c299eb066bd1ee3))
71
+
72
+
73
+ ### Features
74
+
75
+ * **accordion:** added new type for title ([0275349](https://github.com/MegafonWebLab/megafon-ui/commit/0275349edffec74c4fb08638cbebf7026d99d4cd))
76
+
77
+
78
+
79
+
80
+
6
81
  # [2.0.0-beta.165](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@2.0.0-beta.164...@megafon/ui-core@2.0.0-beta.165) (2021-11-01)
7
82
 
8
83
 
@@ -5,7 +5,7 @@ export interface IAccordionProps extends IFilterDataAttrs {
5
5
  /** Ссылка на корневой элемент */
6
6
  rootRef?: React.Ref<HTMLDivElement>;
7
7
  /** Заголовок */
8
- title: string;
8
+ title: string | React.ReactNode | React.ReactNode[];
9
9
  /** Состояние открытости */
10
10
  isOpened?: boolean;
11
11
  /** Вертикальные отступы */
@@ -20,7 +20,7 @@ export interface IAccordionProps extends IFilterDataAttrs {
20
20
  titleWrap?: string;
21
21
  };
22
22
  /** Обработчик клика */
23
- onClickAccordion?: (isOpened: boolean, title: string) => void;
23
+ onClickAccordion?: (isOpened: boolean, title: string | React.ReactNode | React.ReactNode[]) => void;
24
24
  }
25
25
  declare const Accordion: React.FC<IAccordionProps>;
26
26
  export default Accordion;
@@ -85,7 +85,7 @@ Accordion.propTypes = {
85
85
  rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
86
86
  current: PropTypes.elementType
87
87
  }), PropTypes.any])]),
88
- title: PropTypes.string.isRequired,
88
+ title: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.arrayOf(PropTypes.node)]).isRequired,
89
89
  isOpened: PropTypes.bool,
90
90
  hasVerticalPaddings: PropTypes.bool,
91
91
  className: PropTypes.string,
@@ -162,6 +162,8 @@ var Button = function Button(_ref) {
162
162
  if (target && target !== '_self') {
163
163
  return 'noreferrer noopener';
164
164
  }
165
+
166
+ return undefined;
165
167
  };
166
168
 
167
169
  var classNameValue = Array.isArray(className) ? [].concat(_toConsumableArray(className), [rootClassName]) : [className, rootClassName];
@@ -95,7 +95,9 @@ var Calendar = function Calendar(_ref) {
95
95
  stateFocusedInput = calendarState.focusedInput;
96
96
 
97
97
  var _a = useDatepicker(_extends({
98
- onDatesChange: function onDatesChange() {},
98
+ onDatesChange: function onDatesChange() {
99
+ return undefined;
100
+ },
99
101
  numberOfMonths: 1,
100
102
  minBookingDate: minBookingDate,
101
103
  maxBookingDate: maxBookingDate,
@@ -133,12 +135,14 @@ var Calendar = function Calendar(_ref) {
133
135
  });
134
136
 
135
137
  case isPeriodNarrow:
136
- var isCloserToStart = stateStartDate && stateEndDate && differenceInDays(stateStartDate, date) >= differenceInDays(date, stateEndDate);
137
- return _extends(_extends({}, calendarState), {
138
- startDate: isCloserToStart ? date : stateStartDate,
139
- endDate: isCloserToStart ? stateEndDate : date,
140
- focusedInput: START_DATE
141
- });
138
+ {
139
+ var isCloserToStart = stateStartDate && stateEndDate && differenceInDays(stateStartDate, date) >= differenceInDays(date, stateEndDate);
140
+ return _extends(_extends({}, calendarState), {
141
+ startDate: isCloserToStart ? date : stateStartDate,
142
+ endDate: isCloserToStart ? stateEndDate : date,
143
+ focusedInput: START_DATE
144
+ });
145
+ }
142
146
 
143
147
  case isStartDateChose:
144
148
  return {
@@ -1,3 +1,4 @@
1
+ import "core-js/modules/es.array.index-of";
1
2
  import "core-js/modules/es.array.map";
2
3
  import "core-js/modules/es.object.values";
3
4
  import _extends from "@babel/runtime/helpers/extends";
@@ -190,6 +191,26 @@ var Carousel = function Carousel(_ref) {
190
191
  swiper.slides.css('width', '');
191
192
  }
192
193
  }, throttleTime.resize), []);
194
+
195
+ var handleSlideFocus = function handleSlideFocus(index) {
196
+ return function (e) {
197
+ var _a;
198
+
199
+ if (loop) {
200
+ // for correctly scroll the looped carousel to the focused element, we need to get its real index in the DOM-collection of slides
201
+ // because swiper does not provide this, only data-swiper-slide-index, whose values are in the range from 0 to children.length - 1,
202
+ // but method slideTo needs to be passed a real slide index in DOM-collection
203
+ var slideSelector = ".".concat(cn('slide'));
204
+ var slide = e.nativeEvent.target.closest(slideSelector);
205
+ var realIndex = Array.prototype.indexOf.call((_a = slide === null || slide === void 0 ? void 0 : slide.parentNode) === null || _a === void 0 ? void 0 : _a.children, slide);
206
+ swiperInstance === null || swiperInstance === void 0 ? void 0 : swiperInstance.slideTo(realIndex);
207
+ return;
208
+ }
209
+
210
+ swiperInstance === null || swiperInstance === void 0 ? void 0 : swiperInstance.slideTo(index);
211
+ };
212
+ };
213
+
193
214
  return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs), {
194
215
  ref: rootRef,
195
216
  className: cn({
@@ -216,6 +237,9 @@ var Carousel = function Carousel(_ref) {
216
237
  allowTouchMove: !disableTouchMove,
217
238
  centeredSlides: centeredSlides,
218
239
  effect: effectTheme,
240
+ fadeEffect: effectTheme === EffectTheme.FADE ? {
241
+ crossFade: effectTheme === EffectTheme.FADE
242
+ } : undefined,
219
243
  noSwipingSelector: noSwipingSelector ? ".swiper-pagination, ".concat(noSwipingSelector) : '.swiper-pagination',
220
244
  onSwiper: handleSwiper,
221
245
  onReachBeginning: handleReachBeginnig,
@@ -227,7 +251,8 @@ var Carousel = function Carousel(_ref) {
227
251
  }), React.Children.map(children, function (child, i) {
228
252
  return /*#__PURE__*/React.createElement(SwiperSlide, {
229
253
  key: i,
230
- className: cn('slide', slideClass)
254
+ className: cn('slide', slideClass),
255
+ onFocus: handleSlideFocus(i)
231
256
  }, child);
232
257
  })), /*#__PURE__*/React.createElement(NavArrow, {
233
258
  className: cn('arrow', {
@@ -1,5 +1,5 @@
1
1
  declare type ObjectType = {
2
- [key: string]: any;
2
+ [key: string]: unknown;
3
3
  };
4
4
  declare const checkBreakpointsPropTypes: (settingsPropTypes: ObjectType) => (object: ObjectType, key: string, componentName: string) => Error | null;
5
5
  export default checkBreakpointsPropTypes;
@@ -1,7 +1,17 @@
1
1
  import * as React from 'react';
2
- import * as PropTypes from 'prop-types';
3
2
  import './ContentArea.less';
4
- export declare type BackgroundColorType = 'white' | 'transparent' | 'green' | 'purple' | 'spbSky0' | 'spbSky1' | 'spbSky2' | 'freshAsphalt' | 'fullBlack';
3
+ declare const BACKGROUND_COLORS: {
4
+ WHITE: string;
5
+ TRANSPARENT: string;
6
+ GREEN: string;
7
+ PURPLE: string;
8
+ SPB_SKY_0: string;
9
+ SPB_SKY_1: string;
10
+ SPB_SKY_2: string;
11
+ FRESH_ASPHALT: string;
12
+ FULL_BLACK: string;
13
+ };
14
+ export declare type BackgroundColorType = typeof BACKGROUND_COLORS[keyof typeof BACKGROUND_COLORS];
5
15
  declare const DisableIndents: {
6
16
  readonly MOBILE: "mobile";
7
17
  readonly MOBILE_TABLET: "mobile-tablet";
@@ -24,22 +34,5 @@ export interface IConrentAreaProps {
24
34
  inner?: string;
25
35
  };
26
36
  }
27
- declare class ContentArea extends React.Component<IConrentAreaProps> {
28
- static propTypes: {
29
- outerBackgroundColor: PropTypes.Requireable<string>;
30
- innerBackgroundColor: PropTypes.Requireable<string>;
31
- disableIndents: PropTypes.Requireable<"all" | "mobile" | "mobile-tablet" | "tablet-desktop">;
32
- children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
33
- className: PropTypes.Requireable<string>;
34
- classes: PropTypes.Requireable<PropTypes.InferProps<{
35
- root: PropTypes.Requireable<string>;
36
- inner: PropTypes.Requireable<string>;
37
- }>>;
38
- };
39
- static defaultProps: {
40
- outerBackgroundColor: string;
41
- innerBackgroundColor: string;
42
- };
43
- render(): JSX.Element;
44
- }
37
+ declare const ContentArea: React.FC<IConrentAreaProps>;
45
38
  export default ContentArea;
@@ -1,74 +1,50 @@
1
- import "core-js/modules/es.date.to-string";
2
- import "core-js/modules/es.object.to-string";
3
1
  import "core-js/modules/es.object.values";
4
- import "core-js/modules/es.reflect.construct";
5
- import "core-js/modules/es.regexp.to-string";
6
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
7
- import _createClass from "@babel/runtime/helpers/createClass";
8
- import _inherits from "@babel/runtime/helpers/inherits";
9
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
10
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
11
-
12
- function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
13
-
14
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
15
-
16
2
  import * as React from 'react';
17
3
  import { cnCreate } from '@megafon/ui-helpers';
18
4
  import * as PropTypes from 'prop-types';
19
5
  import "./ContentArea.css";
6
+ var BACKGROUND_COLORS = {
7
+ WHITE: 'white',
8
+ TRANSPARENT: 'transparent',
9
+ GREEN: 'green',
10
+ PURPLE: 'purple',
11
+ SPB_SKY_0: 'spbSky0',
12
+ SPB_SKY_1: 'spbSky1',
13
+ SPB_SKY_2: 'spbSky2',
14
+ FRESH_ASPHALT: 'freshAsphalt',
15
+ FULL_BLACK: 'fullBlack'
16
+ };
20
17
  var DisableIndents = {
21
18
  MOBILE: 'mobile',
22
19
  MOBILE_TABLET: 'mobile-tablet',
23
20
  TABLET_DESKTOP: 'tablet-desktop',
24
21
  ALL: 'all'
25
22
  };
26
- var BACKGROUND_COLORS = ['white', 'transparent', 'green', 'purple', 'spbSky0', 'spbSky1', 'spbSky2', 'freshAsphalt', 'fullBlack'];
27
23
  var cn = cnCreate('mfui-beta-content-area');
28
24
 
29
- var ContentArea = /*#__PURE__*/function (_React$Component) {
30
- _inherits(ContentArea, _React$Component);
31
-
32
- var _super = _createSuper(ContentArea);
33
-
34
- function ContentArea() {
35
- _classCallCheck(this, ContentArea);
36
-
37
- return _super.apply(this, arguments);
38
- }
39
-
40
- _createClass(ContentArea, [{
41
- key: "render",
42
- value: function render() {
43
- var _this$props = this.props,
44
- outerBackgroundColor = _this$props.outerBackgroundColor,
45
- innerBackgroundColor = _this$props.innerBackgroundColor,
46
- disableIndents = _this$props.disableIndents,
47
- children = _this$props.children,
48
- className = _this$props.className,
49
- _this$props$classes = _this$props.classes,
50
- classes = _this$props$classes === void 0 ? {} : _this$props$classes;
51
- return /*#__PURE__*/React.createElement("div", {
52
- className: cn({
53
- color: outerBackgroundColor
54
- }, [className, classes.root])
55
- }, /*#__PURE__*/React.createElement("div", {
56
- className: cn('inner', {
57
- 'disable-indents': disableIndents,
58
- color: innerBackgroundColor
59
- }, classes.inner)
60
- }, children));
61
- }
62
- }]);
63
-
64
- return ContentArea;
65
- }(React.Component);
25
+ var ContentArea = function ContentArea(_ref) {
26
+ var outerBackgroundColor = _ref.outerBackgroundColor,
27
+ innerBackgroundColor = _ref.innerBackgroundColor,
28
+ disableIndents = _ref.disableIndents,
29
+ children = _ref.children,
30
+ className = _ref.className,
31
+ classes = _ref.classes;
32
+ return /*#__PURE__*/React.createElement("div", {
33
+ className: cn({
34
+ color: outerBackgroundColor
35
+ }, [className, classes === null || classes === void 0 ? void 0 : classes.root])
36
+ }, /*#__PURE__*/React.createElement("div", {
37
+ className: cn('inner', {
38
+ 'disable-indents': disableIndents,
39
+ color: innerBackgroundColor
40
+ }, classes === null || classes === void 0 ? void 0 : classes.inner)
41
+ }, children));
42
+ };
66
43
 
67
44
  ContentArea.propTypes = {
68
- outerBackgroundColor: PropTypes.oneOf(BACKGROUND_COLORS),
69
- innerBackgroundColor: PropTypes.oneOf(BACKGROUND_COLORS),
45
+ outerBackgroundColor: PropTypes.oneOf(Object.values(BACKGROUND_COLORS)),
46
+ innerBackgroundColor: PropTypes.oneOf(Object.values(BACKGROUND_COLORS)),
70
47
  disableIndents: PropTypes.oneOf(Object.values(DisableIndents)),
71
- children: PropTypes.node,
72
48
  className: PropTypes.string,
73
49
  classes: PropTypes.shape({
74
50
  root: PropTypes.string,
@@ -1,5 +1,4 @@
1
1
  import * as React from 'react';
2
- import * as PropTypes from 'prop-types';
3
2
  export interface ILinkProps {
4
3
  /** Дополнительный класс корневого элемента */
5
4
  className?: string;
@@ -15,16 +14,5 @@ export interface ILinkProps {
15
14
  download?: boolean;
16
15
  children?: JSX.Element[] | Element[] | JSX.Element | string | Element | React.ReactNode;
17
16
  }
18
- declare class Link extends React.Component<ILinkProps, {}> {
19
- static propTypes: {
20
- href: PropTypes.Requireable<string>;
21
- children: PropTypes.Requireable<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
22
- target: PropTypes.Requireable<string>;
23
- className: PropTypes.Requireable<string>;
24
- rel: PropTypes.Requireable<string>;
25
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
26
- download: PropTypes.Requireable<boolean>;
27
- };
28
- render(): JSX.Element;
29
- }
17
+ declare const Link: React.FC<ILinkProps>;
30
18
  export default Link;
@@ -1,40 +1,13 @@
1
- import "core-js/modules/es.date.to-string";
2
- import "core-js/modules/es.object.to-string";
3
- import "core-js/modules/es.reflect.construct";
4
- import "core-js/modules/es.regexp.to-string";
5
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
6
- import _createClass from "@babel/runtime/helpers/createClass";
7
- import _inherits from "@babel/runtime/helpers/inherits";
8
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
9
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
10
-
11
- function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
12
-
13
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
14
-
15
1
  import * as React from 'react';
16
2
  import * as PropTypes from 'prop-types';
17
3
 
18
- var Link = /*#__PURE__*/function (_React$Component) {
19
- _inherits(Link, _React$Component);
20
-
21
- var _super = _createSuper(Link);
22
-
23
- function Link() {
24
- _classCallCheck(this, Link);
25
-
26
- return _super.apply(this, arguments);
27
- }
28
-
29
- _createClass(Link, [{
30
- key: "render",
31
- value: function render() {
32
- return /*#__PURE__*/React.createElement("a", this.props);
33
- }
34
- }]);
35
-
36
- return Link;
37
- }(React.Component);
4
+ var Link = function Link(props) {
5
+ return (
6
+ /*#__PURE__*/
7
+ // eslint-disable-next-line jsx-a11y/anchor-has-content
8
+ React.createElement("a", props)
9
+ );
10
+ };
38
11
 
39
12
  Link.propTypes = {
40
13
  href: PropTypes.string,
@@ -1,5 +1,4 @@
1
1
  import * as React from 'react';
2
- import * as PropTypes from 'prop-types';
3
2
  import './Logo.less';
4
3
  export interface ILogoProps {
5
4
  /** Дополнительный класс корневого элемента */
@@ -13,15 +12,5 @@ export interface ILogoProps {
13
12
  /** target - аргумент тега <a> */
14
13
  target?: '_self' | '_blank' | '_parent' | '_top';
15
14
  }
16
- declare class Logo extends React.Component<ILogoProps, {}> {
17
- static propTypes: {
18
- color: PropTypes.Requireable<string>;
19
- view: PropTypes.Requireable<string>;
20
- target: PropTypes.Requireable<string>;
21
- href: PropTypes.Requireable<string>;
22
- className: PropTypes.Requireable<string>;
23
- };
24
- static defaultProps: Partial<ILogoProps>;
25
- render(): JSX.Element;
26
- }
15
+ declare const Logo: React.FC<ILogoProps>;
27
16
  export default Logo;
@@ -1,19 +1,5 @@
1
1
  import "core-js/modules/es.array.concat";
2
- import "core-js/modules/es.date.to-string";
3
- import "core-js/modules/es.object.to-string";
4
- import "core-js/modules/es.reflect.construct";
5
- import "core-js/modules/es.regexp.to-string";
6
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
7
- import _createClass from "@babel/runtime/helpers/createClass";
8
- import _inherits from "@babel/runtime/helpers/inherits";
9
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
10
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
11
2
  import _extends from "@babel/runtime/helpers/extends";
12
-
13
- function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
14
-
15
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
16
-
17
3
  import * as React from 'react';
18
4
  import { cnCreate } from '@megafon/ui-helpers';
19
5
  import * as PropTypes from 'prop-types';
@@ -53,52 +39,34 @@ var greenVerticalImg = function greenVerticalImg(props) {
53
39
 
54
40
  var cn = cnCreate('mfui-beta-logo');
55
41
 
56
- var Logo = /*#__PURE__*/function (_React$Component) {
57
- _inherits(Logo, _React$Component);
58
-
59
- var _super = _createSuper(Logo);
60
-
61
- function Logo() {
62
- _classCallCheck(this, Logo);
63
-
64
- return _super.apply(this, arguments);
65
- }
66
-
67
- _createClass(Logo, [{
68
- key: "render",
69
- value: function render() {
70
- var _this$props = this.props,
71
- color = _this$props.color,
72
- view = _this$props.view,
73
- className = _this$props.className,
74
- href = _this$props.href,
75
- target = _this$props.target;
76
- var images = {
77
- 'green-horizontal': greenHorizontalImg,
78
- 'green-vertical': greenVerticalImg
79
- };
80
- var BackgroundImage = images["".concat(color, "-").concat(view)];
81
- return /*#__PURE__*/React.createElement(Link, {
82
- href: href,
83
- target: target,
84
- className: cn('', {
85
- view: view
86
- }, className)
87
- }, /*#__PURE__*/React.createElement("div", {
88
- className: cn('img')
89
- }, /*#__PURE__*/React.createElement(BackgroundImage, {
90
- className: cn('svg')
91
- })));
92
- }
93
- }]);
94
-
95
- return Logo;
96
- }(React.Component);
42
+ var Logo = function Logo(_ref) {
43
+ var className = _ref.className,
44
+ color = _ref.color,
45
+ view = _ref.view,
46
+ target = _ref.target,
47
+ href = _ref.href;
48
+ var images = {
49
+ 'green-horizontal': greenHorizontalImg,
50
+ 'green-vertical': greenVerticalImg
51
+ };
52
+ var BackgroundImage = images["".concat(color, "-").concat(view)];
53
+ return /*#__PURE__*/React.createElement(Link, {
54
+ href: href,
55
+ target: target,
56
+ className: cn('', {
57
+ view: view
58
+ }, className)
59
+ }, /*#__PURE__*/React.createElement("div", {
60
+ className: cn('img')
61
+ }, /*#__PURE__*/React.createElement(BackgroundImage, {
62
+ className: cn('svg')
63
+ })));
64
+ };
97
65
 
98
66
  Logo.propTypes = {
99
67
  color: PropTypes.string,
100
68
  view: PropTypes.oneOf(['horizontal', 'vertical']),
101
- target: PropTypes.string,
69
+ target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top']),
102
70
  href: PropTypes.string,
103
71
  className: PropTypes.string
104
72
  };
@@ -26,7 +26,8 @@ var PaginationButton = function PaginationButton(_ref) {
26
26
  theme: theme
27
27
  }, className),
28
28
  disabled: disabled,
29
- onClick: handleClick
29
+ onClick: handleClick,
30
+ type: "button"
30
31
  }, children);
31
32
  };
32
33
 
@@ -74,9 +74,9 @@ h5 {
74
74
  }
75
75
  .mfui-beta-search__list {
76
76
  position: absolute;
77
- top: 100%;
78
- right: 0;
79
- left: 0;
77
+ top: calc(100% + 1px);
78
+ right: -1px;
79
+ left: -1px;
80
80
  z-index: 0;
81
81
  display: none;
82
82
  background-color: #FFFFFF;
@@ -151,6 +151,15 @@ h5 {
151
151
  .mfui-beta-search_open {
152
152
  z-index: 12;
153
153
  }
154
+ .mfui-beta-search_disabled .mfui-beta-search__control {
155
+ border-color: #EDEDED;
156
+ background-color: #EDEDED;
157
+ cursor: default;
158
+ pointer-events: none;
159
+ }
160
+ .mfui-beta-search_disabled .mfui-beta-search__icon {
161
+ opacity: 0.5;
162
+ }
154
163
  .mfui-beta-search__highlighted-fragment {
155
164
  font-weight: bold;
156
165
  }
@@ -29,6 +29,8 @@ export interface ISearchProps {
29
29
  verification?: VerificationType;
30
30
  /** Дополнительный текст под полем. Свойство verification влияет на цвет текста. */
31
31
  noticeText?: string;
32
+ /** Управление возможностью взаимодействия с компонентом */
33
+ disabled?: boolean;
32
34
  /** Делает поле обязательным */
33
35
  required?: boolean;
34
36
  /** Дополнительный класс корневого элемента */