@elliemae/ds-shared 2.0.0-alpha.1 → 2.0.0-alpha.13

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 (75) hide show
  1. package/cjs/Animations/BaseAnimation.js +24 -20
  2. package/cjs/Animations/Grow.js +30 -26
  3. package/cjs/Animations/GrowRight.js +30 -26
  4. package/cjs/Animations/GrowVertical.js +1 -0
  5. package/cjs/CheckableGroup.js +35 -26
  6. package/cjs/DeferRenderAfterComputation.js +9 -7
  7. package/cjs/FocusGroup/FocusGrid.js +43 -36
  8. package/cjs/FocusGroup/FocusGroup.js +32 -14
  9. package/cjs/FocusGroup/FocusGroupContext.js +1 -1
  10. package/cjs/FocusGroup/FocusGroupManager.js +7 -12
  11. package/cjs/FocusGroup/focusGroupManagerHoc.js +9 -3
  12. package/cjs/FocusGroup/index.js +2 -2
  13. package/cjs/FocusGroup/useFocusGroupItem.js +11 -5
  14. package/cjs/FocusGroup/utils/getNextCellPosition.js +10 -9
  15. package/cjs/GroupContext/Group.js +12 -5
  16. package/cjs/GroupContext/GroupContext.js +1 -1
  17. package/cjs/GroupContext/GroupItem.js +6 -3
  18. package/cjs/ScrollSync/ScrollSync.js +26 -25
  19. package/cjs/ScrollSync/ScrollSyncPane.js +16 -8
  20. package/cjs/ScrollSync/ScrollSyncProvider.js +15 -9
  21. package/cjs/ScrollSync/index.js +1 -1
  22. package/cjs/createDataInstance/createInstancePlugin.js +7 -1
  23. package/cjs/createDataInstance/createInstanceRef.js +10 -2
  24. package/cjs/createDataInstance/utils.js +58 -26
  25. package/cjs/defer-render-hoc/index.js +13 -8
  26. package/cjs/index.js +1 -1
  27. package/cjs/react-spring/index.js +1 -3
  28. package/cjs/react-spring/renderprops.js +1 -3
  29. package/cjs/toolbar/ToolbarProvider.js +37 -27
  30. package/cjs/useDataGrid/VolatileRowsListener.js +6 -8
  31. package/cjs/useDataGrid/initColumnDefinition.js +30 -22
  32. package/cjs/useDataGrid/useDataGrid.js +47 -41
  33. package/cjs/useDataList/index.js +1 -1
  34. package/cjs/useDataList/recordIterator.js +4 -1
  35. package/cjs/useDataList/useDataList.js +21 -7
  36. package/cjs/utils.js +9 -2
  37. package/cjs/virtualization/AutoHeightList.js +12 -10
  38. package/cjs/virtualization/FluidHeightList.js +18 -10
  39. package/cjs/virtualization/index.js +7 -6
  40. package/esm/Animations/BaseAnimation.js +24 -20
  41. package/esm/Animations/Grow.js +30 -26
  42. package/esm/Animations/GrowRight.js +30 -26
  43. package/esm/Animations/GrowVertical.js +1 -0
  44. package/esm/CheckableGroup.js +29 -19
  45. package/esm/DeferRenderAfterComputation.js +8 -6
  46. package/esm/FocusGroup/FocusGrid.js +27 -19
  47. package/esm/FocusGroup/FocusGroup.js +26 -8
  48. package/esm/FocusGroup/FocusGroupManager.js +4 -8
  49. package/esm/FocusGroup/focusGroupManagerHoc.js +7 -1
  50. package/esm/FocusGroup/useFocusGroupItem.js +8 -2
  51. package/esm/FocusGroup/utils/getNextCellPosition.js +10 -9
  52. package/esm/GroupContext/Group.js +11 -4
  53. package/esm/GroupContext/GroupItem.js +6 -3
  54. package/esm/ScrollSync/ScrollSync.js +22 -20
  55. package/esm/ScrollSync/ScrollSyncPane.js +14 -6
  56. package/esm/ScrollSync/ScrollSyncProvider.js +12 -6
  57. package/esm/createDataInstance/createInstancePlugin.js +6 -0
  58. package/esm/createDataInstance/createInstanceRef.js +8 -0
  59. package/esm/createDataInstance/utils.js +57 -25
  60. package/esm/defer-render-hoc/index.js +10 -5
  61. package/esm/toolbar/ToolbarProvider.js +30 -20
  62. package/esm/useDataGrid/VolatileRowsListener.js +5 -3
  63. package/esm/useDataGrid/initColumnDefinition.js +12 -4
  64. package/esm/useDataGrid/useDataGrid.js +26 -16
  65. package/esm/useDataList/recordIterator.js +4 -1
  66. package/esm/useDataList/useDataList.js +17 -3
  67. package/esm/utils.js +8 -1
  68. package/esm/virtualization/AutoHeightList.js +6 -3
  69. package/esm/virtualization/FluidHeightList.js +14 -6
  70. package/esm/virtualization/index.js +7 -6
  71. package/package.json +8 -4
  72. package/types/toolbar/ToolbarProvider.d.ts +1 -1
  73. package/types/useDataGrid/initColumnDefinition.d.ts +4 -3
  74. package/cjs/package.json +0 -7
  75. package/esm/package.json +0 -7
@@ -1,9 +1,11 @@
1
- import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
2
- import { safeCall } from '@elliemae/ds-utilities/utils';
1
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.for-each.js';
4
+ import { safeCall } from '@elliemae/ds-utilities';
3
5
 
4
6
  class VolatileRowsListener {
5
7
  constructor() {
6
- _defineProperty(this, "observers", []);
8
+ this.observers = [];
7
9
  }
8
10
 
9
11
  observe(listener) {
@@ -1,9 +1,15 @@
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';
1
6
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
7
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
8
+ import 'core-js/modules/web.dom-collections.iterator.js';
3
9
  import 'core-js/modules/es.string.replace.js';
4
10
  import 'react';
5
11
  import { v4 } from 'uuid';
6
- import { curry, get, cloneDeep, set, isFunction } from '@elliemae/ds-utilities/utils';
12
+ import { curry, get, cloneDeep, set, isFunction } from '@elliemae/ds-utilities';
7
13
 
8
14
  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; }
9
15
 
@@ -14,7 +20,8 @@ const appendHeaderFormatter = curry((formatter, column) => _objectSpread(_object
14
20
  formatters: [...get(column, 'header.formatters', []), formatter]
15
21
  })
16
22
  }));
17
- const appendCellFormatter = curry((formatter, column, path = 'formatters') => {
23
+ const appendCellFormatter = curry(function (formatter, column) {
24
+ let path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'formatters';
18
25
  const nextColumn = cloneDeep(column);
19
26
  const formatters = get(nextColumn, ['cell', path], []);
20
27
  const scrollingFormatters = get(nextColumn, 'cell.scrollingFormatters', []);
@@ -43,12 +50,13 @@ const mergeClassNameToColumnHeader = curry((className, column) => {
43
50
  return _objectSpread(_objectSpread({}, column), {}, {
44
51
  header: _objectSpread(_objectSpread({}, column.header), {}, {
45
52
  props: _objectSpread(_objectSpread({}, headerProps), {}, {
46
- className: `${headerClassName} ${className}`
53
+ className: "".concat(headerClassName, " ").concat(className)
47
54
  })
48
55
  })
49
56
  });
50
57
  });
51
- function initColumnDefinition(options = {}) {
58
+ function initColumnDefinition() {
59
+ let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
52
60
  // eslint-disable-next-line complexity
53
61
  return column => {
54
62
  // todo: clean this
@@ -1,12 +1,19 @@
1
1
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
2
2
  import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
3
- import { compose, cloneDeep, isObject, isEqual } from '@elliemae/ds-utilities/utils';
3
+ import 'core-js/modules/web.dom-collections.iterator.js';
4
+ import 'core-js/modules/esnext.async-iterator.map.js';
5
+ import 'core-js/modules/esnext.iterator.map.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 'core-js/modules/esnext.async-iterator.filter.js';
12
+ import 'core-js/modules/esnext.iterator.filter.js';
13
+ import { useDerivedStateFromProps, compose, cloneDeep, usePrevious, isObject, isEqual, setRef } from '@elliemae/ds-utilities';
4
14
  import { useRef, useState, useMemo } from 'react';
5
15
  import { v4 } from 'uuid';
6
16
  import * as resolve from 'table-resolver';
7
- import useDerivedStateFromProps from '@elliemae/ds-utilities/hooks/useDerivedStateFromProps';
8
- import usePrevious from '@elliemae/ds-utilities/hooks/usePrevious';
9
- import { setRef } from '@elliemae/ds-utilities/system';
10
17
  import initColumnDefinition from './initColumnDefinition.js';
11
18
  import { applyDecorators, decorateColumns, reducePropsGetter } from '../createDataInstance/utils.js';
12
19
  import VolatileRowsListener from './VolatileRowsListener.js';
@@ -132,18 +139,21 @@ function useDataGrid(_ref) {
132
139
  });
133
140
  }, instance.current);
134
141
 
135
- const reduceHotKey = (nextInstance, {
136
- key,
137
- handler,
138
- options
139
- }) => _objectSpread(_objectSpread({}, nextInstance), {}, {
140
- hotKeys: _objectSpread(_objectSpread({}, nextInstance.hotKeys), {}, {
141
- [key]: {
142
- handler,
143
- options
144
- }
145
- })
146
- });
142
+ const reduceHotKey = (nextInstance, _ref2) => {
143
+ let {
144
+ key,
145
+ handler,
146
+ options
147
+ } = _ref2;
148
+ return _objectSpread(_objectSpread({}, nextInstance), {}, {
149
+ hotKeys: _objectSpread(_objectSpread({}, nextInstance.hotKeys), {}, {
150
+ [key]: {
151
+ handler,
152
+ options
153
+ }
154
+ })
155
+ });
156
+ };
147
157
 
148
158
  instance.current = decorators.registerHotKeys.reduce((nextInstance, decorator) => {
149
159
  const hotKeys = decorator(nextInstance);
@@ -2,7 +2,10 @@ const defaultStrategy = () => {
2
2
  throw Error('Implement an iterator strategy for record iterator');
3
3
  };
4
4
 
5
- function recordIterator(records, strategy = defaultStrategy, decorators = [], instance) {
5
+ function recordIterator(records) {
6
+ let strategy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultStrategy;
7
+ let decorators = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
8
+ let instance = arguments.length > 3 ? arguments[3] : undefined;
6
9
  const nextRows = [];
7
10
  strategy({
8
11
  data: records,
@@ -1,7 +1,15 @@
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.filter.js';
3
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
4
+ import 'core-js/modules/esnext.iterator.for-each.js';
1
5
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
2
6
  import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
7
+ import 'core-js/modules/web.dom-collections.iterator.js';
8
+ import 'core-js/modules/esnext.async-iterator.reduce.js';
9
+ import 'core-js/modules/esnext.iterator.constructor.js';
10
+ import 'core-js/modules/esnext.iterator.reduce.js';
3
11
  import { useRef, useMemo } from 'react';
4
- import { setRef } from '@elliemae/ds-utilities/system';
12
+ import { setRef } from '@elliemae/ds-utilities';
5
13
  import get from 'lodash/get';
6
14
  import { reducePropsGetter, composeFormatters } from '../createDataInstance/utils.js';
7
15
  import { recordIterator } from './recordIterator.js';
@@ -12,8 +20,14 @@ const _excluded = ["data", "plugins", "renderers", "itemRenderer", "customDecora
12
20
  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
21
 
14
22
  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; }
15
- const getItemLabel = (record, nameKey = 'name') => get(record, ['data', nameKey]);
16
- const getItemChildren = (record, childrenKey = 'children') => get(record, ['data', childrenKey]);
23
+ const getItemLabel = function (record) {
24
+ let nameKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'name';
25
+ return get(record, ['data', nameKey]);
26
+ };
27
+ const getItemChildren = function (record) {
28
+ let childrenKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'children';
29
+ return get(record, ['data', childrenKey]);
30
+ };
17
31
  const listRenderers = {
18
32
  list: 'ul',
19
33
  item: 'li'
package/esm/utils.js CHANGED
@@ -1,4 +1,11 @@
1
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
2
+ import 'core-js/modules/esnext.iterator.for-each.js';
1
3
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
4
+ import 'core-js/modules/esnext.async-iterator.map.js';
5
+ import 'core-js/modules/esnext.iterator.map.js';
6
+ import 'core-js/modules/esnext.async-iterator.filter.js';
7
+ import 'core-js/modules/esnext.iterator.constructor.js';
8
+ import 'core-js/modules/esnext.iterator.filter.js';
2
9
 
3
10
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
4
11
 
@@ -61,7 +68,7 @@ const getTotalScroll = elem => {
61
68
  };
62
69
  };
63
70
  const getTransformProps = (x, y) => ({
64
- transform: `translate(${x}px, ${y}px)`
71
+ transform: "translate(".concat(x, "px, ").concat(y, "px)")
65
72
  });
66
73
  const listWithChildren = (list, childrenProp) => list.map(item => _objectSpread(_objectSpread({}, item), {}, {
67
74
  [childrenProp]: item[childrenProp] ? listWithChildren(item[childrenProp], childrenProp) : []
@@ -1,10 +1,13 @@
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';
1
6
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
2
7
  import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
3
8
  import { forwardRef, useRef } from 'react';
4
9
  import { FixedSizeList } from 'react-window';
5
- import { cx } from '@elliemae/ds-utilities/utils';
6
- import { mergeRefs } from '@elliemae/ds-utilities/system';
7
- import useWindowScrollerList from '@elliemae/ds-utilities/hooks/useWindowScrollerList';
10
+ import { useWindowScrollerList, mergeRefs, cx } from '@elliemae/ds-utilities';
8
11
  import { jsx } from 'react/jsx-runtime';
9
12
 
10
13
  const _excluded = ["itemCount", "className", "innerRef", "itemData", "itemKey", "itemSize", "outerRef", "component"];
@@ -1,3 +1,8 @@
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';
1
6
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
7
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
3
8
  import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
@@ -18,13 +23,16 @@ const FluidHeightList = /*#__PURE__*/forwardRef((_ref, ref) => {
18
23
 
19
24
  return /*#__PURE__*/_jsx(AutoSizer, {
20
25
  disableWidth: true
21
- }, void 0, ({
22
- height: fluidHeight
23
- }) => /*#__PURE__*/jsx(Component, _objectSpread(_objectSpread({}, props), {}, {
24
- ref: ref,
25
- height: fluidHeight - 32 // taking in count the margins of the list
26
+ }, void 0, _ref2 => {
27
+ let {
28
+ height: fluidHeight
29
+ } = _ref2;
30
+ return /*#__PURE__*/jsx(Component, _objectSpread(_objectSpread({}, props), {}, {
31
+ ref: ref,
32
+ height: fluidHeight - 32 // taking in count the margins of the list
26
33
 
27
- })));
34
+ }));
35
+ });
28
36
  });
29
37
 
30
38
  export { FluidHeightList };
@@ -3,12 +3,13 @@ export { FluidHeightList } from './FluidHeightList.js';
3
3
  import { AutoHeightList } from './AutoHeightList.js';
4
4
  export { AutoHeightList } from './AutoHeightList.js';
5
5
 
6
- function getVirtualListComponent({
7
- component: Component,
8
- fluid,
9
- height,
10
- autoHeight
11
- }) {
6
+ function getVirtualListComponent(_ref) {
7
+ let {
8
+ component: Component,
9
+ fluid,
10
+ height,
11
+ autoHeight
12
+ } = _ref;
12
13
  if (autoHeight) return AutoHeightList;
13
14
  if (fluid) return FluidHeightList;
14
15
  return Component;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-shared",
3
- "version": "2.0.0-alpha.1",
3
+ "version": "2.0.0-alpha.13",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Shared components and utilities",
6
6
  "module": "./esm/index.js",
@@ -213,12 +213,16 @@
213
213
  "generateSubmodules": true
214
214
  },
215
215
  "dependencies": {
216
- "@elliemae/ds-basic": "2.0.0-alpha.1",
217
- "@elliemae/ds-utilities": "2.0.0-alpha.1",
216
+ "@elliemae/ds-popper": "2.0.0-alpha.13",
217
+ "@elliemae/ds-utilities": "2.0.0-alpha.13",
218
218
  "hoist-non-react-statics": "~3.3.2",
219
+ "hotkeys-js": "~3.8.2",
220
+ "prop-types": "~15.7.2",
219
221
  "raf": "~3.4.1",
220
222
  "react-spring": "~8.0.27",
221
- "react-virtualized-auto-sizer": "~1.0.6",
223
+ "react-virtualized-auto-sizer": "~1.0.4",
224
+ "react-window": "~1.8.6",
225
+ "table-resolver": "~4.1.1",
222
226
  "uuid": "~8.3.2"
223
227
  },
224
228
  "peerDependencies": {
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  export declare const ToolbarContext: React.Context<unknown>;
3
- declare function ToolbarProvider({ delay, children, onHide, onShow, }: {
3
+ declare function ToolbarProvider({ delay, children, onHide, onShow }: {
4
4
  delay?: number | undefined;
5
5
  children: any;
6
6
  onHide?: (() => null) | undefined;
@@ -1,4 +1,5 @@
1
- export declare const appendHeaderFormatter: any;
2
- export declare const appendCellFormatter: any;
3
- export declare const mergeClassNameToColumnHeader: any;
1
+ /// <reference types="lodash" />
2
+ export declare const appendHeaderFormatter: import("lodash").CurriedFunction2<any, any, any>;
3
+ export declare const appendCellFormatter: import("lodash").CurriedFunction2<any, any, any>;
4
+ export declare const mergeClassNameToColumnHeader: import("lodash").CurriedFunction2<any, any, any>;
4
5
  export default function initColumnDefinition(options?: {}): (column: any) => any;
package/cjs/package.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "type": "commonjs",
3
- "sideEffects": [
4
- "*.css",
5
- "*.scss"
6
- ]
7
- }
package/esm/package.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "type": "module",
3
- "sideEffects": [
4
- "*.css",
5
- "*.scss"
6
- ]
7
- }