@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
|
@@ -1,35 +1,28 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
|
|
3
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
4
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
5
|
+
require('react');
|
|
6
|
+
var renderprops = require('react-spring/renderprops');
|
|
5
7
|
|
|
6
8
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
7
9
|
|
|
8
|
-
var
|
|
10
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
9
11
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
from = _ref$from === void 0 ? {} : _ref$from,
|
|
23
|
-
_ref$leave = _ref.leave,
|
|
24
|
-
leave = _ref$leave === void 0 ? {} : _ref$leave,
|
|
25
|
-
_ref$onRest = _ref.onRest,
|
|
26
|
-
onRest = _ref$onRest === void 0 ? function () {
|
|
27
|
-
return null;
|
|
28
|
-
} : _ref$onRest,
|
|
29
|
-
children = _ref.children;
|
|
30
|
-
return /*#__PURE__*/React__default['default'].createElement(renderprops_cjs.Transition, {
|
|
12
|
+
const BaseAnimation = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
keys = undefined,
|
|
15
|
+
items = [],
|
|
16
|
+
duration = 100,
|
|
17
|
+
enter = {},
|
|
18
|
+
from = {},
|
|
19
|
+
leave = {},
|
|
20
|
+
onRest = () => null,
|
|
21
|
+
children
|
|
22
|
+
} = _ref;
|
|
23
|
+
return /*#__PURE__*/_jsx__default["default"](renderprops.Transition, {
|
|
31
24
|
config: {
|
|
32
|
-
duration
|
|
25
|
+
duration
|
|
33
26
|
},
|
|
34
27
|
enter: enter,
|
|
35
28
|
from: from,
|
|
@@ -37,8 +30,7 @@ var BaseAnimation = function BaseAnimation(_ref) {
|
|
|
37
30
|
keys: keys,
|
|
38
31
|
leave: leave,
|
|
39
32
|
onRest: onRest
|
|
40
|
-
}, children);
|
|
33
|
+
}, void 0, children);
|
|
41
34
|
};
|
|
42
35
|
|
|
43
36
|
module.exports = BaseAnimation;
|
|
44
|
-
//# sourceMappingURL=BaseAnimation.js.map
|
package/cjs/Animations/Grow.js
CHANGED
|
@@ -1,29 +1,25 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
require('react
|
|
3
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
4
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
5
|
+
require('react');
|
|
6
|
+
var BaseAnimation = require('./BaseAnimation.js');
|
|
6
7
|
|
|
7
8
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
9
|
|
|
9
|
-
var
|
|
10
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
_ref$onRest = _ref.onRest,
|
|
23
|
-
onRest = _ref$onRest === void 0 ? function () {
|
|
24
|
-
return null;
|
|
25
|
-
} : _ref$onRest;
|
|
26
|
-
return /*#__PURE__*/React__default['default'].createElement(Animations_BaseAnimation, {
|
|
12
|
+
const Grow = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
keys = undefined,
|
|
15
|
+
duration,
|
|
16
|
+
items = undefined,
|
|
17
|
+
from = 0,
|
|
18
|
+
to = 1,
|
|
19
|
+
children,
|
|
20
|
+
onRest = () => null
|
|
21
|
+
} = _ref;
|
|
22
|
+
return /*#__PURE__*/_jsx__default["default"](BaseAnimation, {
|
|
27
23
|
duration: duration,
|
|
28
24
|
enter: {
|
|
29
25
|
opacity: 1,
|
|
@@ -40,8 +36,7 @@ var Grow = function Grow(_ref) {
|
|
|
40
36
|
transform: "scale(".concat(from, ")")
|
|
41
37
|
},
|
|
42
38
|
onRest: onRest
|
|
43
|
-
}, children);
|
|
39
|
+
}, void 0, children);
|
|
44
40
|
};
|
|
45
41
|
|
|
46
42
|
module.exports = Grow;
|
|
47
|
-
//# sourceMappingURL=Grow.js.map
|
|
@@ -1,30 +1,25 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
require('react
|
|
3
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
4
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
5
|
+
require('react');
|
|
6
|
+
var BaseAnimation = require('./BaseAnimation.js');
|
|
6
7
|
|
|
7
8
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
9
|
|
|
9
|
-
var
|
|
10
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
children = _ref.children,
|
|
23
|
-
_ref$onRest = _ref.onRest,
|
|
24
|
-
onRest = _ref$onRest === void 0 ? function () {
|
|
25
|
-
return null;
|
|
26
|
-
} : _ref$onRest;
|
|
27
|
-
return /*#__PURE__*/React__default['default'].createElement(Animations_BaseAnimation, {
|
|
12
|
+
const GrowRight = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
keys = undefined,
|
|
15
|
+
items = undefined,
|
|
16
|
+
duration = 200,
|
|
17
|
+
from = 0,
|
|
18
|
+
to = 1,
|
|
19
|
+
children,
|
|
20
|
+
onRest = () => null
|
|
21
|
+
} = _ref;
|
|
22
|
+
return /*#__PURE__*/_jsx__default["default"](BaseAnimation, {
|
|
28
23
|
duration: duration,
|
|
29
24
|
enter: {
|
|
30
25
|
opacity: "".concat(to),
|
|
@@ -41,8 +36,7 @@ var GrowRight = function GrowRight(_ref) {
|
|
|
41
36
|
transform: 'translateX(100%)'
|
|
42
37
|
},
|
|
43
38
|
onRest: onRest
|
|
44
|
-
}, children);
|
|
39
|
+
}, void 0, children);
|
|
45
40
|
};
|
|
46
41
|
|
|
47
42
|
module.exports = GrowRight;
|
|
48
|
-
//# sourceMappingURL=GrowRight.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
require('@babel/runtime/helpers/jsx');
|
|
4
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
3
5
|
require('react');
|
|
4
|
-
require('react-spring/renderprops
|
|
6
|
+
require('react-spring/renderprops');
|
|
5
7
|
|
|
6
|
-
//# sourceMappingURL=GrowVertical.js.map
|
package/cjs/CheckableGroup.js
CHANGED
|
@@ -3,78 +3,72 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
-
|
|
6
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
7
|
+
require('core-js/modules/esnext.async-iterator.map.js');
|
|
8
|
+
require('core-js/modules/esnext.iterator.map.js');
|
|
9
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
11
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
12
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
13
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
7
14
|
var React = require('react');
|
|
8
|
-
var PropTypes = require('prop-types');
|
|
9
15
|
var dsUtilities = require('@elliemae/ds-utilities');
|
|
10
16
|
|
|
11
17
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
18
|
|
|
13
19
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
14
|
-
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
15
20
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
16
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
17
21
|
|
|
18
22
|
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; }
|
|
19
23
|
|
|
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[
|
|
24
|
+
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; }
|
|
21
25
|
function useCheckableGroup(_ref) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
let {
|
|
27
|
+
children,
|
|
28
|
+
active: activeProp,
|
|
29
|
+
multi,
|
|
30
|
+
onCheck = () => null
|
|
31
|
+
} = _ref;
|
|
32
|
+
const [active, setActive] = dsUtilities.useDerivedStateFromProps(activeProp);
|
|
29
33
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
var nextActive = multi ? dsUtilities.addOrRemove(prevActive, value) : value;
|
|
34
|
+
const handleCheck = (_ref2, item) => {
|
|
35
|
+
let {
|
|
36
|
+
target: {
|
|
37
|
+
value
|
|
38
|
+
}
|
|
39
|
+
} = _ref2;
|
|
40
|
+
setActive(prevActive => {
|
|
41
|
+
const nextActive = multi ? dsUtilities.addOrRemove(prevActive, value) : value;
|
|
39
42
|
onCheck(nextActive, item);
|
|
40
43
|
return nextActive;
|
|
41
44
|
});
|
|
42
45
|
};
|
|
43
46
|
|
|
44
|
-
return React__default[
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
return React__default["default"].Children.map(children, child => {
|
|
48
|
+
const {
|
|
49
|
+
props
|
|
50
|
+
} = child;
|
|
51
|
+
const checked = Array.isArray(active) ? active.indexOf(props.name) !== -1 : active === props.name;
|
|
47
52
|
return /*#__PURE__*/React.cloneElement(child, _objectSpread(_objectSpread({}, props), {}, {
|
|
48
|
-
checked
|
|
53
|
+
checked,
|
|
49
54
|
onClick: dsUtilities.runAll(handleCheck, props.onClick)
|
|
50
55
|
}));
|
|
51
56
|
});
|
|
52
57
|
}
|
|
53
58
|
|
|
54
59
|
function CheckableGroup(_ref3) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
let {
|
|
61
|
+
active = [],
|
|
62
|
+
multi = false,
|
|
63
|
+
// checkbox or radio
|
|
64
|
+
children
|
|
65
|
+
} = _ref3;
|
|
60
66
|
return useCheckableGroup({
|
|
61
|
-
active
|
|
62
|
-
multi
|
|
63
|
-
children
|
|
67
|
+
active,
|
|
68
|
+
multi,
|
|
69
|
+
children
|
|
64
70
|
});
|
|
65
71
|
}
|
|
66
72
|
|
|
67
|
-
|
|
68
|
-
/* The item (if multi false) or items (if multi true) selected */
|
|
69
|
-
active: PropTypes__default['default'].arrayOf(PropTypes__default['default'].string),
|
|
70
|
-
|
|
71
|
-
/* Whether is multi select or not */
|
|
72
|
-
multi: PropTypes__default['default'].bool,
|
|
73
|
-
|
|
74
|
-
/* Handler when a user checks an item */
|
|
75
|
-
onCheck: PropTypes__default['default'].func
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
exports['default'] = CheckableGroup;
|
|
73
|
+
exports["default"] = CheckableGroup;
|
|
79
74
|
exports.useCheckableGroup = useCheckableGroup;
|
|
80
|
-
//# sourceMappingURL=CheckableGroup.js.map
|
|
@@ -1,37 +1,28 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var raf = require('raf');
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
9
|
-
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
10
9
|
var raf__default = /*#__PURE__*/_interopDefaultLegacy(raf);
|
|
11
10
|
|
|
12
11
|
function DeferRenderAfterComputation(_ref) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
setShouldRender = _useState2[1];
|
|
22
|
-
|
|
23
|
-
React.useEffect(function () {
|
|
12
|
+
let {
|
|
13
|
+
children,
|
|
14
|
+
resolve,
|
|
15
|
+
fallback,
|
|
16
|
+
timeout = 2000
|
|
17
|
+
} = _ref;
|
|
18
|
+
const [shouldRender, setShouldRender] = React.useState(false);
|
|
19
|
+
React.useEffect(() => {
|
|
24
20
|
// eslint-disable-next-line max-nested-callbacks
|
|
25
|
-
raf__default[
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
setShouldRender(true);
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
});
|
|
21
|
+
raf__default["default"](() => raf__default["default"](() => resolve().then(() => {
|
|
22
|
+
setShouldRender(true);
|
|
23
|
+
})));
|
|
32
24
|
}, []);
|
|
33
25
|
return shouldRender ? children : fallback;
|
|
34
26
|
}
|
|
35
27
|
|
|
36
28
|
module.exports = DeferRenderAfterComputation;
|
|
37
|
-
//# sourceMappingURL=DeferRenderAfterComputation.js.map
|
|
@@ -2,75 +2,85 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
5
6
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
8
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
10
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
11
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
6
12
|
var React = require('react');
|
|
7
13
|
var dsUtilities = require('@elliemae/ds-utilities');
|
|
8
|
-
var
|
|
14
|
+
var getNextCellPosition = require('./utils/getNextCellPosition.js');
|
|
9
15
|
|
|
10
16
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
17
|
|
|
18
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
12
19
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
13
20
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
21
|
|
|
15
22
|
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; }
|
|
16
23
|
|
|
17
|
-
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[
|
|
18
|
-
|
|
19
|
-
|
|
24
|
+
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; }
|
|
25
|
+
const FocusGridContext = /*#__PURE__*/React.createContext();
|
|
26
|
+
const {
|
|
27
|
+
Provider
|
|
28
|
+
} = FocusGridContext;
|
|
20
29
|
|
|
21
|
-
|
|
22
|
-
return e.preventDefault();
|
|
23
|
-
};
|
|
30
|
+
const preventDefault = e => e.preventDefault();
|
|
24
31
|
|
|
25
32
|
function registerHotKeysHooks(hotKeys, _ref) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
33
|
+
let {
|
|
34
|
+
focusedRow,
|
|
35
|
+
focusedCell
|
|
36
|
+
} = _ref;
|
|
37
|
+
Object.keys(hotKeys).forEach(key => {
|
|
38
|
+
const {
|
|
39
|
+
handler,
|
|
40
|
+
options
|
|
41
|
+
} = hotKeys[key];
|
|
32
42
|
dsUtilities.useHotkeys({
|
|
33
43
|
keys: key,
|
|
34
|
-
handler:
|
|
44
|
+
handler: e => {
|
|
35
45
|
e.preventDefault();
|
|
36
|
-
|
|
37
|
-
_handler({
|
|
46
|
+
handler({
|
|
38
47
|
rowIndex: focusedRow.current,
|
|
39
48
|
cellIndex: focusedCell.current
|
|
40
49
|
});
|
|
41
50
|
},
|
|
42
|
-
options
|
|
51
|
+
options
|
|
43
52
|
});
|
|
44
53
|
});
|
|
45
54
|
} // eslint-disable-next-line max-statements
|
|
46
55
|
|
|
47
56
|
|
|
48
57
|
function FocusGridProvider(_ref2) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
var decoratedChild = /*#__PURE__*/React__default['default'].cloneElement(child, {
|
|
58
|
+
let {
|
|
59
|
+
shouldWrapRows = false,
|
|
60
|
+
shouldWrapCells = false,
|
|
61
|
+
shouldRefocus = true,
|
|
62
|
+
children,
|
|
63
|
+
keyBindings,
|
|
64
|
+
hotKeys
|
|
65
|
+
} = _ref2;
|
|
66
|
+
const focusedRow = React.useRef();
|
|
67
|
+
const focusedCell = React.useRef();
|
|
68
|
+
const grid = React.useRef([]);
|
|
69
|
+
const containerRef = React.useRef(document);
|
|
70
|
+
const child = React__default["default"].Children.only(children);
|
|
71
|
+
const decoratedChild = /*#__PURE__*/React__default["default"].cloneElement(child, {
|
|
64
72
|
innerRef: dsUtilities.mergeRefs(child.props.innerRef, containerRef)
|
|
65
73
|
});
|
|
66
74
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
75
|
+
const getNode = _ref3 => {
|
|
76
|
+
let {
|
|
77
|
+
rowIndex,
|
|
78
|
+
cellIndex
|
|
79
|
+
} = _ref3;
|
|
70
80
|
return dsUtilities.get(grid.current, [rowIndex, cellIndex]);
|
|
71
81
|
};
|
|
72
82
|
|
|
73
|
-
|
|
83
|
+
const register = (node, rowIndex, columnIndex) => {
|
|
74
84
|
if (!node) return;
|
|
75
85
|
|
|
76
86
|
if (!Array.isArray(grid.current[rowIndex])) {
|
|
@@ -83,8 +93,8 @@ function FocusGridProvider(_ref2) {
|
|
|
83
93
|
node.setAttribute('tabindex', -1);
|
|
84
94
|
}
|
|
85
95
|
|
|
86
|
-
node.onfocus =
|
|
87
|
-
|
|
96
|
+
node.onfocus = () => {
|
|
97
|
+
const prevNode = getNode({
|
|
88
98
|
rowIndex: focusedRow.current,
|
|
89
99
|
cellIndex: focusedCell.current
|
|
90
100
|
});
|
|
@@ -97,31 +107,31 @@ function FocusGridProvider(_ref2) {
|
|
|
97
107
|
grid.current[rowIndex][columnIndex] = node;
|
|
98
108
|
};
|
|
99
109
|
|
|
100
|
-
React.useEffect(
|
|
110
|
+
React.useEffect(() => {
|
|
101
111
|
if (shouldRefocus) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
112
|
+
const rowIndex = focusedRow.current;
|
|
113
|
+
const cellIndex = focusedCell.current;
|
|
114
|
+
const node = dsUtilities.get(grid.current, [rowIndex, cellIndex]);
|
|
105
115
|
if (node) node.focus();
|
|
106
116
|
}
|
|
107
117
|
});
|
|
108
118
|
|
|
109
|
-
|
|
110
|
-
|
|
119
|
+
const focusNextCell = (directionY, directionX, position) => {
|
|
120
|
+
const {
|
|
121
|
+
rowIndex,
|
|
122
|
+
cellIndex
|
|
123
|
+
} = position || getNextCellPosition({
|
|
111
124
|
grid: grid.current,
|
|
112
125
|
currentCell: focusedCell.current,
|
|
113
126
|
currentRow: focusedRow.current,
|
|
114
|
-
directionX
|
|
115
|
-
directionY
|
|
116
|
-
shouldWrapCells
|
|
117
|
-
shouldWrapRows
|
|
118
|
-
})
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
var node = getNode({
|
|
123
|
-
rowIndex: rowIndex,
|
|
124
|
-
cellIndex: cellIndex
|
|
127
|
+
directionX,
|
|
128
|
+
directionY,
|
|
129
|
+
shouldWrapCells,
|
|
130
|
+
shouldWrapRows
|
|
131
|
+
});
|
|
132
|
+
const node = getNode({
|
|
133
|
+
rowIndex,
|
|
134
|
+
cellIndex
|
|
125
135
|
}); // can focus
|
|
126
136
|
|
|
127
137
|
if (node) {
|
|
@@ -132,85 +142,74 @@ function FocusGridProvider(_ref2) {
|
|
|
132
142
|
};
|
|
133
143
|
|
|
134
144
|
registerHotKeysHooks(hotKeys, {
|
|
135
|
-
focusedCell
|
|
136
|
-
focusedRow
|
|
145
|
+
focusedCell,
|
|
146
|
+
focusedRow
|
|
137
147
|
});
|
|
138
148
|
|
|
139
|
-
|
|
140
|
-
ArrowUp: dsUtilities.runAll(preventDefault,
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
ArrowDown: dsUtilities.runAll(preventDefault, function () {
|
|
147
|
-
return focusNextCell(1, 0);
|
|
148
|
-
}),
|
|
149
|
-
ArrowLeft: dsUtilities.runAll(preventDefault, function () {
|
|
150
|
-
return focusNextCell(0, -1);
|
|
151
|
-
}),
|
|
152
|
-
Home: dsUtilities.runAll(preventDefault, function (e) {
|
|
153
|
-
var rowIndex = focusedRow.current;
|
|
149
|
+
const defaultKeyBindings = _objectSpread({
|
|
150
|
+
ArrowUp: dsUtilities.runAll(preventDefault, () => focusNextCell(-1, 0)),
|
|
151
|
+
ArrowRight: dsUtilities.runAll(preventDefault, () => focusNextCell(0, 1)),
|
|
152
|
+
ArrowDown: dsUtilities.runAll(preventDefault, () => focusNextCell(1, 0)),
|
|
153
|
+
ArrowLeft: dsUtilities.runAll(preventDefault, () => focusNextCell(0, -1)),
|
|
154
|
+
Home: dsUtilities.runAll(preventDefault, e => {
|
|
155
|
+
let rowIndex = focusedRow.current;
|
|
154
156
|
|
|
155
157
|
if (e.ctrlKey) {
|
|
156
158
|
rowIndex = 0;
|
|
157
159
|
}
|
|
158
160
|
|
|
159
161
|
focusNextCell(0, 0, {
|
|
160
|
-
rowIndex
|
|
162
|
+
rowIndex,
|
|
161
163
|
cellIndex: 0
|
|
162
164
|
});
|
|
163
165
|
}),
|
|
164
|
-
End: dsUtilities.runAll(preventDefault,
|
|
165
|
-
|
|
166
|
+
End: dsUtilities.runAll(preventDefault, e => {
|
|
167
|
+
let rowIndex = focusedRow.current;
|
|
166
168
|
|
|
167
169
|
if (e.ctrlKey) {
|
|
168
170
|
rowIndex = grid.current.length - 1;
|
|
169
171
|
}
|
|
170
172
|
|
|
171
173
|
focusNextCell(0, 0, {
|
|
172
|
-
rowIndex
|
|
174
|
+
rowIndex,
|
|
173
175
|
cellIndex: grid.current[0].length - 1
|
|
174
176
|
});
|
|
175
177
|
})
|
|
176
178
|
}, keyBindings);
|
|
177
179
|
|
|
178
|
-
|
|
180
|
+
const nextKeyBindings = dsUtilities.isFunction(keyBindings) ? keyBindings({
|
|
179
181
|
defaultBindings: defaultKeyBindings,
|
|
180
182
|
rowIndex: focusedRow.current,
|
|
181
183
|
cellIndex: focusedCell.current
|
|
182
184
|
}) : _objectSpread(_objectSpread({}, defaultKeyBindings), keyBindings);
|
|
183
185
|
|
|
184
|
-
|
|
186
|
+
const onKeyDown = e => {
|
|
185
187
|
if (e.target.tagName.toLowerCase() === 'input') return;
|
|
186
|
-
|
|
188
|
+
const action = nextKeyBindings[e.key];
|
|
187
189
|
if (dsUtilities.isFunction(action)) action(e);
|
|
188
190
|
};
|
|
189
191
|
|
|
190
|
-
|
|
192
|
+
const activate = container => {
|
|
191
193
|
container.addEventListener('keydown', onKeyDown, true);
|
|
192
194
|
};
|
|
193
195
|
|
|
194
|
-
|
|
196
|
+
const deactivate = container => {
|
|
195
197
|
container.removeEventListener('keydown', onKeyDown, true);
|
|
196
198
|
};
|
|
197
199
|
|
|
198
|
-
React.useEffect(
|
|
200
|
+
React.useEffect(() => {
|
|
199
201
|
activate(containerRef.current);
|
|
200
|
-
return
|
|
202
|
+
return () => {
|
|
201
203
|
deactivate(containerRef.current);
|
|
202
204
|
};
|
|
203
205
|
}, []);
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
}, []);
|
|
209
|
-
return /*#__PURE__*/React__default['default'].createElement(Provider, {
|
|
206
|
+
const valueProvider = React.useMemo(() => ({
|
|
207
|
+
register
|
|
208
|
+
}), []);
|
|
209
|
+
return /*#__PURE__*/_jsx__default["default"](Provider, {
|
|
210
210
|
value: valueProvider
|
|
211
|
-
}, decoratedChild);
|
|
211
|
+
}, void 0, decoratedChild);
|
|
212
212
|
}
|
|
213
213
|
|
|
214
214
|
exports.FocusGridContext = FocusGridContext;
|
|
215
|
-
exports[
|
|
216
|
-
//# sourceMappingURL=FocusGrid.js.map
|
|
215
|
+
exports["default"] = FocusGridProvider;
|