@elliemae/ds-shared 3.0.0-next.0 → 3.0.0-next.4
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/dist/cjs/Animations/BaseAnimation.js +56 -0
- package/dist/cjs/Animations/BaseAnimation.js.map +7 -0
- package/dist/cjs/Animations/Grow.js +55 -0
- package/dist/cjs/Animations/Grow.js.map +7 -0
- package/dist/cjs/Animations/GrowRight.js +64 -0
- package/dist/cjs/Animations/GrowRight.js.map +7 -0
- package/dist/cjs/Animations/GrowVertical.js +47 -0
- package/dist/cjs/Animations/GrowVertical.js.map +7 -0
- package/dist/cjs/CheckableGroup.js +92 -0
- package/dist/cjs/CheckableGroup.js.map +7 -0
- package/dist/cjs/DeferRenderAfterComputation.js +52 -0
- package/dist/cjs/DeferRenderAfterComputation.js.map +7 -0
- package/dist/cjs/FocusGroup/FocusGrid.js +193 -0
- package/dist/cjs/FocusGroup/FocusGrid.js.map +7 -0
- package/dist/cjs/FocusGroup/FocusGroup.js +262 -0
- package/dist/cjs/FocusGroup/FocusGroup.js.map +7 -0
- package/dist/cjs/FocusGroup/FocusGroupContext.js +38 -0
- package/dist/cjs/FocusGroup/FocusGroupContext.js.map +7 -0
- package/dist/cjs/FocusGroup/FocusGroupManager.js +126 -0
- package/dist/cjs/FocusGroup/FocusGroupManager.js.map +7 -0
- package/dist/cjs/FocusGroup/focusGroupManagerHoc.js +82 -0
- package/dist/cjs/FocusGroup/focusGroupManagerHoc.js.map +7 -0
- package/dist/cjs/FocusGroup/index.js +47 -0
- package/dist/cjs/FocusGroup/index.js.map +7 -0
- package/dist/cjs/FocusGroup/useFocusGroupItem.js +81 -0
- package/dist/cjs/FocusGroup/useFocusGroupItem.js.map +7 -0
- package/dist/cjs/FocusGroup/utils/getNextCellPosition.js +80 -0
- package/dist/cjs/FocusGroup/utils/getNextCellPosition.js.map +7 -0
- package/dist/cjs/GroupContext/Group.js +115 -0
- package/dist/cjs/GroupContext/Group.js.map +7 -0
- package/dist/cjs/GroupContext/GroupContext.js +36 -0
- package/dist/cjs/GroupContext/GroupContext.js.map +7 -0
- package/dist/cjs/GroupContext/GroupItem.js +40 -0
- package/dist/cjs/GroupContext/GroupItem.js.map +7 -0
- package/dist/cjs/GroupContext/index.js +39 -0
- package/dist/cjs/GroupContext/index.js.map +7 -0
- package/dist/cjs/ScrollSync/ScrollSync.js +138 -0
- package/dist/cjs/ScrollSync/ScrollSync.js.map +7 -0
- package/dist/cjs/ScrollSync/ScrollSyncPane.js +89 -0
- package/dist/cjs/ScrollSync/ScrollSyncPane.js.map +7 -0
- package/dist/cjs/ScrollSync/ScrollSyncProvider.js +120 -0
- package/dist/cjs/ScrollSync/ScrollSyncProvider.js.map +7 -0
- package/dist/cjs/ScrollSync/index.js +37 -0
- package/dist/cjs/ScrollSync/index.js.map +7 -0
- package/dist/cjs/ScrollSync/useScrollSync.js +41 -0
- package/dist/cjs/ScrollSync/useScrollSync.js.map +7 -0
- package/dist/cjs/constants.js +70 -0
- package/dist/cjs/constants.js.map +7 -0
- package/dist/cjs/createDataInstance/createInstancePlugin.js +62 -0
- package/dist/cjs/createDataInstance/createInstancePlugin.js.map +7 -0
- package/dist/cjs/createDataInstance/createInstanceRef.js +124 -0
- package/dist/cjs/createDataInstance/createInstanceRef.js.map +7 -0
- package/dist/cjs/createDataInstance/utils.js +104 -0
- package/dist/cjs/createDataInstance/utils.js.map +7 -0
- package/dist/cjs/defer-render-hoc/index.js +68 -0
- package/dist/cjs/defer-render-hoc/index.js.map +7 -0
- package/dist/cjs/dimsum.config.js +39 -0
- package/dist/cjs/dimsum.config.js.map +7 -0
- package/dist/cjs/index.js +40 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/prop-types.js +116 -0
- package/dist/cjs/prop-types.js.map +7 -0
- package/dist/cjs/react-spring/index.js +28 -0
- package/dist/cjs/react-spring/index.js.map +7 -0
- package/dist/cjs/react-spring/renderprops.js +28 -0
- package/dist/cjs/react-spring/renderprops.js.map +7 -0
- package/dist/cjs/toolbar/ToolbarProvider.js +126 -0
- package/dist/cjs/toolbar/ToolbarProvider.js.map +7 -0
- package/dist/cjs/useDataGrid/VolatileRowsListener.js +49 -0
- package/dist/cjs/useDataGrid/VolatileRowsListener.js.map +7 -0
- package/dist/cjs/useDataGrid/index.js +36 -0
- package/dist/cjs/useDataGrid/index.js.map +7 -0
- package/dist/cjs/useDataGrid/initColumnDefinition.js +147 -0
- package/dist/cjs/useDataGrid/initColumnDefinition.js.map +7 -0
- package/dist/cjs/useDataGrid/useDataGrid.js +216 -0
- package/dist/cjs/useDataGrid/useDataGrid.js.map +7 -0
- package/dist/cjs/useDataList/index.js +36 -0
- package/dist/cjs/useDataList/index.js.map +7 -0
- package/dist/cjs/useDataList/recordIterator.js +55 -0
- package/dist/cjs/useDataList/recordIterator.js.map +7 -0
- package/dist/cjs/useDataList/useDataList.js +126 -0
- package/dist/cjs/useDataList/useDataList.js.map +7 -0
- package/dist/cjs/utils.js +123 -0
- package/dist/cjs/utils.js.map +7 -0
- package/dist/cjs/virtualization/AutoHeightList.js +106 -0
- package/dist/cjs/virtualization/AutoHeightList.js.map +7 -0
- package/dist/cjs/virtualization/FluidHeightList.js +74 -0
- package/dist/cjs/virtualization/FluidHeightList.js.map +7 -0
- package/dist/cjs/virtualization/index.js +50 -0
- package/dist/cjs/virtualization/index.js.map +7 -0
- package/dist/esm/Animations/BaseAnimation.js +27 -0
- package/dist/esm/Animations/BaseAnimation.js.map +7 -0
- package/dist/esm/Animations/Grow.js +26 -0
- package/dist/esm/Animations/Grow.js.map +7 -0
- package/dist/esm/Animations/GrowRight.js +35 -0
- package/dist/esm/Animations/GrowRight.js.map +7 -0
- package/dist/esm/Animations/GrowVertical.js +29 -0
- package/dist/esm/Animations/GrowVertical.js.map +7 -0
- package/dist/esm/CheckableGroup.js +65 -0
- package/dist/esm/CheckableGroup.js.map +7 -0
- package/dist/esm/DeferRenderAfterComputation.js +23 -0
- package/dist/esm/DeferRenderAfterComputation.js.map +7 -0
- package/dist/esm/FocusGroup/FocusGrid.js +166 -0
- package/dist/esm/FocusGroup/FocusGrid.js.map +7 -0
- package/{esm → dist/esm}/FocusGroup/FocusGroup.js +70 -136
- package/dist/esm/FocusGroup/FocusGroup.js.map +7 -0
- package/dist/esm/FocusGroup/FocusGroupContext.js +9 -0
- package/dist/esm/FocusGroup/FocusGroupContext.js.map +7 -0
- package/{esm → dist/esm}/FocusGroup/FocusGroupManager.js +24 -38
- package/dist/esm/FocusGroup/FocusGroupManager.js.map +7 -0
- package/dist/esm/FocusGroup/focusGroupManagerHoc.js +55 -0
- package/dist/esm/FocusGroup/focusGroupManagerHoc.js.map +7 -0
- package/dist/esm/FocusGroup/index.js +18 -0
- package/dist/esm/FocusGroup/index.js.map +7 -0
- package/dist/esm/FocusGroup/useFocusGroupItem.js +53 -0
- package/dist/esm/FocusGroup/useFocusGroupItem.js.map +7 -0
- package/{esm → dist/esm}/FocusGroup/utils/getNextCellPosition.js +18 -25
- package/dist/esm/FocusGroup/utils/getNextCellPosition.js.map +7 -0
- package/dist/esm/GroupContext/Group.js +86 -0
- package/dist/esm/GroupContext/Group.js.map +7 -0
- package/dist/esm/GroupContext/GroupContext.js +7 -0
- package/dist/esm/GroupContext/GroupContext.js.map +7 -0
- package/dist/esm/GroupContext/GroupItem.js +11 -0
- package/dist/esm/GroupContext/GroupItem.js.map +7 -0
- package/dist/esm/GroupContext/index.js +10 -0
- package/dist/esm/GroupContext/index.js.map +7 -0
- package/{esm → dist/esm}/ScrollSync/ScrollSync.js +30 -64
- package/dist/esm/ScrollSync/ScrollSync.js.map +7 -0
- package/dist/esm/ScrollSync/ScrollSyncPane.js +62 -0
- package/dist/esm/ScrollSync/ScrollSyncPane.js.map +7 -0
- package/dist/esm/ScrollSync/ScrollSyncProvider.js +91 -0
- package/dist/esm/ScrollSync/ScrollSyncProvider.js.map +7 -0
- package/dist/esm/ScrollSync/index.js +8 -0
- package/dist/esm/ScrollSync/index.js.map +7 -0
- package/dist/esm/ScrollSync/useScrollSync.js +12 -0
- package/dist/esm/ScrollSync/useScrollSync.js.map +7 -0
- package/dist/esm/constants.js +41 -0
- package/dist/esm/constants.js.map +7 -0
- package/dist/esm/createDataInstance/createInstancePlugin.js +35 -0
- package/dist/esm/createDataInstance/createInstancePlugin.js.map +7 -0
- package/dist/esm/createDataInstance/createInstanceRef.js +101 -0
- package/dist/esm/createDataInstance/createInstanceRef.js.map +7 -0
- package/dist/esm/createDataInstance/utils.js +77 -0
- package/dist/esm/createDataInstance/utils.js.map +7 -0
- package/dist/esm/defer-render-hoc/index.js +41 -0
- package/dist/esm/defer-render-hoc/index.js.map +7 -0
- package/dist/esm/dimsum.config.js +10 -0
- package/dist/esm/dimsum.config.js.map +7 -0
- package/dist/esm/index.js +11 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/prop-types.js +87 -0
- package/dist/esm/prop-types.js.map +7 -0
- package/dist/esm/react-spring/index.js +3 -0
- package/dist/esm/react-spring/index.js.map +7 -0
- package/dist/esm/react-spring/renderprops.js +3 -0
- package/dist/esm/react-spring/renderprops.js.map +7 -0
- package/dist/esm/toolbar/ToolbarProvider.js +99 -0
- package/dist/esm/toolbar/ToolbarProvider.js.map +7 -0
- package/dist/esm/useDataGrid/VolatileRowsListener.js +20 -0
- package/dist/esm/useDataGrid/VolatileRowsListener.js.map +7 -0
- package/dist/esm/useDataGrid/index.js +7 -0
- package/dist/esm/useDataGrid/index.js.map +7 -0
- package/dist/esm/useDataGrid/initColumnDefinition.js +126 -0
- package/dist/esm/useDataGrid/initColumnDefinition.js.map +7 -0
- package/dist/esm/useDataGrid/useDataGrid.js +201 -0
- package/dist/esm/useDataGrid/useDataGrid.js.map +7 -0
- package/dist/esm/useDataList/index.js +7 -0
- package/dist/esm/useDataList/index.js.map +7 -0
- package/dist/esm/useDataList/recordIterator.js +26 -0
- package/dist/esm/useDataList/recordIterator.js.map +7 -0
- package/dist/esm/useDataList/useDataList.js +102 -0
- package/dist/esm/useDataList/useDataList.js.map +7 -0
- package/dist/esm/utils.js +96 -0
- package/dist/esm/utils.js.map +7 -0
- package/dist/esm/virtualization/AutoHeightList.js +79 -0
- package/dist/esm/virtualization/AutoHeightList.js.map +7 -0
- package/dist/esm/virtualization/FluidHeightList.js +47 -0
- package/dist/esm/virtualization/FluidHeightList.js.map +7 -0
- package/dist/esm/virtualization/index.js +21 -0
- package/dist/esm/virtualization/index.js.map +7 -0
- package/package.json +116 -107
- package/cjs/Animations/BaseAnimation.js +0 -36
- package/cjs/Animations/Grow.js +0 -42
- package/cjs/Animations/GrowRight.js +0 -42
- package/cjs/Animations/GrowVertical.js +0 -7
- package/cjs/CheckableGroup.js +0 -74
- package/cjs/DeferRenderAfterComputation.js +0 -28
- package/cjs/FocusGroup/FocusGrid.js +0 -215
- package/cjs/FocusGroup/FocusGroup.js +0 -308
- package/cjs/FocusGroup/FocusGroupContext.js +0 -11
- package/cjs/FocusGroup/FocusGroupManager.js +0 -117
- package/cjs/FocusGroup/focusGroupManagerHoc.js +0 -44
- package/cjs/FocusGroup/index.js +0 -21
- package/cjs/FocusGroup/useFocusGroupItem.js +0 -59
- package/cjs/FocusGroup/utils/getNextCellPosition.js +0 -60
- package/cjs/GroupContext/Group.js +0 -124
- package/cjs/GroupContext/GroupContext.js +0 -13
- package/cjs/GroupContext/GroupItem.js +0 -22
- package/cjs/GroupContext/index.js +0 -13
- package/cjs/ScrollSync/ScrollSync.js +0 -153
- package/cjs/ScrollSync/ScrollSyncPane.js +0 -81
- package/cjs/ScrollSync/ScrollSyncProvider.js +0 -67
- package/cjs/ScrollSync/index.js +0 -11
- package/cjs/ScrollSync/useScrollSync.js +0 -10
- package/cjs/constants.js +0 -51
- package/cjs/createDataInstance/createInstancePlugin.js +0 -36
- package/cjs/createDataInstance/createInstanceRef.js +0 -97
- package/cjs/createDataInstance/utils.js +0 -123
- package/cjs/defer-render-hoc/index.js +0 -49
- package/cjs/dimsum.config.js +0 -7
- package/cjs/index.js +0 -17
- package/cjs/prop-types.js +0 -59
- package/cjs/react-spring/index.js +0 -14
- package/cjs/react-spring/renderprops.js +0 -14
- package/cjs/toolbar/ToolbarProvider.js +0 -123
- package/cjs/useDataGrid/VolatileRowsListener.js +0 -24
- package/cjs/useDataGrid/index.js +0 -7
- package/cjs/useDataGrid/initColumnDefinition.js +0 -146
- package/cjs/useDataGrid/useDataGrid.js +0 -220
- package/cjs/useDataList/index.js +0 -7
- package/cjs/useDataList/recordIterator.js +0 -31
- package/cjs/useDataList/useDataList.js +0 -102
- package/cjs/utils.js +0 -116
- package/cjs/virtualization/AutoHeightList.js +0 -61
- package/cjs/virtualization/FluidHeightList.js +0 -49
- package/cjs/virtualization/index.js +0 -22
- package/esm/Animations/BaseAnimation.js +0 -30
- package/esm/Animations/Grow.js +0 -36
- package/esm/Animations/GrowRight.js +0 -36
- package/esm/Animations/GrowVertical.js +0 -4
- package/esm/CheckableGroup.js +0 -64
- package/esm/DeferRenderAfterComputation.js +0 -22
- package/esm/FocusGroup/FocusGrid.js +0 -204
- package/esm/FocusGroup/FocusGroupContext.js +0 -5
- package/esm/FocusGroup/focusGroupManagerHoc.js +0 -37
- package/esm/FocusGroup/index.js +0 -6
- package/esm/FocusGroup/useFocusGroupItem.js +0 -50
- package/esm/GroupContext/Group.js +0 -118
- package/esm/GroupContext/GroupContext.js +0 -5
- package/esm/GroupContext/GroupItem.js +0 -16
- package/esm/GroupContext/index.js +0 -3
- package/esm/ScrollSync/ScrollSyncPane.js +0 -74
- package/esm/ScrollSync/ScrollSyncProvider.js +0 -59
- package/esm/ScrollSync/index.js +0 -2
- package/esm/ScrollSync/useScrollSync.js +0 -8
- package/esm/constants.js +0 -32
- package/esm/createDataInstance/createInstancePlugin.js +0 -30
- package/esm/createDataInstance/createInstanceRef.js +0 -90
- package/esm/createDataInstance/utils.js +0 -107
- package/esm/defer-render-hoc/index.js +0 -41
- package/esm/dimsum.config.js +0 -5
- package/esm/index.js +0 -5
- package/esm/prop-types.js +0 -43
- package/esm/react-spring/index.js +0 -1
- package/esm/react-spring/renderprops.js +0 -1
- package/esm/toolbar/ToolbarProvider.js +0 -111
- package/esm/useDataGrid/VolatileRowsListener.js +0 -22
- package/esm/useDataGrid/index.js +0 -1
- package/esm/useDataGrid/initColumnDefinition.js +0 -134
- package/esm/useDataGrid/useDataGrid.js +0 -194
- package/esm/useDataList/index.js +0 -1
- package/esm/useDataList/recordIterator.js +0 -27
- package/esm/useDataList/useDataList.js +0 -90
- package/esm/utils.js +0 -95
- package/esm/virtualization/AutoHeightList.js +0 -52
- package/esm/virtualization/FluidHeightList.js +0 -38
- package/esm/virtualization/index.js +0 -18
- package/types/Animations/BaseAnimation.d.ts +0 -12
- package/types/Animations/Grow.d.ts +0 -11
- package/types/Animations/GrowRight.d.ts +0 -11
- package/types/Animations/GrowVertical.d.ts +0 -1
- package/types/CheckableGroup.d.ts +0 -20
- package/types/DeferRenderAfterComputation.d.ts +0 -6
- package/types/FocusGroup/FocusGrid.d.ts +0 -10
- package/types/FocusGroup/FocusGroup.d.ts +0 -36
- package/types/FocusGroup/FocusGroupContext.d.ts +0 -3
- package/types/FocusGroup/FocusGroupManager.d.ts +0 -24
- package/types/FocusGroup/focusGroupManagerHoc.d.ts +0 -7
- package/types/FocusGroup/index.d.ts +0 -6
- package/types/FocusGroup/useFocusGroupItem.d.ts +0 -2
- package/types/FocusGroup/utils/getNextCellPosition.d.ts +0 -12
- package/types/GroupContext/Group.d.ts +0 -14
- package/types/GroupContext/GroupContext.d.ts +0 -2
- package/types/GroupContext/GroupItem.d.ts +0 -5
- package/types/GroupContext/index.d.ts +0 -3
- package/types/ScrollSync/ScrollSync.d.ts +0 -21
- package/types/ScrollSync/ScrollSyncPane.d.ts +0 -3
- package/types/ScrollSync/ScrollSyncProvider.d.ts +0 -12
- package/types/ScrollSync/index.d.ts +0 -2
- package/types/ScrollSync/useScrollSync.d.ts +0 -6
- package/types/constants.d.ts +0 -30
- package/types/createDataInstance/createInstancePlugin.d.ts +0 -1
- package/types/createDataInstance/createInstanceRef.d.ts +0 -12
- package/types/createDataInstance/tests/createInstanceRef.test.d.ts +0 -0
- package/types/createDataInstance/utils.d.ts +0 -9
- package/types/dimsum.config.d.ts +0 -4
- package/types/index.d.ts +0 -2
- package/types/prop-types.d.ts +0 -41
- package/types/react-spring/index.d.ts +0 -1
- package/types/react-spring/renderprops.d.ts +0 -1
- package/types/toolbar/ToolbarProvider.d.ts +0 -10
- package/types/useDataGrid/VolatileRowsListener.d.ts +0 -5
- package/types/useDataGrid/index.d.ts +0 -1
- package/types/useDataGrid/initColumnDefinition.d.ts +0 -5
- package/types/useDataGrid/useDataGrid.d.ts +0 -8
- package/types/useDataList/index.d.ts +0 -1
- package/types/useDataList/recordIterator.d.ts +0 -1
- package/types/useDataList/useDataList.d.ts +0 -13
- package/types/utils.d.ts +0 -22
- package/types/virtualization/AutoHeightList.d.ts +0 -2
- package/types/virtualization/FluidHeightList.d.ts +0 -2
- package/types/virtualization/index.d.ts +0 -9
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
-
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
-
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
-
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
-
require('core-js/modules/esnext.iterator.for-each.js');
|
|
10
|
-
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
11
|
-
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
12
|
-
var React = require('react');
|
|
13
|
-
var reactWindow = require('react-window');
|
|
14
|
-
var dsUtilities = require('@elliemae/ds-utilities');
|
|
15
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
16
|
-
|
|
17
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
18
|
-
|
|
19
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
20
|
-
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
21
|
-
|
|
22
|
-
const _excluded = ["itemCount", "className", "innerRef", "itemData", "itemKey", "itemSize", "outerRef", "component"];
|
|
23
|
-
|
|
24
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
25
|
-
|
|
26
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
27
|
-
const AutoHeightList = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
28
|
-
let {
|
|
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();
|
|
42
|
-
dsUtilities.useWindowScrollerList({
|
|
43
|
-
listInstance: listRef,
|
|
44
|
-
outerListRef
|
|
45
|
-
});
|
|
46
|
-
return /*#__PURE__*/jsxRuntime.jsx(ListComponent, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
47
|
-
ref: dsUtilities.mergeRefs(ref, listRef),
|
|
48
|
-
className: dsUtilities.cx(className, 'window-scroller-override'),
|
|
49
|
-
height: window.innerHeight,
|
|
50
|
-
innerRef: innerRef,
|
|
51
|
-
itemCount: itemCount,
|
|
52
|
-
itemData: itemData,
|
|
53
|
-
itemKey: itemKey,
|
|
54
|
-
itemSize: itemSize,
|
|
55
|
-
outerRef: dsUtilities.mergeRefs(outerListRef, outerRef),
|
|
56
|
-
overscanCount: 10,
|
|
57
|
-
useIsScrolling: true
|
|
58
|
-
}));
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
exports.AutoHeightList = AutoHeightList;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
-
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
-
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
-
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
-
require('core-js/modules/esnext.iterator.for-each.js');
|
|
10
|
-
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
11
|
-
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
12
|
-
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
13
|
-
var React = require('react');
|
|
14
|
-
var AutoSizer = require('react-virtualized-auto-sizer');
|
|
15
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
16
|
-
|
|
17
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
18
|
-
|
|
19
|
-
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
20
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
21
|
-
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
22
|
-
var AutoSizer__default = /*#__PURE__*/_interopDefaultLegacy(AutoSizer);
|
|
23
|
-
|
|
24
|
-
const _excluded = ["component"];
|
|
25
|
-
|
|
26
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
27
|
-
|
|
28
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
29
|
-
const FluidHeightList = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
30
|
-
let {
|
|
31
|
-
component: Component
|
|
32
|
-
} = _ref,
|
|
33
|
-
props = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
34
|
-
|
|
35
|
-
return /*#__PURE__*/_jsx__default["default"](AutoSizer__default["default"], {
|
|
36
|
-
disableWidth: true
|
|
37
|
-
}, void 0, _ref2 => {
|
|
38
|
-
let {
|
|
39
|
-
height: fluidHeight
|
|
40
|
-
} = _ref2;
|
|
41
|
-
return /*#__PURE__*/jsxRuntime.jsx(Component, _objectSpread(_objectSpread({}, props), {}, {
|
|
42
|
-
ref: ref,
|
|
43
|
-
height: fluidHeight - 32 // taking in count the margins of the list
|
|
44
|
-
|
|
45
|
-
}));
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
exports.FluidHeightList = FluidHeightList;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var FluidHeightList = require('./FluidHeightList.js');
|
|
6
|
-
var AutoHeightList = require('./AutoHeightList.js');
|
|
7
|
-
|
|
8
|
-
function getVirtualListComponent(_ref) {
|
|
9
|
-
let {
|
|
10
|
-
component: Component,
|
|
11
|
-
fluid,
|
|
12
|
-
height,
|
|
13
|
-
autoHeight
|
|
14
|
-
} = _ref;
|
|
15
|
-
if (autoHeight) return AutoHeightList.AutoHeightList;
|
|
16
|
-
if (fluid) return FluidHeightList.FluidHeightList;
|
|
17
|
-
return Component;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
exports.FluidHeightList = FluidHeightList.FluidHeightList;
|
|
21
|
-
exports.AutoHeightList = AutoHeightList.AutoHeightList;
|
|
22
|
-
exports.getVirtualListComponent = getVirtualListComponent;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
|
-
import 'react';
|
|
4
|
-
import { Transition } from 'react-spring/renderprops';
|
|
5
|
-
|
|
6
|
-
const BaseAnimation = _ref => {
|
|
7
|
-
let {
|
|
8
|
-
keys = undefined,
|
|
9
|
-
items = [],
|
|
10
|
-
duration = 100,
|
|
11
|
-
enter = {},
|
|
12
|
-
from = {},
|
|
13
|
-
leave = {},
|
|
14
|
-
onRest = () => null,
|
|
15
|
-
children
|
|
16
|
-
} = _ref;
|
|
17
|
-
return /*#__PURE__*/_jsx(Transition, {
|
|
18
|
-
config: {
|
|
19
|
-
duration
|
|
20
|
-
},
|
|
21
|
-
enter: enter,
|
|
22
|
-
from: from,
|
|
23
|
-
items: items,
|
|
24
|
-
keys: keys,
|
|
25
|
-
leave: leave,
|
|
26
|
-
onRest: onRest
|
|
27
|
-
}, void 0, children);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export { BaseAnimation as default };
|
package/esm/Animations/Grow.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
|
-
import 'react';
|
|
4
|
-
import BaseAnimation from './BaseAnimation.js';
|
|
5
|
-
|
|
6
|
-
const Grow = _ref => {
|
|
7
|
-
let {
|
|
8
|
-
keys = undefined,
|
|
9
|
-
duration,
|
|
10
|
-
items = undefined,
|
|
11
|
-
from = 0,
|
|
12
|
-
to = 1,
|
|
13
|
-
children,
|
|
14
|
-
onRest = () => null
|
|
15
|
-
} = _ref;
|
|
16
|
-
return /*#__PURE__*/_jsx(BaseAnimation, {
|
|
17
|
-
duration: duration,
|
|
18
|
-
enter: {
|
|
19
|
-
opacity: 1,
|
|
20
|
-
transform: "scale(".concat(to, ")")
|
|
21
|
-
},
|
|
22
|
-
from: {
|
|
23
|
-
opacity: 0,
|
|
24
|
-
transform: "scale(".concat(from, ")")
|
|
25
|
-
},
|
|
26
|
-
items: items,
|
|
27
|
-
keys: keys,
|
|
28
|
-
leave: {
|
|
29
|
-
opacity: 0,
|
|
30
|
-
transform: "scale(".concat(from, ")")
|
|
31
|
-
},
|
|
32
|
-
onRest: onRest
|
|
33
|
-
}, void 0, children);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export { Grow as default };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
|
-
import 'react';
|
|
4
|
-
import BaseAnimation from './BaseAnimation.js';
|
|
5
|
-
|
|
6
|
-
const GrowRight = _ref => {
|
|
7
|
-
let {
|
|
8
|
-
keys = undefined,
|
|
9
|
-
items = undefined,
|
|
10
|
-
duration = 200,
|
|
11
|
-
from = 0,
|
|
12
|
-
to = 1,
|
|
13
|
-
children,
|
|
14
|
-
onRest = () => null
|
|
15
|
-
} = _ref;
|
|
16
|
-
return /*#__PURE__*/_jsx(BaseAnimation, {
|
|
17
|
-
duration: duration,
|
|
18
|
-
enter: {
|
|
19
|
-
opacity: "".concat(to),
|
|
20
|
-
transform: 'translateX(0px)'
|
|
21
|
-
},
|
|
22
|
-
from: {
|
|
23
|
-
opacity: "".concat(from),
|
|
24
|
-
transform: 'translateX(100%)'
|
|
25
|
-
},
|
|
26
|
-
items: items,
|
|
27
|
-
keys: keys,
|
|
28
|
-
leave: {
|
|
29
|
-
opacity: "".concat(from),
|
|
30
|
-
transform: 'translateX(100%)'
|
|
31
|
-
},
|
|
32
|
-
onRest: onRest
|
|
33
|
-
}, void 0, children);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export { GrowRight as default };
|
package/esm/CheckableGroup.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
|
-
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
4
|
-
import 'core-js/modules/esnext.iterator.map.js';
|
|
5
|
-
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
6
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
7
|
-
import 'core-js/modules/esnext.iterator.filter.js';
|
|
8
|
-
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
9
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
10
|
-
import React, { cloneElement } from 'react';
|
|
11
|
-
import { useDerivedStateFromProps, runAll, addOrRemove } from '@elliemae/ds-utilities';
|
|
12
|
-
|
|
13
|
-
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; }
|
|
14
|
-
|
|
15
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16
|
-
function useCheckableGroup(_ref) {
|
|
17
|
-
let {
|
|
18
|
-
children,
|
|
19
|
-
active: activeProp,
|
|
20
|
-
multi,
|
|
21
|
-
onCheck = () => null
|
|
22
|
-
} = _ref;
|
|
23
|
-
const [active, setActive] = useDerivedStateFromProps(activeProp);
|
|
24
|
-
|
|
25
|
-
const handleCheck = (_ref2, item) => {
|
|
26
|
-
let {
|
|
27
|
-
target: {
|
|
28
|
-
value
|
|
29
|
-
}
|
|
30
|
-
} = _ref2;
|
|
31
|
-
setActive(prevActive => {
|
|
32
|
-
const nextActive = multi ? addOrRemove(prevActive, value) : value;
|
|
33
|
-
onCheck(nextActive, item);
|
|
34
|
-
return nextActive;
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
return React.Children.map(children, child => {
|
|
39
|
-
const {
|
|
40
|
-
props
|
|
41
|
-
} = child;
|
|
42
|
-
const checked = Array.isArray(active) ? active.indexOf(props.name) !== -1 : active === props.name;
|
|
43
|
-
return /*#__PURE__*/cloneElement(child, _objectSpread(_objectSpread({}, props), {}, {
|
|
44
|
-
checked,
|
|
45
|
-
onClick: runAll(handleCheck, props.onClick)
|
|
46
|
-
}));
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function CheckableGroup(_ref3) {
|
|
51
|
-
let {
|
|
52
|
-
active = [],
|
|
53
|
-
multi = false,
|
|
54
|
-
// checkbox or radio
|
|
55
|
-
children
|
|
56
|
-
} = _ref3;
|
|
57
|
-
return useCheckableGroup({
|
|
58
|
-
active,
|
|
59
|
-
multi,
|
|
60
|
-
children
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export { CheckableGroup as default, useCheckableGroup };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
2
|
-
import { useState, useEffect } from 'react';
|
|
3
|
-
import raf from 'raf';
|
|
4
|
-
|
|
5
|
-
function DeferRenderAfterComputation(_ref) {
|
|
6
|
-
let {
|
|
7
|
-
children,
|
|
8
|
-
resolve,
|
|
9
|
-
fallback,
|
|
10
|
-
timeout = 2000
|
|
11
|
-
} = _ref;
|
|
12
|
-
const [shouldRender, setShouldRender] = useState(false);
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
// eslint-disable-next-line max-nested-callbacks
|
|
15
|
-
raf(() => raf(() => resolve().then(() => {
|
|
16
|
-
setShouldRender(true);
|
|
17
|
-
})));
|
|
18
|
-
}, []);
|
|
19
|
-
return shouldRender ? children : fallback;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export { DeferRenderAfterComputation as default };
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
|
-
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
4
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
5
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
-
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
7
|
-
import 'core-js/modules/esnext.iterator.filter.js';
|
|
8
|
-
import React, { useRef, useEffect, useMemo, createContext } from 'react';
|
|
9
|
-
import { mergeRefs, get, runAll, isFunction, useHotkeys } from '@elliemae/ds-utilities';
|
|
10
|
-
import getNextCellPosition from './utils/getNextCellPosition.js';
|
|
11
|
-
|
|
12
|
-
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; }
|
|
13
|
-
|
|
14
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
15
|
-
const FocusGridContext = /*#__PURE__*/createContext();
|
|
16
|
-
const {
|
|
17
|
-
Provider
|
|
18
|
-
} = FocusGridContext;
|
|
19
|
-
|
|
20
|
-
const preventDefault = e => e.preventDefault();
|
|
21
|
-
|
|
22
|
-
function registerHotKeysHooks(hotKeys, _ref) {
|
|
23
|
-
let {
|
|
24
|
-
focusedRow,
|
|
25
|
-
focusedCell
|
|
26
|
-
} = _ref;
|
|
27
|
-
Object.keys(hotKeys).forEach(key => {
|
|
28
|
-
const {
|
|
29
|
-
handler,
|
|
30
|
-
options
|
|
31
|
-
} = hotKeys[key];
|
|
32
|
-
useHotkeys({
|
|
33
|
-
keys: key,
|
|
34
|
-
handler: e => {
|
|
35
|
-
e.preventDefault();
|
|
36
|
-
handler({
|
|
37
|
-
rowIndex: focusedRow.current,
|
|
38
|
-
cellIndex: focusedCell.current
|
|
39
|
-
});
|
|
40
|
-
},
|
|
41
|
-
options
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
} // eslint-disable-next-line max-statements
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
function FocusGridProvider(_ref2) {
|
|
48
|
-
let {
|
|
49
|
-
shouldWrapRows = false,
|
|
50
|
-
shouldWrapCells = false,
|
|
51
|
-
shouldRefocus = true,
|
|
52
|
-
children,
|
|
53
|
-
keyBindings,
|
|
54
|
-
hotKeys
|
|
55
|
-
} = _ref2;
|
|
56
|
-
const focusedRow = useRef();
|
|
57
|
-
const focusedCell = useRef();
|
|
58
|
-
const grid = useRef([]);
|
|
59
|
-
const containerRef = useRef(document);
|
|
60
|
-
const child = React.Children.only(children);
|
|
61
|
-
const decoratedChild = /*#__PURE__*/React.cloneElement(child, {
|
|
62
|
-
innerRef: mergeRefs(child.props.innerRef, containerRef)
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
const getNode = _ref3 => {
|
|
66
|
-
let {
|
|
67
|
-
rowIndex,
|
|
68
|
-
cellIndex
|
|
69
|
-
} = _ref3;
|
|
70
|
-
return get(grid.current, [rowIndex, cellIndex]);
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
const register = (node, rowIndex, columnIndex) => {
|
|
74
|
-
if (!node) return;
|
|
75
|
-
|
|
76
|
-
if (!Array.isArray(grid.current[rowIndex])) {
|
|
77
|
-
grid.current[rowIndex] = [];
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
if (rowIndex === 0 && columnIndex === 0) {
|
|
81
|
-
node.setAttribute('tabindex', 0);
|
|
82
|
-
} else {
|
|
83
|
-
node.setAttribute('tabindex', -1);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
node.onfocus = () => {
|
|
87
|
-
const prevNode = getNode({
|
|
88
|
-
rowIndex: focusedRow.current,
|
|
89
|
-
cellIndex: focusedCell.current
|
|
90
|
-
});
|
|
91
|
-
if (prevNode) prevNode.setAttribute('tabindex', -1);
|
|
92
|
-
node.setAttribute('tabindex', 0);
|
|
93
|
-
focusedRow.current = rowIndex;
|
|
94
|
-
focusedCell.current = columnIndex;
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
grid.current[rowIndex][columnIndex] = node;
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
useEffect(() => {
|
|
101
|
-
if (shouldRefocus) {
|
|
102
|
-
const rowIndex = focusedRow.current;
|
|
103
|
-
const cellIndex = focusedCell.current;
|
|
104
|
-
const node = get(grid.current, [rowIndex, cellIndex]);
|
|
105
|
-
if (node) node.focus();
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
const focusNextCell = (directionY, directionX, position) => {
|
|
110
|
-
const {
|
|
111
|
-
rowIndex,
|
|
112
|
-
cellIndex
|
|
113
|
-
} = position || getNextCellPosition({
|
|
114
|
-
grid: grid.current,
|
|
115
|
-
currentCell: focusedCell.current,
|
|
116
|
-
currentRow: focusedRow.current,
|
|
117
|
-
directionX,
|
|
118
|
-
directionY,
|
|
119
|
-
shouldWrapCells,
|
|
120
|
-
shouldWrapRows
|
|
121
|
-
});
|
|
122
|
-
const node = getNode({
|
|
123
|
-
rowIndex,
|
|
124
|
-
cellIndex
|
|
125
|
-
}); // can focus
|
|
126
|
-
|
|
127
|
-
if (node) {
|
|
128
|
-
node.focus();
|
|
129
|
-
focusedRow.current = rowIndex;
|
|
130
|
-
focusedCell.current = cellIndex;
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
registerHotKeysHooks(hotKeys, {
|
|
135
|
-
focusedCell,
|
|
136
|
-
focusedRow
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
const defaultKeyBindings = _objectSpread({
|
|
140
|
-
ArrowUp: runAll(preventDefault, () => focusNextCell(-1, 0)),
|
|
141
|
-
ArrowRight: runAll(preventDefault, () => focusNextCell(0, 1)),
|
|
142
|
-
ArrowDown: runAll(preventDefault, () => focusNextCell(1, 0)),
|
|
143
|
-
ArrowLeft: runAll(preventDefault, () => focusNextCell(0, -1)),
|
|
144
|
-
Home: runAll(preventDefault, e => {
|
|
145
|
-
let rowIndex = focusedRow.current;
|
|
146
|
-
|
|
147
|
-
if (e.ctrlKey) {
|
|
148
|
-
rowIndex = 0;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
focusNextCell(0, 0, {
|
|
152
|
-
rowIndex,
|
|
153
|
-
cellIndex: 0
|
|
154
|
-
});
|
|
155
|
-
}),
|
|
156
|
-
End: runAll(preventDefault, e => {
|
|
157
|
-
let rowIndex = focusedRow.current;
|
|
158
|
-
|
|
159
|
-
if (e.ctrlKey) {
|
|
160
|
-
rowIndex = grid.current.length - 1;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
focusNextCell(0, 0, {
|
|
164
|
-
rowIndex,
|
|
165
|
-
cellIndex: grid.current[0].length - 1
|
|
166
|
-
});
|
|
167
|
-
})
|
|
168
|
-
}, keyBindings);
|
|
169
|
-
|
|
170
|
-
const nextKeyBindings = isFunction(keyBindings) ? keyBindings({
|
|
171
|
-
defaultBindings: defaultKeyBindings,
|
|
172
|
-
rowIndex: focusedRow.current,
|
|
173
|
-
cellIndex: focusedCell.current
|
|
174
|
-
}) : _objectSpread(_objectSpread({}, defaultKeyBindings), keyBindings);
|
|
175
|
-
|
|
176
|
-
const onKeyDown = e => {
|
|
177
|
-
if (e.target.tagName.toLowerCase() === 'input') return;
|
|
178
|
-
const action = nextKeyBindings[e.key];
|
|
179
|
-
if (isFunction(action)) action(e);
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
const activate = container => {
|
|
183
|
-
container.addEventListener('keydown', onKeyDown, true);
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
const deactivate = container => {
|
|
187
|
-
container.removeEventListener('keydown', onKeyDown, true);
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
useEffect(() => {
|
|
191
|
-
activate(containerRef.current);
|
|
192
|
-
return () => {
|
|
193
|
-
deactivate(containerRef.current);
|
|
194
|
-
};
|
|
195
|
-
}, []);
|
|
196
|
-
const valueProvider = useMemo(() => ({
|
|
197
|
-
register
|
|
198
|
-
}), []);
|
|
199
|
-
return /*#__PURE__*/_jsx(Provider, {
|
|
200
|
-
value: valueProvider
|
|
201
|
-
}, void 0, decoratedChild);
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
export { FocusGridContext, FocusGridProvider as default };
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
-
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
-
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
8
|
-
import 'react';
|
|
9
|
-
import FocusGroupProvider from './FocusGroupManager.js';
|
|
10
|
-
import { jsx } from 'react/jsx-runtime';
|
|
11
|
-
|
|
12
|
-
const _excluded = ["onExitFocusGroup", "onFocusPrevGroup", "focusKeyBindings"];
|
|
13
|
-
|
|
14
|
-
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; }
|
|
15
|
-
|
|
16
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17
|
-
function FocusGroupHoc(WrappedComponent) {
|
|
18
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
19
|
-
return _ref => {
|
|
20
|
-
let {
|
|
21
|
-
onExitFocusGroup,
|
|
22
|
-
onFocusPrevGroup,
|
|
23
|
-
focusKeyBindings
|
|
24
|
-
} = _ref,
|
|
25
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
26
|
-
|
|
27
|
-
return /*#__PURE__*/jsx(FocusGroupProvider, _objectSpread(_objectSpread({
|
|
28
|
-
keyBindings: focusKeyBindings,
|
|
29
|
-
onExitFocusGroup: onExitFocusGroup,
|
|
30
|
-
onFocusPrevGroup: onFocusPrevGroup
|
|
31
|
-
}, options), {}, {
|
|
32
|
-
children: /*#__PURE__*/jsx(WrappedComponent, _objectSpread(_objectSpread({}, props), options))
|
|
33
|
-
}));
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export { FocusGroupHoc as default };
|
package/esm/FocusGroup/index.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { default as FocusGroup } from './FocusGroup.js';
|
|
2
|
-
export { default as FocusGroupContext } from './FocusGroupContext.js';
|
|
3
|
-
export { default as FocusGroupManager } from './FocusGroupManager.js';
|
|
4
|
-
export { default as useFocusGroupItem, useFocusGroupWithState } from './useFocusGroupItem.js';
|
|
5
|
-
export { default as focusGroupManagerHoc } from './focusGroupManagerHoc.js';
|
|
6
|
-
export { default as FocusGrid, FocusGridContext } from './FocusGrid.js';
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
2
|
-
import { useContext, useEffect } from 'react';
|
|
3
|
-
import FocusGroupContext from './FocusGroupContext.js';
|
|
4
|
-
|
|
5
|
-
const _excluded = ["register", "unregister"],
|
|
6
|
-
_excluded2 = ["register", "unregister"];
|
|
7
|
-
function useFocusGroupItem() {
|
|
8
|
-
let ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
9
|
-
let props = arguments.length > 1 ? arguments[1] : undefined;
|
|
10
|
-
|
|
11
|
-
const _ref = useContext(FocusGroupContext) || {},
|
|
12
|
-
{
|
|
13
|
-
register,
|
|
14
|
-
unregister
|
|
15
|
-
} = _ref,
|
|
16
|
-
otherActions = _objectWithoutProperties(_ref, _excluded);
|
|
17
|
-
|
|
18
|
-
useEffect(() => {
|
|
19
|
-
if (ref.current && register) register(ref.current, props);
|
|
20
|
-
return () => {
|
|
21
|
-
if (ref.current && unregister) unregister(ref.current);
|
|
22
|
-
};
|
|
23
|
-
}); // if the focus item is not wrapped with the focus provider then return null
|
|
24
|
-
|
|
25
|
-
if (!register) return {};
|
|
26
|
-
return otherActions;
|
|
27
|
-
}
|
|
28
|
-
const useFocusGroupWithState = function () {
|
|
29
|
-
let ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
30
|
-
let props = arguments.length > 1 ? arguments[1] : undefined;
|
|
31
|
-
|
|
32
|
-
const _ref2 = useContext(FocusGroupContext) || {},
|
|
33
|
-
{
|
|
34
|
-
register,
|
|
35
|
-
unregister
|
|
36
|
-
} = _ref2,
|
|
37
|
-
otherActions = _objectWithoutProperties(_ref2, _excluded2);
|
|
38
|
-
|
|
39
|
-
useEffect(() => {
|
|
40
|
-
if (ref && register) register(ref, props);
|
|
41
|
-
return () => {
|
|
42
|
-
if (ref && unregister) unregister(ref);
|
|
43
|
-
};
|
|
44
|
-
}, [ref]); // if the focus item is not wrapped with the focus provider then return null
|
|
45
|
-
|
|
46
|
-
if (!register) return {};
|
|
47
|
-
return otherActions;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export { useFocusGroupItem as default, useFocusGroupWithState };
|