@elliemae/ds-shared 2.3.0-alpha.9 → 2.3.0-next.11
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/{dist/types/react-spring/index.d.ts → esm/react-spring/index.js} +0 -0
- package/{dist/types/react-spring/renderprops.d.ts → esm/react-spring/renderprops.js} +0 -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/{dist/types → types}/Animations/BaseAnimation.d.ts +0 -1
- package/{dist/types → types}/Animations/Grow.d.ts +0 -1
- package/{dist/types → types}/Animations/GrowRight.d.ts +0 -1
- package/{dist/types → types}/Animations/GrowVertical.d.ts +0 -0
- package/{dist/types → types}/CheckableGroup.d.ts +0 -1
- package/types/DeferRenderAfterComputation.d.ts +6 -0
- package/types/FocusGroup/FocusGrid.d.ts +10 -0
- package/{dist/types → types}/FocusGroup/FocusGroup.d.ts +1 -3
- package/types/FocusGroup/FocusGroupContext.d.ts +3 -0
- package/{dist/types → types}/FocusGroup/FocusGroupManager.d.ts +1 -3
- 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/{dist/types → types}/FocusGroup/utils/getNextCellPosition.d.ts +1 -3
- package/{dist/types → types}/GroupContext/Group.d.ts +0 -1
- package/{dist/types → types}/GroupContext/GroupContext.d.ts +0 -0
- package/{dist/types → types}/GroupContext/GroupItem.d.ts +0 -1
- package/types/GroupContext/index.d.ts +3 -0
- package/{dist/types → types}/ScrollSync/ScrollSync.d.ts +2 -4
- package/types/ScrollSync/ScrollSyncPane.d.ts +3 -0
- package/{dist/types → types}/ScrollSync/ScrollSyncProvider.d.ts +0 -0
- package/types/ScrollSync/index.d.ts +2 -0
- package/types/ScrollSync/useScrollSync.d.ts +6 -0
- package/{dist/types → types}/constants.d.ts +0 -0
- package/types/createDataInstance/createInstancePlugin.d.ts +1 -0
- package/{dist/types → types}/createDataInstance/createInstanceRef.d.ts +1 -3
- package/{dist/types → types}/createDataInstance/tests/createInstanceRef.test.d.ts +0 -0
- package/{dist/types → types}/createDataInstance/utils.d.ts +0 -0
- package/types/dimsum.config.d.ts +4 -0
- package/types/index.d.ts +2 -0
- package/{dist/types → types}/prop-types.d.ts +0 -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/{dist/types → types}/useDataGrid/initColumnDefinition.d.ts +1 -2
- package/types/useDataGrid/useDataGrid.d.ts +8 -0
- package/types/useDataList/index.d.ts +1 -0
- package/{dist/types → types}/useDataList/recordIterator.d.ts +0 -0
- package/{dist/types → types}/useDataList/useDataList.d.ts +2 -3
- package/{dist/types → types}/utils.d.ts +0 -0
- package/{dist/types → types}/virtualization/AutoHeightList.d.ts +0 -0
- package/{dist/types → types}/virtualization/FluidHeightList.d.ts +0 -0
- package/{dist/types → types}/virtualization/index.d.ts +0 -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
- package/dist/types/DeferRenderAfterComputation.d.ts +0 -7
- package/dist/types/FocusGroup/FocusGrid.d.ts +0 -12
- package/dist/types/FocusGroup/FocusGroupContext.d.ts +0 -4
- package/dist/types/FocusGroup/focusGroupManagerHoc.d.ts +0 -9
- package/dist/types/FocusGroup/index.d.ts +0 -6
- package/dist/types/FocusGroup/useFocusGroupItem.d.ts +0 -4
- package/dist/types/GroupContext/index.d.ts +0 -3
- package/dist/types/ScrollSync/ScrollSyncPane.d.ts +0 -3
- package/dist/types/ScrollSync/index.d.ts +0 -2
- package/dist/types/ScrollSync/useScrollSync.d.ts +0 -7
- package/dist/types/createDataInstance/createInstancePlugin.d.ts +0 -2
- package/dist/types/dimsum.config.d.ts +0 -5
- package/dist/types/index.d.ts +0 -2
- package/dist/types/toolbar/ToolbarProvider.d.ts +0 -5
- package/dist/types/useDataGrid/VolatileRowsListener.d.ts +0 -7
- package/dist/types/useDataGrid/index.d.ts +0 -1
- package/dist/types/useDataGrid/useDataGrid.d.ts +0 -9
- package/dist/types/useDataList/index.d.ts +0 -1
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
8
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
9
|
+
require('core-js/modules/esnext.async-iterator.reduce.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.reduce.js');
|
|
11
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
12
|
+
require('core-js/modules/esnext.async-iterator.map.js');
|
|
13
|
+
require('core-js/modules/esnext.iterator.map.js');
|
|
14
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
15
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
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
|
+
|
|
21
|
+
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; }
|
|
22
|
+
|
|
23
|
+
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; }
|
|
24
|
+
const reducePropsGetter = function () {
|
|
25
|
+
let decorators = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
26
|
+
let grid = arguments.length > 1 ? arguments[1] : undefined;
|
|
27
|
+
return function () {
|
|
28
|
+
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
29
|
+
let extraParams = arguments.length > 1 ? arguments[1] : undefined;
|
|
30
|
+
let nextProps = props;
|
|
31
|
+
decorators.forEach(decorator => {
|
|
32
|
+
nextProps = decorator(nextProps, grid, extraParams);
|
|
33
|
+
});
|
|
34
|
+
return nextProps;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
/* eslint-disable-next-line max-params */
|
|
38
|
+
|
|
39
|
+
function evaluateTransforms(transforms, value) {
|
|
40
|
+
let extraParams = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
41
|
+
let props = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
42
|
+
let grid = arguments.length > 4 ? arguments[4] : undefined;
|
|
43
|
+
let nextProps = props;
|
|
44
|
+
transforms.forEach(transform => {
|
|
45
|
+
nextProps = transform(value, extraParams, nextProps, grid);
|
|
46
|
+
});
|
|
47
|
+
return nextProps;
|
|
48
|
+
}
|
|
49
|
+
/* eslint-disable-next-line max-params */
|
|
50
|
+
|
|
51
|
+
function evaluateFormatters(formatters, value) {
|
|
52
|
+
let extraParams = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
53
|
+
let grid = arguments.length > 3 ? arguments[3] : undefined;
|
|
54
|
+
return formatters.reduce((result, formatter) => formatter(result, extraParams, grid), value);
|
|
55
|
+
}
|
|
56
|
+
function composeFormatters(formatters, instance) {
|
|
57
|
+
let getItemValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : record => record.data.name;
|
|
58
|
+
// todo: make the formatters subscribe to the item props instead of getting the whole instance
|
|
59
|
+
// todo: addd should formatter update to memoize specific ones
|
|
60
|
+
return props => formatters.reduce((result, formatter) => formatter(result, props, instance), getItemValue(props.record));
|
|
61
|
+
}
|
|
62
|
+
const applyDecorators = function (subject) {
|
|
63
|
+
let decorators = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
64
|
+
|
|
65
|
+
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
66
|
+
args[_key - 2] = arguments[_key];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return decorators.reduce((nextSubject, decorator) => decorator(nextSubject, ...args), subject);
|
|
70
|
+
};
|
|
71
|
+
const decorateColumns = (columns, decorators, grid) => {
|
|
72
|
+
const nextColumns = applyDecorators(columns, decorators.decorateColumns, grid);
|
|
73
|
+
return nextColumns.map((column, index) => applyDecorators(column, decorators.decorateColumn, grid, index));
|
|
74
|
+
};
|
|
75
|
+
const mergeInstance = (instance, instanceHook) => _objectSpread(_objectSpread({}, instance), instanceHook(instance));
|
|
76
|
+
const registerStateHookToInstance = (instance, stateHook) => {
|
|
77
|
+
const {
|
|
78
|
+
state,
|
|
79
|
+
actions
|
|
80
|
+
} = stateHook(instance);
|
|
81
|
+
return _objectSpread(_objectSpread({}, instance), {}, {
|
|
82
|
+
state: _objectSpread(_objectSpread({}, instance.state), state),
|
|
83
|
+
actions: _objectSpread(_objectSpread({}, instance.actions), actions)
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const reduceHotKey = (instance, _ref) => {
|
|
88
|
+
let {
|
|
89
|
+
key,
|
|
90
|
+
handler,
|
|
91
|
+
options,
|
|
92
|
+
allowDocumentHandler
|
|
93
|
+
} = _ref;
|
|
94
|
+
return _objectSpread(_objectSpread({}, instance), {}, {
|
|
95
|
+
hotKeys: _objectSpread(_objectSpread({}, instance.hotKeys), {}, {
|
|
96
|
+
[key]: {
|
|
97
|
+
handler,
|
|
98
|
+
options,
|
|
99
|
+
allowDocumentHandler
|
|
100
|
+
}
|
|
101
|
+
})
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
const registerHotKeysHookToInstance = (instance, hotKeysHook) => {
|
|
106
|
+
const hotKeys = hotKeysHook(instance);
|
|
107
|
+
|
|
108
|
+
if (Array.isArray(hotKeys)) {
|
|
109
|
+
return hotKeys.reduce(reduceHotKey, instance);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return reduceHotKey(instance, hotKeys);
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
exports.applyDecorators = applyDecorators;
|
|
116
|
+
exports.composeFormatters = composeFormatters;
|
|
117
|
+
exports.decorateColumns = decorateColumns;
|
|
118
|
+
exports.evaluateFormatters = evaluateFormatters;
|
|
119
|
+
exports.evaluateTransforms = evaluateTransforms;
|
|
120
|
+
exports.mergeInstance = mergeInstance;
|
|
121
|
+
exports.reducePropsGetter = reducePropsGetter;
|
|
122
|
+
exports.registerHotKeysHookToInstance = registerHotKeysHookToInstance;
|
|
123
|
+
exports.registerStateHookToInstance = registerStateHookToInstance;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
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 React = require('react');
|
|
11
|
+
var raf = require('raf');
|
|
12
|
+
var hoistNonReactStatic = require('hoist-non-react-statics');
|
|
13
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
14
|
+
|
|
15
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
|
+
|
|
17
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
18
|
+
var raf__default = /*#__PURE__*/_interopDefaultLegacy(raf);
|
|
19
|
+
var hoistNonReactStatic__default = /*#__PURE__*/_interopDefaultLegacy(hoistNonReactStatic);
|
|
20
|
+
|
|
21
|
+
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; }
|
|
22
|
+
|
|
23
|
+
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; }
|
|
24
|
+
function deferComponentRender(WrappedComponent, fallback) {
|
|
25
|
+
class DeferredRenderWrapper extends React.PureComponent {
|
|
26
|
+
constructor() {
|
|
27
|
+
super(...arguments);
|
|
28
|
+
this.state = {
|
|
29
|
+
shouldRender: false
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
componentDidMount() {
|
|
34
|
+
raf__default["default"](() => raf__default["default"](() => this.setState({
|
|
35
|
+
shouldRender: true
|
|
36
|
+
})));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
render() {
|
|
40
|
+
// eslint-disable-next-line react/destructuring-assignment
|
|
41
|
+
return this.state.shouldRender ? /*#__PURE__*/jsxRuntime.jsx(WrappedComponent, _objectSpread({}, this.props)) : fallback;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return hoistNonReactStatic__default["default"](DeferredRenderWrapper, WrappedComponent);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
module.exports = deferComponentRender;
|
package/cjs/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var ScrollSync = require('./ScrollSync/ScrollSync.js');
|
|
6
|
+
var ScrollSyncPane = require('./ScrollSync/ScrollSyncPane.js');
|
|
7
|
+
var Group = require('./GroupContext/Group.js');
|
|
8
|
+
var GroupContext = require('./GroupContext/GroupContext.js');
|
|
9
|
+
var GroupItem = require('./GroupContext/GroupItem.js');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
exports.ScrollSync = ScrollSync["default"];
|
|
14
|
+
exports.ScrollSyncPane = ScrollSyncPane;
|
|
15
|
+
exports.Group = Group;
|
|
16
|
+
exports.GroupContext = GroupContext.GroupContext;
|
|
17
|
+
exports.GroupItem = GroupItem;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const dsBasicSizes = ['s', 'm', 'l'];
|
|
6
|
+
const sizes = ['xsmall', 'small', 'medium', 'large', 'xlarge'];
|
|
7
|
+
const iconSizes = ['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl'];
|
|
8
|
+
const iconColors = [['neutral', '900'], ['neutral', '0'], ['danger', '900'], ['warning', '500'], ['success', '900'], ['brand-primary', '600']];
|
|
9
|
+
const CHECKBOX_VARIANT = {
|
|
10
|
+
DEFAULT: 'variant-default',
|
|
11
|
+
FOCUS: 'variant-focus',
|
|
12
|
+
ACTIVE: 'variant-active',
|
|
13
|
+
DISABLED: 'variant-disabled',
|
|
14
|
+
ERROR: 'variant-error'
|
|
15
|
+
};
|
|
16
|
+
const checkboxVariants = [CHECKBOX_VARIANT.DEFAULT, CHECKBOX_VARIANT.FOCUS, CHECKBOX_VARIANT.ACTIVE, CHECKBOX_VARIANT.DISABLED, CHECKBOX_VARIANT.ERROR];
|
|
17
|
+
const COMBOBOX_VARIANT = {
|
|
18
|
+
DEFAULT: 'variant-default',
|
|
19
|
+
FOCUS: 'variant-focus-input',
|
|
20
|
+
FOCUS_ICON: 'variant-focus-icon',
|
|
21
|
+
ACTIVE: 'variant-active-input',
|
|
22
|
+
ACTIVE_ICON: 'variant-active-icon',
|
|
23
|
+
DISABLED: 'variant-disabled',
|
|
24
|
+
ERROR: 'variant-error'
|
|
25
|
+
};
|
|
26
|
+
const comboBoxVariants = [COMBOBOX_VARIANT.DEFAULT, COMBOBOX_VARIANT.FOCUS, COMBOBOX_VARIANT.FOCUS_ICON, COMBOBOX_VARIANT.ACTIVE, COMBOBOX_VARIANT.ACTIVE_ICON, COMBOBOX_VARIANT.DISABLED, COMBOBOX_VARIANT.ERROR];
|
|
27
|
+
const sizeVariants = {
|
|
28
|
+
S: 's',
|
|
29
|
+
M: 'm',
|
|
30
|
+
L: 'l'
|
|
31
|
+
};
|
|
32
|
+
const position = {
|
|
33
|
+
LEFT: 'left',
|
|
34
|
+
RIGHT: 'right',
|
|
35
|
+
CENTER: 'center'
|
|
36
|
+
};
|
|
37
|
+
const fontColor = {
|
|
38
|
+
NEUTRAL500: 'neutral500',
|
|
39
|
+
NEUTRAL700: 'neutral700'
|
|
40
|
+
};
|
|
41
|
+
const orientation = ['horizontal', 'vertical'];
|
|
42
|
+
const orientationVariants = {
|
|
43
|
+
HORIZONTAL: 'horizontal',
|
|
44
|
+
VERTICAL: 'vertical'
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
exports.CHECKBOX_VARIANT = CHECKBOX_VARIANT;
|
|
48
|
+
exports.COMBOBOX_VARIANT = COMBOBOX_VARIANT;
|
|
49
|
+
exports.checkboxVariants = checkboxVariants;
|
|
50
|
+
exports.comboBoxVariants = comboBoxVariants;
|
|
51
|
+
exports.dsBasicSizes = dsBasicSizes;
|
|
52
|
+
exports.fontColor = fontColor;
|
|
53
|
+
exports.iconColors = iconColors;
|
|
54
|
+
exports.iconSizes = iconSizes;
|
|
55
|
+
exports.orientation = orientation;
|
|
56
|
+
exports.orientationVariants = orientationVariants;
|
|
57
|
+
exports.position = position;
|
|
58
|
+
exports.sizeVariants = sizeVariants;
|
|
59
|
+
exports.sizes = sizes;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var web = require('react-spring/web');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.keys(web).forEach(function (k) {
|
|
10
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () { return web[k]; }
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var renderprops = require('react-spring/renderprops');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.keys(renderprops).forEach(function (k) {
|
|
10
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () { return renderprops[k]; }
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,123 @@
|
|
|
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/web.dom-collections.iterator.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
11
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
12
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
13
|
+
var React = require('react');
|
|
14
|
+
var DSPopover = require('@elliemae/ds-popper');
|
|
15
|
+
var dsUtilities = require('@elliemae/ds-utilities');
|
|
16
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
17
|
+
|
|
18
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
|
+
|
|
20
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
21
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
22
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
23
|
+
var DSPopover__default = /*#__PURE__*/_interopDefaultLegacy(DSPopover);
|
|
24
|
+
|
|
25
|
+
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; }
|
|
26
|
+
|
|
27
|
+
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; }
|
|
28
|
+
const ToolbarContext = /*#__PURE__*/React__default["default"].createContext();
|
|
29
|
+
const {
|
|
30
|
+
Provider
|
|
31
|
+
} = ToolbarContext;
|
|
32
|
+
|
|
33
|
+
const useScrollListener = (callback, dependencies) => {
|
|
34
|
+
React.useEffect(() => {
|
|
35
|
+
window.addEventListener('scroll', callback, true);
|
|
36
|
+
return () => {
|
|
37
|
+
window.removeEventListener('scroll', callback, true);
|
|
38
|
+
};
|
|
39
|
+
}, [dependencies]);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const noop = () => null;
|
|
43
|
+
|
|
44
|
+
function ToolbarProvider(_ref) {
|
|
45
|
+
let {
|
|
46
|
+
delay = 200,
|
|
47
|
+
children,
|
|
48
|
+
onHide = noop,
|
|
49
|
+
onShow = noop
|
|
50
|
+
} = _ref;
|
|
51
|
+
const showTimer = React.useRef();
|
|
52
|
+
const hideTimer = React.useRef();
|
|
53
|
+
const toolbarRef = React.useRef();
|
|
54
|
+
const [tooltipState, setTooltipState] = React.useState({});
|
|
55
|
+
|
|
56
|
+
const show = state => {
|
|
57
|
+
if (state.reference === tooltipState.reference) clearTimeout(hideTimer.current);
|
|
58
|
+
showTimer.current = setTimeout(() => setTooltipState(_objectSpread(_objectSpread({}, state), {}, {
|
|
59
|
+
visible: true
|
|
60
|
+
})), delay);
|
|
61
|
+
onShow();
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const hide = (e, force) => {
|
|
65
|
+
if (!force) clearTimeout(showTimer.current);
|
|
66
|
+
hideTimer.current = setTimeout(() => setTooltipState(prevState => _objectSpread(_objectSpread({}, prevState), {}, {
|
|
67
|
+
visible: false
|
|
68
|
+
})), 100);
|
|
69
|
+
onHide(tooltipState, e);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
useScrollListener(e => hide(e, true), tooltipState.visible);
|
|
73
|
+
dsUtilities.useOnClickOutside(toolbarRef, () => hide());
|
|
74
|
+
|
|
75
|
+
const keyDownHandler = e => {
|
|
76
|
+
if (e.key === 'Escape') {
|
|
77
|
+
hide(e);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
React.useEffect(() => {
|
|
82
|
+
window.addEventListener('keydown', keyDownHandler);
|
|
83
|
+
return () => {
|
|
84
|
+
window.removeEventListener('keydown', keyDownHandler);
|
|
85
|
+
};
|
|
86
|
+
});
|
|
87
|
+
const value = React.useMemo(() => ({
|
|
88
|
+
state: tooltipState,
|
|
89
|
+
show,
|
|
90
|
+
hide
|
|
91
|
+
}), [tooltipState.reference]);
|
|
92
|
+
return /*#__PURE__*/_jsx__default["default"](Provider, {
|
|
93
|
+
value: value
|
|
94
|
+
}, void 0, children, /*#__PURE__*/jsxRuntime.jsx(DSPopover__default["default"], _objectSpread(_objectSpread({
|
|
95
|
+
boundaries: "scrollParent"
|
|
96
|
+
}, tooltipState.options || {}), {}, {
|
|
97
|
+
content: tooltipState.renderer,
|
|
98
|
+
placement: "left",
|
|
99
|
+
referenceEl: tooltipState.reference,
|
|
100
|
+
renderer: _ref2 => {
|
|
101
|
+
let {
|
|
102
|
+
as: Component,
|
|
103
|
+
style,
|
|
104
|
+
children: Content
|
|
105
|
+
} = _ref2;
|
|
106
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
107
|
+
ref: toolbarRef,
|
|
108
|
+
onMouseEnter: e => show(tooltipState),
|
|
109
|
+
onMouseLeave: hide,
|
|
110
|
+
children: /*#__PURE__*/_jsx__default["default"](Component, {
|
|
111
|
+
style: style
|
|
112
|
+
}, void 0, Content)
|
|
113
|
+
});
|
|
114
|
+
},
|
|
115
|
+
style: tooltipState.style,
|
|
116
|
+
visible: tooltipState.visible
|
|
117
|
+
})));
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
var ToolbarProvider$1 = /*#__PURE__*/React__default["default"].memo(ToolbarProvider);
|
|
121
|
+
|
|
122
|
+
exports.ToolbarContext = ToolbarContext;
|
|
123
|
+
exports["default"] = ToolbarProvider$1;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
4
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
5
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
6
|
+
var dsUtilities = require('@elliemae/ds-utilities');
|
|
7
|
+
|
|
8
|
+
class VolatileRowsListener {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.observers = [];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
observe(listener) {
|
|
14
|
+
this.observers.push(listener);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
notify(nextRows) {
|
|
18
|
+
this.observers.forEach(observer => dsUtilities.safeCall(observer, nextRows));
|
|
19
|
+
this.observers = [];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
module.exports = VolatileRowsListener;
|
|
@@ -0,0 +1,146 @@
|
|
|
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/web.dom-collections.iterator.js');
|
|
8
|
+
require('core-js/modules/es.string.replace.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
|
+
require('react');
|
|
15
|
+
var uuid = require('uuid');
|
|
16
|
+
var dsUtilities = require('@elliemae/ds-utilities');
|
|
17
|
+
|
|
18
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
|
+
|
|
20
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
21
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
22
|
+
|
|
23
|
+
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; }
|
|
24
|
+
|
|
25
|
+
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; }
|
|
26
|
+
|
|
27
|
+
const appendHeaderFormatter = dsUtilities.curry((formatter, column) => _objectSpread(_objectSpread({}, column), {}, {
|
|
28
|
+
header: _objectSpread(_objectSpread({}, column.header), {}, {
|
|
29
|
+
formatters: [...dsUtilities.get(column, 'header.formatters', []), formatter]
|
|
30
|
+
})
|
|
31
|
+
}));
|
|
32
|
+
const appendCellFormatter = dsUtilities.curry(function (formatter, column) {
|
|
33
|
+
let path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'formatters';
|
|
34
|
+
const nextColumn = dsUtilities.cloneDeep(column);
|
|
35
|
+
const formatters = dsUtilities.get(nextColumn, ['cell', path], []);
|
|
36
|
+
const scrollingFormatters = dsUtilities.get(nextColumn, 'cell.scrollingFormatters', []);
|
|
37
|
+
|
|
38
|
+
if (Array.isArray(formatter)) {
|
|
39
|
+
if (formatter[1]) scrollingFormatters.push(formatter[1]);
|
|
40
|
+
formatters.push(formatter[0]);
|
|
41
|
+
} else {
|
|
42
|
+
formatters.push(formatter);
|
|
43
|
+
scrollingFormatters.push(formatter);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
dsUtilities.set(nextColumn, ['cell', path], formatters);
|
|
47
|
+
dsUtilities.set(nextColumn, 'cell.scrollingFormatters', scrollingFormatters);
|
|
48
|
+
return nextColumn;
|
|
49
|
+
});
|
|
50
|
+
const defaultColumnDefinitionOptions = {
|
|
51
|
+
normalize: false,
|
|
52
|
+
useTextTruncation: true,
|
|
53
|
+
isUserColumn: true,
|
|
54
|
+
visible: true
|
|
55
|
+
};
|
|
56
|
+
const mergeClassNameToColumnHeader = dsUtilities.curry((className, column) => {
|
|
57
|
+
const headerProps = dsUtilities.get(column, ['header', 'props'], {});
|
|
58
|
+
const headerClassName = headerProps.className || '';
|
|
59
|
+
return _objectSpread(_objectSpread({}, column), {}, {
|
|
60
|
+
header: _objectSpread(_objectSpread({}, column.header), {}, {
|
|
61
|
+
props: _objectSpread(_objectSpread({}, headerProps), {}, {
|
|
62
|
+
className: "".concat(headerClassName, " ").concat(className)
|
|
63
|
+
})
|
|
64
|
+
})
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
function initColumnDefinition() {
|
|
68
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
69
|
+
// eslint-disable-next-line complexity
|
|
70
|
+
return column => {
|
|
71
|
+
// todo: clean this
|
|
72
|
+
if (column.type === 'number') {
|
|
73
|
+
// eslint-disable-next-line no-param-reassign
|
|
74
|
+
column.cellStyle = {
|
|
75
|
+
textAlign: 'right'
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const {
|
|
80
|
+
useTextTruncation = true,
|
|
81
|
+
isUserColumn,
|
|
82
|
+
visible,
|
|
83
|
+
normalize
|
|
84
|
+
} = _objectSpread(_objectSpread({}, defaultColumnDefinitionOptions), options);
|
|
85
|
+
|
|
86
|
+
if (normalize) {
|
|
87
|
+
// eslint-disable-next-line no-param-reassign
|
|
88
|
+
column.originalProperty = column.property; // eslint-disable-next-line no-param-reassign
|
|
89
|
+
|
|
90
|
+
column.property = column.property.replace(/\s+/g, '');
|
|
91
|
+
} // eslint-disable-next-line no-param-reassign
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
column.props = _objectSpread(_objectSpread({}, column.props), {}, {
|
|
95
|
+
style: {}
|
|
96
|
+
}); // eslint-disable-next-line no-param-reassign
|
|
97
|
+
|
|
98
|
+
column.header = _objectSpread(_objectSpread({}, column.header), {}, {
|
|
99
|
+
label: column.label,
|
|
100
|
+
formatters: [...dsUtilities.get(column, ['header', 'formatters'], [])],
|
|
101
|
+
props: {
|
|
102
|
+
style: column.headerStyle || {}
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
if (useTextTruncation && !(dsUtilities.isFunction(column.customHeaderRenderer) || column.header.formatters.length)) {
|
|
107
|
+
column.header.formatters.push(value => /*#__PURE__*/_jsx__default["default"]("span", {
|
|
108
|
+
className: "cell-value"
|
|
109
|
+
}, void 0, value));
|
|
110
|
+
} // eslint-disable-next-line no-param-reassign
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
column.cell = _objectSpread(_objectSpread({}, column.cell), {}, {
|
|
114
|
+
transforms: [],
|
|
115
|
+
formatters: [...dsUtilities.get(column, ['cell', 'formatters'], [])],
|
|
116
|
+
scrollingFormatters: [...dsUtilities.get(column, ['cell', 'formatters'], [])],
|
|
117
|
+
props: {
|
|
118
|
+
style: column.cellStyle || {}
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
if (useTextTruncation && !(dsUtilities.isFunction(column.customRenderer) || column.cell.formatters.length)) {
|
|
123
|
+
column.cell.formatters.push(value => /*#__PURE__*/_jsx__default["default"]("span", {
|
|
124
|
+
className: "cell-value",
|
|
125
|
+
style: {
|
|
126
|
+
justifyContent: column.type === 'number' ? 'flex-end' : 'flex-start'
|
|
127
|
+
}
|
|
128
|
+
}, void 0, value));
|
|
129
|
+
} // eslint-disable-next-line no-param-reassign
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
column.uuid = column.uuid || uuid.v4(); // eslint-disable-next-line no-param-reassign
|
|
133
|
+
|
|
134
|
+
column.visible = column.visible === undefined ? visible : column.visible; // eslint-disable-next-line no-param-reassign, max-lines
|
|
135
|
+
|
|
136
|
+
column.isUserColumn = column.isUserColumn || isUserColumn; // eslint-disable-next-line no-param-reassign
|
|
137
|
+
|
|
138
|
+
column.headerHookEffects = [];
|
|
139
|
+
return column;
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
exports.appendCellFormatter = appendCellFormatter;
|
|
144
|
+
exports.appendHeaderFormatter = appendHeaderFormatter;
|
|
145
|
+
exports["default"] = initColumnDefinition;
|
|
146
|
+
exports.mergeClassNameToColumnHeader = mergeClassNameToColumnHeader;
|