@synerise/ds-progress-bar 0.6.2 → 0.6.3

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,14 @@
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
+ ## [0.6.3](https://github.com/Synerise/synerise-design/compare/@synerise/ds-progress-bar@0.6.2...@synerise/ds-progress-bar@0.6.3) (2021-11-22)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-progress-bar
9
+
10
+
11
+
12
+
13
+
6
14
  ## [0.6.2](https://github.com/Synerise/synerise-design/compare/@synerise/ds-progress-bar@0.6.1...@synerise/ds-progress-bar@0.6.2) (2021-11-16)
7
15
 
8
16
  **Note:** Version bump only for package @synerise/ds-progress-bar
@@ -17,7 +17,7 @@ var Multivalue = function Multivalue(props) {
17
17
  /*#__PURE__*/
18
18
  // eslint-disable-next-line react/no-array-index-key
19
19
  React.createElement(S.Multivalue, {
20
- key: "".concat(val.color, "-").concat(val.percent, "-").concat(index),
20
+ key: val.color + "-" + val.percent + "-" + index,
21
21
  color: val.color,
22
22
  percent: normalizePercent(val.percent)
23
23
  })
@@ -1,90 +1,68 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
1
+ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
2
2
 
3
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
-
5
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
6
-
7
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
8
-
9
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
10
-
11
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
12
-
13
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
14
-
15
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
16
-
17
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
18
-
19
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
20
-
21
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
3
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
22
4
 
23
5
  import * as React from 'react';
24
6
  import * as S from './ProgressBar.styles';
25
7
 
26
8
  var ProgressBar = /*#__PURE__*/function (_React$PureComponent) {
27
- _inherits(ProgressBar, _React$PureComponent);
28
-
29
- var _super = _createSuper(ProgressBar);
9
+ _inheritsLoose(ProgressBar, _React$PureComponent);
30
10
 
31
11
  function ProgressBar() {
32
- _classCallCheck(this, ProgressBar);
33
-
34
- return _super.apply(this, arguments);
12
+ return _React$PureComponent.apply(this, arguments) || this;
35
13
  }
36
14
 
37
- _createClass(ProgressBar, [{
38
- key: "render",
39
- value: function render() {
40
- var _this$props = this.props,
41
- showLabel = _this$props.showLabel,
42
- description = _this$props.description,
43
- amount = _this$props.amount,
44
- percent = _this$props.percent,
45
- type = _this$props.type,
46
- status = _this$props.status,
47
- strokeColor = _this$props.strokeColor,
48
- strokeLinecap = _this$props.strokeLinecap,
49
- className = _this$props.className,
50
- thick = _this$props.thick,
51
- labelFormatter = _this$props.labelFormatter,
52
- containerStyles = _this$props.containerStyles;
53
- return /*#__PURE__*/React.createElement(S.Container, {
54
- className: "".concat(className || '', " progress-bar-container"),
55
- "data-testid": "progress-bar-container",
56
- style: containerStyles
57
- }, showLabel && (labelFormatter ? labelFormatter(amount, percent) : /*#__PURE__*/React.createElement("span", {
58
- className: "progress-bar-label",
59
- "data-testid": "progress-bar-label"
60
- }, /*#__PURE__*/React.createElement(S.MaxValue, {
61
- "data-testid": "progress-bar-max-value"
62
- }, amount), /*#__PURE__*/React.createElement("span", {
63
- "data-testid": "progress-bar-max-percent"
64
- }, " (".concat(percent, "%)")))), /*#__PURE__*/React.createElement(S.AntdProgressBar, {
65
- percent: percent,
66
- type: type,
67
- thick: thick,
68
- status: status,
69
- strokeColor: strokeColor,
70
- strokeLinecap: strokeLinecap,
71
- showInfo: false
72
- }), description && /*#__PURE__*/React.createElement("span", {
73
- className: "progress-bar-description",
74
- "data-testid": "progress-bar-description"
75
- }, description));
76
- }
77
- }]);
15
+ var _proto = ProgressBar.prototype;
16
+
17
+ _proto.render = function render() {
18
+ var _this$props = this.props,
19
+ showLabel = _this$props.showLabel,
20
+ description = _this$props.description,
21
+ amount = _this$props.amount,
22
+ percent = _this$props.percent,
23
+ type = _this$props.type,
24
+ status = _this$props.status,
25
+ strokeColor = _this$props.strokeColor,
26
+ strokeLinecap = _this$props.strokeLinecap,
27
+ className = _this$props.className,
28
+ thick = _this$props.thick,
29
+ labelFormatter = _this$props.labelFormatter,
30
+ containerStyles = _this$props.containerStyles;
31
+ return /*#__PURE__*/React.createElement(S.Container, {
32
+ className: (className || '') + " progress-bar-container",
33
+ "data-testid": "progress-bar-container",
34
+ style: containerStyles
35
+ }, showLabel && (labelFormatter ? labelFormatter(amount, percent) : /*#__PURE__*/React.createElement("span", {
36
+ className: "progress-bar-label",
37
+ "data-testid": "progress-bar-label"
38
+ }, /*#__PURE__*/React.createElement(S.MaxValue, {
39
+ "data-testid": "progress-bar-max-value"
40
+ }, amount), /*#__PURE__*/React.createElement("span", {
41
+ "data-testid": "progress-bar-max-percent"
42
+ }, " (" + percent + "%)"))), /*#__PURE__*/React.createElement(S.AntdProgressBar, {
43
+ percent: percent,
44
+ type: type,
45
+ thick: thick,
46
+ status: status,
47
+ strokeColor: strokeColor,
48
+ strokeLinecap: strokeLinecap,
49
+ showInfo: false
50
+ }), description && /*#__PURE__*/React.createElement("span", {
51
+ className: "progress-bar-description",
52
+ "data-testid": "progress-bar-description"
53
+ }, description));
54
+ };
78
55
 
79
56
  return ProgressBar;
80
57
  }(React.PureComponent);
81
58
 
82
- ProgressBar.defaultProps = {
59
+ _defineProperty(ProgressBar, "defaultProps", {
83
60
  type: 'line',
84
61
  status: 'normal',
85
62
  strokeLinecap: 'round',
86
63
  strokeColor: '#76dc25',
87
64
  showLabel: false,
88
65
  description: ''
89
- };
66
+ });
67
+
90
68
  export default ProgressBar;
@@ -1,15 +1,3 @@
1
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
-
3
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
-
5
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
-
7
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
8
-
9
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
10
-
11
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
12
-
13
1
  import * as React from 'react';
14
2
  import { Label } from '@synerise/ds-typography';
15
3
  import * as S from './ProgressTiles.styles';
@@ -25,12 +13,12 @@ export var ProgressTiles = function ProgressTiles(_ref) {
25
13
  var currentProgress = percent / tileWidthRatio;
26
14
  var tileWidths = Array(Math.floor(currentProgress)).fill(1);
27
15
  var lastTileWidth = currentProgress % 1;
28
- var tilesWidthRatios = [].concat(_toConsumableArray(tileWidths), [lastTileWidth]);
16
+ var tilesWidthRatios = [].concat(tileWidths, [lastTileWidth]);
29
17
  return colors.map(function (color, i) {
30
18
  return {
31
19
  key: i,
32
20
  color: color,
33
- width: "".concat((tilesWidthRatios[i] || 0) * MAX_PERCENT, "%")
21
+ width: (tilesWidthRatios[i] || 0) * MAX_PERCENT + "%"
34
22
  };
35
23
  });
36
24
  }, [colors, percent]);
@@ -40,7 +28,7 @@ export var ProgressTiles = function ProgressTiles(_ref) {
40
28
  className: "progress-bar-wrapper"
41
29
  }, getTilesConfig().map(function (tile) {
42
30
  return /*#__PURE__*/React.createElement(S.TileContainer, {
43
- key: "key-".concat(tile.key),
31
+ key: "key-" + tile.key,
44
32
  width: tileWidth
45
33
  }, /*#__PURE__*/React.createElement(S.TileProgress, {
46
34
  color: tile.color,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-progress-bar",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "description": "Progress-Bar UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -32,7 +32,7 @@
32
32
  ],
33
33
  "types": "dist/index.d.ts",
34
34
  "dependencies": {
35
- "@synerise/ds-typography": "^0.12.1"
35
+ "@synerise/ds-typography": "^0.12.2"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "@synerise/ds-core": "*",
@@ -40,7 +40,7 @@
40
40
  "react": ">=16.9.0 < 17.0.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@synerise/ds-utils": "^0.21.2"
43
+ "@synerise/ds-utils": "^0.21.3"
44
44
  },
45
- "gitHead": "8e667a88a48d774c550ff4766de71c4aab01f5a9"
45
+ "gitHead": "2468359677783819939fb9f1ef5acc36667ecd1a"
46
46
  }