@megafon/ui-core 4.0.0-beta.18 → 4.0.0-beta.20
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 +24 -0
- package/dist/es/components/Notification/Notification.css +3 -7
- package/dist/es/components/Search/Search.css +10 -1
- 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 +10 -1
- package/dist/es/components/Select/Select.d.ts +7 -0
- package/dist/es/components/Select/Select.js +11 -3
- package/dist/es/components/TextField/TextField.css +2 -2
- package/dist/lib/components/Notification/Notification.css +3 -7
- package/dist/lib/components/Search/Search.css +10 -1
- 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 +10 -1
- package/dist/lib/components/Select/Select.d.ts +7 -0
- package/dist/lib/components/Select/Select.js +13 -4
- package/dist/lib/components/TextField/TextField.css +2 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
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
|
+
# [4.0.0-beta.20](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@4.0.0-beta.19...@megafon/ui-core@4.0.0-beta.20) (2022-08-24)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **textfield:** returned correct color to notice text ([d6ef976](https://github.com/MegafonWebLab/megafon-ui/commit/d6ef976f755e1fb55d7fd2e462095459d96b74c9))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [4.0.0-beta.19](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@4.0.0-beta.18...@megafon/ui-core@4.0.0-beta.19) (2022-08-23)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **notification:** fix bottom gaps ([1427080](https://github.com/MegafonWebLab/megafon-ui/commit/14270809ec97d18dbdf19183111b9034114d9437))
|
|
23
|
+
* **search:** add modifier for item paddings ([9df5792](https://github.com/MegafonWebLab/megafon-ui/commit/9df5792d6828f852bed9c1c4e64404667e8d2cd7))
|
|
24
|
+
* **select:** add modifier for item paddings ([e5f9735](https://github.com/MegafonWebLab/megafon-ui/commit/e5f97353c9686fba070aad48d3816ec0ce12d5d9))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
# [4.0.0-beta.18](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@4.0.0-beta.17...@megafon/ui-core@4.0.0-beta.18) (2022-08-22)
|
|
7
31
|
|
|
8
32
|
|
|
@@ -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 {
|
|
@@ -167,6 +160,7 @@ h5 {
|
|
|
167
160
|
-webkit-box-align: center;
|
|
168
161
|
-ms-flex-align: center;
|
|
169
162
|
align-items: center;
|
|
163
|
+
margin-left: 16px;
|
|
170
164
|
cursor: pointer;
|
|
171
165
|
}
|
|
172
166
|
@media screen and (max-width: 767px) {
|
|
@@ -203,6 +197,7 @@ h5 {
|
|
|
203
197
|
height: -webkit-fit-content;
|
|
204
198
|
height: -moz-fit-content;
|
|
205
199
|
height: fit-content;
|
|
200
|
+
margin-left: 20px;
|
|
206
201
|
padding: 0;
|
|
207
202
|
border: none;
|
|
208
203
|
color: var(--systemBlue);
|
|
@@ -214,6 +209,7 @@ h5 {
|
|
|
214
209
|
.mfui-notification__collapse-button {
|
|
215
210
|
font-size: 12px;
|
|
216
211
|
line-height: 18px;
|
|
212
|
+
margin-left: 16px;
|
|
217
213
|
}
|
|
218
214
|
}
|
|
219
215
|
.mfui-notification__collapse_hidden {
|
|
@@ -224,11 +224,20 @@
|
|
|
224
224
|
}
|
|
225
225
|
.mfui-search__list-item {
|
|
226
226
|
font-family: inherit;
|
|
227
|
-
padding: 12px
|
|
227
|
+
padding-top: 12px;
|
|
228
|
+
padding-bottom: 12px;
|
|
228
229
|
border-radius: 16px;
|
|
229
230
|
background-color: var(--base);
|
|
230
231
|
cursor: pointer;
|
|
231
232
|
}
|
|
233
|
+
.mfui-search__list-item_paddings_large {
|
|
234
|
+
padding-right: 32px;
|
|
235
|
+
padding-left: 32px;
|
|
236
|
+
}
|
|
237
|
+
.mfui-search__list-item_paddings_small {
|
|
238
|
+
padding-right: 12px;
|
|
239
|
+
padding-left: 12px;
|
|
240
|
+
}
|
|
232
241
|
.mfui-search__list-item_active {
|
|
233
242
|
background-color: var(--spbSky0);
|
|
234
243
|
}
|
|
@@ -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 атрибуты к внутренним элементам */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "core-js/modules/es.array.map";
|
|
2
|
+
import "core-js/modules/es.object.values";
|
|
2
3
|
import "core-js/modules/es.regexp.constructor";
|
|
3
4
|
import "core-js/modules/es.regexp.exec";
|
|
4
5
|
import "core-js/modules/es.regexp.to-string";
|
|
@@ -24,6 +25,10 @@ export var Verification = {
|
|
|
24
25
|
VALID: 'valid',
|
|
25
26
|
ERROR: 'error'
|
|
26
27
|
};
|
|
28
|
+
export var SearchItemsPaddings = {
|
|
29
|
+
SMALL: 'small',
|
|
30
|
+
LARGE: 'large'
|
|
31
|
+
};
|
|
27
32
|
var cn = cnCreate('mfui-search');
|
|
28
33
|
|
|
29
34
|
var Search = function Search(_ref) {
|
|
@@ -220,11 +225,14 @@ var Search = function Search(_ref) {
|
|
|
220
225
|
className: cn('list-inner')
|
|
221
226
|
}, items.map(function (_ref2, i) {
|
|
222
227
|
var itemValue = _ref2.value,
|
|
223
|
-
searchView = _ref2.searchView
|
|
228
|
+
searchView = _ref2.searchView,
|
|
229
|
+
_ref2$paddings = _ref2.paddings,
|
|
230
|
+
paddings = _ref2$paddings === void 0 ? SearchItemsPaddings.LARGE : _ref2$paddings;
|
|
224
231
|
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.item, i + 1), {
|
|
225
232
|
ref: activeIndex === i ? highlightedItem : null,
|
|
226
233
|
className: cn('list-item', {
|
|
227
|
-
active: activeIndex === i
|
|
234
|
+
active: activeIndex === i,
|
|
235
|
+
paddings: paddings
|
|
228
236
|
}),
|
|
229
237
|
onMouseDown: handleSelectSubmit(i),
|
|
230
238
|
onMouseEnter: handleHoverItem(i),
|
|
@@ -254,7 +262,8 @@ Search.propTypes = {
|
|
|
254
262
|
hideIcon: PropTypes.bool,
|
|
255
263
|
items: PropTypes.arrayOf(PropTypes.shape({
|
|
256
264
|
value: PropTypes.string.isRequired,
|
|
257
|
-
searchView: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.arrayOf(PropTypes.element)])
|
|
265
|
+
searchView: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.arrayOf(PropTypes.element)]),
|
|
266
|
+
paddings: PropTypes.oneOf(Object.values(SearchItemsPaddings))
|
|
258
267
|
}).isRequired),
|
|
259
268
|
changeDelay: PropTypes.number,
|
|
260
269
|
verification: PropTypes.oneOf(['valid', 'error']),
|
|
@@ -192,7 +192,8 @@
|
|
|
192
192
|
}
|
|
193
193
|
.mfui-select__list-item {
|
|
194
194
|
font-family: inherit;
|
|
195
|
-
padding: 12px
|
|
195
|
+
padding-top: 12px;
|
|
196
|
+
padding-bottom: 12px;
|
|
196
197
|
border-radius: 16px;
|
|
197
198
|
background-color: var(--base);
|
|
198
199
|
cursor: pointer;
|
|
@@ -200,6 +201,14 @@
|
|
|
200
201
|
.mfui-select__list-item_hovered {
|
|
201
202
|
background-color: var(--spbSky0);
|
|
202
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
|
+
}
|
|
203
212
|
.mfui-select__item-title {
|
|
204
213
|
position: relative;
|
|
205
214
|
display: -webkit-box;
|
|
@@ -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>;
|
|
@@ -26,6 +26,10 @@ var UPDATE_ITEMS_LIST = SelectActions.UPDATE_ITEMS_LIST,
|
|
|
26
26
|
TOGGLE_DROPDOWN = SelectActions.TOGGLE_DROPDOWN,
|
|
27
27
|
UPDATE_SELECT_VALUE = SelectActions.UPDATE_SELECT_VALUE,
|
|
28
28
|
SET_HOVERED_ITEM_INDEX = SelectActions.SET_HOVERED_ITEM_INDEX;
|
|
29
|
+
export var SelectItemsPaddings = {
|
|
30
|
+
SMALL: 'small',
|
|
31
|
+
LARGE: 'large'
|
|
32
|
+
};
|
|
29
33
|
export var Verification = {
|
|
30
34
|
VALID: 'valid',
|
|
31
35
|
ERROR: 'error'
|
|
@@ -381,11 +385,14 @@ var Select = function Select(_ref) {
|
|
|
381
385
|
}, currentItems.map(function (_ref3, i) {
|
|
382
386
|
var title = _ref3.title,
|
|
383
387
|
value = _ref3.value,
|
|
384
|
-
view = _ref3.view
|
|
388
|
+
view = _ref3.view,
|
|
389
|
+
_ref3$paddings = _ref3.paddings,
|
|
390
|
+
paddings = _ref3$paddings === void 0 ? SelectItemsPaddings.LARGE : _ref3$paddings;
|
|
385
391
|
var isItemActive = currentValue === value;
|
|
386
392
|
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.listItem, i + 1), {
|
|
387
393
|
className: cn('list-item', {
|
|
388
|
-
hovered: hoveredItemIndex === i
|
|
394
|
+
hovered: hoveredItemIndex === i,
|
|
395
|
+
paddings: paddings
|
|
389
396
|
}, [classes.listItem]),
|
|
390
397
|
key: "".concat(i, "_").concat(value),
|
|
391
398
|
onClick: handleSelectItem,
|
|
@@ -460,7 +467,8 @@ Select.propTypes = {
|
|
|
460
467
|
view: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.func]),
|
|
461
468
|
selectedView: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.func]),
|
|
462
469
|
title: PropTypes.string.isRequired,
|
|
463
|
-
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired
|
|
470
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
471
|
+
paddings: PropTypes.oneOf(Object.values(SelectItemsPaddings))
|
|
464
472
|
})).isRequired,
|
|
465
473
|
onSelect: PropTypes.func,
|
|
466
474
|
onOpened: PropTypes.func,
|
|
@@ -269,13 +269,13 @@
|
|
|
269
269
|
cursor: default !important;
|
|
270
270
|
}
|
|
271
271
|
.mfui-text-field_theme_default.mfui-text-field_error .mfui-text-field__counter_error,
|
|
272
|
-
.mfui-text-field_theme_default.mfui-text-field_error .mfui-text-
|
|
272
|
+
.mfui-text-field_theme_default.mfui-text-field_error .mfui-text-field__field-bottom-wrapper {
|
|
273
273
|
color: var(--fury);
|
|
274
274
|
}
|
|
275
275
|
.mfui-text-field_theme_white .mfui-text-field__icon {
|
|
276
276
|
fill: var(--stcWhite);
|
|
277
277
|
}
|
|
278
|
-
.mfui-text-field_theme_white .mfui-text-
|
|
278
|
+
.mfui-text-field_theme_white .mfui-text-field__field-bottom-wrapper,
|
|
279
279
|
.mfui-text-field_theme_white .mfui-text-field__counter {
|
|
280
280
|
color: var(--stcWhite);
|
|
281
281
|
}
|
|
@@ -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 {
|
|
@@ -167,6 +160,7 @@ h5 {
|
|
|
167
160
|
-webkit-box-align: center;
|
|
168
161
|
-ms-flex-align: center;
|
|
169
162
|
align-items: center;
|
|
163
|
+
margin-left: 16px;
|
|
170
164
|
cursor: pointer;
|
|
171
165
|
}
|
|
172
166
|
@media screen and (max-width: 767px) {
|
|
@@ -203,6 +197,7 @@ h5 {
|
|
|
203
197
|
height: -webkit-fit-content;
|
|
204
198
|
height: -moz-fit-content;
|
|
205
199
|
height: fit-content;
|
|
200
|
+
margin-left: 20px;
|
|
206
201
|
padding: 0;
|
|
207
202
|
border: none;
|
|
208
203
|
color: var(--systemBlue);
|
|
@@ -214,6 +209,7 @@ h5 {
|
|
|
214
209
|
.mfui-notification__collapse-button {
|
|
215
210
|
font-size: 12px;
|
|
216
211
|
line-height: 18px;
|
|
212
|
+
margin-left: 16px;
|
|
217
213
|
}
|
|
218
214
|
}
|
|
219
215
|
.mfui-notification__collapse_hidden {
|
|
@@ -224,11 +224,20 @@
|
|
|
224
224
|
}
|
|
225
225
|
.mfui-search__list-item {
|
|
226
226
|
font-family: inherit;
|
|
227
|
-
padding: 12px
|
|
227
|
+
padding-top: 12px;
|
|
228
|
+
padding-bottom: 12px;
|
|
228
229
|
border-radius: 16px;
|
|
229
230
|
background-color: var(--base);
|
|
230
231
|
cursor: pointer;
|
|
231
232
|
}
|
|
233
|
+
.mfui-search__list-item_paddings_large {
|
|
234
|
+
padding-right: 32px;
|
|
235
|
+
padding-left: 32px;
|
|
236
|
+
}
|
|
237
|
+
.mfui-search__list-item_paddings_small {
|
|
238
|
+
padding-right: 12px;
|
|
239
|
+
padding-left: 12px;
|
|
240
|
+
}
|
|
232
241
|
.mfui-search__list-item_active {
|
|
233
242
|
background-color: var(--spbSky0);
|
|
234
243
|
}
|
|
@@ -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']),
|
|
@@ -192,7 +192,8 @@
|
|
|
192
192
|
}
|
|
193
193
|
.mfui-select__list-item {
|
|
194
194
|
font-family: inherit;
|
|
195
|
-
padding: 12px
|
|
195
|
+
padding-top: 12px;
|
|
196
|
+
padding-bottom: 12px;
|
|
196
197
|
border-radius: 16px;
|
|
197
198
|
background-color: var(--base);
|
|
198
199
|
cursor: pointer;
|
|
@@ -200,6 +201,14 @@
|
|
|
200
201
|
.mfui-select__list-item_hovered {
|
|
201
202
|
background-color: var(--spbSky0);
|
|
202
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
|
+
}
|
|
203
212
|
.mfui-select__item-title {
|
|
204
213
|
position: relative;
|
|
205
214
|
display: -webkit-box;
|
|
@@ -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>;
|
|
@@ -5,7 +5,7 @@ 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.SelectTypes = exports.Verification = void 0;
|
|
8
|
+
exports["default"] = exports.SelectTypes = exports.Verification = exports.SelectItemsPaddings = void 0;
|
|
9
9
|
|
|
10
10
|
require("core-js/modules/es.array.concat");
|
|
11
11
|
|
|
@@ -58,6 +58,11 @@ var UPDATE_ITEMS_LIST = _selectReducer.SelectActions.UPDATE_ITEMS_LIST,
|
|
|
58
58
|
TOGGLE_DROPDOWN = _selectReducer.SelectActions.TOGGLE_DROPDOWN,
|
|
59
59
|
UPDATE_SELECT_VALUE = _selectReducer.SelectActions.UPDATE_SELECT_VALUE,
|
|
60
60
|
SET_HOVERED_ITEM_INDEX = _selectReducer.SelectActions.SET_HOVERED_ITEM_INDEX;
|
|
61
|
+
var SelectItemsPaddings = {
|
|
62
|
+
SMALL: 'small',
|
|
63
|
+
LARGE: 'large'
|
|
64
|
+
};
|
|
65
|
+
exports.SelectItemsPaddings = SelectItemsPaddings;
|
|
61
66
|
var Verification = {
|
|
62
67
|
VALID: 'valid',
|
|
63
68
|
ERROR: 'error'
|
|
@@ -415,11 +420,14 @@ var Select = function Select(_ref) {
|
|
|
415
420
|
}, currentItems.map(function (_ref3, i) {
|
|
416
421
|
var title = _ref3.title,
|
|
417
422
|
value = _ref3.value,
|
|
418
|
-
view = _ref3.view
|
|
423
|
+
view = _ref3.view,
|
|
424
|
+
_ref3$paddings = _ref3.paddings,
|
|
425
|
+
paddings = _ref3$paddings === void 0 ? SelectItemsPaddings.LARGE : _ref3$paddings;
|
|
419
426
|
var isItemActive = currentValue === value;
|
|
420
427
|
return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.listItem, i + 1), {
|
|
421
428
|
className: cn('list-item', {
|
|
422
|
-
hovered: hoveredItemIndex === i
|
|
429
|
+
hovered: hoveredItemIndex === i,
|
|
430
|
+
paddings: paddings
|
|
423
431
|
}, [classes.listItem]),
|
|
424
432
|
key: "".concat(i, "_").concat(value),
|
|
425
433
|
onClick: handleSelectItem,
|
|
@@ -494,7 +502,8 @@ Select.propTypes = {
|
|
|
494
502
|
view: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.func]),
|
|
495
503
|
selectedView: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.func]),
|
|
496
504
|
title: PropTypes.string.isRequired,
|
|
497
|
-
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired
|
|
505
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
506
|
+
paddings: PropTypes.oneOf(Object.values(SelectItemsPaddings))
|
|
498
507
|
})).isRequired,
|
|
499
508
|
onSelect: PropTypes.func,
|
|
500
509
|
onOpened: PropTypes.func,
|
|
@@ -269,13 +269,13 @@
|
|
|
269
269
|
cursor: default !important;
|
|
270
270
|
}
|
|
271
271
|
.mfui-text-field_theme_default.mfui-text-field_error .mfui-text-field__counter_error,
|
|
272
|
-
.mfui-text-field_theme_default.mfui-text-field_error .mfui-text-
|
|
272
|
+
.mfui-text-field_theme_default.mfui-text-field_error .mfui-text-field__field-bottom-wrapper {
|
|
273
273
|
color: var(--fury);
|
|
274
274
|
}
|
|
275
275
|
.mfui-text-field_theme_white .mfui-text-field__icon {
|
|
276
276
|
fill: var(--stcWhite);
|
|
277
277
|
}
|
|
278
|
-
.mfui-text-field_theme_white .mfui-text-
|
|
278
|
+
.mfui-text-field_theme_white .mfui-text-field__field-bottom-wrapper,
|
|
279
279
|
.mfui-text-field_theme_white .mfui-text-field__counter {
|
|
280
280
|
color: var(--stcWhite);
|
|
281
281
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@megafon/ui-core",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.20",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist",
|
|
6
6
|
"styles"
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
"react-popper": "^2.2.3",
|
|
98
98
|
"swiper": "^6.5.6"
|
|
99
99
|
},
|
|
100
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "0757940d05a058c5eb0a5044767bf59a993eaace"
|
|
101
101
|
}
|