@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,155 +1,135 @@
|
|
|
1
|
-
import
|
|
2
|
-
import _createClass from '@babel/runtime/helpers/esm/createClass';
|
|
3
|
-
import _assertThisInitialized from '@babel/runtime/helpers/esm/assertThisInitialized';
|
|
4
|
-
import _inherits from '@babel/runtime/helpers/esm/inherits';
|
|
5
|
-
import _possibleConstructorReturn from '@babel/runtime/helpers/esm/possibleConstructorReturn';
|
|
6
|
-
import _getPrototypeOf from '@babel/runtime/helpers/esm/getPrototypeOf';
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
7
2
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
8
3
|
import React, { Component } from 'react';
|
|
9
4
|
|
|
10
|
-
|
|
5
|
+
const ScrollSyncContext = /*#__PURE__*/React.createContext();
|
|
6
|
+
const {
|
|
7
|
+
Provider
|
|
8
|
+
} = ScrollSyncContext;
|
|
9
|
+
class ScrollSync extends Component {
|
|
10
|
+
constructor(props) {
|
|
11
|
+
super(props);
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
var ScrollSyncContext = /*#__PURE__*/React.createContext();
|
|
14
|
-
var Provider = ScrollSyncContext.Provider;
|
|
13
|
+
_defineProperty(this, "panes", {});
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
function ScrollSync(props) {
|
|
22
|
-
var _this;
|
|
23
|
-
|
|
24
|
-
_classCallCheck(this, ScrollSync);
|
|
25
|
-
|
|
26
|
-
_this = _super.call(this, props);
|
|
27
|
-
|
|
28
|
-
_defineProperty(_assertThisInitialized(_this), "panes", {});
|
|
29
|
-
|
|
30
|
-
_defineProperty(_assertThisInitialized(_this), "registerPane", function (node, groups) {
|
|
31
|
-
groups.forEach(function (group) {
|
|
32
|
-
if (!_this.panes[group]) {
|
|
33
|
-
_this.panes[group] = [];
|
|
15
|
+
_defineProperty(this, "registerPane", (node, groups) => {
|
|
16
|
+
groups.forEach(group => {
|
|
17
|
+
if (!this.panes[group]) {
|
|
18
|
+
this.panes[group] = [];
|
|
34
19
|
}
|
|
35
20
|
|
|
36
|
-
if (
|
|
37
|
-
|
|
21
|
+
if (this.panes[group].length > 0) {
|
|
22
|
+
this.syncScrollPosition(this.panes[group][0], node);
|
|
38
23
|
}
|
|
39
24
|
|
|
40
|
-
|
|
25
|
+
this.panes[group].push(node);
|
|
41
26
|
});
|
|
42
|
-
|
|
43
|
-
_this.addEvents(node, groups);
|
|
27
|
+
this.addEvents(node, groups);
|
|
44
28
|
});
|
|
45
29
|
|
|
46
|
-
_defineProperty(
|
|
47
|
-
groups.forEach(
|
|
48
|
-
if (
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
_this.panes[group].splice(_this.panes[group].indexOf(node), 1);
|
|
30
|
+
_defineProperty(this, "unregisterPane", (node, groups) => {
|
|
31
|
+
groups.forEach(group => {
|
|
32
|
+
if (this.findPane(node, group)) {
|
|
33
|
+
this.removeEvents(node);
|
|
34
|
+
this.panes[group].splice(this.panes[group].indexOf(node), 1);
|
|
52
35
|
}
|
|
53
36
|
});
|
|
54
37
|
});
|
|
55
38
|
|
|
56
|
-
_defineProperty(
|
|
39
|
+
_defineProperty(this, "addEvents", (node, groups) => {
|
|
57
40
|
/* For some reason element.addEventListener doesnt work with document.body */
|
|
58
|
-
node.onscroll =
|
|
41
|
+
node.onscroll = this.handlePaneScroll.bind(this, node, groups); // eslint-disable-line
|
|
59
42
|
});
|
|
60
43
|
|
|
61
|
-
_defineProperty(
|
|
44
|
+
_defineProperty(this, "removeEvents", node => {
|
|
62
45
|
/* For some reason element.removeEventListener doesnt work with document.body */
|
|
63
46
|
node.onscroll = null; // eslint-disable-line
|
|
64
47
|
});
|
|
65
48
|
|
|
66
|
-
_defineProperty(
|
|
67
|
-
if (!
|
|
49
|
+
_defineProperty(this, "findPane", (node, group) => {
|
|
50
|
+
if (!this.panes[group]) {
|
|
68
51
|
return false;
|
|
69
52
|
}
|
|
70
53
|
|
|
71
|
-
return
|
|
72
|
-
return pane === node;
|
|
73
|
-
});
|
|
54
|
+
return this.panes[group].find(pane => pane === node);
|
|
74
55
|
});
|
|
75
56
|
|
|
76
|
-
_defineProperty(
|
|
77
|
-
|
|
78
|
-
|
|
57
|
+
_defineProperty(this, "handlePaneScroll", (node, groups, e) => {
|
|
58
|
+
const {
|
|
59
|
+
enabled
|
|
60
|
+
} = this.props;
|
|
61
|
+
if (this.props.onScroll) this.props.onScroll(e);
|
|
79
62
|
if (!enabled) return;
|
|
80
|
-
window.requestAnimationFrame(
|
|
81
|
-
|
|
63
|
+
window.requestAnimationFrame(() => {
|
|
64
|
+
this.syncScrollPositions(node, groups);
|
|
82
65
|
});
|
|
83
66
|
});
|
|
84
67
|
|
|
85
|
-
_defineProperty(
|
|
86
|
-
groups.forEach(
|
|
87
|
-
|
|
68
|
+
_defineProperty(this, "syncScrollPositions", (scrolledPane, groups) => {
|
|
69
|
+
groups.forEach(group => {
|
|
70
|
+
this.panes[group].forEach(pane => {
|
|
88
71
|
/* For all panes beside the currently scrolling one */
|
|
89
72
|
if (scrolledPane !== pane) {
|
|
90
73
|
/* Remove event listeners from the node that we'll manipulate */
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
_this.syncScrollPosition(scrolledPane, pane);
|
|
74
|
+
this.removeEvents(pane, group);
|
|
75
|
+
this.syncScrollPosition(scrolledPane, pane);
|
|
94
76
|
/* Re-attach event listeners after we're done scrolling */
|
|
95
77
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
_this.addEvents(pane, groups);
|
|
78
|
+
window.requestAnimationFrame(() => {
|
|
79
|
+
this.addEvents(pane, groups);
|
|
99
80
|
});
|
|
100
81
|
}
|
|
101
82
|
});
|
|
102
83
|
});
|
|
103
84
|
});
|
|
104
85
|
|
|
105
|
-
|
|
106
|
-
registerPane:
|
|
107
|
-
unregisterPane:
|
|
86
|
+
this.syncContext = {
|
|
87
|
+
registerPane: this.registerPane,
|
|
88
|
+
unregisterPane: this.unregisterPane
|
|
108
89
|
};
|
|
109
|
-
return _this;
|
|
110
90
|
}
|
|
111
91
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
if (horizontal && scrollLeftOffset > 0) {
|
|
138
|
-
pane.scrollLeft = proportional ? paneWidth * scrollLeft / scrollLeftOffset : scrollLeft; // eslint-disable-line
|
|
139
|
-
}
|
|
92
|
+
syncScrollPosition(scrolledPane, pane) {
|
|
93
|
+
const {
|
|
94
|
+
scrollTop,
|
|
95
|
+
scrollHeight,
|
|
96
|
+
clientHeight,
|
|
97
|
+
scrollLeft,
|
|
98
|
+
scrollWidth,
|
|
99
|
+
clientWidth
|
|
100
|
+
} = scrolledPane;
|
|
101
|
+
const scrollTopOffset = scrollHeight - clientHeight;
|
|
102
|
+
const scrollLeftOffset = scrollWidth - clientWidth;
|
|
103
|
+
const {
|
|
104
|
+
proportional,
|
|
105
|
+
vertical,
|
|
106
|
+
horizontal
|
|
107
|
+
} = this.props;
|
|
108
|
+
/* Calculate the actual pane height */
|
|
109
|
+
|
|
110
|
+
const paneHeight = pane.scrollHeight - clientHeight;
|
|
111
|
+
const paneWidth = pane.scrollWidth - clientWidth;
|
|
112
|
+
/* Adjust the scrollTop position of it accordingly */
|
|
113
|
+
|
|
114
|
+
if (vertical && scrollTopOffset > 0) {
|
|
115
|
+
pane.scrollTop = proportional ? paneHeight * scrollTop / scrollTopOffset : scrollTop; // eslint-disable-line
|
|
140
116
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
var children = this.props.children;
|
|
145
|
-
return /*#__PURE__*/React.createElement(Provider, {
|
|
146
|
-
value: this.syncContext
|
|
147
|
-
}, React.Children.only(children));
|
|
117
|
+
|
|
118
|
+
if (horizontal && scrollLeftOffset > 0) {
|
|
119
|
+
pane.scrollLeft = proportional ? paneWidth * scrollLeft / scrollLeftOffset : scrollLeft; // eslint-disable-line
|
|
148
120
|
}
|
|
149
|
-
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
render() {
|
|
124
|
+
const {
|
|
125
|
+
children
|
|
126
|
+
} = this.props;
|
|
127
|
+
return /*#__PURE__*/_jsx(Provider, {
|
|
128
|
+
value: this.syncContext
|
|
129
|
+
}, void 0, React.Children.only(children));
|
|
130
|
+
}
|
|
150
131
|
|
|
151
|
-
|
|
152
|
-
}(Component);
|
|
132
|
+
}
|
|
153
133
|
|
|
154
134
|
_defineProperty(ScrollSync, "defaultProps", {
|
|
155
135
|
proportional: true,
|
|
@@ -159,4 +139,3 @@ _defineProperty(ScrollSync, "defaultProps", {
|
|
|
159
139
|
});
|
|
160
140
|
|
|
161
141
|
export { ScrollSyncContext, ScrollSync as default };
|
|
162
|
-
//# sourceMappingURL=ScrollSync.js.map
|
|
@@ -1,103 +1,67 @@
|
|
|
1
|
-
import
|
|
2
|
-
import _classCallCheck from '@babel/runtime/helpers/esm/classCallCheck';
|
|
3
|
-
import _createClass from '@babel/runtime/helpers/esm/createClass';
|
|
4
|
-
import _assertThisInitialized from '@babel/runtime/helpers/esm/assertThisInitialized';
|
|
5
|
-
import _inherits from '@babel/runtime/helpers/esm/inherits';
|
|
6
|
-
import _possibleConstructorReturn from '@babel/runtime/helpers/esm/possibleConstructorReturn';
|
|
7
|
-
import _getPrototypeOf from '@babel/runtime/helpers/esm/getPrototypeOf';
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
8
2
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
9
|
-
import
|
|
3
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
4
|
+
import { Component } from 'react';
|
|
10
5
|
import { ScrollSyncContext } from './ScrollSync.js';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
11
7
|
|
|
12
|
-
function
|
|
8
|
+
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; }
|
|
13
9
|
|
|
14
|
-
function
|
|
15
|
-
/**
|
|
16
|
-
* MODIFIED FROM react-scroll-sync
|
|
17
|
-
*
|
|
18
|
-
* ScrollSyncPane Component
|
|
19
|
-
*
|
|
20
|
-
* Wrap your content in it to keep its scroll position in sync with other panes
|
|
21
|
-
*
|
|
22
|
-
* @param groups
|
|
23
|
-
* @example ./example.md
|
|
24
|
-
*/
|
|
10
|
+
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(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; }
|
|
25
11
|
|
|
26
|
-
|
|
27
|
-
|
|
12
|
+
class ScrollSyncPane extends Component {
|
|
13
|
+
constructor(...args) {
|
|
14
|
+
super(...args);
|
|
28
15
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
function ScrollSyncPane() {
|
|
32
|
-
var _this;
|
|
33
|
-
|
|
34
|
-
_classCallCheck(this, ScrollSyncPane);
|
|
35
|
-
|
|
36
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
37
|
-
args[_key] = arguments[_key];
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
41
|
-
|
|
42
|
-
_defineProperty(_assertThisInitialized(_this), "toArray", function (groups) {
|
|
43
|
-
return [].concat(groups);
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
return _this;
|
|
16
|
+
_defineProperty(this, "toArray", groups => [].concat(groups));
|
|
47
17
|
}
|
|
48
18
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
key: "render",
|
|
61
|
-
value: function render() {
|
|
62
|
-
var _this2 = this;
|
|
63
|
-
|
|
64
|
-
var _this$props2 = this.props,
|
|
65
|
-
children = _this$props2.children,
|
|
66
|
-
group = _this$props2.group,
|
|
67
|
-
syncContext = _this$props2.syncContext,
|
|
68
|
-
notPaginated = _this$props2.notPaginated;
|
|
69
|
-
var _registerPane = syncContext.registerPane;
|
|
70
|
-
return children({
|
|
71
|
-
registerPane: function registerPane(node) {
|
|
72
|
-
if (notPaginated) {
|
|
73
|
-
var virtualizedBody = node.querySelector('.virtualized-body-wrapper');
|
|
19
|
+
componentWillUnmount() {
|
|
20
|
+
const {
|
|
21
|
+
enabled,
|
|
22
|
+
group,
|
|
23
|
+
syncContext
|
|
24
|
+
} = this.props;
|
|
25
|
+
const {
|
|
26
|
+
unregisterPane
|
|
27
|
+
} = syncContext;
|
|
28
|
+
if (enabled) unregisterPane(this.node, this.toArray(group));
|
|
29
|
+
}
|
|
74
30
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
31
|
+
render() {
|
|
32
|
+
const {
|
|
33
|
+
children,
|
|
34
|
+
group,
|
|
35
|
+
syncContext,
|
|
36
|
+
notPaginated
|
|
37
|
+
} = this.props;
|
|
38
|
+
const {
|
|
39
|
+
registerPane
|
|
40
|
+
} = syncContext;
|
|
41
|
+
return children({
|
|
42
|
+
registerPane: node => {
|
|
43
|
+
if (notPaginated) {
|
|
44
|
+
const virtualizedBody = node.querySelector('.virtualized-body-wrapper');
|
|
45
|
+
|
|
46
|
+
if (virtualizedBody) {
|
|
47
|
+
registerPane(virtualizedBody, this.toArray(group));
|
|
78
48
|
}
|
|
79
|
-
|
|
80
|
-
return _registerPane(node, _this2.toArray(group));
|
|
81
49
|
}
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
}]);
|
|
85
50
|
|
|
86
|
-
|
|
87
|
-
}
|
|
51
|
+
return registerPane(node, this.toArray(group));
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
}
|
|
88
57
|
|
|
89
58
|
_defineProperty(ScrollSyncPane, "defaultProps", {
|
|
90
59
|
group: 'default',
|
|
91
60
|
enabled: true
|
|
92
61
|
});
|
|
93
62
|
|
|
94
|
-
var ScrollSyncPane$1 = (
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
syncContext: context
|
|
98
|
-
}));
|
|
99
|
-
});
|
|
100
|
-
});
|
|
63
|
+
var ScrollSyncPane$1 = (props => /*#__PURE__*/_jsx(ScrollSyncContext.Consumer, {}, void 0, context => /*#__PURE__*/jsx(ScrollSyncPane, _objectSpread(_objectSpread({}, props), {}, {
|
|
64
|
+
syncContext: context
|
|
65
|
+
}))));
|
|
101
66
|
|
|
102
67
|
export { ScrollSyncPane$1 as default };
|
|
103
|
-
//# sourceMappingURL=ScrollSyncPane.js.map
|
|
@@ -1,35 +1,40 @@
|
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import raf from 'raf';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
const ScrollSyncContext = /*#__PURE__*/React.createContext();
|
|
6
|
+
const {
|
|
7
|
+
Provider
|
|
8
|
+
} = ScrollSyncContext;
|
|
9
|
+
|
|
10
|
+
function ScrollSyncProvider({
|
|
11
|
+
enabled,
|
|
12
|
+
horizontal,
|
|
13
|
+
vertical,
|
|
14
|
+
children
|
|
15
|
+
}) {
|
|
14
16
|
useRef();
|
|
15
17
|
|
|
16
|
-
raf(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
raf((scrolledPane, pane) => {
|
|
19
|
+
const {
|
|
20
|
+
scrollTop,
|
|
21
|
+
scrollHeight,
|
|
22
|
+
clientHeight,
|
|
23
|
+
scrollLeft,
|
|
24
|
+
scrollWidth,
|
|
25
|
+
clientWidth
|
|
26
|
+
} = scrolledPane;
|
|
27
|
+
const scrollTopOffset = scrollHeight - clientHeight;
|
|
28
|
+
const scrollLeftOffset = scrollWidth - clientWidth;
|
|
29
|
+
const {
|
|
30
|
+
proportional,
|
|
31
|
+
vertical,
|
|
32
|
+
horizontal
|
|
33
|
+
} = this.props;
|
|
29
34
|
/* Calculate the actual pane height */
|
|
30
35
|
|
|
31
|
-
|
|
32
|
-
|
|
36
|
+
const paneHeight = pane.scrollHeight - clientHeight;
|
|
37
|
+
const paneWidth = pane.scrollWidth - clientWidth;
|
|
33
38
|
/* Adjust the scrollTop position of it accordingly */
|
|
34
39
|
|
|
35
40
|
if (vertical && scrollTopOffset > 0) {
|
|
@@ -40,11 +45,9 @@ function ScrollSyncProvider(_ref) {
|
|
|
40
45
|
pane.scrollLeft = proportional ? paneWidth * scrollLeft / scrollLeftOffset : scrollLeft; // eslint-disable-line
|
|
41
46
|
}
|
|
42
47
|
});
|
|
43
|
-
return /*#__PURE__*/
|
|
48
|
+
return /*#__PURE__*/_jsx(Provider, {}, void 0, children);
|
|
44
49
|
}
|
|
45
50
|
|
|
46
|
-
ScrollSyncProvider.propTypes = {};
|
|
47
51
|
ScrollSyncProvider.defaultProps = {};
|
|
48
52
|
|
|
49
53
|
export { ScrollSyncProvider as default };
|
|
50
|
-
//# sourceMappingURL=ScrollSyncProvider.js.map
|
package/esm/ScrollSync/index.js
CHANGED
|
@@ -1,12 +1,2 @@
|
|
|
1
1
|
export { default as ScrollSync } from './ScrollSync.js';
|
|
2
2
|
export { default as ScrollSyncPane } from './ScrollSyncPane.js';
|
|
3
|
-
import '@babel/runtime/helpers/esm/classCallCheck';
|
|
4
|
-
import '@babel/runtime/helpers/esm/createClass';
|
|
5
|
-
import '@babel/runtime/helpers/esm/assertThisInitialized';
|
|
6
|
-
import '@babel/runtime/helpers/esm/inherits';
|
|
7
|
-
import '@babel/runtime/helpers/esm/possibleConstructorReturn';
|
|
8
|
-
import '@babel/runtime/helpers/esm/getPrototypeOf';
|
|
9
|
-
import '@babel/runtime/helpers/esm/defineProperty';
|
|
10
|
-
import 'react';
|
|
11
|
-
import '@babel/runtime/helpers/esm/extends';
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
package/esm/constants.js
CHANGED
|
@@ -1,6 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const DEFAULT_DELAY_OPEN = 200;
|
|
2
|
+
const DEFAULT_DELAY_CLOSE = 300;
|
|
3
|
+
const sizeOptions = ['small', 'medium', 'large', 'x-large'];
|
|
4
|
+
const AM = 'am';
|
|
5
|
+
const PM = 'pm';
|
|
6
|
+
const ARROW_UP = 'ArrowUp';
|
|
7
|
+
const ARROW_DOWN = 'ArrowDown';
|
|
8
|
+
const BACKSPACE = 'Backspace';
|
|
9
|
+
const ESCAPE = 'Escape';
|
|
10
|
+
const HOME = 'Home';
|
|
11
|
+
const SHIFT = 'Shift';
|
|
12
|
+
const END = 'End';
|
|
13
|
+
const HOUR_RANGE_12 = {
|
|
14
|
+
min: 0,
|
|
15
|
+
max: 12
|
|
16
|
+
};
|
|
17
|
+
const HOUR_RANGE_24 = {
|
|
18
|
+
min: 0,
|
|
19
|
+
max: 24
|
|
20
|
+
};
|
|
21
|
+
const GENERAL_TIME_RANGE = {
|
|
22
|
+
min: 0,
|
|
23
|
+
max: 59
|
|
24
|
+
};
|
|
25
|
+
const PLACEHOLDER_TIME = {
|
|
26
|
+
hour: 'hour',
|
|
27
|
+
minutes: 'minutes',
|
|
28
|
+
seconds: 'seconds',
|
|
29
|
+
meridiem: 'meridiem'
|
|
30
|
+
};
|
|
4
31
|
|
|
5
|
-
export { DEFAULT_DELAY_CLOSE, DEFAULT_DELAY_OPEN, sizeOptions };
|
|
6
|
-
//# sourceMappingURL=constants.js.map
|
|
32
|
+
export { AM, ARROW_DOWN, ARROW_UP, BACKSPACE, DEFAULT_DELAY_CLOSE, DEFAULT_DELAY_OPEN, END, ESCAPE, GENERAL_TIME_RANGE, HOME, HOUR_RANGE_12, HOUR_RANGE_24, PLACEHOLDER_TIME, PM, SHIFT, sizeOptions };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import _toConsumableArray from '@babel/runtime/helpers/esm/toConsumableArray';
|
|
2
1
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
3
|
|
|
4
4
|
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; }
|
|
5
5
|
|
|
6
6
|
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(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; }
|
|
7
7
|
|
|
8
8
|
function getDecoratorsFromHooks(hooks, decorators) {
|
|
9
|
-
|
|
9
|
+
const nextDecorators = _objectSpread({}, decorators);
|
|
10
10
|
|
|
11
|
-
Object.keys(hooks).forEach(
|
|
11
|
+
Object.keys(hooks).forEach(decorator => {
|
|
12
12
|
if (Array.isArray(decorators[decorator])) {
|
|
13
|
-
nextDecorators[decorator] = [
|
|
13
|
+
nextDecorators[decorator] = [...decorators[decorator], hooks[decorator]];
|
|
14
14
|
} else {
|
|
15
15
|
nextDecorators[decorator] = hooks[decorator];
|
|
16
16
|
}
|
|
@@ -19,10 +19,7 @@ function getDecoratorsFromHooks(hooks, decorators) {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
function createInstancePlugin(name, hooks) {
|
|
22
|
-
return
|
|
23
|
-
return getDecoratorsFromHooks(hooks, decorators);
|
|
24
|
-
};
|
|
22
|
+
return decorators => getDecoratorsFromHooks(hooks, decorators);
|
|
25
23
|
}
|
|
26
24
|
|
|
27
25
|
export { createInstancePlugin as default };
|
|
28
|
-
//# sourceMappingURL=createInstancePlugin.js.map
|