@megafon/ui-core 4.0.0-beta.8 → 4.0.1
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 +72 -14
- package/dist/es/components/Accordion/Accordion.css +6 -4
- package/dist/es/components/Badges/components/PromoBadge/PromoBadge.css +4 -0
- package/dist/es/components/Badges/components/PromoBadge/PromoBadge.d.ts +1 -0
- package/dist/es/components/Badges/components/PromoBadge/PromoBadge.js +2 -1
- package/dist/es/components/Banner/Banner.css +3 -0
- package/dist/es/components/Banner/Banner.d.ts +2 -0
- package/dist/es/components/Banner/Banner.js +5 -1
- package/dist/es/components/Carousel/Carousel.d.ts +2 -0
- package/dist/es/components/Carousel/Carousel.js +7 -2
- package/dist/es/components/ContentArea/ContentArea.css +0 -10
- package/dist/es/components/ContentArea/ContentArea.d.ts +0 -1
- package/dist/es/components/ContentArea/ContentArea.js +1 -3
- package/dist/es/components/Header/Header.d.ts +1 -1
- package/dist/es/components/Header/Header.js +4 -4
- package/dist/es/components/List/List.d.ts +1 -1
- package/dist/es/components/List/List.js +3 -3
- package/dist/es/components/Notification/Notification.css +20 -7
- package/dist/es/components/Search/Search.css +24 -4
- package/dist/es/components/Search/Search.d.ts +6 -0
- package/dist/es/components/Search/Search.js +12 -3
- package/dist/es/components/Select/Select.css +50 -33
- package/dist/es/components/Select/Select.d.ts +7 -0
- package/dist/es/components/Select/Select.js +14 -5
- package/dist/es/components/Tabs/Tabs.css +12 -1
- package/dist/es/components/Tabs/Tabs.d.ts +3 -3
- package/dist/es/components/Tabs/Tabs.js +8 -6
- package/dist/es/components/TextField/TextField.css +33 -20
- package/dist/es/components/TextField/TextField.d.ts +2 -0
- package/dist/es/components/TextField/TextField.js +14 -9
- package/dist/lib/components/Accordion/Accordion.css +6 -4
- package/dist/lib/components/Badges/components/PromoBadge/PromoBadge.css +4 -0
- package/dist/lib/components/Badges/components/PromoBadge/PromoBadge.d.ts +1 -0
- package/dist/lib/components/Badges/components/PromoBadge/PromoBadge.js +2 -1
- package/dist/lib/components/Banner/Banner.css +3 -0
- package/dist/lib/components/Banner/Banner.d.ts +2 -0
- package/dist/lib/components/Banner/Banner.js +5 -1
- package/dist/lib/components/Carousel/Carousel.d.ts +2 -0
- package/dist/lib/components/Carousel/Carousel.js +7 -2
- package/dist/lib/components/ContentArea/ContentArea.css +0 -10
- package/dist/lib/components/ContentArea/ContentArea.d.ts +0 -1
- package/dist/lib/components/ContentArea/ContentArea.js +1 -3
- package/dist/lib/components/Header/Header.d.ts +1 -1
- package/dist/lib/components/Header/Header.js +4 -4
- package/dist/lib/components/List/List.d.ts +1 -1
- package/dist/lib/components/List/List.js +3 -3
- package/dist/lib/components/Notification/Notification.css +20 -7
- package/dist/lib/components/Search/Search.css +24 -4
- package/dist/lib/components/Search/Search.d.ts +6 -0
- package/dist/lib/components/Search/Search.js +15 -4
- package/dist/lib/components/Select/Select.css +50 -33
- package/dist/lib/components/Select/Select.d.ts +7 -0
- package/dist/lib/components/Select/Select.js +16 -6
- package/dist/lib/components/Tabs/Tabs.css +12 -1
- package/dist/lib/components/Tabs/Tabs.d.ts +3 -3
- package/dist/lib/components/Tabs/Tabs.js +10 -8
- package/dist/lib/components/TextField/TextField.css +33 -20
- package/dist/lib/components/TextField/TextField.d.ts +2 -0
- package/dist/lib/components/TextField/TextField.js +14 -9
- package/package.json +3 -3
|
@@ -36,6 +36,8 @@ export interface IBannerProps {
|
|
|
36
36
|
pauseOnHover?: boolean;
|
|
37
37
|
/** Цветовая тема навигации */
|
|
38
38
|
navTheme?: NavThemeType;
|
|
39
|
+
/** Автоматическая высота слайдов */
|
|
40
|
+
autoHeight?: boolean;
|
|
39
41
|
/** Обработчик клика по стрелке "вперед" (должен быть обернут в useCallback) */
|
|
40
42
|
onNextClick?: (index: number) => void;
|
|
41
43
|
/** Обработчик клика по стрелке "назад" (должен быть обернут в useCallback) */
|
|
@@ -71,6 +71,8 @@ var Banner = function Banner(_ref) {
|
|
|
71
71
|
loop = _ref$loop === void 0 ? false : _ref$loop,
|
|
72
72
|
_ref$navTheme = _ref.navTheme,
|
|
73
73
|
navTheme = _ref$navTheme === void 0 ? 'light' : _ref$navTheme,
|
|
74
|
+
_ref$autoHeight = _ref.autoHeight,
|
|
75
|
+
autoHeight = _ref$autoHeight === void 0 ? false : _ref$autoHeight,
|
|
74
76
|
_ref$children = _ref.children,
|
|
75
77
|
children = _ref$children === void 0 ? [] : _ref$children,
|
|
76
78
|
onNextClick = _ref.onNextClick,
|
|
@@ -206,7 +208,8 @@ var Banner = function Banner(_ref) {
|
|
|
206
208
|
}, [autoPlay, pauseOnHover, swiperInstance === null || swiperInstance === void 0 ? void 0 : swiperInstance.autoplay]);
|
|
207
209
|
return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
208
210
|
className: cn({
|
|
209
|
-
'nav-theme': navTheme
|
|
211
|
+
'nav-theme': navTheme,
|
|
212
|
+
'auto-height': autoHeight
|
|
210
213
|
}, className),
|
|
211
214
|
ref: rootRef
|
|
212
215
|
}), /*#__PURE__*/React.createElement(_react2.Swiper, (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.swiper), {
|
|
@@ -287,6 +290,7 @@ Banner.propTypes = {
|
|
|
287
290
|
autoPlayDelay: PropTypes.number,
|
|
288
291
|
pauseOnHover: PropTypes.bool,
|
|
289
292
|
navTheme: PropTypes.oneOf(Object.values(NavTheme)),
|
|
293
|
+
autoHeight: PropTypes.bool,
|
|
290
294
|
onNextClick: PropTypes.func,
|
|
291
295
|
onPrevClick: PropTypes.func,
|
|
292
296
|
onDotClick: PropTypes.func,
|
|
@@ -72,6 +72,8 @@ export interface ICarouselProps {
|
|
|
72
72
|
effectTheme?: EffectThemeType;
|
|
73
73
|
/** Css селектор элемента, при перетаскивании которого не будет происходить смена слайдов */
|
|
74
74
|
noSwipingSelector?: string;
|
|
75
|
+
/** Свайп к слайду, по которому произведен клик */
|
|
76
|
+
slideToClickedSlide?: boolean;
|
|
75
77
|
/** Ref на swiper */
|
|
76
78
|
getSwiper?: (instance: SwiperCore) => void;
|
|
77
79
|
/** Обработчик клика по стрелке вперед (должен быть обернут в useCallback) */
|
|
@@ -124,7 +124,9 @@ var Carousel = function Carousel(_ref) {
|
|
|
124
124
|
getSwiper = _ref.getSwiper,
|
|
125
125
|
onNextClick = _ref.onNextClick,
|
|
126
126
|
onPrevClick = _ref.onPrevClick,
|
|
127
|
-
onChange = _ref.onChange
|
|
127
|
+
onChange = _ref.onChange,
|
|
128
|
+
_ref$slideToClickedSl = _ref.slideToClickedSlide,
|
|
129
|
+
slideToClickedSlide = _ref$slideToClickedSl === void 0 ? false : _ref$slideToClickedSl;
|
|
128
130
|
|
|
129
131
|
var _React$useState = React.useState(),
|
|
130
132
|
_React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
|
|
@@ -249,7 +251,9 @@ var Carousel = function Carousel(_ref) {
|
|
|
249
251
|
};
|
|
250
252
|
|
|
251
253
|
var disableFocusOnSlideClick = function disableFocusOnSlideClick(e) {
|
|
252
|
-
e.nativeEvent.
|
|
254
|
+
if (e.nativeEvent.target.closest(".".concat(cn()))) {
|
|
255
|
+
e.nativeEvent.preventDefault();
|
|
256
|
+
}
|
|
253
257
|
};
|
|
254
258
|
|
|
255
259
|
React.useEffect(function () {
|
|
@@ -293,6 +297,7 @@ var Carousel = function Carousel(_ref) {
|
|
|
293
297
|
allowTouchMove: !disableTouchMove,
|
|
294
298
|
centeredSlides: centeredSlides,
|
|
295
299
|
effect: effectTheme,
|
|
300
|
+
slideToClickedSlide: slideToClickedSlide,
|
|
296
301
|
fadeEffect: effectTheme === EffectTheme.FADE ? {
|
|
297
302
|
crossFade: effectTheme === EffectTheme.FADE
|
|
298
303
|
} : undefined,
|
|
@@ -5,10 +5,6 @@ h4,
|
|
|
5
5
|
h5 {
|
|
6
6
|
margin: 0;
|
|
7
7
|
}
|
|
8
|
-
.mfui-content-area {
|
|
9
|
-
/* deprecated */
|
|
10
|
-
/* deprecated */
|
|
11
|
-
}
|
|
12
8
|
.mfui-content-area_background-color_transparent {
|
|
13
9
|
background-color: transparent;
|
|
14
10
|
}
|
|
@@ -33,9 +29,6 @@ h5 {
|
|
|
33
29
|
.mfui-content-area_background-color_spbSky2 {
|
|
34
30
|
background-color: var(--spbSky2);
|
|
35
31
|
}
|
|
36
|
-
.mfui-content-area_background-color_default {
|
|
37
|
-
background-color: var(--content);
|
|
38
|
-
}
|
|
39
32
|
.mfui-content-area__inner {
|
|
40
33
|
-webkit-box-sizing: content-box;
|
|
41
34
|
box-sizing: content-box;
|
|
@@ -108,6 +101,3 @@ h5 {
|
|
|
108
101
|
.mfui-content-area__inner_background-color_spbSky2 {
|
|
109
102
|
background-color: var(--spbSky2);
|
|
110
103
|
}
|
|
111
|
-
.mfui-content-area__inner_background-color_default {
|
|
112
|
-
background-color: var(--content);
|
|
113
|
-
}
|
|
@@ -9,7 +9,6 @@ declare const BACKGROUND_COLORS: {
|
|
|
9
9
|
readonly SPB_SKY_0: "spbSky0";
|
|
10
10
|
readonly SPB_SKY_1: "spbSky1";
|
|
11
11
|
readonly SPB_SKY_2: "spbSky2";
|
|
12
|
-
readonly DEFAULT: "default";
|
|
13
12
|
};
|
|
14
13
|
export declare type BackgroundColorType = typeof BACKGROUND_COLORS[keyof typeof BACKGROUND_COLORS];
|
|
15
14
|
declare const DisableIndents: {
|
|
@@ -18,7 +18,7 @@ interface IHeaderProps {
|
|
|
18
18
|
root?: Record<string, string>;
|
|
19
19
|
};
|
|
20
20
|
/** Горизонтальное выравнивание */
|
|
21
|
-
|
|
21
|
+
align?: 'inherit' | 'left' | 'center' | 'right';
|
|
22
22
|
/** Обработчик клика */
|
|
23
23
|
onClick?: (e: React.SyntheticEvent<EventTarget>) => void;
|
|
24
24
|
}
|
|
@@ -34,8 +34,8 @@ var Header = function Header(_ref) {
|
|
|
34
34
|
_ref$color = _ref.color,
|
|
35
35
|
color = _ref$color === void 0 ? 'default' : _ref$color,
|
|
36
36
|
dataAttrs = _ref.dataAttrs,
|
|
37
|
-
_ref$
|
|
38
|
-
|
|
37
|
+
_ref$align = _ref.align,
|
|
38
|
+
align = _ref$align === void 0 ? 'inherit' : _ref$align,
|
|
39
39
|
margin = _ref.margin,
|
|
40
40
|
onClick = _ref.onClick;
|
|
41
41
|
var ElementType = level;
|
|
@@ -46,7 +46,7 @@ var Header = function Header(_ref) {
|
|
|
46
46
|
color: color,
|
|
47
47
|
margin: margin,
|
|
48
48
|
level: level,
|
|
49
|
-
'h-align':
|
|
49
|
+
'h-align': align,
|
|
50
50
|
space: spaceLevel
|
|
51
51
|
}, className),
|
|
52
52
|
onClick: onClick
|
|
@@ -61,7 +61,7 @@ Header.propTypes = {
|
|
|
61
61
|
space: PropTypes.oneOf(['wide', 'tight']),
|
|
62
62
|
margin: PropTypes.bool,
|
|
63
63
|
addition: PropTypes.element,
|
|
64
|
-
|
|
64
|
+
align: PropTypes.oneOf(['inherit', 'left', 'center', 'right']),
|
|
65
65
|
dataAttrs: PropTypes.shape({
|
|
66
66
|
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
|
67
67
|
}),
|
|
@@ -26,13 +26,13 @@ var List = function List(_ref) {
|
|
|
26
26
|
color = _ref$color === void 0 ? 'default' : _ref$color,
|
|
27
27
|
_ref$weight = _ref.weight,
|
|
28
28
|
weight = _ref$weight === void 0 ? 'regular' : _ref$weight,
|
|
29
|
-
|
|
29
|
+
align = _ref.align,
|
|
30
30
|
className = _ref.className,
|
|
31
31
|
children = _ref.children;
|
|
32
32
|
var ElementType = as;
|
|
33
33
|
return /*#__PURE__*/React.createElement(ElementType, {
|
|
34
34
|
className: cn({
|
|
35
|
-
'h-align':
|
|
35
|
+
'h-align': align,
|
|
36
36
|
color: color,
|
|
37
37
|
weight: weight,
|
|
38
38
|
type: as
|
|
@@ -42,7 +42,7 @@ var List = function List(_ref) {
|
|
|
42
42
|
|
|
43
43
|
List.propTypes = {
|
|
44
44
|
as: PropTypes.oneOf(['ul', 'ol']),
|
|
45
|
-
|
|
45
|
+
align: PropTypes.oneOf(['center', 'right']),
|
|
46
46
|
weight: PropTypes.oneOf(['light', 'regular', 'bold']),
|
|
47
47
|
color: PropTypes.oneOf(['default', 'black', 'white', 'gray', 'green', 'purple', 'red', 'inherit']),
|
|
48
48
|
className: PropTypes.string
|
|
@@ -132,7 +132,6 @@ h5 {
|
|
|
132
132
|
display: -webkit-box;
|
|
133
133
|
display: -ms-flexbox;
|
|
134
134
|
display: flex;
|
|
135
|
-
gap: 16px;
|
|
136
135
|
-webkit-box-align: end;
|
|
137
136
|
-ms-flex-align: end;
|
|
138
137
|
align-items: flex-end;
|
|
@@ -142,16 +141,10 @@ h5 {
|
|
|
142
141
|
width: 100%;
|
|
143
142
|
margin-top: 8px;
|
|
144
143
|
}
|
|
145
|
-
@media screen and (min-width: 768px) {
|
|
146
|
-
.mfui-notification__bottom {
|
|
147
|
-
gap: 20px;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
144
|
.mfui-notification__bottom-block {
|
|
151
145
|
display: -webkit-box;
|
|
152
146
|
display: -ms-flexbox;
|
|
153
147
|
display: flex;
|
|
154
|
-
gap: 16px;
|
|
155
148
|
overflow: hidden;
|
|
156
149
|
}
|
|
157
150
|
.mfui-notification__bottom_has-button {
|
|
@@ -175,6 +168,9 @@ h5 {
|
|
|
175
168
|
line-height: 18px;
|
|
176
169
|
}
|
|
177
170
|
}
|
|
171
|
+
.mfui-notification__button + .mfui-notification__link {
|
|
172
|
+
margin-left: 16px;
|
|
173
|
+
}
|
|
178
174
|
.mfui-notification__link-arrow,
|
|
179
175
|
.mfui-notification__collapse-arrow {
|
|
180
176
|
width: 20px;
|
|
@@ -214,6 +210,15 @@ h5 {
|
|
|
214
210
|
.mfui-notification__collapse-button {
|
|
215
211
|
font-size: 12px;
|
|
216
212
|
line-height: 18px;
|
|
213
|
+
margin-left: 16px;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
.mfui-notification__bottom-block + .mfui-notification__collapse-button {
|
|
217
|
+
margin-left: 20px;
|
|
218
|
+
}
|
|
219
|
+
@media screen and (max-width: 767px) {
|
|
220
|
+
.mfui-notification__bottom-block + .mfui-notification__collapse-button {
|
|
221
|
+
margin-left: 16px;
|
|
217
222
|
}
|
|
218
223
|
}
|
|
219
224
|
.mfui-notification__collapse_hidden {
|
|
@@ -331,3 +336,11 @@ h5 {
|
|
|
331
336
|
/* stylelint-disable-line max-nesting-depth */
|
|
332
337
|
fill: var(--stcWhite);
|
|
333
338
|
}
|
|
339
|
+
.mfui-notification_colored.mfui-notification_type_error .mfui-notification__close:not(:hover) {
|
|
340
|
+
background-color: var(--stcWhite20);
|
|
341
|
+
}
|
|
342
|
+
.mfui-notification_colored.mfui-notification_type_error .mfui-notification__close:not(:hover) .mfui-notification__close-icon {
|
|
343
|
+
/* stylelint-disable-line max-nesting-depth */
|
|
344
|
+
opacity: 1;
|
|
345
|
+
fill: var(--stcWhite);
|
|
346
|
+
}
|
|
@@ -23,13 +23,15 @@
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
.mfui-search {
|
|
26
|
-
font-family: inherit;
|
|
27
|
-
font-size: 15px;
|
|
28
|
-
line-height: 24px;
|
|
29
26
|
position: relative;
|
|
30
27
|
z-index: auto;
|
|
28
|
+
-webkit-box-sizing: border-box;
|
|
29
|
+
box-sizing: border-box;
|
|
31
30
|
min-height: 40px;
|
|
32
31
|
color: var(--content);
|
|
32
|
+
font-family: inherit;
|
|
33
|
+
font-size: 15px;
|
|
34
|
+
line-height: 24px;
|
|
33
35
|
}
|
|
34
36
|
.mfui-search__require-mark {
|
|
35
37
|
margin-left: 1px;
|
|
@@ -139,6 +141,15 @@
|
|
|
139
141
|
.mfui-search__search-wrapper_labeled .mfui-search__search-field:focus:-ms-input-placeholder {
|
|
140
142
|
opacity: 1;
|
|
141
143
|
}
|
|
144
|
+
.mfui-search__search-wrapper_labeled .mfui-search__search-field:focus::-moz-placeholder {
|
|
145
|
+
opacity: 1;
|
|
146
|
+
}
|
|
147
|
+
.mfui-search__search-wrapper_labeled .mfui-search__search-field:focus::-ms-input-placeholder {
|
|
148
|
+
opacity: 1;
|
|
149
|
+
}
|
|
150
|
+
.mfui-search__search-wrapper_labeled .mfui-search__search-field:focus::placeholder {
|
|
151
|
+
opacity: 1;
|
|
152
|
+
}
|
|
142
153
|
.mfui-search__search-field_filled + .mfui-search__label,
|
|
143
154
|
.mfui-search__search-field:focus + .mfui-search__label {
|
|
144
155
|
-webkit-transform: scale(0.8) translate(-12.5%, -75%);
|
|
@@ -222,11 +233,20 @@
|
|
|
222
233
|
}
|
|
223
234
|
.mfui-search__list-item {
|
|
224
235
|
font-family: inherit;
|
|
225
|
-
padding:
|
|
236
|
+
padding-top: 12px;
|
|
237
|
+
padding-bottom: 12px;
|
|
226
238
|
border-radius: 16px;
|
|
227
239
|
background-color: var(--base);
|
|
228
240
|
cursor: pointer;
|
|
229
241
|
}
|
|
242
|
+
.mfui-search__list-item_paddings_large {
|
|
243
|
+
padding-right: 32px;
|
|
244
|
+
padding-left: 32px;
|
|
245
|
+
}
|
|
246
|
+
.mfui-search__list-item_paddings_small {
|
|
247
|
+
padding-right: 12px;
|
|
248
|
+
padding-left: 12px;
|
|
249
|
+
}
|
|
230
250
|
.mfui-search__list-item_active {
|
|
231
251
|
background-color: var(--spbSky0);
|
|
232
252
|
}
|
|
@@ -6,11 +6,17 @@ export declare const Verification: {
|
|
|
6
6
|
};
|
|
7
7
|
declare type VerificationType = typeof Verification[keyof typeof Verification];
|
|
8
8
|
declare type ElementOrString = JSX.Element[] | JSX.Element | Element[] | Element;
|
|
9
|
+
export declare const SearchItemsPaddings: {
|
|
10
|
+
readonly SMALL: "small";
|
|
11
|
+
readonly LARGE: "large";
|
|
12
|
+
};
|
|
9
13
|
export declare type SearchItem = {
|
|
10
14
|
/** Значение value элемента */
|
|
11
15
|
value: string;
|
|
12
16
|
/** Настраиваемое отображение элементов в выпадающем списке */
|
|
13
17
|
searchView?: ElementOrString;
|
|
18
|
+
/** Размер горизонтальных отступов элемента */
|
|
19
|
+
paddings?: typeof SearchItemsPaddings[keyof typeof SearchItemsPaddings];
|
|
14
20
|
};
|
|
15
21
|
export interface ISearchProps {
|
|
16
22
|
/** Дополнительные data атрибуты к внутренним элементам */
|
|
@@ -5,10 +5,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports["default"] = exports.Verification = void 0;
|
|
8
|
+
exports["default"] = exports.SearchItemsPaddings = exports.Verification = void 0;
|
|
9
9
|
|
|
10
10
|
require("core-js/modules/es.array.map");
|
|
11
11
|
|
|
12
|
+
require("core-js/modules/es.object.values");
|
|
13
|
+
|
|
12
14
|
require("core-js/modules/es.regexp.constructor");
|
|
13
15
|
|
|
14
16
|
require("core-js/modules/es.regexp.exec");
|
|
@@ -50,6 +52,11 @@ var Verification = {
|
|
|
50
52
|
ERROR: 'error'
|
|
51
53
|
};
|
|
52
54
|
exports.Verification = Verification;
|
|
55
|
+
var SearchItemsPaddings = {
|
|
56
|
+
SMALL: 'small',
|
|
57
|
+
LARGE: 'large'
|
|
58
|
+
};
|
|
59
|
+
exports.SearchItemsPaddings = SearchItemsPaddings;
|
|
53
60
|
var cn = (0, _uiHelpers.cnCreate)('mfui-search');
|
|
54
61
|
|
|
55
62
|
var Search = function Search(_ref) {
|
|
@@ -260,11 +267,14 @@ var Search = function Search(_ref) {
|
|
|
260
267
|
className: cn('list-inner')
|
|
261
268
|
}, items.map(function (_ref2, i) {
|
|
262
269
|
var itemValue = _ref2.value,
|
|
263
|
-
searchView = _ref2.searchView
|
|
270
|
+
searchView = _ref2.searchView,
|
|
271
|
+
_ref2$paddings = _ref2.paddings,
|
|
272
|
+
paddings = _ref2$paddings === void 0 ? SearchItemsPaddings.LARGE : _ref2$paddings;
|
|
264
273
|
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.item, i + 1), {
|
|
265
274
|
ref: activeIndex === i ? highlightedItem : null,
|
|
266
275
|
className: cn('list-item', {
|
|
267
|
-
active: activeIndex === i
|
|
276
|
+
active: activeIndex === i,
|
|
277
|
+
paddings: paddings
|
|
268
278
|
}),
|
|
269
279
|
onMouseDown: handleSelectSubmit(i),
|
|
270
280
|
onMouseEnter: handleHoverItem(i),
|
|
@@ -294,7 +304,8 @@ Search.propTypes = {
|
|
|
294
304
|
hideIcon: PropTypes.bool,
|
|
295
305
|
items: PropTypes.arrayOf(PropTypes.shape({
|
|
296
306
|
value: PropTypes.string.isRequired,
|
|
297
|
-
searchView: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.arrayOf(PropTypes.element)])
|
|
307
|
+
searchView: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.arrayOf(PropTypes.element)]),
|
|
308
|
+
paddings: PropTypes.oneOf(Object.values(SearchItemsPaddings))
|
|
298
309
|
}).isRequired),
|
|
299
310
|
changeDelay: PropTypes.number,
|
|
300
311
|
verification: PropTypes.oneOf(['valid', 'error']),
|
|
@@ -23,14 +23,16 @@
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
.mfui-select {
|
|
26
|
-
font-family: inherit;
|
|
27
|
-
font-size: 15px;
|
|
28
|
-
line-height: 24px;
|
|
29
|
-
font-weight: 400;
|
|
30
26
|
position: relative;
|
|
31
27
|
z-index: 1;
|
|
28
|
+
-webkit-box-sizing: border-box;
|
|
29
|
+
box-sizing: border-box;
|
|
32
30
|
min-height: 40px;
|
|
33
31
|
color: var(--content);
|
|
32
|
+
font-family: inherit;
|
|
33
|
+
font-size: 15px;
|
|
34
|
+
line-height: 24px;
|
|
35
|
+
font-weight: 400;
|
|
34
36
|
}
|
|
35
37
|
.mfui-select__inner {
|
|
36
38
|
position: relative;
|
|
@@ -48,21 +50,26 @@
|
|
|
48
50
|
background-color: var(--base);
|
|
49
51
|
outline: none;
|
|
50
52
|
cursor: pointer;
|
|
53
|
+
-webkit-transition: border-color 0.3s;
|
|
54
|
+
transition: border-color 0.3s;
|
|
51
55
|
}
|
|
52
56
|
.mfui-select__control:after {
|
|
53
57
|
content: '';
|
|
54
58
|
position: absolute;
|
|
55
|
-
top:
|
|
59
|
+
top: 50%;
|
|
56
60
|
right: 27px;
|
|
61
|
+
z-index: 1;
|
|
57
62
|
display: block;
|
|
58
63
|
border-top: 6px solid;
|
|
59
64
|
border-right: 5px solid transparent;
|
|
60
65
|
border-bottom: none;
|
|
61
66
|
border-left: 5px solid transparent;
|
|
62
67
|
color: var(--brandGreen);
|
|
63
|
-
-webkit-transform: translateY(-50%);
|
|
64
|
-
transform: translateY(-50%);
|
|
65
68
|
cursor: pointer;
|
|
69
|
+
-webkit-transition: -webkit-transform 0.6s;
|
|
70
|
+
transition: -webkit-transform 0.6s;
|
|
71
|
+
transition: transform 0.6s;
|
|
72
|
+
transition: transform 0.6s, -webkit-transform 0.6s;
|
|
66
73
|
}
|
|
67
74
|
.mfui-select__combobox {
|
|
68
75
|
font-size: 15px;
|
|
@@ -89,7 +96,8 @@
|
|
|
89
96
|
-moz-appearance: none;
|
|
90
97
|
appearance: none;
|
|
91
98
|
}
|
|
92
|
-
.mfui-select_no-touch .mfui-select__control:hover
|
|
99
|
+
.mfui-select_no-touch .mfui-select__control:hover,
|
|
100
|
+
.mfui-select_no-touch .mfui-select__control:focus-within {
|
|
93
101
|
border-color: var(--content);
|
|
94
102
|
}
|
|
95
103
|
.mfui-select__title {
|
|
@@ -109,11 +117,12 @@
|
|
|
109
117
|
display: -webkit-box;
|
|
110
118
|
display: -ms-flexbox;
|
|
111
119
|
display: flex;
|
|
112
|
-
-webkit-box-align:
|
|
113
|
-
-ms-flex-align:
|
|
114
|
-
align-items:
|
|
120
|
+
-webkit-box-align: center;
|
|
121
|
+
-ms-flex-align: center;
|
|
122
|
+
align-items: center;
|
|
123
|
+
overflow: hidden;
|
|
115
124
|
}
|
|
116
|
-
.mfui-select__title-
|
|
125
|
+
.mfui-select__title-inner_hide-value .mfui-select__title-value {
|
|
117
126
|
color: var(--spbSky3);
|
|
118
127
|
}
|
|
119
128
|
.mfui-select__title-inner {
|
|
@@ -127,6 +136,8 @@
|
|
|
127
136
|
-webkit-box-align: center;
|
|
128
137
|
-ms-flex-align: center;
|
|
129
138
|
align-items: center;
|
|
139
|
+
-webkit-box-sizing: border-box;
|
|
140
|
+
box-sizing: border-box;
|
|
130
141
|
height: 100%;
|
|
131
142
|
padding: 0 45px 0 16px;
|
|
132
143
|
overflow: hidden;
|
|
@@ -136,7 +147,7 @@
|
|
|
136
147
|
content: '';
|
|
137
148
|
position: absolute;
|
|
138
149
|
top: 0;
|
|
139
|
-
right:
|
|
150
|
+
right: 40px;
|
|
140
151
|
bottom: 0;
|
|
141
152
|
width: 40px;
|
|
142
153
|
background: -webkit-gradient(linear, left top, right top, from(rgba(255, 255, 255, 0)), to(var(--base)));
|
|
@@ -153,7 +164,7 @@
|
|
|
153
164
|
top: 100%;
|
|
154
165
|
right: 0;
|
|
155
166
|
left: 0;
|
|
156
|
-
z-index:
|
|
167
|
+
z-index: 11;
|
|
157
168
|
display: none;
|
|
158
169
|
border-radius: 12px;
|
|
159
170
|
background-color: var(--base);
|
|
@@ -181,7 +192,8 @@
|
|
|
181
192
|
}
|
|
182
193
|
.mfui-select__list-item {
|
|
183
194
|
font-family: inherit;
|
|
184
|
-
padding:
|
|
195
|
+
padding-top: 12px;
|
|
196
|
+
padding-bottom: 12px;
|
|
185
197
|
border-radius: 16px;
|
|
186
198
|
background-color: var(--base);
|
|
187
199
|
cursor: pointer;
|
|
@@ -189,6 +201,14 @@
|
|
|
189
201
|
.mfui-select__list-item_hovered {
|
|
190
202
|
background-color: var(--spbSky0);
|
|
191
203
|
}
|
|
204
|
+
.mfui-select__list-item_paddings_large {
|
|
205
|
+
padding-right: 32px;
|
|
206
|
+
padding-left: 32px;
|
|
207
|
+
}
|
|
208
|
+
.mfui-select__list-item_paddings_small {
|
|
209
|
+
padding-right: 12px;
|
|
210
|
+
padding-left: 12px;
|
|
211
|
+
}
|
|
192
212
|
.mfui-select__item-title {
|
|
193
213
|
position: relative;
|
|
194
214
|
display: -webkit-box;
|
|
@@ -200,18 +220,6 @@
|
|
|
200
220
|
-webkit-box-align: center;
|
|
201
221
|
-ms-flex-align: center;
|
|
202
222
|
align-items: center;
|
|
203
|
-
overflow: hidden;
|
|
204
|
-
white-space: nowrap;
|
|
205
|
-
}
|
|
206
|
-
.mfui-select__item-title:after {
|
|
207
|
-
content: '';
|
|
208
|
-
position: absolute;
|
|
209
|
-
top: 0;
|
|
210
|
-
right: 0;
|
|
211
|
-
bottom: 0;
|
|
212
|
-
width: 40px;
|
|
213
|
-
background: -webkit-gradient(linear, left top, right top, from(rgba(255, 255, 255, 0)), to(var(--base)));
|
|
214
|
-
background: linear-gradient(to right, rgba(255, 255, 255, 0), var(--base));
|
|
215
223
|
}
|
|
216
224
|
.mfui-select__item-title_active {
|
|
217
225
|
font-weight: 600;
|
|
@@ -289,19 +297,19 @@
|
|
|
289
297
|
transition: opacity 0.2s;
|
|
290
298
|
}
|
|
291
299
|
.mfui-select_open .mfui-select__label,
|
|
292
|
-
.mfui-select__title-inner:not(.mfui-select__title-
|
|
300
|
+
.mfui-select__title-inner:not(.mfui-select__title-inner_hide-value) .mfui-select__label {
|
|
293
301
|
-webkit-transform: scale(0.8) translate(-12%, -75%);
|
|
294
302
|
transform: scale(0.8) translate(-12%, -75%);
|
|
295
303
|
-webkit-transition-duration: 0.2s, 0.01s;
|
|
296
304
|
transition-duration: 0.2s, 0.01s;
|
|
297
305
|
}
|
|
298
|
-
.mfui-select__combobox:not(.mfui-
|
|
306
|
+
.mfui-select__combobox:not(.mfui-select__combobox_hide-value) + .mfui-select__label {
|
|
299
307
|
-webkit-transform: scale(0.8) translate(-12.5%, -75%);
|
|
300
308
|
transform: scale(0.8) translate(-12.5%, -75%);
|
|
301
309
|
-webkit-transition-duration: 0.2s, 0.01s;
|
|
302
310
|
transition-duration: 0.2s, 0.01s;
|
|
303
311
|
}
|
|
304
|
-
.mfui-select__control_labeled .mfui-select__title-
|
|
312
|
+
.mfui-select__control_labeled .mfui-select__title-inner_hide-value .mfui-select__title-value {
|
|
305
313
|
color: var(--spbSky3);
|
|
306
314
|
-webkit-transition: opacity 0.2s;
|
|
307
315
|
transition: opacity 0.2s;
|
|
@@ -320,12 +328,21 @@
|
|
|
320
328
|
.mfui-select__control_labeled .mfui-select__combobox:focus:-ms-input-placeholder {
|
|
321
329
|
opacity: 1;
|
|
322
330
|
}
|
|
331
|
+
.mfui-select__control_labeled .mfui-select__combobox:focus::-moz-placeholder {
|
|
332
|
+
opacity: 1;
|
|
333
|
+
}
|
|
334
|
+
.mfui-select__control_labeled .mfui-select__combobox:focus::-ms-input-placeholder {
|
|
335
|
+
opacity: 1;
|
|
336
|
+
}
|
|
337
|
+
.mfui-select__control_labeled .mfui-select__combobox:focus::placeholder {
|
|
338
|
+
opacity: 1;
|
|
339
|
+
}
|
|
323
340
|
.mfui-select_open {
|
|
324
341
|
z-index: 100;
|
|
325
342
|
}
|
|
326
343
|
.mfui-select_open .mfui-select__control:after {
|
|
327
|
-
|
|
328
|
-
|
|
344
|
+
-webkit-transform: rotate(-180deg);
|
|
345
|
+
transform: rotate(-180deg);
|
|
329
346
|
}
|
|
330
347
|
.mfui-select_open .mfui-select__list {
|
|
331
348
|
display: block;
|
|
@@ -339,7 +356,7 @@
|
|
|
339
356
|
.mfui-select_open .mfui-select__control {
|
|
340
357
|
border-color: var(--content);
|
|
341
358
|
}
|
|
342
|
-
.mfui-select_open .mfui-select__title-
|
|
359
|
+
.mfui-select_open .mfui-select__title-inner_hide-value .mfui-select__title-value {
|
|
343
360
|
opacity: 1;
|
|
344
361
|
}
|
|
345
362
|
.mfui-select_valid .mfui-select__control {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as PropTypes from 'prop-types';
|
|
3
3
|
import './Select.less';
|
|
4
|
+
export declare const SelectItemsPaddings: {
|
|
5
|
+
readonly SMALL: "small";
|
|
6
|
+
readonly LARGE: "large";
|
|
7
|
+
};
|
|
4
8
|
export declare const Verification: {
|
|
5
9
|
readonly VALID: "valid";
|
|
6
10
|
readonly ERROR: "error";
|
|
@@ -26,6 +30,8 @@ export interface ISelectItem<T extends SelectItemValueType> {
|
|
|
26
30
|
view?: ElementOrString | ((data: ViewCallbackArguments) => ElementOrString);
|
|
27
31
|
/** Настраиваемое отображение выбранного элемента в поле селекта */
|
|
28
32
|
selectedView?: JSX.Element | Element | React.ReactElement;
|
|
33
|
+
/** Размер горизонтальных отступов элемента */
|
|
34
|
+
paddings?: typeof SelectItemsPaddings[keyof typeof SelectItemsPaddings];
|
|
29
35
|
}
|
|
30
36
|
export interface ISelectProps<T extends SelectItemValueType> {
|
|
31
37
|
/** Тип компонента */
|
|
@@ -134,6 +140,7 @@ declare const Select: {
|
|
|
134
140
|
selectedView: PropTypes.Requireable<string | PropTypes.ReactElementLike | ((...args: any[]) => any)>;
|
|
135
141
|
title: PropTypes.Validator<string>;
|
|
136
142
|
value: PropTypes.Validator<string | number>;
|
|
143
|
+
paddings: PropTypes.Requireable<"small" | "large">;
|
|
137
144
|
}>> | null | undefined)[]>;
|
|
138
145
|
onSelect: PropTypes.Requireable<(...args: any[]) => any>;
|
|
139
146
|
onOpened: PropTypes.Requireable<(...args: any[]) => any>;
|