@megafon/ui-core 6.6.1 → 6.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/components/List/List.css +1 -1
- package/dist/es/components/Row/Row.css +13 -0
- package/dist/es/components/Row/Row.d.ts +2 -0
- package/dist/es/components/Row/Row.js +7 -2
- package/dist/es/components/Search/Search.d.ts +4 -0
- package/dist/es/components/Search/Search.js +7 -2
- package/dist/es/components/Select/Select.d.ts +4 -1
- package/dist/es/components/Select/Select.js +13 -1
- package/dist/lib/components/List/List.css +1 -1
- package/dist/lib/components/Row/Row.css +13 -0
- package/dist/lib/components/Row/Row.d.ts +2 -0
- package/dist/lib/components/Row/Row.js +7 -2
- package/dist/lib/components/Search/Search.d.ts +4 -0
- package/dist/lib/components/Search/Search.js +7 -2
- package/dist/lib/components/Select/Select.d.ts +4 -1
- package/dist/lib/components/Select/Select.js +13 -1
- package/package.json +2 -2
|
@@ -30,6 +30,9 @@
|
|
|
30
30
|
padding: 24px 32px;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
+
.mfui-v6-row:hover {
|
|
34
|
+
text-decoration: none;
|
|
35
|
+
}
|
|
33
36
|
.mfui-v6-row__wrapper {
|
|
34
37
|
display: -webkit-box;
|
|
35
38
|
display: -ms-flexbox;
|
|
@@ -37,6 +40,7 @@
|
|
|
37
40
|
-webkit-box-align: center;
|
|
38
41
|
-ms-flex-align: center;
|
|
39
42
|
align-items: center;
|
|
43
|
+
width: 100%;
|
|
40
44
|
}
|
|
41
45
|
.mfui-v6-row__icon-container {
|
|
42
46
|
display: -webkit-box;
|
|
@@ -236,3 +240,12 @@
|
|
|
236
240
|
line-height: 24px;
|
|
237
241
|
font-weight: 500;
|
|
238
242
|
}
|
|
243
|
+
.mfui-v6-row_auto-height {
|
|
244
|
+
display: -webkit-box;
|
|
245
|
+
display: -ms-flexbox;
|
|
246
|
+
display: flex;
|
|
247
|
+
-webkit-box-align: center;
|
|
248
|
+
-ms-flex-align: center;
|
|
249
|
+
align-items: center;
|
|
250
|
+
height: auto;
|
|
251
|
+
}
|
|
@@ -23,6 +23,8 @@ export interface IRowProps {
|
|
|
23
23
|
target?: '_self' | '_blank';
|
|
24
24
|
/** rel - аргумент тега <a> */
|
|
25
25
|
rel?: string;
|
|
26
|
+
/** Автоматическая высота */
|
|
27
|
+
autoHeight?: boolean;
|
|
26
28
|
/** Обработчик клика */
|
|
27
29
|
onClick?: (e: React.SyntheticEvent<EventTarget>) => void;
|
|
28
30
|
/** Дочерние элементы: Badges, Switcher, Selector */
|
|
@@ -34,6 +34,8 @@ var Row = function Row(_ref) {
|
|
|
34
34
|
_ref$target = _ref.target,
|
|
35
35
|
target = _ref$target === void 0 ? '_self' : _ref$target,
|
|
36
36
|
rel = _ref.rel,
|
|
37
|
+
_ref$autoHeight = _ref.autoHeight,
|
|
38
|
+
autoHeight = _ref$autoHeight === void 0 ? false : _ref$autoHeight,
|
|
37
39
|
onClick = _ref.onClick,
|
|
38
40
|
children = _ref.children,
|
|
39
41
|
className = _ref.className,
|
|
@@ -53,7 +55,8 @@ var Row = function Row(_ref) {
|
|
|
53
55
|
size: size,
|
|
54
56
|
view: backgroundView,
|
|
55
57
|
pointer: isActive,
|
|
56
|
-
'has-arrow': showArrow && !showLoader
|
|
58
|
+
'has-arrow': showArrow && !showLoader,
|
|
59
|
+
'auto-height': autoHeight
|
|
57
60
|
}, [className, classes.root]),
|
|
58
61
|
href: href,
|
|
59
62
|
target: href ? target : undefined,
|
|
@@ -71,7 +74,8 @@ var Row = function Row(_ref) {
|
|
|
71
74
|
className: cn('header')
|
|
72
75
|
}, /*#__PURE__*/React.createElement(Header, {
|
|
73
76
|
className: cn('title', [classes.title]),
|
|
74
|
-
as: isSmallSize ? 'h5' : 'h3'
|
|
77
|
+
as: isSmallSize ? 'h5' : 'h3',
|
|
78
|
+
space: isSmallSize ? 'tight' : 'wide'
|
|
75
79
|
}, title), !!subTitle && /*#__PURE__*/React.createElement("div", {
|
|
76
80
|
className: cn('sub-title', [classes.subtitle])
|
|
77
81
|
}, subTitle)), !showLoader ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
@@ -98,6 +102,7 @@ Row.propTypes = {
|
|
|
98
102
|
href: PropTypes.string,
|
|
99
103
|
target: PropTypes.oneOf(['_self', '_blank']),
|
|
100
104
|
rel: PropTypes.string,
|
|
105
|
+
autoHeight: PropTypes.bool,
|
|
101
106
|
onClick: PropTypes.func,
|
|
102
107
|
children: PropTypes.node,
|
|
103
108
|
className: PropTypes.string,
|
|
@@ -79,6 +79,8 @@ export interface ISearchProps {
|
|
|
79
79
|
classes?: {
|
|
80
80
|
label?: string;
|
|
81
81
|
input?: string;
|
|
82
|
+
list?: string;
|
|
83
|
+
listInner?: string;
|
|
82
84
|
listItemTitle?: string;
|
|
83
85
|
control?: string;
|
|
84
86
|
icon?: string;
|
|
@@ -104,6 +106,8 @@ export interface ISearchProps {
|
|
|
104
106
|
minTextareaHeight?: MinTextareaHeightType;
|
|
105
107
|
/** Показать хендлер для ресайза текстового поля */
|
|
106
108
|
showResizer?: boolean;
|
|
109
|
+
/** Ref обработчик */
|
|
110
|
+
inputRef?: (node: HTMLInputElement | HTMLTextAreaElement) => void;
|
|
107
111
|
/** Обработчик изменения поля */
|
|
108
112
|
onChange?: (value: string) => void;
|
|
109
113
|
/** Обработчик нажатия на enter */
|
|
@@ -107,6 +107,7 @@ var Search = function Search(_ref) {
|
|
|
107
107
|
_ref$minTextareaHeigh = _ref.minTextareaHeight,
|
|
108
108
|
minTextareaHeight = _ref$minTextareaHeigh === void 0 ? MinTextareaHeight.ONE_ROW : _ref$minTextareaHeigh,
|
|
109
109
|
showResizer = _ref.showResizer,
|
|
110
|
+
inputRef = _ref.inputRef,
|
|
110
111
|
onChange = _ref.onChange,
|
|
111
112
|
onSubmit = _ref.onSubmit,
|
|
112
113
|
onBlur = _ref.onBlur,
|
|
@@ -172,6 +173,7 @@ var Search = function Search(_ref) {
|
|
|
172
173
|
}
|
|
173
174
|
|
|
174
175
|
fieldRef.current = node;
|
|
176
|
+
inputRef === null || inputRef === void 0 ? void 0 : inputRef(node);
|
|
175
177
|
};
|
|
176
178
|
|
|
177
179
|
var textareaResize = React.useCallback(function () {
|
|
@@ -477,10 +479,10 @@ var Search = function Search(_ref) {
|
|
|
477
479
|
|
|
478
480
|
var renderList = function renderList() {
|
|
479
481
|
return /*#__PURE__*/React.createElement("div", {
|
|
480
|
-
className: cn('list'),
|
|
482
|
+
className: cn('list', [classes === null || classes === void 0 ? void 0 : classes.list]),
|
|
481
483
|
ref: listRef
|
|
482
484
|
}, /*#__PURE__*/React.createElement("div", {
|
|
483
|
-
className: cn('list-inner')
|
|
485
|
+
className: cn('list-inner', [classes === null || classes === void 0 ? void 0 : classes.listInner])
|
|
484
486
|
}, items.map(function (_ref2, i) {
|
|
485
487
|
var itemValue = _ref2.value,
|
|
486
488
|
searchView = _ref2.searchView,
|
|
@@ -660,6 +662,8 @@ Search.propTypes = {
|
|
|
660
662
|
classes: PropTypes.shape({
|
|
661
663
|
label: PropTypes.string,
|
|
662
664
|
input: PropTypes.string,
|
|
665
|
+
list: PropTypes.string,
|
|
666
|
+
listInner: PropTypes.string,
|
|
663
667
|
listItemTitle: PropTypes.string,
|
|
664
668
|
control: PropTypes.string,
|
|
665
669
|
icon: PropTypes.string,
|
|
@@ -681,6 +685,7 @@ Search.propTypes = {
|
|
|
681
685
|
}), PropTypes.any])]),
|
|
682
686
|
minTextareaHeight: PropTypes.oneOf([MinTextareaHeight.ONE_ROW, MinTextareaHeight.THREE_ROWS]),
|
|
683
687
|
showResizer: PropTypes.bool,
|
|
688
|
+
inputRef: PropTypes.func,
|
|
684
689
|
onChange: PropTypes.func,
|
|
685
690
|
onSubmit: PropTypes.func,
|
|
686
691
|
onBlur: PropTypes.func,
|
|
@@ -86,6 +86,8 @@ export interface ISelectProps<T extends SelectItemValueType> {
|
|
|
86
86
|
listItemTitle?: Record<string, string>;
|
|
87
87
|
notFound?: Record<string, string>;
|
|
88
88
|
};
|
|
89
|
+
/** Ref обработчик */
|
|
90
|
+
inputRef?: (node: HTMLDivElement) => void;
|
|
89
91
|
/** Обработчик выбора элемента селекта */
|
|
90
92
|
onSelect?: (e: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement> | null, dataItem?: ISelectItem<T>) => void;
|
|
91
93
|
/** Обработчик при открытом селекте */
|
|
@@ -94,7 +96,7 @@ export interface ISelectProps<T extends SelectItemValueType> {
|
|
|
94
96
|
onClosed?: () => void;
|
|
95
97
|
}
|
|
96
98
|
declare const Select: {
|
|
97
|
-
<T extends string | number | undefined>({ type, disabled, verification, noticeText, label, labelId, required, className, classes, dataAttrs, notFoundText, items, placeholder, currentValue, shortList, onClosed, onOpened, onSelect, }: ISelectProps<T>): JSX.Element;
|
|
99
|
+
<T extends string | number | undefined>({ type, disabled, verification, noticeText, label, labelId, required, className, classes, dataAttrs, notFoundText, items, placeholder, currentValue, shortList, inputRef, onClosed, onOpened, onSelect, }: ISelectProps<T>): JSX.Element;
|
|
98
100
|
propTypes: {
|
|
99
101
|
type: PropTypes.Requireable<"classic" | "combobox">;
|
|
100
102
|
label: PropTypes.Requireable<string>;
|
|
@@ -163,6 +165,7 @@ declare const Select: {
|
|
|
163
165
|
paddings: PropTypes.Requireable<"small" | "large">;
|
|
164
166
|
}>> | null | undefined)[]>;
|
|
165
167
|
shortList: PropTypes.Requireable<boolean>;
|
|
168
|
+
inputRef: PropTypes.Requireable<(...args: any[]) => any>;
|
|
166
169
|
onSelect: PropTypes.Requireable<(...args: any[]) => any>;
|
|
167
170
|
onOpened: PropTypes.Requireable<(...args: any[]) => any>;
|
|
168
171
|
onClosed: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -75,6 +75,7 @@ var Select = function Select(_ref) {
|
|
|
75
75
|
currentValue = _ref.currentValue,
|
|
76
76
|
_ref$shortList = _ref.shortList,
|
|
77
77
|
shortList = _ref$shortList === void 0 ? false : _ref$shortList,
|
|
78
|
+
inputRef = _ref.inputRef,
|
|
78
79
|
onClosed = _ref.onClosed,
|
|
79
80
|
onOpened = _ref.onOpened,
|
|
80
81
|
onSelect = _ref.onSelect;
|
|
@@ -96,6 +97,16 @@ var Select = function Select(_ref) {
|
|
|
96
97
|
var currentIndex = itemsList.findIndex(function (elem) {
|
|
97
98
|
return elem.value === currentValue;
|
|
98
99
|
});
|
|
100
|
+
|
|
101
|
+
var getFieldNode = function getFieldNode(node) {
|
|
102
|
+
if (!node) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
selectNode.current = node;
|
|
107
|
+
inputRef === null || inputRef === void 0 ? void 0 : inputRef(node);
|
|
108
|
+
};
|
|
109
|
+
|
|
99
110
|
var handleClickOutside = useCallback(function (e) {
|
|
100
111
|
var _a;
|
|
101
112
|
|
|
@@ -421,7 +432,7 @@ var Select = function Select(_ref) {
|
|
|
421
432
|
valid: verification === Verification.VALID,
|
|
422
433
|
error: verification === Verification.ERROR
|
|
423
434
|
}, [className, classes.root]),
|
|
424
|
-
ref:
|
|
435
|
+
ref: getFieldNode
|
|
425
436
|
}), /*#__PURE__*/React.createElement("div", {
|
|
426
437
|
className: cn('inner')
|
|
427
438
|
}, /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.control), {
|
|
@@ -481,6 +492,7 @@ Select.propTypes = {
|
|
|
481
492
|
paddings: PropTypes.oneOf(Object.values(SelectItemsPaddings))
|
|
482
493
|
})).isRequired,
|
|
483
494
|
shortList: PropTypes.bool,
|
|
495
|
+
inputRef: PropTypes.func,
|
|
484
496
|
onSelect: PropTypes.func,
|
|
485
497
|
onOpened: PropTypes.func,
|
|
486
498
|
onClosed: PropTypes.func
|
|
@@ -30,6 +30,9 @@
|
|
|
30
30
|
padding: 24px 32px;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
+
.mfui-v6-row:hover {
|
|
34
|
+
text-decoration: none;
|
|
35
|
+
}
|
|
33
36
|
.mfui-v6-row__wrapper {
|
|
34
37
|
display: -webkit-box;
|
|
35
38
|
display: -ms-flexbox;
|
|
@@ -37,6 +40,7 @@
|
|
|
37
40
|
-webkit-box-align: center;
|
|
38
41
|
-ms-flex-align: center;
|
|
39
42
|
align-items: center;
|
|
43
|
+
width: 100%;
|
|
40
44
|
}
|
|
41
45
|
.mfui-v6-row__icon-container {
|
|
42
46
|
display: -webkit-box;
|
|
@@ -236,3 +240,12 @@
|
|
|
236
240
|
line-height: 24px;
|
|
237
241
|
font-weight: 500;
|
|
238
242
|
}
|
|
243
|
+
.mfui-v6-row_auto-height {
|
|
244
|
+
display: -webkit-box;
|
|
245
|
+
display: -ms-flexbox;
|
|
246
|
+
display: flex;
|
|
247
|
+
-webkit-box-align: center;
|
|
248
|
+
-ms-flex-align: center;
|
|
249
|
+
align-items: center;
|
|
250
|
+
height: auto;
|
|
251
|
+
}
|
|
@@ -23,6 +23,8 @@ export interface IRowProps {
|
|
|
23
23
|
target?: '_self' | '_blank';
|
|
24
24
|
/** rel - аргумент тега <a> */
|
|
25
25
|
rel?: string;
|
|
26
|
+
/** Автоматическая высота */
|
|
27
|
+
autoHeight?: boolean;
|
|
26
28
|
/** Обработчик клика */
|
|
27
29
|
onClick?: (e: React.SyntheticEvent<EventTarget>) => void;
|
|
28
30
|
/** Дочерние элементы: Badges, Switcher, Selector */
|
|
@@ -53,6 +53,8 @@ var Row = function Row(_ref) {
|
|
|
53
53
|
_ref$target = _ref.target,
|
|
54
54
|
target = _ref$target === void 0 ? '_self' : _ref$target,
|
|
55
55
|
rel = _ref.rel,
|
|
56
|
+
_ref$autoHeight = _ref.autoHeight,
|
|
57
|
+
autoHeight = _ref$autoHeight === void 0 ? false : _ref$autoHeight,
|
|
56
58
|
onClick = _ref.onClick,
|
|
57
59
|
children = _ref.children,
|
|
58
60
|
className = _ref.className,
|
|
@@ -72,7 +74,8 @@ var Row = function Row(_ref) {
|
|
|
72
74
|
size: size,
|
|
73
75
|
view: backgroundView,
|
|
74
76
|
pointer: isActive,
|
|
75
|
-
'has-arrow': showArrow && !showLoader
|
|
77
|
+
'has-arrow': showArrow && !showLoader,
|
|
78
|
+
'auto-height': autoHeight
|
|
76
79
|
}, [className, classes.root]),
|
|
77
80
|
href: href,
|
|
78
81
|
target: href ? target : undefined,
|
|
@@ -90,7 +93,8 @@ var Row = function Row(_ref) {
|
|
|
90
93
|
className: cn('header')
|
|
91
94
|
}, /*#__PURE__*/_react["default"].createElement(_Header["default"], {
|
|
92
95
|
className: cn('title', [classes.title]),
|
|
93
|
-
as: isSmallSize ? 'h5' : 'h3'
|
|
96
|
+
as: isSmallSize ? 'h5' : 'h3',
|
|
97
|
+
space: isSmallSize ? 'tight' : 'wide'
|
|
94
98
|
}, title), !!subTitle && /*#__PURE__*/_react["default"].createElement("div", {
|
|
95
99
|
className: cn('sub-title', [classes.subtitle])
|
|
96
100
|
}, subTitle)), !showLoader ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -117,6 +121,7 @@ Row.propTypes = {
|
|
|
117
121
|
href: PropTypes.string,
|
|
118
122
|
target: PropTypes.oneOf(['_self', '_blank']),
|
|
119
123
|
rel: PropTypes.string,
|
|
124
|
+
autoHeight: PropTypes.bool,
|
|
120
125
|
onClick: PropTypes.func,
|
|
121
126
|
children: PropTypes.node,
|
|
122
127
|
className: PropTypes.string,
|
|
@@ -79,6 +79,8 @@ export interface ISearchProps {
|
|
|
79
79
|
classes?: {
|
|
80
80
|
label?: string;
|
|
81
81
|
input?: string;
|
|
82
|
+
list?: string;
|
|
83
|
+
listInner?: string;
|
|
82
84
|
listItemTitle?: string;
|
|
83
85
|
control?: string;
|
|
84
86
|
icon?: string;
|
|
@@ -104,6 +106,8 @@ export interface ISearchProps {
|
|
|
104
106
|
minTextareaHeight?: MinTextareaHeightType;
|
|
105
107
|
/** Показать хендлер для ресайза текстового поля */
|
|
106
108
|
showResizer?: boolean;
|
|
109
|
+
/** Ref обработчик */
|
|
110
|
+
inputRef?: (node: HTMLInputElement | HTMLTextAreaElement) => void;
|
|
107
111
|
/** Обработчик изменения поля */
|
|
108
112
|
onChange?: (value: string) => void;
|
|
109
113
|
/** Обработчик нажатия на enter */
|
|
@@ -143,6 +143,7 @@ var Search = function Search(_ref) {
|
|
|
143
143
|
_ref$minTextareaHeigh = _ref.minTextareaHeight,
|
|
144
144
|
minTextareaHeight = _ref$minTextareaHeigh === void 0 ? MinTextareaHeight.ONE_ROW : _ref$minTextareaHeigh,
|
|
145
145
|
showResizer = _ref.showResizer,
|
|
146
|
+
inputRef = _ref.inputRef,
|
|
146
147
|
onChange = _ref.onChange,
|
|
147
148
|
onSubmit = _ref.onSubmit,
|
|
148
149
|
onBlur = _ref.onBlur,
|
|
@@ -215,6 +216,7 @@ var Search = function Search(_ref) {
|
|
|
215
216
|
}
|
|
216
217
|
|
|
217
218
|
fieldRef.current = node;
|
|
219
|
+
inputRef === null || inputRef === void 0 ? void 0 : inputRef(node);
|
|
218
220
|
};
|
|
219
221
|
|
|
220
222
|
var textareaResize = _react["default"].useCallback(function () {
|
|
@@ -539,10 +541,10 @@ var Search = function Search(_ref) {
|
|
|
539
541
|
|
|
540
542
|
var renderList = function renderList() {
|
|
541
543
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
542
|
-
className: cn('list'),
|
|
544
|
+
className: cn('list', [classes === null || classes === void 0 ? void 0 : classes.list]),
|
|
543
545
|
ref: listRef
|
|
544
546
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
545
|
-
className: cn('list-inner')
|
|
547
|
+
className: cn('list-inner', [classes === null || classes === void 0 ? void 0 : classes.listInner])
|
|
546
548
|
}, items.map(function (_ref2, i) {
|
|
547
549
|
var itemValue = _ref2.value,
|
|
548
550
|
searchView = _ref2.searchView,
|
|
@@ -725,6 +727,8 @@ Search.propTypes = {
|
|
|
725
727
|
classes: PropTypes.shape({
|
|
726
728
|
label: PropTypes.string,
|
|
727
729
|
input: PropTypes.string,
|
|
730
|
+
list: PropTypes.string,
|
|
731
|
+
listInner: PropTypes.string,
|
|
728
732
|
listItemTitle: PropTypes.string,
|
|
729
733
|
control: PropTypes.string,
|
|
730
734
|
icon: PropTypes.string,
|
|
@@ -746,6 +750,7 @@ Search.propTypes = {
|
|
|
746
750
|
}), PropTypes.any])]),
|
|
747
751
|
minTextareaHeight: PropTypes.oneOf([MinTextareaHeight.ONE_ROW, MinTextareaHeight.THREE_ROWS]),
|
|
748
752
|
showResizer: PropTypes.bool,
|
|
753
|
+
inputRef: PropTypes.func,
|
|
749
754
|
onChange: PropTypes.func,
|
|
750
755
|
onSubmit: PropTypes.func,
|
|
751
756
|
onBlur: PropTypes.func,
|
|
@@ -86,6 +86,8 @@ export interface ISelectProps<T extends SelectItemValueType> {
|
|
|
86
86
|
listItemTitle?: Record<string, string>;
|
|
87
87
|
notFound?: Record<string, string>;
|
|
88
88
|
};
|
|
89
|
+
/** Ref обработчик */
|
|
90
|
+
inputRef?: (node: HTMLDivElement) => void;
|
|
89
91
|
/** Обработчик выбора элемента селекта */
|
|
90
92
|
onSelect?: (e: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement> | null, dataItem?: ISelectItem<T>) => void;
|
|
91
93
|
/** Обработчик при открытом селекте */
|
|
@@ -94,7 +96,7 @@ export interface ISelectProps<T extends SelectItemValueType> {
|
|
|
94
96
|
onClosed?: () => void;
|
|
95
97
|
}
|
|
96
98
|
declare const Select: {
|
|
97
|
-
<T extends string | number | undefined>({ type, disabled, verification, noticeText, label, labelId, required, className, classes, dataAttrs, notFoundText, items, placeholder, currentValue, shortList, onClosed, onOpened, onSelect, }: ISelectProps<T>): JSX.Element;
|
|
99
|
+
<T extends string | number | undefined>({ type, disabled, verification, noticeText, label, labelId, required, className, classes, dataAttrs, notFoundText, items, placeholder, currentValue, shortList, inputRef, onClosed, onOpened, onSelect, }: ISelectProps<T>): JSX.Element;
|
|
98
100
|
propTypes: {
|
|
99
101
|
type: PropTypes.Requireable<"classic" | "combobox">;
|
|
100
102
|
label: PropTypes.Requireable<string>;
|
|
@@ -163,6 +165,7 @@ declare const Select: {
|
|
|
163
165
|
paddings: PropTypes.Requireable<"small" | "large">;
|
|
164
166
|
}>> | null | undefined)[]>;
|
|
165
167
|
shortList: PropTypes.Requireable<boolean>;
|
|
168
|
+
inputRef: PropTypes.Requireable<(...args: any[]) => any>;
|
|
166
169
|
onSelect: PropTypes.Requireable<(...args: any[]) => any>;
|
|
167
170
|
onOpened: PropTypes.Requireable<(...args: any[]) => any>;
|
|
168
171
|
onClosed: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -110,6 +110,7 @@ var Select = function Select(_ref) {
|
|
|
110
110
|
currentValue = _ref.currentValue,
|
|
111
111
|
_ref$shortList = _ref.shortList,
|
|
112
112
|
shortList = _ref$shortList === void 0 ? false : _ref$shortList,
|
|
113
|
+
inputRef = _ref.inputRef,
|
|
113
114
|
onClosed = _ref.onClosed,
|
|
114
115
|
onOpened = _ref.onOpened,
|
|
115
116
|
onSelect = _ref.onSelect;
|
|
@@ -131,6 +132,16 @@ var Select = function Select(_ref) {
|
|
|
131
132
|
var currentIndex = itemsList.findIndex(function (elem) {
|
|
132
133
|
return elem.value === currentValue;
|
|
133
134
|
});
|
|
135
|
+
|
|
136
|
+
var getFieldNode = function getFieldNode(node) {
|
|
137
|
+
if (!node) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
selectNode.current = node;
|
|
142
|
+
inputRef === null || inputRef === void 0 ? void 0 : inputRef(node);
|
|
143
|
+
};
|
|
144
|
+
|
|
134
145
|
var handleClickOutside = (0, React.useCallback)(function (e) {
|
|
135
146
|
var _a;
|
|
136
147
|
|
|
@@ -456,7 +467,7 @@ var Select = function Select(_ref) {
|
|
|
456
467
|
valid: verification === Verification.VALID,
|
|
457
468
|
error: verification === Verification.ERROR
|
|
458
469
|
}, [className, classes.root]),
|
|
459
|
-
ref:
|
|
470
|
+
ref: getFieldNode
|
|
460
471
|
}), /*#__PURE__*/React.createElement("div", {
|
|
461
472
|
className: cn('inner')
|
|
462
473
|
}, /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.control), {
|
|
@@ -516,6 +527,7 @@ Select.propTypes = {
|
|
|
516
527
|
paddings: PropTypes.oneOf(Object.values(SelectItemsPaddings))
|
|
517
528
|
})).isRequired,
|
|
518
529
|
shortList: PropTypes.bool,
|
|
530
|
+
inputRef: PropTypes.func,
|
|
519
531
|
onSelect: PropTypes.func,
|
|
520
532
|
onOpened: PropTypes.func,
|
|
521
533
|
onClosed: PropTypes.func
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@megafon/ui-core",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.8.0",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist",
|
|
6
6
|
"styles"
|
|
@@ -99,5 +99,5 @@
|
|
|
99
99
|
"react-popper": "^2.2.3",
|
|
100
100
|
"swiper": "^6.5.6"
|
|
101
101
|
},
|
|
102
|
-
"gitHead": "
|
|
102
|
+
"gitHead": "05256f0d8c8ed175460371157ac6dde4e521183a"
|
|
103
103
|
}
|