@megafon/ui-core 3.14.0 → 3.16.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/CHANGELOG.md +22 -0
- package/dist/es/components/Select/Select.css +3 -0
- package/dist/es/components/Select/Select.d.ts +6 -1
- package/dist/es/components/Select/Select.js +7 -1
- package/dist/lib/components/Select/Select.css +3 -0
- package/dist/lib/components/Select/Select.d.ts +6 -1
- package/dist/lib/components/Select/Select.js +7 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
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
|
+
# [3.16.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.15.0...@megafon/ui-core@3.16.0) (2022-10-10)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **select:** add new props useShortListItems ([cd3ee88](https://github.com/MegafonWebLab/megafon-ui/commit/cd3ee88462e36cf725ab9867f5635c3b89d61511))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [3.15.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.14.0...@megafon/ui-core@3.15.0) (2022-10-03)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* **select:** add class to list-inner element ([44a366c](https://github.com/MegafonWebLab/megafon-ui/commit/44a366ce6b79222f3ef68532c719f5ee13d3d6bf))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
# [3.14.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.13.0...@megafon/ui-core@3.14.0) (2022-09-06)
|
|
7
29
|
|
|
8
30
|
|
|
@@ -50,6 +50,8 @@ export interface ISelectProps<T extends SelectItemValueType> {
|
|
|
50
50
|
notFoundText?: string;
|
|
51
51
|
/** Массив элементов селекта */
|
|
52
52
|
items: Array<ISelectItem<T>>;
|
|
53
|
+
/** Отображать короткий выпадающий список */
|
|
54
|
+
shortList?: boolean;
|
|
53
55
|
/** Дополнительный класс корневого элемента */
|
|
54
56
|
className?: string;
|
|
55
57
|
/** Дополнительные классы для внутренних элементов */
|
|
@@ -59,6 +61,7 @@ export interface ISelectProps<T extends SelectItemValueType> {
|
|
|
59
61
|
title?: string;
|
|
60
62
|
titleInner?: string;
|
|
61
63
|
list?: string;
|
|
64
|
+
listInner?: string;
|
|
62
65
|
listItem?: string;
|
|
63
66
|
listItemTitle?: string;
|
|
64
67
|
};
|
|
@@ -81,7 +84,7 @@ export interface ISelectProps<T extends SelectItemValueType> {
|
|
|
81
84
|
onClosed?: () => void;
|
|
82
85
|
}
|
|
83
86
|
declare const Select: {
|
|
84
|
-
<T extends string | number | undefined>({ type, disabled, verification, noticeText, label, labelId, required, className, classes, dataAttrs, notFoundText, items, placeholder, currentValue, onClosed, onOpened, onSelect, }: ISelectProps<T>): JSX.Element;
|
|
87
|
+
<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;
|
|
85
88
|
propTypes: {
|
|
86
89
|
type: PropTypes.Requireable<"classic" | "combobox">;
|
|
87
90
|
label: PropTypes.Requireable<string>;
|
|
@@ -100,6 +103,7 @@ declare const Select: {
|
|
|
100
103
|
title: PropTypes.Requireable<string>;
|
|
101
104
|
titleInner: PropTypes.Requireable<string>;
|
|
102
105
|
list: PropTypes.Requireable<string>;
|
|
106
|
+
listInner: PropTypes.Requireable<string>;
|
|
103
107
|
listItem: PropTypes.Requireable<string>;
|
|
104
108
|
listItemTitle: PropTypes.Requireable<string>;
|
|
105
109
|
}>>;
|
|
@@ -135,6 +139,7 @@ declare const Select: {
|
|
|
135
139
|
title: PropTypes.Validator<string>;
|
|
136
140
|
value: PropTypes.Validator<string | number>;
|
|
137
141
|
}>> | null | undefined)[]>;
|
|
142
|
+
shortList: PropTypes.Requireable<boolean>;
|
|
138
143
|
onSelect: PropTypes.Requireable<(...args: any[]) => any>;
|
|
139
144
|
onOpened: PropTypes.Requireable<(...args: any[]) => any>;
|
|
140
145
|
onClosed: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -69,6 +69,8 @@ var Select = function Select(_ref) {
|
|
|
69
69
|
items = _ref.items,
|
|
70
70
|
placeholder = _ref.placeholder,
|
|
71
71
|
currentValue = _ref.currentValue,
|
|
72
|
+
_ref$shortList = _ref.shortList,
|
|
73
|
+
shortList = _ref$shortList === void 0 ? false : _ref$shortList,
|
|
72
74
|
onClosed = _ref.onClosed,
|
|
73
75
|
onOpened = _ref.onOpened,
|
|
74
76
|
onSelect = _ref.onSelect;
|
|
@@ -363,7 +365,9 @@ var Select = function Select(_ref) {
|
|
|
363
365
|
return /*#__PURE__*/React.createElement("div", {
|
|
364
366
|
className: cn('list', [classes.list])
|
|
365
367
|
}, /*#__PURE__*/React.createElement("div", {
|
|
366
|
-
className: cn('list-inner'
|
|
368
|
+
className: cn('list-inner', {
|
|
369
|
+
"short": shortList
|
|
370
|
+
}, [classes.listInner]),
|
|
367
371
|
ref: itemWrapperNode
|
|
368
372
|
}, currentItems.map(function (_ref3, i) {
|
|
369
373
|
var title = _ref3.title,
|
|
@@ -435,6 +439,7 @@ Select.propTypes = {
|
|
|
435
439
|
title: PropTypes.string,
|
|
436
440
|
titleInner: PropTypes.string,
|
|
437
441
|
list: PropTypes.string,
|
|
442
|
+
listInner: PropTypes.string,
|
|
438
443
|
listItem: PropTypes.string,
|
|
439
444
|
listItemTitle: PropTypes.string
|
|
440
445
|
}),
|
|
@@ -454,6 +459,7 @@ Select.propTypes = {
|
|
|
454
459
|
title: PropTypes.string.isRequired,
|
|
455
460
|
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired
|
|
456
461
|
})).isRequired,
|
|
462
|
+
shortList: PropTypes.bool,
|
|
457
463
|
onSelect: PropTypes.func,
|
|
458
464
|
onOpened: PropTypes.func,
|
|
459
465
|
onClosed: PropTypes.func
|
|
@@ -50,6 +50,8 @@ export interface ISelectProps<T extends SelectItemValueType> {
|
|
|
50
50
|
notFoundText?: string;
|
|
51
51
|
/** Массив элементов селекта */
|
|
52
52
|
items: Array<ISelectItem<T>>;
|
|
53
|
+
/** Отображать короткий выпадающий список */
|
|
54
|
+
shortList?: boolean;
|
|
53
55
|
/** Дополнительный класс корневого элемента */
|
|
54
56
|
className?: string;
|
|
55
57
|
/** Дополнительные классы для внутренних элементов */
|
|
@@ -59,6 +61,7 @@ export interface ISelectProps<T extends SelectItemValueType> {
|
|
|
59
61
|
title?: string;
|
|
60
62
|
titleInner?: string;
|
|
61
63
|
list?: string;
|
|
64
|
+
listInner?: string;
|
|
62
65
|
listItem?: string;
|
|
63
66
|
listItemTitle?: string;
|
|
64
67
|
};
|
|
@@ -81,7 +84,7 @@ export interface ISelectProps<T extends SelectItemValueType> {
|
|
|
81
84
|
onClosed?: () => void;
|
|
82
85
|
}
|
|
83
86
|
declare const Select: {
|
|
84
|
-
<T extends string | number | undefined>({ type, disabled, verification, noticeText, label, labelId, required, className, classes, dataAttrs, notFoundText, items, placeholder, currentValue, onClosed, onOpened, onSelect, }: ISelectProps<T>): JSX.Element;
|
|
87
|
+
<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;
|
|
85
88
|
propTypes: {
|
|
86
89
|
type: PropTypes.Requireable<"classic" | "combobox">;
|
|
87
90
|
label: PropTypes.Requireable<string>;
|
|
@@ -100,6 +103,7 @@ declare const Select: {
|
|
|
100
103
|
title: PropTypes.Requireable<string>;
|
|
101
104
|
titleInner: PropTypes.Requireable<string>;
|
|
102
105
|
list: PropTypes.Requireable<string>;
|
|
106
|
+
listInner: PropTypes.Requireable<string>;
|
|
103
107
|
listItem: PropTypes.Requireable<string>;
|
|
104
108
|
listItemTitle: PropTypes.Requireable<string>;
|
|
105
109
|
}>>;
|
|
@@ -135,6 +139,7 @@ declare const Select: {
|
|
|
135
139
|
title: PropTypes.Validator<string>;
|
|
136
140
|
value: PropTypes.Validator<string | number>;
|
|
137
141
|
}>> | null | undefined)[]>;
|
|
142
|
+
shortList: PropTypes.Requireable<boolean>;
|
|
138
143
|
onSelect: PropTypes.Requireable<(...args: any[]) => any>;
|
|
139
144
|
onOpened: PropTypes.Requireable<(...args: any[]) => any>;
|
|
140
145
|
onClosed: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -104,6 +104,8 @@ var Select = function Select(_ref) {
|
|
|
104
104
|
items = _ref.items,
|
|
105
105
|
placeholder = _ref.placeholder,
|
|
106
106
|
currentValue = _ref.currentValue,
|
|
107
|
+
_ref$shortList = _ref.shortList,
|
|
108
|
+
shortList = _ref$shortList === void 0 ? false : _ref$shortList,
|
|
107
109
|
onClosed = _ref.onClosed,
|
|
108
110
|
onOpened = _ref.onOpened,
|
|
109
111
|
onSelect = _ref.onSelect;
|
|
@@ -398,7 +400,9 @@ var Select = function Select(_ref) {
|
|
|
398
400
|
return /*#__PURE__*/React.createElement("div", {
|
|
399
401
|
className: cn('list', [classes.list])
|
|
400
402
|
}, /*#__PURE__*/React.createElement("div", {
|
|
401
|
-
className: cn('list-inner'
|
|
403
|
+
className: cn('list-inner', {
|
|
404
|
+
"short": shortList
|
|
405
|
+
}, [classes.listInner]),
|
|
402
406
|
ref: itemWrapperNode
|
|
403
407
|
}, currentItems.map(function (_ref3, i) {
|
|
404
408
|
var title = _ref3.title,
|
|
@@ -470,6 +474,7 @@ Select.propTypes = {
|
|
|
470
474
|
title: PropTypes.string,
|
|
471
475
|
titleInner: PropTypes.string,
|
|
472
476
|
list: PropTypes.string,
|
|
477
|
+
listInner: PropTypes.string,
|
|
473
478
|
listItem: PropTypes.string,
|
|
474
479
|
listItemTitle: PropTypes.string
|
|
475
480
|
}),
|
|
@@ -489,6 +494,7 @@ Select.propTypes = {
|
|
|
489
494
|
title: PropTypes.string.isRequired,
|
|
490
495
|
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired
|
|
491
496
|
})).isRequired,
|
|
497
|
+
shortList: PropTypes.bool,
|
|
492
498
|
onSelect: PropTypes.func,
|
|
493
499
|
onOpened: PropTypes.func,
|
|
494
500
|
onClosed: PropTypes.func
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@megafon/ui-core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.16.0",
|
|
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": "9cee39ff2a0a8bc21655cfd30de96a2de75e5f13"
|
|
101
101
|
}
|