@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
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
6
7
|
|
|
7
8
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
9
|
|
|
@@ -10,101 +11,67 @@ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_definePropert
|
|
|
10
11
|
|
|
11
12
|
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
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__default[
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var extraParams = arguments.length > 1 ? arguments[1] : undefined;
|
|
21
|
-
var nextProps = props;
|
|
22
|
-
decorators.forEach(function (decorator) {
|
|
23
|
-
nextProps = decorator(nextProps, grid, extraParams);
|
|
24
|
-
});
|
|
25
|
-
return nextProps;
|
|
26
|
-
};
|
|
14
|
+
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__default["default"](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 reducePropsGetter = (decorators = [], grid) => (props = {}, extraParams) => {
|
|
16
|
+
let nextProps = props;
|
|
17
|
+
decorators.forEach(decorator => {
|
|
18
|
+
nextProps = decorator(nextProps, grid, extraParams);
|
|
19
|
+
});
|
|
20
|
+
return nextProps;
|
|
27
21
|
};
|
|
28
22
|
/* eslint-disable-next-line max-params */
|
|
29
23
|
|
|
30
|
-
function evaluateTransforms(transforms, value) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
var grid = arguments.length > 4 ? arguments[4] : undefined;
|
|
34
|
-
var nextProps = props;
|
|
35
|
-
transforms.forEach(function (transform) {
|
|
24
|
+
function evaluateTransforms(transforms, value, extraParams = {}, props = {}, grid) {
|
|
25
|
+
let nextProps = props;
|
|
26
|
+
transforms.forEach(transform => {
|
|
36
27
|
nextProps = transform(value, extraParams, nextProps, grid);
|
|
37
28
|
});
|
|
38
29
|
return nextProps;
|
|
39
30
|
}
|
|
40
31
|
/* eslint-disable-next-line max-params */
|
|
41
32
|
|
|
42
|
-
function evaluateFormatters(formatters, value) {
|
|
43
|
-
|
|
44
|
-
var grid = arguments.length > 3 ? arguments[3] : undefined;
|
|
45
|
-
return formatters.reduce(function (result, formatter) {
|
|
46
|
-
return formatter(result, extraParams, grid);
|
|
47
|
-
}, value);
|
|
33
|
+
function evaluateFormatters(formatters, value, extraParams = {}, grid) {
|
|
34
|
+
return formatters.reduce((result, formatter) => formatter(result, extraParams, grid), value);
|
|
48
35
|
}
|
|
49
|
-
function composeFormatters(formatters, instance) {
|
|
50
|
-
var getItemValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (record) {
|
|
51
|
-
return record.data.name;
|
|
52
|
-
};
|
|
36
|
+
function composeFormatters(formatters, instance, getItemValue = record => record.data.name) {
|
|
53
37
|
// todo: make the formatters subscribe to the item props instead of getting the whole instance
|
|
54
38
|
// todo: addd should formatter update to memoize specific ones
|
|
55
|
-
return
|
|
56
|
-
return formatters.reduce(function (result, formatter) {
|
|
57
|
-
return formatter(result, props, instance);
|
|
58
|
-
}, getItemValue(props.record));
|
|
59
|
-
};
|
|
39
|
+
return props => formatters.reduce((result, formatter) => formatter(result, props, instance), getItemValue(props.record));
|
|
60
40
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
args[_key - 2] = arguments[_key];
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return decorators.reduce(function (nextSubject, decorator) {
|
|
69
|
-
return decorator.apply(void 0, [nextSubject].concat(args));
|
|
70
|
-
}, subject);
|
|
71
|
-
};
|
|
72
|
-
var decorateColumns = function decorateColumns(columns, decorators, grid) {
|
|
73
|
-
var nextColumns = applyDecorators(columns, decorators.decorateColumns, grid);
|
|
74
|
-
return nextColumns.map(function (column, index) {
|
|
75
|
-
return applyDecorators(column, decorators.decorateColumn, grid, index);
|
|
76
|
-
});
|
|
77
|
-
};
|
|
78
|
-
var mergeInstance = function mergeInstance(instance, instanceHook) {
|
|
79
|
-
return _objectSpread(_objectSpread({}, instance), instanceHook(instance));
|
|
41
|
+
const applyDecorators = (subject, decorators = [], ...args) => decorators.reduce((nextSubject, decorator) => decorator(nextSubject, ...args), subject);
|
|
42
|
+
const decorateColumns = (columns, decorators, grid) => {
|
|
43
|
+
const nextColumns = applyDecorators(columns, decorators.decorateColumns, grid);
|
|
44
|
+
return nextColumns.map((column, index) => applyDecorators(column, decorators.decorateColumn, grid, index));
|
|
80
45
|
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
46
|
+
const mergeInstance = (instance, instanceHook) => _objectSpread(_objectSpread({}, instance), instanceHook(instance));
|
|
47
|
+
const registerStateHookToInstance = (instance, stateHook) => {
|
|
48
|
+
const {
|
|
49
|
+
state,
|
|
50
|
+
actions
|
|
51
|
+
} = stateHook(instance);
|
|
86
52
|
return _objectSpread(_objectSpread({}, instance), {}, {
|
|
87
53
|
state: _objectSpread(_objectSpread({}, instance.state), state),
|
|
88
54
|
actions: _objectSpread(_objectSpread({}, instance.actions), actions)
|
|
89
55
|
});
|
|
90
56
|
};
|
|
91
57
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
58
|
+
const reduceHotKey = (instance, {
|
|
59
|
+
key,
|
|
60
|
+
handler,
|
|
61
|
+
options,
|
|
62
|
+
allowDocumentHandler
|
|
63
|
+
}) => _objectSpread(_objectSpread({}, instance), {}, {
|
|
64
|
+
hotKeys: _objectSpread(_objectSpread({}, instance.hotKeys), {}, {
|
|
65
|
+
[key]: {
|
|
66
|
+
handler,
|
|
67
|
+
options,
|
|
68
|
+
allowDocumentHandler
|
|
69
|
+
}
|
|
70
|
+
})
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const registerHotKeysHookToInstance = (instance, hotKeysHook) => {
|
|
74
|
+
const hotKeys = hotKeysHook(instance);
|
|
108
75
|
|
|
109
76
|
if (Array.isArray(hotKeys)) {
|
|
110
77
|
return hotKeys.reduce(reduceHotKey, instance);
|
|
@@ -122,4 +89,3 @@ exports.mergeInstance = mergeInstance;
|
|
|
122
89
|
exports.reducePropsGetter = reducePropsGetter;
|
|
123
90
|
exports.registerHotKeysHookToInstance = registerHotKeysHookToInstance;
|
|
124
91
|
exports.registerStateHookToInstance = registerStateHookToInstance;
|
|
125
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1,90 +1,45 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
|
|
4
|
-
var _createClass = require('@babel/runtime/helpers/createClass');
|
|
5
|
-
var _assertThisInitialized = require('@babel/runtime/helpers/assertThisInitialized');
|
|
6
|
-
var _inherits = require('@babel/runtime/helpers/inherits');
|
|
7
|
-
var _possibleConstructorReturn = require('@babel/runtime/helpers/possibleConstructorReturn');
|
|
8
|
-
var _getPrototypeOf = require('@babel/runtime/helpers/getPrototypeOf');
|
|
9
3
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
10
5
|
var React = require('react');
|
|
11
6
|
var raf = require('raf');
|
|
12
7
|
var hoistNonReactStatic = require('hoist-non-react-statics');
|
|
8
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
13
9
|
|
|
14
10
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
11
|
|
|
16
|
-
var _classCallCheck__default = /*#__PURE__*/_interopDefaultLegacy(_classCallCheck);
|
|
17
|
-
var _createClass__default = /*#__PURE__*/_interopDefaultLegacy(_createClass);
|
|
18
|
-
var _assertThisInitialized__default = /*#__PURE__*/_interopDefaultLegacy(_assertThisInitialized);
|
|
19
|
-
var _inherits__default = /*#__PURE__*/_interopDefaultLegacy(_inherits);
|
|
20
|
-
var _possibleConstructorReturn__default = /*#__PURE__*/_interopDefaultLegacy(_possibleConstructorReturn);
|
|
21
|
-
var _getPrototypeOf__default = /*#__PURE__*/_interopDefaultLegacy(_getPrototypeOf);
|
|
22
12
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
23
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
24
13
|
var raf__default = /*#__PURE__*/_interopDefaultLegacy(raf);
|
|
25
14
|
var hoistNonReactStatic__default = /*#__PURE__*/_interopDefaultLegacy(hoistNonReactStatic);
|
|
26
15
|
|
|
27
|
-
function
|
|
28
|
-
|
|
29
|
-
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; } }
|
|
30
|
-
/**
|
|
31
|
-
* Allows two animation frames to complete to allow other components to update
|
|
32
|
-
* and re-render before mounting and rendering an expensive `WrappedComponent`.
|
|
33
|
-
*
|
|
34
|
-
* @param WrappedComponent
|
|
35
|
-
* @param fallback
|
|
36
|
-
*/
|
|
16
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
37
17
|
|
|
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__default["default"](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; }
|
|
38
19
|
function deferComponentRender(WrappedComponent, fallback) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
var _super = _createSuper(DeferredRenderWrapper);
|
|
43
|
-
|
|
44
|
-
function DeferredRenderWrapper() {
|
|
45
|
-
var _this;
|
|
46
|
-
|
|
47
|
-
_classCallCheck__default['default'](this, DeferredRenderWrapper);
|
|
48
|
-
|
|
49
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
50
|
-
args[_key] = arguments[_key];
|
|
51
|
-
}
|
|
20
|
+
class DeferredRenderWrapper extends React.PureComponent {
|
|
21
|
+
constructor(...args) {
|
|
22
|
+
super(...args);
|
|
52
23
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "state", {
|
|
24
|
+
_defineProperty__default["default"](this, "state", {
|
|
56
25
|
shouldRender: false
|
|
57
26
|
});
|
|
58
|
-
|
|
59
|
-
return _this;
|
|
60
27
|
}
|
|
61
28
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
29
|
+
componentDidMount() {
|
|
30
|
+
raf__default["default"](() => raf__default["default"](() => this.setState({
|
|
31
|
+
shouldRender: true
|
|
32
|
+
})));
|
|
33
|
+
}
|
|
66
34
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
}, {
|
|
76
|
-
key: "render",
|
|
77
|
-
value: function render() {
|
|
78
|
-
// eslint-disable-next-line react/destructuring-assignment
|
|
79
|
-
return this.state.shouldRender ? /*#__PURE__*/React__default['default'].createElement(WrappedComponent, this.props) : fallback;
|
|
80
|
-
}
|
|
81
|
-
}]);
|
|
35
|
+
render() {
|
|
36
|
+
// eslint-disable-next-line react/destructuring-assignment
|
|
37
|
+
return this.state.shouldRender ? /*#__PURE__*/jsxRuntime.jsx(WrappedComponent, _objectSpread({}, this.props)) : fallback;
|
|
38
|
+
}
|
|
82
39
|
|
|
83
|
-
|
|
84
|
-
}(React.PureComponent);
|
|
40
|
+
}
|
|
85
41
|
|
|
86
|
-
return hoistNonReactStatic__default[
|
|
42
|
+
return hoistNonReactStatic__default["default"](DeferredRenderWrapper, WrappedComponent);
|
|
87
43
|
}
|
|
88
44
|
|
|
89
45
|
module.exports = deferComponentRender;
|
|
90
|
-
//# sourceMappingURL=index.js.map
|
package/cjs/index.js
CHANGED
|
@@ -2,27 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
require('@babel/runtime/helpers/classCallCheck');
|
|
11
|
-
require('@babel/runtime/helpers/createClass');
|
|
12
|
-
require('@babel/runtime/helpers/assertThisInitialized');
|
|
13
|
-
require('@babel/runtime/helpers/inherits');
|
|
14
|
-
require('@babel/runtime/helpers/possibleConstructorReturn');
|
|
15
|
-
require('@babel/runtime/helpers/getPrototypeOf');
|
|
16
|
-
require('@babel/runtime/helpers/defineProperty');
|
|
17
|
-
require('react');
|
|
18
|
-
require('@babel/runtime/helpers/extends');
|
|
19
|
-
require('prop-types');
|
|
5
|
+
var ScrollSync = require('./ScrollSync/ScrollSync.js');
|
|
6
|
+
var ScrollSyncPane = require('./ScrollSync/ScrollSyncPane.js');
|
|
7
|
+
var Group = require('./GroupContext/Group.js');
|
|
8
|
+
var GroupContext = require('./GroupContext/GroupContext.js');
|
|
9
|
+
var GroupItem = require('./GroupContext/GroupItem.js');
|
|
20
10
|
|
|
21
11
|
|
|
22
12
|
|
|
23
|
-
exports.ScrollSync =
|
|
24
|
-
exports.ScrollSyncPane =
|
|
25
|
-
exports.Group =
|
|
26
|
-
exports.GroupContext =
|
|
27
|
-
exports.GroupItem =
|
|
28
|
-
//# sourceMappingURL=index.js.map
|
|
13
|
+
exports.ScrollSync = ScrollSync["default"];
|
|
14
|
+
exports.ScrollSyncPane = ScrollSyncPane;
|
|
15
|
+
exports.Group = Group;
|
|
16
|
+
exports.GroupContext = GroupContext.GroupContext;
|
|
17
|
+
exports.GroupItem = GroupItem;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const dsBasicSizes = ['s', 'm', 'l'];
|
|
6
|
+
const sizes = ['xsmall', 'small', 'medium', 'large', 'xlarge'];
|
|
7
|
+
const iconSizes = ['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl'];
|
|
8
|
+
const iconColors = [['neutral', '900'], ['neutral', '0'], ['danger', '900'], ['warning', '500'], ['success', '900'], ['brand-primary', '600']];
|
|
9
|
+
const CHECKBOX_VARIANT = {
|
|
10
|
+
DEFAULT: 'variant-default',
|
|
11
|
+
FOCUS: 'variant-focus',
|
|
12
|
+
ACTIVE: 'variant-active',
|
|
13
|
+
DISABLED: 'variant-disabled',
|
|
14
|
+
ERROR: 'variant-error'
|
|
15
|
+
};
|
|
16
|
+
const checkboxVariants = [CHECKBOX_VARIANT.DEFAULT, CHECKBOX_VARIANT.FOCUS, CHECKBOX_VARIANT.ACTIVE, CHECKBOX_VARIANT.DISABLED, CHECKBOX_VARIANT.ERROR];
|
|
17
|
+
const COMBOBOX_VARIANT = {
|
|
18
|
+
DEFAULT: 'variant-default',
|
|
19
|
+
FOCUS: 'variant-focus-input',
|
|
20
|
+
FOCUS_ICON: 'variant-focus-icon',
|
|
21
|
+
ACTIVE: 'variant-active-input',
|
|
22
|
+
ACTIVE_ICON: 'variant-active-icon',
|
|
23
|
+
DISABLED: 'variant-disabled',
|
|
24
|
+
ERROR: 'variant-error'
|
|
25
|
+
};
|
|
26
|
+
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];
|
|
27
|
+
const sizeVariants = {
|
|
28
|
+
S: 's',
|
|
29
|
+
M: 'm',
|
|
30
|
+
L: 'l'
|
|
31
|
+
};
|
|
32
|
+
const position = {
|
|
33
|
+
LEFT: 'left',
|
|
34
|
+
RIGHT: 'right',
|
|
35
|
+
CENTER: 'center'
|
|
36
|
+
};
|
|
37
|
+
const fontColor = {
|
|
38
|
+
NEUTRAL500: 'neutral500',
|
|
39
|
+
NEUTRAL700: 'neutral700'
|
|
40
|
+
};
|
|
41
|
+
const orientation = ['horizontal', 'vertical'];
|
|
42
|
+
const orientationVariants = {
|
|
43
|
+
HORIZONTAL: 'horizontal',
|
|
44
|
+
VERTICAL: 'vertical'
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
exports.CHECKBOX_VARIANT = CHECKBOX_VARIANT;
|
|
48
|
+
exports.COMBOBOX_VARIANT = COMBOBOX_VARIANT;
|
|
49
|
+
exports.checkboxVariants = checkboxVariants;
|
|
50
|
+
exports.comboBoxVariants = comboBoxVariants;
|
|
51
|
+
exports.dsBasicSizes = dsBasicSizes;
|
|
52
|
+
exports.fontColor = fontColor;
|
|
53
|
+
exports.iconColors = iconColors;
|
|
54
|
+
exports.iconSizes = iconSizes;
|
|
55
|
+
exports.orientation = orientation;
|
|
56
|
+
exports.orientationVariants = orientationVariants;
|
|
57
|
+
exports.position = position;
|
|
58
|
+
exports.sizeVariants = sizeVariants;
|
|
59
|
+
exports.sizes = sizes;
|
|
@@ -2,16 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var web = require('react-spring/web');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
Object.keys(
|
|
9
|
+
Object.keys(web).forEach(function (k) {
|
|
10
10
|
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return web_cjs[k];
|
|
14
|
-
}
|
|
12
|
+
get: function () { return web[k]; }
|
|
15
13
|
});
|
|
16
14
|
});
|
|
17
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -2,16 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var renderprops = require('react-spring/renderprops');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
Object.keys(
|
|
9
|
+
Object.keys(renderprops).forEach(function (k) {
|
|
10
10
|
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return renderprops_cjs[k];
|
|
14
|
-
}
|
|
12
|
+
get: function () { return renderprops[k]; }
|
|
15
13
|
});
|
|
16
14
|
});
|
|
17
|
-
//# sourceMappingURL=renderprops.js.map
|
|
@@ -2,134 +2,113 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
6
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
|
-
|
|
7
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
8
8
|
var React = require('react');
|
|
9
|
-
var DSPopover = require('@elliemae/ds-
|
|
10
|
-
var
|
|
9
|
+
var DSPopover = require('@elliemae/ds-basic/Popover');
|
|
10
|
+
var hooks = require('@elliemae/ds-utilities/hooks');
|
|
11
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
11
12
|
|
|
12
13
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
14
|
|
|
14
|
-
var
|
|
15
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
15
16
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
16
|
-
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
17
17
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
18
18
|
var DSPopover__default = /*#__PURE__*/_interopDefaultLegacy(DSPopover);
|
|
19
19
|
|
|
20
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; }
|
|
21
21
|
|
|
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__default[
|
|
23
|
-
|
|
24
|
-
|
|
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__default["default"](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
|
+
const ToolbarContext = /*#__PURE__*/React__default["default"].createContext();
|
|
24
|
+
const {
|
|
25
|
+
Provider
|
|
26
|
+
} = ToolbarContext;
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
React.useEffect(
|
|
28
|
+
const useScrollListener = (callback, dependencies) => {
|
|
29
|
+
React.useEffect(() => {
|
|
28
30
|
window.addEventListener('scroll', callback, true);
|
|
29
|
-
return
|
|
31
|
+
return () => {
|
|
30
32
|
window.removeEventListener('scroll', callback, true);
|
|
31
33
|
};
|
|
32
34
|
}, [dependencies]);
|
|
33
35
|
};
|
|
34
36
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
const noop = () => null;
|
|
38
|
+
|
|
39
|
+
function ToolbarProvider({
|
|
40
|
+
delay = 200,
|
|
41
|
+
children,
|
|
42
|
+
onHide = noop,
|
|
43
|
+
onShow = noop
|
|
44
|
+
}) {
|
|
45
|
+
const showTimer = React.useRef();
|
|
46
|
+
const hideTimer = React.useRef();
|
|
47
|
+
const toolbarRef = React.useRef();
|
|
48
|
+
const [tooltipState, setTooltipState] = React.useState({});
|
|
38
49
|
|
|
39
|
-
|
|
40
|
-
var _ref$delay = _ref.delay,
|
|
41
|
-
delay = _ref$delay === void 0 ? 200 : _ref$delay,
|
|
42
|
-
children = _ref.children,
|
|
43
|
-
_ref$onHide = _ref.onHide,
|
|
44
|
-
onHide = _ref$onHide === void 0 ? noop : _ref$onHide,
|
|
45
|
-
_ref$onShow = _ref.onShow,
|
|
46
|
-
onShow = _ref$onShow === void 0 ? noop : _ref$onShow;
|
|
47
|
-
var showTimer = React.useRef();
|
|
48
|
-
var hideTimer = React.useRef();
|
|
49
|
-
var toolbarRef = React.useRef();
|
|
50
|
-
|
|
51
|
-
var _useState = React.useState({}),
|
|
52
|
-
_useState2 = _slicedToArray__default['default'](_useState, 2),
|
|
53
|
-
tooltipState = _useState2[0],
|
|
54
|
-
setTooltipState = _useState2[1];
|
|
55
|
-
|
|
56
|
-
var show = function show(state) {
|
|
50
|
+
const show = state => {
|
|
57
51
|
if (state.reference === tooltipState.reference) clearTimeout(hideTimer.current);
|
|
58
|
-
showTimer.current = setTimeout(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}));
|
|
62
|
-
}, delay);
|
|
52
|
+
showTimer.current = setTimeout(() => setTooltipState(_objectSpread(_objectSpread({}, state), {}, {
|
|
53
|
+
visible: true
|
|
54
|
+
})), delay);
|
|
63
55
|
onShow();
|
|
64
56
|
};
|
|
65
57
|
|
|
66
|
-
|
|
58
|
+
const hide = (e, force) => {
|
|
67
59
|
if (!force) clearTimeout(showTimer.current);
|
|
68
|
-
hideTimer.current = setTimeout(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
visible: false
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
}, 100);
|
|
60
|
+
hideTimer.current = setTimeout(() => setTooltipState(prevState => _objectSpread(_objectSpread({}, prevState), {}, {
|
|
61
|
+
visible: false
|
|
62
|
+
})), 100);
|
|
75
63
|
onHide(tooltipState, e);
|
|
76
64
|
};
|
|
77
65
|
|
|
78
|
-
useScrollListener(
|
|
79
|
-
|
|
80
|
-
}, tooltipState.visible);
|
|
81
|
-
dsUtilities.useOnClickOutside(toolbarRef, function () {
|
|
82
|
-
return hide();
|
|
83
|
-
});
|
|
66
|
+
useScrollListener(e => hide(e, true), tooltipState.visible);
|
|
67
|
+
hooks.useOnClickOutside(toolbarRef, () => hide());
|
|
84
68
|
|
|
85
|
-
|
|
69
|
+
const keyDownHandler = e => {
|
|
86
70
|
if (e.key === 'Escape') {
|
|
87
71
|
hide(e);
|
|
88
72
|
}
|
|
89
73
|
};
|
|
90
74
|
|
|
91
|
-
React.useEffect(
|
|
75
|
+
React.useEffect(() => {
|
|
92
76
|
window.addEventListener('keydown', keyDownHandler);
|
|
93
|
-
return
|
|
77
|
+
return () => {
|
|
94
78
|
window.removeEventListener('keydown', keyDownHandler);
|
|
95
79
|
};
|
|
96
80
|
});
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}, [tooltipState.reference]);
|
|
104
|
-
return /*#__PURE__*/React__default['default'].createElement(Provider, {
|
|
81
|
+
const value = React.useMemo(() => ({
|
|
82
|
+
state: tooltipState,
|
|
83
|
+
show,
|
|
84
|
+
hide
|
|
85
|
+
}), [tooltipState.reference]);
|
|
86
|
+
return /*#__PURE__*/_jsx__default["default"](Provider, {
|
|
105
87
|
value: value
|
|
106
|
-
}, children, /*#__PURE__*/
|
|
88
|
+
}, void 0, children, /*#__PURE__*/jsxRuntime.jsx(DSPopover__default["default"], _objectSpread(_objectSpread({
|
|
107
89
|
boundaries: "scrollParent"
|
|
108
|
-
}, tooltipState.options || {}, {
|
|
90
|
+
}, tooltipState.options || {}), {}, {
|
|
109
91
|
content: tooltipState.renderer,
|
|
110
92
|
placement: "left",
|
|
111
93
|
referenceEl: tooltipState.reference,
|
|
112
|
-
renderer:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
onMouseLeave: hide
|
|
122
|
-
}, /*#__PURE__*/React__default['default'].createElement(Component, {
|
|
94
|
+
renderer: ({
|
|
95
|
+
as: Component,
|
|
96
|
+
style,
|
|
97
|
+
children: Content
|
|
98
|
+
}) => /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
99
|
+
ref: toolbarRef,
|
|
100
|
+
onMouseEnter: e => show(tooltipState),
|
|
101
|
+
onMouseLeave: hide,
|
|
102
|
+
children: /*#__PURE__*/_jsx__default["default"](Component, {
|
|
123
103
|
style: style
|
|
124
|
-
}, Content)
|
|
125
|
-
},
|
|
104
|
+
}, void 0, Content)
|
|
105
|
+
}),
|
|
126
106
|
style: tooltipState.style,
|
|
127
107
|
visible: tooltipState.visible
|
|
128
108
|
})));
|
|
129
109
|
}
|
|
130
110
|
|
|
131
|
-
var ToolbarProvider$1 = /*#__PURE__*/React__default[
|
|
111
|
+
var ToolbarProvider$1 = /*#__PURE__*/React__default["default"].memo(ToolbarProvider);
|
|
132
112
|
|
|
133
113
|
exports.ToolbarContext = ToolbarContext;
|
|
134
|
-
exports[
|
|
135
|
-
//# sourceMappingURL=ToolbarProvider.js.map
|
|
114
|
+
exports["default"] = ToolbarProvider$1;
|