@elliemae/ds-shared 1.60.0 → 2.0.0-alpha.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (264) hide show
  1. package/cjs/Animations/BaseAnimation.js +19 -27
  2. package/cjs/Animations/Grow.js +17 -22
  3. package/cjs/Animations/GrowRight.js +17 -23
  4. package/cjs/Animations/GrowVertical.js +3 -2
  5. package/cjs/CheckableGroup.js +40 -46
  6. package/cjs/DeferRenderAfterComputation.js +12 -21
  7. package/cjs/FocusGroup/FocusGrid.js +91 -92
  8. package/cjs/FocusGroup/FocusGroup.js +225 -262
  9. package/cjs/FocusGroup/FocusGroupContext.js +1 -2
  10. package/cjs/FocusGroup/FocusGroupManager.js +88 -126
  11. package/cjs/FocusGroup/focusGroupManagerHoc.js +28 -27
  12. package/cjs/FocusGroup/index.js +14 -28
  13. package/cjs/FocusGroup/useFocusGroupItem.js +27 -24
  14. package/cjs/FocusGroup/utils/getNextCellPosition.js +14 -15
  15. package/cjs/GroupContext/Group.js +81 -103
  16. package/cjs/GroupContext/GroupContext.js +1 -2
  17. package/cjs/GroupContext/GroupItem.js +12 -10
  18. package/cjs/GroupContext/index.js +6 -15
  19. package/cjs/ScrollSync/ScrollSync.js +90 -112
  20. package/cjs/ScrollSync/ScrollSyncPane.js +58 -90
  21. package/cjs/ScrollSync/ScrollSyncProvider.js +36 -26
  22. package/cjs/ScrollSync/index.js +4 -13
  23. package/cjs/ScrollSync/useScrollSync.js +0 -1
  24. package/cjs/constants.js +43 -4
  25. package/cjs/createDataInstance/createInstancePlugin.js +11 -10
  26. package/cjs/createDataInstance/createInstanceRef.js +41 -42
  27. package/cjs/createDataInstance/utils.js +56 -58
  28. package/cjs/defer-render-hoc/index.js +26 -61
  29. package/cjs/dimsum.config.js +7 -0
  30. package/cjs/index.js +10 -20
  31. package/cjs/prop-types.js +59 -0
  32. package/cjs/react-spring/index.js +3 -6
  33. package/cjs/react-spring/renderprops.js +3 -6
  34. package/cjs/toolbar/ToolbarProvider.js +65 -77
  35. package/cjs/useDataGrid/VolatileRowsListener.js +13 -27
  36. package/cjs/useDataGrid/index.js +2 -17
  37. package/cjs/useDataGrid/initColumnDefinition.js +46 -47
  38. package/cjs/useDataGrid/useDataGrid.js +104 -144
  39. package/cjs/useDataList/index.js +2 -15
  40. package/cjs/useDataList/recordIterator.js +9 -10
  41. package/cjs/useDataList/useDataList.js +51 -59
  42. package/cjs/utils.js +46 -59
  43. package/cjs/virtualization/AutoHeightList.js +31 -22
  44. package/cjs/virtualization/FluidHeightList.js +26 -12
  45. package/cjs/virtualization/index.js +12 -17
  46. package/esm/Animations/BaseAnimation.js +18 -26
  47. package/esm/Animations/Grow.js +15 -20
  48. package/esm/Animations/GrowRight.js +15 -21
  49. package/esm/Animations/GrowVertical.js +3 -2
  50. package/esm/CheckableGroup.js +38 -42
  51. package/esm/DeferRenderAfterComputation.js +12 -20
  52. package/esm/FocusGroup/FocusGrid.js +87 -89
  53. package/esm/FocusGroup/FocusGroup.js +222 -257
  54. package/esm/FocusGroup/FocusGroupContext.js +0 -1
  55. package/esm/FocusGroup/FocusGroupManager.js +82 -114
  56. package/esm/FocusGroup/focusGroupManagerHoc.js +24 -22
  57. package/esm/FocusGroup/index.js +0 -14
  58. package/esm/FocusGroup/useFocusGroupItem.js +25 -22
  59. package/esm/FocusGroup/utils/getNextCellPosition.js +14 -15
  60. package/esm/GroupContext/Group.js +80 -95
  61. package/esm/GroupContext/GroupContext.js +1 -2
  62. package/esm/GroupContext/GroupItem.js +10 -8
  63. package/esm/GroupContext/index.js +0 -9
  64. package/esm/ScrollSync/ScrollSync.js +88 -105
  65. package/esm/ScrollSync/ScrollSyncPane.js +56 -83
  66. package/esm/ScrollSync/ScrollSyncProvider.js +35 -26
  67. package/esm/ScrollSync/index.js +0 -9
  68. package/esm/ScrollSync/useScrollSync.js +0 -1
  69. package/esm/constants.js +31 -5
  70. package/esm/createDataInstance/createInstancePlugin.js +10 -8
  71. package/esm/createDataInstance/createInstanceRef.js +36 -36
  72. package/esm/createDataInstance/utils.js +55 -57
  73. package/esm/defer-render-hoc/index.js +25 -55
  74. package/esm/dimsum.config.js +5 -0
  75. package/esm/index.js +0 -10
  76. package/esm/prop-types.js +43 -0
  77. package/esm/react-spring/index.js +1 -2
  78. package/esm/react-spring/renderprops.js +1 -2
  79. package/esm/toolbar/ToolbarProvider.js +60 -71
  80. package/esm/useDataGrid/VolatileRowsListener.js +14 -23
  81. package/esm/useDataGrid/index.js +0 -15
  82. package/esm/useDataGrid/initColumnDefinition.js +43 -43
  83. package/esm/useDataGrid/useDataGrid.js +90 -127
  84. package/esm/useDataList/index.js +0 -13
  85. package/esm/useDataList/recordIterator.js +9 -10
  86. package/esm/useDataList/useDataList.js +39 -46
  87. package/esm/utils.js +44 -57
  88. package/esm/virtualization/AutoHeightList.js +28 -18
  89. package/esm/virtualization/FluidHeightList.js +24 -10
  90. package/esm/virtualization/index.js +6 -11
  91. package/package.json +201 -8
  92. package/types/Animations/BaseAnimation.d.ts +12 -0
  93. package/types/Animations/Grow.d.ts +11 -0
  94. package/types/Animations/GrowRight.d.ts +11 -0
  95. package/types/Animations/GrowVertical.d.ts +1 -0
  96. package/types/CheckableGroup.d.ts +20 -0
  97. package/types/DeferRenderAfterComputation.d.ts +6 -0
  98. package/types/FocusGroup/FocusGrid.d.ts +10 -0
  99. package/types/FocusGroup/FocusGroup.d.ts +36 -0
  100. package/types/FocusGroup/FocusGroupContext.d.ts +3 -0
  101. package/types/FocusGroup/FocusGroupManager.d.ts +24 -0
  102. package/types/FocusGroup/focusGroupManagerHoc.d.ts +7 -0
  103. package/types/FocusGroup/index.d.ts +6 -0
  104. package/types/FocusGroup/useFocusGroupItem.d.ts +2 -0
  105. package/types/FocusGroup/utils/getNextCellPosition.d.ts +12 -0
  106. package/types/GroupContext/Group.d.ts +14 -0
  107. package/types/GroupContext/GroupContext.d.ts +2 -0
  108. package/types/GroupContext/GroupItem.d.ts +5 -0
  109. package/types/GroupContext/index.d.ts +3 -0
  110. package/types/ScrollSync/ScrollSync.d.ts +21 -0
  111. package/types/ScrollSync/ScrollSyncPane.d.ts +3 -0
  112. package/types/ScrollSync/ScrollSyncProvider.d.ts +12 -0
  113. package/types/ScrollSync/index.d.ts +2 -0
  114. package/types/ScrollSync/useScrollSync.d.ts +6 -0
  115. package/types/constants.d.ts +30 -0
  116. package/types/createDataInstance/createInstancePlugin.d.ts +1 -0
  117. package/types/createDataInstance/createInstanceRef.d.ts +12 -0
  118. package/types/createDataInstance/tests/createInstanceRef.test.d.ts +0 -0
  119. package/types/createDataInstance/utils.d.ts +9 -0
  120. package/types/dimsum.config.d.ts +4 -0
  121. package/types/index.d.ts +2 -0
  122. package/types/prop-types.d.ts +41 -0
  123. package/types/react-spring/index.d.ts +1 -0
  124. package/types/react-spring/renderprops.d.ts +1 -0
  125. package/types/toolbar/ToolbarProvider.d.ts +10 -0
  126. package/types/useDataGrid/VolatileRowsListener.d.ts +5 -0
  127. package/types/useDataGrid/index.d.ts +1 -0
  128. package/types/useDataGrid/initColumnDefinition.d.ts +5 -0
  129. package/types/useDataGrid/useDataGrid.d.ts +8 -0
  130. package/types/useDataList/index.d.ts +1 -0
  131. package/types/useDataList/recordIterator.d.ts +1 -0
  132. package/types/useDataList/useDataList.d.ts +13 -0
  133. package/types/utils.d.ts +22 -0
  134. package/types/virtualization/AutoHeightList.d.ts +2 -0
  135. package/types/virtualization/FluidHeightList.d.ts +2 -0
  136. package/types/virtualization/index.d.ts +9 -0
  137. package/Animations/BaseAnimation/package.json +0 -10
  138. package/Animations/Grow/package.json +0 -10
  139. package/Animations/GrowRight/package.json +0 -10
  140. package/Animations/GrowVertical/package.json +0 -10
  141. package/CheckableGroup/package.json +0 -10
  142. package/DeferRenderAfterComputation/package.json +0 -10
  143. package/FocusGroup/FocusGrid/package.json +0 -10
  144. package/FocusGroup/FocusGroup/package.json +0 -10
  145. package/FocusGroup/FocusGroupContext/package.json +0 -10
  146. package/FocusGroup/FocusGroupManager/package.json +0 -10
  147. package/FocusGroup/focusGroupManagerHoc/package.json +0 -10
  148. package/FocusGroup/package.json +0 -10
  149. package/FocusGroup/useFocusGroupItem/package.json +0 -10
  150. package/FocusGroup/utils/getNextCellPosition/package.json +0 -10
  151. package/GroupContext/Group/package.json +0 -10
  152. package/GroupContext/GroupContext/package.json +0 -10
  153. package/GroupContext/GroupItem/package.json +0 -10
  154. package/GroupContext/package.json +0 -10
  155. package/ScrollSync/ScrollSync/package.json +0 -10
  156. package/ScrollSync/ScrollSyncPane/package.json +0 -10
  157. package/ScrollSync/ScrollSyncProvider/package.json +0 -10
  158. package/ScrollSync/package.json +0 -10
  159. package/ScrollSync/useScrollSync/package.json +0 -10
  160. package/cjs/Animations/BaseAnimation.js.map +0 -1
  161. package/cjs/Animations/Grow.js.map +0 -1
  162. package/cjs/Animations/GrowRight.js.map +0 -1
  163. package/cjs/Animations/GrowVertical.js.map +0 -1
  164. package/cjs/CheckableGroup.js.map +0 -1
  165. package/cjs/DeferRenderAfterComputation.js.map +0 -1
  166. package/cjs/FocusGroup/FocusGrid.js.map +0 -1
  167. package/cjs/FocusGroup/FocusGroup.js.map +0 -1
  168. package/cjs/FocusGroup/FocusGroupContext.js.map +0 -1
  169. package/cjs/FocusGroup/FocusGroupManager.js.map +0 -1
  170. package/cjs/FocusGroup/focusGroupManagerHoc.js.map +0 -1
  171. package/cjs/FocusGroup/index.js.map +0 -1
  172. package/cjs/FocusGroup/useFocusGroupItem.js.map +0 -1
  173. package/cjs/FocusGroup/utils/getNextCellPosition.js.map +0 -1
  174. package/cjs/GroupContext/Group.js.map +0 -1
  175. package/cjs/GroupContext/GroupContext.js.map +0 -1
  176. package/cjs/GroupContext/GroupItem.js.map +0 -1
  177. package/cjs/GroupContext/index.js.map +0 -1
  178. package/cjs/ScrollSync/ScrollSync.js.map +0 -1
  179. package/cjs/ScrollSync/ScrollSyncPane.js.map +0 -1
  180. package/cjs/ScrollSync/ScrollSyncProvider.js.map +0 -1
  181. package/cjs/ScrollSync/index.js.map +0 -1
  182. package/cjs/ScrollSync/useScrollSync.js.map +0 -1
  183. package/cjs/constants.js.map +0 -1
  184. package/cjs/createDataInstance/createInstancePlugin.js.map +0 -1
  185. package/cjs/createDataInstance/createInstanceRef.js.map +0 -1
  186. package/cjs/createDataInstance/utils.js.map +0 -1
  187. package/cjs/defer-render-hoc/index.js.map +0 -1
  188. package/cjs/index.js.map +0 -1
  189. package/cjs/react-spring/index.js.map +0 -1
  190. package/cjs/react-spring/renderprops.js.map +0 -1
  191. package/cjs/toolbar/ToolbarProvider.js.map +0 -1
  192. package/cjs/useDataGrid/VolatileRowsListener.js.map +0 -1
  193. package/cjs/useDataGrid/index.js.map +0 -1
  194. package/cjs/useDataGrid/initColumnDefinition.js.map +0 -1
  195. package/cjs/useDataGrid/useDataGrid.js.map +0 -1
  196. package/cjs/useDataList/index.js.map +0 -1
  197. package/cjs/useDataList/recordIterator.js.map +0 -1
  198. package/cjs/useDataList/useDataList.js.map +0 -1
  199. package/cjs/utils.js.map +0 -1
  200. package/cjs/virtualization/AutoHeightList.js.map +0 -1
  201. package/cjs/virtualization/FluidHeightList.js.map +0 -1
  202. package/cjs/virtualization/index.js.map +0 -1
  203. package/constants/package.json +0 -10
  204. package/createDataInstance/createInstancePlugin/package.json +0 -10
  205. package/createDataInstance/createInstanceRef/package.json +0 -10
  206. package/createDataInstance/utils/package.json +0 -10
  207. package/defer-render-hoc/package.json +0 -10
  208. package/esm/Animations/BaseAnimation.js.map +0 -1
  209. package/esm/Animations/Grow.js.map +0 -1
  210. package/esm/Animations/GrowRight.js.map +0 -1
  211. package/esm/Animations/GrowVertical.js.map +0 -1
  212. package/esm/CheckableGroup.js.map +0 -1
  213. package/esm/DeferRenderAfterComputation.js.map +0 -1
  214. package/esm/FocusGroup/FocusGrid.js.map +0 -1
  215. package/esm/FocusGroup/FocusGroup.js.map +0 -1
  216. package/esm/FocusGroup/FocusGroupContext.js.map +0 -1
  217. package/esm/FocusGroup/FocusGroupManager.js.map +0 -1
  218. package/esm/FocusGroup/focusGroupManagerHoc.js.map +0 -1
  219. package/esm/FocusGroup/index.js.map +0 -1
  220. package/esm/FocusGroup/useFocusGroupItem.js.map +0 -1
  221. package/esm/FocusGroup/utils/getNextCellPosition.js.map +0 -1
  222. package/esm/GroupContext/Group.js.map +0 -1
  223. package/esm/GroupContext/GroupContext.js.map +0 -1
  224. package/esm/GroupContext/GroupItem.js.map +0 -1
  225. package/esm/GroupContext/index.js.map +0 -1
  226. package/esm/ScrollSync/ScrollSync.js.map +0 -1
  227. package/esm/ScrollSync/ScrollSyncPane.js.map +0 -1
  228. package/esm/ScrollSync/ScrollSyncProvider.js.map +0 -1
  229. package/esm/ScrollSync/index.js.map +0 -1
  230. package/esm/ScrollSync/useScrollSync.js.map +0 -1
  231. package/esm/constants.js.map +0 -1
  232. package/esm/createDataInstance/createInstancePlugin.js.map +0 -1
  233. package/esm/createDataInstance/createInstanceRef.js.map +0 -1
  234. package/esm/createDataInstance/utils.js.map +0 -1
  235. package/esm/defer-render-hoc/index.js.map +0 -1
  236. package/esm/index.js.map +0 -1
  237. package/esm/react-spring/index.js.map +0 -1
  238. package/esm/react-spring/renderprops.js.map +0 -1
  239. package/esm/toolbar/ToolbarProvider.js.map +0 -1
  240. package/esm/useDataGrid/VolatileRowsListener.js.map +0 -1
  241. package/esm/useDataGrid/index.js.map +0 -1
  242. package/esm/useDataGrid/initColumnDefinition.js.map +0 -1
  243. package/esm/useDataGrid/useDataGrid.js.map +0 -1
  244. package/esm/useDataList/index.js.map +0 -1
  245. package/esm/useDataList/recordIterator.js.map +0 -1
  246. package/esm/useDataList/useDataList.js.map +0 -1
  247. package/esm/utils.js.map +0 -1
  248. package/esm/virtualization/AutoHeightList.js.map +0 -1
  249. package/esm/virtualization/FluidHeightList.js.map +0 -1
  250. package/esm/virtualization/index.js.map +0 -1
  251. package/react-spring/package.json +0 -10
  252. package/react-spring/renderprops/package.json +0 -10
  253. package/toolbar/ToolbarProvider/package.json +0 -10
  254. package/useDataGrid/VolatileRowsListener/package.json +0 -10
  255. package/useDataGrid/initColumnDefinition/package.json +0 -10
  256. package/useDataGrid/package.json +0 -10
  257. package/useDataGrid/useDataGrid/package.json +0 -10
  258. package/useDataList/package.json +0 -10
  259. package/useDataList/recordIterator/package.json +0 -10
  260. package/useDataList/useDataList/package.json +0 -10
  261. package/utils/package.json +0 -10
  262. package/virtualization/AutoHeightList/package.json +0 -10
  263. package/virtualization/FluidHeightList/package.json +0 -10
  264. package/virtualization/package.json +0 -10
@@ -1,12 +1,3 @@
1
1
  export { default as Group } from './Group.js';
2
2
  export { GroupContext } from './GroupContext.js';
3
3
  export { default as GroupItem } from './GroupItem.js';
4
- import '@babel/runtime/helpers/esm/classCallCheck';
5
- import '@babel/runtime/helpers/esm/createClass';
6
- import '@babel/runtime/helpers/esm/assertThisInitialized';
7
- import '@babel/runtime/helpers/esm/inherits';
8
- import '@babel/runtime/helpers/esm/possibleConstructorReturn';
9
- import '@babel/runtime/helpers/esm/getPrototypeOf';
10
- import 'react';
11
- import 'prop-types';
12
- //# sourceMappingURL=index.js.map
@@ -1,154 +1,138 @@
1
- import _classCallCheck from '@babel/runtime/helpers/esm/classCallCheck';
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';
2
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
3
+ import 'core-js/modules/esnext.iterator.constructor.js';
4
+ import 'core-js/modules/esnext.iterator.for-each.js';
5
+ import 'core-js/modules/esnext.async-iterator.find.js';
6
+ import 'core-js/modules/esnext.iterator.find.js';
7
7
  import React, { Component } from 'react';
8
8
 
9
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
10
-
11
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
12
- var ScrollSyncContext = /*#__PURE__*/React.createContext();
13
- var Provider = ScrollSyncContext.Provider;
14
-
15
- var ScrollSync = /*#__PURE__*/function (_Component) {
16
- _inherits(ScrollSync, _Component);
17
-
18
- var _super = _createSuper(ScrollSync);
19
-
20
- function ScrollSync(props) {
21
- var _this;
22
-
23
- _classCallCheck(this, ScrollSync);
24
-
25
- _this = _super.call(this, props);
26
- _this.panes = {};
27
-
28
- _this.registerPane = function (node, groups) {
29
- groups.forEach(function (group) {
30
- if (!_this.panes[group]) {
31
- _this.panes[group] = [];
9
+ const ScrollSyncContext = /*#__PURE__*/React.createContext();
10
+ const {
11
+ Provider
12
+ } = ScrollSyncContext;
13
+ class ScrollSync extends Component {
14
+ constructor(props) {
15
+ super(props);
16
+ this.panes = {};
17
+
18
+ this.registerPane = (node, groups) => {
19
+ groups.forEach(group => {
20
+ if (!this.panes[group]) {
21
+ this.panes[group] = [];
32
22
  }
33
23
 
34
- if (_this.panes[group].length > 0) {
35
- _this.syncScrollPosition(_this.panes[group][0], node);
24
+ if (this.panes[group].length > 0) {
25
+ this.syncScrollPosition(this.panes[group][0], node);
36
26
  }
37
27
 
38
- _this.panes[group].push(node);
28
+ this.panes[group].push(node);
39
29
  });
40
-
41
- _this.addEvents(node, groups);
30
+ this.addEvents(node, groups);
42
31
  };
43
32
 
44
- _this.unregisterPane = function (node, groups) {
45
- groups.forEach(function (group) {
46
- if (_this.findPane(node, group)) {
47
- _this.removeEvents(node);
48
-
49
- _this.panes[group].splice(_this.panes[group].indexOf(node), 1);
33
+ this.unregisterPane = (node, groups) => {
34
+ groups.forEach(group => {
35
+ if (this.findPane(node, group)) {
36
+ this.removeEvents(node);
37
+ this.panes[group].splice(this.panes[group].indexOf(node), 1);
50
38
  }
51
39
  });
52
40
  };
53
41
 
54
- _this.addEvents = function (node, groups) {
42
+ this.addEvents = (node, groups) => {
55
43
  /* For some reason element.addEventListener doesnt work with document.body */
56
- node.onscroll = _this.handlePaneScroll.bind(_assertThisInitialized(_this), node, groups); // eslint-disable-line
44
+ node.onscroll = this.handlePaneScroll.bind(this, node, groups); // eslint-disable-line
57
45
  };
58
46
 
59
- _this.removeEvents = function (node) {
47
+ this.removeEvents = node => {
60
48
  /* For some reason element.removeEventListener doesnt work with document.body */
61
49
  node.onscroll = null; // eslint-disable-line
62
50
  };
63
51
 
64
- _this.findPane = function (node, group) {
65
- if (!_this.panes[group]) {
52
+ this.findPane = (node, group) => {
53
+ if (!this.panes[group]) {
66
54
  return false;
67
55
  }
68
56
 
69
- return _this.panes[group].find(function (pane) {
70
- return pane === node;
71
- });
57
+ return this.panes[group].find(pane => pane === node);
72
58
  };
73
59
 
74
- _this.handlePaneScroll = function (node, groups, e) {
75
- var enabled = _this.props.enabled;
76
- if (_this.props.onScroll) _this.props.onScroll(e);
60
+ this.handlePaneScroll = (node, groups, e) => {
61
+ const {
62
+ enabled
63
+ } = this.props;
64
+ if (this.props.onScroll) this.props.onScroll(e);
77
65
  if (!enabled) return;
78
- window.requestAnimationFrame(function () {
79
- _this.syncScrollPositions(node, groups);
66
+ window.requestAnimationFrame(() => {
67
+ this.syncScrollPositions(node, groups);
80
68
  });
81
69
  };
82
70
 
83
- _this.syncScrollPositions = function (scrolledPane, groups) {
84
- groups.forEach(function (group) {
85
- _this.panes[group].forEach(function (pane) {
71
+ this.syncScrollPositions = (scrolledPane, groups) => {
72
+ groups.forEach(group => {
73
+ this.panes[group].forEach(pane => {
86
74
  /* For all panes beside the currently scrolling one */
87
75
  if (scrolledPane !== pane) {
88
76
  /* Remove event listeners from the node that we'll manipulate */
89
- _this.removeEvents(pane, group);
90
-
91
- _this.syncScrollPosition(scrolledPane, pane);
77
+ this.removeEvents(pane, group);
78
+ this.syncScrollPosition(scrolledPane, pane);
92
79
  /* Re-attach event listeners after we're done scrolling */
93
80
 
94
-
95
- window.requestAnimationFrame(function () {
96
- _this.addEvents(pane, groups);
81
+ window.requestAnimationFrame(() => {
82
+ this.addEvents(pane, groups);
97
83
  });
98
84
  }
99
85
  });
100
86
  });
101
87
  };
102
88
 
103
- _this.syncContext = {
104
- registerPane: _this.registerPane,
105
- unregisterPane: _this.unregisterPane
89
+ this.syncContext = {
90
+ registerPane: this.registerPane,
91
+ unregisterPane: this.unregisterPane
106
92
  };
107
- return _this;
108
93
  }
109
94
 
110
- _createClass(ScrollSync, [{
111
- key: "syncScrollPosition",
112
- value: function syncScrollPosition(scrolledPane, pane) {
113
- var scrollTop = scrolledPane.scrollTop,
114
- scrollHeight = scrolledPane.scrollHeight,
115
- clientHeight = scrolledPane.clientHeight,
116
- scrollLeft = scrolledPane.scrollLeft,
117
- scrollWidth = scrolledPane.scrollWidth,
118
- clientWidth = scrolledPane.clientWidth;
119
- var scrollTopOffset = scrollHeight - clientHeight;
120
- var scrollLeftOffset = scrollWidth - clientWidth;
121
- var _this$props = this.props,
122
- proportional = _this$props.proportional,
123
- vertical = _this$props.vertical,
124
- horizontal = _this$props.horizontal;
125
- /* Calculate the actual pane height */
126
-
127
- var paneHeight = pane.scrollHeight - clientHeight;
128
- var paneWidth = pane.scrollWidth - clientWidth;
129
- /* Adjust the scrollTop position of it accordingly */
130
-
131
- if (vertical && scrollTopOffset > 0) {
132
- pane.scrollTop = proportional ? paneHeight * scrollTop / scrollTopOffset : scrollTop; // eslint-disable-line
133
- }
134
-
135
- if (horizontal && scrollLeftOffset > 0) {
136
- pane.scrollLeft = proportional ? paneWidth * scrollLeft / scrollLeftOffset : scrollLeft; // eslint-disable-line
137
- }
95
+ syncScrollPosition(scrolledPane, pane) {
96
+ const {
97
+ scrollTop,
98
+ scrollHeight,
99
+ clientHeight,
100
+ scrollLeft,
101
+ scrollWidth,
102
+ clientWidth
103
+ } = scrolledPane;
104
+ const scrollTopOffset = scrollHeight - clientHeight;
105
+ const scrollLeftOffset = scrollWidth - clientWidth;
106
+ const {
107
+ proportional,
108
+ vertical,
109
+ horizontal
110
+ } = this.props;
111
+ /* Calculate the actual pane height */
112
+
113
+ const paneHeight = pane.scrollHeight - clientHeight;
114
+ const paneWidth = pane.scrollWidth - clientWidth;
115
+ /* Adjust the scrollTop position of it accordingly */
116
+
117
+ if (vertical && scrollTopOffset > 0) {
118
+ pane.scrollTop = proportional ? paneHeight * scrollTop / scrollTopOffset : scrollTop; // eslint-disable-line
138
119
  }
139
- }, {
140
- key: "render",
141
- value: function render() {
142
- var children = this.props.children;
143
- return /*#__PURE__*/React.createElement(Provider, {
144
- value: this.syncContext
145
- }, React.Children.only(children));
120
+
121
+ if (horizontal && scrollLeftOffset > 0) {
122
+ pane.scrollLeft = proportional ? paneWidth * scrollLeft / scrollLeftOffset : scrollLeft; // eslint-disable-line
146
123
  }
147
- }]);
124
+ }
148
125
 
149
- return ScrollSync;
150
- }(Component);
126
+ render() {
127
+ const {
128
+ children
129
+ } = this.props;
130
+ return /*#__PURE__*/_jsx(Provider, {
131
+ value: this.syncContext
132
+ }, void 0, React.Children.only(children));
133
+ }
151
134
 
135
+ }
152
136
  ScrollSync.defaultProps = {
153
137
  proportional: true,
154
138
  vertical: true,
@@ -157,4 +141,3 @@ ScrollSync.defaultProps = {
157
141
  };
158
142
 
159
143
  export { ScrollSyncContext, ScrollSync as default };
160
- //# sourceMappingURL=ScrollSync.js.map
@@ -1,101 +1,74 @@
1
- import _extends from '@babel/runtime/helpers/esm/extends';
2
- import _classCallCheck from '@babel/runtime/helpers/esm/classCallCheck';
3
- import _createClass from '@babel/runtime/helpers/esm/createClass';
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';
7
- import React, { Component } from 'react';
1
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
2
+ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
3
+ import 'core-js/modules/web.dom-collections.iterator.js';
4
+ import 'core-js/modules/esnext.async-iterator.constructor.js';
5
+ import 'core-js/modules/esnext.async-iterator.to-array.js';
6
+ import 'core-js/modules/esnext.iterator.constructor.js';
7
+ import 'core-js/modules/esnext.iterator.to-array.js';
8
+ import 'core-js/modules/esnext.async-iterator.filter.js';
9
+ import 'core-js/modules/esnext.iterator.filter.js';
10
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
11
+ import 'core-js/modules/esnext.iterator.for-each.js';
12
+ import { Component } from 'react';
8
13
  import { ScrollSyncContext } from './ScrollSync.js';
9
- import '@babel/runtime/helpers/esm/assertThisInitialized';
14
+ import { jsx } from 'react/jsx-runtime';
10
15
 
11
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
16
+ 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
17
 
13
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
14
- /**
15
- * MODIFIED FROM react-scroll-sync
16
- *
17
- * ScrollSyncPane Component
18
- *
19
- * Wrap your content in it to keep its scroll position in sync with other panes
20
- *
21
- * @param groups
22
- * @example ./example.md
23
- */
18
+ 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; }
24
19
 
25
- var ScrollSyncPane = /*#__PURE__*/function (_Component) {
26
- _inherits(ScrollSyncPane, _Component);
20
+ class ScrollSyncPane extends Component {
21
+ constructor() {
22
+ super(...arguments);
27
23
 
28
- var _super = _createSuper(ScrollSyncPane);
29
-
30
- function ScrollSyncPane() {
31
- var _this;
32
-
33
- _classCallCheck(this, ScrollSyncPane);
34
-
35
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
36
- args[_key] = arguments[_key];
37
- }
38
-
39
- _this = _super.call.apply(_super, [this].concat(args));
40
-
41
- _this.toArray = function (groups) {
42
- return [].concat(groups);
43
- };
44
-
45
- return _this;
24
+ this.toArray = groups => [].concat(groups);
46
25
  }
47
26
 
48
- _createClass(ScrollSyncPane, [{
49
- key: "componentWillUnmount",
50
- value: function componentWillUnmount() {
51
- var _this$props = this.props,
52
- enabled = _this$props.enabled,
53
- group = _this$props.group,
54
- syncContext = _this$props.syncContext;
55
- var unregisterPane = syncContext.unregisterPane;
56
- if (enabled) unregisterPane(this.node, this.toArray(group));
57
- }
58
- }, {
59
- key: "render",
60
- value: function render() {
61
- var _this2 = this;
62
-
63
- var _this$props2 = this.props,
64
- children = _this$props2.children,
65
- group = _this$props2.group,
66
- syncContext = _this$props2.syncContext,
67
- notPaginated = _this$props2.notPaginated;
68
- var _registerPane = syncContext.registerPane;
69
- return children({
70
- registerPane: function registerPane(node) {
71
- if (notPaginated) {
72
- var virtualizedBody = node.querySelector('.virtualized-body-wrapper');
27
+ componentWillUnmount() {
28
+ const {
29
+ enabled,
30
+ group,
31
+ syncContext
32
+ } = this.props;
33
+ const {
34
+ unregisterPane
35
+ } = syncContext;
36
+ if (enabled) unregisterPane(this.node, this.toArray(group));
37
+ }
73
38
 
74
- if (virtualizedBody) {
75
- _registerPane(virtualizedBody, _this2.toArray(group));
76
- }
39
+ render() {
40
+ const {
41
+ children,
42
+ group,
43
+ syncContext,
44
+ notPaginated
45
+ } = this.props;
46
+ const {
47
+ registerPane
48
+ } = syncContext;
49
+ return children({
50
+ registerPane: node => {
51
+ if (notPaginated) {
52
+ const virtualizedBody = node.querySelector('.virtualized-body-wrapper');
53
+
54
+ if (virtualizedBody) {
55
+ registerPane(virtualizedBody, this.toArray(group));
77
56
  }
78
-
79
- return _registerPane(node, _this2.toArray(group));
80
57
  }
81
- });
82
- }
83
- }]);
84
58
 
85
- return ScrollSyncPane;
86
- }(Component);
59
+ return registerPane(node, this.toArray(group));
60
+ }
61
+ });
62
+ }
63
+
64
+ }
87
65
 
88
66
  ScrollSyncPane.defaultProps = {
89
67
  group: 'default',
90
68
  enabled: true
91
69
  };
92
- var ScrollSyncPane$1 = (function (props) {
93
- return /*#__PURE__*/React.createElement(ScrollSyncContext.Consumer, null, function (context) {
94
- return /*#__PURE__*/React.createElement(ScrollSyncPane, _extends({}, props, {
95
- syncContext: context
96
- }));
97
- });
98
- });
70
+ var ScrollSyncPane$1 = (props => /*#__PURE__*/_jsx(ScrollSyncContext.Consumer, {}, void 0, context => /*#__PURE__*/jsx(ScrollSyncPane, _objectSpread(_objectSpread({}, props), {}, {
71
+ syncContext: context
72
+ }))));
99
73
 
100
74
  export { ScrollSyncPane$1 as default };
101
- //# sourceMappingURL=ScrollSyncPane.js.map
@@ -1,35 +1,46 @@
1
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
2
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
3
+ import 'core-js/modules/esnext.iterator.constructor.js';
4
+ import 'core-js/modules/esnext.iterator.for-each.js';
5
+ import 'core-js/modules/esnext.async-iterator.find.js';
6
+ import 'core-js/modules/esnext.iterator.find.js';
1
7
  import React from 'react';
2
8
  import raf from 'raf';
3
9
 
4
- var ScrollSyncContext = /*#__PURE__*/React.createContext();
5
- var Provider = ScrollSyncContext.Provider;
10
+ const ScrollSyncContext = /*#__PURE__*/React.createContext();
11
+ const {
12
+ Provider
13
+ } = ScrollSyncContext;
6
14
 
7
15
  function ScrollSyncProvider(_ref) {
8
- var _this = this;
9
-
10
- _ref.enabled;
11
- _ref.horizontal;
12
- _ref.vertical;
13
- var children = _ref.children;
16
+ let {
17
+ enabled,
18
+ horizontal,
19
+ vertical,
20
+ children
21
+ } = _ref;
14
22
  useRef();
15
23
 
16
- raf(function (scrolledPane, pane) {
17
- var scrollTop = scrolledPane.scrollTop,
18
- scrollHeight = scrolledPane.scrollHeight,
19
- clientHeight = scrolledPane.clientHeight,
20
- scrollLeft = scrolledPane.scrollLeft,
21
- scrollWidth = scrolledPane.scrollWidth,
22
- clientWidth = scrolledPane.clientWidth;
23
- var scrollTopOffset = scrollHeight - clientHeight;
24
- var scrollLeftOffset = scrollWidth - clientWidth;
25
- var _this$props = _this.props,
26
- proportional = _this$props.proportional,
27
- vertical = _this$props.vertical,
28
- horizontal = _this$props.horizontal;
24
+ raf((scrolledPane, pane) => {
25
+ const {
26
+ scrollTop,
27
+ scrollHeight,
28
+ clientHeight,
29
+ scrollLeft,
30
+ scrollWidth,
31
+ clientWidth
32
+ } = scrolledPane;
33
+ const scrollTopOffset = scrollHeight - clientHeight;
34
+ const scrollLeftOffset = scrollWidth - clientWidth;
35
+ const {
36
+ proportional,
37
+ vertical,
38
+ horizontal
39
+ } = this.props;
29
40
  /* Calculate the actual pane height */
30
41
 
31
- var paneHeight = pane.scrollHeight - clientHeight;
32
- var paneWidth = pane.scrollWidth - clientWidth;
42
+ const paneHeight = pane.scrollHeight - clientHeight;
43
+ const paneWidth = pane.scrollWidth - clientWidth;
33
44
  /* Adjust the scrollTop position of it accordingly */
34
45
 
35
46
  if (vertical && scrollTopOffset > 0) {
@@ -40,11 +51,9 @@ function ScrollSyncProvider(_ref) {
40
51
  pane.scrollLeft = proportional ? paneWidth * scrollLeft / scrollLeftOffset : scrollLeft; // eslint-disable-line
41
52
  }
42
53
  });
43
- return /*#__PURE__*/React.createElement(Provider, null, children);
54
+ return /*#__PURE__*/_jsx(Provider, {}, void 0, children);
44
55
  }
45
56
 
46
- ScrollSyncProvider.propTypes = {};
47
57
  ScrollSyncProvider.defaultProps = {};
48
58
 
49
59
  export { ScrollSyncProvider as default };
50
- //# sourceMappingURL=ScrollSyncProvider.js.map
@@ -1,11 +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 'react';
10
- import '@babel/runtime/helpers/esm/extends';
11
- //# sourceMappingURL=index.js.map
@@ -6,4 +6,3 @@ useScrollSync.propTypes = {};
6
6
  useScrollSync.defaultProps = {};
7
7
 
8
8
  export { useScrollSync as default };
9
- //# sourceMappingURL=useScrollSync.js.map
package/esm/constants.js CHANGED
@@ -1,6 +1,32 @@
1
- var DEFAULT_DELAY_OPEN = 200;
2
- var DEFAULT_DELAY_CLOSE = 300;
3
- var sizeOptions = ['small', 'medium', 'large', 'x-large'];
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,21 @@
1
- import _toConsumableArray from '@babel/runtime/helpers/esm/toConsumableArray';
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.filter.js';
2
3
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
4
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
5
+ import 'core-js/modules/esnext.iterator.constructor.js';
6
+ import 'core-js/modules/esnext.iterator.for-each.js';
7
+ import 'core-js/modules/web.dom-collections.iterator.js';
3
8
 
4
9
  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
10
 
6
11
  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
12
 
8
13
  function getDecoratorsFromHooks(hooks, decorators) {
9
- var nextDecorators = _objectSpread({}, decorators);
14
+ const nextDecorators = _objectSpread({}, decorators);
10
15
 
11
- Object.keys(hooks).forEach(function (decorator) {
16
+ Object.keys(hooks).forEach(decorator => {
12
17
  if (Array.isArray(decorators[decorator])) {
13
- nextDecorators[decorator] = [].concat(_toConsumableArray(decorators[decorator]), [hooks[decorator]]);
18
+ nextDecorators[decorator] = [...decorators[decorator], hooks[decorator]];
14
19
  } else {
15
20
  nextDecorators[decorator] = hooks[decorator];
16
21
  }
@@ -19,10 +24,7 @@ function getDecoratorsFromHooks(hooks, decorators) {
19
24
  }
20
25
 
21
26
  function createInstancePlugin(name, hooks) {
22
- return function (decorators) {
23
- return getDecoratorsFromHooks(hooks, decorators);
24
- };
27
+ return decorators => getDecoratorsFromHooks(hooks, decorators);
25
28
  }
26
29
 
27
30
  export { createInstancePlugin as default };
28
- //# sourceMappingURL=createInstancePlugin.js.map