@megafon/ui-core 2.2.0 → 2.3.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 CHANGED
@@ -3,6 +3,23 @@
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
+ # [2.3.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@2.2.0...@megafon/ui-core@2.3.0) (2022-01-24)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **search:** prevents default action when a menu item is selected and the enter button is pressed ([054cbcf](https://github.com/MegafonWebLab/megafon-ui/commit/054cbcf3457ff779443a82b5ae6383fda57f9cc7))
12
+
13
+
14
+ ### Features
15
+
16
+ * **accordion:** props hasVerticalPaddings marked as deprecated ([4d6d4cc](https://github.com/MegafonWebLab/megafon-ui/commit/4d6d4cca2cf45a86441827f0bef625a88a2c44f8))
17
+ * **textfield:** add autocomplete prop ([f2cff94](https://github.com/MegafonWebLab/megafon-ui/commit/f2cff9403503de174b785ea02365ce470811369e))
18
+
19
+
20
+
21
+
22
+
6
23
  # [2.2.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@2.1.4...@megafon/ui-core@2.2.0) (2021-12-29)
7
24
 
8
25
 
@@ -9,6 +9,7 @@ export interface IAccordionProps extends IFilterDataAttrs {
9
9
  /** Состояние открытости */
10
10
  isOpened?: boolean;
11
11
  /** Вертикальные отступы */
12
+ /** @deprecated */
12
13
  hasVerticalPaddings?: boolean;
13
14
  /** Дополнительный класс для корневого элемента */
14
15
  className?: string;
@@ -87,7 +87,9 @@ Accordion.propTypes = {
87
87
  }), PropTypes.any])]),
88
88
  title: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.arrayOf(PropTypes.node)]).isRequired,
89
89
  isOpened: PropTypes.bool,
90
- hasVerticalPaddings: PropTypes.bool,
90
+ hasVerticalPaddings: function hasVerticalPaddings(props, propName) {
91
+ return props[propName] && new Error('Failed prop type: Prop "hasVerticalPaddings" is deprecated');
92
+ },
91
93
  className: PropTypes.string,
92
94
  classes: PropTypes.shape({
93
95
  openedClass: PropTypes.string,
@@ -125,6 +125,7 @@ var Search = function Search(_ref) {
125
125
  e.preventDefault();
126
126
  } else if (e.key === 'Enter' && activeIndex > -1) {
127
127
  handleItemSubmit(activeIndex);
128
+ e.preventDefault();
128
129
  } else if (e.key === 'Enter' && activeIndex === -1) {
129
130
  handleSearchSubmit();
130
131
  }
@@ -62,8 +62,10 @@ export declare type TextFieldProps = {
62
62
  classes?: {
63
63
  input?: string;
64
64
  };
65
- /** Аргумент элемента input */
65
+ /** Атрибут элемента input */
66
66
  inputMode?: 'numeric' | 'tel' | 'decimal' | 'email' | 'url' | 'search' | 'none';
67
+ /** Атрибут элемента input. Не работает с textarea=true */
68
+ autoComplete?: string;
67
69
  /** Переводит компонент в контролируемое состояние */
68
70
  isControlled?: boolean;
69
71
  /** Обработчик изменения значения */
@@ -96,6 +96,7 @@ var TextField = function TextField(_ref) {
96
96
  noticeText = _ref.noticeText,
97
97
  inputRef = _ref.inputRef,
98
98
  inputMode = _ref.inputMode,
99
+ autoComplete = _ref.autoComplete,
99
100
  _ref$classes = _ref.classes;
100
101
  _ref$classes = _ref$classes === void 0 ? {} : _ref$classes;
101
102
  var input = _ref$classes.input;
@@ -232,7 +233,8 @@ var TextField = function TextField(_ref) {
232
233
 
233
234
  var inputParams = _extends(_extends({}, commonParams), {
234
235
  className: cn('field', input),
235
- type: isVisiblePassword ? 'text' : type
236
+ type: isVisiblePassword ? 'text' : type,
237
+ autoComplete: autoComplete
236
238
  });
237
239
 
238
240
  var inputMaskParams = {
@@ -370,6 +372,8 @@ TextField.propTypes = {
370
372
  disabled: PropTypes.bool,
371
373
  required: PropTypes.bool,
372
374
  type: PropTypes.oneOf(['text', 'password', 'tel', 'email']),
375
+ inputMode: PropTypes.oneOf(['numeric', 'tel', 'decimal', 'email', 'url', 'search', 'none']),
376
+ autoComplete: PropTypes.string,
373
377
  name: PropTypes.string,
374
378
  placeholder: PropTypes.string,
375
379
  id: PropTypes.string,
@@ -9,6 +9,7 @@ export interface IAccordionProps extends IFilterDataAttrs {
9
9
  /** Состояние открытости */
10
10
  isOpened?: boolean;
11
11
  /** Вертикальные отступы */
12
+ /** @deprecated */
12
13
  hasVerticalPaddings?: boolean;
13
14
  /** Дополнительный класс для корневого элемента */
14
15
  className?: string;
@@ -107,7 +107,9 @@ Accordion.propTypes = {
107
107
  }), PropTypes.any])]),
108
108
  title: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.arrayOf(PropTypes.node)]).isRequired,
109
109
  isOpened: PropTypes.bool,
110
- hasVerticalPaddings: PropTypes.bool,
110
+ hasVerticalPaddings: function hasVerticalPaddings(props, propName) {
111
+ return props[propName] && new Error('Failed prop type: Prop "hasVerticalPaddings" is deprecated');
112
+ },
111
113
  className: PropTypes.string,
112
114
  classes: PropTypes.shape({
113
115
  openedClass: PropTypes.string,
@@ -161,6 +161,7 @@ var Search = function Search(_ref) {
161
161
  e.preventDefault();
162
162
  } else if (e.key === 'Enter' && activeIndex > -1) {
163
163
  handleItemSubmit(activeIndex);
164
+ e.preventDefault();
164
165
  } else if (e.key === 'Enter' && activeIndex === -1) {
165
166
  handleSearchSubmit();
166
167
  }
@@ -62,8 +62,10 @@ export declare type TextFieldProps = {
62
62
  classes?: {
63
63
  input?: string;
64
64
  };
65
- /** Аргумент элемента input */
65
+ /** Атрибут элемента input */
66
66
  inputMode?: 'numeric' | 'tel' | 'decimal' | 'email' | 'url' | 'search' | 'none';
67
+ /** Атрибут элемента input. Не работает с textarea=true */
68
+ autoComplete?: string;
67
69
  /** Переводит компонент в контролируемое состояние */
68
70
  isControlled?: boolean;
69
71
  /** Обработчик изменения значения */
@@ -121,6 +121,7 @@ var TextField = function TextField(_ref) {
121
121
  noticeText = _ref.noticeText,
122
122
  inputRef = _ref.inputRef,
123
123
  inputMode = _ref.inputMode,
124
+ autoComplete = _ref.autoComplete,
124
125
  _ref$classes = _ref.classes;
125
126
  _ref$classes = _ref$classes === void 0 ? {} : _ref$classes;
126
127
  var input = _ref$classes.input;
@@ -256,7 +257,8 @@ var TextField = function TextField(_ref) {
256
257
  };
257
258
  var inputParams = (0, _extends2["default"])((0, _extends2["default"])({}, commonParams), {
258
259
  className: cn('field', input),
259
- type: isVisiblePassword ? 'text' : type
260
+ type: isVisiblePassword ? 'text' : type,
261
+ autoComplete: autoComplete
260
262
  });
261
263
  var inputMaskParams = {
262
264
  mask: mask,
@@ -392,6 +394,8 @@ TextField.propTypes = {
392
394
  disabled: PropTypes.bool,
393
395
  required: PropTypes.bool,
394
396
  type: PropTypes.oneOf(['text', 'password', 'tel', 'email']),
397
+ inputMode: PropTypes.oneOf(['numeric', 'tel', 'decimal', 'email', 'url', 'search', 'none']),
398
+ autoComplete: PropTypes.string,
395
399
  name: PropTypes.string,
396
400
  placeholder: PropTypes.string,
397
401
  id: PropTypes.string,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megafon/ui-core",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "files": [
5
5
  "dist",
6
6
  "styles"
@@ -96,5 +96,5 @@
96
96
  "react-popper": "^2.2.3",
97
97
  "swiper": "^6.5.6"
98
98
  },
99
- "gitHead": "26b2f120bd0f51992981718c28cb8cd8138e1870"
99
+ "gitHead": "135afecf6e64efb26e7a751a6d812609f9c45658"
100
100
  }