@elliemae/ds-shared 1.60.0 → 2.0.0-alpha.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/Animations/BaseAnimation.js +19 -27
- package/cjs/Animations/Grow.js +17 -22
- package/cjs/Animations/GrowRight.js +17 -23
- package/cjs/Animations/GrowVertical.js +3 -2
- package/cjs/CheckableGroup.js +40 -46
- package/cjs/DeferRenderAfterComputation.js +12 -21
- package/cjs/FocusGroup/FocusGrid.js +91 -92
- package/cjs/FocusGroup/FocusGroup.js +225 -262
- package/cjs/FocusGroup/FocusGroupContext.js +1 -2
- package/cjs/FocusGroup/FocusGroupManager.js +88 -126
- package/cjs/FocusGroup/focusGroupManagerHoc.js +28 -27
- package/cjs/FocusGroup/index.js +14 -28
- package/cjs/FocusGroup/useFocusGroupItem.js +27 -24
- package/cjs/FocusGroup/utils/getNextCellPosition.js +14 -15
- package/cjs/GroupContext/Group.js +81 -103
- package/cjs/GroupContext/GroupContext.js +1 -2
- package/cjs/GroupContext/GroupItem.js +12 -10
- package/cjs/GroupContext/index.js +6 -15
- package/cjs/ScrollSync/ScrollSync.js +90 -112
- package/cjs/ScrollSync/ScrollSyncPane.js +58 -90
- package/cjs/ScrollSync/ScrollSyncProvider.js +36 -26
- package/cjs/ScrollSync/index.js +4 -13
- package/cjs/ScrollSync/useScrollSync.js +0 -1
- package/cjs/constants.js +43 -4
- package/cjs/createDataInstance/createInstancePlugin.js +11 -10
- package/cjs/createDataInstance/createInstanceRef.js +41 -42
- package/cjs/createDataInstance/utils.js +56 -58
- package/cjs/defer-render-hoc/index.js +26 -61
- package/cjs/dimsum.config.js +7 -0
- package/cjs/index.js +10 -20
- package/cjs/prop-types.js +59 -0
- package/cjs/react-spring/index.js +3 -6
- package/cjs/react-spring/renderprops.js +3 -6
- package/cjs/toolbar/ToolbarProvider.js +65 -77
- package/cjs/useDataGrid/VolatileRowsListener.js +13 -27
- package/cjs/useDataGrid/index.js +2 -17
- package/cjs/useDataGrid/initColumnDefinition.js +46 -47
- package/cjs/useDataGrid/useDataGrid.js +104 -144
- package/cjs/useDataList/index.js +2 -15
- package/cjs/useDataList/recordIterator.js +9 -10
- package/cjs/useDataList/useDataList.js +51 -59
- package/cjs/utils.js +46 -59
- package/cjs/virtualization/AutoHeightList.js +31 -22
- package/cjs/virtualization/FluidHeightList.js +26 -12
- package/cjs/virtualization/index.js +12 -17
- package/esm/Animations/BaseAnimation.js +18 -26
- package/esm/Animations/Grow.js +15 -20
- package/esm/Animations/GrowRight.js +15 -21
- package/esm/Animations/GrowVertical.js +3 -2
- package/esm/CheckableGroup.js +38 -42
- package/esm/DeferRenderAfterComputation.js +12 -20
- package/esm/FocusGroup/FocusGrid.js +87 -89
- package/esm/FocusGroup/FocusGroup.js +222 -257
- package/esm/FocusGroup/FocusGroupContext.js +0 -1
- package/esm/FocusGroup/FocusGroupManager.js +82 -114
- package/esm/FocusGroup/focusGroupManagerHoc.js +24 -22
- package/esm/FocusGroup/index.js +0 -14
- package/esm/FocusGroup/useFocusGroupItem.js +25 -22
- package/esm/FocusGroup/utils/getNextCellPosition.js +14 -15
- package/esm/GroupContext/Group.js +80 -95
- package/esm/GroupContext/GroupContext.js +1 -2
- package/esm/GroupContext/GroupItem.js +10 -8
- package/esm/GroupContext/index.js +0 -9
- package/esm/ScrollSync/ScrollSync.js +88 -105
- package/esm/ScrollSync/ScrollSyncPane.js +56 -83
- package/esm/ScrollSync/ScrollSyncProvider.js +35 -26
- package/esm/ScrollSync/index.js +0 -9
- package/esm/ScrollSync/useScrollSync.js +0 -1
- package/esm/constants.js +31 -5
- package/esm/createDataInstance/createInstancePlugin.js +10 -8
- package/esm/createDataInstance/createInstanceRef.js +36 -36
- package/esm/createDataInstance/utils.js +55 -57
- package/esm/defer-render-hoc/index.js +25 -55
- package/esm/dimsum.config.js +5 -0
- package/esm/index.js +0 -10
- package/esm/prop-types.js +43 -0
- package/esm/react-spring/index.js +1 -2
- package/esm/react-spring/renderprops.js +1 -2
- package/esm/toolbar/ToolbarProvider.js +60 -71
- package/esm/useDataGrid/VolatileRowsListener.js +14 -23
- package/esm/useDataGrid/index.js +0 -15
- package/esm/useDataGrid/initColumnDefinition.js +43 -43
- package/esm/useDataGrid/useDataGrid.js +90 -127
- package/esm/useDataList/index.js +0 -13
- package/esm/useDataList/recordIterator.js +9 -10
- package/esm/useDataList/useDataList.js +39 -46
- package/esm/utils.js +44 -57
- package/esm/virtualization/AutoHeightList.js +28 -18
- package/esm/virtualization/FluidHeightList.js +24 -10
- package/esm/virtualization/index.js +6 -11
- package/package.json +201 -8
- package/types/Animations/BaseAnimation.d.ts +12 -0
- package/types/Animations/Grow.d.ts +11 -0
- package/types/Animations/GrowRight.d.ts +11 -0
- package/types/Animations/GrowVertical.d.ts +1 -0
- package/types/CheckableGroup.d.ts +20 -0
- package/types/DeferRenderAfterComputation.d.ts +6 -0
- package/types/FocusGroup/FocusGrid.d.ts +10 -0
- package/types/FocusGroup/FocusGroup.d.ts +36 -0
- package/types/FocusGroup/FocusGroupContext.d.ts +3 -0
- package/types/FocusGroup/FocusGroupManager.d.ts +24 -0
- package/types/FocusGroup/focusGroupManagerHoc.d.ts +7 -0
- package/types/FocusGroup/index.d.ts +6 -0
- package/types/FocusGroup/useFocusGroupItem.d.ts +2 -0
- package/types/FocusGroup/utils/getNextCellPosition.d.ts +12 -0
- package/types/GroupContext/Group.d.ts +14 -0
- package/types/GroupContext/GroupContext.d.ts +2 -0
- package/types/GroupContext/GroupItem.d.ts +5 -0
- package/types/GroupContext/index.d.ts +3 -0
- package/types/ScrollSync/ScrollSync.d.ts +21 -0
- package/types/ScrollSync/ScrollSyncPane.d.ts +3 -0
- package/types/ScrollSync/ScrollSyncProvider.d.ts +12 -0
- package/types/ScrollSync/index.d.ts +2 -0
- package/types/ScrollSync/useScrollSync.d.ts +6 -0
- package/types/constants.d.ts +30 -0
- package/types/createDataInstance/createInstancePlugin.d.ts +1 -0
- package/types/createDataInstance/createInstanceRef.d.ts +12 -0
- package/types/createDataInstance/tests/createInstanceRef.test.d.ts +0 -0
- package/types/createDataInstance/utils.d.ts +9 -0
- package/types/dimsum.config.d.ts +4 -0
- package/types/index.d.ts +2 -0
- package/types/prop-types.d.ts +41 -0
- package/types/react-spring/index.d.ts +1 -0
- package/types/react-spring/renderprops.d.ts +1 -0
- package/types/toolbar/ToolbarProvider.d.ts +10 -0
- package/types/useDataGrid/VolatileRowsListener.d.ts +5 -0
- package/types/useDataGrid/index.d.ts +1 -0
- package/types/useDataGrid/initColumnDefinition.d.ts +5 -0
- package/types/useDataGrid/useDataGrid.d.ts +8 -0
- package/types/useDataList/index.d.ts +1 -0
- package/types/useDataList/recordIterator.d.ts +1 -0
- package/types/useDataList/useDataList.d.ts +13 -0
- package/types/utils.d.ts +22 -0
- package/types/virtualization/AutoHeightList.d.ts +2 -0
- package/types/virtualization/FluidHeightList.d.ts +2 -0
- package/types/virtualization/index.d.ts +9 -0
- package/Animations/BaseAnimation/package.json +0 -10
- package/Animations/Grow/package.json +0 -10
- package/Animations/GrowRight/package.json +0 -10
- package/Animations/GrowVertical/package.json +0 -10
- package/CheckableGroup/package.json +0 -10
- package/DeferRenderAfterComputation/package.json +0 -10
- package/FocusGroup/FocusGrid/package.json +0 -10
- package/FocusGroup/FocusGroup/package.json +0 -10
- package/FocusGroup/FocusGroupContext/package.json +0 -10
- package/FocusGroup/FocusGroupManager/package.json +0 -10
- package/FocusGroup/focusGroupManagerHoc/package.json +0 -10
- package/FocusGroup/package.json +0 -10
- package/FocusGroup/useFocusGroupItem/package.json +0 -10
- package/FocusGroup/utils/getNextCellPosition/package.json +0 -10
- package/GroupContext/Group/package.json +0 -10
- package/GroupContext/GroupContext/package.json +0 -10
- package/GroupContext/GroupItem/package.json +0 -10
- package/GroupContext/package.json +0 -10
- package/ScrollSync/ScrollSync/package.json +0 -10
- package/ScrollSync/ScrollSyncPane/package.json +0 -10
- package/ScrollSync/ScrollSyncProvider/package.json +0 -10
- package/ScrollSync/package.json +0 -10
- package/ScrollSync/useScrollSync/package.json +0 -10
- package/cjs/Animations/BaseAnimation.js.map +0 -1
- package/cjs/Animations/Grow.js.map +0 -1
- package/cjs/Animations/GrowRight.js.map +0 -1
- package/cjs/Animations/GrowVertical.js.map +0 -1
- package/cjs/CheckableGroup.js.map +0 -1
- package/cjs/DeferRenderAfterComputation.js.map +0 -1
- package/cjs/FocusGroup/FocusGrid.js.map +0 -1
- package/cjs/FocusGroup/FocusGroup.js.map +0 -1
- package/cjs/FocusGroup/FocusGroupContext.js.map +0 -1
- package/cjs/FocusGroup/FocusGroupManager.js.map +0 -1
- package/cjs/FocusGroup/focusGroupManagerHoc.js.map +0 -1
- package/cjs/FocusGroup/index.js.map +0 -1
- package/cjs/FocusGroup/useFocusGroupItem.js.map +0 -1
- package/cjs/FocusGroup/utils/getNextCellPosition.js.map +0 -1
- package/cjs/GroupContext/Group.js.map +0 -1
- package/cjs/GroupContext/GroupContext.js.map +0 -1
- package/cjs/GroupContext/GroupItem.js.map +0 -1
- package/cjs/GroupContext/index.js.map +0 -1
- package/cjs/ScrollSync/ScrollSync.js.map +0 -1
- package/cjs/ScrollSync/ScrollSyncPane.js.map +0 -1
- package/cjs/ScrollSync/ScrollSyncProvider.js.map +0 -1
- package/cjs/ScrollSync/index.js.map +0 -1
- package/cjs/ScrollSync/useScrollSync.js.map +0 -1
- package/cjs/constants.js.map +0 -1
- package/cjs/createDataInstance/createInstancePlugin.js.map +0 -1
- package/cjs/createDataInstance/createInstanceRef.js.map +0 -1
- package/cjs/createDataInstance/utils.js.map +0 -1
- package/cjs/defer-render-hoc/index.js.map +0 -1
- package/cjs/index.js.map +0 -1
- package/cjs/react-spring/index.js.map +0 -1
- package/cjs/react-spring/renderprops.js.map +0 -1
- package/cjs/toolbar/ToolbarProvider.js.map +0 -1
- package/cjs/useDataGrid/VolatileRowsListener.js.map +0 -1
- package/cjs/useDataGrid/index.js.map +0 -1
- package/cjs/useDataGrid/initColumnDefinition.js.map +0 -1
- package/cjs/useDataGrid/useDataGrid.js.map +0 -1
- package/cjs/useDataList/index.js.map +0 -1
- package/cjs/useDataList/recordIterator.js.map +0 -1
- package/cjs/useDataList/useDataList.js.map +0 -1
- package/cjs/utils.js.map +0 -1
- package/cjs/virtualization/AutoHeightList.js.map +0 -1
- package/cjs/virtualization/FluidHeightList.js.map +0 -1
- package/cjs/virtualization/index.js.map +0 -1
- package/constants/package.json +0 -10
- package/createDataInstance/createInstancePlugin/package.json +0 -10
- package/createDataInstance/createInstanceRef/package.json +0 -10
- package/createDataInstance/utils/package.json +0 -10
- package/defer-render-hoc/package.json +0 -10
- package/esm/Animations/BaseAnimation.js.map +0 -1
- package/esm/Animations/Grow.js.map +0 -1
- package/esm/Animations/GrowRight.js.map +0 -1
- package/esm/Animations/GrowVertical.js.map +0 -1
- package/esm/CheckableGroup.js.map +0 -1
- package/esm/DeferRenderAfterComputation.js.map +0 -1
- package/esm/FocusGroup/FocusGrid.js.map +0 -1
- package/esm/FocusGroup/FocusGroup.js.map +0 -1
- package/esm/FocusGroup/FocusGroupContext.js.map +0 -1
- package/esm/FocusGroup/FocusGroupManager.js.map +0 -1
- package/esm/FocusGroup/focusGroupManagerHoc.js.map +0 -1
- package/esm/FocusGroup/index.js.map +0 -1
- package/esm/FocusGroup/useFocusGroupItem.js.map +0 -1
- package/esm/FocusGroup/utils/getNextCellPosition.js.map +0 -1
- package/esm/GroupContext/Group.js.map +0 -1
- package/esm/GroupContext/GroupContext.js.map +0 -1
- package/esm/GroupContext/GroupItem.js.map +0 -1
- package/esm/GroupContext/index.js.map +0 -1
- package/esm/ScrollSync/ScrollSync.js.map +0 -1
- package/esm/ScrollSync/ScrollSyncPane.js.map +0 -1
- package/esm/ScrollSync/ScrollSyncProvider.js.map +0 -1
- package/esm/ScrollSync/index.js.map +0 -1
- package/esm/ScrollSync/useScrollSync.js.map +0 -1
- package/esm/constants.js.map +0 -1
- package/esm/createDataInstance/createInstancePlugin.js.map +0 -1
- package/esm/createDataInstance/createInstanceRef.js.map +0 -1
- package/esm/createDataInstance/utils.js.map +0 -1
- package/esm/defer-render-hoc/index.js.map +0 -1
- package/esm/index.js.map +0 -1
- package/esm/react-spring/index.js.map +0 -1
- package/esm/react-spring/renderprops.js.map +0 -1
- package/esm/toolbar/ToolbarProvider.js.map +0 -1
- package/esm/useDataGrid/VolatileRowsListener.js.map +0 -1
- package/esm/useDataGrid/index.js.map +0 -1
- package/esm/useDataGrid/initColumnDefinition.js.map +0 -1
- package/esm/useDataGrid/useDataGrid.js.map +0 -1
- package/esm/useDataList/index.js.map +0 -1
- package/esm/useDataList/recordIterator.js.map +0 -1
- package/esm/useDataList/useDataList.js.map +0 -1
- package/esm/utils.js.map +0 -1
- package/esm/virtualization/AutoHeightList.js.map +0 -1
- package/esm/virtualization/FluidHeightList.js.map +0 -1
- package/esm/virtualization/index.js.map +0 -1
- package/react-spring/package.json +0 -10
- package/react-spring/renderprops/package.json +0 -10
- package/toolbar/ToolbarProvider/package.json +0 -10
- package/useDataGrid/VolatileRowsListener/package.json +0 -10
- package/useDataGrid/initColumnDefinition/package.json +0 -10
- package/useDataGrid/package.json +0 -10
- package/useDataGrid/useDataGrid/package.json +0 -10
- package/useDataList/package.json +0 -10
- package/useDataList/recordIterator/package.json +0 -10
- package/useDataList/useDataList/package.json +0 -10
- package/utils/package.json +0 -10
- package/virtualization/AutoHeightList/package.json +0 -10
- package/virtualization/FluidHeightList/package.json +0 -10
- package/virtualization/package.json +0 -10
|
@@ -1,38 +1,24 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
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');
|
|
5
6
|
var dsUtilities = require('@elliemae/ds-utilities');
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
class VolatileRowsListener {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.observers = [];
|
|
11
|
+
}
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
observe(listener) {
|
|
14
|
+
this.observers.push(listener);
|
|
15
|
+
}
|
|
15
16
|
|
|
17
|
+
notify(nextRows) {
|
|
18
|
+
this.observers.forEach(observer => dsUtilities.safeCall(observer, nextRows));
|
|
16
19
|
this.observers = [];
|
|
17
20
|
}
|
|
18
21
|
|
|
19
|
-
|
|
20
|
-
key: "observe",
|
|
21
|
-
value: function observe(listener) {
|
|
22
|
-
this.observers.push(listener);
|
|
23
|
-
}
|
|
24
|
-
}, {
|
|
25
|
-
key: "notify",
|
|
26
|
-
value: function notify(nextRows) {
|
|
27
|
-
this.observers.forEach(function (observer) {
|
|
28
|
-
return dsUtilities.safeCall(observer, nextRows);
|
|
29
|
-
});
|
|
30
|
-
this.observers = [];
|
|
31
|
-
}
|
|
32
|
-
}]);
|
|
33
|
-
|
|
34
|
-
return VolatileRowsListener;
|
|
35
|
-
}();
|
|
22
|
+
}
|
|
36
23
|
|
|
37
24
|
module.exports = VolatileRowsListener;
|
|
38
|
-
//# sourceMappingURL=VolatileRowsListener.js.map
|
package/cjs/useDataGrid/index.js
CHANGED
|
@@ -1,22 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('@babel/runtime/helpers/defineProperty');
|
|
5
|
-
require('@babel/runtime/helpers/slicedToArray');
|
|
6
|
-
require('@babel/runtime/helpers/objectWithoutProperties');
|
|
7
|
-
require('@elliemae/ds-utilities');
|
|
8
|
-
require('react');
|
|
9
|
-
require('uuid');
|
|
10
|
-
require('table-resolver');
|
|
11
|
-
require('./initColumnDefinition.js');
|
|
12
|
-
require('@babel/runtime/helpers/toConsumableArray');
|
|
13
|
-
require('../createDataInstance/utils.js');
|
|
14
|
-
require('./VolatileRowsListener.js');
|
|
15
|
-
require('@babel/runtime/helpers/classCallCheck');
|
|
16
|
-
require('@babel/runtime/helpers/createClass');
|
|
17
|
-
require('../utils.js');
|
|
3
|
+
var useDataGrid = require('./useDataGrid.js');
|
|
18
4
|
|
|
19
5
|
|
|
20
6
|
|
|
21
|
-
module.exports =
|
|
22
|
-
//# sourceMappingURL=index.js.map
|
|
7
|
+
module.exports = useDataGrid;
|
|
@@ -2,34 +2,38 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
6
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
|
-
|
|
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');
|
|
8
15
|
var uuid = require('uuid');
|
|
9
16
|
var dsUtilities = require('@elliemae/ds-utilities');
|
|
10
17
|
|
|
11
18
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
19
|
|
|
13
|
-
var
|
|
20
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
14
21
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
15
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
16
22
|
|
|
17
23
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
18
24
|
|
|
19
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default[
|
|
25
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
20
26
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
var formatters = dsUtilities.get(nextColumn, ['cell', path], []);
|
|
32
|
-
var scrollingFormatters = dsUtilities.get(nextColumn, 'cell.scrollingFormatters', []);
|
|
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', []);
|
|
33
37
|
|
|
34
38
|
if (Array.isArray(formatter)) {
|
|
35
39
|
if (formatter[1]) scrollingFormatters.push(formatter[1]);
|
|
@@ -43,15 +47,15 @@ var appendCellFormatter = dsUtilities.curry(function (formatter, column) {
|
|
|
43
47
|
dsUtilities.set(nextColumn, 'cell.scrollingFormatters', scrollingFormatters);
|
|
44
48
|
return nextColumn;
|
|
45
49
|
});
|
|
46
|
-
|
|
50
|
+
const defaultColumnDefinitionOptions = {
|
|
47
51
|
normalize: false,
|
|
48
52
|
useTextTruncation: true,
|
|
49
53
|
isUserColumn: true,
|
|
50
54
|
visible: true
|
|
51
55
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
56
|
+
const mergeClassNameToColumnHeader = dsUtilities.curry((className, column) => {
|
|
57
|
+
const headerProps = dsUtilities.get(column, ['header', 'props'], {});
|
|
58
|
+
const headerClassName = headerProps.className || '';
|
|
55
59
|
return _objectSpread(_objectSpread({}, column), {}, {
|
|
56
60
|
header: _objectSpread(_objectSpread({}, column.header), {}, {
|
|
57
61
|
props: _objectSpread(_objectSpread({}, headerProps), {}, {
|
|
@@ -61,9 +65,9 @@ var mergeClassNameToColumnHeader = dsUtilities.curry(function (className, column
|
|
|
61
65
|
});
|
|
62
66
|
});
|
|
63
67
|
function initColumnDefinition() {
|
|
64
|
-
|
|
68
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
65
69
|
// eslint-disable-next-line complexity
|
|
66
|
-
return
|
|
70
|
+
return column => {
|
|
67
71
|
// todo: clean this
|
|
68
72
|
if (column.type === 'number') {
|
|
69
73
|
// eslint-disable-next-line no-param-reassign
|
|
@@ -72,12 +76,12 @@ function initColumnDefinition() {
|
|
|
72
76
|
};
|
|
73
77
|
}
|
|
74
78
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
const {
|
|
80
|
+
useTextTruncation = true,
|
|
81
|
+
isUserColumn,
|
|
82
|
+
visible,
|
|
83
|
+
normalize
|
|
84
|
+
} = _objectSpread(_objectSpread({}, defaultColumnDefinitionOptions), options);
|
|
81
85
|
|
|
82
86
|
if (normalize) {
|
|
83
87
|
// eslint-disable-next-line no-param-reassign
|
|
@@ -93,39 +97,35 @@ function initColumnDefinition() {
|
|
|
93
97
|
|
|
94
98
|
column.header = _objectSpread(_objectSpread({}, column.header), {}, {
|
|
95
99
|
label: column.label,
|
|
96
|
-
formatters:
|
|
100
|
+
formatters: [...dsUtilities.get(column, ['header', 'formatters'], [])],
|
|
97
101
|
props: {
|
|
98
102
|
style: column.headerStyle || {}
|
|
99
103
|
}
|
|
100
104
|
});
|
|
101
105
|
|
|
102
106
|
if (useTextTruncation && !(dsUtilities.isFunction(column.customHeaderRenderer) || column.header.formatters.length)) {
|
|
103
|
-
column.header.formatters.push(
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}, value);
|
|
107
|
-
});
|
|
107
|
+
column.header.formatters.push(value => /*#__PURE__*/_jsx__default["default"]("span", {
|
|
108
|
+
className: "cell-value"
|
|
109
|
+
}, void 0, value));
|
|
108
110
|
} // eslint-disable-next-line no-param-reassign
|
|
109
111
|
|
|
110
112
|
|
|
111
113
|
column.cell = _objectSpread(_objectSpread({}, column.cell), {}, {
|
|
112
114
|
transforms: [],
|
|
113
|
-
formatters:
|
|
114
|
-
scrollingFormatters:
|
|
115
|
+
formatters: [...dsUtilities.get(column, ['cell', 'formatters'], [])],
|
|
116
|
+
scrollingFormatters: [...dsUtilities.get(column, ['cell', 'formatters'], [])],
|
|
115
117
|
props: {
|
|
116
118
|
style: column.cellStyle || {}
|
|
117
119
|
}
|
|
118
120
|
});
|
|
119
121
|
|
|
120
122
|
if (useTextTruncation && !(dsUtilities.isFunction(column.customRenderer) || column.cell.formatters.length)) {
|
|
121
|
-
column.cell.formatters.push(
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}, value);
|
|
128
|
-
});
|
|
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
129
|
} // eslint-disable-next-line no-param-reassign
|
|
130
130
|
|
|
131
131
|
|
|
@@ -142,6 +142,5 @@ function initColumnDefinition() {
|
|
|
142
142
|
|
|
143
143
|
exports.appendCellFormatter = appendCellFormatter;
|
|
144
144
|
exports.appendHeaderFormatter = appendHeaderFormatter;
|
|
145
|
-
exports[
|
|
145
|
+
exports["default"] = initColumnDefinition;
|
|
146
146
|
exports.mergeClassNameToColumnHeader = mergeClassNameToColumnHeader;
|
|
147
|
-
//# sourceMappingURL=initColumnDefinition.js.map
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
|
-
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
5
4
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
5
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
6
|
+
require('core-js/modules/esnext.async-iterator.map.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.map.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
11
|
+
require('core-js/modules/esnext.async-iterator.reduce.js');
|
|
12
|
+
require('core-js/modules/esnext.iterator.reduce.js');
|
|
13
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
14
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
6
15
|
var dsUtilities = require('@elliemae/ds-utilities');
|
|
7
16
|
var React = require('react');
|
|
8
17
|
var uuid = require('uuid');
|
|
9
18
|
var resolve = require('table-resolver');
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
19
|
+
var initColumnDefinition = require('./initColumnDefinition.js');
|
|
20
|
+
var utils$1 = require('../createDataInstance/utils.js');
|
|
21
|
+
var VolatileRowsListener = require('./VolatileRowsListener.js');
|
|
13
22
|
var utils = require('../utils.js');
|
|
14
|
-
require('@babel/runtime/helpers/toConsumableArray');
|
|
15
|
-
require('@babel/runtime/helpers/classCallCheck');
|
|
16
|
-
require('@babel/runtime/helpers/createClass');
|
|
17
23
|
|
|
18
24
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
25
|
|
|
@@ -26,91 +32,64 @@ function _interopNamespace(e) {
|
|
|
26
32
|
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
27
33
|
Object.defineProperty(n, k, d.get ? d : {
|
|
28
34
|
enumerable: true,
|
|
29
|
-
get: function () {
|
|
30
|
-
return e[k];
|
|
31
|
-
}
|
|
35
|
+
get: function () { return e[k]; }
|
|
32
36
|
});
|
|
33
37
|
}
|
|
34
38
|
});
|
|
35
39
|
}
|
|
36
|
-
n[
|
|
40
|
+
n["default"] = e;
|
|
37
41
|
return Object.freeze(n);
|
|
38
42
|
}
|
|
39
43
|
|
|
40
44
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
41
|
-
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
42
45
|
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
43
46
|
var resolve__namespace = /*#__PURE__*/_interopNamespace(resolve);
|
|
44
47
|
|
|
45
|
-
|
|
48
|
+
const _excluded = ["uuid", "plugins", "rows", "columns", "renderers"];
|
|
46
49
|
|
|
47
50
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
48
51
|
|
|
49
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default[
|
|
50
|
-
|
|
52
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
53
|
+
const IS_INTERNET_EXPLORER = utils.isInternetExplorer(); // TODO: Reuse createDataInstance for the grid the same
|
|
51
54
|
// way as the list does ex: packages/ds-shared/src/useDataList/useDataList.js
|
|
52
55
|
// eslint-disable-next-line max-statements
|
|
53
56
|
|
|
54
57
|
function useDataGrid(_ref) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
setHasScroll = _useState4[1];
|
|
80
|
-
|
|
81
|
-
var _useState5 = React.useState(false),
|
|
82
|
-
_useState6 = _slicedToArray__default['default'](_useState5, 2),
|
|
83
|
-
isRowDragging = _useState6[0],
|
|
84
|
-
setIsRowDragging = _useState6[1];
|
|
85
|
-
|
|
86
|
-
var isScrolling = React.useRef();
|
|
87
|
-
var shouldRefocus = React.useRef(); // todo: we probably need a plugin for focus related stuff
|
|
88
|
-
|
|
89
|
-
var _useState7 = React.useState(function () {
|
|
90
|
-
return new useDataGrid_VolatileRowsListener();
|
|
91
|
-
}),
|
|
92
|
-
_useState8 = _slicedToArray__default['default'](_useState7, 1),
|
|
93
|
-
RowsObserver = _useState8[0]; // todo move this with rows composition
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
var _useDerivedStateFromP = dsUtilities.useDerivedStateFromProps(rows, {
|
|
58
|
+
let {
|
|
59
|
+
uuid: uuidProp,
|
|
60
|
+
plugins: pluginsFromProps,
|
|
61
|
+
rows,
|
|
62
|
+
columns,
|
|
63
|
+
renderers = {}
|
|
64
|
+
} = _ref,
|
|
65
|
+
props = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
66
|
+
|
|
67
|
+
const plugins = pluginsFromProps;
|
|
68
|
+
const instance = React.useRef();
|
|
69
|
+
const tableRef = React.useRef();
|
|
70
|
+
const headerRef = React.useRef();
|
|
71
|
+
const bodyRef = React.useRef();
|
|
72
|
+
const bodyInnerRef = React.useRef();
|
|
73
|
+
const [uuid$1] = React.useState(uuidProp || (() => uuid.v4()));
|
|
74
|
+
const [hasScroll, setHasScroll] = React.useState(false);
|
|
75
|
+
const [isRowDragging, setIsRowDragging] = React.useState(false);
|
|
76
|
+
const isScrolling = React.useRef();
|
|
77
|
+
const shouldRefocus = React.useRef(); // todo: we probably need a plugin for focus related stuff
|
|
78
|
+
|
|
79
|
+
const [RowsObserver] = React.useState(() => new VolatileRowsListener()); // todo move this with rows composition
|
|
80
|
+
|
|
81
|
+
const [originalRows, updateRows] = dsUtilities.useDerivedStateFromProps(rows, {
|
|
97
82
|
onUpdate: resolve__namespace.resolve({
|
|
98
|
-
columns
|
|
99
|
-
method:
|
|
100
|
-
return dsUtilities.compose(resolve__namespace.byFunction('valueTransformation')(extra), resolve__namespace.nested(extra));
|
|
101
|
-
}
|
|
83
|
+
columns,
|
|
84
|
+
method: extra => dsUtilities.compose(resolve__namespace.byFunction('valueTransformation')(extra), resolve__namespace.nested(extra))
|
|
102
85
|
}),
|
|
103
86
|
updateOnStateChange: true
|
|
104
|
-
})
|
|
105
|
-
_useDerivedStateFromP2 = _slicedToArray__default['default'](_useDerivedStateFromP, 2),
|
|
106
|
-
originalRows = _useDerivedStateFromP2[0],
|
|
107
|
-
updateRows = _useDerivedStateFromP2[1];
|
|
108
|
-
|
|
87
|
+
});
|
|
109
88
|
instance.current = {
|
|
110
89
|
decoratedRenderers: dsUtilities.cloneDeep(renderers),
|
|
111
90
|
decoratedColumns: columns,
|
|
112
|
-
columns
|
|
113
|
-
rows
|
|
91
|
+
columns,
|
|
92
|
+
rows,
|
|
114
93
|
composedRows: originalRows,
|
|
115
94
|
getRowProps: [],
|
|
116
95
|
getHeaderRowProps: [],
|
|
@@ -118,7 +97,7 @@ function useDataGrid(_ref) {
|
|
|
118
97
|
getTableProps: [],
|
|
119
98
|
effects: [],
|
|
120
99
|
uuid: uuid$1,
|
|
121
|
-
props
|
|
100
|
+
props,
|
|
122
101
|
refs: {
|
|
123
102
|
table: tableRef,
|
|
124
103
|
body: bodyRef,
|
|
@@ -126,54 +105,40 @@ function useDataGrid(_ref) {
|
|
|
126
105
|
innerBody: bodyInnerRef
|
|
127
106
|
},
|
|
128
107
|
state: {
|
|
129
|
-
hasScroll
|
|
108
|
+
hasScroll
|
|
130
109
|
},
|
|
131
110
|
actions: {
|
|
132
|
-
updateRows
|
|
111
|
+
updateRows
|
|
133
112
|
},
|
|
134
|
-
updateRows
|
|
113
|
+
updateRows,
|
|
135
114
|
// eslint-disable-next-line no-return-assign
|
|
136
|
-
enableEvents:
|
|
137
|
-
return document.body.style.pointerEvents = IS_INTERNET_EXPLORER ? '' : null;
|
|
138
|
-
},
|
|
115
|
+
enableEvents: () => document.body.style.pointerEvents = IS_INTERNET_EXPLORER ? '' : null,
|
|
139
116
|
// eslint-disable-next-line no-return-assign
|
|
140
|
-
disableEvents:
|
|
141
|
-
|
|
142
|
-
},
|
|
143
|
-
observeRows: function observeRows(observer) {
|
|
144
|
-
return RowsObserver.observe(observer);
|
|
145
|
-
},
|
|
117
|
+
disableEvents: () => document.body.style.pointerEvents = 'none',
|
|
118
|
+
observeRows: observer => RowsObserver.observe(observer),
|
|
146
119
|
hotKeys: {},
|
|
147
|
-
shouldRefocus
|
|
148
|
-
isScrolling
|
|
149
|
-
setHasScroll
|
|
150
|
-
setIsRowDragging
|
|
151
|
-
isRowDragging
|
|
152
|
-
plugins
|
|
120
|
+
shouldRefocus,
|
|
121
|
+
isScrolling,
|
|
122
|
+
setHasScroll,
|
|
123
|
+
setIsRowDragging,
|
|
124
|
+
isRowDragging,
|
|
125
|
+
plugins
|
|
153
126
|
};
|
|
154
127
|
|
|
155
|
-
instance.current.getState =
|
|
156
|
-
return instance.current.state;
|
|
157
|
-
};
|
|
128
|
+
instance.current.getState = () => instance.current.state;
|
|
158
129
|
|
|
159
|
-
instance.current.getInstance =
|
|
160
|
-
return instance.current;
|
|
161
|
-
};
|
|
130
|
+
instance.current.getInstance = () => instance.current;
|
|
162
131
|
|
|
163
|
-
|
|
132
|
+
const defaultDecorators = {
|
|
164
133
|
decorateGrid: [],
|
|
165
134
|
registerStateHook: [],
|
|
166
135
|
registerHotKeys: [],
|
|
167
136
|
decorateColumn: [],
|
|
168
|
-
decorateColumns: [
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
normalize: props.normalizeDataKeys
|
|
174
|
-
})(col);
|
|
175
|
-
});
|
|
176
|
-
}],
|
|
137
|
+
decorateColumns: [cols => cols.map(col => initColumnDefinition["default"]({
|
|
138
|
+
useTextTruncation: col.useTextTruncation,
|
|
139
|
+
wrapText: props.wrapText,
|
|
140
|
+
normalize: props.normalizeDataKeys
|
|
141
|
+
})(col))],
|
|
177
142
|
decorateRenderers: [],
|
|
178
143
|
getRowProps: [],
|
|
179
144
|
getHeaderRowProps: [],
|
|
@@ -182,42 +147,42 @@ function useDataGrid(_ref) {
|
|
|
182
147
|
getHeaderProps: [],
|
|
183
148
|
composeRows: []
|
|
184
149
|
};
|
|
185
|
-
|
|
186
|
-
|
|
150
|
+
const decorators = React.useMemo(() => {
|
|
151
|
+
let nextDecorators = defaultDecorators; // eslint-disable-next-line no-return-assign
|
|
187
152
|
|
|
188
|
-
plugins.forEach(
|
|
189
|
-
return nextDecorators = plugin(nextDecorators);
|
|
190
|
-
});
|
|
153
|
+
plugins.forEach(plugin => nextDecorators = plugin(nextDecorators));
|
|
191
154
|
return nextDecorators;
|
|
192
155
|
}, [plugins]);
|
|
193
|
-
instance.current = decorators.decorateGrid.reduce(
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
actions = _decorator.actions;
|
|
200
|
-
|
|
156
|
+
instance.current = decorators.decorateGrid.reduce((nextInstance, decorator) => _objectSpread(_objectSpread({}, nextInstance), decorator(instance.current)), instance.current);
|
|
157
|
+
instance.current = decorators.registerStateHook.reduce((nextInstance, decorator) => {
|
|
158
|
+
const {
|
|
159
|
+
state,
|
|
160
|
+
actions
|
|
161
|
+
} = decorator(instance.current);
|
|
201
162
|
return _objectSpread(_objectSpread({}, nextInstance), {}, {
|
|
202
163
|
state: _objectSpread(_objectSpread({}, nextInstance.state), state),
|
|
203
164
|
actions: _objectSpread(_objectSpread({}, nextInstance.actions), actions)
|
|
204
165
|
});
|
|
205
166
|
}, instance.current);
|
|
206
167
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
168
|
+
const reduceHotKey = (nextInstance, _ref2) => {
|
|
169
|
+
let {
|
|
170
|
+
key,
|
|
171
|
+
handler,
|
|
172
|
+
options
|
|
173
|
+
} = _ref2;
|
|
211
174
|
return _objectSpread(_objectSpread({}, nextInstance), {}, {
|
|
212
|
-
hotKeys: _objectSpread(_objectSpread({}, nextInstance.hotKeys), {},
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
175
|
+
hotKeys: _objectSpread(_objectSpread({}, nextInstance.hotKeys), {}, {
|
|
176
|
+
[key]: {
|
|
177
|
+
handler,
|
|
178
|
+
options
|
|
179
|
+
}
|
|
180
|
+
})
|
|
216
181
|
});
|
|
217
182
|
};
|
|
218
183
|
|
|
219
|
-
instance.current = decorators.registerHotKeys.reduce(
|
|
220
|
-
|
|
184
|
+
instance.current = decorators.registerHotKeys.reduce((nextInstance, decorator) => {
|
|
185
|
+
const hotKeys = decorator(nextInstance);
|
|
221
186
|
|
|
222
187
|
if (Array.isArray(hotKeys)) {
|
|
223
188
|
return hotKeys.reduce(reduceHotKey, nextInstance);
|
|
@@ -225,24 +190,20 @@ function useDataGrid(_ref) {
|
|
|
225
190
|
|
|
226
191
|
return reduceHotKey(nextInstance, hotKeys);
|
|
227
192
|
}, instance.current);
|
|
228
|
-
instance.current.decoratedRenderers =
|
|
229
|
-
instance.current.decoratedColumns = React.useMemo(
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
});
|
|
233
|
-
return visibleColumns.length ? createDataInstance_utils.decorateColumns(visibleColumns, decorators, instance.current) : [];
|
|
193
|
+
instance.current.decoratedRenderers = utils$1.applyDecorators(instance.current.decoratedRenderers, decorators.decorateRenderers, instance.current);
|
|
194
|
+
instance.current.decoratedColumns = React.useMemo(() => {
|
|
195
|
+
const visibleColumns = dsUtilities.cloneDeep(columns).filter(column => typeof column.visible === 'undefined' || column.visible);
|
|
196
|
+
return visibleColumns.length ? utils$1.decorateColumns(visibleColumns, decorators, instance.current) : [];
|
|
234
197
|
}, [columns]);
|
|
235
|
-
instance.current.getBodyProps =
|
|
236
|
-
instance.current.getHeaderProps =
|
|
237
|
-
instance.current.getRowProps =
|
|
238
|
-
instance.current.getHeaderRowProps =
|
|
239
|
-
instance.current.getTableProps =
|
|
240
|
-
instance.current.composedRows = decorators.composeRows.reduce(
|
|
241
|
-
return getter(nextRows, instance.current);
|
|
242
|
-
}, instance.current.composedRows);
|
|
198
|
+
instance.current.getBodyProps = utils$1.reducePropsGetter(decorators.getBodyProps, instance.current);
|
|
199
|
+
instance.current.getHeaderProps = utils$1.reducePropsGetter(decorators.getHeaderProps, instance.current);
|
|
200
|
+
instance.current.getRowProps = utils$1.reducePropsGetter(decorators.getRowProps, instance.current);
|
|
201
|
+
instance.current.getHeaderRowProps = utils$1.reducePropsGetter(decorators.getHeaderRowProps, instance.current);
|
|
202
|
+
instance.current.getTableProps = utils$1.reducePropsGetter(decorators.getTableProps, instance.current);
|
|
203
|
+
instance.current.composedRows = decorators.composeRows.reduce((nextRows, getter) => getter(nextRows, instance.current), instance.current.composedRows);
|
|
243
204
|
RowsObserver.notify(instance.current.composedRows);
|
|
244
|
-
|
|
245
|
-
|
|
205
|
+
const currentShouldRefocus = instance.current.shouldRefocus.current;
|
|
206
|
+
const prevState = dsUtilities.usePrevious(instance.current.state);
|
|
246
207
|
|
|
247
208
|
if (dsUtilities.isObject(currentShouldRefocus) && currentShouldRefocus.forced) {
|
|
248
209
|
instance.current.shouldRefocus.current = currentShouldRefocus.value;
|
|
@@ -252,9 +213,8 @@ function useDataGrid(_ref) {
|
|
|
252
213
|
|
|
253
214
|
if (props.instanceRef) dsUtilities.setRef(props.instanceRef, instance.current);
|
|
254
215
|
return _objectSpread(_objectSpread({}, instance.current), {}, {
|
|
255
|
-
decorators
|
|
216
|
+
decorators
|
|
256
217
|
});
|
|
257
218
|
}
|
|
258
219
|
|
|
259
220
|
module.exports = useDataGrid;
|
|
260
|
-
//# sourceMappingURL=useDataGrid.js.map
|
package/cjs/useDataList/index.js
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('@babel/runtime/helpers/toConsumableArray');
|
|
5
|
-
require('@babel/runtime/helpers/defineProperty');
|
|
6
|
-
require('@babel/runtime/helpers/objectWithoutProperties');
|
|
7
|
-
require('react');
|
|
8
|
-
require('@elliemae/ds-utilities');
|
|
9
|
-
require('lodash/get');
|
|
10
|
-
require('../createDataInstance/utils.js');
|
|
11
|
-
require('./recordIterator.js');
|
|
12
|
-
require('../createDataInstance/createInstanceRef.js');
|
|
13
|
-
require('@babel/runtime/helpers/slicedToArray');
|
|
14
|
-
require('uuid');
|
|
15
|
-
require('lodash');
|
|
3
|
+
var useDataList = require('./useDataList.js');
|
|
16
4
|
|
|
17
5
|
|
|
18
6
|
|
|
19
|
-
module.exports =
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
|
7
|
+
module.exports = useDataList["default"];
|