@rio-cloud/rio-uikit 0.16.3-beta.2 → 0.16.3-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Colors.d.ts +1 -1
- package/IncidentsLayer.d.ts +1 -1
- package/RuleContainer.d.ts +1 -1
- package/RulesWrapper.d.ts +1 -1
- package/SortDirection.d.ts +1 -1
- package/TrafficLayer.d.ts +1 -1
- package/TruckLayer.d.ts +1 -1
- package/components/actionBarItem/ActionBarItem.js +6 -2
- package/components/assetTree/Tree.js +2 -1
- package/components/bottomSheet/BottomSheet.js +22 -19
- package/components/fade/Fade.js +23 -7
- package/components/map/components/features/basics/marker/DomMarker.js +1 -1
- package/components/responsiveColumnStripe/ResponsiveColumnStripe.js +28 -28
- package/hooks/useDebugInfo.js +1 -1
- package/hooks/usePrevious.js +18 -0
- package/index.js +1 -0
- package/lib/.DS_Store +0 -0
- package/lib/es/Colors.d.ts +1 -1
- package/lib/es/IncidentsLayer.d.ts +1 -1
- package/lib/es/RuleContainer.d.ts +1 -1
- package/lib/es/RulesWrapper.d.ts +1 -1
- package/lib/es/SortDirection.d.ts +1 -1
- package/lib/es/TrafficLayer.d.ts +1 -1
- package/lib/es/TruckLayer.d.ts +1 -1
- package/lib/es/components/actionBarItem/ActionBarItem.js +6 -2
- package/lib/es/components/assetTree/Tree.js +2 -1
- package/lib/es/components/bottomSheet/BottomSheet.js +22 -19
- package/lib/es/components/fade/Fade.js +26 -7
- package/lib/es/components/map/components/features/basics/marker/DomMarker.js +1 -1
- package/lib/es/components/responsiveColumnStripe/ResponsiveColumnStripe.js +28 -28
- package/lib/es/hooks/useDebugInfo.js +1 -1
- package/lib/es/hooks/usePrevious.js +25 -0
- package/lib/es/index.js +8 -0
- package/lib/es/styles/components/BottomSheet.less +10 -1
- package/lib/es/styles/components/Dialog.less +38 -44
- package/lib/es/styles/components/Sidebar.less +10 -1
- package/lib/es/styles/design/popovers.less +1 -1
- package/lib/es/styles/design/utilities.less +8 -0
- package/lib/es/styles/variables/colors.json +72 -72
- package/lib/es/themes/Website/styles/rio-website.less +2 -1
- package/lib/es/types.ts +7 -2
- package/lib/es/usePrevious.d.ts +4 -0
- package/lib/es/usePrevious.js +13 -0
- package/lib/es/utils/cssuseragent.js +66 -66
- package/lib/es/utils/searchNormalized.js +14 -0
- package/lib/es/version.json +2 -2
- package/package.json +34 -26
- package/styles/components/BottomSheet.less +10 -1
- package/styles/components/Dialog.less +38 -44
- package/styles/components/Sidebar.less +10 -1
- package/styles/design/popovers.less +1 -1
- package/styles/design/utilities.less +8 -0
- package/styles/variables/colors.json +72 -72
- package/themes/Website/styles/rio-website.less +2 -1
- package/types.ts +7 -2
- package/usePrevious.d.ts +4 -0
- package/usePrevious.js +2 -0
- package/utils/cssuseragent.js +66 -66
- package/utils/searchNormalized.js +6 -0
- package/version.json +2 -2
package/Colors.d.ts
CHANGED
package/IncidentsLayer.d.ts
CHANGED
package/RuleContainer.d.ts
CHANGED
package/RulesWrapper.d.ts
CHANGED
package/SortDirection.d.ts
CHANGED
package/TrafficLayer.d.ts
CHANGED
package/TruckLayer.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
-
var _excluded = ["className", "children", "popoverWidth", "id", "hidePopoverOnClick"];
|
|
4
|
+
var _excluded = ["className", "mobileDialogBodyClassName", "children", "popoverWidth", "id", "hidePopoverOnClick"];
|
|
5
5
|
import React, { useCallback, useEffect, useLayoutEffect, useState, useRef } from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import classNames from 'classnames';
|
|
@@ -56,6 +56,7 @@ var isActionBarItemIcon = function isActionBarItemIcon(child) {
|
|
|
56
56
|
};
|
|
57
57
|
export var ActionBarItem = /*#__PURE__*/React.memo(function (props) {
|
|
58
58
|
var className = props.className,
|
|
59
|
+
mobileDialogBodyClassName = props.mobileDialogBodyClassName,
|
|
59
60
|
children = props.children,
|
|
60
61
|
popoverWidth = props.popoverWidth,
|
|
61
62
|
id = props.id,
|
|
@@ -153,6 +154,7 @@ export var ActionBarItem = /*#__PURE__*/React.memo(function (props) {
|
|
|
153
154
|
return setIsShown(false);
|
|
154
155
|
},
|
|
155
156
|
body: itemPopover,
|
|
157
|
+
bodyClassName: mobileDialogBodyClassName,
|
|
156
158
|
title: title
|
|
157
159
|
})), childrenWithoutPopoverAndIcon);
|
|
158
160
|
}
|
|
@@ -192,12 +194,14 @@ ActionBarItem.ListSeparator = ActionBarItemListSeparator;
|
|
|
192
194
|
ActionBarItem.defaultProps = {
|
|
193
195
|
id: getRandomString(),
|
|
194
196
|
hidePopoverOnClick: true,
|
|
195
|
-
popoverWidth: 250
|
|
197
|
+
popoverWidth: 250,
|
|
198
|
+
mobileDialogBodyClassName: ''
|
|
196
199
|
};
|
|
197
200
|
ActionBarItem.propTypes = {
|
|
198
201
|
id: PropTypes.string,
|
|
199
202
|
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,
|
|
200
203
|
className: PropTypes.string,
|
|
204
|
+
mobileDialogBodyClassName: PropTypes.string,
|
|
201
205
|
hidePopoverOnClick: PropTypes.bool,
|
|
202
206
|
popoverWidth: PropTypes.oneOf([100, 150, 200, 250, 300, 350, 400, 450, 500])
|
|
203
207
|
};
|
|
@@ -39,6 +39,7 @@ import TreeNothingFound from './TreeNothingFound';
|
|
|
39
39
|
import TreeOptions from './TreeOptions';
|
|
40
40
|
import TreeRoot from './TreeRoot';
|
|
41
41
|
import TypeCounter from './TypeCounter';
|
|
42
|
+
import { searchNormalized } from '../../utils/searchNormalized';
|
|
42
43
|
var SEARCH_DEBOUNCE = 100;
|
|
43
44
|
var otherwise = stubTrue;
|
|
44
45
|
var notEqual = negate(isEqual);
|
|
@@ -121,7 +122,7 @@ var getMappedItemsToGroups = function getMappedItemsToGroups(groups, items) {
|
|
|
121
122
|
var filterByName = function filterByName(searchValue) {
|
|
122
123
|
return function (item) {
|
|
123
124
|
if (searchValue) {
|
|
124
|
-
return getName(item)
|
|
125
|
+
return searchNormalized(getName(item), searchValue);
|
|
125
126
|
}
|
|
126
127
|
return true;
|
|
127
128
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["show", "onClose", "width", "height", "title", "
|
|
4
|
+
var _excluded = ["show", "onClose", "width", "height", "title", "detach", "useBackdrop", "showCloseButton", "showMaximizeButton", "onHeightChange", "bodyRef", "bodyClassName", "className", "children"];
|
|
5
5
|
import React, { useState, useEffect } from 'react';
|
|
6
6
|
import ReactDOM from 'react-dom';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
@@ -16,7 +16,7 @@ var BottomSheet = function BottomSheet(props) {
|
|
|
16
16
|
width = props.width,
|
|
17
17
|
height = props.height,
|
|
18
18
|
title = props.title,
|
|
19
|
-
|
|
19
|
+
detach = props.detach,
|
|
20
20
|
useBackdrop = props.useBackdrop,
|
|
21
21
|
showCloseButton = props.showCloseButton,
|
|
22
22
|
showMaximizeButton = props.showMaximizeButton,
|
|
@@ -46,14 +46,23 @@ var BottomSheet = function BottomSheet(props) {
|
|
|
46
46
|
setIsShown(newValue);
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
|
+
useEffect(function () {
|
|
50
|
+
setIsShown(show);
|
|
51
|
+
}, [show]);
|
|
49
52
|
var handleMaximize = function handleMaximize() {
|
|
50
53
|
var newValue = !isMaxHeight;
|
|
51
54
|
setIsMaxHeight(newValue);
|
|
52
55
|
onHeightChange();
|
|
53
56
|
};
|
|
54
|
-
var sheetClasses = classNames('bottom-sheet', 'position-fixed left-0', !width && 'width-100pct', !height && !isMaxHeight && 'height-auto', 'bg-white', 'shadow-hard',
|
|
55
|
-
var
|
|
57
|
+
var sheetClasses = classNames('bottom-sheet', 'position-fixed left-0', !width && 'width-100pct', !height && !isMaxHeight && 'height-auto', 'bg-white', 'shadow-hard', detach ? 'margin-15 rounded' : 'rounded-top-left rounded-top-right', className && className);
|
|
58
|
+
var sheetBodyClasses = classNames('bottom-sheet-body', 'height-100pct', bodyClassName && bodyClassName);
|
|
56
59
|
var sheetHeight = isMaxHeight ? window.innerHeight : height;
|
|
60
|
+
|
|
61
|
+
// Note: we always have to kep the body element in the DOM as there might be a ref assigned to it.
|
|
62
|
+
// Unmounting it will lead to loosing the reference and breaking the functionality that is implemented on that ref.
|
|
63
|
+
// That is the reason why there is no "AnimatePresence" with an "exit" animation here.
|
|
64
|
+
// Instead we change the "animate" values.
|
|
65
|
+
|
|
57
66
|
return /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(motion.div, _extends({}, remainigProps, {
|
|
58
67
|
className: sheetClasses,
|
|
59
68
|
width: width,
|
|
@@ -61,20 +70,14 @@ var BottomSheet = function BottomSheet(props) {
|
|
|
61
70
|
opacity: 0
|
|
62
71
|
},
|
|
63
72
|
animate: {
|
|
64
|
-
opacity: 1,
|
|
73
|
+
opacity: isShown ? 1 : 0,
|
|
65
74
|
y: 0,
|
|
66
75
|
bottom: isShown ? 0 : OFFSET_POSITION,
|
|
67
|
-
height: sheetHeight
|
|
68
|
-
},
|
|
69
|
-
exit: {
|
|
70
|
-
opacity: 0,
|
|
71
|
-
transition: {
|
|
72
|
-
duration: 0.3
|
|
73
|
-
},
|
|
74
|
-
bottom: OFFSET_POSITION,
|
|
75
|
-
height: sheetHeight
|
|
76
|
+
height: isShown ? sheetHeight : 0
|
|
76
77
|
}
|
|
77
|
-
}), /*#__PURE__*/React.createElement("div",
|
|
78
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
79
|
+
className: "bottom-sheet-header"
|
|
80
|
+
}, title && /*#__PURE__*/React.createElement("div", {
|
|
78
81
|
className: 'bottom-sheet-title display-flex justify-content-between padding-15 ' + 'border border-top-none border-left-none border-right-none border-color-lighter'
|
|
79
82
|
}, /*#__PURE__*/React.createElement("div", {
|
|
80
83
|
className: "text-size-18"
|
|
@@ -91,16 +94,16 @@ var BottomSheet = function BottomSheet(props) {
|
|
|
91
94
|
}, /*#__PURE__*/React.createElement("div", {
|
|
92
95
|
className: "height-5 width-40 rounded bg-lighter"
|
|
93
96
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
94
|
-
className:
|
|
97
|
+
className: sheetBodyClasses,
|
|
95
98
|
ref: bodyRef
|
|
96
|
-
}, children)), useBackdrop && isShown && /*#__PURE__*/React.createElement("div", {
|
|
99
|
+
}, isShown && children)), useBackdrop && isShown && /*#__PURE__*/React.createElement("div", {
|
|
97
100
|
className: "bottom-sheet-backdrop",
|
|
98
101
|
onClick: handleToggle
|
|
99
102
|
})), modalRoot);
|
|
100
103
|
};
|
|
101
104
|
BottomSheet.defaultProps = {
|
|
102
105
|
show: false,
|
|
103
|
-
|
|
106
|
+
detach: false,
|
|
104
107
|
useBackdrop: false,
|
|
105
108
|
showCloseButton: true,
|
|
106
109
|
showMaximizeButton: false,
|
|
@@ -115,7 +118,7 @@ BottomSheet.propTypes = {
|
|
|
115
118
|
showCloseButton: PropTypes.bool,
|
|
116
119
|
showMaximizeButton: PropTypes.bool,
|
|
117
120
|
onHeightChange: PropTypes.func,
|
|
118
|
-
|
|
121
|
+
detach: PropTypes.bool,
|
|
119
122
|
useBackdrop: PropTypes.bool,
|
|
120
123
|
onBackdropClick: PropTypes.func,
|
|
121
124
|
bodyRef: PropTypes.object,
|
package/components/fade/Fade.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
+
import React, { useState } from 'react';
|
|
3
7
|
import PropTypes from 'prop-types';
|
|
4
8
|
import { AnimatePresence, motion } from 'framer-motion';
|
|
5
|
-
import logDeprecatedWarnings from '../../utils/logDeprecatedWarnings';
|
|
6
9
|
import isArray from 'lodash/fp/isArray';
|
|
7
10
|
import head from 'lodash/fp/head';
|
|
11
|
+
import isNil from 'lodash/fp/isNil';
|
|
12
|
+
import logDeprecatedWarnings from '../../utils/logDeprecatedWarnings';
|
|
13
|
+
import useAfterMount from '../../useAfterMount';
|
|
8
14
|
var warningProps = [{
|
|
9
15
|
prop: 'in',
|
|
10
16
|
replacement: 'show'
|
|
@@ -172,7 +178,16 @@ var Fade = function Fade(props) {
|
|
|
172
178
|
duration = duration / 100;
|
|
173
179
|
}
|
|
174
180
|
var show = props.show || oldIn;
|
|
175
|
-
var initial = props.initial
|
|
181
|
+
var initial = isNil(appear) ? props.initial : appear;
|
|
182
|
+
var _useState = useState(initial),
|
|
183
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
184
|
+
allowInitialAnimation = _useState2[0],
|
|
185
|
+
setAllowInitialAnimation = _useState2[1];
|
|
186
|
+
useAfterMount(function () {
|
|
187
|
+
if (!allowInitialAnimation) {
|
|
188
|
+
setAllowInitialAnimation(true);
|
|
189
|
+
}
|
|
190
|
+
});
|
|
176
191
|
var motionDivKey = 'fade';
|
|
177
192
|
|
|
178
193
|
// If there are multiple children that are conditionally rendered like
|
|
@@ -193,14 +208,15 @@ var Fade = function Fade(props) {
|
|
|
193
208
|
var pageTransitionProps = isPageTransition ? {
|
|
194
209
|
variants: pageTransitionVariants
|
|
195
210
|
} : null;
|
|
196
|
-
var animationProps = animations[animationStyle];
|
|
211
|
+
var animationProps = _objectSpread({}, animations[animationStyle]);
|
|
197
212
|
|
|
198
|
-
// Disable initial animation
|
|
199
|
-
|
|
213
|
+
// Disable initial animation on mount. After mount the initial animation step is needed to enable
|
|
214
|
+
// the "fade-in" animation, otherwise it just appears
|
|
215
|
+
if (!allowInitialAnimation) {
|
|
200
216
|
animationProps.initial = false;
|
|
201
217
|
}
|
|
202
218
|
return /*#__PURE__*/React.createElement(AnimatePresence, _extends({
|
|
203
|
-
initial:
|
|
219
|
+
initial: allowInitialAnimation,
|
|
204
220
|
exitBeforeEnter: exitBeforeEnter,
|
|
205
221
|
onExitComplete: onExitComplete,
|
|
206
222
|
custom: custom
|
|
@@ -13,7 +13,7 @@ import { addEventListenerMap, removeEventListenerMap, checkAndUpdateEventListene
|
|
|
13
13
|
|
|
14
14
|
// Should be deprecated...
|
|
15
15
|
// Here Documentation:
|
|
16
|
-
// It should be only used where small numbers of markers with dynamic style and/or scripted icons are to be displayed
|
|
16
|
+
// It should be only used where small numbers of markers with dynamic style and/or scripted icons are to be displayed
|
|
17
17
|
// on the map (for example animated interactive SVG). Otherwise a H.map.Marker should be preferred for performance reasons.
|
|
18
18
|
//
|
|
19
19
|
var DomMarker = /*#__PURE__*/function (_React$Component) {
|
|
@@ -11,6 +11,7 @@ import chunk from 'lodash/fp/chunk';
|
|
|
11
11
|
import { AnimatePresence, motion } from 'framer-motion';
|
|
12
12
|
import useAfterMount from '../../hooks/useAfterMount';
|
|
13
13
|
import useElementSize from '../../hooks/useElementSize';
|
|
14
|
+
import usePrevious from '../../hooks/usePrevious';
|
|
14
15
|
var DEFAULT_MIN_COLUMN_WITH = 300;
|
|
15
16
|
var DEFAULT_MIN_COLUMNS = 1;
|
|
16
17
|
var DEFAULT_MAX_COLUMNS = 5;
|
|
@@ -21,21 +22,19 @@ var ANIMATION_DURATION = 0.2;
|
|
|
21
22
|
var ANIMATION_NEXT = 'page';
|
|
22
23
|
var ANIMATION_BACK = 'pageBack';
|
|
23
24
|
var COLUMN_ITEM_CLASSNAME = 'ColumnItem';
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
};
|
|
25
|
+
var variants = {
|
|
26
|
+
pageEnter: function pageEnter(pageDirection) {
|
|
27
|
+
return {
|
|
28
|
+
x: pageDirection === ANIMATION_NEXT ? '60%' : '-60%',
|
|
29
|
+
opacity: 0
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
pageCenter: function pageCenter() {
|
|
33
|
+
return {
|
|
34
|
+
x: 0,
|
|
35
|
+
opacity: 1
|
|
36
|
+
};
|
|
37
|
+
}
|
|
39
38
|
};
|
|
40
39
|
var getFirstColumnItem = function getFirstColumnItem(node) {
|
|
41
40
|
if (_toConsumableArray(node.classList).includes(COLUMN_ITEM_CLASSNAME)) {
|
|
@@ -87,10 +86,6 @@ var ResponsiveColumnStripe = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
87
86
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
88
87
|
isResizePage = _useState8[0],
|
|
89
88
|
setIsResizePage = _useState8[1];
|
|
90
|
-
var _useState9 = useState(ANIMATION_NEXT),
|
|
91
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
92
|
-
animationDirection = _useState10[0],
|
|
93
|
-
setAnimationDirection = _useState10[1];
|
|
94
89
|
|
|
95
90
|
// The base for reacting on changing width of the wrapping element.
|
|
96
91
|
// It uses a ResizeObserver under the hood.
|
|
@@ -98,16 +93,21 @@ var ResponsiveColumnStripe = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
98
93
|
var _useElementSize = useElementSize(columnWrapperRef),
|
|
99
94
|
_useElementSize2 = _slicedToArray(_useElementSize, 1),
|
|
100
95
|
columnWrapperWidth = _useElementSize2[0];
|
|
96
|
+
var previousPage = usePrevious(currentPage);
|
|
97
|
+
var animationDirection = currentPage > previousPage ? ANIMATION_NEXT : ANIMATION_BACK;
|
|
101
98
|
useAfterMount(function () {
|
|
102
99
|
setEnableInitialAnimation(true);
|
|
103
100
|
});
|
|
104
101
|
|
|
105
102
|
// Update active page from outside to be used as controlled component
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
103
|
+
var _useState9 = useState(activePage),
|
|
104
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
105
|
+
previousActivePage = _useState10[0],
|
|
106
|
+
setPreviousActivePage = _useState10[1];
|
|
107
|
+
if (Number.isFinite(activePage) && activePage !== previousActivePage) {
|
|
108
|
+
setCurrentPage(activePage);
|
|
109
|
+
setPreviousActivePage(activePage);
|
|
110
|
+
}
|
|
111
111
|
var updatePageOnColumnsSizeChange = function updatePageOnColumnsSizeChange(firstItem, columnsPerPage, children) {
|
|
112
112
|
// Split children in page chunks
|
|
113
113
|
var itemChunks = chunk(columnsPerPage)(children);
|
|
@@ -168,14 +168,12 @@ var ResponsiveColumnStripe = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
168
168
|
}, [columnWrapperWidth, columnWrapperRef.current, children]);
|
|
169
169
|
var handlePrevClick = function handlePrevClick() {
|
|
170
170
|
setIsResizePage(false);
|
|
171
|
-
setAnimationDirection(ANIMATION_BACK);
|
|
172
171
|
var pageNumber = currentPage - 1;
|
|
173
172
|
setCurrentPage(pageNumber);
|
|
174
173
|
onPreviousClick(pageNumber, columnsPerPage);
|
|
175
174
|
};
|
|
176
175
|
var handleNextClick = function handleNextClick() {
|
|
177
176
|
setIsResizePage(false);
|
|
178
|
-
setAnimationDirection(ANIMATION_NEXT);
|
|
179
177
|
var pageNumber = currentPage + 1;
|
|
180
178
|
setCurrentPage(pageNumber);
|
|
181
179
|
onNextClick(pageNumber, columnsPerPage);
|
|
@@ -222,12 +220,14 @@ var ResponsiveColumnStripe = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
222
220
|
className: "ColumnsArea flex-1-1 overflow-hidden",
|
|
223
221
|
ref: columnWrapperRef
|
|
224
222
|
}, disableAnimation || isResizePage ? columns : null, !disableAnimation && !isResizePage && /*#__PURE__*/React.createElement(AnimatePresence, {
|
|
225
|
-
exitBeforeEnter: true
|
|
223
|
+
exitBeforeEnter: true,
|
|
224
|
+
custom: animationDirection
|
|
226
225
|
}, /*#__PURE__*/React.createElement(motion.div, {
|
|
227
226
|
key: currentPage,
|
|
228
|
-
variants:
|
|
227
|
+
variants: variants,
|
|
229
228
|
initial: enableInitialAnimation ? 'pageEnter' : false,
|
|
230
229
|
animate: "pageCenter",
|
|
230
|
+
custom: animationDirection,
|
|
231
231
|
transition: {
|
|
232
232
|
duration: ANIMATION_DURATION
|
|
233
233
|
}
|
package/hooks/useDebugInfo.js
CHANGED
|
@@ -4,7 +4,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
// Inspired by https://github.com/WebDevSimplified/useful-custom-react-hooks/blob/main/src/28-useDebugInformation/useDebugInformation.js
|
|
5
5
|
import { useEffect, useRef } from 'react';
|
|
6
6
|
import useRenderCount from './useRenderCount';
|
|
7
|
-
var logStyle = [
|
|
7
|
+
var logStyle = ['color: #4c5667', 'background-color: #e5ebf0', 'padding: 2px 4px', 'border-radius: 2px'].join(';');
|
|
8
8
|
export default function useDebugInfo(componentName, props) {
|
|
9
9
|
var renderCount = useRenderCount();
|
|
10
10
|
var changedProps = useRef({});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
export default function usePrevious(state) {
|
|
4
|
+
// Based on the react beta docs, we avoid using an effect and a ref here but
|
|
5
|
+
// use another state to store the previous value to compare to.
|
|
6
|
+
// See: https://beta.reactjs.org/reference/react/useState#storing-information-from-previous-renders
|
|
7
|
+
|
|
8
|
+
// [previousState currentState]
|
|
9
|
+
var _useState = useState([null, state]),
|
|
10
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
11
|
+
tuple = _useState2[0],
|
|
12
|
+
setTuple = _useState2[1];
|
|
13
|
+
if (tuple[1] !== state) {
|
|
14
|
+
// Set the new given state value and store the old state as pervious value
|
|
15
|
+
setTuple([tuple[1], state]);
|
|
16
|
+
}
|
|
17
|
+
return tuple[0];
|
|
18
|
+
}
|
package/index.js
CHANGED
|
@@ -158,6 +158,7 @@ export { default as useElementSize } from './hooks/useElementSize';
|
|
|
158
158
|
export { default as useScrollPosition } from './hooks/useScrollPosition';
|
|
159
159
|
export { default as useDarkMode } from './hooks/useDarkMode';
|
|
160
160
|
export { default as useMutationObserver } from './hooks/useMutationObserver';
|
|
161
|
+
export { default as usePrevious } from './hooks/usePrevious';
|
|
161
162
|
import { hasTouch as _hasTouch, inIframe as _inIframe, isDesktop as _isDesktop } from './utils/deviceUtils';
|
|
162
163
|
export { _hasTouch as hasTouch, _inIframe as inIframe, _isDesktop as isDesktop };
|
|
163
164
|
import { getColorScheme as _getColorScheme, setColorScheme as _setColorScheme } from './utils/colorScheme';
|
package/lib/.DS_Store
ADDED
|
Binary file
|
package/lib/es/Colors.d.ts
CHANGED
package/lib/es/RulesWrapper.d.ts
CHANGED
package/lib/es/TrafficLayer.d.ts
CHANGED
package/lib/es/TruckLayer.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ var _ActionBarItemListItem = require("./ActionBarItemListItem");
|
|
|
23
23
|
var _ActionBarItemListSeparator = require("./ActionBarItemListSeparator");
|
|
24
24
|
var _OverlayTrigger = _interopRequireDefault(require("../overlay/OverlayTrigger"));
|
|
25
25
|
var _Dialog = _interopRequireDefault(require("../dialog/Dialog"));
|
|
26
|
-
var _excluded = ["className", "children", "popoverWidth", "id", "hidePopoverOnClick"];
|
|
26
|
+
var _excluded = ["className", "mobileDialogBodyClassName", "children", "popoverWidth", "id", "hidePopoverOnClick"];
|
|
27
27
|
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); }
|
|
28
28
|
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; }
|
|
29
29
|
var EVENT = 'mousedown';
|
|
@@ -66,6 +66,7 @@ var isActionBarItemIcon = function isActionBarItemIcon(child) {
|
|
|
66
66
|
};
|
|
67
67
|
var ActionBarItem = /*#__PURE__*/_react["default"].memo(function (props) {
|
|
68
68
|
var className = props.className,
|
|
69
|
+
mobileDialogBodyClassName = props.mobileDialogBodyClassName,
|
|
69
70
|
children = props.children,
|
|
70
71
|
popoverWidth = props.popoverWidth,
|
|
71
72
|
id = props.id,
|
|
@@ -163,6 +164,7 @@ var ActionBarItem = /*#__PURE__*/_react["default"].memo(function (props) {
|
|
|
163
164
|
return setIsShown(false);
|
|
164
165
|
},
|
|
165
166
|
body: itemPopover,
|
|
167
|
+
bodyClassName: mobileDialogBodyClassName,
|
|
166
168
|
title: title
|
|
167
169
|
})), childrenWithoutPopoverAndIcon);
|
|
168
170
|
}
|
|
@@ -203,12 +205,14 @@ ActionBarItem.ListSeparator = _ActionBarItemListSeparator.ActionBarItemListSepar
|
|
|
203
205
|
ActionBarItem.defaultProps = {
|
|
204
206
|
id: getRandomString(),
|
|
205
207
|
hidePopoverOnClick: true,
|
|
206
|
-
popoverWidth: 250
|
|
208
|
+
popoverWidth: 250,
|
|
209
|
+
mobileDialogBodyClassName: ''
|
|
207
210
|
};
|
|
208
211
|
ActionBarItem.propTypes = {
|
|
209
212
|
id: _propTypes["default"].string,
|
|
210
213
|
children: _propTypes["default"].oneOfType([_propTypes["default"].arrayOf(_propTypes["default"].node), _propTypes["default"].node]).isRequired,
|
|
211
214
|
className: _propTypes["default"].string,
|
|
215
|
+
mobileDialogBodyClassName: _propTypes["default"].string,
|
|
212
216
|
hidePopoverOnClick: _propTypes["default"].bool,
|
|
213
217
|
popoverWidth: _propTypes["default"].oneOf([100, 150, 200, 250, 300, 350, 400, 450, 500])
|
|
214
218
|
};
|
|
@@ -43,6 +43,7 @@ var _TreeNothingFound = _interopRequireDefault(require("./TreeNothingFound"));
|
|
|
43
43
|
var _TreeOptions = _interopRequireDefault(require("./TreeOptions"));
|
|
44
44
|
var _TreeRoot = _interopRequireDefault(require("./TreeRoot"));
|
|
45
45
|
var _TypeCounter = _interopRequireDefault(require("./TypeCounter"));
|
|
46
|
+
var _searchNormalized = require("../../utils/searchNormalized");
|
|
46
47
|
var _excluded = ["groups", "items", "selectedGroups", "selectedItems", "onSelectionChange", "hasMultiselect", "showRadioButtons", "hideSearch", "hideTreeHead", "summary", "hideSummary", "search", "searchPlaceholder", "onSearchChange", "className", "scrollHeight", "expandedGroups", "onExpandGroupsChange", "showEmptyGroups", "treeOptions"];
|
|
47
48
|
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); }
|
|
48
49
|
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; }
|
|
@@ -130,7 +131,7 @@ var getMappedItemsToGroups = function getMappedItemsToGroups(groups, items) {
|
|
|
130
131
|
var filterByName = function filterByName(searchValue) {
|
|
131
132
|
return function (item) {
|
|
132
133
|
if (searchValue) {
|
|
133
|
-
return
|
|
134
|
+
return (0, _searchNormalized.searchNormalized)(getName(item), searchValue);
|
|
134
135
|
}
|
|
135
136
|
return true;
|
|
136
137
|
};
|