@elliemae/ds-shared 2.2.0-alpha.4 → 3.0.0-next.2

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 (212) hide show
  1. package/cjs/Animations/BaseAnimation.js +35 -55
  2. package/cjs/Animations/Grow.js +41 -54
  3. package/cjs/Animations/GrowRight.js +41 -63
  4. package/cjs/Animations/GrowVertical.js +7 -47
  5. package/cjs/CheckableGroup.js +65 -67
  6. package/cjs/DeferRenderAfterComputation.js +24 -48
  7. package/cjs/FocusGroup/FocusGrid.js +143 -108
  8. package/cjs/FocusGroup/FocusGroup.js +147 -88
  9. package/cjs/FocusGroup/FocusGroupContext.js +11 -38
  10. package/cjs/FocusGroup/FocusGroupManager.js +47 -56
  11. package/cjs/FocusGroup/focusGroupManagerHoc.js +42 -52
  12. package/cjs/FocusGroup/index.js +21 -47
  13. package/cjs/FocusGroup/useFocusGroupItem.js +51 -59
  14. package/cjs/FocusGroup/utils/getNextCellPosition.js +27 -47
  15. package/cjs/GroupContext/Group.js +73 -64
  16. package/cjs/GroupContext/GroupContext.js +13 -36
  17. package/cjs/GroupContext/GroupItem.js +21 -39
  18. package/cjs/GroupContext/index.js +13 -39
  19. package/cjs/ScrollSync/ScrollSync.js +75 -60
  20. package/cjs/ScrollSync/ScrollSyncPane.js +60 -52
  21. package/cjs/ScrollSync/ScrollSyncProvider.js +50 -103
  22. package/cjs/ScrollSync/index.js +11 -37
  23. package/cjs/ScrollSync/useScrollSync.js +7 -38
  24. package/cjs/constants.js +46 -65
  25. package/cjs/createDataInstance/createInstancePlugin.js +29 -41
  26. package/cjs/createDataInstance/createInstanceRef.js +71 -66
  27. package/cjs/createDataInstance/utils.js +100 -76
  28. package/cjs/defer-render-hoc/index.js +41 -48
  29. package/cjs/dimsum.config.js +6 -38
  30. package/cjs/index.js +17 -40
  31. package/cjs/prop-types.js +49 -106
  32. package/cjs/react-spring/index.js +14 -28
  33. package/cjs/react-spring/renderprops.js +14 -28
  34. package/cjs/toolbar/ToolbarProvider.js +94 -82
  35. package/cjs/useDataGrid/VolatileRowsListener.js +13 -38
  36. package/cjs/useDataGrid/index.js +7 -36
  37. package/cjs/useDataGrid/initColumnDefinition.js +110 -105
  38. package/cjs/useDataGrid/useDataGrid.js +148 -122
  39. package/cjs/useDataList/index.js +7 -36
  40. package/cjs/useDataList/recordIterator.js +18 -42
  41. package/cjs/useDataList/useDataList.js +83 -74
  42. package/cjs/utils.js +80 -71
  43. package/cjs/virtualization/AutoHeightList.js +54 -62
  44. package/cjs/virtualization/FluidHeightList.js +48 -42
  45. package/cjs/virtualization/index.js +20 -48
  46. package/esm/Animations/BaseAnimation.js +29 -26
  47. package/esm/Animations/Grow.js +35 -25
  48. package/esm/Animations/GrowRight.js +35 -34
  49. package/esm/Animations/GrowVertical.js +4 -29
  50. package/esm/CheckableGroup.js +52 -35
  51. package/esm/DeferRenderAfterComputation.js +15 -16
  52. package/esm/FocusGroup/FocusGrid.js +117 -64
  53. package/esm/FocusGroup/FocusGroup.js +137 -56
  54. package/esm/FocusGroup/FocusGroupContext.js +5 -9
  55. package/esm/FocusGroup/FocusGroupManager.js +38 -24
  56. package/esm/FocusGroup/focusGroupManagerHoc.js +36 -24
  57. package/esm/FocusGroup/index.js +6 -18
  58. package/esm/FocusGroup/useFocusGroupItem.js +40 -28
  59. package/esm/FocusGroup/utils/getNextCellPosition.js +25 -18
  60. package/esm/GroupContext/Group.js +66 -34
  61. package/esm/GroupContext/GroupContext.js +5 -7
  62. package/esm/GroupContext/GroupItem.js +15 -10
  63. package/esm/GroupContext/index.js +3 -10
  64. package/esm/ScrollSync/ScrollSync.js +64 -30
  65. package/esm/ScrollSync/ScrollSyncPane.js +52 -22
  66. package/esm/ScrollSync/ScrollSyncProvider.js +42 -74
  67. package/esm/ScrollSync/index.js +2 -8
  68. package/esm/ScrollSync/useScrollSync.js +5 -9
  69. package/esm/constants.js +28 -37
  70. package/esm/createDataInstance/createInstancePlugin.js +23 -12
  71. package/esm/createDataInstance/createInstanceRef.js +59 -36
  72. package/esm/createDataInstance/utils.js +85 -48
  73. package/esm/defer-render-hoc/index.js +31 -17
  74. package/esm/dimsum.config.js +4 -9
  75. package/esm/index.js +5 -11
  76. package/esm/prop-types.js +31 -75
  77. package/esm/react-spring/index.js +1 -3
  78. package/esm/react-spring/renderprops.js +1 -3
  79. package/esm/toolbar/ToolbarProvider.js +74 -45
  80. package/esm/useDataGrid/VolatileRowsListener.js +11 -9
  81. package/esm/useDataGrid/index.js +1 -7
  82. package/esm/useDataGrid/initColumnDefinition.js +94 -78
  83. package/esm/useDataGrid/useDataGrid.js +99 -82
  84. package/esm/useDataList/index.js +1 -7
  85. package/esm/useDataList/recordIterator.js +14 -13
  86. package/esm/useDataList/useDataList.js +67 -44
  87. package/esm/utils.js +59 -42
  88. package/esm/virtualization/AutoHeightList.js +40 -28
  89. package/esm/virtualization/FluidHeightList.js +38 -14
  90. package/esm/virtualization/index.js +16 -19
  91. package/package.json +3 -3
  92. package/types/Animations/BaseAnimation.d.ts +0 -1
  93. package/types/Animations/Grow.d.ts +0 -1
  94. package/types/Animations/GrowRight.d.ts +0 -1
  95. package/types/CheckableGroup.d.ts +0 -1
  96. package/types/DeferRenderAfterComputation.d.ts +2 -3
  97. package/types/FocusGroup/FocusGrid.d.ts +3 -5
  98. package/types/FocusGroup/FocusGroup.d.ts +1 -3
  99. package/types/FocusGroup/FocusGroupContext.d.ts +2 -3
  100. package/types/FocusGroup/FocusGroupManager.d.ts +1 -3
  101. package/types/FocusGroup/focusGroupManagerHoc.d.ts +1 -3
  102. package/types/FocusGroup/index.d.ts +6 -6
  103. package/types/FocusGroup/useFocusGroupItem.d.ts +1 -3
  104. package/types/FocusGroup/utils/getNextCellPosition.d.ts +1 -3
  105. package/types/GroupContext/Group.d.ts +0 -1
  106. package/types/GroupContext/GroupItem.d.ts +0 -1
  107. package/types/GroupContext/index.d.ts +3 -3
  108. package/types/ScrollSync/ScrollSync.d.ts +2 -4
  109. package/types/ScrollSync/ScrollSyncPane.d.ts +2 -2
  110. package/types/ScrollSync/index.d.ts +2 -2
  111. package/types/ScrollSync/useScrollSync.d.ts +5 -6
  112. package/types/createDataInstance/createInstancePlugin.d.ts +1 -2
  113. package/types/createDataInstance/createInstanceRef.d.ts +1 -3
  114. package/types/dimsum.config.d.ts +2 -3
  115. package/types/index.d.ts +2 -2
  116. package/types/toolbar/ToolbarProvider.d.ts +8 -3
  117. package/types/useDataGrid/VolatileRowsListener.d.ts +1 -3
  118. package/types/useDataGrid/index.d.ts +1 -1
  119. package/types/useDataGrid/initColumnDefinition.d.ts +1 -2
  120. package/types/useDataGrid/useDataGrid.d.ts +2 -3
  121. package/types/useDataList/index.d.ts +1 -1
  122. package/types/useDataList/useDataList.d.ts +2 -3
  123. package/cjs/Animations/BaseAnimation.js.map +0 -7
  124. package/cjs/Animations/Grow.js.map +0 -7
  125. package/cjs/Animations/GrowRight.js.map +0 -7
  126. package/cjs/Animations/GrowVertical.js.map +0 -7
  127. package/cjs/CheckableGroup.js.map +0 -7
  128. package/cjs/DeferRenderAfterComputation.js.map +0 -7
  129. package/cjs/FocusGroup/FocusGrid.js.map +0 -7
  130. package/cjs/FocusGroup/FocusGroup.js.map +0 -7
  131. package/cjs/FocusGroup/FocusGroupContext.js.map +0 -7
  132. package/cjs/FocusGroup/FocusGroupManager.js.map +0 -7
  133. package/cjs/FocusGroup/focusGroupManagerHoc.js.map +0 -7
  134. package/cjs/FocusGroup/index.js.map +0 -7
  135. package/cjs/FocusGroup/useFocusGroupItem.js.map +0 -7
  136. package/cjs/FocusGroup/utils/getNextCellPosition.js.map +0 -7
  137. package/cjs/GroupContext/Group.js.map +0 -7
  138. package/cjs/GroupContext/GroupContext.js.map +0 -7
  139. package/cjs/GroupContext/GroupItem.js.map +0 -7
  140. package/cjs/GroupContext/index.js.map +0 -7
  141. package/cjs/ScrollSync/ScrollSync.js.map +0 -7
  142. package/cjs/ScrollSync/ScrollSyncPane.js.map +0 -7
  143. package/cjs/ScrollSync/ScrollSyncProvider.js.map +0 -7
  144. package/cjs/ScrollSync/index.js.map +0 -7
  145. package/cjs/ScrollSync/useScrollSync.js.map +0 -7
  146. package/cjs/constants.js.map +0 -7
  147. package/cjs/createDataInstance/createInstancePlugin.js.map +0 -7
  148. package/cjs/createDataInstance/createInstanceRef.js.map +0 -7
  149. package/cjs/createDataInstance/utils.js.map +0 -7
  150. package/cjs/defer-render-hoc/index.js.map +0 -7
  151. package/cjs/dimsum.config.js.map +0 -7
  152. package/cjs/index.js.map +0 -7
  153. package/cjs/prop-types.js.map +0 -7
  154. package/cjs/react-spring/index.js.map +0 -7
  155. package/cjs/react-spring/renderprops.js.map +0 -7
  156. package/cjs/toolbar/ToolbarProvider.js.map +0 -7
  157. package/cjs/useDataGrid/VolatileRowsListener.js.map +0 -7
  158. package/cjs/useDataGrid/index.js.map +0 -7
  159. package/cjs/useDataGrid/initColumnDefinition.js.map +0 -7
  160. package/cjs/useDataGrid/useDataGrid.js.map +0 -7
  161. package/cjs/useDataList/index.js.map +0 -7
  162. package/cjs/useDataList/recordIterator.js.map +0 -7
  163. package/cjs/useDataList/useDataList.js.map +0 -7
  164. package/cjs/utils.js.map +0 -7
  165. package/cjs/virtualization/AutoHeightList.js.map +0 -7
  166. package/cjs/virtualization/FluidHeightList.js.map +0 -7
  167. package/cjs/virtualization/index.js.map +0 -7
  168. package/esm/Animations/BaseAnimation.js.map +0 -7
  169. package/esm/Animations/Grow.js.map +0 -7
  170. package/esm/Animations/GrowRight.js.map +0 -7
  171. package/esm/Animations/GrowVertical.js.map +0 -7
  172. package/esm/CheckableGroup.js.map +0 -7
  173. package/esm/DeferRenderAfterComputation.js.map +0 -7
  174. package/esm/FocusGroup/FocusGrid.js.map +0 -7
  175. package/esm/FocusGroup/FocusGroup.js.map +0 -7
  176. package/esm/FocusGroup/FocusGroupContext.js.map +0 -7
  177. package/esm/FocusGroup/FocusGroupManager.js.map +0 -7
  178. package/esm/FocusGroup/focusGroupManagerHoc.js.map +0 -7
  179. package/esm/FocusGroup/index.js.map +0 -7
  180. package/esm/FocusGroup/useFocusGroupItem.js.map +0 -7
  181. package/esm/FocusGroup/utils/getNextCellPosition.js.map +0 -7
  182. package/esm/GroupContext/Group.js.map +0 -7
  183. package/esm/GroupContext/GroupContext.js.map +0 -7
  184. package/esm/GroupContext/GroupItem.js.map +0 -7
  185. package/esm/GroupContext/index.js.map +0 -7
  186. package/esm/ScrollSync/ScrollSync.js.map +0 -7
  187. package/esm/ScrollSync/ScrollSyncPane.js.map +0 -7
  188. package/esm/ScrollSync/ScrollSyncProvider.js.map +0 -7
  189. package/esm/ScrollSync/index.js.map +0 -7
  190. package/esm/ScrollSync/useScrollSync.js.map +0 -7
  191. package/esm/constants.js.map +0 -7
  192. package/esm/createDataInstance/createInstancePlugin.js.map +0 -7
  193. package/esm/createDataInstance/createInstanceRef.js.map +0 -7
  194. package/esm/createDataInstance/utils.js.map +0 -7
  195. package/esm/defer-render-hoc/index.js.map +0 -7
  196. package/esm/dimsum.config.js.map +0 -7
  197. package/esm/index.js.map +0 -7
  198. package/esm/prop-types.js.map +0 -7
  199. package/esm/react-spring/index.js.map +0 -7
  200. package/esm/react-spring/renderprops.js.map +0 -7
  201. package/esm/toolbar/ToolbarProvider.js.map +0 -7
  202. package/esm/useDataGrid/VolatileRowsListener.js.map +0 -7
  203. package/esm/useDataGrid/index.js.map +0 -7
  204. package/esm/useDataGrid/initColumnDefinition.js.map +0 -7
  205. package/esm/useDataGrid/useDataGrid.js.map +0 -7
  206. package/esm/useDataList/index.js.map +0 -7
  207. package/esm/useDataList/recordIterator.js.map +0 -7
  208. package/esm/useDataList/useDataList.js.map +0 -7
  209. package/esm/utils.js.map +0 -7
  210. package/esm/virtualization/AutoHeightList.js.map +0 -7
  211. package/esm/virtualization/FluidHeightList.js.map +0 -7
  212. package/esm/virtualization/index.js.map +0 -7
@@ -1,8 +1,2 @@
1
- import * as React from "react";
2
- import { ScrollSync } from "./ScrollSync";
3
- import { ScrollSyncPaneHOC } from "./ScrollSyncPane";
4
- export {
5
- ScrollSync,
6
- ScrollSyncPaneHOC as ScrollSyncPane
7
- };
8
- //# sourceMappingURL=index.js.map
1
+ export { default as ScrollSync } from './ScrollSync.js';
2
+ export { default as ScrollSyncPane } from './ScrollSyncPane.js';
@@ -1,12 +1,8 @@
1
- import * as React from "react";
2
- const useScrollSync = (props) => {
1
+ function useScrollSync(props) {
3
2
  return {};
4
- };
3
+ }
4
+
5
5
  useScrollSync.propTypes = {};
6
6
  useScrollSync.defaultProps = {};
7
- var useScrollSync_default = useScrollSync;
8
- export {
9
- useScrollSync_default as default,
10
- useScrollSync
11
- };
12
- //# sourceMappingURL=useScrollSync.js.map
7
+
8
+ export { useScrollSync as default };
package/esm/constants.js CHANGED
@@ -1,41 +1,32 @@
1
- import * as React from "react";
2
1
  const DEFAULT_DELAY_OPEN = 200;
3
2
  const DEFAULT_DELAY_CLOSE = 300;
4
- const sizeOptions = ["small", "medium", "large", "x-large"];
5
- const AM = "am";
6
- const PM = "pm";
7
- const ARROW_UP = "ArrowUp";
8
- const ARROW_DOWN = "ArrowDown";
9
- const BACKSPACE = "Backspace";
10
- const ESCAPE = "Escape";
11
- const HOME = "Home";
12
- const SHIFT = "Shift";
13
- const END = "End";
14
- const HOUR_RANGE_12 = { min: 0, max: 12 };
15
- const HOUR_RANGE_24 = { min: 0, max: 24 };
16
- const GENERAL_TIME_RANGE = { min: 0, max: 59 };
17
- const PLACEHOLDER_TIME = {
18
- hour: "hour",
19
- minutes: "minutes",
20
- seconds: "seconds",
21
- meridiem: "meridiem"
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
22
20
  };
23
- export {
24
- AM,
25
- ARROW_DOWN,
26
- ARROW_UP,
27
- BACKSPACE,
28
- DEFAULT_DELAY_CLOSE,
29
- DEFAULT_DELAY_OPEN,
30
- END,
31
- ESCAPE,
32
- GENERAL_TIME_RANGE,
33
- HOME,
34
- HOUR_RANGE_12,
35
- HOUR_RANGE_24,
36
- PLACEHOLDER_TIME,
37
- PM,
38
- SHIFT,
39
- sizeOptions
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'
40
30
  };
41
- //# sourceMappingURL=constants.js.map
31
+
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,7 +1,19 @@
1
- import * as React from "react";
2
- const getDecoratorsFromHooks = (hooks, decorators) => {
3
- const nextDecorators = { ...decorators };
4
- Object.keys(hooks).forEach((decorator) => {
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.filter.js';
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';
8
+
9
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
10
+
11
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
12
+
13
+ function getDecoratorsFromHooks(hooks, decorators) {
14
+ const nextDecorators = _objectSpread({}, decorators);
15
+
16
+ Object.keys(hooks).forEach(decorator => {
5
17
  if (Array.isArray(decorators[decorator])) {
6
18
  nextDecorators[decorator] = [...decorators[decorator], hooks[decorator]];
7
19
  } else {
@@ -9,11 +21,10 @@ const getDecoratorsFromHooks = (hooks, decorators) => {
9
21
  }
10
22
  });
11
23
  return nextDecorators;
12
- };
13
- const createInstancePlugin = (name, hooks) => (decorators) => getDecoratorsFromHooks(hooks, decorators);
14
- var createInstancePlugin_default = createInstancePlugin;
15
- export {
16
- createInstancePlugin,
17
- createInstancePlugin_default as default
18
- };
19
- //# sourceMappingURL=createInstancePlugin.js.map
24
+ }
25
+
26
+ function createInstancePlugin(name, hooks) {
27
+ return decorators => getDecoratorsFromHooks(hooks, decorators);
28
+ }
29
+
30
+ export { createInstancePlugin as default };
@@ -1,12 +1,23 @@
1
- import * as React from "react";
2
- import { v4 as uuidv4 } from "uuid";
3
- import { useMemo, useRef, useState } from "react";
4
- import { orderBy } from "lodash";
5
- import {
6
- mergeInstance,
7
- registerHotKeysHookToInstance,
8
- registerStateHookToInstance
9
- } from "./utils";
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.filter.js';
3
+ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
4
+ import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
5
+ import 'core-js/modules/web.dom-collections.iterator.js';
6
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
7
+ import 'core-js/modules/esnext.iterator.constructor.js';
8
+ import 'core-js/modules/esnext.iterator.for-each.js';
9
+ import 'core-js/modules/esnext.async-iterator.reduce.js';
10
+ import 'core-js/modules/esnext.iterator.reduce.js';
11
+ import { v4 } from 'uuid';
12
+ import { useRef, useState, useMemo } from 'react';
13
+ import { orderBy } from 'lodash';
14
+ import { mergeInstance, registerStateHookToInstance, registerHotKeysHookToInstance } from './utils.js';
15
+
16
+ const _excluded = ["uuid", "data", "renderers", "plugins", "customDecorators"];
17
+
18
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
19
+
20
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
10
21
  const defaultDecorators = {
11
22
  instance: [],
12
23
  state: [],
@@ -14,54 +25,66 @@ const defaultDecorators = {
14
25
  renderers: [],
15
26
  composeData: []
16
27
  };
17
- function createDataInstanceRef({
18
- uuid: uuidProp,
19
- data,
20
- renderers,
21
- plugins,
22
- customDecorators,
23
- ...props
24
- }) {
25
- const instance = useRef();
26
- const [uuid] = useState(uuidProp || (() => uuidv4()));
28
+ function createDataInstanceRef(_ref) {
29
+ let {
30
+ uuid: uuidProp,
31
+ data,
32
+ renderers,
33
+ plugins,
34
+ customDecorators
35
+ } = _ref,
36
+ props = _objectWithoutProperties(_ref, _excluded);
37
+
38
+ // eslint-disable-next-line react-hooks/rules-of-hooks
39
+ const instance = useRef(); // eslint-disable-next-line react-hooks/rules-of-hooks
40
+
41
+ const [uuid] = useState(uuidProp || (() => v4()));
27
42
  instance.current = {
28
43
  uuid,
29
44
  state: {},
30
45
  actions: {},
31
46
  hotKeys: {},
47
+ // keyboard hotkeys to run specific actions
32
48
  originalData: data,
33
49
  records: [],
50
+ // item abstraction with meta data for originalData
34
51
  renderers,
52
+
35
53
  ref(key) {
36
- return (node) => instance.current.refs[key] = node;
54
+ // eslint-disable-next-line no-return-assign
55
+ return node => instance.current.refs[key] = node;
37
56
  },
57
+
38
58
  getInstance() {
39
59
  return instance.current;
40
60
  },
61
+
41
62
  props
42
- };
63
+ }; // eslint-disable-next-line react-hooks/rules-of-hooks
64
+
43
65
  const decorators = useMemo(() => {
44
- let nextDecorators = { ...defaultDecorators, ...customDecorators };
45
- plugins.forEach((plugin) => {
46
- if (!plugin)
47
- return;
66
+ let nextDecorators = _objectSpread(_objectSpread({}, defaultDecorators), customDecorators);
67
+
68
+ plugins.forEach(plugin => {
69
+ if (!plugin) return;
48
70
  nextDecorators = plugin(nextDecorators);
49
71
  });
50
- Object.keys(nextDecorators).forEach((key) => {
51
- if (Array.isArray(nextDecorators[key]))
52
- nextDecorators[key] = orderBy(nextDecorators[key], (item) => item.order);
72
+ Object.keys(nextDecorators).forEach(key => {
73
+ if (Array.isArray(nextDecorators[key])) nextDecorators[key] = orderBy(nextDecorators[key], item => item.order);
53
74
  });
54
75
  return nextDecorators;
55
- }, []);
76
+ }, []); // the plugins are defined on creation, but not changed at runtime
77
+ // todo: test if getting the hooks without registering them
78
+ // here would be beneficial to memoize instance and squeeze performance
79
+
56
80
  instance.current = decorators.instance.reduce(mergeInstance, instance.current);
57
81
  instance.current = decorators.state.reduce(registerStateHookToInstance, instance.current);
58
82
  instance.current = decorators.hotKeys.reduce(registerHotKeysHookToInstance, instance.current);
59
83
  instance.current.renderers = decorators.renderers.reduce((result, decorator) => decorator(result, instance.current), renderers);
60
- return { instance, decorators };
84
+ return {
85
+ instance,
86
+ decorators
87
+ };
61
88
  }
62
- var createInstanceRef_default = createDataInstanceRef;
63
- export {
64
- createDataInstanceRef,
65
- createInstanceRef_default as default
66
- };
67
- //# sourceMappingURL=createInstanceRef.js.map
89
+
90
+ export { createDataInstanceRef as default };
@@ -1,70 +1,107 @@
1
- import * as React from "react";
2
- const reducePropsGetter = (decorators = [], grid) => (props = {}, extraParams) => {
3
- let nextProps = props;
4
- decorators.forEach((decorator) => {
5
- nextProps = decorator(nextProps, grid, extraParams);
6
- });
7
- return nextProps;
1
+ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
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.reduce.js';
6
+ import 'core-js/modules/esnext.iterator.reduce.js';
7
+ import 'core-js/modules/web.dom-collections.iterator.js';
8
+ import 'core-js/modules/esnext.async-iterator.map.js';
9
+ import 'core-js/modules/esnext.iterator.map.js';
10
+ import 'core-js/modules/esnext.async-iterator.filter.js';
11
+ import 'core-js/modules/esnext.iterator.filter.js';
12
+
13
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
14
+
15
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
16
+ const reducePropsGetter = function () {
17
+ let decorators = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
18
+ let grid = arguments.length > 1 ? arguments[1] : undefined;
19
+ return function () {
20
+ let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
21
+ let extraParams = arguments.length > 1 ? arguments[1] : undefined;
22
+ let nextProps = props;
23
+ decorators.forEach(decorator => {
24
+ nextProps = decorator(nextProps, grid, extraParams);
25
+ });
26
+ return nextProps;
27
+ };
8
28
  };
9
- function evaluateTransforms(transforms, value, extraParams = {}, props = {}, grid) {
29
+ /* eslint-disable-next-line max-params */
30
+
31
+ function evaluateTransforms(transforms, value) {
32
+ let extraParams = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
33
+ let props = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
34
+ let grid = arguments.length > 4 ? arguments[4] : undefined;
10
35
  let nextProps = props;
11
- transforms.forEach((transform) => {
36
+ transforms.forEach(transform => {
12
37
  nextProps = transform(value, extraParams, nextProps, grid);
13
38
  });
14
39
  return nextProps;
15
40
  }
16
- function evaluateFormatters(formatters, value, extraParams = {}, grid) {
41
+ /* eslint-disable-next-line max-params */
42
+
43
+ function evaluateFormatters(formatters, value) {
44
+ let extraParams = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
45
+ let grid = arguments.length > 3 ? arguments[3] : undefined;
17
46
  return formatters.reduce((result, formatter) => formatter(result, extraParams, grid), value);
18
47
  }
19
- function composeFormatters(formatters, instance, getItemValue = (record) => record.data.name) {
20
- return (props) => formatters.reduce((result, formatter) => formatter(result, props, instance), getItemValue(props.record));
48
+ function composeFormatters(formatters, instance) {
49
+ let getItemValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : record => record.data.name;
50
+ // todo: make the formatters subscribe to the item props instead of getting the whole instance
51
+ // todo: addd should formatter update to memoize specific ones
52
+ return props => formatters.reduce((result, formatter) => formatter(result, props, instance), getItemValue(props.record));
21
53
  }
22
- const applyDecorators = (subject, decorators = [], ...args) => decorators.reduce((nextSubject, decorator) => decorator(nextSubject, ...args), subject);
54
+ const applyDecorators = function (subject) {
55
+ let decorators = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
56
+
57
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
58
+ args[_key - 2] = arguments[_key];
59
+ }
60
+
61
+ return decorators.reduce((nextSubject, decorator) => decorator(nextSubject, ...args), subject);
62
+ };
23
63
  const decorateColumns = (columns, decorators, grid) => {
24
64
  const nextColumns = applyDecorators(columns, decorators.decorateColumns, grid);
25
65
  return nextColumns.map((column, index) => applyDecorators(column, decorators.decorateColumn, grid, index));
26
66
  };
27
- const mergeInstance = (instance, instanceHook) => ({
28
- ...instance,
29
- ...instanceHook(instance)
30
- });
67
+ const mergeInstance = (instance, instanceHook) => _objectSpread(_objectSpread({}, instance), instanceHook(instance));
31
68
  const registerStateHookToInstance = (instance, stateHook) => {
32
- const { state, actions } = stateHook(instance);
33
- return {
34
- ...instance,
35
- state: {
36
- ...instance.state,
37
- ...state
38
- },
39
- actions: {
40
- ...instance.actions,
41
- ...actions
42
- }
43
- };
69
+ const {
70
+ state,
71
+ actions
72
+ } = stateHook(instance);
73
+ return _objectSpread(_objectSpread({}, instance), {}, {
74
+ state: _objectSpread(_objectSpread({}, instance.state), state),
75
+ actions: _objectSpread(_objectSpread({}, instance.actions), actions)
76
+ });
44
77
  };
45
- const reduceHotKey = (instance, { key, handler, options, allowDocumentHandler }) => ({
46
- ...instance,
47
- hotKeys: {
48
- ...instance.hotKeys,
49
- [key]: { handler, options, allowDocumentHandler }
50
- }
51
- });
78
+
79
+ const reduceHotKey = (instance, _ref) => {
80
+ let {
81
+ key,
82
+ handler,
83
+ options,
84
+ allowDocumentHandler
85
+ } = _ref;
86
+ return _objectSpread(_objectSpread({}, instance), {}, {
87
+ hotKeys: _objectSpread(_objectSpread({}, instance.hotKeys), {}, {
88
+ [key]: {
89
+ handler,
90
+ options,
91
+ allowDocumentHandler
92
+ }
93
+ })
94
+ });
95
+ };
96
+
52
97
  const registerHotKeysHookToInstance = (instance, hotKeysHook) => {
53
98
  const hotKeys = hotKeysHook(instance);
99
+
54
100
  if (Array.isArray(hotKeys)) {
55
101
  return hotKeys.reduce(reduceHotKey, instance);
56
102
  }
103
+
57
104
  return reduceHotKey(instance, hotKeys);
58
105
  };
59
- export {
60
- applyDecorators,
61
- composeFormatters,
62
- decorateColumns,
63
- evaluateFormatters,
64
- evaluateTransforms,
65
- mergeInstance,
66
- reducePropsGetter,
67
- registerHotKeysHookToInstance,
68
- registerStateHookToInstance
69
- };
70
- //# sourceMappingURL=utils.js.map
106
+
107
+ export { applyDecorators, composeFormatters, decorateColumns, evaluateFormatters, evaluateTransforms, mergeInstance, reducePropsGetter, registerHotKeysHookToInstance, registerStateHookToInstance };
@@ -1,27 +1,41 @@
1
- import * as React from "react";
2
- import React2, { PureComponent } from "react";
3
- import raf from "raf";
4
- import hoistNonReactStatic from "hoist-non-react-statics";
5
- const deferComponentRender = (WrappedComponent, fallback) => {
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.filter.js';
4
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
5
+ import 'core-js/modules/esnext.iterator.for-each.js';
6
+ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
7
+ import 'core-js/modules/web.dom-collections.iterator.js';
8
+ import { PureComponent } from 'react';
9
+ import raf from 'raf';
10
+ import hoistNonReactStatic from 'hoist-non-react-statics';
11
+ import { jsx } from 'react/jsx-runtime';
12
+
13
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
14
+
15
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
16
+ function deferComponentRender(WrappedComponent, fallback) {
6
17
  class DeferredRenderWrapper extends PureComponent {
7
18
  constructor() {
8
19
  super(...arguments);
9
- this.state = { shouldRender: false };
20
+ this.state = {
21
+ shouldRender: false
22
+ };
10
23
  }
24
+
11
25
  componentDidMount() {
12
- raf(() => raf(() => this.setState({ shouldRender: true })));
26
+ raf(() => raf(() => this.setState({
27
+ shouldRender: true
28
+ })));
13
29
  }
30
+
14
31
  render() {
15
- return this.state.shouldRender ? /* @__PURE__ */ React2.createElement(WrappedComponent, {
16
- ...this.props
17
- }) : fallback;
32
+ // eslint-disable-next-line react/destructuring-assignment
33
+ return this.state.shouldRender ? /*#__PURE__*/jsx(WrappedComponent, _objectSpread({}, this.props)) : fallback;
18
34
  }
35
+
19
36
  }
37
+
20
38
  return hoistNonReactStatic(DeferredRenderWrapper, WrappedComponent);
21
- };
22
- var defer_render_hoc_default = deferComponentRender;
23
- export {
24
- defer_render_hoc_default as default,
25
- deferComponentRender
26
- };
27
- //# sourceMappingURL=index.js.map
39
+ }
40
+
41
+ export { deferComponentRender as default };
@@ -1,10 +1,5 @@
1
- import * as React from "react";
2
- const dimsumConfig = {
3
- classNamePrefix: "em-ds"
1
+ var dimsum_config = {
2
+ classNamePrefix: 'em-ds'
4
3
  };
5
- var dimsum_config_default = dimsumConfig;
6
- export {
7
- dimsum_config_default as default,
8
- dimsumConfig
9
- };
10
- //# sourceMappingURL=dimsum.config.js.map
4
+
5
+ export { dimsum_config as default };
package/esm/index.js CHANGED
@@ -1,11 +1,5 @@
1
- import * as React from "react";
2
- import { ScrollSync, ScrollSyncPane } from "./ScrollSync";
3
- import { Group, GroupContext, GroupItem } from "./GroupContext";
4
- export {
5
- Group,
6
- GroupContext,
7
- GroupItem,
8
- ScrollSync,
9
- ScrollSyncPane
10
- };
11
- //# sourceMappingURL=index.js.map
1
+ export { default as ScrollSync } from './ScrollSync/ScrollSync.js';
2
+ export { default as ScrollSyncPane } from './ScrollSync/ScrollSyncPane.js';
3
+ export { default as Group } from './GroupContext/Group.js';
4
+ export { GroupContext } from './GroupContext/GroupContext.js';
5
+ export { default as GroupItem } from './GroupContext/GroupItem.js';
package/esm/prop-types.js CHANGED
@@ -1,87 +1,43 @@
1
- import * as React from "react";
2
- const dsBasicSizes = ["s", "m", "l"];
3
- const sizes = ["xsmall", "small", "medium", "large", "xlarge"];
4
- const iconSizes = [
5
- "xxs",
6
- "xs",
7
- "s",
8
- "m",
9
- "l",
10
- "xl",
11
- "xxl"
12
- ];
13
- const iconColors = [
14
- ["neutral", "900"],
15
- ["neutral", "0"],
16
- ["danger", "900"],
17
- ["warning", "500"],
18
- ["success", "900"],
19
- ["brand-primary", "600"]
20
- ];
1
+ const dsBasicSizes = ['s', 'm', 'l'];
2
+ const sizes = ['xsmall', 'small', 'medium', 'large', 'xlarge'];
3
+ const iconSizes = ['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl'];
4
+ const iconColors = [['neutral', '900'], ['neutral', '0'], ['danger', '900'], ['warning', '500'], ['success', '900'], ['brand-primary', '600']];
21
5
  const CHECKBOX_VARIANT = {
22
- DEFAULT: "variant-default",
23
- FOCUS: "variant-focus",
24
- ACTIVE: "variant-active",
25
- DISABLED: "variant-disabled",
26
- ERROR: "variant-error"
6
+ DEFAULT: 'variant-default',
7
+ FOCUS: 'variant-focus',
8
+ ACTIVE: 'variant-active',
9
+ DISABLED: 'variant-disabled',
10
+ ERROR: 'variant-error'
27
11
  };
28
- const checkboxVariants = [
29
- CHECKBOX_VARIANT.DEFAULT,
30
- CHECKBOX_VARIANT.FOCUS,
31
- CHECKBOX_VARIANT.ACTIVE,
32
- CHECKBOX_VARIANT.DISABLED,
33
- CHECKBOX_VARIANT.ERROR
34
- ];
12
+ const checkboxVariants = [CHECKBOX_VARIANT.DEFAULT, CHECKBOX_VARIANT.FOCUS, CHECKBOX_VARIANT.ACTIVE, CHECKBOX_VARIANT.DISABLED, CHECKBOX_VARIANT.ERROR];
35
13
  const COMBOBOX_VARIANT = {
36
- DEFAULT: "variant-default",
37
- FOCUS: "variant-focus-input",
38
- FOCUS_ICON: "variant-focus-icon",
39
- ACTIVE: "variant-active-input",
40
- ACTIVE_ICON: "variant-active-icon",
41
- DISABLED: "variant-disabled",
42
- ERROR: "variant-error"
14
+ DEFAULT: 'variant-default',
15
+ FOCUS: 'variant-focus-input',
16
+ FOCUS_ICON: 'variant-focus-icon',
17
+ ACTIVE: 'variant-active-input',
18
+ ACTIVE_ICON: 'variant-active-icon',
19
+ DISABLED: 'variant-disabled',
20
+ ERROR: 'variant-error'
43
21
  };
44
- const comboBoxVariants = [
45
- COMBOBOX_VARIANT.DEFAULT,
46
- COMBOBOX_VARIANT.FOCUS,
47
- COMBOBOX_VARIANT.FOCUS_ICON,
48
- COMBOBOX_VARIANT.ACTIVE,
49
- COMBOBOX_VARIANT.ACTIVE_ICON,
50
- COMBOBOX_VARIANT.DISABLED,
51
- COMBOBOX_VARIANT.ERROR
52
- ];
22
+ const comboBoxVariants = [COMBOBOX_VARIANT.DEFAULT, COMBOBOX_VARIANT.FOCUS, COMBOBOX_VARIANT.FOCUS_ICON, COMBOBOX_VARIANT.ACTIVE, COMBOBOX_VARIANT.ACTIVE_ICON, COMBOBOX_VARIANT.DISABLED, COMBOBOX_VARIANT.ERROR];
53
23
  const sizeVariants = {
54
- S: "s",
55
- M: "m",
56
- L: "l"
24
+ S: 's',
25
+ M: 'm',
26
+ L: 'l'
57
27
  };
58
28
  const position = {
59
- LEFT: "left",
60
- RIGHT: "right",
61
- CENTER: "center"
29
+ LEFT: 'left',
30
+ RIGHT: 'right',
31
+ CENTER: 'center'
62
32
  };
63
33
  const fontColor = {
64
- NEUTRAL500: "neutral500",
65
- NEUTRAL700: "neutral700"
34
+ NEUTRAL500: 'neutral500',
35
+ NEUTRAL700: 'neutral700'
66
36
  };
67
- const orientation = ["horizontal", "vertical"];
37
+ const orientation = ['horizontal', 'vertical'];
68
38
  const orientationVariants = {
69
- HORIZONTAL: "horizontal",
70
- VERTICAL: "vertical"
39
+ HORIZONTAL: 'horizontal',
40
+ VERTICAL: 'vertical'
71
41
  };
72
- export {
73
- CHECKBOX_VARIANT,
74
- COMBOBOX_VARIANT,
75
- checkboxVariants,
76
- comboBoxVariants,
77
- dsBasicSizes,
78
- fontColor,
79
- iconColors,
80
- iconSizes,
81
- orientation,
82
- orientationVariants,
83
- position,
84
- sizeVariants,
85
- sizes
86
- };
87
- //# sourceMappingURL=prop-types.js.map
42
+
43
+ export { CHECKBOX_VARIANT, COMBOBOX_VARIANT, checkboxVariants, comboBoxVariants, dsBasicSizes, fontColor, iconColors, iconSizes, orientation, orientationVariants, position, sizeVariants, sizes };
@@ -1,3 +1 @@
1
- import * as React from "react";
2
- export * from "react-spring/web";
3
- //# sourceMappingURL=index.js.map
1
+ export * from 'react-spring/web';
@@ -1,3 +1 @@
1
- import * as React from "react";
2
- export * from "react-spring/renderprops";
3
- //# sourceMappingURL=renderprops.js.map
1
+ export * from 'react-spring/renderprops';