@megafon/ui-core 2.4.0 → 3.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +154 -7
- package/dist/es/colors/ColorItem/ColorItem.css +1 -8
- package/dist/es/colors/ColorItem/ColorItem.js +1 -1
- package/dist/es/colors/Colors.css +3 -11
- package/dist/es/colors/Colors.d.ts +2 -2
- package/dist/es/colors/Colors.js +64 -4
- package/dist/es/colors/colorsData.js +78 -71
- package/dist/es/components/Accordion/Accordion.css +7 -27
- package/dist/es/components/Accordion/Accordion.d.ts +12 -7
- package/dist/es/components/Accordion/Accordion.js +25 -20
- package/dist/es/components/Banner/Banner.css +2 -37
- package/dist/es/components/Banner/Banner.d.ts +10 -2
- package/dist/es/components/Banner/Banner.js +35 -26
- package/dist/es/components/Banner/BannerDot.css +4 -11
- package/dist/es/components/Banner/BannerDot.d.ts +3 -0
- package/dist/es/components/Banner/BannerDot.js +8 -3
- package/dist/es/components/Button/Button.css +83 -74
- package/dist/es/components/Button/Button.d.ts +8 -2
- package/dist/es/components/Button/Button.js +16 -8
- package/dist/es/components/Calendar/Calendar.css +0 -7
- package/dist/es/components/Calendar/Calendar.js +2 -3
- package/dist/es/components/Calendar/components/Day/Day.css +10 -17
- package/dist/es/components/Calendar/components/Day/Day.js +1 -1
- package/dist/es/components/Calendar/components/Month/Month.css +3 -10
- package/dist/es/components/Calendar/components/Month/Month.js +21 -5
- package/dist/es/components/Carousel/Carousel.css +4 -11
- package/dist/es/components/Carousel/Carousel.d.ts +9 -2
- package/dist/es/components/Carousel/Carousel.js +28 -25
- package/dist/es/components/Checkbox/Checkbox.css +18 -25
- package/dist/es/components/Checkbox/Checkbox.d.ts +11 -27
- package/dist/es/components/Checkbox/Checkbox.js +77 -90
- package/dist/es/components/Collapse/Collapse.d.ts +15 -3
- package/dist/es/components/Collapse/Collapse.js +11 -4
- package/dist/es/components/ContentArea/ContentArea.css +18 -28
- package/dist/es/components/ContentArea/ContentArea.d.ts +2 -7
- package/dist/es/components/ContentArea/ContentArea.js +5 -39
- package/dist/es/components/Counter/Counter.css +14 -11
- package/dist/es/components/Counter/Counter.js +3 -3
- package/dist/es/components/Grid/GridColumn.css +0 -7
- package/dist/es/components/Header/Header.css +8 -12
- package/dist/es/components/Header/Header.d.ts +7 -21
- package/dist/es/components/Header/Header.js +31 -67
- package/dist/es/components/InputLabel/InputLabel.css +0 -7
- package/dist/es/components/InputLabel/InputLabel.d.ts +3 -0
- package/dist/es/components/InputLabel/InputLabel.js +9 -4
- package/dist/es/components/Link/Link.d.ts +3 -3
- package/dist/es/components/Link/Link.js +32 -21
- package/dist/es/components/List/List.css +9 -13
- package/dist/es/components/List/List.d.ts +1 -1
- package/dist/es/components/List/List.js +2 -2
- package/dist/es/components/List/ListItem.css +0 -7
- package/dist/es/components/Logo/Logo.css +0 -7
- package/dist/es/components/Logo/Logo.js +4 -8
- package/dist/es/components/NavArrow/NavArrow.css +5 -12
- package/dist/es/components/Notification/Notification.css +41 -24
- package/dist/es/components/Notification/Notification.d.ts +8 -0
- package/dist/es/components/Notification/Notification.js +21 -4
- package/dist/es/components/Pagination/Pagination.css +0 -7
- package/dist/es/components/Pagination/Pagination.d.ts +9 -2
- package/dist/es/components/Pagination/Pagination.js +20 -3
- package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.css +9 -9
- package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.d.ts +6 -3
- package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.js +12 -7
- package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.d.ts +5 -2
- package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.js +10 -2
- package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.d.ts +5 -2
- package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.js +6 -1
- package/dist/es/components/Pagination/helpers.d.ts +1 -1
- package/dist/es/components/Paragraph/Paragraph.css +10 -31
- package/dist/es/components/Paragraph/Paragraph.d.ts +9 -13
- package/dist/es/components/Paragraph/Paragraph.js +14 -40
- package/dist/es/components/Preloader/Preloader.css +5 -12
- package/dist/es/components/Preloader/Preloader.d.ts +4 -0
- package/dist/es/components/Preloader/Preloader.js +10 -5
- package/dist/es/components/RadioButton/RadioButton.css +7 -14
- package/dist/es/components/RadioButton/RadioButton.d.ts +8 -28
- package/dist/es/components/RadioButton/RadioButton.js +50 -85
- package/dist/es/components/Search/Search.css +20 -25
- package/dist/es/components/Search/Search.js +3 -4
- package/dist/es/components/Select/Select.css +34 -37
- package/dist/es/components/Select/Select.d.ts +43 -50
- package/dist/es/components/Select/Select.js +382 -461
- package/dist/es/components/Select/reducer/selectReducer.d.ts +34 -0
- package/dist/es/components/Select/reducer/selectReducer.js +123 -0
- package/dist/es/components/Switcher/Switcher.css +18 -28
- package/dist/es/components/Switcher/Switcher.js +1 -1
- package/dist/es/components/Tabs/Tab.d.ts +5 -2
- package/dist/es/components/Tabs/Tab.js +4 -2
- package/dist/es/components/Tabs/Tabs.css +30 -37
- package/dist/es/components/Tabs/Tabs.d.ts +8 -0
- package/dist/es/components/Tabs/Tabs.js +38 -31
- package/dist/es/components/TextField/TextField.css +27 -33
- package/dist/es/components/TextField/TextField.d.ts +9 -3
- package/dist/es/components/TextField/TextField.js +32 -24
- package/dist/es/components/TextLink/TextLink.css +10 -14
- package/dist/es/components/TextLink/TextLink.d.ts +1 -1
- package/dist/es/components/TextLink/TextLink.js +7 -2
- package/dist/es/components/Tile/Tile.css +2 -8
- package/dist/es/components/Tile/Tile.d.ts +5 -2
- package/dist/es/components/Tile/Tile.js +2 -2
- package/dist/es/components/Tooltip/Tooltip.css +1 -8
- package/dist/es/components/Tooltip/Tooltip.d.ts +8 -2
- package/dist/es/components/Tooltip/Tooltip.js +28 -27
- package/dist/es/index.d.ts +1 -0
- package/dist/es/index.js +1 -0
- package/dist/lib/colors/ColorItem/ColorItem.css +1 -8
- package/dist/lib/colors/ColorItem/ColorItem.js +1 -1
- package/dist/lib/colors/Colors.css +3 -11
- package/dist/lib/colors/Colors.d.ts +2 -2
- package/dist/lib/colors/Colors.js +63 -4
- package/dist/lib/colors/colorsData.js +78 -71
- package/dist/lib/components/Accordion/Accordion.css +7 -27
- package/dist/lib/components/Accordion/Accordion.d.ts +12 -7
- package/dist/lib/components/Accordion/Accordion.js +24 -19
- package/dist/lib/components/Banner/Banner.css +2 -37
- package/dist/lib/components/Banner/Banner.d.ts +10 -2
- package/dist/lib/components/Banner/Banner.js +35 -25
- package/dist/lib/components/Banner/BannerDot.css +4 -11
- package/dist/lib/components/Banner/BannerDot.d.ts +3 -0
- package/dist/lib/components/Banner/BannerDot.js +10 -2
- package/dist/lib/components/Button/Button.css +83 -74
- package/dist/lib/components/Button/Button.d.ts +8 -2
- package/dist/lib/components/Button/Button.js +16 -8
- package/dist/lib/components/Calendar/Calendar.css +0 -7
- package/dist/lib/components/Calendar/Calendar.js +3 -3
- package/dist/lib/components/Calendar/components/Day/Day.css +10 -17
- package/dist/lib/components/Calendar/components/Day/Day.js +1 -1
- package/dist/lib/components/Calendar/components/Month/Month.css +3 -10
- package/dist/lib/components/Calendar/components/Month/Month.js +20 -4
- package/dist/lib/components/Carousel/Carousel.css +4 -11
- package/dist/lib/components/Carousel/Carousel.d.ts +9 -2
- package/dist/lib/components/Carousel/Carousel.js +26 -23
- package/dist/lib/components/Checkbox/Checkbox.css +18 -25
- package/dist/lib/components/Checkbox/Checkbox.d.ts +11 -27
- package/dist/lib/components/Checkbox/Checkbox.js +82 -125
- package/dist/lib/components/Collapse/Collapse.d.ts +15 -3
- package/dist/lib/components/Collapse/Collapse.js +13 -4
- package/dist/lib/components/ContentArea/ContentArea.css +18 -28
- package/dist/lib/components/ContentArea/ContentArea.d.ts +2 -7
- package/dist/lib/components/ContentArea/ContentArea.js +5 -42
- package/dist/lib/components/Counter/Counter.css +14 -11
- package/dist/lib/components/Counter/Counter.js +3 -3
- package/dist/lib/components/Grid/GridColumn.css +0 -7
- package/dist/lib/components/Header/Header.css +8 -12
- package/dist/lib/components/Header/Header.d.ts +7 -21
- package/dist/lib/components/Header/Header.js +31 -98
- package/dist/lib/components/InputLabel/InputLabel.css +0 -7
- package/dist/lib/components/InputLabel/InputLabel.d.ts +3 -0
- package/dist/lib/components/InputLabel/InputLabel.js +11 -3
- package/dist/lib/components/Link/Link.d.ts +3 -3
- package/dist/lib/components/Link/Link.js +44 -26
- package/dist/lib/components/List/List.css +9 -13
- package/dist/lib/components/List/List.d.ts +1 -1
- package/dist/lib/components/List/List.js +2 -2
- package/dist/lib/components/List/ListItem.css +0 -7
- package/dist/lib/components/Logo/Logo.css +0 -7
- package/dist/lib/components/Logo/Logo.js +4 -8
- package/dist/lib/components/NavArrow/NavArrow.css +5 -12
- package/dist/lib/components/Notification/Notification.css +41 -24
- package/dist/lib/components/Notification/Notification.d.ts +8 -0
- package/dist/lib/components/Notification/Notification.js +20 -3
- package/dist/lib/components/Pagination/Pagination.css +0 -7
- package/dist/lib/components/Pagination/Pagination.d.ts +9 -2
- package/dist/lib/components/Pagination/Pagination.js +20 -2
- package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.css +9 -9
- package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.d.ts +6 -3
- package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.js +12 -6
- package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.d.ts +5 -2
- package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.js +9 -1
- package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.d.ts +5 -2
- package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.js +6 -1
- package/dist/lib/components/Pagination/helpers.d.ts +1 -1
- package/dist/lib/components/Paragraph/Paragraph.css +10 -31
- package/dist/lib/components/Paragraph/Paragraph.d.ts +9 -13
- package/dist/lib/components/Paragraph/Paragraph.js +15 -41
- package/dist/lib/components/Preloader/Preloader.css +5 -12
- package/dist/lib/components/Preloader/Preloader.d.ts +4 -0
- package/dist/lib/components/Preloader/Preloader.js +10 -4
- package/dist/lib/components/RadioButton/RadioButton.css +7 -14
- package/dist/lib/components/RadioButton/RadioButton.d.ts +8 -28
- package/dist/lib/components/RadioButton/RadioButton.js +51 -117
- package/dist/lib/components/Search/Search.css +20 -25
- package/dist/lib/components/Search/Search.js +3 -4
- package/dist/lib/components/Select/Select.css +34 -37
- package/dist/lib/components/Select/Select.d.ts +43 -50
- package/dist/lib/components/Select/Select.js +375 -483
- package/dist/lib/components/Select/reducer/selectReducer.d.ts +34 -0
- package/dist/lib/components/Select/reducer/selectReducer.js +136 -0
- package/dist/lib/components/Switcher/Switcher.css +18 -28
- package/dist/lib/components/Switcher/Switcher.js +1 -1
- package/dist/lib/components/Tabs/Tab.d.ts +5 -2
- package/dist/lib/components/Tabs/Tab.js +4 -2
- package/dist/lib/components/Tabs/Tabs.css +30 -37
- package/dist/lib/components/Tabs/Tabs.d.ts +8 -0
- package/dist/lib/components/Tabs/Tabs.js +38 -31
- package/dist/lib/components/TextField/TextField.css +27 -33
- package/dist/lib/components/TextField/TextField.d.ts +9 -3
- package/dist/lib/components/TextField/TextField.js +30 -23
- package/dist/lib/components/TextLink/TextLink.css +10 -14
- package/dist/lib/components/TextLink/TextLink.d.ts +1 -1
- package/dist/lib/components/TextLink/TextLink.js +7 -2
- package/dist/lib/components/Tile/Tile.css +2 -8
- package/dist/lib/components/Tile/Tile.d.ts +5 -2
- package/dist/lib/components/Tile/Tile.js +2 -2
- package/dist/lib/components/Tooltip/Tooltip.css +1 -8
- package/dist/lib/components/Tooltip/Tooltip.d.ts +8 -2
- package/dist/lib/components/Tooltip/Tooltip.js +27 -26
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.js +8 -0
- package/package.json +5 -4
- package/styles/base.less +2 -73
- package/styles/colors.css +60 -0
- package/styles/colorsDark.css +62 -0
|
@@ -1,27 +1,15 @@
|
|
|
1
|
-
import "core-js/modules/es.array.concat";
|
|
2
|
-
import "core-js/modules/es.array.includes";
|
|
3
1
|
import "core-js/modules/es.object.values";
|
|
4
|
-
import "
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
5
3
|
import * as React from 'react';
|
|
6
|
-
import { cnCreate } from '@megafon/ui-helpers';
|
|
4
|
+
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
|
7
5
|
import * as PropTypes from 'prop-types';
|
|
8
6
|
import "./Paragraph.css";
|
|
9
7
|
var COLORS = {
|
|
10
|
-
GREEN: 'green',
|
|
11
|
-
PURPLE: 'purple',
|
|
12
|
-
BASE: 'base',
|
|
13
|
-
SPB_SKY_0: 'spbSky0',
|
|
14
|
-
SPB_SKY_1: 'spbSky1',
|
|
15
|
-
SPB_SKY_2: 'spbSky2',
|
|
16
|
-
CONTENT: 'content',
|
|
17
|
-
FULL_BLACK: 'fullBlack',
|
|
18
8
|
INHERIT: 'inherit',
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
/** @deprecated */
|
|
24
|
-
FRESH_ASPHALT: 'freshAsphalt'
|
|
9
|
+
DEFAULT: 'default',
|
|
10
|
+
WHITE: 'white',
|
|
11
|
+
GREEN: 'green',
|
|
12
|
+
PURPLE: 'purple'
|
|
25
13
|
};
|
|
26
14
|
var cn = cnCreate('mfui-paragraph');
|
|
27
15
|
|
|
@@ -30,43 +18,29 @@ var Paragraph = function Paragraph(_ref) {
|
|
|
30
18
|
size = _ref$size === void 0 ? 'regular' : _ref$size,
|
|
31
19
|
align = _ref.align,
|
|
32
20
|
_ref$color = _ref.color,
|
|
33
|
-
color = _ref$color === void 0 ?
|
|
21
|
+
color = _ref$color === void 0 ? COLORS.DEFAULT : _ref$color,
|
|
34
22
|
className = _ref.className,
|
|
35
23
|
_ref$hasMargin = _ref.hasMargin,
|
|
36
24
|
hasMargin = _ref$hasMargin === void 0 ? true : _ref$hasMargin,
|
|
25
|
+
dataAttrs = _ref.dataAttrs,
|
|
37
26
|
children = _ref.children;
|
|
38
|
-
return /*#__PURE__*/React.createElement("p", {
|
|
27
|
+
return /*#__PURE__*/React.createElement("p", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
39
28
|
className: cn({
|
|
40
29
|
size: size,
|
|
41
30
|
align: align,
|
|
42
31
|
color: color,
|
|
43
32
|
'has-margin': hasMargin
|
|
44
33
|
}, className)
|
|
45
|
-
}, children);
|
|
34
|
+
}), children);
|
|
46
35
|
};
|
|
47
36
|
|
|
48
37
|
Paragraph.propTypes = {
|
|
38
|
+
dataAttrs: PropTypes.shape({
|
|
39
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
|
40
|
+
}),
|
|
49
41
|
align: PropTypes.oneOf(['left', 'center', 'right']),
|
|
50
42
|
size: PropTypes.oneOf(['regular', 'small']),
|
|
51
43
|
hasMargin: PropTypes.bool,
|
|
52
|
-
color:
|
|
53
|
-
var deprecatedBlackValue = COLORS.FRESH_ASPHALT;
|
|
54
|
-
var deprecatedWhiteValue = COLORS.CLEAR_WHITE;
|
|
55
|
-
var propValue = props[propName];
|
|
56
|
-
|
|
57
|
-
if (propValue && !Object.values(COLORS).includes(propValue)) {
|
|
58
|
-
return new Error("Failed prop type: Invalid prop '".concat(propName, "' of value '").concat(propValue, "' supplied to '").concat(componentName, "', \n expected one of [").concat(Object.values(COLORS), "]"));
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (propValue && props[propName] === deprecatedBlackValue) {
|
|
62
|
-
return new Error("Failed prop type: Invalid prop '".concat(propName, "' of value '").concat(propValue, "' supplied to '").concat(componentName, "',\n value '").concat(deprecatedBlackValue, "' is deprecated, please use value '").concat(COLORS.CONTENT, "'"));
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
if (propValue && props[propName] === deprecatedWhiteValue) {
|
|
66
|
-
return new Error("Failed prop type: Invalid prop '".concat(propName, "' of value '").concat(propValue, "' supplied to '").concat(componentName, "',\n value '").concat(deprecatedWhiteValue, "' is deprecated, please use value '").concat(COLORS.BASE, "'"));
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return null;
|
|
70
|
-
}
|
|
44
|
+
color: PropTypes.oneOf(Object.values(COLORS))
|
|
71
45
|
};
|
|
72
46
|
export default Paragraph;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
h1,
|
|
2
|
-
h2,
|
|
3
|
-
h3,
|
|
4
|
-
h4,
|
|
5
|
-
h5 {
|
|
6
|
-
margin: 0;
|
|
7
|
-
}
|
|
8
1
|
.mfui-preloader {
|
|
9
2
|
display: -webkit-box;
|
|
10
3
|
display: -ms-flexbox;
|
|
@@ -106,20 +99,20 @@ h5 {
|
|
|
106
99
|
animation: scaling 1s linear infinite;
|
|
107
100
|
}
|
|
108
101
|
.mfui-preloader_color_default .mfui-preloader__item_first:before {
|
|
109
|
-
background-color:
|
|
102
|
+
background-color: var(--brandGreen);
|
|
110
103
|
}
|
|
111
104
|
.mfui-preloader_color_default .mfui-preloader__item_second:before {
|
|
112
|
-
background-color:
|
|
105
|
+
background-color: var(--brandGreen);
|
|
113
106
|
-webkit-animation-delay: 0.166s;
|
|
114
107
|
animation-delay: 0.166s;
|
|
115
108
|
}
|
|
116
109
|
.mfui-preloader_color_default .mfui-preloader__item_third:before {
|
|
117
|
-
background-color:
|
|
110
|
+
background-color: var(--brandPurple);
|
|
118
111
|
-webkit-animation-delay: 0.33s;
|
|
119
112
|
animation-delay: 0.33s;
|
|
120
113
|
}
|
|
121
114
|
.mfui-preloader_color_black .mfui-preloader__item:before {
|
|
122
|
-
background-color:
|
|
115
|
+
background-color: var(--stcBlack);
|
|
123
116
|
opacity: 0.35;
|
|
124
117
|
-webkit-animation: opacityScaling 1s linear infinite;
|
|
125
118
|
animation: opacityScaling 1s linear infinite;
|
|
@@ -133,7 +126,7 @@ h5 {
|
|
|
133
126
|
animation-delay: 0.33s;
|
|
134
127
|
}
|
|
135
128
|
.mfui-preloader_color_white .mfui-preloader__item:before {
|
|
136
|
-
background-color:
|
|
129
|
+
background-color: var(--stcWhite);
|
|
137
130
|
-webkit-animation: scaling 1s linear infinite;
|
|
138
131
|
animation: scaling 1s linear infinite;
|
|
139
132
|
}
|
|
@@ -26,6 +26,10 @@ export interface IPreloaderProps {
|
|
|
26
26
|
sizeMobile?: PreloaderSizesType;
|
|
27
27
|
/** Дополнительный класс корневого элемента */
|
|
28
28
|
className?: string;
|
|
29
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
|
30
|
+
dataAttrs?: {
|
|
31
|
+
root?: Record<string, string>;
|
|
32
|
+
};
|
|
29
33
|
}
|
|
30
34
|
declare const Preloader: React.FC<IPreloaderProps>;
|
|
31
35
|
export default Preloader;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import "core-js/modules/es.object.values";
|
|
2
2
|
import "core-js/modules/web.timers";
|
|
3
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
4
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
5
|
import * as React from 'react';
|
|
5
|
-
import { cnCreate } from '@megafon/ui-helpers';
|
|
6
|
+
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
|
6
7
|
import * as PropTypes from 'prop-types';
|
|
7
8
|
import "./Preloader.css";
|
|
8
9
|
export var PreloaderColors = {
|
|
@@ -25,7 +26,8 @@ var Preloader = function Preloader(_ref) {
|
|
|
25
26
|
sizeDesktop = _ref.sizeDesktop,
|
|
26
27
|
sizeTablet = _ref.sizeTablet,
|
|
27
28
|
sizeMobile = _ref.sizeMobile,
|
|
28
|
-
className = _ref.className
|
|
29
|
+
className = _ref.className,
|
|
30
|
+
dataAttrs = _ref.dataAttrs;
|
|
29
31
|
|
|
30
32
|
var _React$useState = React.useState(false),
|
|
31
33
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -40,7 +42,7 @@ var Preloader = function Preloader(_ref) {
|
|
|
40
42
|
clearTimeout(timerId);
|
|
41
43
|
};
|
|
42
44
|
}, []);
|
|
43
|
-
return isShowed ? /*#__PURE__*/React.createElement("div", {
|
|
45
|
+
return isShowed ? /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
44
46
|
className: cn({
|
|
45
47
|
color: color,
|
|
46
48
|
'size-all': sizeAll,
|
|
@@ -49,7 +51,7 @@ var Preloader = function Preloader(_ref) {
|
|
|
49
51
|
'size-tablet': sizeTablet,
|
|
50
52
|
'size-mobile': sizeMobile
|
|
51
53
|
}, className)
|
|
52
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
54
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
53
55
|
className: cn('item', {
|
|
54
56
|
first: true
|
|
55
57
|
})
|
|
@@ -71,6 +73,9 @@ Preloader.propTypes = {
|
|
|
71
73
|
sizeDesktop: PropTypes.oneOf(Object.values(PreloaderSizes)),
|
|
72
74
|
sizeTablet: PropTypes.oneOf(Object.values(PreloaderSizes)),
|
|
73
75
|
sizeMobile: PropTypes.oneOf(Object.values(PreloaderSizes)),
|
|
74
|
-
className: PropTypes.string
|
|
76
|
+
className: PropTypes.string,
|
|
77
|
+
dataAttrs: PropTypes.shape({
|
|
78
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
|
79
|
+
})
|
|
75
80
|
};
|
|
76
81
|
export default Preloader;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
h1,
|
|
2
|
-
h2,
|
|
3
|
-
h3,
|
|
4
|
-
h4,
|
|
5
|
-
h5 {
|
|
6
|
-
margin: 0;
|
|
7
|
-
}
|
|
8
1
|
.mfui-radio-button__input {
|
|
9
2
|
position: absolute;
|
|
10
3
|
top: 0;
|
|
@@ -48,22 +41,22 @@ h5 {
|
|
|
48
41
|
box-sizing: border-box;
|
|
49
42
|
width: 20px;
|
|
50
43
|
height: 20px;
|
|
51
|
-
border: 2px solid
|
|
44
|
+
border: 2px solid var(--spbSky2);
|
|
52
45
|
border-radius: 50%;
|
|
53
|
-
background-color:
|
|
46
|
+
background-color: var(--base);
|
|
54
47
|
}
|
|
55
48
|
.mfui-radio-button__input:checked + .mfui-radio-button__custom-input:before {
|
|
56
|
-
border: 6px solid
|
|
49
|
+
border: 6px solid var(--brandGreen);
|
|
57
50
|
}
|
|
58
51
|
.mfui-radio-button__label:hover .mfui-radio-button__custom-input:before {
|
|
59
|
-
border-color:
|
|
52
|
+
border-color: var(--buttonHoverGreen);
|
|
60
53
|
}
|
|
61
54
|
.mfui-radio-button__label:active .mfui-radio-button__custom-input:before {
|
|
62
|
-
border-color:
|
|
55
|
+
border-color: var(--buttonDown);
|
|
63
56
|
}
|
|
64
57
|
.mfui-radio-button__label_disabled .mfui-radio-button__custom-input:before {
|
|
65
|
-
border-color:
|
|
66
|
-
background-color:
|
|
58
|
+
border-color: var(--spbSky2) !important;
|
|
59
|
+
background-color: var(--spbSky1) !important;
|
|
67
60
|
}
|
|
68
61
|
.mfui-radio-button__text_size_small {
|
|
69
62
|
font-size: 12px;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { IFilterDataAttrs } from '@megafon/ui-helpers';
|
|
3
|
-
import * as PropTypes from 'prop-types';
|
|
4
2
|
import './RadioButton.less';
|
|
5
|
-
export interface IRadioButtonProps
|
|
3
|
+
export interface IRadioButtonProps {
|
|
6
4
|
/** Значение */
|
|
7
5
|
value: string;
|
|
8
6
|
/** Имя для тега form */
|
|
@@ -22,35 +20,17 @@ export interface IRadioButtonProps extends IFilterDataAttrs {
|
|
|
22
20
|
customInput?: string;
|
|
23
21
|
labelText?: string;
|
|
24
22
|
};
|
|
23
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
|
24
|
+
dataAttrs?: {
|
|
25
|
+
root?: Record<string, string>;
|
|
26
|
+
input?: Record<string, string>;
|
|
27
|
+
text?: Record<string, string>;
|
|
28
|
+
};
|
|
25
29
|
children?: React.ReactNode;
|
|
26
30
|
/** Обработчик изменения значения 'value' */
|
|
27
31
|
onChange?: (value: string) => void;
|
|
28
32
|
/** Ссылка на input */
|
|
29
33
|
inputRef?: React.Ref<HTMLInputElement>;
|
|
30
34
|
}
|
|
31
|
-
declare
|
|
32
|
-
static propTypes: {
|
|
33
|
-
value: PropTypes.Validator<string>;
|
|
34
|
-
name: PropTypes.Requireable<string>;
|
|
35
|
-
textSize: PropTypes.Requireable<string>;
|
|
36
|
-
disabled: PropTypes.Requireable<boolean>;
|
|
37
|
-
isChecked: PropTypes.Requireable<boolean>;
|
|
38
|
-
className: PropTypes.Requireable<string>;
|
|
39
|
-
classes: PropTypes.Requireable<PropTypes.InferProps<{
|
|
40
|
-
root: PropTypes.Requireable<string>;
|
|
41
|
-
label: PropTypes.Requireable<string>;
|
|
42
|
-
customInput: PropTypes.Requireable<string>;
|
|
43
|
-
labelText: PropTypes.Requireable<string>;
|
|
44
|
-
}>>;
|
|
45
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
46
|
-
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
47
|
-
inputRef: PropTypes.Requireable<any>;
|
|
48
|
-
dataAttrs: PropTypes.Requireable<{
|
|
49
|
-
[x: string]: string;
|
|
50
|
-
}>;
|
|
51
|
-
};
|
|
52
|
-
static defaultProps: Partial<IRadioButtonProps>;
|
|
53
|
-
handleChange: () => void;
|
|
54
|
-
render(): JSX.Element;
|
|
55
|
-
}
|
|
35
|
+
declare const RadioButton: React.FC<IRadioButtonProps>;
|
|
56
36
|
export default RadioButton;
|
|
@@ -1,95 +1,60 @@
|
|
|
1
1
|
import "core-js/modules/es.array.concat";
|
|
2
2
|
import "core-js/modules/es.array.is-array";
|
|
3
|
-
import "core-js/modules/es.date.to-string";
|
|
4
3
|
import "core-js/modules/es.function.name";
|
|
5
|
-
import "core-js/modules/es.object.to-string";
|
|
6
|
-
import "core-js/modules/es.reflect.construct";
|
|
7
|
-
import "core-js/modules/es.regexp.to-string";
|
|
8
4
|
import _extends from "@babel/runtime/helpers/extends";
|
|
9
5
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
10
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
11
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
12
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
13
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
14
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
15
|
-
|
|
16
|
-
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); }; }
|
|
17
|
-
|
|
18
|
-
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; } }
|
|
19
|
-
|
|
20
6
|
import * as React from 'react';
|
|
21
7
|
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
|
22
8
|
import * as PropTypes from 'prop-types';
|
|
23
9
|
import "./RadioButton.css";
|
|
24
10
|
var cn = cnCreate('mfui-radio-button');
|
|
25
11
|
|
|
26
|
-
var RadioButton =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
12
|
+
var RadioButton = function RadioButton(_ref) {
|
|
13
|
+
var isChecked = _ref.isChecked,
|
|
14
|
+
_ref$disabled = _ref.disabled,
|
|
15
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
16
|
+
name = _ref.name,
|
|
17
|
+
value = _ref.value,
|
|
18
|
+
_ref$textSize = _ref.textSize,
|
|
19
|
+
textSize = _ref$textSize === void 0 ? 'medium' : _ref$textSize,
|
|
20
|
+
children = _ref.children,
|
|
21
|
+
inputRef = _ref.inputRef,
|
|
22
|
+
className = _ref.className,
|
|
23
|
+
_ref$classes = _ref.classes,
|
|
24
|
+
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
|
25
|
+
dataAttrs = _ref.dataAttrs,
|
|
26
|
+
onChange = _ref.onChange;
|
|
27
|
+
var checkedProp = isChecked !== undefined ? {
|
|
28
|
+
checked: isChecked
|
|
29
|
+
} : {};
|
|
30
|
+
var rootClassNames = Array.isArray(className) ? [].concat(_toConsumableArray(className), [classes.root]) : [className, classes.root];
|
|
35
31
|
|
|
36
|
-
|
|
32
|
+
var handleChange = function handleChange() {
|
|
33
|
+
return onChange && onChange(value);
|
|
34
|
+
};
|
|
37
35
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
_this$props2$classes = _this$props2.classes,
|
|
61
|
-
classes = _this$props2$classes === void 0 ? {} : _this$props2$classes,
|
|
62
|
-
dataAttrs = _this$props2.dataAttrs;
|
|
63
|
-
var checkedProp = isChecked !== undefined ? {
|
|
64
|
-
checked: isChecked
|
|
65
|
-
} : {};
|
|
66
|
-
var rootClassNames = Array.isArray(className) ? [].concat(_toConsumableArray(className), [classes.root]) : [className, classes.root];
|
|
67
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
68
|
-
className: cn(rootClassNames)
|
|
69
|
-
}, filterDataAttrs(dataAttrs)), /*#__PURE__*/React.createElement("label", {
|
|
70
|
-
className: cn('label', {
|
|
71
|
-
disabled: disabled
|
|
72
|
-
}, classes.label)
|
|
73
|
-
}, /*#__PURE__*/React.createElement("input", _extends({}, checkedProp, {
|
|
74
|
-
className: cn('input'),
|
|
75
|
-
type: "radio",
|
|
76
|
-
name: name,
|
|
77
|
-
value: value,
|
|
78
|
-
onChange: this.handleChange,
|
|
79
|
-
disabled: disabled,
|
|
80
|
-
ref: inputRef
|
|
81
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
82
|
-
className: cn('custom-input', classes.customInput)
|
|
83
|
-
}), children && /*#__PURE__*/React.createElement("div", {
|
|
84
|
-
className: cn('text', {
|
|
85
|
-
size: textSize
|
|
86
|
-
}, classes.labelText)
|
|
87
|
-
}, children)));
|
|
88
|
-
}
|
|
89
|
-
}]);
|
|
90
|
-
|
|
91
|
-
return RadioButton;
|
|
92
|
-
}(React.Component);
|
|
36
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
37
|
+
className: cn(rootClassNames)
|
|
38
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), /*#__PURE__*/React.createElement("label", {
|
|
39
|
+
className: cn('label', {
|
|
40
|
+
disabled: disabled
|
|
41
|
+
}, classes.label)
|
|
42
|
+
}, /*#__PURE__*/React.createElement("input", _extends({}, checkedProp, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.input), {
|
|
43
|
+
className: cn('input'),
|
|
44
|
+
type: "radio",
|
|
45
|
+
name: name,
|
|
46
|
+
value: value,
|
|
47
|
+
onChange: handleChange,
|
|
48
|
+
disabled: disabled,
|
|
49
|
+
ref: inputRef
|
|
50
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
51
|
+
className: cn('custom-input', classes.customInput)
|
|
52
|
+
}), children && /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.text), {
|
|
53
|
+
className: cn('text', {
|
|
54
|
+
size: textSize
|
|
55
|
+
}, classes.labelText)
|
|
56
|
+
}), children)));
|
|
57
|
+
};
|
|
93
58
|
|
|
94
59
|
RadioButton.propTypes = {
|
|
95
60
|
value: PropTypes.string.isRequired,
|
|
@@ -104,15 +69,15 @@ RadioButton.propTypes = {
|
|
|
104
69
|
customInput: PropTypes.string,
|
|
105
70
|
labelText: PropTypes.string
|
|
106
71
|
}),
|
|
72
|
+
dataAttrs: PropTypes.shape({
|
|
73
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
74
|
+
input: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
75
|
+
text: PropTypes.objectOf(PropTypes.string.isRequired)
|
|
76
|
+
}),
|
|
107
77
|
children: PropTypes.node,
|
|
108
78
|
onChange: PropTypes.func,
|
|
109
79
|
inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
|
|
110
80
|
current: PropTypes.elementType
|
|
111
|
-
}), PropTypes.any])])
|
|
112
|
-
dataAttrs: PropTypes.objectOf(PropTypes.string.isRequired)
|
|
113
|
-
};
|
|
114
|
-
RadioButton.defaultProps = {
|
|
115
|
-
textSize: 'medium',
|
|
116
|
-
disabled: false
|
|
81
|
+
}), PropTypes.any])])
|
|
117
82
|
};
|
|
118
83
|
export default RadioButton;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
h1,
|
|
2
|
-
h2,
|
|
3
|
-
h3,
|
|
4
|
-
h4,
|
|
5
|
-
h5 {
|
|
6
|
-
margin: 0;
|
|
7
|
-
}
|
|
8
1
|
.mfui-search {
|
|
9
2
|
font-family: inherit;
|
|
10
3
|
font-size: 15px;
|
|
@@ -12,11 +5,11 @@ h5 {
|
|
|
12
5
|
position: relative;
|
|
13
6
|
z-index: auto;
|
|
14
7
|
min-height: 40px;
|
|
15
|
-
color:
|
|
8
|
+
color: var(--content);
|
|
16
9
|
}
|
|
17
10
|
.mfui-search__require-mark {
|
|
18
11
|
margin-left: 1px;
|
|
19
|
-
color:
|
|
12
|
+
color: var(--fury);
|
|
20
13
|
font-size: 20px;
|
|
21
14
|
line-height: 0;
|
|
22
15
|
}
|
|
@@ -31,8 +24,8 @@ h5 {
|
|
|
31
24
|
width: 100%;
|
|
32
25
|
height: 48px;
|
|
33
26
|
padding: 0 16px 0 20px;
|
|
34
|
-
border: 1px solid
|
|
35
|
-
background-color:
|
|
27
|
+
border: 1px solid var(--spbSky2);
|
|
28
|
+
background-color: var(--base);
|
|
36
29
|
outline: none;
|
|
37
30
|
cursor: pointer;
|
|
38
31
|
-webkit-user-select: none;
|
|
@@ -41,7 +34,7 @@ h5 {
|
|
|
41
34
|
user-select: none;
|
|
42
35
|
}
|
|
43
36
|
.mfui-search__control_error {
|
|
44
|
-
border-color:
|
|
37
|
+
border-color: var(--fury);
|
|
45
38
|
}
|
|
46
39
|
.mfui-search__search-field {
|
|
47
40
|
position: relative;
|
|
@@ -56,6 +49,7 @@ h5 {
|
|
|
56
49
|
border: none;
|
|
57
50
|
border-radius: 0;
|
|
58
51
|
overflow: auto;
|
|
52
|
+
color: var(--content);
|
|
59
53
|
font-family: inherit;
|
|
60
54
|
line-height: 25px;
|
|
61
55
|
background-color: transparent;
|
|
@@ -79,7 +73,7 @@ h5 {
|
|
|
79
73
|
left: -1px;
|
|
80
74
|
z-index: 0;
|
|
81
75
|
display: none;
|
|
82
|
-
background-color:
|
|
76
|
+
background-color: var(--base);
|
|
83
77
|
-webkit-box-shadow: 0 1px 16px rgba(0, 0, 0, 0.2);
|
|
84
78
|
box-shadow: 0 1px 16px rgba(0, 0, 0, 0.2);
|
|
85
79
|
}
|
|
@@ -91,7 +85,7 @@ h5 {
|
|
|
91
85
|
-moz-user-select: none;
|
|
92
86
|
-ms-user-select: none;
|
|
93
87
|
user-select: none;
|
|
94
|
-
fill:
|
|
88
|
+
fill: var(--content);
|
|
95
89
|
}
|
|
96
90
|
.mfui-search__icon-box {
|
|
97
91
|
display: -webkit-box;
|
|
@@ -105,6 +99,7 @@ h5 {
|
|
|
105
99
|
justify-content: center;
|
|
106
100
|
height: 100%;
|
|
107
101
|
text-align: center;
|
|
102
|
+
fill: var(--content);
|
|
108
103
|
}
|
|
109
104
|
.mfui-search__list-inner {
|
|
110
105
|
-webkit-box-sizing: border-box;
|
|
@@ -116,11 +111,11 @@ h5 {
|
|
|
116
111
|
.mfui-search__list-item {
|
|
117
112
|
font-family: inherit;
|
|
118
113
|
padding: 8px 32px;
|
|
119
|
-
background-color:
|
|
114
|
+
background-color: var(--base);
|
|
120
115
|
cursor: pointer;
|
|
121
116
|
}
|
|
122
117
|
.mfui-search__list-item_active {
|
|
123
|
-
background-color:
|
|
118
|
+
background-color: var(--spbSky0);
|
|
124
119
|
}
|
|
125
120
|
.mfui-search__item-title {
|
|
126
121
|
position: relative;
|
|
@@ -137,23 +132,23 @@ h5 {
|
|
|
137
132
|
right: 0;
|
|
138
133
|
bottom: 0;
|
|
139
134
|
width: 40px;
|
|
140
|
-
background: -webkit-gradient(linear, left top, right top, from(rgba(255, 255, 255, 0)), to(
|
|
141
|
-
background: linear-gradient(to right, rgba(255, 255, 255, 0),
|
|
135
|
+
background: -webkit-gradient(linear, left top, right top, from(rgba(255, 255, 255, 0)), to(var(--base)));
|
|
136
|
+
background: linear-gradient(to right, rgba(255, 255, 255, 0), var(--base));
|
|
142
137
|
}
|
|
143
138
|
.mfui-search__list-item_active .mfui-search__item-title:after {
|
|
144
|
-
background: -webkit-gradient(linear, left top, right top, from(rgba(255, 255, 255, 0)), to(
|
|
145
|
-
background: linear-gradient(to right, rgba(255, 255, 255, 0),
|
|
139
|
+
background: -webkit-gradient(linear, left top, right top, from(rgba(255, 255, 255, 0)), to(var(--spbSky0)));
|
|
140
|
+
background: linear-gradient(to right, rgba(255, 255, 255, 0), var(--spbSky0));
|
|
146
141
|
}
|
|
147
142
|
.mfui-search_open .mfui-search__list {
|
|
148
143
|
display: block;
|
|
149
|
-
border-color:
|
|
144
|
+
border-color: var(--content);
|
|
150
145
|
}
|
|
151
146
|
.mfui-search_open {
|
|
152
147
|
z-index: 12;
|
|
153
148
|
}
|
|
154
149
|
.mfui-search_disabled .mfui-search__control {
|
|
155
|
-
border-color:
|
|
156
|
-
background-color:
|
|
150
|
+
border-color: var(--spbSky1);
|
|
151
|
+
background-color: var(--spbSky1);
|
|
157
152
|
cursor: default;
|
|
158
153
|
pointer-events: none;
|
|
159
154
|
}
|
|
@@ -169,8 +164,8 @@ h5 {
|
|
|
169
164
|
line-height: 16px;
|
|
170
165
|
}
|
|
171
166
|
.mfui-search__notice_error {
|
|
172
|
-
color:
|
|
167
|
+
color: var(--fury);
|
|
173
168
|
}
|
|
174
169
|
.mfui-search__notice_success {
|
|
175
|
-
color:
|
|
170
|
+
color: var(--brandGreen);
|
|
176
171
|
}
|
|
@@ -72,7 +72,7 @@ var Search = function Search(_ref) {
|
|
|
72
72
|
setActiveIndex(-1);
|
|
73
73
|
|
|
74
74
|
if (changeDelay === 0) {
|
|
75
|
-
onChange
|
|
75
|
+
onChange && onChange(inputValue);
|
|
76
76
|
} else {
|
|
77
77
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
78
78
|
// @ts-ignore
|
|
@@ -93,7 +93,7 @@ var Search = function Search(_ref) {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
var chosenValue = items[index].value;
|
|
96
|
-
onSubmit
|
|
96
|
+
onSubmit && onSubmit(chosenValue);
|
|
97
97
|
}, [disabled, items, onSubmit]);
|
|
98
98
|
var handleSelectSubmit = React.useCallback(function () {
|
|
99
99
|
return function () {
|
|
@@ -105,7 +105,7 @@ var Search = function Search(_ref) {
|
|
|
105
105
|
}, []);
|
|
106
106
|
var handleBlur = React.useCallback(function (e) {
|
|
107
107
|
setFocus(false);
|
|
108
|
-
onBlur
|
|
108
|
+
onBlur && onBlur(e);
|
|
109
109
|
}, [onBlur]);
|
|
110
110
|
var handleClick = React.useCallback(function () {
|
|
111
111
|
if (activeIndex >= 0) {
|
|
@@ -125,7 +125,6 @@ var Search = function Search(_ref) {
|
|
|
125
125
|
e.preventDefault();
|
|
126
126
|
} else if (e.key === 'Enter' && activeIndex > -1) {
|
|
127
127
|
handleItemSubmit(activeIndex);
|
|
128
|
-
e.preventDefault();
|
|
129
128
|
} else if (e.key === 'Enter' && activeIndex === -1) {
|
|
130
129
|
handleSearchSubmit();
|
|
131
130
|
}
|