@elliemae/ds-shared 2.2.0-alpha.4 → 3.0.0-next.2
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/cjs/Animations/BaseAnimation.js +35 -55
- package/cjs/Animations/Grow.js +41 -54
- package/cjs/Animations/GrowRight.js +41 -63
- package/cjs/Animations/GrowVertical.js +7 -47
- package/cjs/CheckableGroup.js +65 -67
- package/cjs/DeferRenderAfterComputation.js +24 -48
- package/cjs/FocusGroup/FocusGrid.js +143 -108
- package/cjs/FocusGroup/FocusGroup.js +147 -88
- package/cjs/FocusGroup/FocusGroupContext.js +11 -38
- package/cjs/FocusGroup/FocusGroupManager.js +47 -56
- package/cjs/FocusGroup/focusGroupManagerHoc.js +42 -52
- package/cjs/FocusGroup/index.js +21 -47
- package/cjs/FocusGroup/useFocusGroupItem.js +51 -59
- package/cjs/FocusGroup/utils/getNextCellPosition.js +27 -47
- package/cjs/GroupContext/Group.js +73 -64
- package/cjs/GroupContext/GroupContext.js +13 -36
- package/cjs/GroupContext/GroupItem.js +21 -39
- package/cjs/GroupContext/index.js +13 -39
- package/cjs/ScrollSync/ScrollSync.js +75 -60
- package/cjs/ScrollSync/ScrollSyncPane.js +60 -52
- package/cjs/ScrollSync/ScrollSyncProvider.js +50 -103
- package/cjs/ScrollSync/index.js +11 -37
- package/cjs/ScrollSync/useScrollSync.js +7 -38
- package/cjs/constants.js +46 -65
- package/cjs/createDataInstance/createInstancePlugin.js +29 -41
- package/cjs/createDataInstance/createInstanceRef.js +71 -66
- package/cjs/createDataInstance/utils.js +100 -76
- package/cjs/defer-render-hoc/index.js +41 -48
- package/cjs/dimsum.config.js +6 -38
- package/cjs/index.js +17 -40
- package/cjs/prop-types.js +49 -106
- package/cjs/react-spring/index.js +14 -28
- package/cjs/react-spring/renderprops.js +14 -28
- package/cjs/toolbar/ToolbarProvider.js +94 -82
- package/cjs/useDataGrid/VolatileRowsListener.js +13 -38
- package/cjs/useDataGrid/index.js +7 -36
- package/cjs/useDataGrid/initColumnDefinition.js +110 -105
- package/cjs/useDataGrid/useDataGrid.js +148 -122
- package/cjs/useDataList/index.js +7 -36
- package/cjs/useDataList/recordIterator.js +18 -42
- package/cjs/useDataList/useDataList.js +83 -74
- package/cjs/utils.js +80 -71
- package/cjs/virtualization/AutoHeightList.js +54 -62
- package/cjs/virtualization/FluidHeightList.js +48 -42
- package/cjs/virtualization/index.js +20 -48
- package/esm/Animations/BaseAnimation.js +29 -26
- package/esm/Animations/Grow.js +35 -25
- package/esm/Animations/GrowRight.js +35 -34
- package/esm/Animations/GrowVertical.js +4 -29
- package/esm/CheckableGroup.js +52 -35
- package/esm/DeferRenderAfterComputation.js +15 -16
- package/esm/FocusGroup/FocusGrid.js +117 -64
- package/esm/FocusGroup/FocusGroup.js +137 -56
- package/esm/FocusGroup/FocusGroupContext.js +5 -9
- package/esm/FocusGroup/FocusGroupManager.js +38 -24
- package/esm/FocusGroup/focusGroupManagerHoc.js +36 -24
- package/esm/FocusGroup/index.js +6 -18
- package/esm/FocusGroup/useFocusGroupItem.js +40 -28
- package/esm/FocusGroup/utils/getNextCellPosition.js +25 -18
- package/esm/GroupContext/Group.js +66 -34
- package/esm/GroupContext/GroupContext.js +5 -7
- package/esm/GroupContext/GroupItem.js +15 -10
- package/esm/GroupContext/index.js +3 -10
- package/esm/ScrollSync/ScrollSync.js +64 -30
- package/esm/ScrollSync/ScrollSyncPane.js +52 -22
- package/esm/ScrollSync/ScrollSyncProvider.js +42 -74
- package/esm/ScrollSync/index.js +2 -8
- package/esm/ScrollSync/useScrollSync.js +5 -9
- package/esm/constants.js +28 -37
- package/esm/createDataInstance/createInstancePlugin.js +23 -12
- package/esm/createDataInstance/createInstanceRef.js +59 -36
- package/esm/createDataInstance/utils.js +85 -48
- package/esm/defer-render-hoc/index.js +31 -17
- package/esm/dimsum.config.js +4 -9
- package/esm/index.js +5 -11
- package/esm/prop-types.js +31 -75
- package/esm/react-spring/index.js +1 -3
- package/esm/react-spring/renderprops.js +1 -3
- package/esm/toolbar/ToolbarProvider.js +74 -45
- package/esm/useDataGrid/VolatileRowsListener.js +11 -9
- package/esm/useDataGrid/index.js +1 -7
- package/esm/useDataGrid/initColumnDefinition.js +94 -78
- package/esm/useDataGrid/useDataGrid.js +99 -82
- package/esm/useDataList/index.js +1 -7
- package/esm/useDataList/recordIterator.js +14 -13
- package/esm/useDataList/useDataList.js +67 -44
- package/esm/utils.js +59 -42
- package/esm/virtualization/AutoHeightList.js +40 -28
- package/esm/virtualization/FluidHeightList.js +38 -14
- package/esm/virtualization/index.js +16 -19
- package/package.json +3 -3
- package/types/Animations/BaseAnimation.d.ts +0 -1
- package/types/Animations/Grow.d.ts +0 -1
- package/types/Animations/GrowRight.d.ts +0 -1
- package/types/CheckableGroup.d.ts +0 -1
- package/types/DeferRenderAfterComputation.d.ts +2 -3
- package/types/FocusGroup/FocusGrid.d.ts +3 -5
- package/types/FocusGroup/FocusGroup.d.ts +1 -3
- package/types/FocusGroup/FocusGroupContext.d.ts +2 -3
- package/types/FocusGroup/FocusGroupManager.d.ts +1 -3
- package/types/FocusGroup/focusGroupManagerHoc.d.ts +1 -3
- package/types/FocusGroup/index.d.ts +6 -6
- package/types/FocusGroup/useFocusGroupItem.d.ts +1 -3
- package/types/FocusGroup/utils/getNextCellPosition.d.ts +1 -3
- package/types/GroupContext/Group.d.ts +0 -1
- package/types/GroupContext/GroupItem.d.ts +0 -1
- package/types/GroupContext/index.d.ts +3 -3
- package/types/ScrollSync/ScrollSync.d.ts +2 -4
- package/types/ScrollSync/ScrollSyncPane.d.ts +2 -2
- package/types/ScrollSync/index.d.ts +2 -2
- package/types/ScrollSync/useScrollSync.d.ts +5 -6
- package/types/createDataInstance/createInstancePlugin.d.ts +1 -2
- package/types/createDataInstance/createInstanceRef.d.ts +1 -3
- package/types/dimsum.config.d.ts +2 -3
- package/types/index.d.ts +2 -2
- package/types/toolbar/ToolbarProvider.d.ts +8 -3
- package/types/useDataGrid/VolatileRowsListener.d.ts +1 -3
- package/types/useDataGrid/index.d.ts +1 -1
- package/types/useDataGrid/initColumnDefinition.d.ts +1 -2
- package/types/useDataGrid/useDataGrid.d.ts +2 -3
- package/types/useDataList/index.d.ts +1 -1
- package/types/useDataList/useDataList.d.ts +2 -3
- package/cjs/Animations/BaseAnimation.js.map +0 -7
- package/cjs/Animations/Grow.js.map +0 -7
- package/cjs/Animations/GrowRight.js.map +0 -7
- package/cjs/Animations/GrowVertical.js.map +0 -7
- package/cjs/CheckableGroup.js.map +0 -7
- package/cjs/DeferRenderAfterComputation.js.map +0 -7
- package/cjs/FocusGroup/FocusGrid.js.map +0 -7
- package/cjs/FocusGroup/FocusGroup.js.map +0 -7
- package/cjs/FocusGroup/FocusGroupContext.js.map +0 -7
- package/cjs/FocusGroup/FocusGroupManager.js.map +0 -7
- package/cjs/FocusGroup/focusGroupManagerHoc.js.map +0 -7
- package/cjs/FocusGroup/index.js.map +0 -7
- package/cjs/FocusGroup/useFocusGroupItem.js.map +0 -7
- package/cjs/FocusGroup/utils/getNextCellPosition.js.map +0 -7
- package/cjs/GroupContext/Group.js.map +0 -7
- package/cjs/GroupContext/GroupContext.js.map +0 -7
- package/cjs/GroupContext/GroupItem.js.map +0 -7
- package/cjs/GroupContext/index.js.map +0 -7
- package/cjs/ScrollSync/ScrollSync.js.map +0 -7
- package/cjs/ScrollSync/ScrollSyncPane.js.map +0 -7
- package/cjs/ScrollSync/ScrollSyncProvider.js.map +0 -7
- package/cjs/ScrollSync/index.js.map +0 -7
- package/cjs/ScrollSync/useScrollSync.js.map +0 -7
- package/cjs/constants.js.map +0 -7
- package/cjs/createDataInstance/createInstancePlugin.js.map +0 -7
- package/cjs/createDataInstance/createInstanceRef.js.map +0 -7
- package/cjs/createDataInstance/utils.js.map +0 -7
- package/cjs/defer-render-hoc/index.js.map +0 -7
- package/cjs/dimsum.config.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/cjs/prop-types.js.map +0 -7
- package/cjs/react-spring/index.js.map +0 -7
- package/cjs/react-spring/renderprops.js.map +0 -7
- package/cjs/toolbar/ToolbarProvider.js.map +0 -7
- package/cjs/useDataGrid/VolatileRowsListener.js.map +0 -7
- package/cjs/useDataGrid/index.js.map +0 -7
- package/cjs/useDataGrid/initColumnDefinition.js.map +0 -7
- package/cjs/useDataGrid/useDataGrid.js.map +0 -7
- package/cjs/useDataList/index.js.map +0 -7
- package/cjs/useDataList/recordIterator.js.map +0 -7
- package/cjs/useDataList/useDataList.js.map +0 -7
- package/cjs/utils.js.map +0 -7
- package/cjs/virtualization/AutoHeightList.js.map +0 -7
- package/cjs/virtualization/FluidHeightList.js.map +0 -7
- package/cjs/virtualization/index.js.map +0 -7
- package/esm/Animations/BaseAnimation.js.map +0 -7
- package/esm/Animations/Grow.js.map +0 -7
- package/esm/Animations/GrowRight.js.map +0 -7
- package/esm/Animations/GrowVertical.js.map +0 -7
- package/esm/CheckableGroup.js.map +0 -7
- package/esm/DeferRenderAfterComputation.js.map +0 -7
- package/esm/FocusGroup/FocusGrid.js.map +0 -7
- package/esm/FocusGroup/FocusGroup.js.map +0 -7
- package/esm/FocusGroup/FocusGroupContext.js.map +0 -7
- package/esm/FocusGroup/FocusGroupManager.js.map +0 -7
- package/esm/FocusGroup/focusGroupManagerHoc.js.map +0 -7
- package/esm/FocusGroup/index.js.map +0 -7
- package/esm/FocusGroup/useFocusGroupItem.js.map +0 -7
- package/esm/FocusGroup/utils/getNextCellPosition.js.map +0 -7
- package/esm/GroupContext/Group.js.map +0 -7
- package/esm/GroupContext/GroupContext.js.map +0 -7
- package/esm/GroupContext/GroupItem.js.map +0 -7
- package/esm/GroupContext/index.js.map +0 -7
- package/esm/ScrollSync/ScrollSync.js.map +0 -7
- package/esm/ScrollSync/ScrollSyncPane.js.map +0 -7
- package/esm/ScrollSync/ScrollSyncProvider.js.map +0 -7
- package/esm/ScrollSync/index.js.map +0 -7
- package/esm/ScrollSync/useScrollSync.js.map +0 -7
- package/esm/constants.js.map +0 -7
- package/esm/createDataInstance/createInstancePlugin.js.map +0 -7
- package/esm/createDataInstance/createInstanceRef.js.map +0 -7
- package/esm/createDataInstance/utils.js.map +0 -7
- package/esm/defer-render-hoc/index.js.map +0 -7
- package/esm/dimsum.config.js.map +0 -7
- package/esm/index.js.map +0 -7
- package/esm/prop-types.js.map +0 -7
- package/esm/react-spring/index.js.map +0 -7
- package/esm/react-spring/renderprops.js.map +0 -7
- package/esm/toolbar/ToolbarProvider.js.map +0 -7
- package/esm/useDataGrid/VolatileRowsListener.js.map +0 -7
- package/esm/useDataGrid/index.js.map +0 -7
- package/esm/useDataGrid/initColumnDefinition.js.map +0 -7
- package/esm/useDataGrid/useDataGrid.js.map +0 -7
- package/esm/useDataList/index.js.map +0 -7
- package/esm/useDataList/recordIterator.js.map +0 -7
- package/esm/useDataList/useDataList.js.map +0 -7
- package/esm/utils.js.map +0 -7
- package/esm/virtualization/AutoHeightList.js.map +0 -7
- package/esm/virtualization/FluidHeightList.js.map +0 -7
- package/esm/virtualization/index.js.map +0 -7
package/cjs/utils.js
CHANGED
|
@@ -1,95 +1,89 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
getAllNonEmptyNodesIds: () => getAllNonEmptyNodesIds,
|
|
32
|
-
getOffsetRect: () => getOffsetRect,
|
|
33
|
-
getTotalScroll: () => getTotalScroll,
|
|
34
|
-
getTransformProps: () => getTransformProps,
|
|
35
|
-
isArray: () => isArray,
|
|
36
|
-
isDefined: () => isDefined,
|
|
37
|
-
isFunction: () => isFunction,
|
|
38
|
-
isInternetExplorer: () => isInternetExplorer,
|
|
39
|
-
isNumber: () => isNumber,
|
|
40
|
-
isString: () => isString,
|
|
41
|
-
isUndefined: () => isUndefined,
|
|
42
|
-
listWithChildren: () => listWithChildren,
|
|
43
|
-
objectType: () => objectType
|
|
44
|
-
});
|
|
45
|
-
var React = __toESM(require("react"));
|
|
46
|
-
const objectType = (obj) => Object.prototype.toString.call(obj).slice(8, -1);
|
|
47
|
-
const isDefined = (param) => typeof param !== "undefined";
|
|
48
|
-
const isUndefined = (param) => typeof param === "undefined";
|
|
49
|
-
const isFunction = (param) => typeof param === "function";
|
|
50
|
-
const isNumber = (param) => typeof param === "number" && !isNaN(param);
|
|
51
|
-
const isString = (str) => objectType(str) === "String";
|
|
52
|
-
const isArray = (arr) => objectType(arr) === "Array";
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
+
require('core-js/modules/esnext.async-iterator.map.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.map.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
11
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
12
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
13
|
+
|
|
14
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
|
+
|
|
16
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
17
|
+
|
|
18
|
+
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; }
|
|
19
|
+
|
|
20
|
+
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__default["default"](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; }
|
|
21
|
+
|
|
22
|
+
/* eslint-disable no-cond-assign */
|
|
23
|
+
const objectType = obj => Object.prototype.toString.call(obj).slice(8, -1);
|
|
24
|
+
const isDefined = param => typeof param !== 'undefined';
|
|
25
|
+
const isUndefined = param => typeof param === 'undefined';
|
|
26
|
+
const isFunction = param => typeof param === 'function';
|
|
27
|
+
const isNumber = param => typeof param === 'number' && !isNaN(param); // eslint-disable-line
|
|
28
|
+
|
|
29
|
+
const isString = str => objectType(str) === 'String';
|
|
30
|
+
const isArray = arr => objectType(arr) === 'Array';
|
|
53
31
|
const closest = (target, selector) => {
|
|
32
|
+
// closest(e.target, '.field')
|
|
54
33
|
while (target) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
if (target.msMatchesSelector && target.msMatchesSelector(selector))
|
|
58
|
-
|
|
34
|
+
// eslint-disable-line
|
|
35
|
+
if (target.matches && target.matches(selector)) return target;
|
|
36
|
+
if (target.msMatchesSelector && target.msMatchesSelector(selector)) return target; // eslint-disable-next-line no-param-reassign
|
|
37
|
+
|
|
59
38
|
target = target.parentNode;
|
|
60
39
|
}
|
|
40
|
+
|
|
61
41
|
return null;
|
|
62
42
|
};
|
|
63
|
-
const getOffsetRect =
|
|
43
|
+
const getOffsetRect = elem => {
|
|
44
|
+
// (1)
|
|
64
45
|
const box = elem.getBoundingClientRect();
|
|
65
|
-
const {
|
|
46
|
+
const {
|
|
47
|
+
body,
|
|
48
|
+
documentElement
|
|
49
|
+
} = document; // (2)
|
|
50
|
+
|
|
66
51
|
const scrollTop = window.pageYOffset || documentElement.scrollTop || body.scrollTop;
|
|
67
|
-
const scrollLeft = window.pageXOffset || documentElement.scrollLeft || body.scrollLeft;
|
|
52
|
+
const scrollLeft = window.pageXOffset || documentElement.scrollLeft || body.scrollLeft; // (3)
|
|
53
|
+
|
|
68
54
|
const clientTop = documentElement.clientTop || body.clientTop || 0;
|
|
69
|
-
const clientLeft = documentElement.clientLeft || body.clientLeft || 0;
|
|
55
|
+
const clientLeft = documentElement.clientLeft || body.clientLeft || 0; // (4)
|
|
56
|
+
|
|
70
57
|
const top = box.top + scrollTop - clientTop;
|
|
71
58
|
const left = box.left + scrollLeft - clientLeft;
|
|
72
|
-
return {
|
|
59
|
+
return {
|
|
60
|
+
top: Math.round(top),
|
|
61
|
+
left: Math.round(left)
|
|
62
|
+
};
|
|
73
63
|
};
|
|
74
|
-
const getTotalScroll =
|
|
64
|
+
const getTotalScroll = elem => {
|
|
75
65
|
let top = 0;
|
|
76
|
-
let left = 0;
|
|
66
|
+
let left = 0; // eslint-disable-next-line no-param-reassign
|
|
67
|
+
|
|
77
68
|
while (elem = elem.parentNode) {
|
|
78
69
|
top += elem.scrollTop || 0;
|
|
79
70
|
left += elem.scrollLeft || 0;
|
|
80
71
|
}
|
|
81
|
-
|
|
72
|
+
|
|
73
|
+
return {
|
|
74
|
+
top,
|
|
75
|
+
left
|
|
76
|
+
};
|
|
82
77
|
};
|
|
83
78
|
const getTransformProps = (x, y) => ({
|
|
84
|
-
transform:
|
|
79
|
+
transform: "translate(".concat(x, "px, ").concat(y, "px)")
|
|
85
80
|
});
|
|
86
|
-
const listWithChildren = (list, childrenProp) => list.map(
|
|
87
|
-
...item,
|
|
81
|
+
const listWithChildren = (list, childrenProp) => list.map(item => _objectSpread(_objectSpread({}, item), {}, {
|
|
88
82
|
[childrenProp]: item[childrenProp] ? listWithChildren(item[childrenProp], childrenProp) : []
|
|
89
83
|
}));
|
|
90
84
|
const getAllNonEmptyNodesIds = (items, childrenProp) => {
|
|
91
85
|
let childrenIds = [];
|
|
92
|
-
const ids = items.filter(
|
|
86
|
+
const ids = items.filter(item => item[childrenProp].length).map(item => {
|
|
93
87
|
childrenIds = childrenIds.concat(getAllNonEmptyNodesIds(item[childrenProp], childrenProp));
|
|
94
88
|
return item.id;
|
|
95
89
|
});
|
|
@@ -97,11 +91,26 @@ const getAllNonEmptyNodesIds = (items, childrenProp) => {
|
|
|
97
91
|
};
|
|
98
92
|
const isInternetExplorer = () => {
|
|
99
93
|
const ua = window.navigator.userAgent;
|
|
100
|
-
const msie = ua.indexOf(
|
|
94
|
+
const msie = ua.indexOf('MSIE '); // If Internet Explorer, return version number
|
|
95
|
+
|
|
101
96
|
if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv:11\./)) {
|
|
102
97
|
return true;
|
|
103
98
|
}
|
|
99
|
+
|
|
104
100
|
return false;
|
|
105
101
|
};
|
|
106
|
-
|
|
107
|
-
|
|
102
|
+
|
|
103
|
+
exports.closest = closest;
|
|
104
|
+
exports.getAllNonEmptyNodesIds = getAllNonEmptyNodesIds;
|
|
105
|
+
exports.getOffsetRect = getOffsetRect;
|
|
106
|
+
exports.getTotalScroll = getTotalScroll;
|
|
107
|
+
exports.getTransformProps = getTransformProps;
|
|
108
|
+
exports.isArray = isArray;
|
|
109
|
+
exports.isDefined = isDefined;
|
|
110
|
+
exports.isFunction = isFunction;
|
|
111
|
+
exports.isInternetExplorer = isInternetExplorer;
|
|
112
|
+
exports.isNumber = isNumber;
|
|
113
|
+
exports.isString = isString;
|
|
114
|
+
exports.isUndefined = isUndefined;
|
|
115
|
+
exports.listWithChildren = listWithChildren;
|
|
116
|
+
exports.objectType = objectType;
|
|
@@ -1,69 +1,61 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
__export(AutoHeightList_exports, {
|
|
30
|
-
AutoHeightList: () => AutoHeightList
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
var import_react = __toESM(require("react"));
|
|
34
|
-
var import_react_window = require("react-window");
|
|
35
|
-
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
36
|
-
const AutoHeightList = (0, import_react.forwardRef)(({
|
|
37
|
-
itemCount,
|
|
38
|
-
className,
|
|
39
|
-
innerRef,
|
|
40
|
-
itemData,
|
|
41
|
-
itemKey,
|
|
42
|
-
itemSize,
|
|
43
|
-
outerRef,
|
|
44
|
-
component: ListComponent = import_react_window.FixedSizeList,
|
|
45
|
-
...otherProps
|
|
46
|
-
}, ref) => {
|
|
47
|
-
const listRef = (0, import_react.useRef)();
|
|
48
|
-
const outerListRef = (0, import_react.useRef)();
|
|
49
|
-
(0, import_ds_utilities.useWindowScrollerList)({
|
|
50
|
-
listInstance: listRef,
|
|
51
|
-
outerListRef
|
|
52
|
-
});
|
|
53
|
-
return /* @__PURE__ */ import_react.default.createElement(ListComponent, {
|
|
54
|
-
...otherProps,
|
|
55
|
-
ref: (0, import_ds_utilities.mergeRefs)(ref, listRef),
|
|
56
|
-
className: (0, import_ds_utilities.cx)(className, "window-scroller-override"),
|
|
57
|
-
height: window.innerHeight,
|
|
58
|
-
innerRef,
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
10
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
11
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
12
|
+
var React = require('react');
|
|
13
|
+
var reactWindow = require('react-window');
|
|
14
|
+
var dsUtilities = require('@elliemae/ds-utilities');
|
|
15
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
16
|
+
|
|
17
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
18
|
+
|
|
19
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
20
|
+
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
21
|
+
|
|
22
|
+
const _excluded = ["itemCount", "className", "innerRef", "itemData", "itemKey", "itemSize", "outerRef", "component"];
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
26
|
+
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__default["default"](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; }
|
|
27
|
+
const AutoHeightList = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
28
|
+
let {
|
|
59
29
|
itemCount,
|
|
30
|
+
className,
|
|
31
|
+
innerRef,
|
|
60
32
|
itemData,
|
|
61
33
|
itemKey,
|
|
62
34
|
itemSize,
|
|
63
|
-
outerRef
|
|
35
|
+
outerRef,
|
|
36
|
+
component: ListComponent = reactWindow.FixedSizeList
|
|
37
|
+
} = _ref,
|
|
38
|
+
otherProps = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
39
|
+
|
|
40
|
+
const listRef = React.useRef();
|
|
41
|
+
const outerListRef = React.useRef();
|
|
42
|
+
dsUtilities.useWindowScrollerList({
|
|
43
|
+
listInstance: listRef,
|
|
44
|
+
outerListRef
|
|
45
|
+
});
|
|
46
|
+
return /*#__PURE__*/jsxRuntime.jsx(ListComponent, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
47
|
+
ref: dsUtilities.mergeRefs(ref, listRef),
|
|
48
|
+
className: dsUtilities.cx(className, 'window-scroller-override'),
|
|
49
|
+
height: window.innerHeight,
|
|
50
|
+
innerRef: innerRef,
|
|
51
|
+
itemCount: itemCount,
|
|
52
|
+
itemData: itemData,
|
|
53
|
+
itemKey: itemKey,
|
|
54
|
+
itemSize: itemSize,
|
|
55
|
+
outerRef: dsUtilities.mergeRefs(outerListRef, outerRef),
|
|
64
56
|
overscanCount: 10,
|
|
65
57
|
useIsScrolling: true
|
|
66
|
-
});
|
|
58
|
+
}));
|
|
67
59
|
});
|
|
68
|
-
|
|
69
|
-
|
|
60
|
+
|
|
61
|
+
exports.AutoHeightList = AutoHeightList;
|
|
@@ -1,43 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
10
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
11
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
12
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
13
|
+
var React = require('react');
|
|
14
|
+
var AutoSizer = require('react-virtualized-auto-sizer');
|
|
15
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
16
|
+
|
|
17
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
18
|
+
|
|
19
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
20
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
21
|
+
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
22
|
+
var AutoSizer__default = /*#__PURE__*/_interopDefaultLegacy(AutoSizer);
|
|
23
|
+
|
|
24
|
+
const _excluded = ["component"];
|
|
25
|
+
|
|
26
|
+
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; }
|
|
27
|
+
|
|
28
|
+
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__default["default"](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; }
|
|
29
|
+
const FluidHeightList = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
30
|
+
let {
|
|
31
|
+
component: Component
|
|
32
|
+
} = _ref,
|
|
33
|
+
props = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
34
|
+
|
|
35
|
+
return /*#__PURE__*/_jsx__default["default"](AutoSizer__default["default"], {
|
|
36
|
+
disableWidth: true
|
|
37
|
+
}, void 0, _ref2 => {
|
|
38
|
+
let {
|
|
39
|
+
height: fluidHeight
|
|
40
|
+
} = _ref2;
|
|
41
|
+
return /*#__PURE__*/jsxRuntime.jsx(Component, _objectSpread(_objectSpread({}, props), {}, {
|
|
42
|
+
ref: ref,
|
|
43
|
+
height: fluidHeight - 32 // taking in count the margins of the list
|
|
44
|
+
|
|
45
|
+
}));
|
|
46
|
+
});
|
|
31
47
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
var import_react_virtualized_auto_sizer = __toESM(require("react-virtualized-auto-sizer"));
|
|
35
|
-
const FluidHeightList = (0, import_react.forwardRef)(({ component: Component, ...props }, ref) => /* @__PURE__ */ import_react.default.createElement(import_react_virtualized_auto_sizer.default, {
|
|
36
|
-
disableWidth: true
|
|
37
|
-
}, ({ height: fluidHeight }) => /* @__PURE__ */ import_react.default.createElement(Component, {
|
|
38
|
-
...props,
|
|
39
|
-
ref,
|
|
40
|
-
height: fluidHeight - 32
|
|
41
|
-
})));
|
|
42
|
-
module.exports = __toCommonJS(FluidHeightList_exports);
|
|
43
|
-
//# sourceMappingURL=FluidHeightList.js.map
|
|
48
|
+
|
|
49
|
+
exports.FluidHeightList = FluidHeightList;
|
|
@@ -1,50 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var virtualization_exports = {};
|
|
29
|
-
__export(virtualization_exports, {
|
|
30
|
-
AutoHeightList: () => import_AutoHeightList.AutoHeightList,
|
|
31
|
-
FluidHeightList: () => import_FluidHeightList.FluidHeightList,
|
|
32
|
-
getVirtualListComponent: () => getVirtualListComponent
|
|
33
|
-
});
|
|
34
|
-
var React = __toESM(require("react"));
|
|
35
|
-
var import_FluidHeightList = require("./FluidHeightList");
|
|
36
|
-
var import_AutoHeightList = require("./AutoHeightList");
|
|
37
|
-
function getVirtualListComponent({
|
|
38
|
-
component: Component,
|
|
39
|
-
fluid,
|
|
40
|
-
height,
|
|
41
|
-
autoHeight
|
|
42
|
-
}) {
|
|
43
|
-
if (autoHeight)
|
|
44
|
-
return import_AutoHeightList.AutoHeightList;
|
|
45
|
-
if (fluid)
|
|
46
|
-
return import_FluidHeightList.FluidHeightList;
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var FluidHeightList = require('./FluidHeightList.js');
|
|
6
|
+
var AutoHeightList = require('./AutoHeightList.js');
|
|
7
|
+
|
|
8
|
+
function getVirtualListComponent(_ref) {
|
|
9
|
+
let {
|
|
10
|
+
component: Component,
|
|
11
|
+
fluid,
|
|
12
|
+
height,
|
|
13
|
+
autoHeight
|
|
14
|
+
} = _ref;
|
|
15
|
+
if (autoHeight) return AutoHeightList.AutoHeightList;
|
|
16
|
+
if (fluid) return FluidHeightList.FluidHeightList;
|
|
47
17
|
return Component;
|
|
48
18
|
}
|
|
49
|
-
|
|
50
|
-
|
|
19
|
+
|
|
20
|
+
exports.FluidHeightList = FluidHeightList.FluidHeightList;
|
|
21
|
+
exports.AutoHeightList = AutoHeightList.AutoHeightList;
|
|
22
|
+
exports.getVirtualListComponent = getVirtualListComponent;
|
|
@@ -1,27 +1,30 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
|
+
import 'react';
|
|
4
|
+
import { Transition } from 'react-spring/renderprops';
|
|
5
|
+
|
|
6
|
+
const BaseAnimation = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
keys = undefined,
|
|
9
|
+
items = [],
|
|
10
|
+
duration = 100,
|
|
11
|
+
enter = {},
|
|
12
|
+
from = {},
|
|
13
|
+
leave = {},
|
|
14
|
+
onRest = () => null,
|
|
15
|
+
children
|
|
16
|
+
} = _ref;
|
|
17
|
+
return /*#__PURE__*/_jsx(Transition, {
|
|
18
|
+
config: {
|
|
19
|
+
duration
|
|
20
|
+
},
|
|
21
|
+
enter: enter,
|
|
22
|
+
from: from,
|
|
23
|
+
items: items,
|
|
24
|
+
keys: keys,
|
|
25
|
+
leave: leave,
|
|
26
|
+
onRest: onRest
|
|
27
|
+
}, void 0, children);
|
|
26
28
|
};
|
|
27
|
-
|
|
29
|
+
|
|
30
|
+
export { BaseAnimation as default };
|
package/esm/Animations/Grow.js
CHANGED
|
@@ -1,26 +1,36 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
|
+
import 'react';
|
|
4
|
+
import BaseAnimation from './BaseAnimation.js';
|
|
5
|
+
|
|
6
|
+
const Grow = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
keys = undefined,
|
|
9
|
+
duration,
|
|
10
|
+
items = undefined,
|
|
11
|
+
from = 0,
|
|
12
|
+
to = 1,
|
|
13
|
+
children,
|
|
14
|
+
onRest = () => null
|
|
15
|
+
} = _ref;
|
|
16
|
+
return /*#__PURE__*/_jsx(BaseAnimation, {
|
|
17
|
+
duration: duration,
|
|
18
|
+
enter: {
|
|
19
|
+
opacity: 1,
|
|
20
|
+
transform: "scale(".concat(to, ")")
|
|
21
|
+
},
|
|
22
|
+
from: {
|
|
23
|
+
opacity: 0,
|
|
24
|
+
transform: "scale(".concat(from, ")")
|
|
25
|
+
},
|
|
26
|
+
items: items,
|
|
27
|
+
keys: keys,
|
|
28
|
+
leave: {
|
|
29
|
+
opacity: 0,
|
|
30
|
+
transform: "scale(".concat(from, ")")
|
|
31
|
+
},
|
|
32
|
+
onRest: onRest
|
|
33
|
+
}, void 0, children);
|
|
25
34
|
};
|
|
26
|
-
|
|
35
|
+
|
|
36
|
+
export { Grow as default };
|