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