@megafon/ui-core 4.16.0 → 4.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,17 @@
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.16.1](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@4.16.0...@megafon/ui-core@4.16.1) (2023-05-23)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **counterbadge:** fix required props ([6824153](https://github.com/MegafonWebLab/megafon-ui/commit/6824153b4f2543eb3961cd408c447c8bcb9cd83d))
12
+
13
+
14
+
15
+
16
+
6
17
  # [4.16.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@4.15.6...@megafon/ui-core@4.16.0) (2023-05-17)
7
18
 
8
19
 
@@ -6,10 +6,10 @@ export declare const CounterBadgeColorTheme: {
6
6
  };
7
7
  declare type CounterBadgeColorThemeType = typeof CounterBadgeColorTheme[keyof typeof CounterBadgeColorTheme];
8
8
  export interface ICounterBadgeProps {
9
- /** Общее/максимальное количество */
10
- totalCount: number;
11
9
  /** Текущее значение */
12
- currentValue?: number;
10
+ currentValue: number;
11
+ /** Максимальное значение */
12
+ totalCount?: number;
13
13
  /** Наличие иконки */
14
14
  hasIcon?: boolean;
15
15
  /** Кастомная иконка */
@@ -34,21 +34,21 @@ var CounterBadge = function CounterBadge(_ref) {
34
34
  dataAttrs = _ref.dataAttrs;
35
35
  return /*#__PURE__*/React.createElement("div", _extends({
36
36
  className: cn({
37
- limited: !!currentValue,
37
+ limited: !!totalCount,
38
38
  adaptive: isAdaptive,
39
39
  theme: colorTheme,
40
40
  icon: hasIcon
41
41
  }, className)
42
42
  }, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), /*#__PURE__*/React.createElement("span", {
43
43
  className: cn('value')
44
- }, !!currentValue && "".concat(currentValue, "/"), totalCount), hasIcon && /*#__PURE__*/React.createElement("div", {
44
+ }, currentValue, !!totalCount && "/".concat(totalCount)), hasIcon && /*#__PURE__*/React.createElement("div", {
45
45
  className: cn('icon')
46
46
  }, customIcon || /*#__PURE__*/React.createElement(DefaultIcon, null)));
47
47
  };
48
48
 
49
49
  CounterBadge.propTypes = {
50
- totalCount: PropTypes.number.isRequired,
51
- currentValue: PropTypes.number,
50
+ totalCount: PropTypes.number,
51
+ currentValue: PropTypes.number.isRequired,
52
52
  customIcon: PropTypes.element,
53
53
  colorTheme: PropTypes.oneOf(Object.values(CounterBadgeColorTheme)),
54
54
  hasIcon: PropTypes.bool,
@@ -6,10 +6,10 @@ export declare const CounterBadgeColorTheme: {
6
6
  };
7
7
  declare type CounterBadgeColorThemeType = typeof CounterBadgeColorTheme[keyof typeof CounterBadgeColorTheme];
8
8
  export interface ICounterBadgeProps {
9
- /** Общее/максимальное количество */
10
- totalCount: number;
11
9
  /** Текущее значение */
12
- currentValue?: number;
10
+ currentValue: number;
11
+ /** Максимальное значение */
12
+ totalCount?: number;
13
13
  /** Наличие иконки */
14
14
  hasIcon?: boolean;
15
15
  /** Кастомная иконка */
@@ -53,21 +53,21 @@ var CounterBadge = function CounterBadge(_ref) {
53
53
  dataAttrs = _ref.dataAttrs;
54
54
  return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({
55
55
  className: cn({
56
- limited: !!currentValue,
56
+ limited: !!totalCount,
57
57
  adaptive: isAdaptive,
58
58
  theme: colorTheme,
59
59
  icon: hasIcon
60
60
  }, className)
61
61
  }, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), /*#__PURE__*/React.createElement("span", {
62
62
  className: cn('value')
63
- }, !!currentValue && "".concat(currentValue, "/"), totalCount), hasIcon && /*#__PURE__*/React.createElement("div", {
63
+ }, currentValue, !!totalCount && "/".concat(totalCount)), hasIcon && /*#__PURE__*/React.createElement("div", {
64
64
  className: cn('icon')
65
65
  }, customIcon || /*#__PURE__*/React.createElement(DefaultIcon, null)));
66
66
  };
67
67
 
68
68
  CounterBadge.propTypes = {
69
- totalCount: PropTypes.number.isRequired,
70
- currentValue: PropTypes.number,
69
+ totalCount: PropTypes.number,
70
+ currentValue: PropTypes.number.isRequired,
71
71
  customIcon: PropTypes.element,
72
72
  colorTheme: PropTypes.oneOf(Object.values(CounterBadgeColorTheme)),
73
73
  hasIcon: PropTypes.bool,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megafon/ui-core",
3
- "version": "4.16.0",
3
+ "version": "4.16.1",
4
4
  "files": [
5
5
  "dist",
6
6
  "styles"
@@ -100,5 +100,5 @@
100
100
  "react-popper": "^2.2.3",
101
101
  "swiper": "^6.5.6"
102
102
  },
103
- "gitHead": "7e5ec2880019da52a81060df8e96320269ab5f2f"
103
+ "gitHead": "511c2426a2f60050064028622ccbd0312198286a"
104
104
  }