@elliemae/ds-shared 1.57.1-rc.0 → 2.0.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/Animations/BaseAnimation.js +25 -36
- package/cjs/Animations/Grow.js +31 -39
- package/cjs/Animations/GrowRight.js +31 -40
- package/cjs/Animations/GrowVertical.js +3 -2
- package/cjs/CheckableGroup.js +36 -50
- package/cjs/DeferRenderAfterComputation.js +12 -22
- package/cjs/FocusGroup/FocusGrid.js +94 -102
- package/cjs/FocusGroup/FocusGroup.js +215 -270
- package/cjs/FocusGroup/FocusGroupContext.js +1 -2
- package/cjs/FocusGroup/FocusGroupManager.js +88 -124
- package/cjs/FocusGroup/focusGroupManagerHoc.js +24 -29
- package/cjs/FocusGroup/index.js +14 -28
- package/cjs/FocusGroup/useFocusGroupItem.js +24 -27
- package/cjs/FocusGroup/utils/getNextCellPosition.js +14 -16
- package/cjs/GroupContext/Group.js +76 -104
- package/cjs/GroupContext/GroupContext.js +1 -2
- package/cjs/GroupContext/GroupItem.js +10 -11
- package/cjs/GroupContext/index.js +6 -15
- package/cjs/ScrollSync/ScrollSync.js +86 -112
- package/cjs/ScrollSync/ScrollSyncPane.js +49 -92
- package/cjs/ScrollSync/ScrollSyncProvider.js +32 -28
- package/cjs/ScrollSync/index.js +4 -14
- package/cjs/ScrollSync/useScrollSync.js +0 -1
- package/cjs/constants.js +43 -4
- package/cjs/createDataInstance/createInstancePlugin.js +6 -10
- package/cjs/createDataInstance/createInstanceRef.js +34 -42
- package/cjs/createDataInstance/utils.js +42 -76
- package/cjs/defer-render-hoc/index.js +19 -64
- package/cjs/dimsum.config.js +7 -0
- package/cjs/index.js +10 -21
- package/cjs/prop-types.js +59 -0
- package/cjs/react-spring/index.js +3 -6
- package/cjs/react-spring/renderprops.js +3 -6
- package/cjs/toolbar/ToolbarProvider.js +60 -81
- package/cjs/useDataGrid/VolatileRowsListener.js +13 -27
- package/cjs/useDataGrid/index.js +2 -17
- package/cjs/useDataGrid/initColumnDefinition.js +45 -53
- package/cjs/useDataGrid/useDataGrid.js +105 -152
- package/cjs/useDataList/index.js +2 -15
- package/cjs/useDataList/recordIterator.js +7 -11
- package/cjs/useDataList/useDataList.js +42 -63
- package/cjs/utils.js +39 -59
- package/cjs/virtualization/AutoHeightList.js +34 -27
- package/cjs/virtualization/FluidHeightList.js +23 -17
- package/cjs/virtualization/index.js +12 -18
- package/esm/Animations/BaseAnimation.js +24 -35
- package/esm/Animations/Grow.js +29 -37
- package/esm/Animations/GrowRight.js +29 -38
- package/esm/Animations/GrowVertical.js +3 -2
- package/esm/CheckableGroup.js +33 -46
- package/esm/DeferRenderAfterComputation.js +12 -21
- package/esm/FocusGroup/FocusGrid.js +86 -96
- package/esm/FocusGroup/FocusGroup.js +210 -263
- package/esm/FocusGroup/FocusGroupContext.js +0 -1
- package/esm/FocusGroup/FocusGroupManager.js +85 -115
- package/esm/FocusGroup/focusGroupManagerHoc.js +19 -23
- package/esm/FocusGroup/index.js +0 -14
- package/esm/FocusGroup/useFocusGroupItem.js +22 -25
- package/esm/FocusGroup/utils/getNextCellPosition.js +14 -16
- package/esm/GroupContext/Group.js +75 -96
- package/esm/GroupContext/GroupContext.js +1 -2
- package/esm/GroupContext/GroupItem.js +8 -9
- package/esm/GroupContext/index.js +0 -9
- package/esm/ScrollSync/ScrollSync.js +83 -104
- package/esm/ScrollSync/ScrollSyncPane.js +47 -83
- package/esm/ScrollSync/ScrollSyncProvider.js +31 -28
- package/esm/ScrollSync/index.js +0 -10
- package/esm/ScrollSync/useScrollSync.js +0 -1
- package/esm/constants.js +31 -5
- package/esm/createDataInstance/createInstancePlugin.js +5 -8
- package/esm/createDataInstance/createInstanceRef.js +29 -36
- package/esm/createDataInstance/utils.js +40 -74
- package/esm/defer-render-hoc/index.js +19 -57
- package/esm/dimsum.config.js +5 -0
- package/esm/index.js +0 -11
- package/esm/prop-types.js +43 -0
- package/esm/react-spring/index.js +1 -2
- package/esm/react-spring/renderprops.js +1 -2
- package/esm/toolbar/ToolbarProvider.js +55 -75
- package/esm/useDataGrid/VolatileRowsListener.js +12 -24
- package/esm/useDataGrid/index.js +0 -15
- package/esm/useDataGrid/initColumnDefinition.js +38 -45
- package/esm/useDataGrid/useDataGrid.js +85 -131
- package/esm/useDataList/index.js +0 -13
- package/esm/useDataList/recordIterator.js +7 -11
- package/esm/useDataList/useDataList.js +31 -51
- package/esm/utils.js +37 -57
- package/esm/virtualization/AutoHeightList.js +26 -19
- package/esm/virtualization/FluidHeightList.js +20 -14
- package/esm/virtualization/index.js +6 -12
- package/package.json +202 -13
- package/types/Animations/BaseAnimation.d.ts +12 -0
- package/types/Animations/Grow.d.ts +11 -0
- package/types/Animations/GrowRight.d.ts +11 -0
- package/types/Animations/GrowVertical.d.ts +1 -0
- package/types/CheckableGroup.d.ts +20 -0
- package/types/DeferRenderAfterComputation.d.ts +6 -0
- package/types/FocusGroup/FocusGrid.d.ts +10 -0
- package/types/FocusGroup/FocusGroup.d.ts +36 -0
- package/types/FocusGroup/FocusGroupContext.d.ts +3 -0
- package/types/FocusGroup/FocusGroupManager.d.ts +24 -0
- package/types/FocusGroup/focusGroupManagerHoc.d.ts +7 -0
- package/types/FocusGroup/index.d.ts +6 -0
- package/types/FocusGroup/useFocusGroupItem.d.ts +2 -0
- package/types/FocusGroup/utils/getNextCellPosition.d.ts +12 -0
- package/types/GroupContext/Group.d.ts +14 -0
- package/types/GroupContext/GroupContext.d.ts +2 -0
- package/types/GroupContext/GroupItem.d.ts +5 -0
- package/types/GroupContext/index.d.ts +3 -0
- package/types/ScrollSync/ScrollSync.d.ts +21 -0
- package/types/ScrollSync/ScrollSyncPane.d.ts +3 -0
- package/types/ScrollSync/ScrollSyncProvider.d.ts +12 -0
- package/types/ScrollSync/index.d.ts +2 -0
- package/types/ScrollSync/useScrollSync.d.ts +6 -0
- package/types/constants.d.ts +30 -0
- package/types/createDataInstance/createInstancePlugin.d.ts +1 -0
- package/types/createDataInstance/createInstanceRef.d.ts +12 -0
- package/types/createDataInstance/tests/createInstanceRef.test.d.ts +0 -0
- package/types/createDataInstance/utils.d.ts +9 -0
- package/types/dimsum.config.d.ts +4 -0
- package/types/index.d.ts +2 -0
- package/types/prop-types.d.ts +41 -0
- package/types/react-spring/index.d.ts +1 -0
- package/types/react-spring/renderprops.d.ts +1 -0
- package/types/toolbar/ToolbarProvider.d.ts +10 -0
- package/types/useDataGrid/VolatileRowsListener.d.ts +5 -0
- package/types/useDataGrid/index.d.ts +1 -0
- package/types/useDataGrid/initColumnDefinition.d.ts +4 -0
- package/types/useDataGrid/useDataGrid.d.ts +8 -0
- package/types/useDataList/index.d.ts +1 -0
- package/types/useDataList/recordIterator.d.ts +1 -0
- package/types/useDataList/useDataList.d.ts +13 -0
- package/types/utils.d.ts +22 -0
- package/types/virtualization/AutoHeightList.d.ts +2 -0
- package/types/virtualization/FluidHeightList.d.ts +2 -0
- package/types/virtualization/index.d.ts +9 -0
- package/Animations/BaseAnimation/package.json +0 -10
- package/Animations/Grow/package.json +0 -10
- package/Animations/GrowRight/package.json +0 -10
- package/Animations/GrowVertical/package.json +0 -10
- package/CheckableGroup/package.json +0 -10
- package/DeferRenderAfterComputation/package.json +0 -10
- package/FocusGroup/FocusGrid/package.json +0 -10
- package/FocusGroup/FocusGroup/package.json +0 -10
- package/FocusGroup/FocusGroupContext/package.json +0 -10
- package/FocusGroup/FocusGroupManager/package.json +0 -10
- package/FocusGroup/focusGroupManagerHoc/package.json +0 -10
- package/FocusGroup/package.json +0 -10
- package/FocusGroup/useFocusGroupItem/package.json +0 -10
- package/FocusGroup/utils/getNextCellPosition/package.json +0 -10
- package/GroupContext/Group/package.json +0 -10
- package/GroupContext/GroupContext/package.json +0 -10
- package/GroupContext/GroupItem/package.json +0 -10
- package/GroupContext/package.json +0 -10
- package/ScrollSync/ScrollSync/package.json +0 -10
- package/ScrollSync/ScrollSyncPane/package.json +0 -10
- package/ScrollSync/ScrollSyncProvider/package.json +0 -10
- package/ScrollSync/package.json +0 -10
- package/ScrollSync/useScrollSync/package.json +0 -10
- package/cjs/Animations/BaseAnimation.js.map +0 -1
- package/cjs/Animations/Grow.js.map +0 -1
- package/cjs/Animations/GrowRight.js.map +0 -1
- package/cjs/Animations/GrowVertical.js.map +0 -1
- package/cjs/CheckableGroup.js.map +0 -1
- package/cjs/DeferRenderAfterComputation.js.map +0 -1
- package/cjs/FocusGroup/FocusGrid.js.map +0 -1
- package/cjs/FocusGroup/FocusGroup.js.map +0 -1
- package/cjs/FocusGroup/FocusGroupContext.js.map +0 -1
- package/cjs/FocusGroup/FocusGroupManager.js.map +0 -1
- package/cjs/FocusGroup/focusGroupManagerHoc.js.map +0 -1
- package/cjs/FocusGroup/index.js.map +0 -1
- package/cjs/FocusGroup/useFocusGroupItem.js.map +0 -1
- package/cjs/FocusGroup/utils/getNextCellPosition.js.map +0 -1
- package/cjs/GroupContext/Group.js.map +0 -1
- package/cjs/GroupContext/GroupContext.js.map +0 -1
- package/cjs/GroupContext/GroupItem.js.map +0 -1
- package/cjs/GroupContext/index.js.map +0 -1
- package/cjs/ScrollSync/ScrollSync.js.map +0 -1
- package/cjs/ScrollSync/ScrollSyncPane.js.map +0 -1
- package/cjs/ScrollSync/ScrollSyncProvider.js.map +0 -1
- package/cjs/ScrollSync/index.js.map +0 -1
- package/cjs/ScrollSync/useScrollSync.js.map +0 -1
- package/cjs/constants.js.map +0 -1
- package/cjs/createDataInstance/createInstancePlugin.js.map +0 -1
- package/cjs/createDataInstance/createInstanceRef.js.map +0 -1
- package/cjs/createDataInstance/utils.js.map +0 -1
- package/cjs/defer-render-hoc/index.js.map +0 -1
- package/cjs/index.js.map +0 -1
- package/cjs/react-spring/index.js.map +0 -1
- package/cjs/react-spring/renderprops.js.map +0 -1
- package/cjs/toolbar/ToolbarProvider.js.map +0 -1
- package/cjs/useDataGrid/VolatileRowsListener.js.map +0 -1
- package/cjs/useDataGrid/index.js.map +0 -1
- package/cjs/useDataGrid/initColumnDefinition.js.map +0 -1
- package/cjs/useDataGrid/useDataGrid.js.map +0 -1
- package/cjs/useDataList/index.js.map +0 -1
- package/cjs/useDataList/recordIterator.js.map +0 -1
- package/cjs/useDataList/useDataList.js.map +0 -1
- package/cjs/utils.js.map +0 -1
- package/cjs/virtualization/AutoHeightList.js.map +0 -1
- package/cjs/virtualization/FluidHeightList.js.map +0 -1
- package/cjs/virtualization/index.js.map +0 -1
- package/constants/package.json +0 -10
- package/createDataInstance/createInstancePlugin/package.json +0 -10
- package/createDataInstance/createInstanceRef/package.json +0 -10
- package/createDataInstance/utils/package.json +0 -10
- package/defer-render-hoc/package.json +0 -10
- package/esm/Animations/BaseAnimation.js.map +0 -1
- package/esm/Animations/Grow.js.map +0 -1
- package/esm/Animations/GrowRight.js.map +0 -1
- package/esm/Animations/GrowVertical.js.map +0 -1
- package/esm/CheckableGroup.js.map +0 -1
- package/esm/DeferRenderAfterComputation.js.map +0 -1
- package/esm/FocusGroup/FocusGrid.js.map +0 -1
- package/esm/FocusGroup/FocusGroup.js.map +0 -1
- package/esm/FocusGroup/FocusGroupContext.js.map +0 -1
- package/esm/FocusGroup/FocusGroupManager.js.map +0 -1
- package/esm/FocusGroup/focusGroupManagerHoc.js.map +0 -1
- package/esm/FocusGroup/index.js.map +0 -1
- package/esm/FocusGroup/useFocusGroupItem.js.map +0 -1
- package/esm/FocusGroup/utils/getNextCellPosition.js.map +0 -1
- package/esm/GroupContext/Group.js.map +0 -1
- package/esm/GroupContext/GroupContext.js.map +0 -1
- package/esm/GroupContext/GroupItem.js.map +0 -1
- package/esm/GroupContext/index.js.map +0 -1
- package/esm/ScrollSync/ScrollSync.js.map +0 -1
- package/esm/ScrollSync/ScrollSyncPane.js.map +0 -1
- package/esm/ScrollSync/ScrollSyncProvider.js.map +0 -1
- package/esm/ScrollSync/index.js.map +0 -1
- package/esm/ScrollSync/useScrollSync.js.map +0 -1
- package/esm/constants.js.map +0 -1
- package/esm/createDataInstance/createInstancePlugin.js.map +0 -1
- package/esm/createDataInstance/createInstanceRef.js.map +0 -1
- package/esm/createDataInstance/utils.js.map +0 -1
- package/esm/defer-render-hoc/index.js.map +0 -1
- package/esm/index.js.map +0 -1
- package/esm/react-spring/index.js.map +0 -1
- package/esm/react-spring/renderprops.js.map +0 -1
- package/esm/toolbar/ToolbarProvider.js.map +0 -1
- package/esm/useDataGrid/VolatileRowsListener.js.map +0 -1
- package/esm/useDataGrid/index.js.map +0 -1
- package/esm/useDataGrid/initColumnDefinition.js.map +0 -1
- package/esm/useDataGrid/useDataGrid.js.map +0 -1
- package/esm/useDataList/index.js.map +0 -1
- package/esm/useDataList/recordIterator.js.map +0 -1
- package/esm/useDataList/useDataList.js.map +0 -1
- package/esm/utils.js.map +0 -1
- package/esm/virtualization/AutoHeightList.js.map +0 -1
- package/esm/virtualization/FluidHeightList.js.map +0 -1
- package/esm/virtualization/index.js.map +0 -1
- package/react-spring/package.json +0 -10
- package/react-spring/renderprops/package.json +0 -10
- package/toolbar/ToolbarProvider/package.json +0 -10
- package/useDataGrid/VolatileRowsListener/package.json +0 -10
- package/useDataGrid/initColumnDefinition/package.json +0 -10
- package/useDataGrid/package.json +0 -10
- package/useDataGrid/useDataGrid/package.json +0 -10
- package/useDataList/package.json +0 -10
- package/useDataList/recordIterator/package.json +0 -10
- package/useDataList/useDataList/package.json +0 -10
- package/utils/package.json +0 -10
- package/virtualization/AutoHeightList/package.json +0 -10
- package/virtualization/FluidHeightList/package.json +0 -10
- package/virtualization/package.json +0 -10
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
|
-
import _slicedToArray from '@babel/runtime/helpers/esm/slicedToArray';
|
|
3
2
|
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
3
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
4
4
|
import { v4 } from 'uuid';
|
|
5
5
|
import { useRef, useState, useMemo } from 'react';
|
|
6
6
|
import { orderBy } from 'lodash';
|
|
7
7
|
import { mergeInstance, registerStateHookToInstance, registerHotKeysHookToInstance } from './utils.js';
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
const _excluded = ["uuid", "data", "renderers", "plugins", "customDecorators"];
|
|
10
10
|
|
|
11
11
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
12
12
|
|
|
13
13
|
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; }
|
|
14
|
-
|
|
14
|
+
const defaultDecorators = {
|
|
15
15
|
instance: [],
|
|
16
16
|
state: [],
|
|
17
17
|
hotKeys: [],
|
|
@@ -19,24 +19,21 @@ var defaultDecorators = {
|
|
|
19
19
|
composeData: []
|
|
20
20
|
};
|
|
21
21
|
function createDataInstanceRef(_ref) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
let {
|
|
23
|
+
uuid: uuidProp,
|
|
24
|
+
data,
|
|
25
|
+
renderers,
|
|
26
|
+
plugins,
|
|
27
|
+
customDecorators
|
|
28
|
+
} = _ref,
|
|
27
29
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
28
30
|
|
|
29
31
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
var _useState = useState(uuidProp || function () {
|
|
33
|
-
return v4();
|
|
34
|
-
}),
|
|
35
|
-
_useState2 = _slicedToArray(_useState, 1),
|
|
36
|
-
uuid = _useState2[0];
|
|
32
|
+
const instance = useRef(); // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
37
33
|
|
|
34
|
+
const [uuid] = useState(uuidProp || (() => v4()));
|
|
38
35
|
instance.current = {
|
|
39
|
-
uuid
|
|
36
|
+
uuid,
|
|
40
37
|
state: {},
|
|
41
38
|
actions: {},
|
|
42
39
|
hotKeys: {},
|
|
@@ -44,30 +41,29 @@ function createDataInstanceRef(_ref) {
|
|
|
44
41
|
originalData: data,
|
|
45
42
|
records: [],
|
|
46
43
|
// item abstraction with meta data for originalData
|
|
47
|
-
renderers
|
|
48
|
-
|
|
44
|
+
renderers,
|
|
45
|
+
|
|
46
|
+
ref(key) {
|
|
49
47
|
// eslint-disable-next-line no-return-assign
|
|
50
|
-
return
|
|
51
|
-
return instance.current.refs[key] = node;
|
|
52
|
-
};
|
|
48
|
+
return node => instance.current.refs[key] = node;
|
|
53
49
|
},
|
|
54
|
-
|
|
50
|
+
|
|
51
|
+
getInstance() {
|
|
55
52
|
return instance.current;
|
|
56
53
|
},
|
|
57
|
-
|
|
54
|
+
|
|
55
|
+
props
|
|
58
56
|
}; // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
59
57
|
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
const decorators = useMemo(() => {
|
|
59
|
+
let nextDecorators = _objectSpread(_objectSpread({}, defaultDecorators), customDecorators);
|
|
62
60
|
|
|
63
|
-
plugins.forEach(
|
|
61
|
+
plugins.forEach(plugin => {
|
|
64
62
|
if (!plugin) return;
|
|
65
63
|
nextDecorators = plugin(nextDecorators);
|
|
66
64
|
});
|
|
67
|
-
Object.keys(nextDecorators).forEach(
|
|
68
|
-
if (Array.isArray(nextDecorators[key])) nextDecorators[key] = orderBy(nextDecorators[key],
|
|
69
|
-
return item.order;
|
|
70
|
-
});
|
|
65
|
+
Object.keys(nextDecorators).forEach(key => {
|
|
66
|
+
if (Array.isArray(nextDecorators[key])) nextDecorators[key] = orderBy(nextDecorators[key], item => item.order);
|
|
71
67
|
});
|
|
72
68
|
return nextDecorators;
|
|
73
69
|
}, []); // the plugins are defined on creation, but not changed at runtime
|
|
@@ -77,14 +73,11 @@ function createDataInstanceRef(_ref) {
|
|
|
77
73
|
instance.current = decorators.instance.reduce(mergeInstance, instance.current);
|
|
78
74
|
instance.current = decorators.state.reduce(registerStateHookToInstance, instance.current);
|
|
79
75
|
instance.current = decorators.hotKeys.reduce(registerHotKeysHookToInstance, instance.current);
|
|
80
|
-
instance.current.renderers = decorators.renderers.reduce(
|
|
81
|
-
return decorator(result, instance.current);
|
|
82
|
-
}, renderers);
|
|
76
|
+
instance.current.renderers = decorators.renderers.reduce((result, decorator) => decorator(result, instance.current), renderers);
|
|
83
77
|
return {
|
|
84
|
-
instance
|
|
85
|
-
decorators
|
|
78
|
+
instance,
|
|
79
|
+
decorators
|
|
86
80
|
};
|
|
87
81
|
}
|
|
88
82
|
|
|
89
83
|
export { createDataInstanceRef as default };
|
|
90
|
-
//# sourceMappingURL=createInstanceRef.js.map
|
|
@@ -1,102 +1,69 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
2
3
|
|
|
3
4
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
4
5
|
|
|
5
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var extraParams = arguments.length > 1 ? arguments[1] : undefined;
|
|
13
|
-
var nextProps = props;
|
|
14
|
-
decorators.forEach(function (decorator) {
|
|
15
|
-
nextProps = decorator(nextProps, grid, extraParams);
|
|
16
|
-
});
|
|
17
|
-
return nextProps;
|
|
18
|
-
};
|
|
7
|
+
const reducePropsGetter = (decorators = [], grid) => (props = {}, extraParams) => {
|
|
8
|
+
let nextProps = props;
|
|
9
|
+
decorators.forEach(decorator => {
|
|
10
|
+
nextProps = decorator(nextProps, grid, extraParams);
|
|
11
|
+
});
|
|
12
|
+
return nextProps;
|
|
19
13
|
};
|
|
20
14
|
/* eslint-disable-next-line max-params */
|
|
21
15
|
|
|
22
|
-
function evaluateTransforms(transforms, value) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var grid = arguments.length > 4 ? arguments[4] : undefined;
|
|
26
|
-
var nextProps = props;
|
|
27
|
-
transforms.forEach(function (transform) {
|
|
16
|
+
function evaluateTransforms(transforms, value, extraParams = {}, props = {}, grid) {
|
|
17
|
+
let nextProps = props;
|
|
18
|
+
transforms.forEach(transform => {
|
|
28
19
|
nextProps = transform(value, extraParams, nextProps, grid);
|
|
29
20
|
});
|
|
30
21
|
return nextProps;
|
|
31
22
|
}
|
|
32
23
|
/* eslint-disable-next-line max-params */
|
|
33
24
|
|
|
34
|
-
function evaluateFormatters(formatters, value) {
|
|
35
|
-
|
|
36
|
-
var grid = arguments.length > 3 ? arguments[3] : undefined;
|
|
37
|
-
return formatters.reduce(function (result, formatter) {
|
|
38
|
-
return formatter(result, extraParams, grid);
|
|
39
|
-
}, value);
|
|
25
|
+
function evaluateFormatters(formatters, value, extraParams = {}, grid) {
|
|
26
|
+
return formatters.reduce((result, formatter) => formatter(result, extraParams, grid), value);
|
|
40
27
|
}
|
|
41
|
-
function composeFormatters(formatters, instance) {
|
|
42
|
-
var getItemValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (record) {
|
|
43
|
-
return record.data.name;
|
|
44
|
-
};
|
|
28
|
+
function composeFormatters(formatters, instance, getItemValue = record => record.data.name) {
|
|
45
29
|
// todo: make the formatters subscribe to the item props instead of getting the whole instance
|
|
46
30
|
// todo: addd should formatter update to memoize specific ones
|
|
47
|
-
return
|
|
48
|
-
return formatters.reduce(function (result, formatter) {
|
|
49
|
-
return formatter(result, props, instance);
|
|
50
|
-
}, getItemValue(props.record));
|
|
51
|
-
};
|
|
31
|
+
return props => formatters.reduce((result, formatter) => formatter(result, props, instance), getItemValue(props.record));
|
|
52
32
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
args[_key - 2] = arguments[_key];
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return decorators.reduce(function (nextSubject, decorator) {
|
|
61
|
-
return decorator.apply(void 0, [nextSubject].concat(args));
|
|
62
|
-
}, subject);
|
|
33
|
+
const applyDecorators = (subject, decorators = [], ...args) => decorators.reduce((nextSubject, decorator) => decorator(nextSubject, ...args), subject);
|
|
34
|
+
const decorateColumns = (columns, decorators, grid) => {
|
|
35
|
+
const nextColumns = applyDecorators(columns, decorators.decorateColumns, grid);
|
|
36
|
+
return nextColumns.map((column, index) => applyDecorators(column, decorators.decorateColumn, grid, index));
|
|
63
37
|
};
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
};
|
|
70
|
-
var mergeInstance = function mergeInstance(instance, instanceHook) {
|
|
71
|
-
return _objectSpread(_objectSpread({}, instance), instanceHook(instance));
|
|
72
|
-
};
|
|
73
|
-
var registerStateHookToInstance = function registerStateHookToInstance(instance, stateHook) {
|
|
74
|
-
var _stateHook = stateHook(instance),
|
|
75
|
-
state = _stateHook.state,
|
|
76
|
-
actions = _stateHook.actions;
|
|
77
|
-
|
|
38
|
+
const mergeInstance = (instance, instanceHook) => _objectSpread(_objectSpread({}, instance), instanceHook(instance));
|
|
39
|
+
const registerStateHookToInstance = (instance, stateHook) => {
|
|
40
|
+
const {
|
|
41
|
+
state,
|
|
42
|
+
actions
|
|
43
|
+
} = stateHook(instance);
|
|
78
44
|
return _objectSpread(_objectSpread({}, instance), {}, {
|
|
79
45
|
state: _objectSpread(_objectSpread({}, instance.state), state),
|
|
80
46
|
actions: _objectSpread(_objectSpread({}, instance.actions), actions)
|
|
81
47
|
});
|
|
82
48
|
};
|
|
83
49
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
50
|
+
const reduceHotKey = (instance, {
|
|
51
|
+
key,
|
|
52
|
+
handler,
|
|
53
|
+
options,
|
|
54
|
+
allowDocumentHandler
|
|
55
|
+
}) => _objectSpread(_objectSpread({}, instance), {}, {
|
|
56
|
+
hotKeys: _objectSpread(_objectSpread({}, instance.hotKeys), {}, {
|
|
57
|
+
[key]: {
|
|
58
|
+
handler,
|
|
59
|
+
options,
|
|
60
|
+
allowDocumentHandler
|
|
61
|
+
}
|
|
62
|
+
})
|
|
63
|
+
});
|
|
97
64
|
|
|
98
|
-
|
|
99
|
-
|
|
65
|
+
const registerHotKeysHookToInstance = (instance, hotKeysHook) => {
|
|
66
|
+
const hotKeys = hotKeysHook(instance);
|
|
100
67
|
|
|
101
68
|
if (Array.isArray(hotKeys)) {
|
|
102
69
|
return hotKeys.reduce(reduceHotKey, instance);
|
|
@@ -106,4 +73,3 @@ var registerHotKeysHookToInstance = function registerHotKeysHookToInstance(insta
|
|
|
106
73
|
};
|
|
107
74
|
|
|
108
75
|
export { applyDecorators, composeFormatters, decorateColumns, evaluateFormatters, evaluateTransforms, mergeInstance, reducePropsGetter, registerHotKeysHookToInstance, registerStateHookToInstance };
|
|
109
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1,75 +1,37 @@
|
|
|
1
|
-
import _classCallCheck from '@babel/runtime/helpers/esm/classCallCheck';
|
|
2
|
-
import _createClass from '@babel/runtime/helpers/esm/createClass';
|
|
3
|
-
import _assertThisInitialized from '@babel/runtime/helpers/esm/assertThisInitialized';
|
|
4
|
-
import _inherits from '@babel/runtime/helpers/esm/inherits';
|
|
5
|
-
import _possibleConstructorReturn from '@babel/runtime/helpers/esm/possibleConstructorReturn';
|
|
6
|
-
import _getPrototypeOf from '@babel/runtime/helpers/esm/getPrototypeOf';
|
|
7
1
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
8
|
-
import
|
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
|
+
import { PureComponent } from 'react';
|
|
9
4
|
import raf from 'raf';
|
|
10
5
|
import hoistNonReactStatic from 'hoist-non-react-statics';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
11
7
|
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
15
|
-
/**
|
|
16
|
-
* Allows two animation frames to complete to allow other components to update
|
|
17
|
-
* and re-render before mounting and rendering an expensive `WrappedComponent`.
|
|
18
|
-
*
|
|
19
|
-
* @param WrappedComponent
|
|
20
|
-
* @param fallback
|
|
21
|
-
*/
|
|
8
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
22
9
|
|
|
10
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
23
11
|
function deferComponentRender(WrappedComponent, fallback) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
var _super = _createSuper(DeferredRenderWrapper);
|
|
28
|
-
|
|
29
|
-
function DeferredRenderWrapper() {
|
|
30
|
-
var _this;
|
|
31
|
-
|
|
32
|
-
_classCallCheck(this, DeferredRenderWrapper);
|
|
33
|
-
|
|
34
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
35
|
-
args[_key] = arguments[_key];
|
|
36
|
-
}
|
|
12
|
+
class DeferredRenderWrapper extends PureComponent {
|
|
13
|
+
constructor(...args) {
|
|
14
|
+
super(...args);
|
|
37
15
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
16
|
+
_defineProperty(this, "state", {
|
|
41
17
|
shouldRender: false
|
|
42
18
|
});
|
|
43
|
-
|
|
44
|
-
return _this;
|
|
45
19
|
}
|
|
46
20
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
21
|
+
componentDidMount() {
|
|
22
|
+
raf(() => raf(() => this.setState({
|
|
23
|
+
shouldRender: true
|
|
24
|
+
})));
|
|
25
|
+
}
|
|
51
26
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
}, {
|
|
61
|
-
key: "render",
|
|
62
|
-
value: function render() {
|
|
63
|
-
// eslint-disable-next-line react/destructuring-assignment
|
|
64
|
-
return this.state.shouldRender ? /*#__PURE__*/React.createElement(WrappedComponent, this.props) : fallback;
|
|
65
|
-
}
|
|
66
|
-
}]);
|
|
27
|
+
render() {
|
|
28
|
+
// eslint-disable-next-line react/destructuring-assignment
|
|
29
|
+
return this.state.shouldRender ? /*#__PURE__*/jsx(WrappedComponent, _objectSpread({}, this.props)) : fallback;
|
|
30
|
+
}
|
|
67
31
|
|
|
68
|
-
|
|
69
|
-
}(PureComponent);
|
|
32
|
+
}
|
|
70
33
|
|
|
71
34
|
return hoistNonReactStatic(DeferredRenderWrapper, WrappedComponent);
|
|
72
35
|
}
|
|
73
36
|
|
|
74
37
|
export { deferComponentRender as default };
|
|
75
|
-
//# sourceMappingURL=index.js.map
|
package/esm/index.js
CHANGED
|
@@ -3,14 +3,3 @@ export { default as ScrollSyncPane } from './ScrollSync/ScrollSyncPane.js';
|
|
|
3
3
|
export { default as Group } from './GroupContext/Group.js';
|
|
4
4
|
export { GroupContext } from './GroupContext/GroupContext.js';
|
|
5
5
|
export { default as GroupItem } from './GroupContext/GroupItem.js';
|
|
6
|
-
import '@babel/runtime/helpers/esm/classCallCheck';
|
|
7
|
-
import '@babel/runtime/helpers/esm/createClass';
|
|
8
|
-
import '@babel/runtime/helpers/esm/assertThisInitialized';
|
|
9
|
-
import '@babel/runtime/helpers/esm/inherits';
|
|
10
|
-
import '@babel/runtime/helpers/esm/possibleConstructorReturn';
|
|
11
|
-
import '@babel/runtime/helpers/esm/getPrototypeOf';
|
|
12
|
-
import '@babel/runtime/helpers/esm/defineProperty';
|
|
13
|
-
import 'react';
|
|
14
|
-
import '@babel/runtime/helpers/esm/extends';
|
|
15
|
-
import 'prop-types';
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,43 @@
|
|
|
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']];
|
|
5
|
+
const CHECKBOX_VARIANT = {
|
|
6
|
+
DEFAULT: 'variant-default',
|
|
7
|
+
FOCUS: 'variant-focus',
|
|
8
|
+
ACTIVE: 'variant-active',
|
|
9
|
+
DISABLED: 'variant-disabled',
|
|
10
|
+
ERROR: 'variant-error'
|
|
11
|
+
};
|
|
12
|
+
const checkboxVariants = [CHECKBOX_VARIANT.DEFAULT, CHECKBOX_VARIANT.FOCUS, CHECKBOX_VARIANT.ACTIVE, CHECKBOX_VARIANT.DISABLED, CHECKBOX_VARIANT.ERROR];
|
|
13
|
+
const COMBOBOX_VARIANT = {
|
|
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'
|
|
21
|
+
};
|
|
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];
|
|
23
|
+
const sizeVariants = {
|
|
24
|
+
S: 's',
|
|
25
|
+
M: 'm',
|
|
26
|
+
L: 'l'
|
|
27
|
+
};
|
|
28
|
+
const position = {
|
|
29
|
+
LEFT: 'left',
|
|
30
|
+
RIGHT: 'right',
|
|
31
|
+
CENTER: 'center'
|
|
32
|
+
};
|
|
33
|
+
const fontColor = {
|
|
34
|
+
NEUTRAL500: 'neutral500',
|
|
35
|
+
NEUTRAL700: 'neutral700'
|
|
36
|
+
};
|
|
37
|
+
const orientation = ['horizontal', 'vertical'];
|
|
38
|
+
const orientationVariants = {
|
|
39
|
+
HORIZONTAL: 'horizontal',
|
|
40
|
+
VERTICAL: 'vertical'
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export { CHECKBOX_VARIANT, COMBOBOX_VARIANT, checkboxVariants, comboBoxVariants, dsBasicSizes, fontColor, iconColors, iconSizes, orientation, orientationVariants, position, sizeVariants, sizes };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export * from 'react-spring/web
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export * from 'react-spring/web';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export * from 'react-spring/renderprops
|
|
2
|
-
//# sourceMappingURL=renderprops.js.map
|
|
1
|
+
export * from 'react-spring/renderprops';
|
|
@@ -1,116 +1,97 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
2
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
|
-
import
|
|
3
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
4
4
|
import React, { useRef, useState, useEffect, useMemo } from 'react';
|
|
5
|
-
import DSPopover from '@elliemae/ds-
|
|
6
|
-
import { useOnClickOutside } from '@elliemae/ds-utilities';
|
|
5
|
+
import DSPopover from '@elliemae/ds-basic/Popover';
|
|
6
|
+
import { useOnClickOutside } from '@elliemae/ds-utilities/hooks';
|
|
7
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
8
|
|
|
8
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; }
|
|
9
10
|
|
|
10
11
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
const ToolbarContext = /*#__PURE__*/React.createContext();
|
|
13
|
+
const {
|
|
14
|
+
Provider
|
|
15
|
+
} = ToolbarContext;
|
|
13
16
|
|
|
14
|
-
|
|
15
|
-
useEffect(
|
|
17
|
+
const useScrollListener = (callback, dependencies) => {
|
|
18
|
+
useEffect(() => {
|
|
16
19
|
window.addEventListener('scroll', callback, true);
|
|
17
|
-
return
|
|
20
|
+
return () => {
|
|
18
21
|
window.removeEventListener('scroll', callback, true);
|
|
19
22
|
};
|
|
20
23
|
}, [dependencies]);
|
|
21
24
|
};
|
|
22
25
|
|
|
23
|
-
|
|
24
|
-
return null;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
function ToolbarProvider(_ref) {
|
|
28
|
-
var _ref$delay = _ref.delay,
|
|
29
|
-
delay = _ref$delay === void 0 ? 200 : _ref$delay,
|
|
30
|
-
children = _ref.children,
|
|
31
|
-
_ref$onHide = _ref.onHide,
|
|
32
|
-
onHide = _ref$onHide === void 0 ? noop : _ref$onHide,
|
|
33
|
-
_ref$onShow = _ref.onShow,
|
|
34
|
-
onShow = _ref$onShow === void 0 ? noop : _ref$onShow;
|
|
35
|
-
var showTimer = useRef();
|
|
36
|
-
var hideTimer = useRef();
|
|
37
|
-
var toolbarRef = useRef();
|
|
26
|
+
const noop = () => null;
|
|
38
27
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
28
|
+
function ToolbarProvider({
|
|
29
|
+
delay = 200,
|
|
30
|
+
children,
|
|
31
|
+
onHide = noop,
|
|
32
|
+
onShow = noop
|
|
33
|
+
}) {
|
|
34
|
+
const showTimer = useRef();
|
|
35
|
+
const hideTimer = useRef();
|
|
36
|
+
const toolbarRef = useRef();
|
|
37
|
+
const [tooltipState, setTooltipState] = useState({});
|
|
43
38
|
|
|
44
|
-
|
|
39
|
+
const show = state => {
|
|
45
40
|
if (state.reference === tooltipState.reference) clearTimeout(hideTimer.current);
|
|
46
|
-
showTimer.current = setTimeout(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}));
|
|
50
|
-
}, delay);
|
|
41
|
+
showTimer.current = setTimeout(() => setTooltipState(_objectSpread(_objectSpread({}, state), {}, {
|
|
42
|
+
visible: true
|
|
43
|
+
})), delay);
|
|
51
44
|
onShow();
|
|
52
45
|
};
|
|
53
46
|
|
|
54
|
-
|
|
47
|
+
const hide = (e, force) => {
|
|
55
48
|
if (!force) clearTimeout(showTimer.current);
|
|
56
|
-
hideTimer.current = setTimeout(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
visible: false
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
}, 100);
|
|
49
|
+
hideTimer.current = setTimeout(() => setTooltipState(prevState => _objectSpread(_objectSpread({}, prevState), {}, {
|
|
50
|
+
visible: false
|
|
51
|
+
})), 100);
|
|
63
52
|
onHide(tooltipState, e);
|
|
64
53
|
};
|
|
65
54
|
|
|
66
|
-
useScrollListener(
|
|
67
|
-
|
|
68
|
-
}, tooltipState.visible);
|
|
69
|
-
useOnClickOutside(toolbarRef, function () {
|
|
70
|
-
return hide();
|
|
71
|
-
});
|
|
55
|
+
useScrollListener(e => hide(e, true), tooltipState.visible);
|
|
56
|
+
useOnClickOutside(toolbarRef, () => hide());
|
|
72
57
|
|
|
73
|
-
|
|
58
|
+
const keyDownHandler = e => {
|
|
74
59
|
if (e.key === 'Escape') {
|
|
75
60
|
hide(e);
|
|
76
61
|
}
|
|
77
62
|
};
|
|
78
63
|
|
|
79
|
-
useEffect(
|
|
64
|
+
useEffect(() => {
|
|
80
65
|
window.addEventListener('keydown', keyDownHandler);
|
|
81
|
-
return
|
|
66
|
+
return () => {
|
|
82
67
|
window.removeEventListener('keydown', keyDownHandler);
|
|
83
68
|
};
|
|
84
69
|
});
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}, [tooltipState.reference]);
|
|
92
|
-
return /*#__PURE__*/React.createElement(Provider, {
|
|
70
|
+
const value = useMemo(() => ({
|
|
71
|
+
state: tooltipState,
|
|
72
|
+
show,
|
|
73
|
+
hide
|
|
74
|
+
}), [tooltipState.reference]);
|
|
75
|
+
return /*#__PURE__*/_jsx(Provider, {
|
|
93
76
|
value: value
|
|
94
|
-
}, children, /*#__PURE__*/
|
|
77
|
+
}, void 0, children, /*#__PURE__*/jsx(DSPopover, _objectSpread(_objectSpread({
|
|
95
78
|
boundaries: "scrollParent"
|
|
96
|
-
}, tooltipState.options || {}, {
|
|
79
|
+
}, tooltipState.options || {}), {}, {
|
|
97
80
|
content: tooltipState.renderer,
|
|
98
81
|
placement: "left",
|
|
99
82
|
referenceEl: tooltipState.reference,
|
|
100
|
-
renderer:
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
onMouseLeave: hide
|
|
110
|
-
}, /*#__PURE__*/React.createElement(Component, {
|
|
83
|
+
renderer: ({
|
|
84
|
+
as: Component,
|
|
85
|
+
style,
|
|
86
|
+
children: Content
|
|
87
|
+
}) => /*#__PURE__*/jsx("div", {
|
|
88
|
+
ref: toolbarRef,
|
|
89
|
+
onMouseEnter: e => show(tooltipState),
|
|
90
|
+
onMouseLeave: hide,
|
|
91
|
+
children: /*#__PURE__*/_jsx(Component, {
|
|
111
92
|
style: style
|
|
112
|
-
}, Content)
|
|
113
|
-
},
|
|
93
|
+
}, void 0, Content)
|
|
94
|
+
}),
|
|
114
95
|
style: tooltipState.style,
|
|
115
96
|
visible: tooltipState.visible
|
|
116
97
|
})));
|
|
@@ -119,4 +100,3 @@ function ToolbarProvider(_ref) {
|
|
|
119
100
|
var ToolbarProvider$1 = /*#__PURE__*/React.memo(ToolbarProvider);
|
|
120
101
|
|
|
121
102
|
export { ToolbarContext, ToolbarProvider$1 as default };
|
|
122
|
-
//# sourceMappingURL=ToolbarProvider.js.map
|