@elliemae/ds-shared 2.0.0-alpha.8 → 2.0.0-next.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/Animations/BaseAnimation.js +24 -20
- package/cjs/Animations/Grow.js +30 -26
- package/cjs/Animations/GrowRight.js +30 -26
- package/cjs/Animations/GrowVertical.js +1 -0
- package/cjs/CheckableGroup.js +32 -23
- package/cjs/DeferRenderAfterComputation.js +8 -6
- package/cjs/FocusGroup/FocusGrid.js +38 -31
- package/cjs/FocusGroup/FocusGroup.js +29 -9
- package/cjs/FocusGroup/FocusGroupManager.js +3 -3
- package/cjs/FocusGroup/focusGroupManagerHoc.js +7 -1
- package/cjs/FocusGroup/useFocusGroupItem.js +8 -2
- package/cjs/FocusGroup/utils/getNextCellPosition.js +10 -9
- package/cjs/GroupContext/Group.js +11 -4
- package/cjs/GroupContext/GroupItem.js +6 -3
- package/cjs/ScrollSync/ScrollSync.js +5 -0
- package/cjs/ScrollSync/ScrollSyncPane.js +11 -2
- package/cjs/ScrollSync/ScrollSyncProvider.js +12 -6
- package/cjs/createDataInstance/createInstancePlugin.js +6 -0
- package/cjs/createDataInstance/createInstanceRef.js +8 -0
- package/cjs/createDataInstance/utils.js +57 -25
- package/cjs/defer-render-hoc/index.js +8 -2
- package/cjs/toolbar/ToolbarProvider.js +31 -21
- package/cjs/useDataGrid/VolatileRowsListener.js +5 -2
- package/cjs/useDataGrid/initColumnDefinition.js +26 -18
- package/cjs/useDataGrid/useDataGrid.js +42 -34
- package/cjs/useDataList/recordIterator.js +4 -1
- package/cjs/useDataList/useDataList.js +18 -4
- package/cjs/utils.js +8 -1
- package/cjs/virtualization/AutoHeightList.js +10 -8
- package/cjs/virtualization/FluidHeightList.js +15 -7
- package/cjs/virtualization/index.js +7 -6
- package/esm/Animations/BaseAnimation.js +24 -20
- package/esm/Animations/Grow.js +30 -26
- package/esm/Animations/GrowRight.js +30 -26
- package/esm/Animations/GrowVertical.js +1 -0
- package/esm/CheckableGroup.js +29 -19
- package/esm/DeferRenderAfterComputation.js +8 -6
- package/esm/FocusGroup/FocusGrid.js +27 -19
- package/esm/FocusGroup/FocusGroup.js +26 -6
- package/esm/FocusGroup/FocusGroupManager.js +1 -1
- package/esm/FocusGroup/focusGroupManagerHoc.js +7 -1
- package/esm/FocusGroup/useFocusGroupItem.js +8 -2
- package/esm/FocusGroup/utils/getNextCellPosition.js +10 -9
- package/esm/GroupContext/Group.js +11 -4
- package/esm/GroupContext/GroupItem.js +6 -3
- package/esm/ScrollSync/ScrollSync.js +5 -0
- package/esm/ScrollSync/ScrollSyncPane.js +11 -2
- package/esm/ScrollSync/ScrollSyncProvider.js +12 -6
- package/esm/createDataInstance/createInstancePlugin.js +6 -0
- package/esm/createDataInstance/createInstanceRef.js +8 -0
- package/esm/createDataInstance/utils.js +57 -25
- package/esm/defer-render-hoc/index.js +8 -2
- package/esm/toolbar/ToolbarProvider.js +30 -20
- package/esm/useDataGrid/VolatileRowsListener.js +4 -1
- package/esm/useDataGrid/initColumnDefinition.js +12 -4
- package/esm/useDataGrid/useDataGrid.js +26 -16
- package/esm/useDataList/recordIterator.js +4 -1
- package/esm/useDataList/useDataList.js +17 -3
- package/esm/utils.js +8 -1
- package/esm/virtualization/AutoHeightList.js +6 -3
- package/esm/virtualization/FluidHeightList.js +14 -6
- package/esm/virtualization/index.js +7 -6
- package/package.json +8 -4
- package/types/toolbar/ToolbarProvider.d.ts +1 -1
- package/types/useDataGrid/initColumnDefinition.d.ts +4 -3
- package/cjs/package.json +0 -7
- package/esm/package.json +0 -7
|
@@ -4,7 +4,10 @@ import FocusGroupContext from './FocusGroupContext.js';
|
|
|
4
4
|
|
|
5
5
|
const _excluded = ["register", "unregister"],
|
|
6
6
|
_excluded2 = ["register", "unregister"];
|
|
7
|
-
function useFocusGroupItem(
|
|
7
|
+
function useFocusGroupItem() {
|
|
8
|
+
let ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
9
|
+
let props = arguments.length > 1 ? arguments[1] : undefined;
|
|
10
|
+
|
|
8
11
|
const _ref = useContext(FocusGroupContext) || {},
|
|
9
12
|
{
|
|
10
13
|
register,
|
|
@@ -22,7 +25,10 @@ function useFocusGroupItem(ref = {}, props) {
|
|
|
22
25
|
if (!register) return {};
|
|
23
26
|
return otherActions;
|
|
24
27
|
}
|
|
25
|
-
const useFocusGroupWithState = (
|
|
28
|
+
const useFocusGroupWithState = function () {
|
|
29
|
+
let ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
30
|
+
let props = arguments.length > 1 ? arguments[1] : undefined;
|
|
31
|
+
|
|
26
32
|
const _ref2 = useContext(FocusGroupContext) || {},
|
|
27
33
|
{
|
|
28
34
|
register,
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
// eslint-disable-next-line max-statements
|
|
2
|
-
function getNextCellPosition({
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
function getNextCellPosition(_ref) {
|
|
3
|
+
let {
|
|
4
|
+
grid,
|
|
5
|
+
currentRow = 0,
|
|
6
|
+
currentCell = 0,
|
|
7
|
+
directionY,
|
|
8
|
+
directionX,
|
|
9
|
+
shouldWrapCells,
|
|
10
|
+
shouldWrapRows
|
|
11
|
+
} = _ref;
|
|
11
12
|
let nextRow = currentRow + directionY;
|
|
12
13
|
let nextCell = currentCell + directionX;
|
|
13
14
|
const rowCount = grid.length;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
2
3
|
import { Component } from 'react';
|
|
3
4
|
import { GroupContext } from './GroupContext.js';
|
|
4
5
|
|
|
@@ -59,9 +60,10 @@ class Group extends Component {
|
|
|
59
60
|
};
|
|
60
61
|
}
|
|
61
62
|
|
|
62
|
-
static getDerivedStateFromProps(nextProps, {
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
static getDerivedStateFromProps(nextProps, _ref) {
|
|
64
|
+
let {
|
|
65
|
+
prevValue
|
|
66
|
+
} = _ref;
|
|
65
67
|
if (nextProps.activeValue === prevValue) return null;
|
|
66
68
|
return {
|
|
67
69
|
activeValue: nextProps.activeValue,
|
|
@@ -69,7 +71,7 @@ class Group extends Component {
|
|
|
69
71
|
};
|
|
70
72
|
}
|
|
71
73
|
|
|
72
|
-
handleChange(e
|
|
74
|
+
handleChange(e) {
|
|
73
75
|
const {
|
|
74
76
|
multiple,
|
|
75
77
|
onChange
|
|
@@ -90,6 +92,11 @@ class Group extends Component {
|
|
|
90
92
|
this.setState({
|
|
91
93
|
activeValue: newValue
|
|
92
94
|
});
|
|
95
|
+
|
|
96
|
+
for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
97
|
+
rest[_key - 1] = arguments[_key];
|
|
98
|
+
}
|
|
99
|
+
|
|
93
100
|
if (onChange) onChange(newValue, ...rest);
|
|
94
101
|
}
|
|
95
102
|
|
|
@@ -6,8 +6,11 @@ const {
|
|
|
6
6
|
Consumer
|
|
7
7
|
} = GroupContext;
|
|
8
8
|
|
|
9
|
-
const GroupItem =
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const GroupItem = _ref => {
|
|
10
|
+
let {
|
|
11
|
+
render
|
|
12
|
+
} = _ref;
|
|
13
|
+
return /*#__PURE__*/_jsx(Consumer, {}, void 0, context => render(context));
|
|
14
|
+
};
|
|
12
15
|
|
|
13
16
|
export { GroupItem as default };
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
2
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
4
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
+
import 'core-js/modules/esnext.async-iterator.find.js';
|
|
7
|
+
import 'core-js/modules/esnext.iterator.find.js';
|
|
3
8
|
import React, { Component } from 'react';
|
|
4
9
|
|
|
5
10
|
const ScrollSyncContext = /*#__PURE__*/React.createContext();
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
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';
|
|
3
12
|
import { Component } from 'react';
|
|
4
13
|
import { ScrollSyncContext } from './ScrollSync.js';
|
|
5
14
|
import { jsx } from 'react/jsx-runtime';
|
|
@@ -9,8 +18,8 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
9
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; }
|
|
10
19
|
|
|
11
20
|
class ScrollSyncPane extends Component {
|
|
12
|
-
constructor(
|
|
13
|
-
super(...
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
14
23
|
|
|
15
24
|
_defineProperty(this, "toArray", groups => [].concat(groups));
|
|
16
25
|
}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
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';
|
|
2
7
|
import React from 'react';
|
|
3
8
|
import raf from 'raf';
|
|
4
9
|
|
|
@@ -7,12 +12,13 @@ const {
|
|
|
7
12
|
Provider
|
|
8
13
|
} = ScrollSyncContext;
|
|
9
14
|
|
|
10
|
-
function ScrollSyncProvider({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
function ScrollSyncProvider(_ref) {
|
|
16
|
+
let {
|
|
17
|
+
enabled,
|
|
18
|
+
horizontal,
|
|
19
|
+
vertical,
|
|
20
|
+
children
|
|
21
|
+
} = _ref;
|
|
16
22
|
useRef();
|
|
17
23
|
|
|
18
24
|
raf((scrolledPane, pane) => {
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
1
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';
|
|
2
8
|
|
|
3
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; }
|
|
4
10
|
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
1
3
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
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';
|
|
3
11
|
import { v4 } from 'uuid';
|
|
4
12
|
import { useRef, useState, useMemo } from 'react';
|
|
5
13
|
import { orderBy } from 'lodash';
|
|
@@ -1,19 +1,37 @@
|
|
|
1
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';
|
|
2
12
|
|
|
3
13
|
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
14
|
|
|
5
15
|
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; }
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
let
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
+
};
|
|
13
28
|
};
|
|
14
29
|
/* eslint-disable-next-line max-params */
|
|
15
30
|
|
|
16
|
-
function evaluateTransforms(transforms, value
|
|
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;
|
|
17
35
|
let nextProps = props;
|
|
18
36
|
transforms.forEach(transform => {
|
|
19
37
|
nextProps = transform(value, extraParams, nextProps, grid);
|
|
@@ -22,15 +40,26 @@ function evaluateTransforms(transforms, value, extraParams = {}, props = {}, gri
|
|
|
22
40
|
}
|
|
23
41
|
/* eslint-disable-next-line max-params */
|
|
24
42
|
|
|
25
|
-
function evaluateFormatters(formatters, value
|
|
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;
|
|
26
46
|
return formatters.reduce((result, formatter) => formatter(result, extraParams, grid), value);
|
|
27
47
|
}
|
|
28
|
-
function composeFormatters(formatters, instance
|
|
48
|
+
function composeFormatters(formatters, instance) {
|
|
49
|
+
let getItemValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : record => record.data.name;
|
|
29
50
|
// todo: make the formatters subscribe to the item props instead of getting the whole instance
|
|
30
51
|
// todo: addd should formatter update to memoize specific ones
|
|
31
52
|
return props => formatters.reduce((result, formatter) => formatter(result, props, instance), getItemValue(props.record));
|
|
32
53
|
}
|
|
33
|
-
const applyDecorators = (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
|
+
};
|
|
34
63
|
const decorateColumns = (columns, decorators, grid) => {
|
|
35
64
|
const nextColumns = applyDecorators(columns, decorators.decorateColumns, grid);
|
|
36
65
|
return nextColumns.map((column, index) => applyDecorators(column, decorators.decorateColumn, grid, index));
|
|
@@ -47,20 +76,23 @@ const registerStateHookToInstance = (instance, stateHook) => {
|
|
|
47
76
|
});
|
|
48
77
|
};
|
|
49
78
|
|
|
50
|
-
const reduceHotKey = (instance, {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
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
|
+
};
|
|
64
96
|
|
|
65
97
|
const registerHotKeysHookToInstance = (instance, hotKeysHook) => {
|
|
66
98
|
const hotKeys = hotKeysHook(instance);
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
6
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
7
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
2
8
|
import { PureComponent } from 'react';
|
|
3
9
|
import raf from 'raf';
|
|
4
10
|
import hoistNonReactStatic from 'hoist-non-react-statics';
|
|
@@ -9,8 +15,8 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
9
15
|
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; }
|
|
10
16
|
function deferComponentRender(WrappedComponent, fallback) {
|
|
11
17
|
class DeferredRenderWrapper extends PureComponent {
|
|
12
|
-
constructor(
|
|
13
|
-
super(...
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
14
20
|
|
|
15
21
|
_defineProperty(this, "state", {
|
|
16
22
|
shouldRender: false
|
|
@@ -1,8 +1,14 @@
|
|
|
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 React, { useRef, useState, useEffect, useMemo } from 'react';
|
|
4
|
-
import DSPopover from '@elliemae/ds-
|
|
5
|
-
import { useOnClickOutside } from '@elliemae/ds-utilities
|
|
10
|
+
import DSPopover from '@elliemae/ds-popper';
|
|
11
|
+
import { useOnClickOutside } from '@elliemae/ds-utilities';
|
|
6
12
|
import { jsx } from 'react/jsx-runtime';
|
|
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; }
|
|
@@ -24,12 +30,13 @@ const useScrollListener = (callback, dependencies) => {
|
|
|
24
30
|
|
|
25
31
|
const noop = () => null;
|
|
26
32
|
|
|
27
|
-
function ToolbarProvider({
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
function ToolbarProvider(_ref) {
|
|
34
|
+
let {
|
|
35
|
+
delay = 200,
|
|
36
|
+
children,
|
|
37
|
+
onHide = noop,
|
|
38
|
+
onShow = noop
|
|
39
|
+
} = _ref;
|
|
33
40
|
const showTimer = useRef();
|
|
34
41
|
const hideTimer = useRef();
|
|
35
42
|
const toolbarRef = useRef();
|
|
@@ -79,18 +86,21 @@ function ToolbarProvider({
|
|
|
79
86
|
content: tooltipState.renderer,
|
|
80
87
|
placement: "left",
|
|
81
88
|
referenceEl: tooltipState.reference,
|
|
82
|
-
renderer:
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
89
|
+
renderer: _ref2 => {
|
|
90
|
+
let {
|
|
91
|
+
as: Component,
|
|
92
|
+
style,
|
|
93
|
+
children: Content
|
|
94
|
+
} = _ref2;
|
|
95
|
+
return /*#__PURE__*/jsx("div", {
|
|
96
|
+
ref: toolbarRef,
|
|
97
|
+
onMouseEnter: e => show(tooltipState),
|
|
98
|
+
onMouseLeave: hide,
|
|
99
|
+
children: /*#__PURE__*/_jsx(Component, {
|
|
100
|
+
style: style
|
|
101
|
+
}, void 0, Content)
|
|
102
|
+
});
|
|
103
|
+
},
|
|
94
104
|
style: tooltipState.style,
|
|
95
105
|
visible: tooltipState.visible
|
|
96
106
|
})));
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
|
-
import
|
|
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 { safeCall } from '@elliemae/ds-utilities';
|
|
3
6
|
|
|
4
7
|
class VolatileRowsListener {
|
|
5
8
|
constructor() {
|
|
@@ -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
|
|
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
|
|
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:
|
|
53
|
+
className: "".concat(headerClassName, " ").concat(className)
|
|
47
54
|
})
|
|
48
55
|
})
|
|
49
56
|
});
|
|
50
57
|
});
|
|
51
|
-
function initColumnDefinition(
|
|
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
|
|
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
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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
|
|
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
|
|
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
|
|
16
|
-
|
|
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:
|
|
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
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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 };
|