@onepercentio/one-ui 0.20.4 → 0.20.5
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/.babelrc +6 -0
- package/.prod.babelrc +8 -2
- package/dist/components/AdaptiveButton/AdaptiveButton.js +2 -2
- package/dist/components/AdaptiveContainer/AdaptiveContainer.js +26 -26
- package/dist/components/AdaptiveDialog/AdaptiveDialog.js +9 -9
- package/dist/components/AdaptiveSidebar/AdaptiveSidebar.js +14 -14
- package/dist/components/AnchoredTooltip/AnchoredTooltip.js +30 -30
- package/dist/components/AnimatedEntrance/AnimatedEntrance.js +27 -40
- package/dist/components/AsyncWrapper/AsyncWrapper.js +2 -2
- package/dist/components/Avatar/Avatar.js +4 -4
- package/dist/components/BucketFill/BucketFill.js +9 -9
- package/dist/components/Button/Button.js +4 -4
- package/dist/components/Card/Card.js +1 -1
- package/dist/components/Chart/Chart.view.js +34 -34
- package/dist/components/CheckBox/CheckBox.js +3 -3
- package/dist/components/Collapsable/Collapsable.js +18 -18
- package/dist/components/Countdown/Countdown.js +16 -16
- package/dist/components/Divider/Divider.js +1 -1
- package/dist/components/EmailInput/EmailInput.js +4 -4
- package/dist/components/FadeIn/FadeIn.js +9 -9
- package/dist/components/FileInput/FileInput.js +6 -6
- package/dist/components/FileInput/View/BigFactory/BigFactory.js +1 -1
- package/dist/components/FileInput/View/Compact/Compact.js +6 -6
- package/dist/components/FlowController/FlowController.js +4 -4
- package/dist/components/Form/Form.js +17 -28
- package/dist/components/Freeze/Freeze.js +1 -1
- package/dist/components/HSForms/HSForms.js +9 -11
- package/dist/components/Header/Header.js +7 -7
- package/dist/components/HeaderCloseBtn/HeaderCloseBtn.js +1 -1
- package/dist/components/InfinityScroll/InfinityScroll.js +25 -25
- package/dist/components/Input/Input.js +13 -13
- package/dist/components/InstantCounter/InstantCounter.js +9 -9
- package/dist/components/LavaLamp/LavaLamp.data.js +25 -25
- package/dist/components/LavaLamp/LavaLamp.js +7 -7
- package/dist/components/LavaLamp/v2/LavaLamp.js +29 -45
- package/dist/components/LinkToId/LinkToId.js +7 -7
- package/dist/components/Loader/Loader.js +2 -2
- package/dist/components/LoaderDotsIndicator/LoaderDotsIndicator.js +6 -6
- package/dist/components/LoopableVideo/LoopableVideo.js +4 -4
- package/dist/components/MainGrid/MainGrid.js +2 -2
- package/dist/components/MutableHamburgerButton/MutableHamburgerButton.js +2 -2
- package/dist/components/Notification/Notification.js +1 -1
- package/dist/components/OrderableList/OrderableList.js +113 -138
- package/dist/components/PaginationIndicator/PaginationIndicator.js +50 -50
- package/dist/components/Parallax/Parallax.js +39 -39
- package/dist/components/Parallax/math/helpers.js +18 -19
- package/dist/components/PasswordInput/PasswordInput.js +10 -10
- package/dist/components/PingPongText/PingPongText.js +15 -15
- package/dist/components/PixelatedScan/PixelatedScan.js +19 -19
- package/dist/components/Portal/Portal.js +10 -10
- package/dist/components/ProgressBar/ProgressBar.js +6 -6
- package/dist/components/ProgressTexts/ProgressTexts.js +3 -3
- package/dist/components/Radio/Radio.js +3 -3
- package/dist/components/SectionContainer/SectionContainer.js +1 -1
- package/dist/components/Select/Select.js +13 -13
- package/dist/components/Skeleton/Skeleton.js +1 -1
- package/dist/components/Spacing/Spacing.js +1 -1
- package/dist/components/StaticScroller/StaticScroller.js +12 -12
- package/dist/components/Switch/Switch.js +2 -2
- package/dist/components/Table/Table.js +11 -11
- package/dist/components/Tabs/Tabs.js +3 -3
- package/dist/components/Text/Text.js +5 -5
- package/dist/components/Transition/MasksFactory/DiagonalReveal.js +5 -5
- package/dist/components/Transition/MasksFactory/DiagonalSquareToBalls.js +17 -17
- package/dist/components/Transition/MasksFactory/PhysicsSquares.js +13 -13
- package/dist/components/Transition/MasksFactory/SquareToBalls.js +9 -9
- package/dist/components/Transition/MasksFactory/utils.js +8 -8
- package/dist/components/Transition/Transition.js +49 -49
- package/dist/components/UncontrolledTransition/UncontrolledTransition.js +7 -7
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.js +44 -82
- package/dist/components/utilitary/ScrollAndFocusLock/ScrollAndFocusLock.js +6 -6
- package/dist/context/AsyncProcess.js +19 -42
- package/dist/context/CustomBrowserRouter.js +6 -6
- package/dist/context/OneUIProvider.js +15 -15
- package/dist/hooks/logs/useDependencyChangeDetection.js +2 -5
- package/dist/hooks/persistence/useLocalStorage.js +7 -7
- package/dist/hooks/shims/ObjectWatchShim.js +1 -15
- package/dist/hooks/ui/useAdaptiveImage.js +6 -6
- package/dist/hooks/ui/useBreakpoint.js +5 -5
- package/dist/hooks/ui/useCustomScrollbar.js +2 -2
- package/dist/hooks/ui/useMouseHover.js +4 -4
- package/dist/hooks/ui/usePaginationControls.js +34 -34
- package/dist/hooks/ui/useSnapToViewport.js +3 -3
- package/dist/hooks/ui/useTilt.js +38 -38
- package/dist/hooks/ui/useZoomable.js +20 -20
- package/dist/hooks/useAsyncControl.js +21 -38
- package/dist/hooks/useContainedRepositioning.js +22 -22
- package/dist/hooks/useCustomHistory.js +2 -2
- package/dist/hooks/useElementFit.js +6 -6
- package/dist/hooks/useFirestoreWatch.js +26 -39
- package/dist/hooks/useForm.js +8 -8
- package/dist/hooks/useFreeze.js +1 -1
- package/dist/hooks/useHero.js +82 -90
- package/dist/hooks/useIntersection.js +3 -3
- package/dist/hooks/useMergeRefs.js +3 -7
- package/dist/hooks/useObserve.js +5 -5
- package/dist/hooks/usePagination.js +39 -59
- package/dist/hooks/usePooledOperation.js +8 -22
- package/dist/hooks/usePooling.js +17 -33
- package/dist/hooks/useRebound.js +5 -5
- package/dist/hooks/useShortIntl.js +13 -13
- package/dist/hooks/utility/useEvents.js +5 -5
- package/dist/hooks/utility/useModule.js +3 -3
- package/dist/hooks/utility/useQuery.js +1 -1
- package/dist/models/DebugLogger.js +2 -2
- package/dist/models/GenericContract.js +1 -1
- package/dist/storybookUtils/index.js +1 -1
- package/dist/utility.d.js +3 -3
- package/dist/utils/blockchain.js +29 -102
- package/dist/utils/flatten.js +3 -3
- package/dist/utils/html.utils.js +1 -1
- package/package.json +1 -1
|
@@ -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
|
-
|
|
17
|
+
let 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
|
-
|
|
22
|
-
|
|
21
|
+
const initials = (0, _react.useMemo)(function () {
|
|
22
|
+
const nameParts = name.trim().split(" ");
|
|
23
23
|
if (nameParts.length === 1) return nameParts[0].charAt(0).toUpperCase();
|
|
24
|
-
|
|
24
|
+
const _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
|
-
|
|
20
|
+
let children = _ref.children,
|
|
21
21
|
background = _ref.background,
|
|
22
22
|
fillTo = _ref.fillTo;
|
|
23
|
-
|
|
23
|
+
const rootRef = (0, _react.useRef)(null);
|
|
24
24
|
function resize() {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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);
|
|
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
|
-
|
|
51
|
+
let 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
|
-
|
|
12
|
+
const _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
|
-
|
|
23
|
+
let 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
|
-
|
|
30
|
-
|
|
29
|
+
const classNameType = (0, _OneUIProvider.useOneUIConfig)("component.button.className", {});
|
|
30
|
+
const 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
|
-
|
|
14
|
+
let 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", {
|
|
@@ -16,32 +16,32 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
16
16
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
17
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."); }
|
|
18
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); }
|
|
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++)
|
|
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)
|
|
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; } }
|
|
21
21
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
22
|
-
|
|
22
|
+
const DEFAULT_STYLE = {
|
|
23
23
|
lineColor: "#000",
|
|
24
24
|
pointColor: "#000",
|
|
25
25
|
textColor: "#fff"
|
|
26
26
|
};
|
|
27
27
|
function FloatingTooltip(_ref) {
|
|
28
|
-
|
|
28
|
+
let children = _ref.children,
|
|
29
29
|
x = _ref.x,
|
|
30
30
|
y = _ref.y,
|
|
31
31
|
hoverOnly = _ref.hoverOnly,
|
|
32
32
|
height = _ref.height,
|
|
33
33
|
style = _ref.style;
|
|
34
|
-
|
|
34
|
+
const _useState = (0, _react.useState)(function () {
|
|
35
35
|
return hoverOnly ? false : true;
|
|
36
36
|
}),
|
|
37
37
|
_useState2 = _slicedToArray(_useState, 2),
|
|
38
38
|
ope = _useState2[0],
|
|
39
39
|
setOpen = _useState2[1];
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
const ref = (0, _react.useRef)(null);
|
|
41
|
+
const circleRef = (0, _react.useRef)(null);
|
|
42
42
|
(0, _react.useEffect)(function () {
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
const animateEl = circleRef.current.children.item(0);
|
|
44
|
+
let interval;
|
|
45
45
|
animateEl.addEventListener("beginEvent", function () {
|
|
46
46
|
interval = setInterval(function () {
|
|
47
47
|
return ref.current.updatePosition();
|
|
@@ -52,7 +52,7 @@ function FloatingTooltip(_ref) {
|
|
|
52
52
|
ref.current.updatePosition();
|
|
53
53
|
});
|
|
54
54
|
}, []);
|
|
55
|
-
|
|
55
|
+
const actions = (0, _react.useMemo)(function () {
|
|
56
56
|
return hoverOnly ? {
|
|
57
57
|
onMouseEnter: function onMouseEnter() {
|
|
58
58
|
return setOpen(true);
|
|
@@ -91,7 +91,7 @@ function FloatingTooltip(_ref) {
|
|
|
91
91
|
* Draws a simple line chart with some animation
|
|
92
92
|
**/
|
|
93
93
|
function ChartView(_ref2) {
|
|
94
|
-
|
|
94
|
+
let _ref2$bounds = _slicedToArray(_ref2.bounds, 2),
|
|
95
95
|
_ref2$bounds$ = _slicedToArray(_ref2$bounds[0], 3),
|
|
96
96
|
startX = _ref2$bounds$[0],
|
|
97
97
|
endX = _ref2$bounds$[1],
|
|
@@ -107,52 +107,52 @@ function ChartView(_ref2) {
|
|
|
107
107
|
label = _ref2.label,
|
|
108
108
|
_ref2$style = _ref2.style,
|
|
109
109
|
groupStyle = _ref2$style === void 0 ? [] : _ref2$style;
|
|
110
|
-
|
|
110
|
+
const _useState3 = (0, _react.useState)(),
|
|
111
111
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
112
112
|
dim = _useState4[0],
|
|
113
113
|
setDIm = _useState4[1];
|
|
114
|
-
|
|
114
|
+
const chartRef = (0, _react.useRef)(null);
|
|
115
115
|
(0, _react.useLayoutEffect)(function () {
|
|
116
116
|
setDIm({
|
|
117
117
|
width: chartRef.current.clientWidth,
|
|
118
118
|
height: chartRef.current.clientHeight
|
|
119
119
|
});
|
|
120
120
|
}, []);
|
|
121
|
-
|
|
121
|
+
const _ref3 = dim || {},
|
|
122
122
|
width = _ref3.width,
|
|
123
123
|
height = _ref3.height;
|
|
124
|
-
|
|
124
|
+
const howMuchStepsY = (0, _react.useMemo)(function () {
|
|
125
125
|
return (endY - startY) / stepsY + 1;
|
|
126
126
|
}, [endY, startY, stepsY]);
|
|
127
|
-
|
|
127
|
+
const yAxis = (0, _react.useMemo)(function () {
|
|
128
128
|
return new Array(howMuchStepsY).fill(undefined).map(function (_, i) {
|
|
129
129
|
return /*#__PURE__*/_react.default.createElement("span", null, label.y(endY - i * stepsY));
|
|
130
130
|
});
|
|
131
131
|
}, [startY, endY, stepsY, howMuchStepsY]);
|
|
132
|
-
|
|
132
|
+
const howMuchStepsX = (0, _react.useMemo)(function () {
|
|
133
133
|
return (endX - startX) / stepsX + 1;
|
|
134
134
|
}, [endX, startX, stepsX]);
|
|
135
|
-
|
|
135
|
+
const xAxis = (0, _react.useMemo)(function () {
|
|
136
136
|
return new Array(howMuchStepsX).fill(undefined).map(function (_, i) {
|
|
137
137
|
return /*#__PURE__*/_react.default.createElement("span", null, label.x(startX + i * stepsX));
|
|
138
138
|
});
|
|
139
139
|
}, [startX, endX, stepsX]);
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
140
|
+
const _useMemo = (0, _react.useMemo)(function () {
|
|
141
|
+
const calculate = function calculate(end, start) {
|
|
142
|
+
let overrideScale = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 100;
|
|
143
143
|
return function (point) {
|
|
144
|
-
|
|
145
|
-
|
|
144
|
+
const max = end - start;
|
|
145
|
+
const current = point - start;
|
|
146
146
|
return current * overrideScale / max;
|
|
147
147
|
};
|
|
148
148
|
};
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
const calculateX = calculate(endX, startX, width);
|
|
150
|
+
const calculateY = calculate(endY, startY, height);
|
|
151
151
|
return {
|
|
152
152
|
tooltips: points.map(function (pointsCategory, i) {
|
|
153
|
-
|
|
153
|
+
const style = groupStyle[i] || DEFAULT_STYLE;
|
|
154
154
|
return pointsCategory.map(function (_ref4) {
|
|
155
|
-
|
|
155
|
+
let _ref5 = _slicedToArray(_ref4, 4),
|
|
156
156
|
x = _ref5[0],
|
|
157
157
|
y = _ref5[1],
|
|
158
158
|
label = _ref5[2],
|
|
@@ -168,10 +168,10 @@ function ChartView(_ref2) {
|
|
|
168
168
|
});
|
|
169
169
|
}),
|
|
170
170
|
polylines: data.map(function (lineData, i) {
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
const style = groupStyle[i] || DEFAULT_STYLE;
|
|
172
|
+
const calculateLines = function calculateLines(yOverride) {
|
|
173
173
|
return lineData.map(function (_ref6) {
|
|
174
|
-
|
|
174
|
+
let _ref7 = _slicedToArray(_ref6, 2),
|
|
175
175
|
x = _ref7[0],
|
|
176
176
|
y = _ref7[1];
|
|
177
177
|
return "".concat(calculateX(x), ",").concat(yOverride === undefined ? height - calculateY(y) : yOverride);
|
|
@@ -197,12 +197,12 @@ function ChartView(_ref2) {
|
|
|
197
197
|
}, [data, width, height]),
|
|
198
198
|
polylines = _useMemo.polylines,
|
|
199
199
|
tooltips = _useMemo.tooltips;
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
const paddingY = (0, _react.useMemo)(function () {
|
|
201
|
+
const stepSizeY = height / (howMuchStepsY - 1);
|
|
202
202
|
return stepSizeY / 2;
|
|
203
203
|
}, [howMuchStepsY, height]);
|
|
204
|
-
|
|
205
|
-
|
|
204
|
+
const paddingX = (0, _react.useMemo)(function () {
|
|
205
|
+
const stepSizeX = width / (howMuchStepsX - 1);
|
|
206
206
|
return stepSizeX / 2;
|
|
207
207
|
}, [howMuchStepsX, width]);
|
|
208
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
|
-
|
|
10
|
+
const _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
|
-
|
|
19
|
+
let 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
|
-
|
|
29
|
+
const 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
|
-
|
|
13
|
+
const _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
|
-
|
|
32
|
+
let 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
|
-
|
|
46
|
-
|
|
45
|
+
const contentRef = (0, _react.useRef)(null);
|
|
46
|
+
const 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
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
let canShrink = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
57
|
+
const el = contentRef.current;
|
|
58
|
+
const 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
|
-
|
|
65
|
+
const _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
|
-
|
|
72
|
-
|
|
71
|
+
const transitionStart = function transitionStart(_ref2) {
|
|
72
|
+
let 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
|
-
|
|
85
|
+
const 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
|
-
|
|
101
|
+
const onTransitionEnd = function onTransitionEnd() {
|
|
102
102
|
el.parentElement.style.position = "initial";
|
|
103
103
|
el.classList.remove(_CollapsableModule.default.transitionMarginTop);
|
|
104
|
-
el.removeEventListener("transitionend",
|
|
104
|
+
el.removeEventListener("transitionend", onTransitionEnd);
|
|
105
105
|
};
|
|
106
|
-
el.addEventListener("transitionend",
|
|
106
|
+
el.addEventListener("transitionend", onTransitionEnd);
|
|
107
107
|
return function () {
|
|
108
|
-
el.removeEventListener("transitionend",
|
|
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
|
-
|
|
122
|
+
const 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
|
-
|
|
146
|
+
let _CollapsableInterface = /*#__PURE__*/function () {
|
|
147
147
|
function _CollapsableInterface(id) {
|
|
148
148
|
_classCallCheck(this, _CollapsableInterface);
|
|
149
149
|
this._id = id;
|
|
@@ -159,7 +159,7 @@ var _CollapsableInterface = /*#__PURE__*/function () {
|
|
|
159
159
|
}, {
|
|
160
160
|
key: "open",
|
|
161
161
|
value: function open(onOpened) {
|
|
162
|
-
|
|
162
|
+
const _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++)
|
|
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)
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
const seconds = Math.floor(timespan / 1000);
|
|
21
|
+
const minutes = Math.floor(seconds / 60);
|
|
22
|
+
const 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
|
-
|
|
29
|
+
const IntegerFormatter = new Intl.NumberFormat(undefined, {
|
|
30
30
|
minimumIntegerDigits: 2
|
|
31
31
|
});
|
|
32
|
-
|
|
32
|
+
let 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 @@ var CountdownTextModel = /*#__PURE__*/function (CountdownTextModel) {
|
|
|
39
39
|
**/
|
|
40
40
|
exports.CountdownTextModel = CountdownTextModel;
|
|
41
41
|
function Countdown(_ref) {
|
|
42
|
-
|
|
42
|
+
let 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
|
-
|
|
47
|
+
const _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
|
-
|
|
57
|
+
const cl = setInterval(function () {
|
|
58
58
|
setT(function (prev) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
let nextSecond = prev.seconds - 1;
|
|
60
|
+
let nextMinute = prev.minutes;
|
|
61
|
+
let 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
|
-
|
|
85
|
+
const txt = (0, _react.useMemo)(function () {
|
|
86
86
|
var _options$hours, _options$hours2;
|
|
87
87
|
switch (model) {
|
|
88
88
|
case CountdownTextModel.CLOCK:
|
|
89
|
-
|
|
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), ":") : "";
|
|
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
|
-
|
|
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") : "";
|
|
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
|
-
|
|
14
|
+
let _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++)
|
|
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)
|
|
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
|
-
|
|
29
|
+
const _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
|
-
|
|
44
|
+
let 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
|
-
|
|
10
|
+
const _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++)
|
|
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)
|
|
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
|
-
|
|
27
|
+
let 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
|
-
|
|
37
|
+
const _useState = (0, _react.useState)(0),
|
|
38
38
|
_useState2 = _slicedToArray(_useState, 2),
|
|
39
39
|
trigger = _useState2[1];
|
|
40
|
-
|
|
40
|
+
const prevChildren = (0, _react.useRef)();
|
|
41
41
|
prevChildren.current = children || prevChildren.current;
|
|
42
42
|
(0, _react.useEffect)(function () {
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
const el = divRef.current;
|
|
44
|
+
const isElHidden = active !== undefined ? !active : !children;
|
|
45
45
|
if (isElHidden) {
|
|
46
46
|
el.classList.remove(_FadeInModule.default.active);
|
|
47
|
-
|
|
47
|
+
const 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
|
-
|
|
11
|
+
const _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
|
-
|
|
22
|
+
let onFile = _ref.onFile,
|
|
23
23
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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);
|
|
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
|
-
|
|
18
|
+
let _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,
|