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