@elliemae/ds-shared 2.3.0-rc.1 → 3.0.0-alpha.1
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/dist/cjs/Animations/BaseAnimation.js +56 -0
- package/dist/cjs/Animations/BaseAnimation.js.map +7 -0
- package/dist/cjs/Animations/Grow.js +55 -0
- package/dist/cjs/Animations/Grow.js.map +7 -0
- package/dist/cjs/Animations/GrowRight.js +64 -0
- package/dist/cjs/Animations/GrowRight.js.map +7 -0
- package/dist/cjs/Animations/GrowVertical.js +47 -0
- package/dist/cjs/Animations/GrowVertical.js.map +7 -0
- package/dist/cjs/CheckableGroup.js +92 -0
- package/dist/cjs/CheckableGroup.js.map +7 -0
- package/dist/cjs/DeferRenderAfterComputation.js +52 -0
- package/dist/cjs/DeferRenderAfterComputation.js.map +7 -0
- package/dist/cjs/FocusGroup/FocusGrid.js +193 -0
- package/dist/cjs/FocusGroup/FocusGrid.js.map +7 -0
- package/dist/cjs/FocusGroup/FocusGroup.js +262 -0
- package/dist/cjs/FocusGroup/FocusGroup.js.map +7 -0
- package/dist/cjs/FocusGroup/FocusGroupContext.js +38 -0
- package/dist/cjs/FocusGroup/FocusGroupContext.js.map +7 -0
- package/dist/cjs/FocusGroup/FocusGroupManager.js +126 -0
- package/dist/cjs/FocusGroup/FocusGroupManager.js.map +7 -0
- package/dist/cjs/FocusGroup/focusGroupManagerHoc.js +82 -0
- package/dist/cjs/FocusGroup/focusGroupManagerHoc.js.map +7 -0
- package/dist/cjs/FocusGroup/index.js +47 -0
- package/dist/cjs/FocusGroup/index.js.map +7 -0
- package/dist/cjs/FocusGroup/useFocusGroupItem.js +81 -0
- package/dist/cjs/FocusGroup/useFocusGroupItem.js.map +7 -0
- package/dist/cjs/FocusGroup/utils/getNextCellPosition.js +80 -0
- package/dist/cjs/FocusGroup/utils/getNextCellPosition.js.map +7 -0
- package/dist/cjs/GroupContext/Group.js +115 -0
- package/dist/cjs/GroupContext/Group.js.map +7 -0
- package/dist/cjs/GroupContext/GroupContext.js +36 -0
- package/dist/cjs/GroupContext/GroupContext.js.map +7 -0
- package/dist/cjs/GroupContext/GroupItem.js +40 -0
- package/dist/cjs/GroupContext/GroupItem.js.map +7 -0
- package/dist/cjs/GroupContext/index.js +39 -0
- package/dist/cjs/GroupContext/index.js.map +7 -0
- package/dist/cjs/ScrollSync/ScrollSync.js +138 -0
- package/dist/cjs/ScrollSync/ScrollSync.js.map +7 -0
- package/dist/cjs/ScrollSync/ScrollSyncPane.js +89 -0
- package/dist/cjs/ScrollSync/ScrollSyncPane.js.map +7 -0
- package/dist/cjs/ScrollSync/ScrollSyncProvider.js +120 -0
- package/dist/cjs/ScrollSync/ScrollSyncProvider.js.map +7 -0
- package/dist/cjs/ScrollSync/index.js +37 -0
- package/dist/cjs/ScrollSync/index.js.map +7 -0
- package/dist/cjs/ScrollSync/useScrollSync.js +41 -0
- package/dist/cjs/ScrollSync/useScrollSync.js.map +7 -0
- package/dist/cjs/constants.js +70 -0
- package/dist/cjs/constants.js.map +7 -0
- package/dist/cjs/createDataInstance/createInstancePlugin.js +62 -0
- package/dist/cjs/createDataInstance/createInstancePlugin.js.map +7 -0
- package/dist/cjs/createDataInstance/createInstanceRef.js +124 -0
- package/dist/cjs/createDataInstance/createInstanceRef.js.map +7 -0
- package/dist/cjs/createDataInstance/utils.js +104 -0
- package/dist/cjs/createDataInstance/utils.js.map +7 -0
- package/dist/cjs/defer-render-hoc/index.js +68 -0
- package/dist/cjs/defer-render-hoc/index.js.map +7 -0
- package/dist/cjs/dimsum.config.js +39 -0
- package/dist/cjs/dimsum.config.js.map +7 -0
- package/dist/cjs/index.js +40 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/prop-types.js +116 -0
- package/dist/cjs/prop-types.js.map +7 -0
- package/dist/cjs/react-spring/index.js +28 -0
- package/dist/cjs/react-spring/index.js.map +7 -0
- package/dist/cjs/react-spring/renderprops.js +28 -0
- package/dist/cjs/react-spring/renderprops.js.map +7 -0
- package/dist/cjs/toolbar/ToolbarProvider.js +126 -0
- package/dist/cjs/toolbar/ToolbarProvider.js.map +7 -0
- package/dist/cjs/useDataGrid/VolatileRowsListener.js +49 -0
- package/dist/cjs/useDataGrid/VolatileRowsListener.js.map +7 -0
- package/dist/cjs/useDataGrid/index.js +36 -0
- package/dist/cjs/useDataGrid/index.js.map +7 -0
- package/dist/cjs/useDataGrid/initColumnDefinition.js +147 -0
- package/dist/cjs/useDataGrid/initColumnDefinition.js.map +7 -0
- package/dist/cjs/useDataGrid/useDataGrid.js +216 -0
- package/dist/cjs/useDataGrid/useDataGrid.js.map +7 -0
- package/dist/cjs/useDataList/index.js +36 -0
- package/dist/cjs/useDataList/index.js.map +7 -0
- package/dist/cjs/useDataList/recordIterator.js +55 -0
- package/dist/cjs/useDataList/recordIterator.js.map +7 -0
- package/dist/cjs/useDataList/useDataList.js +126 -0
- package/dist/cjs/useDataList/useDataList.js.map +7 -0
- package/dist/cjs/utils.js +123 -0
- package/dist/cjs/utils.js.map +7 -0
- package/dist/cjs/virtualization/AutoHeightList.js +106 -0
- package/dist/cjs/virtualization/AutoHeightList.js.map +7 -0
- package/dist/cjs/virtualization/FluidHeightList.js +74 -0
- package/dist/cjs/virtualization/FluidHeightList.js.map +7 -0
- package/dist/cjs/virtualization/index.js +50 -0
- package/dist/cjs/virtualization/index.js.map +7 -0
- package/dist/esm/Animations/BaseAnimation.js +27 -0
- package/dist/esm/Animations/BaseAnimation.js.map +7 -0
- package/dist/esm/Animations/Grow.js +26 -0
- package/dist/esm/Animations/Grow.js.map +7 -0
- package/dist/esm/Animations/GrowRight.js +35 -0
- package/dist/esm/Animations/GrowRight.js.map +7 -0
- package/dist/esm/Animations/GrowVertical.js +29 -0
- package/dist/esm/Animations/GrowVertical.js.map +7 -0
- package/dist/esm/CheckableGroup.js +65 -0
- package/dist/esm/CheckableGroup.js.map +7 -0
- package/dist/esm/DeferRenderAfterComputation.js +23 -0
- package/dist/esm/DeferRenderAfterComputation.js.map +7 -0
- package/dist/esm/FocusGroup/FocusGrid.js +166 -0
- package/dist/esm/FocusGroup/FocusGrid.js.map +7 -0
- package/{esm → dist/esm}/FocusGroup/FocusGroup.js +70 -136
- package/dist/esm/FocusGroup/FocusGroup.js.map +7 -0
- package/dist/esm/FocusGroup/FocusGroupContext.js +9 -0
- package/dist/esm/FocusGroup/FocusGroupContext.js.map +7 -0
- package/{esm → dist/esm}/FocusGroup/FocusGroupManager.js +24 -38
- package/dist/esm/FocusGroup/FocusGroupManager.js.map +7 -0
- package/dist/esm/FocusGroup/focusGroupManagerHoc.js +55 -0
- package/dist/esm/FocusGroup/focusGroupManagerHoc.js.map +7 -0
- package/dist/esm/FocusGroup/index.js +18 -0
- package/dist/esm/FocusGroup/index.js.map +7 -0
- package/dist/esm/FocusGroup/useFocusGroupItem.js +53 -0
- package/dist/esm/FocusGroup/useFocusGroupItem.js.map +7 -0
- package/{esm → dist/esm}/FocusGroup/utils/getNextCellPosition.js +18 -25
- package/dist/esm/FocusGroup/utils/getNextCellPosition.js.map +7 -0
- package/dist/esm/GroupContext/Group.js +86 -0
- package/dist/esm/GroupContext/Group.js.map +7 -0
- package/dist/esm/GroupContext/GroupContext.js +7 -0
- package/dist/esm/GroupContext/GroupContext.js.map +7 -0
- package/dist/esm/GroupContext/GroupItem.js +11 -0
- package/dist/esm/GroupContext/GroupItem.js.map +7 -0
- package/dist/esm/GroupContext/index.js +10 -0
- package/dist/esm/GroupContext/index.js.map +7 -0
- package/{esm → dist/esm}/ScrollSync/ScrollSync.js +30 -64
- package/dist/esm/ScrollSync/ScrollSync.js.map +7 -0
- package/dist/esm/ScrollSync/ScrollSyncPane.js +62 -0
- package/dist/esm/ScrollSync/ScrollSyncPane.js.map +7 -0
- package/dist/esm/ScrollSync/ScrollSyncProvider.js +91 -0
- package/dist/esm/ScrollSync/ScrollSyncProvider.js.map +7 -0
- package/dist/esm/ScrollSync/index.js +8 -0
- package/dist/esm/ScrollSync/index.js.map +7 -0
- package/dist/esm/ScrollSync/useScrollSync.js +12 -0
- package/dist/esm/ScrollSync/useScrollSync.js.map +7 -0
- package/dist/esm/constants.js +41 -0
- package/dist/esm/constants.js.map +7 -0
- package/dist/esm/createDataInstance/createInstancePlugin.js +35 -0
- package/dist/esm/createDataInstance/createInstancePlugin.js.map +7 -0
- package/dist/esm/createDataInstance/createInstanceRef.js +101 -0
- package/dist/esm/createDataInstance/createInstanceRef.js.map +7 -0
- package/dist/esm/createDataInstance/utils.js +77 -0
- package/dist/esm/createDataInstance/utils.js.map +7 -0
- package/dist/esm/defer-render-hoc/index.js +41 -0
- package/dist/esm/defer-render-hoc/index.js.map +7 -0
- package/dist/esm/dimsum.config.js +10 -0
- package/dist/esm/dimsum.config.js.map +7 -0
- package/dist/esm/index.js +11 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/prop-types.js +87 -0
- package/dist/esm/prop-types.js.map +7 -0
- package/dist/esm/react-spring/index.js +3 -0
- package/dist/esm/react-spring/index.js.map +7 -0
- package/dist/esm/react-spring/renderprops.js +3 -0
- package/dist/esm/react-spring/renderprops.js.map +7 -0
- package/dist/esm/toolbar/ToolbarProvider.js +99 -0
- package/dist/esm/toolbar/ToolbarProvider.js.map +7 -0
- package/dist/esm/useDataGrid/VolatileRowsListener.js +20 -0
- package/dist/esm/useDataGrid/VolatileRowsListener.js.map +7 -0
- package/dist/esm/useDataGrid/index.js +7 -0
- package/dist/esm/useDataGrid/index.js.map +7 -0
- package/dist/esm/useDataGrid/initColumnDefinition.js +126 -0
- package/dist/esm/useDataGrid/initColumnDefinition.js.map +7 -0
- package/dist/esm/useDataGrid/useDataGrid.js +201 -0
- package/dist/esm/useDataGrid/useDataGrid.js.map +7 -0
- package/dist/esm/useDataList/index.js +7 -0
- package/dist/esm/useDataList/index.js.map +7 -0
- package/dist/esm/useDataList/recordIterator.js +26 -0
- package/dist/esm/useDataList/recordIterator.js.map +7 -0
- package/dist/esm/useDataList/useDataList.js +102 -0
- package/dist/esm/useDataList/useDataList.js.map +7 -0
- package/dist/esm/utils.js +96 -0
- package/dist/esm/utils.js.map +7 -0
- package/dist/esm/virtualization/AutoHeightList.js +79 -0
- package/dist/esm/virtualization/AutoHeightList.js.map +7 -0
- package/dist/esm/virtualization/FluidHeightList.js +47 -0
- package/dist/esm/virtualization/FluidHeightList.js.map +7 -0
- package/dist/esm/virtualization/index.js +21 -0
- package/dist/esm/virtualization/index.js.map +7 -0
- package/package.json +116 -107
- package/cjs/Animations/BaseAnimation.js +0 -36
- package/cjs/Animations/Grow.js +0 -42
- package/cjs/Animations/GrowRight.js +0 -42
- package/cjs/Animations/GrowVertical.js +0 -7
- package/cjs/CheckableGroup.js +0 -74
- package/cjs/DeferRenderAfterComputation.js +0 -28
- package/cjs/FocusGroup/FocusGrid.js +0 -215
- package/cjs/FocusGroup/FocusGroup.js +0 -308
- package/cjs/FocusGroup/FocusGroupContext.js +0 -11
- package/cjs/FocusGroup/FocusGroupManager.js +0 -117
- package/cjs/FocusGroup/focusGroupManagerHoc.js +0 -44
- package/cjs/FocusGroup/index.js +0 -21
- package/cjs/FocusGroup/useFocusGroupItem.js +0 -59
- package/cjs/FocusGroup/utils/getNextCellPosition.js +0 -60
- package/cjs/GroupContext/Group.js +0 -124
- package/cjs/GroupContext/GroupContext.js +0 -13
- package/cjs/GroupContext/GroupItem.js +0 -22
- package/cjs/GroupContext/index.js +0 -13
- package/cjs/ScrollSync/ScrollSync.js +0 -153
- package/cjs/ScrollSync/ScrollSyncPane.js +0 -81
- package/cjs/ScrollSync/ScrollSyncProvider.js +0 -67
- package/cjs/ScrollSync/index.js +0 -11
- package/cjs/ScrollSync/useScrollSync.js +0 -10
- package/cjs/constants.js +0 -51
- package/cjs/createDataInstance/createInstancePlugin.js +0 -36
- package/cjs/createDataInstance/createInstanceRef.js +0 -97
- package/cjs/createDataInstance/utils.js +0 -123
- package/cjs/defer-render-hoc/index.js +0 -49
- package/cjs/dimsum.config.js +0 -7
- package/cjs/index.js +0 -17
- package/cjs/prop-types.js +0 -59
- package/cjs/react-spring/index.js +0 -14
- package/cjs/react-spring/renderprops.js +0 -14
- package/cjs/toolbar/ToolbarProvider.js +0 -123
- package/cjs/useDataGrid/VolatileRowsListener.js +0 -24
- package/cjs/useDataGrid/index.js +0 -7
- package/cjs/useDataGrid/initColumnDefinition.js +0 -146
- package/cjs/useDataGrid/useDataGrid.js +0 -220
- package/cjs/useDataList/index.js +0 -7
- package/cjs/useDataList/recordIterator.js +0 -31
- package/cjs/useDataList/useDataList.js +0 -102
- package/cjs/utils.js +0 -116
- package/cjs/virtualization/AutoHeightList.js +0 -61
- package/cjs/virtualization/FluidHeightList.js +0 -49
- package/cjs/virtualization/index.js +0 -22
- package/esm/Animations/BaseAnimation.js +0 -30
- package/esm/Animations/Grow.js +0 -36
- package/esm/Animations/GrowRight.js +0 -36
- package/esm/Animations/GrowVertical.js +0 -4
- package/esm/CheckableGroup.js +0 -64
- package/esm/DeferRenderAfterComputation.js +0 -22
- package/esm/FocusGroup/FocusGrid.js +0 -204
- package/esm/FocusGroup/FocusGroupContext.js +0 -5
- package/esm/FocusGroup/focusGroupManagerHoc.js +0 -37
- package/esm/FocusGroup/index.js +0 -6
- package/esm/FocusGroup/useFocusGroupItem.js +0 -50
- package/esm/GroupContext/Group.js +0 -118
- package/esm/GroupContext/GroupContext.js +0 -5
- package/esm/GroupContext/GroupItem.js +0 -16
- package/esm/GroupContext/index.js +0 -3
- package/esm/ScrollSync/ScrollSyncPane.js +0 -74
- package/esm/ScrollSync/ScrollSyncProvider.js +0 -59
- package/esm/ScrollSync/index.js +0 -2
- package/esm/ScrollSync/useScrollSync.js +0 -8
- package/esm/constants.js +0 -32
- package/esm/createDataInstance/createInstancePlugin.js +0 -30
- package/esm/createDataInstance/createInstanceRef.js +0 -90
- package/esm/createDataInstance/utils.js +0 -107
- package/esm/defer-render-hoc/index.js +0 -41
- package/esm/dimsum.config.js +0 -5
- package/esm/index.js +0 -5
- package/esm/prop-types.js +0 -43
- package/esm/react-spring/index.js +0 -1
- package/esm/react-spring/renderprops.js +0 -1
- package/esm/toolbar/ToolbarProvider.js +0 -111
- package/esm/useDataGrid/VolatileRowsListener.js +0 -22
- package/esm/useDataGrid/index.js +0 -1
- package/esm/useDataGrid/initColumnDefinition.js +0 -134
- package/esm/useDataGrid/useDataGrid.js +0 -194
- package/esm/useDataList/index.js +0 -1
- package/esm/useDataList/recordIterator.js +0 -27
- package/esm/useDataList/useDataList.js +0 -90
- package/esm/utils.js +0 -95
- package/esm/virtualization/AutoHeightList.js +0 -52
- package/esm/virtualization/FluidHeightList.js +0 -38
- package/esm/virtualization/index.js +0 -18
- package/types/Animations/BaseAnimation.d.ts +0 -12
- package/types/Animations/Grow.d.ts +0 -11
- package/types/Animations/GrowRight.d.ts +0 -11
- package/types/Animations/GrowVertical.d.ts +0 -1
- package/types/CheckableGroup.d.ts +0 -20
- package/types/DeferRenderAfterComputation.d.ts +0 -6
- package/types/FocusGroup/FocusGrid.d.ts +0 -10
- package/types/FocusGroup/FocusGroup.d.ts +0 -36
- package/types/FocusGroup/FocusGroupContext.d.ts +0 -3
- package/types/FocusGroup/FocusGroupManager.d.ts +0 -24
- package/types/FocusGroup/focusGroupManagerHoc.d.ts +0 -7
- package/types/FocusGroup/index.d.ts +0 -6
- package/types/FocusGroup/useFocusGroupItem.d.ts +0 -2
- package/types/FocusGroup/utils/getNextCellPosition.d.ts +0 -12
- package/types/GroupContext/Group.d.ts +0 -14
- package/types/GroupContext/GroupContext.d.ts +0 -2
- package/types/GroupContext/GroupItem.d.ts +0 -5
- package/types/GroupContext/index.d.ts +0 -3
- package/types/ScrollSync/ScrollSync.d.ts +0 -21
- package/types/ScrollSync/ScrollSyncPane.d.ts +0 -3
- package/types/ScrollSync/ScrollSyncProvider.d.ts +0 -12
- package/types/ScrollSync/index.d.ts +0 -2
- package/types/ScrollSync/useScrollSync.d.ts +0 -6
- package/types/constants.d.ts +0 -30
- package/types/createDataInstance/createInstancePlugin.d.ts +0 -1
- package/types/createDataInstance/createInstanceRef.d.ts +0 -12
- package/types/createDataInstance/tests/createInstanceRef.test.d.ts +0 -0
- package/types/createDataInstance/utils.d.ts +0 -9
- package/types/dimsum.config.d.ts +0 -4
- package/types/index.d.ts +0 -2
- package/types/prop-types.d.ts +0 -41
- package/types/react-spring/index.d.ts +0 -1
- package/types/react-spring/renderprops.d.ts +0 -1
- package/types/toolbar/ToolbarProvider.d.ts +0 -10
- package/types/useDataGrid/VolatileRowsListener.d.ts +0 -5
- package/types/useDataGrid/index.d.ts +0 -1
- package/types/useDataGrid/initColumnDefinition.d.ts +0 -5
- package/types/useDataGrid/useDataGrid.d.ts +0 -8
- package/types/useDataList/index.d.ts +0 -1
- package/types/useDataList/recordIterator.d.ts +0 -1
- package/types/useDataList/useDataList.d.ts +0 -13
- package/types/utils.d.ts +0 -22
- package/types/virtualization/AutoHeightList.d.ts +0 -2
- package/types/virtualization/FluidHeightList.d.ts +0 -2
- package/types/virtualization/index.d.ts +0 -9
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
|
-
import { Component } from 'react';
|
|
4
|
-
import { GroupContext } from './GroupContext.js';
|
|
5
|
-
|
|
6
|
-
const getValueItem = e => {
|
|
7
|
-
const {
|
|
8
|
-
target,
|
|
9
|
-
currentTarget
|
|
10
|
-
} = e;
|
|
11
|
-
|
|
12
|
-
if (target) {
|
|
13
|
-
const {
|
|
14
|
-
value
|
|
15
|
-
} = target;
|
|
16
|
-
return value;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
if (currentTarget) {
|
|
20
|
-
const {
|
|
21
|
-
value
|
|
22
|
-
} = currentTarget;
|
|
23
|
-
return value;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return e;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const toggleItemValue = (array, e) => {
|
|
30
|
-
const newvalue = getValueItem(e);
|
|
31
|
-
const res = array;
|
|
32
|
-
const index = array.indexOf(newvalue);
|
|
33
|
-
|
|
34
|
-
if (index === -1) {
|
|
35
|
-
res.push(newvalue);
|
|
36
|
-
} else {
|
|
37
|
-
res.splice(index, 1);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return res;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const {
|
|
44
|
-
Provider
|
|
45
|
-
} = GroupContext;
|
|
46
|
-
/** deprecated use CheckableGroup instead */
|
|
47
|
-
|
|
48
|
-
class Group extends Component {
|
|
49
|
-
constructor(props) {
|
|
50
|
-
super(props);
|
|
51
|
-
const {
|
|
52
|
-
activeValue,
|
|
53
|
-
disabled
|
|
54
|
-
} = props;
|
|
55
|
-
this.state = {
|
|
56
|
-
activeValue,
|
|
57
|
-
disabled,
|
|
58
|
-
prevValue: null,
|
|
59
|
-
onChange: this.handleChange.bind(this)
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
static getDerivedStateFromProps(nextProps, _ref) {
|
|
64
|
-
let {
|
|
65
|
-
prevValue
|
|
66
|
-
} = _ref;
|
|
67
|
-
if (nextProps.activeValue === prevValue) return null;
|
|
68
|
-
return {
|
|
69
|
-
activeValue: nextProps.activeValue,
|
|
70
|
-
prevValue: nextProps.activeValue
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
handleChange(e) {
|
|
75
|
-
const {
|
|
76
|
-
multiple,
|
|
77
|
-
onChange
|
|
78
|
-
} = this.props;
|
|
79
|
-
const {
|
|
80
|
-
activeValue
|
|
81
|
-
} = this.state;
|
|
82
|
-
const value = getValueItem(e);
|
|
83
|
-
let newValue;
|
|
84
|
-
|
|
85
|
-
if (multiple) {
|
|
86
|
-
newValue = toggleItemValue(activeValue || [], value);
|
|
87
|
-
} else if (activeValue !== value) {
|
|
88
|
-
// default behaviour it will be toggle the active value
|
|
89
|
-
newValue = value;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
this.setState({
|
|
93
|
-
activeValue: newValue
|
|
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
|
-
|
|
100
|
-
if (onChange) onChange(newValue, ...rest);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
render() {
|
|
104
|
-
const {
|
|
105
|
-
children
|
|
106
|
-
} = this.props;
|
|
107
|
-
return /*#__PURE__*/_jsx(Provider, {
|
|
108
|
-
value: this.state
|
|
109
|
-
}, void 0, children);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
Group.defaultProps = {
|
|
115
|
-
multiple: false
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
export { Group as default };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
-
import 'react';
|
|
3
|
-
import { GroupContext } from './GroupContext.js';
|
|
4
|
-
|
|
5
|
-
const {
|
|
6
|
-
Consumer
|
|
7
|
-
} = GroupContext;
|
|
8
|
-
|
|
9
|
-
const GroupItem = _ref => {
|
|
10
|
-
let {
|
|
11
|
-
render
|
|
12
|
-
} = _ref;
|
|
13
|
-
return /*#__PURE__*/_jsx(Consumer, {}, void 0, context => render(context));
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export { GroupItem as default };
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
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';
|
|
12
|
-
import { Component } from 'react';
|
|
13
|
-
import { ScrollSyncContext } from './ScrollSync.js';
|
|
14
|
-
import { jsx } from 'react/jsx-runtime';
|
|
15
|
-
|
|
16
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
17
|
-
|
|
18
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
19
|
-
|
|
20
|
-
class ScrollSyncPane extends Component {
|
|
21
|
-
constructor() {
|
|
22
|
-
super(...arguments);
|
|
23
|
-
|
|
24
|
-
this.toArray = groups => [].concat(groups);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
componentWillUnmount() {
|
|
28
|
-
const {
|
|
29
|
-
enabled,
|
|
30
|
-
group,
|
|
31
|
-
syncContext
|
|
32
|
-
} = this.props;
|
|
33
|
-
const {
|
|
34
|
-
unregisterPane
|
|
35
|
-
} = syncContext;
|
|
36
|
-
if (enabled) unregisterPane(this.node, this.toArray(group));
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
render() {
|
|
40
|
-
const {
|
|
41
|
-
children,
|
|
42
|
-
group,
|
|
43
|
-
syncContext,
|
|
44
|
-
notPaginated
|
|
45
|
-
} = this.props;
|
|
46
|
-
const {
|
|
47
|
-
registerPane
|
|
48
|
-
} = syncContext;
|
|
49
|
-
return children({
|
|
50
|
-
registerPane: node => {
|
|
51
|
-
if (notPaginated) {
|
|
52
|
-
const virtualizedBody = node.querySelector('.virtualized-body-wrapper');
|
|
53
|
-
|
|
54
|
-
if (virtualizedBody) {
|
|
55
|
-
registerPane(virtualizedBody, this.toArray(group));
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return registerPane(node, this.toArray(group));
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
ScrollSyncPane.defaultProps = {
|
|
67
|
-
group: 'default',
|
|
68
|
-
enabled: true
|
|
69
|
-
};
|
|
70
|
-
var ScrollSyncPane$1 = (props => /*#__PURE__*/_jsx(ScrollSyncContext.Consumer, {}, void 0, context => /*#__PURE__*/jsx(ScrollSyncPane, _objectSpread(_objectSpread({}, props), {}, {
|
|
71
|
-
syncContext: context
|
|
72
|
-
}))));
|
|
73
|
-
|
|
74
|
-
export { ScrollSyncPane$1 as default };
|
|
@@ -1,59 +0,0 @@
|
|
|
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';
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import raf from 'raf';
|
|
9
|
-
|
|
10
|
-
const ScrollSyncContext = /*#__PURE__*/React.createContext();
|
|
11
|
-
const {
|
|
12
|
-
Provider
|
|
13
|
-
} = ScrollSyncContext;
|
|
14
|
-
|
|
15
|
-
function ScrollSyncProvider(_ref) {
|
|
16
|
-
let {
|
|
17
|
-
enabled,
|
|
18
|
-
horizontal,
|
|
19
|
-
vertical,
|
|
20
|
-
children
|
|
21
|
-
} = _ref;
|
|
22
|
-
useRef();
|
|
23
|
-
|
|
24
|
-
raf((scrolledPane, pane) => {
|
|
25
|
-
const {
|
|
26
|
-
scrollTop,
|
|
27
|
-
scrollHeight,
|
|
28
|
-
clientHeight,
|
|
29
|
-
scrollLeft,
|
|
30
|
-
scrollWidth,
|
|
31
|
-
clientWidth
|
|
32
|
-
} = scrolledPane;
|
|
33
|
-
const scrollTopOffset = scrollHeight - clientHeight;
|
|
34
|
-
const scrollLeftOffset = scrollWidth - clientWidth;
|
|
35
|
-
const {
|
|
36
|
-
proportional,
|
|
37
|
-
vertical,
|
|
38
|
-
horizontal
|
|
39
|
-
} = this.props;
|
|
40
|
-
/* Calculate the actual pane height */
|
|
41
|
-
|
|
42
|
-
const paneHeight = pane.scrollHeight - clientHeight;
|
|
43
|
-
const paneWidth = pane.scrollWidth - clientWidth;
|
|
44
|
-
/* Adjust the scrollTop position of it accordingly */
|
|
45
|
-
|
|
46
|
-
if (vertical && scrollTopOffset > 0) {
|
|
47
|
-
pane.scrollTop = proportional ? paneHeight * scrollTop / scrollTopOffset : scrollTop; // eslint-disable-line
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (horizontal && scrollLeftOffset > 0) {
|
|
51
|
-
pane.scrollLeft = proportional ? paneWidth * scrollLeft / scrollLeftOffset : scrollLeft; // eslint-disable-line
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
return /*#__PURE__*/_jsx(Provider, {}, void 0, children);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
ScrollSyncProvider.defaultProps = {};
|
|
58
|
-
|
|
59
|
-
export { ScrollSyncProvider as default };
|
package/esm/ScrollSync/index.js
DELETED
package/esm/constants.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
const DEFAULT_DELAY_OPEN = 200;
|
|
2
|
-
const DEFAULT_DELAY_CLOSE = 300;
|
|
3
|
-
const sizeOptions = ['small', 'medium', 'large', 'x-large'];
|
|
4
|
-
const AM = 'am';
|
|
5
|
-
const PM = 'pm';
|
|
6
|
-
const ARROW_UP = 'ArrowUp';
|
|
7
|
-
const ARROW_DOWN = 'ArrowDown';
|
|
8
|
-
const BACKSPACE = 'Backspace';
|
|
9
|
-
const ESCAPE = 'Escape';
|
|
10
|
-
const HOME = 'Home';
|
|
11
|
-
const SHIFT = 'Shift';
|
|
12
|
-
const END = 'End';
|
|
13
|
-
const HOUR_RANGE_12 = {
|
|
14
|
-
min: 0,
|
|
15
|
-
max: 12
|
|
16
|
-
};
|
|
17
|
-
const HOUR_RANGE_24 = {
|
|
18
|
-
min: 0,
|
|
19
|
-
max: 24
|
|
20
|
-
};
|
|
21
|
-
const GENERAL_TIME_RANGE = {
|
|
22
|
-
min: 0,
|
|
23
|
-
max: 59
|
|
24
|
-
};
|
|
25
|
-
const PLACEHOLDER_TIME = {
|
|
26
|
-
hour: 'hour',
|
|
27
|
-
minutes: 'minutes',
|
|
28
|
-
seconds: 'seconds',
|
|
29
|
-
meridiem: 'meridiem'
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export { AM, ARROW_DOWN, ARROW_UP, BACKSPACE, DEFAULT_DELAY_CLOSE, DEFAULT_DELAY_OPEN, END, ESCAPE, GENERAL_TIME_RANGE, HOME, HOUR_RANGE_12, HOUR_RANGE_24, PLACEHOLDER_TIME, PM, SHIFT, sizeOptions };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
-
import 'core-js/modules/esnext.iterator.filter.js';
|
|
3
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
4
|
-
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
6
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
7
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
8
|
-
|
|
9
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10
|
-
|
|
11
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12
|
-
|
|
13
|
-
function getDecoratorsFromHooks(hooks, decorators) {
|
|
14
|
-
const nextDecorators = _objectSpread({}, decorators);
|
|
15
|
-
|
|
16
|
-
Object.keys(hooks).forEach(decorator => {
|
|
17
|
-
if (Array.isArray(decorators[decorator])) {
|
|
18
|
-
nextDecorators[decorator] = [...decorators[decorator], hooks[decorator]];
|
|
19
|
-
} else {
|
|
20
|
-
nextDecorators[decorator] = hooks[decorator];
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
return nextDecorators;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function createInstancePlugin(name, hooks) {
|
|
27
|
-
return decorators => getDecoratorsFromHooks(hooks, decorators);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export { createInstancePlugin as default };
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
-
import 'core-js/modules/esnext.iterator.filter.js';
|
|
3
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
4
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
5
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
6
|
-
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
7
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
8
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
9
|
-
import 'core-js/modules/esnext.async-iterator.reduce.js';
|
|
10
|
-
import 'core-js/modules/esnext.iterator.reduce.js';
|
|
11
|
-
import { v4 } from 'uuid';
|
|
12
|
-
import { useRef, useState, useMemo } from 'react';
|
|
13
|
-
import { orderBy } from 'lodash';
|
|
14
|
-
import { mergeInstance, registerStateHookToInstance, registerHotKeysHookToInstance } from './utils.js';
|
|
15
|
-
|
|
16
|
-
const _excluded = ["uuid", "data", "renderers", "plugins", "customDecorators"];
|
|
17
|
-
|
|
18
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
19
|
-
|
|
20
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
21
|
-
const defaultDecorators = {
|
|
22
|
-
instance: [],
|
|
23
|
-
state: [],
|
|
24
|
-
hotKeys: [],
|
|
25
|
-
renderers: [],
|
|
26
|
-
composeData: []
|
|
27
|
-
};
|
|
28
|
-
function createDataInstanceRef(_ref) {
|
|
29
|
-
let {
|
|
30
|
-
uuid: uuidProp,
|
|
31
|
-
data,
|
|
32
|
-
renderers,
|
|
33
|
-
plugins,
|
|
34
|
-
customDecorators
|
|
35
|
-
} = _ref,
|
|
36
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
37
|
-
|
|
38
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
39
|
-
const instance = useRef(); // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
40
|
-
|
|
41
|
-
const [uuid] = useState(uuidProp || (() => v4()));
|
|
42
|
-
instance.current = {
|
|
43
|
-
uuid,
|
|
44
|
-
state: {},
|
|
45
|
-
actions: {},
|
|
46
|
-
hotKeys: {},
|
|
47
|
-
// keyboard hotkeys to run specific actions
|
|
48
|
-
originalData: data,
|
|
49
|
-
records: [],
|
|
50
|
-
// item abstraction with meta data for originalData
|
|
51
|
-
renderers,
|
|
52
|
-
|
|
53
|
-
ref(key) {
|
|
54
|
-
// eslint-disable-next-line no-return-assign
|
|
55
|
-
return node => instance.current.refs[key] = node;
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
getInstance() {
|
|
59
|
-
return instance.current;
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
props
|
|
63
|
-
}; // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
64
|
-
|
|
65
|
-
const decorators = useMemo(() => {
|
|
66
|
-
let nextDecorators = _objectSpread(_objectSpread({}, defaultDecorators), customDecorators);
|
|
67
|
-
|
|
68
|
-
plugins.forEach(plugin => {
|
|
69
|
-
if (!plugin) return;
|
|
70
|
-
nextDecorators = plugin(nextDecorators);
|
|
71
|
-
});
|
|
72
|
-
Object.keys(nextDecorators).forEach(key => {
|
|
73
|
-
if (Array.isArray(nextDecorators[key])) nextDecorators[key] = orderBy(nextDecorators[key], item => item.order);
|
|
74
|
-
});
|
|
75
|
-
return nextDecorators;
|
|
76
|
-
}, []); // the plugins are defined on creation, but not changed at runtime
|
|
77
|
-
// todo: test if getting the hooks without registering them
|
|
78
|
-
// here would be beneficial to memoize instance and squeeze performance
|
|
79
|
-
|
|
80
|
-
instance.current = decorators.instance.reduce(mergeInstance, instance.current);
|
|
81
|
-
instance.current = decorators.state.reduce(registerStateHookToInstance, instance.current);
|
|
82
|
-
instance.current = decorators.hotKeys.reduce(registerHotKeysHookToInstance, instance.current);
|
|
83
|
-
instance.current.renderers = decorators.renderers.reduce((result, decorator) => decorator(result, instance.current), renderers);
|
|
84
|
-
return {
|
|
85
|
-
instance,
|
|
86
|
-
decorators
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export { createDataInstanceRef as default };
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
|
-
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
3
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
4
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
5
|
-
import 'core-js/modules/esnext.async-iterator.reduce.js';
|
|
6
|
-
import 'core-js/modules/esnext.iterator.reduce.js';
|
|
7
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
8
|
-
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
9
|
-
import 'core-js/modules/esnext.iterator.map.js';
|
|
10
|
-
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
11
|
-
import 'core-js/modules/esnext.iterator.filter.js';
|
|
12
|
-
|
|
13
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
|
-
|
|
15
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16
|
-
const reducePropsGetter = function () {
|
|
17
|
-
let decorators = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
18
|
-
let grid = arguments.length > 1 ? arguments[1] : undefined;
|
|
19
|
-
return function () {
|
|
20
|
-
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
21
|
-
let extraParams = arguments.length > 1 ? arguments[1] : undefined;
|
|
22
|
-
let nextProps = props;
|
|
23
|
-
decorators.forEach(decorator => {
|
|
24
|
-
nextProps = decorator(nextProps, grid, extraParams);
|
|
25
|
-
});
|
|
26
|
-
return nextProps;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
/* eslint-disable-next-line max-params */
|
|
30
|
-
|
|
31
|
-
function evaluateTransforms(transforms, value) {
|
|
32
|
-
let extraParams = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
33
|
-
let props = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
34
|
-
let grid = arguments.length > 4 ? arguments[4] : undefined;
|
|
35
|
-
let nextProps = props;
|
|
36
|
-
transforms.forEach(transform => {
|
|
37
|
-
nextProps = transform(value, extraParams, nextProps, grid);
|
|
38
|
-
});
|
|
39
|
-
return nextProps;
|
|
40
|
-
}
|
|
41
|
-
/* eslint-disable-next-line max-params */
|
|
42
|
-
|
|
43
|
-
function evaluateFormatters(formatters, value) {
|
|
44
|
-
let extraParams = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
45
|
-
let grid = arguments.length > 3 ? arguments[3] : undefined;
|
|
46
|
-
return formatters.reduce((result, formatter) => formatter(result, extraParams, grid), value);
|
|
47
|
-
}
|
|
48
|
-
function composeFormatters(formatters, instance) {
|
|
49
|
-
let getItemValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : record => record.data.name;
|
|
50
|
-
// todo: make the formatters subscribe to the item props instead of getting the whole instance
|
|
51
|
-
// todo: addd should formatter update to memoize specific ones
|
|
52
|
-
return props => formatters.reduce((result, formatter) => formatter(result, props, instance), getItemValue(props.record));
|
|
53
|
-
}
|
|
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
|
-
};
|
|
63
|
-
const decorateColumns = (columns, decorators, grid) => {
|
|
64
|
-
const nextColumns = applyDecorators(columns, decorators.decorateColumns, grid);
|
|
65
|
-
return nextColumns.map((column, index) => applyDecorators(column, decorators.decorateColumn, grid, index));
|
|
66
|
-
};
|
|
67
|
-
const mergeInstance = (instance, instanceHook) => _objectSpread(_objectSpread({}, instance), instanceHook(instance));
|
|
68
|
-
const registerStateHookToInstance = (instance, stateHook) => {
|
|
69
|
-
const {
|
|
70
|
-
state,
|
|
71
|
-
actions
|
|
72
|
-
} = stateHook(instance);
|
|
73
|
-
return _objectSpread(_objectSpread({}, instance), {}, {
|
|
74
|
-
state: _objectSpread(_objectSpread({}, instance.state), state),
|
|
75
|
-
actions: _objectSpread(_objectSpread({}, instance.actions), actions)
|
|
76
|
-
});
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
const reduceHotKey = (instance, _ref) => {
|
|
80
|
-
let {
|
|
81
|
-
key,
|
|
82
|
-
handler,
|
|
83
|
-
options,
|
|
84
|
-
allowDocumentHandler
|
|
85
|
-
} = _ref;
|
|
86
|
-
return _objectSpread(_objectSpread({}, instance), {}, {
|
|
87
|
-
hotKeys: _objectSpread(_objectSpread({}, instance.hotKeys), {}, {
|
|
88
|
-
[key]: {
|
|
89
|
-
handler,
|
|
90
|
-
options,
|
|
91
|
-
allowDocumentHandler
|
|
92
|
-
}
|
|
93
|
-
})
|
|
94
|
-
});
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
const registerHotKeysHookToInstance = (instance, hotKeysHook) => {
|
|
98
|
-
const hotKeys = hotKeysHook(instance);
|
|
99
|
-
|
|
100
|
-
if (Array.isArray(hotKeys)) {
|
|
101
|
-
return hotKeys.reduce(reduceHotKey, instance);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
return reduceHotKey(instance, hotKeys);
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
export { applyDecorators, composeFormatters, decorateColumns, evaluateFormatters, evaluateTransforms, mergeInstance, reducePropsGetter, registerHotKeysHookToInstance, registerStateHookToInstance };
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
-
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
-
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
8
|
-
import { PureComponent } from 'react';
|
|
9
|
-
import raf from 'raf';
|
|
10
|
-
import hoistNonReactStatic from 'hoist-non-react-statics';
|
|
11
|
-
import { jsx } from 'react/jsx-runtime';
|
|
12
|
-
|
|
13
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
|
-
|
|
15
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16
|
-
function deferComponentRender(WrappedComponent, fallback) {
|
|
17
|
-
class DeferredRenderWrapper extends PureComponent {
|
|
18
|
-
constructor() {
|
|
19
|
-
super(...arguments);
|
|
20
|
-
this.state = {
|
|
21
|
-
shouldRender: false
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
componentDidMount() {
|
|
26
|
-
raf(() => raf(() => this.setState({
|
|
27
|
-
shouldRender: true
|
|
28
|
-
})));
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
render() {
|
|
32
|
-
// eslint-disable-next-line react/destructuring-assignment
|
|
33
|
-
return this.state.shouldRender ? /*#__PURE__*/jsx(WrappedComponent, _objectSpread({}, this.props)) : fallback;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return hoistNonReactStatic(DeferredRenderWrapper, WrappedComponent);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export { deferComponentRender as default };
|
package/esm/dimsum.config.js
DELETED
package/esm/index.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { default as ScrollSync } from './ScrollSync/ScrollSync.js';
|
|
2
|
-
export { default as ScrollSyncPane } from './ScrollSync/ScrollSyncPane.js';
|
|
3
|
-
export { default as Group } from './GroupContext/Group.js';
|
|
4
|
-
export { GroupContext } from './GroupContext/GroupContext.js';
|
|
5
|
-
export { default as GroupItem } from './GroupContext/GroupItem.js';
|
package/esm/prop-types.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
export * from 'react-spring/web';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from 'react-spring/renderprops';
|