@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,117 +1,74 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
|
|
5
|
-
var _createClass = require('@babel/runtime/helpers/createClass');
|
|
6
|
-
var _assertThisInitialized = require('@babel/runtime/helpers/assertThisInitialized');
|
|
7
|
-
var _inherits = require('@babel/runtime/helpers/inherits');
|
|
8
|
-
var _possibleConstructorReturn = require('@babel/runtime/helpers/possibleConstructorReturn');
|
|
9
|
-
var _getPrototypeOf = require('@babel/runtime/helpers/getPrototypeOf');
|
|
3
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
10
4
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
5
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
11
6
|
var React = require('react');
|
|
12
|
-
var
|
|
7
|
+
var ScrollSync = require('./ScrollSync.js');
|
|
8
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
13
9
|
|
|
14
10
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
11
|
|
|
16
|
-
var
|
|
17
|
-
var _classCallCheck__default = /*#__PURE__*/_interopDefaultLegacy(_classCallCheck);
|
|
18
|
-
var _createClass__default = /*#__PURE__*/_interopDefaultLegacy(_createClass);
|
|
19
|
-
var _assertThisInitialized__default = /*#__PURE__*/_interopDefaultLegacy(_assertThisInitialized);
|
|
20
|
-
var _inherits__default = /*#__PURE__*/_interopDefaultLegacy(_inherits);
|
|
21
|
-
var _possibleConstructorReturn__default = /*#__PURE__*/_interopDefaultLegacy(_possibleConstructorReturn);
|
|
22
|
-
var _getPrototypeOf__default = /*#__PURE__*/_interopDefaultLegacy(_getPrototypeOf);
|
|
12
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
23
13
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
24
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
25
14
|
|
|
26
|
-
function
|
|
15
|
+
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; }
|
|
27
16
|
|
|
28
|
-
function
|
|
29
|
-
/**
|
|
30
|
-
* MODIFIED FROM react-scroll-sync
|
|
31
|
-
*
|
|
32
|
-
* ScrollSyncPane Component
|
|
33
|
-
*
|
|
34
|
-
* Wrap your content in it to keep its scroll position in sync with other panes
|
|
35
|
-
*
|
|
36
|
-
* @param groups
|
|
37
|
-
* @example ./example.md
|
|
38
|
-
*/
|
|
17
|
+
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; }
|
|
39
18
|
|
|
40
|
-
|
|
41
|
-
|
|
19
|
+
class ScrollSyncPane extends React.Component {
|
|
20
|
+
constructor(...args) {
|
|
21
|
+
super(...args);
|
|
42
22
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
function ScrollSyncPane() {
|
|
46
|
-
var _this;
|
|
47
|
-
|
|
48
|
-
_classCallCheck__default['default'](this, ScrollSyncPane);
|
|
49
|
-
|
|
50
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
51
|
-
args[_key] = arguments[_key];
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
55
|
-
|
|
56
|
-
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "toArray", function (groups) {
|
|
57
|
-
return [].concat(groups);
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
return _this;
|
|
23
|
+
_defineProperty__default["default"](this, "toArray", groups => [].concat(groups));
|
|
61
24
|
}
|
|
62
25
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
key: "render",
|
|
75
|
-
value: function render() {
|
|
76
|
-
var _this2 = this;
|
|
77
|
-
|
|
78
|
-
var _this$props2 = this.props,
|
|
79
|
-
children = _this$props2.children,
|
|
80
|
-
group = _this$props2.group,
|
|
81
|
-
syncContext = _this$props2.syncContext,
|
|
82
|
-
notPaginated = _this$props2.notPaginated;
|
|
83
|
-
var _registerPane = syncContext.registerPane;
|
|
84
|
-
return children({
|
|
85
|
-
registerPane: function registerPane(node) {
|
|
86
|
-
if (notPaginated) {
|
|
87
|
-
var virtualizedBody = node.querySelector('.virtualized-body-wrapper');
|
|
26
|
+
componentWillUnmount() {
|
|
27
|
+
const {
|
|
28
|
+
enabled,
|
|
29
|
+
group,
|
|
30
|
+
syncContext
|
|
31
|
+
} = this.props;
|
|
32
|
+
const {
|
|
33
|
+
unregisterPane
|
|
34
|
+
} = syncContext;
|
|
35
|
+
if (enabled) unregisterPane(this.node, this.toArray(group));
|
|
36
|
+
}
|
|
88
37
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
38
|
+
render() {
|
|
39
|
+
const {
|
|
40
|
+
children,
|
|
41
|
+
group,
|
|
42
|
+
syncContext,
|
|
43
|
+
notPaginated
|
|
44
|
+
} = this.props;
|
|
45
|
+
const {
|
|
46
|
+
registerPane
|
|
47
|
+
} = syncContext;
|
|
48
|
+
return children({
|
|
49
|
+
registerPane: node => {
|
|
50
|
+
if (notPaginated) {
|
|
51
|
+
const virtualizedBody = node.querySelector('.virtualized-body-wrapper');
|
|
52
|
+
|
|
53
|
+
if (virtualizedBody) {
|
|
54
|
+
registerPane(virtualizedBody, this.toArray(group));
|
|
92
55
|
}
|
|
93
|
-
|
|
94
|
-
return _registerPane(node, _this2.toArray(group));
|
|
95
56
|
}
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
}]);
|
|
99
57
|
|
|
100
|
-
|
|
101
|
-
}
|
|
58
|
+
return registerPane(node, this.toArray(group));
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
}
|
|
102
64
|
|
|
103
|
-
_defineProperty__default[
|
|
65
|
+
_defineProperty__default["default"](ScrollSyncPane, "defaultProps", {
|
|
104
66
|
group: 'default',
|
|
105
67
|
enabled: true
|
|
106
68
|
});
|
|
107
69
|
|
|
108
|
-
var ScrollSyncPane$1 = (
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
syncContext: context
|
|
112
|
-
}));
|
|
113
|
-
});
|
|
114
|
-
});
|
|
70
|
+
var ScrollSyncPane$1 = (props => /*#__PURE__*/_jsx__default["default"](ScrollSync.ScrollSyncContext.Consumer, {}, void 0, context => /*#__PURE__*/jsxRuntime.jsx(ScrollSyncPane, _objectSpread(_objectSpread({}, props), {}, {
|
|
71
|
+
syncContext: context
|
|
72
|
+
}))));
|
|
115
73
|
|
|
116
74
|
module.exports = ScrollSyncPane$1;
|
|
117
|
-
//# sourceMappingURL=ScrollSyncPane.js.map
|
|
@@ -1,42 +1,48 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
3
4
|
var React = require('react');
|
|
4
5
|
var raf = require('raf');
|
|
5
6
|
|
|
6
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
7
8
|
|
|
9
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
8
10
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
9
11
|
var raf__default = /*#__PURE__*/_interopDefaultLegacy(raf);
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
const ScrollSyncContext = /*#__PURE__*/React__default["default"].createContext();
|
|
14
|
+
const {
|
|
15
|
+
Provider
|
|
16
|
+
} = ScrollSyncContext;
|
|
17
|
+
|
|
18
|
+
function ScrollSyncProvider({
|
|
19
|
+
enabled,
|
|
20
|
+
horizontal,
|
|
21
|
+
vertical,
|
|
22
|
+
children
|
|
23
|
+
}) {
|
|
21
24
|
useRef();
|
|
22
25
|
|
|
23
|
-
raf__default[
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
raf__default["default"]((scrolledPane, pane) => {
|
|
27
|
+
const {
|
|
28
|
+
scrollTop,
|
|
29
|
+
scrollHeight,
|
|
30
|
+
clientHeight,
|
|
31
|
+
scrollLeft,
|
|
32
|
+
scrollWidth,
|
|
33
|
+
clientWidth
|
|
34
|
+
} = scrolledPane;
|
|
35
|
+
const scrollTopOffset = scrollHeight - clientHeight;
|
|
36
|
+
const scrollLeftOffset = scrollWidth - clientWidth;
|
|
37
|
+
const {
|
|
38
|
+
proportional,
|
|
39
|
+
vertical,
|
|
40
|
+
horizontal
|
|
41
|
+
} = this.props;
|
|
36
42
|
/* Calculate the actual pane height */
|
|
37
43
|
|
|
38
|
-
|
|
39
|
-
|
|
44
|
+
const paneHeight = pane.scrollHeight - clientHeight;
|
|
45
|
+
const paneWidth = pane.scrollWidth - clientWidth;
|
|
40
46
|
/* Adjust the scrollTop position of it accordingly */
|
|
41
47
|
|
|
42
48
|
if (vertical && scrollTopOffset > 0) {
|
|
@@ -47,11 +53,9 @@ function ScrollSyncProvider(_ref) {
|
|
|
47
53
|
pane.scrollLeft = proportional ? paneWidth * scrollLeft / scrollLeftOffset : scrollLeft; // eslint-disable-line
|
|
48
54
|
}
|
|
49
55
|
});
|
|
50
|
-
return /*#__PURE__*/
|
|
56
|
+
return /*#__PURE__*/_jsx__default["default"](Provider, {}, void 0, children);
|
|
51
57
|
}
|
|
52
58
|
|
|
53
|
-
ScrollSyncProvider.propTypes = {};
|
|
54
59
|
ScrollSyncProvider.defaultProps = {};
|
|
55
60
|
|
|
56
61
|
module.exports = ScrollSyncProvider;
|
|
57
|
-
//# sourceMappingURL=ScrollSyncProvider.js.map
|
package/cjs/ScrollSync/index.js
CHANGED
|
@@ -2,20 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
require('@babel/runtime/helpers/classCallCheck');
|
|
8
|
-
require('@babel/runtime/helpers/createClass');
|
|
9
|
-
require('@babel/runtime/helpers/assertThisInitialized');
|
|
10
|
-
require('@babel/runtime/helpers/inherits');
|
|
11
|
-
require('@babel/runtime/helpers/possibleConstructorReturn');
|
|
12
|
-
require('@babel/runtime/helpers/getPrototypeOf');
|
|
13
|
-
require('@babel/runtime/helpers/defineProperty');
|
|
14
|
-
require('react');
|
|
15
|
-
require('@babel/runtime/helpers/extends');
|
|
5
|
+
var ScrollSync = require('./ScrollSync.js');
|
|
6
|
+
var ScrollSyncPane = require('./ScrollSyncPane.js');
|
|
16
7
|
|
|
17
8
|
|
|
18
9
|
|
|
19
|
-
exports.ScrollSync =
|
|
20
|
-
exports.ScrollSyncPane =
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
|
10
|
+
exports.ScrollSync = ScrollSync["default"];
|
|
11
|
+
exports.ScrollSyncPane = ScrollSyncPane;
|
package/cjs/constants.js
CHANGED
|
@@ -2,11 +2,50 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
const DEFAULT_DELAY_OPEN = 200;
|
|
6
|
+
const DEFAULT_DELAY_CLOSE = 300;
|
|
7
|
+
const sizeOptions = ['small', 'medium', 'large', 'x-large'];
|
|
8
|
+
const AM = 'am';
|
|
9
|
+
const PM = 'pm';
|
|
10
|
+
const ARROW_UP = 'ArrowUp';
|
|
11
|
+
const ARROW_DOWN = 'ArrowDown';
|
|
12
|
+
const BACKSPACE = 'Backspace';
|
|
13
|
+
const ESCAPE = 'Escape';
|
|
14
|
+
const HOME = 'Home';
|
|
15
|
+
const SHIFT = 'Shift';
|
|
16
|
+
const END = 'End';
|
|
17
|
+
const HOUR_RANGE_12 = {
|
|
18
|
+
min: 0,
|
|
19
|
+
max: 12
|
|
20
|
+
};
|
|
21
|
+
const HOUR_RANGE_24 = {
|
|
22
|
+
min: 0,
|
|
23
|
+
max: 24
|
|
24
|
+
};
|
|
25
|
+
const GENERAL_TIME_RANGE = {
|
|
26
|
+
min: 0,
|
|
27
|
+
max: 59
|
|
28
|
+
};
|
|
29
|
+
const PLACEHOLDER_TIME = {
|
|
30
|
+
hour: 'hour',
|
|
31
|
+
minutes: 'minutes',
|
|
32
|
+
seconds: 'seconds',
|
|
33
|
+
meridiem: 'meridiem'
|
|
34
|
+
};
|
|
8
35
|
|
|
36
|
+
exports.AM = AM;
|
|
37
|
+
exports.ARROW_DOWN = ARROW_DOWN;
|
|
38
|
+
exports.ARROW_UP = ARROW_UP;
|
|
39
|
+
exports.BACKSPACE = BACKSPACE;
|
|
9
40
|
exports.DEFAULT_DELAY_CLOSE = DEFAULT_DELAY_CLOSE;
|
|
10
41
|
exports.DEFAULT_DELAY_OPEN = DEFAULT_DELAY_OPEN;
|
|
42
|
+
exports.END = END;
|
|
43
|
+
exports.ESCAPE = ESCAPE;
|
|
44
|
+
exports.GENERAL_TIME_RANGE = GENERAL_TIME_RANGE;
|
|
45
|
+
exports.HOME = HOME;
|
|
46
|
+
exports.HOUR_RANGE_12 = HOUR_RANGE_12;
|
|
47
|
+
exports.HOUR_RANGE_24 = HOUR_RANGE_24;
|
|
48
|
+
exports.PLACEHOLDER_TIME = PLACEHOLDER_TIME;
|
|
49
|
+
exports.PM = PM;
|
|
50
|
+
exports.SHIFT = SHIFT;
|
|
11
51
|
exports.sizeOptions = sizeOptions;
|
|
12
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
4
3
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
5
5
|
|
|
6
6
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
7
7
|
|
|
8
|
-
var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray);
|
|
9
8
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
10
9
|
|
|
11
10
|
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; }
|
|
12
11
|
|
|
13
|
-
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[
|
|
12
|
+
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; }
|
|
14
13
|
|
|
15
14
|
function getDecoratorsFromHooks(hooks, decorators) {
|
|
16
|
-
|
|
15
|
+
const nextDecorators = _objectSpread({}, decorators);
|
|
17
16
|
|
|
18
|
-
Object.keys(hooks).forEach(
|
|
17
|
+
Object.keys(hooks).forEach(decorator => {
|
|
19
18
|
if (Array.isArray(decorators[decorator])) {
|
|
20
|
-
nextDecorators[decorator] = [
|
|
19
|
+
nextDecorators[decorator] = [...decorators[decorator], hooks[decorator]];
|
|
21
20
|
} else {
|
|
22
21
|
nextDecorators[decorator] = hooks[decorator];
|
|
23
22
|
}
|
|
@@ -26,10 +25,7 @@ function getDecoratorsFromHooks(hooks, decorators) {
|
|
|
26
25
|
}
|
|
27
26
|
|
|
28
27
|
function createInstancePlugin(name, hooks) {
|
|
29
|
-
return
|
|
30
|
-
return getDecoratorsFromHooks(hooks, decorators);
|
|
31
|
-
};
|
|
28
|
+
return decorators => getDecoratorsFromHooks(hooks, decorators);
|
|
32
29
|
}
|
|
33
30
|
|
|
34
31
|
module.exports = createInstancePlugin;
|
|
35
|
-
//# sourceMappingURL=createInstancePlugin.js.map
|
|
@@ -1,25 +1,24 @@
|
|
|
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
6
|
var uuid = require('uuid');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var lodash = require('lodash');
|
|
9
|
-
var
|
|
9
|
+
var utils = require('./utils.js');
|
|
10
10
|
|
|
11
11
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
12
|
|
|
13
13
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
14
|
-
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
15
14
|
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
16
15
|
|
|
17
|
-
|
|
16
|
+
const _excluded = ["uuid", "data", "renderers", "plugins", "customDecorators"];
|
|
18
17
|
|
|
19
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; }
|
|
20
19
|
|
|
21
|
-
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[
|
|
22
|
-
|
|
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; }
|
|
21
|
+
const defaultDecorators = {
|
|
23
22
|
instance: [],
|
|
24
23
|
state: [],
|
|
25
24
|
hotKeys: [],
|
|
@@ -27,22 +26,19 @@ var defaultDecorators = {
|
|
|
27
26
|
composeData: []
|
|
28
27
|
};
|
|
29
28
|
function createDataInstanceRef(_ref) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
let {
|
|
30
|
+
uuid: uuidProp,
|
|
31
|
+
data,
|
|
32
|
+
renderers,
|
|
33
|
+
plugins,
|
|
34
|
+
customDecorators
|
|
35
|
+
} = _ref,
|
|
36
|
+
props = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
36
37
|
|
|
37
38
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
var _useState = React.useState(uuidProp || function () {
|
|
41
|
-
return uuid.v4();
|
|
42
|
-
}),
|
|
43
|
-
_useState2 = _slicedToArray__default['default'](_useState, 1),
|
|
44
|
-
uuid$1 = _useState2[0];
|
|
39
|
+
const instance = React.useRef(); // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
45
40
|
|
|
41
|
+
const [uuid$1] = React.useState(uuidProp || (() => uuid.v4()));
|
|
46
42
|
instance.current = {
|
|
47
43
|
uuid: uuid$1,
|
|
48
44
|
state: {},
|
|
@@ -52,47 +48,43 @@ function createDataInstanceRef(_ref) {
|
|
|
52
48
|
originalData: data,
|
|
53
49
|
records: [],
|
|
54
50
|
// item abstraction with meta data for originalData
|
|
55
|
-
renderers
|
|
56
|
-
|
|
51
|
+
renderers,
|
|
52
|
+
|
|
53
|
+
ref(key) {
|
|
57
54
|
// eslint-disable-next-line no-return-assign
|
|
58
|
-
return
|
|
59
|
-
return instance.current.refs[key] = node;
|
|
60
|
-
};
|
|
55
|
+
return node => instance.current.refs[key] = node;
|
|
61
56
|
},
|
|
62
|
-
|
|
57
|
+
|
|
58
|
+
getInstance() {
|
|
63
59
|
return instance.current;
|
|
64
60
|
},
|
|
65
|
-
|
|
61
|
+
|
|
62
|
+
props
|
|
66
63
|
}; // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
67
64
|
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
const decorators = React.useMemo(() => {
|
|
66
|
+
let nextDecorators = _objectSpread(_objectSpread({}, defaultDecorators), customDecorators);
|
|
70
67
|
|
|
71
|
-
plugins.forEach(
|
|
68
|
+
plugins.forEach(plugin => {
|
|
72
69
|
if (!plugin) return;
|
|
73
70
|
nextDecorators = plugin(nextDecorators);
|
|
74
71
|
});
|
|
75
|
-
Object.keys(nextDecorators).forEach(
|
|
76
|
-
if (Array.isArray(nextDecorators[key])) nextDecorators[key] = lodash.orderBy(nextDecorators[key],
|
|
77
|
-
return item.order;
|
|
78
|
-
});
|
|
72
|
+
Object.keys(nextDecorators).forEach(key => {
|
|
73
|
+
if (Array.isArray(nextDecorators[key])) nextDecorators[key] = lodash.orderBy(nextDecorators[key], item => item.order);
|
|
79
74
|
});
|
|
80
75
|
return nextDecorators;
|
|
81
76
|
}, []); // the plugins are defined on creation, but not changed at runtime
|
|
82
77
|
// todo: test if getting the hooks without registering them
|
|
83
78
|
// here would be beneficial to memoize instance and squeeze performance
|
|
84
79
|
|
|
85
|
-
instance.current = decorators.instance.reduce(
|
|
86
|
-
instance.current = decorators.state.reduce(
|
|
87
|
-
instance.current = decorators.hotKeys.reduce(
|
|
88
|
-
instance.current.renderers = decorators.renderers.reduce(
|
|
89
|
-
return decorator(result, instance.current);
|
|
90
|
-
}, renderers);
|
|
80
|
+
instance.current = decorators.instance.reduce(utils.mergeInstance, instance.current);
|
|
81
|
+
instance.current = decorators.state.reduce(utils.registerStateHookToInstance, instance.current);
|
|
82
|
+
instance.current = decorators.hotKeys.reduce(utils.registerHotKeysHookToInstance, instance.current);
|
|
83
|
+
instance.current.renderers = decorators.renderers.reduce((result, decorator) => decorator(result, instance.current), renderers);
|
|
91
84
|
return {
|
|
92
|
-
instance
|
|
93
|
-
decorators
|
|
85
|
+
instance,
|
|
86
|
+
decorators
|
|
94
87
|
};
|
|
95
88
|
}
|
|
96
89
|
|
|
97
90
|
module.exports = createDataInstanceRef;
|
|
98
|
-
//# sourceMappingURL=createInstanceRef.js.map
|