@megafon/ui-core 3.15.0 → 3.16.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 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.1](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.16.0...@megafon/ui-core@3.16.1) (2022-10-25)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **search:** fix input field font-size for all browsers ([f57a17a](https://github.com/MegafonWebLab/megafon-ui/commit/f57a17a7ecb009c6fdb66cd00a6ba43d7d5c567b))
12
+
13
+
14
+
15
+
16
+
17
+ # [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)
18
+
19
+
20
+ ### Features
21
+
22
+ * **select:** add new props useShortListItems ([cd3ee88](https://github.com/MegafonWebLab/megafon-ui/commit/cd3ee88462e36cf725ab9867f5635c3b89d61511))
23
+
24
+
25
+
26
+
27
+
6
28
  # [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)
7
29
 
8
30
 
@@ -50,6 +50,7 @@
50
50
  border-radius: 0;
51
51
  overflow: auto;
52
52
  color: var(--content);
53
+ font-size: 100%;
53
54
  font-family: inherit;
54
55
  line-height: 25px;
55
56
  background-color: transparent;
@@ -144,6 +144,9 @@
144
144
  padding: 12px 0;
145
145
  overflow-y: auto;
146
146
  }
147
+ .mfui-select__list-inner_short {
148
+ max-height: 195px;
149
+ }
147
150
  .mfui-select__list-item {
148
151
  font-family: inherit;
149
152
  padding: 8px 32px;
@@ -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
  /** Дополнительные классы для внутренних элементов */
@@ -82,7 +84,7 @@ export interface ISelectProps<T extends SelectItemValueType> {
82
84
  onClosed?: () => void;
83
85
  }
84
86
  declare const Select: {
85
- <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;
86
88
  propTypes: {
87
89
  type: PropTypes.Requireable<"classic" | "combobox">;
88
90
  label: PropTypes.Requireable<string>;
@@ -137,6 +139,7 @@ declare const Select: {
137
139
  title: PropTypes.Validator<string>;
138
140
  value: PropTypes.Validator<string | number>;
139
141
  }>> | null | undefined)[]>;
142
+ shortList: PropTypes.Requireable<boolean>;
140
143
  onSelect: PropTypes.Requireable<(...args: any[]) => any>;
141
144
  onOpened: PropTypes.Requireable<(...args: any[]) => any>;
142
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', [classes.listInner]),
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,
@@ -455,6 +459,7 @@ Select.propTypes = {
455
459
  title: PropTypes.string.isRequired,
456
460
  value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired
457
461
  })).isRequired,
462
+ shortList: PropTypes.bool,
458
463
  onSelect: PropTypes.func,
459
464
  onOpened: PropTypes.func,
460
465
  onClosed: PropTypes.func
@@ -50,6 +50,7 @@
50
50
  border-radius: 0;
51
51
  overflow: auto;
52
52
  color: var(--content);
53
+ font-size: 100%;
53
54
  font-family: inherit;
54
55
  line-height: 25px;
55
56
  background-color: transparent;
@@ -144,6 +144,9 @@
144
144
  padding: 12px 0;
145
145
  overflow-y: auto;
146
146
  }
147
+ .mfui-select__list-inner_short {
148
+ max-height: 195px;
149
+ }
147
150
  .mfui-select__list-item {
148
151
  font-family: inherit;
149
152
  padding: 8px 32px;
@@ -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
  /** Дополнительные классы для внутренних элементов */
@@ -82,7 +84,7 @@ export interface ISelectProps<T extends SelectItemValueType> {
82
84
  onClosed?: () => void;
83
85
  }
84
86
  declare const Select: {
85
- <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;
86
88
  propTypes: {
87
89
  type: PropTypes.Requireable<"classic" | "combobox">;
88
90
  label: PropTypes.Requireable<string>;
@@ -137,6 +139,7 @@ declare const Select: {
137
139
  title: PropTypes.Validator<string>;
138
140
  value: PropTypes.Validator<string | number>;
139
141
  }>> | null | undefined)[]>;
142
+ shortList: PropTypes.Requireable<boolean>;
140
143
  onSelect: PropTypes.Requireable<(...args: any[]) => any>;
141
144
  onOpened: PropTypes.Requireable<(...args: any[]) => any>;
142
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', [classes.listInner]),
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,
@@ -490,6 +494,7 @@ Select.propTypes = {
490
494
  title: PropTypes.string.isRequired,
491
495
  value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired
492
496
  })).isRequired,
497
+ shortList: PropTypes.bool,
493
498
  onSelect: PropTypes.func,
494
499
  onOpened: PropTypes.func,
495
500
  onClosed: PropTypes.func
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megafon/ui-core",
3
- "version": "3.15.0",
3
+ "version": "3.16.1",
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": "16be55dd99791687663b209a67e4ab6ec485b19c"
100
+ "gitHead": "5d8dca29c01d8b7eac9a5df87ba52a69a824b5db"
101
101
  }