@widergy/energy-ui 1.132.2 → 1.132.4

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
@@ -1,3 +1,17 @@
1
+ ## [1.132.4](https://github.com/widergy/energy-ui/compare/v1.132.3...v1.132.4) (2022-11-01)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * show meta error ([#314](https://github.com/widergy/energy-ui/issues/314)) ([53621d3](https://github.com/widergy/energy-ui/commit/53621d345089672181712037427e8ea031af857a))
7
+
8
+ ## [1.132.3](https://github.com/widergy/energy-ui/compare/v1.132.2...v1.132.3) (2022-10-31)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * round fix ([#315](https://github.com/widergy/energy-ui/issues/315)) ([419ea2e](https://github.com/widergy/energy-ui/commit/419ea2e7e705beaa12beebfeecd53109d240a6b4))
14
+
1
15
  ## [1.132.2](https://github.com/widergy/energy-ui/compare/v1.132.1...v1.132.2) (2022-10-31)
2
16
 
3
17
 
@@ -186,8 +186,8 @@ var UTBarChart = function UTBarChart(_ref) {
186
186
  GRAPH_Y_END = _getGraphAttributes.GRAPH_Y_END,
187
187
  GRAPH_Y_START = _getGraphAttributes.GRAPH_Y_START;
188
188
 
189
- var roundedMaxBarValue = (0, _utils.roundMaxValue)(maxBarValue);
190
- var roundedMaxLinearValue = (0, _utils.roundMaxValue)(maxLinearValue);
189
+ var roundedMaxBarValue = Math.round(maxBarValue);
190
+ var roundedMaxLinearValue = Math.round(maxLinearValue);
191
191
  var maxAbsoluteValue = Math.max(roundedMaxBarValue, roundedMaxLinearValue);
192
192
  var yAxis = d3.scaleLinear().domain([0, singleYAxis ? maxAbsoluteValue : roundedMaxBarValue]).range([GRAPH_Y_START, GRAPH_Y_END]);
193
193
  var xAxis = d3.scaleBand().domain(d3.range(formattedData[0].length)).range([GRAPH_X_START, GRAPH_X_END]).padding(barPadding);
@@ -5,7 +5,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.roundMaxValue = exports.getPages = exports.getMinValue = exports.getMaxValues = exports.getMaxValue = exports.getGrid = exports.getGraphAttributes = exports.getFormattedLinearData = exports.getFormattedDecorators = exports.getFormattedData = exports.flattenData = exports.flattenAndReduceBarData = void 0;
8
+ exports.getPages = exports.getMinValue = exports.getMaxValues = exports.getMaxValue = exports.getGrid = exports.getGraphAttributes = exports.getFormattedLinearData = exports.getFormattedDecorators = exports.getFormattedData = exports.flattenData = exports.flattenAndReduceBarData = void 0;
9
9
 
10
10
  var _array = require("@widergy/web-utils/lib/array");
11
11
 
@@ -207,15 +207,4 @@ var getGrid = function getGrid(ticks, maxValue) {
207
207
  });
208
208
  };
209
209
 
210
- exports.getGrid = getGrid;
211
-
212
- var roundMaxValue = function roundMaxValue(maxValue) {
213
- var multipleOf = 5;
214
- var exponent = Math.floor(Math.log(maxValue) / Math.log(multipleOf));
215
- var fraction = maxValue / Math.pow(5, exponent);
216
- var niceFraction;
217
- if (fraction <= 1) niceFraction = 1;else if (fraction <= 2) niceFraction = 2;else niceFraction = multipleOf;
218
- return niceFraction * Math.pow(multipleOf, exponent);
219
- };
220
-
221
- exports.roundMaxValue = roundMaxValue;
210
+ exports.getGrid = getGrid;
@@ -55,7 +55,8 @@ var PasswordValidations = function PasswordValidations(_ref) {
55
55
  }, regex);
56
56
  });
57
57
  var errorsContainerStyle = classes.errorsContainerStyle;
58
- var submitFailed = meta.submitFailed;
58
+ var submitFailed = meta.submitFailed,
59
+ metaError = meta.error;
59
60
  var validations = validatedRegExps.filter(function (_ref3) {
60
61
  var requirement = _ref3.requirement;
61
62
  return requirement;
@@ -64,17 +65,23 @@ var PasswordValidations = function PasswordValidations(_ref) {
64
65
  var requirement = _ref4.requirement;
65
66
  return !requirement;
66
67
  });
67
- var showErrors = errors.some(function (_ref5) {
68
- var assertion = _ref5.assertion,
69
- error = _ref5.error;
70
- return !assertion && !(passwordValidationsWarning !== null && passwordValidationsWarning !== void 0 && passwordValidationsWarning.some(function (_ref6) {
71
- var warningError = _ref6.error;
68
+ if (metaError && !passwordValidations.map(function (_ref5) {
69
+ var error = _ref5.error;
70
+ return error;
71
+ }).includes(metaError)) errors.push({
72
+ error: metaError
73
+ });
74
+ var showErrors = errors.some(function (_ref6) {
75
+ var assertion = _ref6.assertion,
76
+ error = _ref6.error;
77
+ return !assertion && !(passwordValidationsWarning !== null && passwordValidationsWarning !== void 0 && passwordValidationsWarning.some(function (_ref7) {
78
+ var warningError = _ref7.error;
72
79
  return error === warningError;
73
80
  }));
74
81
  });
75
- return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, validations.map(function (_ref7) {
76
- var requirement = _ref7.requirement,
77
- assertion = _ref7.assertion;
82
+ return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, validations.map(function (_ref8) {
83
+ var requirement = _ref8.requirement,
84
+ assertion = _ref8.assertion;
78
85
  return /*#__PURE__*/_react.default.createElement(_Validation.default, {
79
86
  disabled: disabled,
80
87
  ValidationFailedIcon: ValidationFailedIcon,
@@ -88,9 +95,9 @@ var PasswordValidations = function PasswordValidations(_ref) {
88
95
  });
89
96
  }), submitFailed && showErrors && /*#__PURE__*/_react.default.createElement("div", {
90
97
  className: errorsContainerStyle
91
- }, errors.map(function (_ref8) {
92
- var error = _ref8.error,
93
- assertion = _ref8.assertion;
98
+ }, errors.map(function (_ref9) {
99
+ var error = _ref9.error,
100
+ assertion = _ref9.assertion;
94
101
  return /*#__PURE__*/_react.default.createElement(_Error.default, {
95
102
  ErrorIcon: ErrorIcon,
96
103
  classes: classes,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widergy/energy-ui",
3
- "version": "1.132.2",
3
+ "version": "1.132.4",
4
4
  "description": "Widergy Web Components",
5
5
  "author": "widergy",
6
6
  "license": "MIT",