@onepercentio/one-ui 0.20.2 → 0.20.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.
Files changed (116) hide show
  1. package/.babelrc +0 -5
  2. package/.prod.babelrc +2 -8
  3. package/dist/components/AdaptiveButton/AdaptiveButton.js +2 -2
  4. package/dist/components/AdaptiveContainer/AdaptiveContainer.js +26 -26
  5. package/dist/components/AdaptiveDialog/AdaptiveDialog.js +9 -9
  6. package/dist/components/AdaptiveSidebar/AdaptiveSidebar.js +14 -14
  7. package/dist/components/AnchoredTooltip/AnchoredTooltip.js +30 -30
  8. package/dist/components/AnimatedEntrance/AnimatedEntrance.js +40 -27
  9. package/dist/components/AsyncWrapper/AsyncWrapper.js +2 -2
  10. package/dist/components/Avatar/Avatar.js +4 -4
  11. package/dist/components/BucketFill/BucketFill.js +9 -9
  12. package/dist/components/Button/Button.js +4 -4
  13. package/dist/components/Card/Card.js +1 -1
  14. package/dist/components/Chart/Chart.view.js +35 -34
  15. package/dist/components/CheckBox/CheckBox.js +3 -3
  16. package/dist/components/Collapsable/Collapsable.js +18 -18
  17. package/dist/components/Countdown/Countdown.js +16 -16
  18. package/dist/components/Divider/Divider.js +1 -1
  19. package/dist/components/EmailInput/EmailInput.js +4 -4
  20. package/dist/components/FadeIn/FadeIn.js +9 -9
  21. package/dist/components/FileInput/FileInput.js +6 -6
  22. package/dist/components/FileInput/View/BigFactory/BigFactory.js +1 -1
  23. package/dist/components/FileInput/View/Compact/Compact.js +6 -6
  24. package/dist/components/FlowController/FlowController.js +4 -4
  25. package/dist/components/Form/Form.js +29 -18
  26. package/dist/components/Freeze/Freeze.js +1 -1
  27. package/dist/components/HSForms/HSForms.js +7 -7
  28. package/dist/components/Header/Header.js +8 -8
  29. package/dist/components/HeaderCloseBtn/HeaderCloseBtn.js +1 -1
  30. package/dist/components/InfinityScroll/InfinityScroll.js +25 -25
  31. package/dist/components/Input/Input.js +13 -13
  32. package/dist/components/InstantCounter/InstantCounter.js +9 -9
  33. package/dist/components/LavaLamp/LavaLamp.data.js +25 -25
  34. package/dist/components/LavaLamp/LavaLamp.js +12 -5
  35. package/dist/components/LavaLamp/v2/LavaLamp.js +45 -29
  36. package/dist/components/LinkToId/LinkToId.js +7 -7
  37. package/dist/components/Loader/Loader.js +2 -2
  38. package/dist/components/LoaderDotsIndicator/LoaderDotsIndicator.js +6 -6
  39. package/dist/components/LoopableVideo/LoopableVideo.js +4 -4
  40. package/dist/components/MainGrid/MainGrid.js +2 -2
  41. package/dist/components/MutableHamburgerButton/MutableHamburgerButton.js +2 -2
  42. package/dist/components/Notification/Notification.js +1 -1
  43. package/dist/components/OrderableList/OrderableList.js +141 -112
  44. package/dist/components/PaginationIndicator/PaginationIndicator.js +50 -50
  45. package/dist/components/Parallax/Parallax.js +39 -39
  46. package/dist/components/Parallax/math/helpers.js +19 -18
  47. package/dist/components/PasswordInput/PasswordInput.js +10 -10
  48. package/dist/components/PingPongText/PingPongText.js +15 -15
  49. package/dist/components/PixelatedScan/PixelatedScan.js +20 -19
  50. package/dist/components/Portal/Portal.js +10 -10
  51. package/dist/components/ProgressBar/ProgressBar.js +6 -6
  52. package/dist/components/ProgressTexts/ProgressTexts.js +3 -3
  53. package/dist/components/Radio/Radio.js +3 -3
  54. package/dist/components/SectionContainer/SectionContainer.js +1 -1
  55. package/dist/components/Select/Select.js +13 -13
  56. package/dist/components/Skeleton/Skeleton.js +1 -1
  57. package/dist/components/Spacing/Spacing.js +1 -1
  58. package/dist/components/StaticScroller/StaticScroller.js +12 -12
  59. package/dist/components/Switch/Switch.js +2 -2
  60. package/dist/components/Table/Table.js +11 -11
  61. package/dist/components/Tabs/Tabs.js +3 -3
  62. package/dist/components/Text/Text.js +5 -5
  63. package/dist/components/Transition/MasksFactory/DiagonalReveal.js +5 -5
  64. package/dist/components/Transition/MasksFactory/DiagonalSquareToBalls.js +17 -17
  65. package/dist/components/Transition/MasksFactory/PhysicsSquares.js +13 -13
  66. package/dist/components/Transition/MasksFactory/SquareToBalls.js +9 -9
  67. package/dist/components/Transition/MasksFactory/utils.js +8 -8
  68. package/dist/components/Transition/Transition.js +49 -49
  69. package/dist/components/UncontrolledTransition/UncontrolledTransition.js +7 -7
  70. package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.js +82 -44
  71. package/dist/components/utilitary/ScrollAndFocusLock/ScrollAndFocusLock.js +6 -6
  72. package/dist/context/AsyncProcess.js +42 -19
  73. package/dist/context/CustomBrowserRouter.js +6 -6
  74. package/dist/context/OneUIProvider.js +15 -15
  75. package/dist/hooks/logs/useDependencyChangeDetection.js +5 -2
  76. package/dist/hooks/persistence/useLocalStorage.js +7 -6
  77. package/dist/hooks/shims/ObjectWatchShim.js +15 -1
  78. package/dist/hooks/ui/useAdaptiveImage.js +6 -6
  79. package/dist/hooks/ui/useBreakpoint.js +5 -5
  80. package/dist/hooks/ui/useCustomScrollbar.js +2 -2
  81. package/dist/hooks/ui/useMouseHover.js +4 -4
  82. package/dist/hooks/ui/usePaginationControls.d.ts +2 -1
  83. package/dist/hooks/ui/usePaginationControls.js +42 -40
  84. package/dist/hooks/ui/useSnapToViewport.js +3 -3
  85. package/dist/hooks/ui/useTilt.js +38 -38
  86. package/dist/hooks/ui/useZoomable.js +46 -38
  87. package/dist/hooks/ui/useZoomable.module.scss +2 -2
  88. package/dist/hooks/useAsyncControl.js +39 -22
  89. package/dist/hooks/useContainedRepositioning.js +22 -22
  90. package/dist/hooks/useCustomHistory.js +2 -2
  91. package/dist/hooks/useElementFit.js +6 -6
  92. package/dist/hooks/useFirestoreWatch.js +39 -26
  93. package/dist/hooks/useForm.js +8 -8
  94. package/dist/hooks/useFreeze.js +1 -1
  95. package/dist/hooks/useHero.d.ts +2 -2
  96. package/dist/hooks/useHero.js +96 -74
  97. package/dist/hooks/useIntersection.js +4 -4
  98. package/dist/hooks/useMergeRefs.js +7 -3
  99. package/dist/hooks/useObserve.js +8 -4
  100. package/dist/hooks/usePagination.js +59 -39
  101. package/dist/hooks/usePooledOperation.js +22 -8
  102. package/dist/hooks/usePooling.js +33 -17
  103. package/dist/hooks/useRebound.js +5 -5
  104. package/dist/hooks/useShortIntl.js +13 -13
  105. package/dist/hooks/utility/useEvents.js +5 -5
  106. package/dist/hooks/utility/useModule.js +3 -3
  107. package/dist/hooks/utility/useQuery.js +1 -1
  108. package/dist/models/DebugLogger.js +2 -2
  109. package/dist/models/GenericContract.js +1 -1
  110. package/dist/storybookUtils/index.js +1 -1
  111. package/dist/utility.d.js +6 -6
  112. package/dist/utils/blockchain.js +105 -32
  113. package/dist/utils/flatten.js +3 -3
  114. package/dist/utils/html.utils.js +1 -1
  115. package/package.json +2 -1
  116. package/dist/hooks/ui/usePaginationControls.e2e.d.ts +0 -4
@@ -14,14 +14,14 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
14
14
  * A simple avatar that shows the image of the user or it's initials as fallback
15
15
  **/
16
16
  function Avatar(_ref) {
17
- let name = _ref.name,
17
+ var name = _ref.name,
18
18
  imgSrc = _ref.imgSrc,
19
19
  _ref$size = _ref.size,
20
20
  size = _ref$size === void 0 ? 48 : _ref$size;
21
- const initials = (0, _react.useMemo)(function () {
22
- const nameParts = name.trim().split(" ");
21
+ var initials = (0, _react.useMemo)(function () {
22
+ var nameParts = name.trim().split(" ");
23
23
  if (nameParts.length === 1) return nameParts[0].charAt(0).toUpperCase();
24
- const _ref2 = [nameParts[0], nameParts.slice(-1)[0]],
24
+ var _ref2 = [nameParts[0], nameParts.slice(-1)[0]],
25
25
  firstName = _ref2[0],
26
26
  lastName = _ref2[1];
27
27
  return "".concat(firstName.charAt(0)).concat(lastName.charAt(0)).toUpperCase();
@@ -17,17 +17,17 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
17
17
  * IT IS NOT READY (AND PROBABLY NEVER WILL) FOR FRAGMENT NODES
18
18
  **/
19
19
  function BucketFill(_ref) {
20
- let children = _ref.children,
20
+ var children = _ref.children,
21
21
  background = _ref.background,
22
22
  fillTo = _ref.fillTo;
23
- const rootRef = (0, _react.useRef)(null);
23
+ var rootRef = (0, _react.useRef)(null);
24
24
  function resize() {
25
- const childs = rootRef.current.children;
26
- const s = rootRef.current.style;
27
- const elementAtPosition = fillTo === 0 ? null : childs.item(fillTo - 1);
28
- const elementOffsetAndHeight = elementAtPosition === null ? 0 : elementAtPosition.offsetTop + elementAtPosition.clientHeight;
29
- const elementRootHeight = rootRef.current.clientHeight;
30
- const percentToFill = Math.min(elementOffsetAndHeight * 100 / elementRootHeight, 100);
25
+ var childs = rootRef.current.children;
26
+ var s = rootRef.current.style;
27
+ var elementAtPosition = fillTo === 0 ? null : childs.item(fillTo - 1);
28
+ var elementOffsetAndHeight = elementAtPosition === null ? 0 : elementAtPosition.offsetTop + elementAtPosition.clientHeight;
29
+ var elementRootHeight = rootRef.current.clientHeight;
30
+ var percentToFill = Math.min(elementOffsetAndHeight * 100 / elementRootHeight, 100);
31
31
  s.setProperty("--fill-height", "".concat(percentToFill, "%"));
32
32
  s.setProperty("--empty-height", "".concat(100 - percentToFill, "%"));
33
33
  s.setProperty("--bg-offset", "".concat(percentToFill === 100 ? -1000 : 100 / ((100 - percentToFill) / 100), "%"));
@@ -48,7 +48,7 @@ function BucketFill(_ref) {
48
48
  }, children);
49
49
  }
50
50
  function IgnoreFill(_ref2) {
51
- let children = _ref2.children;
51
+ var children = _ref2.children;
52
52
  return /*#__PURE__*/_react.default.createElement("div", {
53
53
  className: _BucketFillModule.default.ignoreFill
54
54
  }, children);
@@ -9,7 +9,7 @@ exports.default = void 0;
9
9
  var _react = _interopRequireWildcard(require("react"));
10
10
  var _OneUIProvider = require("../../context/OneUIProvider");
11
11
  var _ButtonModule = _interopRequireDefault(require("./Button.module.scss"));
12
- const _excluded = ["children", "variant", "className"];
12
+ var _excluded = ["children", "variant", "className"];
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
14
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
15
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -20,14 +20,14 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
20
20
  * A simple button with the new design
21
21
  **/
22
22
  function _Button(_ref, ref) {
23
- let children = _ref.children,
23
+ var children = _ref.children,
24
24
  _ref$variant = _ref.variant,
25
25
  variant = _ref$variant === void 0 ? "transparent" : _ref$variant,
26
26
  _ref$className = _ref.className,
27
27
  className = _ref$className === void 0 ? "" : _ref$className,
28
28
  otherProps = _objectWithoutProperties(_ref, _excluded);
29
- const classNameType = (0, _OneUIProvider.useOneUIConfig)("component.button.className", {});
30
- const Component = (0, _OneUIProvider.useOneUIConfig)("component.button.Component", "button");
29
+ var classNameType = (0, _OneUIProvider.useOneUIConfig)("component.button.className", {});
30
+ var Component = (0, _OneUIProvider.useOneUIConfig)("component.button.Component", "button");
31
31
  return /*#__PURE__*/_react.default.createElement(Component, _extends({
32
32
  ref: ref,
33
33
  className: "".concat(_ButtonModule.default.button, " ").concat(_ButtonModule.default[variant], " ").concat(className, " ").concat(classNameType[variant] || ""),
@@ -11,7 +11,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
11
11
  * A card layout that holds content
12
12
  **/
13
13
  function Card(_ref) {
14
- let children = _ref.children,
14
+ var children = _ref.children,
15
15
  _ref$className = _ref.className,
16
16
  className = _ref$className === void 0 ? "" : _ref$className;
17
17
  return /*#__PURE__*/_react.default.createElement("div", {
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = ChartView;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  var _ChartModule = _interopRequireDefault(require("./Chart.module.scss"));
10
+ var _Chart = require("./Chart.e2e");
10
11
  var _AnchoredTooltip = _interopRequireDefault(require("../AnchoredTooltip"));
11
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
13
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -15,32 +16,32 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
15
16
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
16
17
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
17
18
  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); }
18
- 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; }
19
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
19
+ 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; }
20
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
20
21
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
21
- const DEFAULT_STYLE = {
22
+ var DEFAULT_STYLE = {
22
23
  lineColor: "#000",
23
24
  pointColor: "#000",
24
25
  textColor: "#fff"
25
26
  };
26
27
  function FloatingTooltip(_ref) {
27
- let children = _ref.children,
28
+ var children = _ref.children,
28
29
  x = _ref.x,
29
30
  y = _ref.y,
30
31
  hoverOnly = _ref.hoverOnly,
31
32
  height = _ref.height,
32
33
  style = _ref.style;
33
- const _useState = (0, _react.useState)(function () {
34
+ var _useState = (0, _react.useState)(function () {
34
35
  return hoverOnly ? false : true;
35
36
  }),
36
37
  _useState2 = _slicedToArray(_useState, 2),
37
38
  ope = _useState2[0],
38
39
  setOpen = _useState2[1];
39
- const ref = (0, _react.useRef)(null);
40
- const circleRef = (0, _react.useRef)(null);
40
+ var ref = (0, _react.useRef)(null);
41
+ var circleRef = (0, _react.useRef)(null);
41
42
  (0, _react.useEffect)(function () {
42
- const animateEl = circleRef.current.children.item(0);
43
- let interval;
43
+ var animateEl = circleRef.current.children.item(0);
44
+ var interval;
44
45
  animateEl.addEventListener("beginEvent", function () {
45
46
  interval = setInterval(function () {
46
47
  return ref.current.updatePosition();
@@ -51,7 +52,7 @@ function FloatingTooltip(_ref) {
51
52
  ref.current.updatePosition();
52
53
  });
53
54
  }, []);
54
- const actions = (0, _react.useMemo)(function () {
55
+ var actions = (0, _react.useMemo)(function () {
55
56
  return hoverOnly ? {
56
57
  onMouseEnter: function onMouseEnter() {
57
58
  return setOpen(true);
@@ -90,7 +91,7 @@ function FloatingTooltip(_ref) {
90
91
  * Draws a simple line chart with some animation
91
92
  **/
92
93
  function ChartView(_ref2) {
93
- let _ref2$bounds = _slicedToArray(_ref2.bounds, 2),
94
+ var _ref2$bounds = _slicedToArray(_ref2.bounds, 2),
94
95
  _ref2$bounds$ = _slicedToArray(_ref2$bounds[0], 3),
95
96
  startX = _ref2$bounds$[0],
96
97
  endX = _ref2$bounds$[1],
@@ -106,52 +107,52 @@ function ChartView(_ref2) {
106
107
  label = _ref2.label,
107
108
  _ref2$style = _ref2.style,
108
109
  groupStyle = _ref2$style === void 0 ? [] : _ref2$style;
109
- const _useState3 = (0, _react.useState)(),
110
+ var _useState3 = (0, _react.useState)(),
110
111
  _useState4 = _slicedToArray(_useState3, 2),
111
112
  dim = _useState4[0],
112
113
  setDIm = _useState4[1];
113
- const chartRef = (0, _react.useRef)(null);
114
+ var chartRef = (0, _react.useRef)(null);
114
115
  (0, _react.useLayoutEffect)(function () {
115
116
  setDIm({
116
117
  width: chartRef.current.clientWidth,
117
118
  height: chartRef.current.clientHeight
118
119
  });
119
120
  }, []);
120
- const _ref3 = dim || {},
121
+ var _ref3 = dim || {},
121
122
  width = _ref3.width,
122
123
  height = _ref3.height;
123
- const howMuchStepsY = (0, _react.useMemo)(function () {
124
+ var howMuchStepsY = (0, _react.useMemo)(function () {
124
125
  return (endY - startY) / stepsY + 1;
125
126
  }, [endY, startY, stepsY]);
126
- const yAxis = (0, _react.useMemo)(function () {
127
+ var yAxis = (0, _react.useMemo)(function () {
127
128
  return new Array(howMuchStepsY).fill(undefined).map(function (_, i) {
128
129
  return /*#__PURE__*/_react.default.createElement("span", null, label.y(endY - i * stepsY));
129
130
  });
130
131
  }, [startY, endY, stepsY, howMuchStepsY]);
131
- const howMuchStepsX = (0, _react.useMemo)(function () {
132
+ var howMuchStepsX = (0, _react.useMemo)(function () {
132
133
  return (endX - startX) / stepsX + 1;
133
134
  }, [endX, startX, stepsX]);
134
- const xAxis = (0, _react.useMemo)(function () {
135
+ var xAxis = (0, _react.useMemo)(function () {
135
136
  return new Array(howMuchStepsX).fill(undefined).map(function (_, i) {
136
137
  return /*#__PURE__*/_react.default.createElement("span", null, label.x(startX + i * stepsX));
137
138
  });
138
139
  }, [startX, endX, stepsX]);
139
- const _useMemo = (0, _react.useMemo)(function () {
140
- const calculate = function calculate(end, start) {
141
- let overrideScale = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 100;
140
+ var _useMemo = (0, _react.useMemo)(function () {
141
+ var calculate = function calculate(end, start) {
142
+ var overrideScale = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 100;
142
143
  return function (point) {
143
- const max = end - start;
144
- const current = point - start;
144
+ var max = end - start;
145
+ var current = point - start;
145
146
  return current * overrideScale / max;
146
147
  };
147
148
  };
148
- const calculateX = calculate(endX, startX, width);
149
- const calculateY = calculate(endY, startY, height);
149
+ var calculateX = calculate(endX, startX, width);
150
+ var calculateY = calculate(endY, startY, height);
150
151
  return {
151
152
  tooltips: points.map(function (pointsCategory, i) {
152
- const style = groupStyle[i] || DEFAULT_STYLE;
153
+ var style = groupStyle[i] || DEFAULT_STYLE;
153
154
  return pointsCategory.map(function (_ref4) {
154
- let _ref5 = _slicedToArray(_ref4, 4),
155
+ var _ref5 = _slicedToArray(_ref4, 4),
155
156
  x = _ref5[0],
156
157
  y = _ref5[1],
157
158
  label = _ref5[2],
@@ -167,10 +168,10 @@ function ChartView(_ref2) {
167
168
  });
168
169
  }),
169
170
  polylines: data.map(function (lineData, i) {
170
- const style = groupStyle[i] || DEFAULT_STYLE;
171
- const calculateLines = function calculateLines(yOverride) {
171
+ var style = groupStyle[i] || DEFAULT_STYLE;
172
+ var calculateLines = function calculateLines(yOverride) {
172
173
  return lineData.map(function (_ref6) {
173
- let _ref7 = _slicedToArray(_ref6, 2),
174
+ var _ref7 = _slicedToArray(_ref6, 2),
174
175
  x = _ref7[0],
175
176
  y = _ref7[1];
176
177
  return "".concat(calculateX(x), ",").concat(yOverride === undefined ? height - calculateY(y) : yOverride);
@@ -196,12 +197,12 @@ function ChartView(_ref2) {
196
197
  }, [data, width, height]),
197
198
  polylines = _useMemo.polylines,
198
199
  tooltips = _useMemo.tooltips;
199
- const paddingY = (0, _react.useMemo)(function () {
200
- const stepSizeY = height / (howMuchStepsY - 1);
200
+ var paddingY = (0, _react.useMemo)(function () {
201
+ var stepSizeY = height / (howMuchStepsY - 1);
201
202
  return stepSizeY / 2;
202
203
  }, [howMuchStepsY, height]);
203
- const paddingX = (0, _react.useMemo)(function () {
204
- const stepSizeX = width / (howMuchStepsX - 1);
204
+ var paddingX = (0, _react.useMemo)(function () {
205
+ var stepSizeX = width / (howMuchStepsX - 1);
205
206
  return stepSizeX / 2;
206
207
  }, [howMuchStepsX, width]);
207
208
  return /*#__PURE__*/_react.default.createElement("div", {
@@ -7,7 +7,7 @@ exports.default = CheckBox;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _OneUIProvider = require("../../context/OneUIProvider");
9
9
  var _CheckBoxModule = _interopRequireDefault(require("./CheckBox.module.scss"));
10
- const _excluded = ["checked", "onToggle", "label", "className", "size", "groupId", "value"];
10
+ var _excluded = ["checked", "onToggle", "label", "className", "size", "groupId", "value"];
11
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
12
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
13
13
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
@@ -16,7 +16,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
16
16
  * A simple checkbox with nissan guidelines
17
17
  **/
18
18
  function CheckBox(_ref) {
19
- let checked = _ref.checked,
19
+ var checked = _ref.checked,
20
20
  onToggle = _ref.onToggle,
21
21
  label = _ref.label,
22
22
  _ref$className = _ref.className,
@@ -26,7 +26,7 @@ function CheckBox(_ref) {
26
26
  groupId = _ref.groupId,
27
27
  value = _ref.value,
28
28
  props = _objectWithoutProperties(_ref, _excluded);
29
- const Checkbox = (0, _OneUIProvider.useOneUIConfig)("component.checkbox.Component", "span");
29
+ var Checkbox = (0, _OneUIProvider.useOneUIConfig)("component.checkbox.Component", "span");
30
30
  return /*#__PURE__*/_react.default.createElement("label", {
31
31
  className: "".concat(_CheckBoxModule.default.container, " ").concat(className),
32
32
  style: {
@@ -10,7 +10,7 @@ var _FadeIn = _interopRequireDefault(require("../FadeIn"));
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
  var _CollapsableModule = _interopRequireDefault(require("./Collapsable.module.scss"));
12
12
  var _AnchoredTooltip = require("../AnchoredTooltip/AnchoredTooltip");
13
- const _excluded = ["children", "title", "className", "onToggleOpen", "open", "id", "mode", "contentClassName", "onContentClick", "keepUnderlayingElement", "onClickOut"];
13
+ var _excluded = ["children", "title", "className", "onToggleOpen", "open", "id", "mode", "contentClassName", "onContentClick", "keepUnderlayingElement", "onClickOut"];
14
14
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
15
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -29,7 +29,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
29
29
  * Wrapps some content on a collapsable header
30
30
  **/
31
31
  function Collapsable(_ref, ref) {
32
- let children = _ref.children,
32
+ var children = _ref.children,
33
33
  title = _ref.title,
34
34
  className = _ref.className,
35
35
  onToggleOpen = _ref.onToggleOpen,
@@ -42,8 +42,8 @@ function Collapsable(_ref, ref) {
42
42
  keepUnderlayingElement = _ref.keepUnderlayingElement,
43
43
  onClickOut = _ref.onClickOut,
44
44
  props = _objectWithoutProperties(_ref, _excluded);
45
- const contentRef = (0, _react.useRef)(null);
46
- const toggleRef = (0, _react.useRef)(null);
45
+ var contentRef = (0, _react.useRef)(null);
46
+ var toggleRef = (0, _react.useRef)(null);
47
47
  (0, _react.useEffect)(function () {
48
48
  if (open && onClickOut) {
49
49
  window.addEventListener("click", onClickOut);
@@ -53,23 +53,23 @@ function Collapsable(_ref, ref) {
53
53
  }
54
54
  }, [!!onClickOut, open]);
55
55
  function _redimension() {
56
- let canShrink = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
57
- const el = contentRef.current;
58
- const contentEl = el.firstElementChild;
56
+ var canShrink = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
57
+ var el = contentRef.current;
58
+ var contentEl = el.firstElementChild;
59
59
  if (open) {
60
60
  el.style.marginTop = "";
61
61
  el.style.height = Math.min(canShrink ? contentEl.clientHeight : Number.POSITIVE_INFINITY, el.scrollHeight, visualViewport.height - 16) + "px";
62
62
  el.parentElement.style.position = "relative";
63
63
  if (mode === "float") {
64
64
  el.style.minHeight = el.style.height;
65
- const _updateTooltipPositio = (0, _AnchoredTooltip.updateTooltipPosition)(el, toggleRef.current, true, "alignTo" in props ? props.alignTo : _AnchoredTooltip.AnchoredTooltipAlignment.CENTER, "anchorTo" in props ? props.anchorTo : undefined),
65
+ var _updateTooltipPositio = (0, _AnchoredTooltip.updateTooltipPosition)(el, toggleRef.current, true, "alignTo" in props ? props.alignTo : _AnchoredTooltip.AnchoredTooltipAlignment.CENTER, "anchorTo" in props ? props.anchorTo : undefined),
66
66
  shouldAnchorToBottom = _updateTooltipPositio.shouldAnchorToBottom;
67
67
  el.style.minHeight = "";
68
68
  if (!shouldAnchorToBottom) {
69
69
  el.style.marginTop = el.style.height;
70
70
  }
71
- const transitionStart = function transitionStart(_ref2) {
72
- let currentTarget = _ref2.currentTarget,
71
+ var transitionStart = function transitionStart(_ref2) {
72
+ var currentTarget = _ref2.currentTarget,
73
73
  target = _ref2.target,
74
74
  propertyName = _ref2.propertyName;
75
75
  if (currentTarget === target && propertyName == "height" && !shouldAnchorToBottom) {
@@ -82,7 +82,7 @@ function Collapsable(_ref, ref) {
82
82
  return el.removeEventListener("transitionstart", transitionStart);
83
83
  };
84
84
  }
85
- const onTransitionEnd = function onTransitionEnd() {
85
+ var onTransitionEnd = function onTransitionEnd() {
86
86
  el.style.height = "auto";
87
87
  };
88
88
  el.addEventListener("transitionend", onTransitionEnd);
@@ -98,14 +98,14 @@ function Collapsable(_ref, ref) {
98
98
  if (el.style.marginTop === "0px") el.style.marginTop = "".concat(el.clientHeight, "px");
99
99
  el.style.height = 0 + "px";
100
100
  }, 100);
101
- const onTransitionEnd = function onTransitionEnd() {
101
+ var _onTransitionEnd = function _onTransitionEnd() {
102
102
  el.parentElement.style.position = "initial";
103
103
  el.classList.remove(_CollapsableModule.default.transitionMarginTop);
104
- el.removeEventListener("transitionend", onTransitionEnd);
104
+ el.removeEventListener("transitionend", _onTransitionEnd);
105
105
  };
106
- el.addEventListener("transitionend", onTransitionEnd);
106
+ el.addEventListener("transitionend", _onTransitionEnd);
107
107
  return function () {
108
- el.removeEventListener("transitionend", onTransitionEnd);
108
+ el.removeEventListener("transitionend", _onTransitionEnd);
109
109
  };
110
110
  }
111
111
  }
@@ -119,7 +119,7 @@ function Collapsable(_ref, ref) {
119
119
  (0, _react.useLayoutEffect)(function () {
120
120
  _redimension();
121
121
  }, [open]);
122
- const propsToSpread = _objectSpread({}, props);
122
+ var propsToSpread = _objectSpread({}, props);
123
123
  delete propsToSpread.alignTo;
124
124
  return /*#__PURE__*/_react.default.createElement("div", _extends({
125
125
  className: "".concat(_CollapsableModule.default.container, " ").concat(open ? _CollapsableModule.default.open : _CollapsableModule.default.closed, " ").concat(className)
@@ -143,7 +143,7 @@ function Collapsable(_ref, ref) {
143
143
  function _collapsableId(type, id) {
144
144
  return id ? "collapsable_".concat(type, "_").concat(id) : undefined;
145
145
  }
146
- let _CollapsableInterface = /*#__PURE__*/function () {
146
+ var _CollapsableInterface = /*#__PURE__*/function () {
147
147
  function _CollapsableInterface(id) {
148
148
  _classCallCheck(this, _CollapsableInterface);
149
149
  this._id = id;
@@ -159,7 +159,7 @@ let _CollapsableInterface = /*#__PURE__*/function () {
159
159
  }, {
160
160
  key: "open",
161
161
  value: function open(onOpened) {
162
- const _this$_getElements = this._getElements(),
162
+ var _this$_getElements = this._getElements(),
163
163
  header = _this$_getElements.header,
164
164
  content = _this$_getElements.content;
165
165
  if (((content === null || content === void 0 ? void 0 : content.clientHeight) || 0) === 0) {
@@ -13,23 +13,23 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
13
13
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
14
14
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15
15
  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); }
16
- 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; }
17
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
16
+ 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; }
17
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
18
18
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
19
19
  function calculateTimeFromTimespan(timespan) {
20
- const seconds = Math.floor(timespan / 1000);
21
- const minutes = Math.floor(seconds / 60);
22
- const hours = Math.floor(minutes / 60);
20
+ var seconds = Math.floor(timespan / 1000);
21
+ var minutes = Math.floor(seconds / 60);
22
+ var hours = Math.floor(minutes / 60);
23
23
  return {
24
24
  hours: hours,
25
25
  minutes: minutes % 60,
26
26
  seconds: seconds % 60
27
27
  };
28
28
  }
29
- const IntegerFormatter = new Intl.NumberFormat(undefined, {
29
+ var IntegerFormatter = new Intl.NumberFormat(undefined, {
30
30
  minimumIntegerDigits: 2
31
31
  });
32
- let CountdownTextModel = /*#__PURE__*/function (CountdownTextModel) {
32
+ var CountdownTextModel = /*#__PURE__*/function (CountdownTextModel) {
33
33
  CountdownTextModel[CountdownTextModel["CLOCK"] = 0] = "CLOCK";
34
34
  CountdownTextModel[CountdownTextModel["SHORT"] = 1] = "SHORT";
35
35
  return CountdownTextModel;
@@ -39,12 +39,12 @@ let CountdownTextModel = /*#__PURE__*/function (CountdownTextModel) {
39
39
  **/
40
40
  exports.CountdownTextModel = CountdownTextModel;
41
41
  function Countdown(_ref) {
42
- let timeRemaining = _ref.timeRemaining,
42
+ var timeRemaining = _ref.timeRemaining,
43
43
  onFinish = _ref.onFinish,
44
44
  _ref$model = _ref.model,
45
45
  model = _ref$model === void 0 ? CountdownTextModel.CLOCK : _ref$model,
46
46
  options = _ref.options;
47
- const _useState = (0, _react.useState)(function () {
47
+ var _useState = (0, _react.useState)(function () {
48
48
  return calculateTimeFromTimespan(timeRemaining);
49
49
  }),
50
50
  _useState2 = _slicedToArray(_useState, 2),
@@ -54,11 +54,11 @@ function Countdown(_ref) {
54
54
  setT(calculateTimeFromTimespan(timeRemaining));
55
55
  }, [timeRemaining]);
56
56
  (0, _react.useEffect)(function () {
57
- const cl = setInterval(function () {
57
+ var cl = setInterval(function () {
58
58
  setT(function (prev) {
59
- let nextSecond = prev.seconds - 1;
60
- let nextMinute = prev.minutes;
61
- let nextHour = prev.hours;
59
+ var nextSecond = prev.seconds - 1;
60
+ var nextMinute = prev.minutes;
61
+ var nextHour = prev.hours;
62
62
  if (nextSecond < 0) {
63
63
  nextSecond = 59;
64
64
  nextMinute -= 1;
@@ -82,14 +82,14 @@ function Countdown(_ref) {
82
82
  clearInterval(cl);
83
83
  };
84
84
  }, [timeRemaining]);
85
- const txt = (0, _react.useMemo)(function () {
85
+ var txt = (0, _react.useMemo)(function () {
86
86
  var _options$hours, _options$hours2;
87
87
  switch (model) {
88
88
  case CountdownTextModel.CLOCK:
89
- const hourFragment = ((_options$hours = options === null || options === void 0 ? void 0 : options.hours) !== null && _options$hours !== void 0 ? _options$hours : true) ? "".concat(IntegerFormatter.format(t.hours), ":") : "";
89
+ var hourFragment = ((_options$hours = options === null || options === void 0 ? void 0 : options.hours) !== null && _options$hours !== void 0 ? _options$hours : true) ? "".concat(IntegerFormatter.format(t.hours), ":") : "";
90
90
  return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, "".concat(hourFragment).concat(IntegerFormatter.format(t.minutes), ":").concat(IntegerFormatter.format(t.seconds)));
91
91
  case CountdownTextModel.SHORT:
92
- const hourFragmentS = ((_options$hours2 = options === null || options === void 0 ? void 0 : options.hours) !== null && _options$hours2 !== void 0 ? _options$hours2 : true) ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, IntegerFormatter.format(t.hours), /*#__PURE__*/_react.default.createElement("span", null, "h"), "\xA0") : "";
92
+ var hourFragmentS = ((_options$hours2 = options === null || options === void 0 ? void 0 : options.hours) !== null && _options$hours2 !== void 0 ? _options$hours2 : true) ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, IntegerFormatter.format(t.hours), /*#__PURE__*/_react.default.createElement("span", null, "h"), "\xA0") : "";
93
93
  return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, hourFragmentS, IntegerFormatter.format(t.minutes), /*#__PURE__*/_react.default.createElement("span", null, "m"), "\xA0", IntegerFormatter.format(t.seconds), /*#__PURE__*/_react.default.createElement("span", null, "s"));
94
94
  }
95
95
  }, [t, model]);
@@ -11,7 +11,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
11
11
  * Guess what this does
12
12
  **/
13
13
  function Divider(_ref) {
14
- let _ref$className = _ref.className,
14
+ var _ref$className = _ref.className,
15
15
  className = _ref$className === void 0 ? "" : _ref$className;
16
16
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
17
17
  className: "".concat(_DividerModule.default.container, " ").concat(className)
@@ -15,8 +15,8 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
15
15
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
16
16
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
17
17
  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); }
18
- 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; }
19
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
18
+ 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; }
19
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
20
20
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
21
21
  function validateEmail(email) {
22
22
  return /@.*\./.test(email);
@@ -26,7 +26,7 @@ function validateEmail(email) {
26
26
  * A Input based wrapper to handle inputs of email
27
27
  **/
28
28
  function EmailInput(props, ref) {
29
- const _useState = (0, _react.useState)(props.value ? !validateEmail(props.value) : false),
29
+ var _useState = (0, _react.useState)(props.value ? !validateEmail(props.value) : false),
30
30
  _useState2 = _slicedToArray(_useState, 2),
31
31
  localWarning = _useState2[0],
32
32
  setLocalWarning = _useState2[1];
@@ -41,7 +41,7 @@ function EmailInput(props, ref) {
41
41
  return /*#__PURE__*/_react.default.createElement(_Input.default, _extends({}, props, {
42
42
  error: localWarning ? props.messages.invalidEmail : props.error,
43
43
  onBlur: function onBlur(_ref) {
44
- let value = _ref.target.value;
44
+ var value = _ref.target.value;
45
45
  setLocalWarning(!!value && !validateEmail(value));
46
46
  },
47
47
  onFocus: function onFocus() {
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = void 0;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  var _FadeInModule = _interopRequireDefault(require("./FadeIn.module.scss"));
10
- const _excluded = ["onHidden", "children", "className", "active", "onClick"];
10
+ var _excluded = ["onHidden", "children", "className", "active", "onClick"];
11
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
12
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
13
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -15,8 +15,8 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
15
15
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
16
16
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
17
17
  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); }
18
- 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; }
19
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
18
+ 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; }
19
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
20
20
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
21
21
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
22
22
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
@@ -24,7 +24,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
24
24
  * Receives a children and displays it with a fade in animation, also when it's removed, it hides with a fadeout
25
25
  **/
26
26
  function FadeIn(_ref, divRef) {
27
- let onHidden = _ref.onHidden,
27
+ var onHidden = _ref.onHidden,
28
28
  children = _ref.children,
29
29
  _ref$className = _ref.className,
30
30
  className = _ref$className === void 0 ? "" : _ref$className,
@@ -34,17 +34,17 @@ function FadeIn(_ref, divRef) {
34
34
  if (!divRef) {
35
35
  divRef = /*#__PURE__*/(0, _react.createRef)();
36
36
  }
37
- const _useState = (0, _react.useState)(0),
37
+ var _useState = (0, _react.useState)(0),
38
38
  _useState2 = _slicedToArray(_useState, 2),
39
39
  trigger = _useState2[1];
40
- const prevChildren = (0, _react.useRef)();
40
+ var prevChildren = (0, _react.useRef)();
41
41
  prevChildren.current = children || prevChildren.current;
42
42
  (0, _react.useEffect)(function () {
43
- const el = divRef.current;
44
- const isElHidden = active !== undefined ? !active : !children;
43
+ var el = divRef.current;
44
+ var isElHidden = active !== undefined ? !active : !children;
45
45
  if (isElHidden) {
46
46
  el.classList.remove(_FadeInModule.default.active);
47
- const handler = function handler() {
47
+ var handler = function handler() {
48
48
  prevChildren.current = null;
49
49
  trigger(function (a) {
50
50
  return a + 1;
@@ -8,7 +8,7 @@ exports.default = FileInput;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  var _OneUIProvider = require("../../context/OneUIProvider");
10
10
  var _FileInputModule = _interopRequireDefault(require("./FileInput.module.scss"));
11
- const _excluded = ["onFile"];
11
+ var _excluded = ["onFile"];
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
13
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
14
14
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -19,12 +19,12 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
19
19
  * A component to provide the upload of a file
20
20
  **/
21
21
  function FileInput(_ref) {
22
- let onFile = _ref.onFile,
22
+ var onFile = _ref.onFile,
23
23
  props = _objectWithoutProperties(_ref, _excluded);
24
- const View = (0, _OneUIProvider.useOneUIView)("component.fileInput.View", "FileInput");
25
- const inputRef = (0, _react.useRef)(null);
26
- const onFileSelected = (0, _react.useCallback)(function (e) {
27
- const file = e.target.files.item(0);
24
+ var View = (0, _OneUIProvider.useOneUIView)("component.fileInput.View", "FileInput");
25
+ var inputRef = (0, _react.useRef)(null);
26
+ var onFileSelected = (0, _react.useCallback)(function (e) {
27
+ var file = e.target.files.item(0);
28
28
  onFile(file || undefined);
29
29
  }, []);
30
30
  return /*#__PURE__*/_react.default.createElement(View, _extends({}, props, {
@@ -15,7 +15,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
15
15
  **/
16
16
  function BigFactory(IconComponent) {
17
17
  return function Big(_ref) {
18
- let _ref$states = _ref.states,
18
+ var _ref$states = _ref.states,
19
19
  _ref$states$fileProvi = _ref$states.fileProvided,
20
20
  fileProvided = _ref$states$fileProvi.title,
21
21
  removeFile = _ref$states$fileProvi.button,