@elliemae/ds-shared 1.60.0 → 2.0.0-alpha.12
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 +19 -27
- package/cjs/Animations/Grow.js +17 -22
- package/cjs/Animations/GrowRight.js +17 -23
- package/cjs/Animations/GrowVertical.js +3 -2
- package/cjs/CheckableGroup.js +40 -46
- package/cjs/DeferRenderAfterComputation.js +12 -21
- package/cjs/FocusGroup/FocusGrid.js +91 -92
- package/cjs/FocusGroup/FocusGroup.js +225 -262
- package/cjs/FocusGroup/FocusGroupContext.js +1 -2
- package/cjs/FocusGroup/FocusGroupManager.js +88 -126
- package/cjs/FocusGroup/focusGroupManagerHoc.js +28 -27
- package/cjs/FocusGroup/index.js +14 -28
- package/cjs/FocusGroup/useFocusGroupItem.js +27 -24
- package/cjs/FocusGroup/utils/getNextCellPosition.js +14 -15
- package/cjs/GroupContext/Group.js +81 -103
- package/cjs/GroupContext/GroupContext.js +1 -2
- package/cjs/GroupContext/GroupItem.js +12 -10
- package/cjs/GroupContext/index.js +6 -15
- package/cjs/ScrollSync/ScrollSync.js +90 -112
- package/cjs/ScrollSync/ScrollSyncPane.js +58 -90
- package/cjs/ScrollSync/ScrollSyncProvider.js +36 -26
- package/cjs/ScrollSync/index.js +4 -13
- package/cjs/ScrollSync/useScrollSync.js +0 -1
- package/cjs/constants.js +43 -4
- package/cjs/createDataInstance/createInstancePlugin.js +11 -10
- package/cjs/createDataInstance/createInstanceRef.js +41 -42
- package/cjs/createDataInstance/utils.js +56 -58
- package/cjs/defer-render-hoc/index.js +26 -61
- package/cjs/dimsum.config.js +7 -0
- package/cjs/index.js +10 -20
- package/cjs/prop-types.js +59 -0
- package/cjs/react-spring/index.js +3 -6
- package/cjs/react-spring/renderprops.js +3 -6
- package/cjs/toolbar/ToolbarProvider.js +65 -77
- package/cjs/useDataGrid/VolatileRowsListener.js +13 -27
- package/cjs/useDataGrid/index.js +2 -17
- package/cjs/useDataGrid/initColumnDefinition.js +46 -47
- package/cjs/useDataGrid/useDataGrid.js +104 -144
- package/cjs/useDataList/index.js +2 -15
- package/cjs/useDataList/recordIterator.js +9 -10
- package/cjs/useDataList/useDataList.js +51 -59
- package/cjs/utils.js +46 -59
- package/cjs/virtualization/AutoHeightList.js +31 -22
- package/cjs/virtualization/FluidHeightList.js +26 -12
- package/cjs/virtualization/index.js +12 -17
- package/esm/Animations/BaseAnimation.js +18 -26
- package/esm/Animations/Grow.js +15 -20
- package/esm/Animations/GrowRight.js +15 -21
- package/esm/Animations/GrowVertical.js +3 -2
- package/esm/CheckableGroup.js +38 -42
- package/esm/DeferRenderAfterComputation.js +12 -20
- package/esm/FocusGroup/FocusGrid.js +87 -89
- package/esm/FocusGroup/FocusGroup.js +222 -257
- package/esm/FocusGroup/FocusGroupContext.js +0 -1
- package/esm/FocusGroup/FocusGroupManager.js +82 -114
- package/esm/FocusGroup/focusGroupManagerHoc.js +24 -22
- package/esm/FocusGroup/index.js +0 -14
- package/esm/FocusGroup/useFocusGroupItem.js +25 -22
- package/esm/FocusGroup/utils/getNextCellPosition.js +14 -15
- package/esm/GroupContext/Group.js +80 -95
- package/esm/GroupContext/GroupContext.js +1 -2
- package/esm/GroupContext/GroupItem.js +10 -8
- package/esm/GroupContext/index.js +0 -9
- package/esm/ScrollSync/ScrollSync.js +88 -105
- package/esm/ScrollSync/ScrollSyncPane.js +56 -83
- package/esm/ScrollSync/ScrollSyncProvider.js +35 -26
- package/esm/ScrollSync/index.js +0 -9
- package/esm/ScrollSync/useScrollSync.js +0 -1
- package/esm/constants.js +31 -5
- package/esm/createDataInstance/createInstancePlugin.js +10 -8
- package/esm/createDataInstance/createInstanceRef.js +36 -36
- package/esm/createDataInstance/utils.js +55 -57
- package/esm/defer-render-hoc/index.js +25 -55
- package/esm/dimsum.config.js +5 -0
- package/esm/index.js +0 -10
- package/esm/prop-types.js +43 -0
- package/esm/react-spring/index.js +1 -2
- package/esm/react-spring/renderprops.js +1 -2
- package/esm/toolbar/ToolbarProvider.js +60 -71
- package/esm/useDataGrid/VolatileRowsListener.js +14 -23
- package/esm/useDataGrid/index.js +0 -15
- package/esm/useDataGrid/initColumnDefinition.js +43 -43
- package/esm/useDataGrid/useDataGrid.js +90 -127
- package/esm/useDataList/index.js +0 -13
- package/esm/useDataList/recordIterator.js +9 -10
- package/esm/useDataList/useDataList.js +39 -46
- package/esm/utils.js +44 -57
- package/esm/virtualization/AutoHeightList.js +28 -18
- package/esm/virtualization/FluidHeightList.js +24 -10
- package/esm/virtualization/index.js +6 -11
- package/package.json +201 -8
- package/types/Animations/BaseAnimation.d.ts +12 -0
- package/types/Animations/Grow.d.ts +11 -0
- package/types/Animations/GrowRight.d.ts +11 -0
- package/types/Animations/GrowVertical.d.ts +1 -0
- package/types/CheckableGroup.d.ts +20 -0
- package/types/DeferRenderAfterComputation.d.ts +6 -0
- package/types/FocusGroup/FocusGrid.d.ts +10 -0
- package/types/FocusGroup/FocusGroup.d.ts +36 -0
- package/types/FocusGroup/FocusGroupContext.d.ts +3 -0
- package/types/FocusGroup/FocusGroupManager.d.ts +24 -0
- package/types/FocusGroup/focusGroupManagerHoc.d.ts +7 -0
- package/types/FocusGroup/index.d.ts +6 -0
- package/types/FocusGroup/useFocusGroupItem.d.ts +2 -0
- package/types/FocusGroup/utils/getNextCellPosition.d.ts +12 -0
- package/types/GroupContext/Group.d.ts +14 -0
- package/types/GroupContext/GroupContext.d.ts +2 -0
- package/types/GroupContext/GroupItem.d.ts +5 -0
- package/types/GroupContext/index.d.ts +3 -0
- package/types/ScrollSync/ScrollSync.d.ts +21 -0
- package/types/ScrollSync/ScrollSyncPane.d.ts +3 -0
- package/types/ScrollSync/ScrollSyncProvider.d.ts +12 -0
- package/types/ScrollSync/index.d.ts +2 -0
- package/types/ScrollSync/useScrollSync.d.ts +6 -0
- package/types/constants.d.ts +30 -0
- package/types/createDataInstance/createInstancePlugin.d.ts +1 -0
- package/types/createDataInstance/createInstanceRef.d.ts +12 -0
- package/types/createDataInstance/tests/createInstanceRef.test.d.ts +0 -0
- package/types/createDataInstance/utils.d.ts +9 -0
- package/types/dimsum.config.d.ts +4 -0
- package/types/index.d.ts +2 -0
- package/types/prop-types.d.ts +41 -0
- package/types/react-spring/index.d.ts +1 -0
- package/types/react-spring/renderprops.d.ts +1 -0
- package/types/toolbar/ToolbarProvider.d.ts +10 -0
- package/types/useDataGrid/VolatileRowsListener.d.ts +5 -0
- package/types/useDataGrid/index.d.ts +1 -0
- package/types/useDataGrid/initColumnDefinition.d.ts +5 -0
- package/types/useDataGrid/useDataGrid.d.ts +8 -0
- package/types/useDataList/index.d.ts +1 -0
- package/types/useDataList/recordIterator.d.ts +1 -0
- package/types/useDataList/useDataList.d.ts +13 -0
- package/types/utils.d.ts +22 -0
- package/types/virtualization/AutoHeightList.d.ts +2 -0
- package/types/virtualization/FluidHeightList.d.ts +2 -0
- package/types/virtualization/index.d.ts +9 -0
- package/Animations/BaseAnimation/package.json +0 -10
- package/Animations/Grow/package.json +0 -10
- package/Animations/GrowRight/package.json +0 -10
- package/Animations/GrowVertical/package.json +0 -10
- package/CheckableGroup/package.json +0 -10
- package/DeferRenderAfterComputation/package.json +0 -10
- package/FocusGroup/FocusGrid/package.json +0 -10
- package/FocusGroup/FocusGroup/package.json +0 -10
- package/FocusGroup/FocusGroupContext/package.json +0 -10
- package/FocusGroup/FocusGroupManager/package.json +0 -10
- package/FocusGroup/focusGroupManagerHoc/package.json +0 -10
- package/FocusGroup/package.json +0 -10
- package/FocusGroup/useFocusGroupItem/package.json +0 -10
- package/FocusGroup/utils/getNextCellPosition/package.json +0 -10
- package/GroupContext/Group/package.json +0 -10
- package/GroupContext/GroupContext/package.json +0 -10
- package/GroupContext/GroupItem/package.json +0 -10
- package/GroupContext/package.json +0 -10
- package/ScrollSync/ScrollSync/package.json +0 -10
- package/ScrollSync/ScrollSyncPane/package.json +0 -10
- package/ScrollSync/ScrollSyncProvider/package.json +0 -10
- package/ScrollSync/package.json +0 -10
- package/ScrollSync/useScrollSync/package.json +0 -10
- package/cjs/Animations/BaseAnimation.js.map +0 -1
- package/cjs/Animations/Grow.js.map +0 -1
- package/cjs/Animations/GrowRight.js.map +0 -1
- package/cjs/Animations/GrowVertical.js.map +0 -1
- package/cjs/CheckableGroup.js.map +0 -1
- package/cjs/DeferRenderAfterComputation.js.map +0 -1
- package/cjs/FocusGroup/FocusGrid.js.map +0 -1
- package/cjs/FocusGroup/FocusGroup.js.map +0 -1
- package/cjs/FocusGroup/FocusGroupContext.js.map +0 -1
- package/cjs/FocusGroup/FocusGroupManager.js.map +0 -1
- package/cjs/FocusGroup/focusGroupManagerHoc.js.map +0 -1
- package/cjs/FocusGroup/index.js.map +0 -1
- package/cjs/FocusGroup/useFocusGroupItem.js.map +0 -1
- package/cjs/FocusGroup/utils/getNextCellPosition.js.map +0 -1
- package/cjs/GroupContext/Group.js.map +0 -1
- package/cjs/GroupContext/GroupContext.js.map +0 -1
- package/cjs/GroupContext/GroupItem.js.map +0 -1
- package/cjs/GroupContext/index.js.map +0 -1
- package/cjs/ScrollSync/ScrollSync.js.map +0 -1
- package/cjs/ScrollSync/ScrollSyncPane.js.map +0 -1
- package/cjs/ScrollSync/ScrollSyncProvider.js.map +0 -1
- package/cjs/ScrollSync/index.js.map +0 -1
- package/cjs/ScrollSync/useScrollSync.js.map +0 -1
- package/cjs/constants.js.map +0 -1
- package/cjs/createDataInstance/createInstancePlugin.js.map +0 -1
- package/cjs/createDataInstance/createInstanceRef.js.map +0 -1
- package/cjs/createDataInstance/utils.js.map +0 -1
- package/cjs/defer-render-hoc/index.js.map +0 -1
- package/cjs/index.js.map +0 -1
- package/cjs/react-spring/index.js.map +0 -1
- package/cjs/react-spring/renderprops.js.map +0 -1
- package/cjs/toolbar/ToolbarProvider.js.map +0 -1
- package/cjs/useDataGrid/VolatileRowsListener.js.map +0 -1
- package/cjs/useDataGrid/index.js.map +0 -1
- package/cjs/useDataGrid/initColumnDefinition.js.map +0 -1
- package/cjs/useDataGrid/useDataGrid.js.map +0 -1
- package/cjs/useDataList/index.js.map +0 -1
- package/cjs/useDataList/recordIterator.js.map +0 -1
- package/cjs/useDataList/useDataList.js.map +0 -1
- package/cjs/utils.js.map +0 -1
- package/cjs/virtualization/AutoHeightList.js.map +0 -1
- package/cjs/virtualization/FluidHeightList.js.map +0 -1
- package/cjs/virtualization/index.js.map +0 -1
- package/constants/package.json +0 -10
- package/createDataInstance/createInstancePlugin/package.json +0 -10
- package/createDataInstance/createInstanceRef/package.json +0 -10
- package/createDataInstance/utils/package.json +0 -10
- package/defer-render-hoc/package.json +0 -10
- package/esm/Animations/BaseAnimation.js.map +0 -1
- package/esm/Animations/Grow.js.map +0 -1
- package/esm/Animations/GrowRight.js.map +0 -1
- package/esm/Animations/GrowVertical.js.map +0 -1
- package/esm/CheckableGroup.js.map +0 -1
- package/esm/DeferRenderAfterComputation.js.map +0 -1
- package/esm/FocusGroup/FocusGrid.js.map +0 -1
- package/esm/FocusGroup/FocusGroup.js.map +0 -1
- package/esm/FocusGroup/FocusGroupContext.js.map +0 -1
- package/esm/FocusGroup/FocusGroupManager.js.map +0 -1
- package/esm/FocusGroup/focusGroupManagerHoc.js.map +0 -1
- package/esm/FocusGroup/index.js.map +0 -1
- package/esm/FocusGroup/useFocusGroupItem.js.map +0 -1
- package/esm/FocusGroup/utils/getNextCellPosition.js.map +0 -1
- package/esm/GroupContext/Group.js.map +0 -1
- package/esm/GroupContext/GroupContext.js.map +0 -1
- package/esm/GroupContext/GroupItem.js.map +0 -1
- package/esm/GroupContext/index.js.map +0 -1
- package/esm/ScrollSync/ScrollSync.js.map +0 -1
- package/esm/ScrollSync/ScrollSyncPane.js.map +0 -1
- package/esm/ScrollSync/ScrollSyncProvider.js.map +0 -1
- package/esm/ScrollSync/index.js.map +0 -1
- package/esm/ScrollSync/useScrollSync.js.map +0 -1
- package/esm/constants.js.map +0 -1
- package/esm/createDataInstance/createInstancePlugin.js.map +0 -1
- package/esm/createDataInstance/createInstanceRef.js.map +0 -1
- package/esm/createDataInstance/utils.js.map +0 -1
- package/esm/defer-render-hoc/index.js.map +0 -1
- package/esm/index.js.map +0 -1
- package/esm/react-spring/index.js.map +0 -1
- package/esm/react-spring/renderprops.js.map +0 -1
- package/esm/toolbar/ToolbarProvider.js.map +0 -1
- package/esm/useDataGrid/VolatileRowsListener.js.map +0 -1
- package/esm/useDataGrid/index.js.map +0 -1
- package/esm/useDataGrid/initColumnDefinition.js.map +0 -1
- package/esm/useDataGrid/useDataGrid.js.map +0 -1
- package/esm/useDataList/index.js.map +0 -1
- package/esm/useDataList/recordIterator.js.map +0 -1
- package/esm/useDataList/useDataList.js.map +0 -1
- package/esm/utils.js.map +0 -1
- package/esm/virtualization/AutoHeightList.js.map +0 -1
- package/esm/virtualization/FluidHeightList.js.map +0 -1
- package/esm/virtualization/index.js.map +0 -1
- package/react-spring/package.json +0 -10
- package/react-spring/renderprops/package.json +0 -10
- package/toolbar/ToolbarProvider/package.json +0 -10
- package/useDataGrid/VolatileRowsListener/package.json +0 -10
- package/useDataGrid/initColumnDefinition/package.json +0 -10
- package/useDataGrid/package.json +0 -10
- package/useDataGrid/useDataGrid/package.json +0 -10
- package/useDataList/package.json +0 -10
- package/useDataList/recordIterator/package.json +0 -10
- package/useDataList/useDataList/package.json +0 -10
- package/utils/package.json +0 -10
- package/virtualization/AutoHeightList/package.json +0 -10
- package/virtualization/FluidHeightList/package.json +0 -10
- package/virtualization/package.json +0 -10
|
@@ -2,31 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const defaultStrategy = () => {
|
|
6
6
|
throw Error('Implement an iterator strategy for record iterator');
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
function recordIterator(records) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
let strategy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultStrategy;
|
|
11
|
+
let decorators = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
12
|
+
let instance = arguments.length > 3 ? arguments[3] : undefined;
|
|
13
|
+
const nextRows = [];
|
|
14
14
|
strategy({
|
|
15
15
|
data: records,
|
|
16
|
-
cb:
|
|
17
|
-
|
|
16
|
+
cb: row => {
|
|
17
|
+
let nextRow = row; // eslint-disable-next-line no-loops/no-loops,no-plusplus
|
|
18
18
|
|
|
19
|
-
for (
|
|
19
|
+
for (let i = 0; i < decorators.length; i++) {
|
|
20
20
|
nextRow = decorators[i](nextRow, instance);
|
|
21
21
|
if (!nextRow) break;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
if (nextRow) nextRows.push(nextRow);
|
|
25
25
|
},
|
|
26
|
-
instance
|
|
26
|
+
instance
|
|
27
27
|
});
|
|
28
28
|
return nextRows;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
exports.recordIterator = recordIterator;
|
|
32
|
-
//# sourceMappingURL=recordIterator.js.map
|
|
@@ -2,109 +2,101 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
6
5
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
6
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
7
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.reduce.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.reduce.js');
|
|
11
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
12
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
13
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
14
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
8
15
|
var React = require('react');
|
|
9
16
|
var dsUtilities = require('@elliemae/ds-utilities');
|
|
10
17
|
var get = require('lodash/get');
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
require('@babel/runtime/helpers/slicedToArray');
|
|
15
|
-
require('uuid');
|
|
16
|
-
require('lodash');
|
|
18
|
+
var utils = require('../createDataInstance/utils.js');
|
|
19
|
+
var recordIterator = require('./recordIterator.js');
|
|
20
|
+
var createInstanceRef = require('../createDataInstance/createInstanceRef.js');
|
|
17
21
|
|
|
18
22
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
23
|
|
|
20
|
-
var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray);
|
|
21
24
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
22
25
|
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
23
26
|
var get__default = /*#__PURE__*/_interopDefaultLegacy(get);
|
|
24
27
|
|
|
25
|
-
|
|
28
|
+
const _excluded = ["data", "plugins", "renderers", "itemRenderer", "customDecorators"];
|
|
26
29
|
|
|
27
30
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
28
31
|
|
|
29
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default[
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return get__default[
|
|
32
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
33
|
+
const getItemLabel = function (record) {
|
|
34
|
+
let nameKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'name';
|
|
35
|
+
return get__default["default"](record, ['data', nameKey]);
|
|
33
36
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return get__default[
|
|
37
|
+
const getItemChildren = function (record) {
|
|
38
|
+
let childrenKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'children';
|
|
39
|
+
return get__default["default"](record, ['data', childrenKey]);
|
|
37
40
|
};
|
|
38
|
-
|
|
41
|
+
const listRenderers = {
|
|
39
42
|
list: 'ul',
|
|
40
43
|
item: 'li'
|
|
41
44
|
}; // todo: check if a plugin is a LIST plugin rather than GRID
|
|
42
45
|
|
|
43
46
|
function useDataList(_ref) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
data
|
|
59
|
-
renderers
|
|
60
|
-
plugins
|
|
47
|
+
let {
|
|
48
|
+
data = [],
|
|
49
|
+
plugins = [],
|
|
50
|
+
renderers = listRenderers,
|
|
51
|
+
itemRenderer = [],
|
|
52
|
+
customDecorators
|
|
53
|
+
} = _ref,
|
|
54
|
+
props = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
55
|
+
|
|
56
|
+
const listRef = React.useRef();
|
|
57
|
+
const {
|
|
58
|
+
instance,
|
|
59
|
+
decorators
|
|
60
|
+
} = createInstanceRef(_objectSpread({
|
|
61
|
+
data,
|
|
62
|
+
renderers,
|
|
63
|
+
plugins,
|
|
61
64
|
customDecorators: _objectSpread(_objectSpread({}, customDecorators), {}, {
|
|
62
|
-
recordIterator:
|
|
65
|
+
recordIterator: recordIterator.recordIterator,
|
|
63
66
|
getListProps: [],
|
|
64
67
|
getItemProps: [],
|
|
65
|
-
itemRenderer:
|
|
68
|
+
itemRenderer: [...itemRenderer],
|
|
66
69
|
// components reduce to compose item content
|
|
67
70
|
record: [],
|
|
68
71
|
records: []
|
|
69
72
|
})
|
|
70
|
-
}, props))
|
|
71
|
-
instance = _createInstanceRef.instance,
|
|
72
|
-
decorators = _createInstanceRef.decorators;
|
|
73
|
+
}, props));
|
|
73
74
|
|
|
74
|
-
instance.current.getListRef =
|
|
75
|
-
return listRef;
|
|
76
|
-
};
|
|
75
|
+
instance.current.getListRef = () => listRef;
|
|
77
76
|
|
|
78
|
-
instance.current.setListRef =
|
|
77
|
+
instance.current.setListRef = ref => {
|
|
79
78
|
listRef.current = ref;
|
|
80
79
|
};
|
|
81
80
|
|
|
82
|
-
instance.current.getItemLabel =
|
|
83
|
-
return getItemLabel(record, props.nameKey);
|
|
84
|
-
};
|
|
81
|
+
instance.current.getItemLabel = record => getItemLabel(record, props.nameKey);
|
|
85
82
|
|
|
86
|
-
instance.current.getItemChildren =
|
|
87
|
-
return getItemChildren(record, props.childrenKey);
|
|
88
|
-
};
|
|
83
|
+
instance.current.getItemChildren = record => getItemChildren(record, props.childrenKey);
|
|
89
84
|
|
|
90
85
|
instance.current.decorators = decorators;
|
|
91
|
-
instance.current.getListProps =
|
|
92
|
-
instance.current.getItemProps =
|
|
93
|
-
instance.current.itemRenderer =
|
|
94
|
-
instance.current.records = React.useMemo(
|
|
86
|
+
instance.current.getListProps = utils.reducePropsGetter(decorators.getListProps, instance.current);
|
|
87
|
+
instance.current.getItemProps = utils.reducePropsGetter(decorators.getItemProps, instance.current);
|
|
88
|
+
instance.current.itemRenderer = utils.composeFormatters(instance.current.decorators.itemRenderer, instance.current);
|
|
89
|
+
instance.current.records = React.useMemo(() => {
|
|
95
90
|
// record iterator TREE / Simple
|
|
96
|
-
|
|
91
|
+
let nextRecords = recordIterator.recordIterator(data, instance.current.decorators.recordIterator, decorators.record, instance.current); // compose all records
|
|
97
92
|
|
|
98
|
-
nextRecords = decorators.records.reduce(
|
|
99
|
-
return getter(nextRows, instance.current);
|
|
100
|
-
}, nextRecords);
|
|
93
|
+
nextRecords = decorators.records.reduce((nextRows, getter) => getter(nextRows, instance.current), nextRecords);
|
|
101
94
|
return nextRecords;
|
|
102
95
|
});
|
|
103
96
|
if (props.instanceRef) dsUtilities.setRef(props.instanceRef, instance.current);
|
|
104
97
|
return instance.current;
|
|
105
98
|
}
|
|
106
99
|
|
|
107
|
-
exports[
|
|
100
|
+
exports["default"] = useDataList;
|
|
108
101
|
exports.getItemChildren = getItemChildren;
|
|
109
102
|
exports.getItemLabel = getItemLabel;
|
|
110
|
-
//# sourceMappingURL=useDataList.js.map
|
package/cjs/utils.js
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
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');
|
|
6
13
|
|
|
7
14
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
15
|
|
|
@@ -10,32 +17,18 @@ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_definePropert
|
|
|
10
17
|
|
|
11
18
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
12
19
|
|
|
13
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default[
|
|
20
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
14
21
|
|
|
15
22
|
/* eslint-disable no-cond-assign */
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var isFunction = function isFunction(param) {
|
|
26
|
-
return typeof param === 'function';
|
|
27
|
-
};
|
|
28
|
-
var isNumber = function isNumber(param) {
|
|
29
|
-
return typeof param === 'number' && !isNaN(param);
|
|
30
|
-
}; // eslint-disable-line
|
|
31
|
-
|
|
32
|
-
var isString = function isString(str) {
|
|
33
|
-
return objectType(str) === 'String';
|
|
34
|
-
};
|
|
35
|
-
var isArray = function isArray(arr) {
|
|
36
|
-
return objectType(arr) === 'Array';
|
|
37
|
-
};
|
|
38
|
-
var closest = function closest(target, selector) {
|
|
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';
|
|
31
|
+
const closest = (target, selector) => {
|
|
39
32
|
// closest(e.target, '.field')
|
|
40
33
|
while (target) {
|
|
41
34
|
// eslint-disable-line
|
|
@@ -47,29 +40,30 @@ var closest = function closest(target, selector) {
|
|
|
47
40
|
|
|
48
41
|
return null;
|
|
49
42
|
};
|
|
50
|
-
|
|
43
|
+
const getOffsetRect = elem => {
|
|
51
44
|
// (1)
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
45
|
+
const box = elem.getBoundingClientRect();
|
|
46
|
+
const {
|
|
47
|
+
body,
|
|
48
|
+
documentElement
|
|
49
|
+
} = document; // (2)
|
|
56
50
|
|
|
57
|
-
|
|
58
|
-
|
|
51
|
+
const scrollTop = window.pageYOffset || documentElement.scrollTop || body.scrollTop;
|
|
52
|
+
const scrollLeft = window.pageXOffset || documentElement.scrollLeft || body.scrollLeft; // (3)
|
|
59
53
|
|
|
60
|
-
|
|
61
|
-
|
|
54
|
+
const clientTop = documentElement.clientTop || body.clientTop || 0;
|
|
55
|
+
const clientLeft = documentElement.clientLeft || body.clientLeft || 0; // (4)
|
|
62
56
|
|
|
63
|
-
|
|
64
|
-
|
|
57
|
+
const top = box.top + scrollTop - clientTop;
|
|
58
|
+
const left = box.left + scrollLeft - clientLeft;
|
|
65
59
|
return {
|
|
66
60
|
top: Math.round(top),
|
|
67
61
|
left: Math.round(left)
|
|
68
62
|
};
|
|
69
63
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
64
|
+
const getTotalScroll = elem => {
|
|
65
|
+
let top = 0;
|
|
66
|
+
let left = 0; // eslint-disable-next-line no-param-reassign
|
|
73
67
|
|
|
74
68
|
while (elem = elem.parentNode) {
|
|
75
69
|
top += elem.scrollTop || 0;
|
|
@@ -77,33 +71,27 @@ var getTotalScroll = function getTotalScroll(elem) {
|
|
|
77
71
|
}
|
|
78
72
|
|
|
79
73
|
return {
|
|
80
|
-
top
|
|
81
|
-
left
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
var getTransformProps = function getTransformProps(x, y) {
|
|
85
|
-
return {
|
|
86
|
-
transform: "translate(".concat(x, "px, ").concat(y, "px)")
|
|
74
|
+
top,
|
|
75
|
+
left
|
|
87
76
|
};
|
|
88
77
|
};
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}).map(function (item) {
|
|
78
|
+
const getTransformProps = (x, y) => ({
|
|
79
|
+
transform: "translate(".concat(x, "px, ").concat(y, "px)")
|
|
80
|
+
});
|
|
81
|
+
const listWithChildren = (list, childrenProp) => list.map(item => _objectSpread(_objectSpread({}, item), {}, {
|
|
82
|
+
[childrenProp]: item[childrenProp] ? listWithChildren(item[childrenProp], childrenProp) : []
|
|
83
|
+
}));
|
|
84
|
+
const getAllNonEmptyNodesIds = (items, childrenProp) => {
|
|
85
|
+
let childrenIds = [];
|
|
86
|
+
const ids = items.filter(item => item[childrenProp].length).map(item => {
|
|
99
87
|
childrenIds = childrenIds.concat(getAllNonEmptyNodesIds(item[childrenProp], childrenProp));
|
|
100
88
|
return item.id;
|
|
101
89
|
});
|
|
102
90
|
return ids.concat(childrenIds);
|
|
103
91
|
};
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
92
|
+
const isInternetExplorer = () => {
|
|
93
|
+
const ua = window.navigator.userAgent;
|
|
94
|
+
const msie = ua.indexOf('MSIE '); // If Internet Explorer, return version number
|
|
107
95
|
|
|
108
96
|
if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv:11\./)) {
|
|
109
97
|
return true;
|
|
@@ -126,4 +114,3 @@ exports.isString = isString;
|
|
|
126
114
|
exports.isUndefined = isUndefined;
|
|
127
115
|
exports.listWithChildren = listWithChildren;
|
|
128
116
|
exports.objectType = objectType;
|
|
129
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -2,38 +2,48 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
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');
|
|
6
11
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
7
12
|
var React = require('react');
|
|
8
13
|
var reactWindow = require('react-window');
|
|
9
14
|
var dsUtilities = require('@elliemae/ds-utilities');
|
|
15
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
10
16
|
|
|
11
17
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
18
|
|
|
13
|
-
var
|
|
19
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
14
20
|
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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); if (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 = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { 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 {
|
|
29
|
+
itemCount,
|
|
30
|
+
className,
|
|
31
|
+
innerRef,
|
|
32
|
+
itemData,
|
|
33
|
+
itemKey,
|
|
34
|
+
itemSize,
|
|
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();
|
|
32
42
|
dsUtilities.useWindowScrollerList({
|
|
33
43
|
listInstance: listRef,
|
|
34
|
-
outerListRef
|
|
44
|
+
outerListRef
|
|
35
45
|
});
|
|
36
|
-
return /*#__PURE__*/
|
|
46
|
+
return /*#__PURE__*/jsxRuntime.jsx(ListComponent, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
37
47
|
ref: dsUtilities.mergeRefs(ref, listRef),
|
|
38
48
|
className: dsUtilities.cx(className, 'window-scroller-override'),
|
|
39
49
|
height: window.innerHeight,
|
|
@@ -49,4 +59,3 @@ var AutoHeightList = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
49
59
|
});
|
|
50
60
|
|
|
51
61
|
exports.AutoHeightList = AutoHeightList;
|
|
52
|
-
//# sourceMappingURL=AutoHeightList.js.map
|
|
@@ -2,28 +2,43 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
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');
|
|
6
12
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
7
13
|
var React = require('react');
|
|
8
14
|
var AutoSizer = require('react-virtualized-auto-sizer');
|
|
15
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
9
16
|
|
|
10
17
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
18
|
|
|
12
|
-
var
|
|
19
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
20
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
13
21
|
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
14
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
15
22
|
var AutoSizer__default = /*#__PURE__*/_interopDefaultLegacy(AutoSizer);
|
|
16
23
|
|
|
17
|
-
|
|
18
|
-
var FluidHeightList = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
19
|
-
var Component = _ref.component,
|
|
20
|
-
props = _objectWithoutProperties__default['default'](_ref, _excluded);
|
|
24
|
+
const _excluded = ["component"];
|
|
21
25
|
|
|
22
|
-
|
|
26
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (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 = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { 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"], {
|
|
23
36
|
disableWidth: true
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
|
|
37
|
+
}, void 0, _ref2 => {
|
|
38
|
+
let {
|
|
39
|
+
height: fluidHeight
|
|
40
|
+
} = _ref2;
|
|
41
|
+
return /*#__PURE__*/jsxRuntime.jsx(Component, _objectSpread(_objectSpread({}, props), {}, {
|
|
27
42
|
ref: ref,
|
|
28
43
|
height: fluidHeight - 32 // taking in count the margins of the list
|
|
29
44
|
|
|
@@ -32,4 +47,3 @@ var FluidHeightList = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
32
47
|
});
|
|
33
48
|
|
|
34
49
|
exports.FluidHeightList = FluidHeightList;
|
|
35
|
-
//# sourceMappingURL=FluidHeightList.js.map
|
|
@@ -2,26 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
require('@babel/runtime/helpers/extends');
|
|
8
|
-
require('@babel/runtime/helpers/objectWithoutProperties');
|
|
9
|
-
require('react');
|
|
10
|
-
require('react-virtualized-auto-sizer');
|
|
11
|
-
require('react-window');
|
|
12
|
-
require('@elliemae/ds-utilities');
|
|
5
|
+
var FluidHeightList = require('./FluidHeightList.js');
|
|
6
|
+
var AutoHeightList = require('./AutoHeightList.js');
|
|
13
7
|
|
|
14
8
|
function getVirtualListComponent(_ref) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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;
|
|
21
17
|
return Component;
|
|
22
18
|
}
|
|
23
19
|
|
|
24
|
-
exports.FluidHeightList =
|
|
25
|
-
exports.AutoHeightList =
|
|
20
|
+
exports.FluidHeightList = FluidHeightList.FluidHeightList;
|
|
21
|
+
exports.AutoHeightList = AutoHeightList.AutoHeightList;
|
|
26
22
|
exports.getVirtualListComponent = getVirtualListComponent;
|
|
27
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,29 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
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';
|
|
3
5
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
from = _ref$from === void 0 ? {} : _ref$from,
|
|
17
|
-
_ref$leave = _ref.leave,
|
|
18
|
-
leave = _ref$leave === void 0 ? {} : _ref$leave,
|
|
19
|
-
_ref$onRest = _ref.onRest,
|
|
20
|
-
onRest = _ref$onRest === void 0 ? function () {
|
|
21
|
-
return null;
|
|
22
|
-
} : _ref$onRest,
|
|
23
|
-
children = _ref.children;
|
|
24
|
-
return /*#__PURE__*/React.createElement(Transition, {
|
|
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, {
|
|
25
18
|
config: {
|
|
26
|
-
duration
|
|
19
|
+
duration
|
|
27
20
|
},
|
|
28
21
|
enter: enter,
|
|
29
22
|
from: from,
|
|
@@ -31,8 +24,7 @@ var BaseAnimation = function BaseAnimation(_ref) {
|
|
|
31
24
|
keys: keys,
|
|
32
25
|
leave: leave,
|
|
33
26
|
onRest: onRest
|
|
34
|
-
}, children);
|
|
27
|
+
}, void 0, children);
|
|
35
28
|
};
|
|
36
29
|
|
|
37
30
|
export { BaseAnimation as default };
|
|
38
|
-
//# sourceMappingURL=BaseAnimation.js.map
|
package/esm/Animations/Grow.js
CHANGED
|
@@ -1,23 +1,19 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
|
+
import 'react';
|
|
2
4
|
import BaseAnimation from './BaseAnimation.js';
|
|
3
|
-
import 'react-spring/renderprops.cjs';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
_ref$onRest = _ref.onRest,
|
|
17
|
-
onRest = _ref$onRest === void 0 ? function () {
|
|
18
|
-
return null;
|
|
19
|
-
} : _ref$onRest;
|
|
20
|
-
return /*#__PURE__*/React.createElement(BaseAnimation, {
|
|
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, {
|
|
21
17
|
duration: duration,
|
|
22
18
|
enter: {
|
|
23
19
|
opacity: 1,
|
|
@@ -34,8 +30,7 @@ var Grow = function Grow(_ref) {
|
|
|
34
30
|
transform: "scale(".concat(from, ")")
|
|
35
31
|
},
|
|
36
32
|
onRest: onRest
|
|
37
|
-
}, children);
|
|
33
|
+
}, void 0, children);
|
|
38
34
|
};
|
|
39
35
|
|
|
40
36
|
export { Grow as default };
|
|
41
|
-
//# sourceMappingURL=Grow.js.map
|