@elliemae/ds-shared 3.27.0-next.1 → 3.27.0-next.3
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/index.js +1 -16
- package/dist/cjs/index.js.map +3 -3
- package/dist/esm/index.js +1 -16
- package/dist/esm/index.js.map +3 -3
- package/dist/types/index.d.ts +1 -16
- package/package.json +8 -194
- package/dist/cjs/Animations/BaseAnimation.js +0 -49
- package/dist/cjs/Animations/BaseAnimation.js.map +0 -7
- package/dist/cjs/Animations/Grow.js +0 -52
- package/dist/cjs/Animations/Grow.js.map +0 -7
- package/dist/cjs/Animations/GrowRight.js +0 -69
- package/dist/cjs/Animations/GrowRight.js.map +0 -7
- package/dist/cjs/Animations/GrowVertical.js +0 -68
- package/dist/cjs/Animations/GrowVertical.js.map +0 -7
- package/dist/cjs/Animations/index.js +0 -33
- package/dist/cjs/Animations/index.js.map +0 -7
- package/dist/cjs/CheckableGroup.js +0 -74
- package/dist/cjs/CheckableGroup.js.map +0 -7
- package/dist/cjs/DeferRenderAfterComputation.js +0 -52
- package/dist/cjs/DeferRenderAfterComputation.js.map +0 -7
- package/dist/cjs/FocusGroup/FocusGrid.js +0 -183
- package/dist/cjs/FocusGroup/FocusGrid.js.map +0 -7
- package/dist/cjs/FocusGroup/FocusGroup.js +0 -272
- package/dist/cjs/FocusGroup/FocusGroup.js.map +0 -7
- package/dist/cjs/FocusGroup/FocusGroupContext.js +0 -39
- package/dist/cjs/FocusGroup/FocusGroupContext.js.map +0 -7
- package/dist/cjs/FocusGroup/FocusGroupManager.js +0 -126
- package/dist/cjs/FocusGroup/FocusGroupManager.js.map +0 -7
- package/dist/cjs/FocusGroup/focusGroupManagerHoc.js +0 -53
- package/dist/cjs/FocusGroup/focusGroupManagerHoc.js.map +0 -7
- package/dist/cjs/FocusGroup/index.js +0 -45
- package/dist/cjs/FocusGroup/index.js.map +0 -7
- package/dist/cjs/FocusGroup/useFocusGroupItem.js +0 -68
- package/dist/cjs/FocusGroup/useFocusGroupItem.js.map +0 -7
- package/dist/cjs/FocusGroup/utils/getNextCellPosition.js +0 -81
- package/dist/cjs/FocusGroup/utils/getNextCellPosition.js.map +0 -7
- package/dist/cjs/GroupContext/Group.js +0 -115
- package/dist/cjs/GroupContext/Group.js.map +0 -7
- package/dist/cjs/GroupContext/GroupContext.js +0 -37
- package/dist/cjs/GroupContext/GroupContext.js.map +0 -7
- package/dist/cjs/GroupContext/GroupItem.js +0 -41
- package/dist/cjs/GroupContext/GroupItem.js.map +0 -7
- package/dist/cjs/GroupContext/index.js +0 -40
- package/dist/cjs/GroupContext/index.js.map +0 -7
- package/dist/cjs/ScrollSync/ScrollSync.js +0 -132
- package/dist/cjs/ScrollSync/ScrollSync.js.map +0 -7
- package/dist/cjs/ScrollSync/ScrollSyncPane.js +0 -72
- package/dist/cjs/ScrollSync/ScrollSyncPane.js.map +0 -7
- package/dist/cjs/ScrollSync/ScrollSyncProvider.js +0 -116
- package/dist/cjs/ScrollSync/ScrollSyncProvider.js.map +0 -7
- package/dist/cjs/ScrollSync/index.js +0 -41
- package/dist/cjs/ScrollSync/index.js.map +0 -7
- package/dist/cjs/ScrollSync/useScrollSync.js +0 -40
- package/dist/cjs/ScrollSync/useScrollSync.js.map +0 -7
- package/dist/cjs/constants.js +0 -71
- package/dist/cjs/constants.js.map +0 -7
- package/dist/cjs/createDataInstance/createInstancePlugin.js +0 -50
- package/dist/cjs/createDataInstance/createInstancePlugin.js.map +0 -7
- package/dist/cjs/createDataInstance/createInstanceRef.js +0 -91
- package/dist/cjs/createDataInstance/createInstanceRef.js.map +0 -7
- package/dist/cjs/createDataInstance/index.js +0 -32
- package/dist/cjs/createDataInstance/index.js.map +0 -7
- package/dist/cjs/createDataInstance/utils.js +0 -100
- package/dist/cjs/createDataInstance/utils.js.map +0 -7
- package/dist/cjs/defer-render-hoc/index.js +0 -56
- package/dist/cjs/defer-render-hoc/index.js.map +0 -7
- package/dist/cjs/dimsum.config.js +0 -40
- package/dist/cjs/dimsum.config.js.map +0 -7
- package/dist/cjs/prop-types.js +0 -117
- package/dist/cjs/prop-types.js.map +0 -7
- package/dist/cjs/react-spring/index.js +0 -30
- package/dist/cjs/react-spring/index.js.map +0 -7
- package/dist/cjs/react-spring/renderprops.js +0 -30
- package/dist/cjs/react-spring/renderprops.js.map +0 -7
- package/dist/cjs/toolbar/ToolbarProvider.js +0 -120
- package/dist/cjs/toolbar/ToolbarProvider.js.map +0 -7
- package/dist/cjs/useDataGrid/VolatileRowsListener.js +0 -50
- package/dist/cjs/useDataGrid/VolatileRowsListener.js.map +0 -7
- package/dist/cjs/useDataGrid/index.js +0 -32
- package/dist/cjs/useDataGrid/index.js.map +0 -7
- package/dist/cjs/useDataGrid/initColumnDefinition.js +0 -150
- package/dist/cjs/useDataGrid/initColumnDefinition.js.map +0 -7
- package/dist/cjs/useDataGrid/useDataGrid.js +0 -204
- package/dist/cjs/useDataGrid/useDataGrid.js.map +0 -7
- package/dist/cjs/useDataList/index.js +0 -31
- package/dist/cjs/useDataList/index.js.map +0 -7
- package/dist/cjs/useDataList/recordIterator.js +0 -56
- package/dist/cjs/useDataList/recordIterator.js.map +0 -7
- package/dist/cjs/useDataList/useDataList.js +0 -100
- package/dist/cjs/useDataList/useDataList.js.map +0 -7
- package/dist/cjs/utils.js +0 -108
- package/dist/cjs/utils.js.map +0 -7
- package/dist/cjs/virtualization/AutoHeightList.js +0 -76
- package/dist/cjs/virtualization/AutoHeightList.js.map +0 -7
- package/dist/cjs/virtualization/FluidHeightList.js +0 -46
- package/dist/cjs/virtualization/FluidHeightList.js.map +0 -7
- package/dist/cjs/virtualization/index.js +0 -46
- package/dist/cjs/virtualization/index.js.map +0 -7
- package/dist/esm/Animations/BaseAnimation.js +0 -19
- package/dist/esm/Animations/BaseAnimation.js.map +0 -7
- package/dist/esm/Animations/Grow.js +0 -22
- package/dist/esm/Animations/Grow.js.map +0 -7
- package/dist/esm/Animations/GrowRight.js +0 -39
- package/dist/esm/Animations/GrowRight.js.map +0 -7
- package/dist/esm/Animations/GrowVertical.js +0 -38
- package/dist/esm/Animations/GrowVertical.js.map +0 -7
- package/dist/esm/Animations/index.js +0 -6
- package/dist/esm/Animations/index.js.map +0 -7
- package/dist/esm/CheckableGroup.js +0 -44
- package/dist/esm/CheckableGroup.js.map +0 -7
- package/dist/esm/DeferRenderAfterComputation.js +0 -22
- package/dist/esm/DeferRenderAfterComputation.js.map +0 -7
- package/dist/esm/FocusGroup/FocusGrid.js +0 -153
- package/dist/esm/FocusGroup/FocusGrid.js.map +0 -7
- package/dist/esm/FocusGroup/FocusGroup.js +0 -242
- package/dist/esm/FocusGroup/FocusGroup.js.map +0 -7
- package/dist/esm/FocusGroup/FocusGroupContext.js +0 -9
- package/dist/esm/FocusGroup/FocusGroupContext.js.map +0 -7
- package/dist/esm/FocusGroup/FocusGroupManager.js +0 -96
- package/dist/esm/FocusGroup/FocusGroupManager.js.map +0 -7
- package/dist/esm/FocusGroup/focusGroupManagerHoc.js +0 -23
- package/dist/esm/FocusGroup/focusGroupManagerHoc.js.map +0 -7
- package/dist/esm/FocusGroup/index.js +0 -14
- package/dist/esm/FocusGroup/index.js.map +0 -7
- package/dist/esm/FocusGroup/useFocusGroupItem.js +0 -38
- package/dist/esm/FocusGroup/useFocusGroupItem.js.map +0 -7
- package/dist/esm/FocusGroup/utils/getNextCellPosition.js +0 -51
- package/dist/esm/FocusGroup/utils/getNextCellPosition.js.map +0 -7
- package/dist/esm/GroupContext/Group.js +0 -85
- package/dist/esm/GroupContext/Group.js.map +0 -7
- package/dist/esm/GroupContext/GroupContext.js +0 -7
- package/dist/esm/GroupContext/GroupContext.js.map +0 -7
- package/dist/esm/GroupContext/GroupItem.js +0 -11
- package/dist/esm/GroupContext/GroupItem.js.map +0 -7
- package/dist/esm/GroupContext/index.js +0 -10
- package/dist/esm/GroupContext/index.js.map +0 -7
- package/dist/esm/ScrollSync/ScrollSync.js +0 -102
- package/dist/esm/ScrollSync/ScrollSync.js.map +0 -7
- package/dist/esm/ScrollSync/ScrollSyncPane.js +0 -42
- package/dist/esm/ScrollSync/ScrollSyncPane.js.map +0 -7
- package/dist/esm/ScrollSync/ScrollSyncProvider.js +0 -86
- package/dist/esm/ScrollSync/ScrollSyncProvider.js.map +0 -7
- package/dist/esm/ScrollSync/index.js +0 -10
- package/dist/esm/ScrollSync/index.js.map +0 -7
- package/dist/esm/ScrollSync/useScrollSync.js +0 -10
- package/dist/esm/ScrollSync/useScrollSync.js.map +0 -7
- package/dist/esm/constants.js +0 -41
- package/dist/esm/constants.js.map +0 -7
- package/dist/esm/createDataInstance/createInstancePlugin.js +0 -20
- package/dist/esm/createDataInstance/createInstancePlugin.js.map +0 -7
- package/dist/esm/createDataInstance/createInstanceRef.js +0 -61
- package/dist/esm/createDataInstance/createInstanceRef.js.map +0 -7
- package/dist/esm/createDataInstance/index.js +0 -5
- package/dist/esm/createDataInstance/index.js.map +0 -7
- package/dist/esm/createDataInstance/utils.js +0 -70
- package/dist/esm/createDataInstance/utils.js.map +0 -7
- package/dist/esm/defer-render-hoc/index.js +0 -26
- package/dist/esm/defer-render-hoc/index.js.map +0 -7
- package/dist/esm/dimsum.config.js +0 -10
- package/dist/esm/dimsum.config.js.map +0 -7
- package/dist/esm/prop-types.js +0 -87
- package/dist/esm/prop-types.js.map +0 -7
- package/dist/esm/react-spring/index.js +0 -3
- package/dist/esm/react-spring/index.js.map +0 -7
- package/dist/esm/react-spring/renderprops.js +0 -3
- package/dist/esm/react-spring/renderprops.js.map +0 -7
- package/dist/esm/toolbar/ToolbarProvider.js +0 -90
- package/dist/esm/toolbar/ToolbarProvider.js.map +0 -7
- package/dist/esm/useDataGrid/VolatileRowsListener.js +0 -20
- package/dist/esm/useDataGrid/VolatileRowsListener.js.map +0 -7
- package/dist/esm/useDataGrid/index.js +0 -5
- package/dist/esm/useDataGrid/index.js.map +0 -7
- package/dist/esm/useDataGrid/initColumnDefinition.js +0 -120
- package/dist/esm/useDataGrid/initColumnDefinition.js.map +0 -7
- package/dist/esm/useDataGrid/useDataGrid.js +0 -182
- package/dist/esm/useDataGrid/useDataGrid.js.map +0 -7
- package/dist/esm/useDataList/index.js +0 -4
- package/dist/esm/useDataList/index.js.map +0 -7
- package/dist/esm/useDataList/recordIterator.js +0 -26
- package/dist/esm/useDataList/recordIterator.js.map +0 -7
- package/dist/esm/useDataList/useDataList.js +0 -70
- package/dist/esm/useDataList/useDataList.js.map +0 -7
- package/dist/esm/utils.js +0 -78
- package/dist/esm/utils.js.map +0 -7
- package/dist/esm/virtualization/AutoHeightList.js +0 -46
- package/dist/esm/virtualization/AutoHeightList.js.map +0 -7
- package/dist/esm/virtualization/FluidHeightList.js +0 -16
- package/dist/esm/virtualization/FluidHeightList.js.map +0 -7
- package/dist/esm/virtualization/index.js +0 -16
- package/dist/esm/virtualization/index.js.map +0 -7
- package/dist/types/Animations/BaseAnimation.d.ts +0 -12
- package/dist/types/Animations/Grow.d.ts +0 -11
- package/dist/types/Animations/GrowRight.d.ts +0 -11
- package/dist/types/Animations/GrowVertical.d.ts +0 -11
- package/dist/types/Animations/index.d.ts +0 -4
- package/dist/types/CheckableGroup.d.ts +0 -19
- package/dist/types/DeferRenderAfterComputation.d.ts +0 -7
- package/dist/types/FocusGroup/FocusGrid.d.ts +0 -12
- package/dist/types/FocusGroup/FocusGroup.d.ts +0 -38
- package/dist/types/FocusGroup/FocusGroupContext.d.ts +0 -4
- package/dist/types/FocusGroup/FocusGroupManager.d.ts +0 -26
- package/dist/types/FocusGroup/focusGroupManagerHoc.d.ts +0 -8
- package/dist/types/FocusGroup/index.d.ts +0 -7
- package/dist/types/FocusGroup/useFocusGroupItem.d.ts +0 -4
- package/dist/types/FocusGroup/utils/getNextCellPosition.d.ts +0 -14
- package/dist/types/GroupContext/Group.d.ts +0 -15
- package/dist/types/GroupContext/GroupContext.d.ts +0 -2
- package/dist/types/GroupContext/GroupItem.d.ts +0 -5
- package/dist/types/GroupContext/index.d.ts +0 -3
- package/dist/types/ScrollSync/ScrollSync.d.ts +0 -23
- package/dist/types/ScrollSync/ScrollSyncPane.d.ts +0 -2
- package/dist/types/ScrollSync/ScrollSyncProvider.d.ts +0 -12
- package/dist/types/ScrollSync/index.d.ts +0 -4
- package/dist/types/ScrollSync/useScrollSync.d.ts +0 -7
- package/dist/types/constants.d.ts +0 -30
- package/dist/types/createDataInstance/createInstancePlugin.d.ts +0 -4
- package/dist/types/createDataInstance/createInstanceRef.d.ts +0 -14
- package/dist/types/createDataInstance/index.d.ts +0 -3
- package/dist/types/createDataInstance/tests/createInstanceRef.test.d.ts +0 -0
- package/dist/types/createDataInstance/utils.d.ts +0 -9
- package/dist/types/defer-render-hoc/index.d.ts +0 -63
- package/dist/types/dimsum.config.d.ts +0 -5
- package/dist/types/prop-types.d.ts +0 -41
- package/dist/types/react-spring/index.d.ts +0 -1
- package/dist/types/react-spring/renderprops.d.ts +0 -1
- package/dist/types/toolbar/ToolbarProvider.d.ts +0 -5
- package/dist/types/useDataGrid/VolatileRowsListener.d.ts +0 -7
- package/dist/types/useDataGrid/index.d.ts +0 -3
- package/dist/types/useDataGrid/initColumnDefinition.d.ts +0 -6
- package/dist/types/useDataGrid/useDataGrid.d.ts +0 -9
- package/dist/types/useDataList/index.d.ts +0 -2
- package/dist/types/useDataList/recordIterator.d.ts +0 -1
- package/dist/types/useDataList/useDataList.d.ts +0 -14
- package/dist/types/utils.d.ts +0 -22
- package/dist/types/virtualization/AutoHeightList.d.ts +0 -2
- package/dist/types/virtualization/FluidHeightList.d.ts +0 -2
- package/dist/types/virtualization/index.d.ts +0 -9
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
-
cloneDeep,
|
|
4
|
-
compose,
|
|
5
|
-
isEqual,
|
|
6
|
-
isObject,
|
|
7
|
-
setRef,
|
|
8
|
-
usePrevious,
|
|
9
|
-
useDerivedStateFromProps
|
|
10
|
-
} from "@elliemae/ds-utilities";
|
|
11
|
-
import { useMemo, useRef, useState } from "react";
|
|
12
|
-
import { v4 as uuidv4 } from "uuid";
|
|
13
|
-
import * as resolve from "table-resolver";
|
|
14
|
-
import { initColumnDefinition } from "./initColumnDefinition.js";
|
|
15
|
-
import { applyDecorators, decorateColumns, reducePropsGetter } from "../createDataInstance/utils.js";
|
|
16
|
-
import { VolatileRowsListener } from "./VolatileRowsListener.js";
|
|
17
|
-
import { isInternetExplorer } from "../utils.js";
|
|
18
|
-
const IS_INTERNET_EXPLORER = isInternetExplorer();
|
|
19
|
-
const useDataGrid = ({ uuid: uuidProp, plugins: pluginsFromProps, rows, columns, renderers = {}, ...props }) => {
|
|
20
|
-
const plugins = pluginsFromProps;
|
|
21
|
-
const instance = useRef();
|
|
22
|
-
const tableRef = useRef();
|
|
23
|
-
const headerRef = useRef();
|
|
24
|
-
const bodyRef = useRef();
|
|
25
|
-
const bodyInnerRef = useRef();
|
|
26
|
-
const [uuid] = useState(uuidProp || (() => uuidv4()));
|
|
27
|
-
const [hasScroll, setHasScroll] = useState(false);
|
|
28
|
-
const [isRowDragging, setIsRowDragging] = useState(false);
|
|
29
|
-
const isScrolling = useRef();
|
|
30
|
-
const shouldRefocus = useRef();
|
|
31
|
-
const [RowsObserver] = useState(() => new VolatileRowsListener());
|
|
32
|
-
const [originalRows, updateRows] = useDerivedStateFromProps(rows, {
|
|
33
|
-
onUpdate: resolve.resolve({
|
|
34
|
-
columns,
|
|
35
|
-
method: (extra) => compose(resolve.byFunction("valueTransformation")(extra), resolve.nested(extra))
|
|
36
|
-
}),
|
|
37
|
-
updateOnStateChange: true
|
|
38
|
-
});
|
|
39
|
-
instance.current = {
|
|
40
|
-
decoratedRenderers: cloneDeep(renderers),
|
|
41
|
-
decoratedColumns: columns,
|
|
42
|
-
columns,
|
|
43
|
-
rows,
|
|
44
|
-
composedRows: originalRows,
|
|
45
|
-
getRowProps: [],
|
|
46
|
-
getHeaderRowProps: [],
|
|
47
|
-
getBodyProps: [],
|
|
48
|
-
getTableProps: [],
|
|
49
|
-
effects: [],
|
|
50
|
-
uuid,
|
|
51
|
-
props,
|
|
52
|
-
refs: {
|
|
53
|
-
table: tableRef,
|
|
54
|
-
body: bodyRef,
|
|
55
|
-
header: headerRef,
|
|
56
|
-
innerBody: bodyInnerRef
|
|
57
|
-
},
|
|
58
|
-
state: {
|
|
59
|
-
hasScroll
|
|
60
|
-
},
|
|
61
|
-
actions: {
|
|
62
|
-
updateRows
|
|
63
|
-
},
|
|
64
|
-
updateRows,
|
|
65
|
-
// eslint-disable-next-line no-return-assign
|
|
66
|
-
enableEvents: () => document.body.style.pointerEvents = IS_INTERNET_EXPLORER ? "" : null,
|
|
67
|
-
// eslint-disable-next-line no-return-assign
|
|
68
|
-
disableEvents: () => document.body.style.pointerEvents = "none",
|
|
69
|
-
observeRows: (observer) => RowsObserver.observe(observer),
|
|
70
|
-
hotKeys: {},
|
|
71
|
-
shouldRefocus,
|
|
72
|
-
isScrolling,
|
|
73
|
-
setHasScroll,
|
|
74
|
-
setIsRowDragging,
|
|
75
|
-
isRowDragging,
|
|
76
|
-
plugins
|
|
77
|
-
};
|
|
78
|
-
instance.current.getState = () => instance.current.state;
|
|
79
|
-
instance.current.getInstance = () => instance.current;
|
|
80
|
-
const defaultDecorators = {
|
|
81
|
-
decorateGrid: [],
|
|
82
|
-
registerStateHook: [],
|
|
83
|
-
registerHotKeys: [],
|
|
84
|
-
decorateColumn: [],
|
|
85
|
-
decorateColumns: [
|
|
86
|
-
(cols) => cols.map(
|
|
87
|
-
(col) => initColumnDefinition({
|
|
88
|
-
useTextTruncation: col.useTextTruncation,
|
|
89
|
-
wrapText: props.wrapText,
|
|
90
|
-
normalize: props.normalizeDataKeys
|
|
91
|
-
})(col)
|
|
92
|
-
)
|
|
93
|
-
],
|
|
94
|
-
decorateRenderers: [],
|
|
95
|
-
getRowProps: [],
|
|
96
|
-
getHeaderRowProps: [],
|
|
97
|
-
getBodyProps: [],
|
|
98
|
-
getTableProps: [],
|
|
99
|
-
getHeaderProps: [],
|
|
100
|
-
composeRows: []
|
|
101
|
-
};
|
|
102
|
-
const decorators = useMemo(() => {
|
|
103
|
-
let nextDecorators = defaultDecorators;
|
|
104
|
-
plugins.forEach((plugin) => nextDecorators = plugin(nextDecorators));
|
|
105
|
-
return nextDecorators;
|
|
106
|
-
}, [plugins]);
|
|
107
|
-
instance.current = decorators.decorateGrid.reduce(
|
|
108
|
-
(nextInstance, decorator) => ({
|
|
109
|
-
...nextInstance,
|
|
110
|
-
...decorator(instance.current)
|
|
111
|
-
}),
|
|
112
|
-
instance.current
|
|
113
|
-
);
|
|
114
|
-
instance.current = decorators.registerStateHook.reduce((nextInstance, decorator) => {
|
|
115
|
-
const { state, actions } = decorator(instance.current);
|
|
116
|
-
return {
|
|
117
|
-
...nextInstance,
|
|
118
|
-
state: {
|
|
119
|
-
...nextInstance.state,
|
|
120
|
-
...state
|
|
121
|
-
},
|
|
122
|
-
actions: {
|
|
123
|
-
...nextInstance.actions,
|
|
124
|
-
...actions
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
}, instance.current);
|
|
128
|
-
const reduceHotKey = (nextInstance, { key, handler, options }) => ({
|
|
129
|
-
...nextInstance,
|
|
130
|
-
hotKeys: {
|
|
131
|
-
...nextInstance.hotKeys,
|
|
132
|
-
[key]: { handler, options }
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
instance.current = decorators.registerHotKeys.reduce((nextInstance, decorator) => {
|
|
136
|
-
const hotKeys = decorator(nextInstance);
|
|
137
|
-
if (Array.isArray(hotKeys)) {
|
|
138
|
-
return hotKeys.reduce(reduceHotKey, nextInstance);
|
|
139
|
-
}
|
|
140
|
-
return reduceHotKey(nextInstance, hotKeys);
|
|
141
|
-
}, instance.current);
|
|
142
|
-
instance.current.decoratedRenderers = applyDecorators(
|
|
143
|
-
instance.current.decoratedRenderers,
|
|
144
|
-
decorators.decorateRenderers,
|
|
145
|
-
instance.current
|
|
146
|
-
);
|
|
147
|
-
instance.current.decoratedColumns = useMemo(() => {
|
|
148
|
-
const visibleColumns = cloneDeep(columns).filter(
|
|
149
|
-
(column) => typeof column.visible === "undefined" || column.visible
|
|
150
|
-
);
|
|
151
|
-
return visibleColumns.length ? decorateColumns(visibleColumns, decorators, instance.current) : [];
|
|
152
|
-
}, [columns]);
|
|
153
|
-
instance.current.getBodyProps = reducePropsGetter(decorators.getBodyProps, instance.current);
|
|
154
|
-
instance.current.getHeaderProps = reducePropsGetter(decorators.getHeaderProps, instance.current);
|
|
155
|
-
instance.current.getRowProps = reducePropsGetter(decorators.getRowProps, instance.current);
|
|
156
|
-
instance.current.getHeaderRowProps = reducePropsGetter(decorators.getHeaderRowProps, instance.current);
|
|
157
|
-
instance.current.getTableProps = reducePropsGetter(decorators.getTableProps, instance.current);
|
|
158
|
-
instance.current.composedRows = decorators.composeRows.reduce(
|
|
159
|
-
(nextRows, getter) => getter(nextRows, instance.current),
|
|
160
|
-
instance.current.composedRows
|
|
161
|
-
);
|
|
162
|
-
RowsObserver.notify(instance.current.composedRows);
|
|
163
|
-
const currentShouldRefocus = instance.current.shouldRefocus.current;
|
|
164
|
-
const prevState = usePrevious(instance.current.state);
|
|
165
|
-
if (isObject(currentShouldRefocus) && currentShouldRefocus.forced) {
|
|
166
|
-
instance.current.shouldRefocus.current = currentShouldRefocus.value;
|
|
167
|
-
} else {
|
|
168
|
-
instance.current.shouldRefocus.current = !isEqual(prevState, instance.current.state);
|
|
169
|
-
}
|
|
170
|
-
if (props.instanceRef)
|
|
171
|
-
setRef(props.instanceRef, instance.current);
|
|
172
|
-
return {
|
|
173
|
-
...instance.current,
|
|
174
|
-
decorators
|
|
175
|
-
};
|
|
176
|
-
};
|
|
177
|
-
var useDataGrid_default = useDataGrid;
|
|
178
|
-
export {
|
|
179
|
-
useDataGrid_default as default,
|
|
180
|
-
useDataGrid
|
|
181
|
-
};
|
|
182
|
-
//# sourceMappingURL=useDataGrid.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/useDataGrid/useDataGrid.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport {\n cloneDeep,\n compose,\n isEqual,\n isObject,\n setRef,\n usePrevious,\n useDerivedStateFromProps,\n} from '@elliemae/ds-utilities';\nimport { useMemo, useRef, useState } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\nimport * as resolve from 'table-resolver';\nimport { initColumnDefinition } from './initColumnDefinition.js';\nimport { applyDecorators, decorateColumns, reducePropsGetter } from '../createDataInstance/utils.js';\nimport { VolatileRowsListener } from './VolatileRowsListener.js';\nimport { isInternetExplorer } from '../utils.js';\n\nconst IS_INTERNET_EXPLORER = isInternetExplorer();\n\n// TODO: Reuse createDataInstance for the grid the same\n// way as the list does ex: packages/ds-shared/src/useDataList/useDataList.js\n// eslint-disable-next-line max-statements\nexport const useDataGrid = ({ uuid: uuidProp, plugins: pluginsFromProps, rows, columns, renderers = {}, ...props }) => {\n const plugins = pluginsFromProps;\n const instance = useRef();\n const tableRef = useRef();\n const headerRef = useRef();\n const bodyRef = useRef();\n const bodyInnerRef = useRef();\n const [uuid] = useState(uuidProp || (() => uuidv4()));\n const [hasScroll, setHasScroll] = useState(false);\n const [isRowDragging, setIsRowDragging] = useState(false);\n const isScrolling = useRef();\n const shouldRefocus = useRef(); // todo: we probably need a plugin for focus related stuff\n const [RowsObserver] = useState(() => new VolatileRowsListener());\n\n // todo move this with rows composition\n const [originalRows, updateRows] = useDerivedStateFromProps(rows, {\n onUpdate: resolve.resolve({\n columns,\n method: (extra) => compose(resolve.byFunction('valueTransformation')(extra), resolve.nested(extra)),\n }),\n updateOnStateChange: true,\n });\n\n instance.current = {\n decoratedRenderers: cloneDeep(renderers),\n decoratedColumns: columns,\n columns,\n rows,\n composedRows: originalRows,\n getRowProps: [],\n getHeaderRowProps: [],\n getBodyProps: [],\n getTableProps: [],\n effects: [],\n uuid,\n props,\n refs: {\n table: tableRef,\n body: bodyRef,\n header: headerRef,\n innerBody: bodyInnerRef,\n },\n state: {\n hasScroll,\n },\n actions: {\n updateRows,\n },\n updateRows,\n // eslint-disable-next-line no-return-assign\n enableEvents: () => (document.body.style.pointerEvents = IS_INTERNET_EXPLORER ? '' : null),\n // eslint-disable-next-line no-return-assign\n disableEvents: () => (document.body.style.pointerEvents = 'none'),\n observeRows: (observer) => RowsObserver.observe(observer),\n hotKeys: {},\n shouldRefocus,\n isScrolling,\n setHasScroll,\n setIsRowDragging,\n isRowDragging,\n plugins,\n };\n instance.current.getState = () => instance.current.state;\n instance.current.getInstance = () => instance.current;\n\n const defaultDecorators = {\n decorateGrid: [],\n registerStateHook: [],\n registerHotKeys: [],\n decorateColumn: [],\n decorateColumns: [\n (cols) =>\n cols.map((col) =>\n initColumnDefinition({\n useTextTruncation: col.useTextTruncation,\n wrapText: props.wrapText,\n normalize: props.normalizeDataKeys,\n })(col),\n ),\n ],\n decorateRenderers: [],\n getRowProps: [],\n getHeaderRowProps: [],\n getBodyProps: [],\n getTableProps: [],\n getHeaderProps: [],\n composeRows: [],\n };\n\n const decorators = useMemo(() => {\n let nextDecorators = defaultDecorators;\n // eslint-disable-next-line no-return-assign\n plugins.forEach((plugin) => (nextDecorators = plugin(nextDecorators)));\n return nextDecorators;\n }, [plugins]);\n\n instance.current = decorators.decorateGrid.reduce(\n (nextInstance, decorator) => ({\n ...nextInstance,\n ...decorator(instance.current),\n }),\n instance.current,\n );\n\n instance.current = decorators.registerStateHook.reduce((nextInstance, decorator) => {\n const { state, actions } = decorator(instance.current);\n return {\n ...nextInstance,\n state: {\n ...nextInstance.state,\n ...state,\n },\n actions: {\n ...nextInstance.actions,\n ...actions,\n },\n };\n }, instance.current);\n\n const reduceHotKey = (nextInstance, { key, handler, options }) => ({\n ...nextInstance,\n hotKeys: {\n ...nextInstance.hotKeys,\n [key]: { handler, options },\n },\n });\n instance.current = decorators.registerHotKeys.reduce((nextInstance, decorator) => {\n const hotKeys = decorator(nextInstance);\n if (Array.isArray(hotKeys)) {\n return hotKeys.reduce(reduceHotKey, nextInstance);\n }\n return reduceHotKey(nextInstance, hotKeys);\n }, instance.current);\n\n instance.current.decoratedRenderers = applyDecorators(\n instance.current.decoratedRenderers,\n decorators.decorateRenderers,\n instance.current,\n );\n\n instance.current.decoratedColumns = useMemo(() => {\n const visibleColumns = cloneDeep(columns).filter(\n (column) => typeof column.visible === 'undefined' || column.visible,\n );\n return visibleColumns.length ? decorateColumns(visibleColumns, decorators, instance.current) : [];\n }, [columns]);\n\n instance.current.getBodyProps = reducePropsGetter(decorators.getBodyProps, instance.current);\n instance.current.getHeaderProps = reducePropsGetter(decorators.getHeaderProps, instance.current);\n instance.current.getRowProps = reducePropsGetter(decorators.getRowProps, instance.current);\n instance.current.getHeaderRowProps = reducePropsGetter(decorators.getHeaderRowProps, instance.current);\n instance.current.getTableProps = reducePropsGetter(decorators.getTableProps, instance.current);\n\n instance.current.composedRows = decorators.composeRows.reduce(\n (nextRows, getter) => getter(nextRows, instance.current),\n instance.current.composedRows,\n );\n\n RowsObserver.notify(instance.current.composedRows);\n\n const currentShouldRefocus = instance.current.shouldRefocus.current;\n const prevState = usePrevious(instance.current.state);\n if (isObject(currentShouldRefocus) && currentShouldRefocus.forced) {\n instance.current.shouldRefocus.current = currentShouldRefocus.value;\n } else {\n instance.current.shouldRefocus.current = !isEqual(prevState, instance.current.state);\n }\n\n if (props.instanceRef) setRef(props.instanceRef, instance.current);\n\n return {\n ...instance.current,\n decorators,\n };\n};\n\nexport default useDataGrid;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACCvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,SAAS,QAAQ,gBAAgB;AAC1C,SAAS,MAAM,cAAc;AAC7B,YAAY,aAAa;AACzB,SAAS,4BAA4B;AACr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,WAAW,gBAAgB,SAAS,OAAO;AAC/F,WAAS,QAAQ,cAAc,kBAAkB,WAAW,aAAa,SAAS,OAAO;AACzF,WAAS,QAAQ,oBAAoB,kBAAkB,WAAW,mBAAmB,SAAS,OAAO;AACrG,WAAS,QAAQ,gBAAgB,kBAAkB,WAAW,eAAe,SAAS,OAAO;AAE7F,WAAS,QAAQ,eAAe,WAAW,YAAY;AAAA,IACrD,CAAC,UAAU,WAAW,OAAO,UAAU,SAAS,OAAO;AAAA,IACvD,SAAS,QAAQ;AAAA,EACnB;AAEA,eAAa,OAAO,SAAS,QAAQ,YAAY;AAEjD,QAAM,uBAAuB,SAAS,QAAQ,cAAc;AAC5D,QAAM,YAAY,YAAY,SAAS,QAAQ,KAAK;AACpD,MAAI,SAAS,oBAAoB,KAAK,qBAAqB,QAAQ;AACjE,aAAS,QAAQ,cAAc,UAAU,qBAAqB;AAAA,EAChE,OAAO;AACL,aAAS,QAAQ,cAAc,UAAU,CAAC,QAAQ,WAAW,SAAS,QAAQ,KAAK;AAAA,EACrF;AAEA,MAAI,MAAM;AAAa,WAAO,MAAM,aAAa,SAAS,OAAO;AAEjE,SAAO;AAAA,IACL,GAAG,SAAS;AAAA,IACZ;AAAA,EACF;AACF;AAEA,IAAO,sBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/useDataList/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './useDataList.js';\nexport * from './recordIterator.js';\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,cAAc;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
const defaultStrategy = () => {
|
|
3
|
-
throw Error("Implement an iterator strategy for record iterator");
|
|
4
|
-
};
|
|
5
|
-
function recordIterator(records, strategy = defaultStrategy, decorators = [], instance) {
|
|
6
|
-
const nextRows = [];
|
|
7
|
-
strategy({
|
|
8
|
-
data: records,
|
|
9
|
-
cb: (row) => {
|
|
10
|
-
let nextRow = row;
|
|
11
|
-
for (let i = 0; i < decorators.length; i++) {
|
|
12
|
-
nextRow = decorators[i](nextRow, instance);
|
|
13
|
-
if (!nextRow)
|
|
14
|
-
break;
|
|
15
|
-
}
|
|
16
|
-
if (nextRow)
|
|
17
|
-
nextRows.push(nextRow);
|
|
18
|
-
},
|
|
19
|
-
instance
|
|
20
|
-
});
|
|
21
|
-
return nextRows;
|
|
22
|
-
}
|
|
23
|
-
export {
|
|
24
|
-
recordIterator
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=recordIterator.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/useDataList/recordIterator.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "const defaultStrategy = () => {\n throw Error('Implement an iterator strategy for record iterator');\n};\n\nexport function recordIterator(records, strategy = defaultStrategy, decorators = [], instance) {\n const nextRows = [];\n\n strategy({\n data: records,\n cb: (row) => {\n let nextRow = row;\n\n // eslint-disable-next-line no-loops/no-loops,no-plusplus\n for (let i = 0; i < decorators.length; i++) {\n nextRow = decorators[i](nextRow, instance);\n if (!nextRow) break;\n }\n\n if (nextRow) nextRows.push(nextRow);\n },\n instance,\n });\n\n return nextRows;\n}\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,MAAM,kBAAkB,MAAM;AAC5B,QAAM,MAAM,oDAAoD;AAClE;AAEO,SAAS,eAAe,SAAS,WAAW,iBAAiB,aAAa,CAAC,GAAG,UAAU;AAC7F,QAAM,WAAW,CAAC;AAElB,WAAS;AAAA,IACP,MAAM;AAAA,IACN,IAAI,CAAC,QAAQ;AACX,UAAI,UAAU;AAGd,eAAS,IAAI,GAAG,IAAI,WAAW,QAAQ,KAAK;AAC1C,kBAAU,WAAW,CAAC,EAAE,SAAS,QAAQ;AACzC,YAAI,CAAC;AAAS;AAAA,MAChB;AAEA,UAAI;AAAS,iBAAS,KAAK,OAAO;AAAA,IACpC;AAAA,IACA;AAAA,EACF,CAAC;AAED,SAAO;AACT;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { useMemo, useRef } from "react";
|
|
3
|
-
import { setRef } from "@elliemae/ds-utilities";
|
|
4
|
-
import { get } from "lodash";
|
|
5
|
-
import { composeFormatters, reducePropsGetter } from "../createDataInstance/utils.js";
|
|
6
|
-
import { recordIterator } from "./recordIterator.js";
|
|
7
|
-
import { createDataInstanceRef } from "../createDataInstance/createInstanceRef.js";
|
|
8
|
-
const getItemLabel = (record, nameKey = "name") => get(record, ["data", nameKey]);
|
|
9
|
-
const getItemChildren = (record, childrenKey = "children") => get(record, ["data", childrenKey]);
|
|
10
|
-
const listRenderers = {
|
|
11
|
-
list: "ul",
|
|
12
|
-
item: "li"
|
|
13
|
-
};
|
|
14
|
-
const useDataList = ({
|
|
15
|
-
data = [],
|
|
16
|
-
plugins = [],
|
|
17
|
-
renderers = listRenderers,
|
|
18
|
-
itemRenderer = [],
|
|
19
|
-
customDecorators,
|
|
20
|
-
...props
|
|
21
|
-
}) => {
|
|
22
|
-
const listRef = useRef();
|
|
23
|
-
const { instance, decorators } = createDataInstanceRef({
|
|
24
|
-
data,
|
|
25
|
-
renderers,
|
|
26
|
-
plugins,
|
|
27
|
-
customDecorators: {
|
|
28
|
-
...customDecorators,
|
|
29
|
-
recordIterator,
|
|
30
|
-
getListProps: [],
|
|
31
|
-
getItemProps: [],
|
|
32
|
-
itemRenderer: [...itemRenderer],
|
|
33
|
-
// components reduce to compose item content
|
|
34
|
-
record: [],
|
|
35
|
-
records: []
|
|
36
|
-
},
|
|
37
|
-
...props
|
|
38
|
-
});
|
|
39
|
-
instance.current.getListRef = () => listRef;
|
|
40
|
-
instance.current.setListRef = (ref) => {
|
|
41
|
-
listRef.current = ref;
|
|
42
|
-
};
|
|
43
|
-
instance.current.getItemLabel = (record) => getItemLabel(record, props.nameKey);
|
|
44
|
-
instance.current.getItemChildren = (record) => getItemChildren(record, props.childrenKey);
|
|
45
|
-
instance.current.decorators = decorators;
|
|
46
|
-
instance.current.getListProps = reducePropsGetter(decorators.getListProps, instance.current);
|
|
47
|
-
instance.current.getItemProps = reducePropsGetter(decorators.getItemProps, instance.current);
|
|
48
|
-
instance.current.itemRenderer = composeFormatters(instance.current.decorators.itemRenderer, instance.current);
|
|
49
|
-
instance.current.records = useMemo(() => {
|
|
50
|
-
let nextRecords = recordIterator(
|
|
51
|
-
data,
|
|
52
|
-
instance.current.decorators.recordIterator,
|
|
53
|
-
decorators.record,
|
|
54
|
-
instance.current
|
|
55
|
-
);
|
|
56
|
-
nextRecords = decorators.records.reduce((nextRows, getter) => getter(nextRows, instance.current), nextRecords);
|
|
57
|
-
return nextRecords;
|
|
58
|
-
});
|
|
59
|
-
if (props.instanceRef)
|
|
60
|
-
setRef(props.instanceRef, instance.current);
|
|
61
|
-
return instance.current;
|
|
62
|
-
};
|
|
63
|
-
var useDataList_default = useDataList;
|
|
64
|
-
export {
|
|
65
|
-
useDataList_default as default,
|
|
66
|
-
getItemChildren,
|
|
67
|
-
getItemLabel,
|
|
68
|
-
useDataList
|
|
69
|
-
};
|
|
70
|
-
//# sourceMappingURL=useDataList.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/useDataList/useDataList.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useMemo, useRef } from 'react';\nimport { setRef } from '@elliemae/ds-utilities';\nimport { get } from 'lodash';\nimport { composeFormatters, reducePropsGetter } from '../createDataInstance/utils.js';\nimport { recordIterator } from './recordIterator.js';\nimport { createDataInstanceRef } from '../createDataInstance/createInstanceRef.js';\n\nexport const getItemLabel = (record, nameKey = 'name') => get(record, ['data', nameKey]);\nexport const getItemChildren = (record, childrenKey = 'children') => get(record, ['data', childrenKey]);\n\nconst listRenderers = {\n list: 'ul',\n item: 'li',\n};\n\n// todo: check if a plugin is a LIST plugin rather than GRID\nexport const useDataList = ({\n data = [],\n plugins = [],\n renderers = listRenderers,\n itemRenderer = [],\n customDecorators,\n ...props\n}) => {\n const listRef = useRef();\n const { instance, decorators } = createDataInstanceRef({\n data,\n renderers,\n plugins,\n customDecorators: {\n ...customDecorators,\n recordIterator,\n getListProps: [],\n getItemProps: [],\n itemRenderer: [...itemRenderer], // components reduce to compose item content\n record: [],\n records: [],\n },\n ...props,\n });\n instance.current.getListRef = () => listRef;\n instance.current.setListRef = (ref) => {\n listRef.current = ref;\n };\n instance.current.getItemLabel = (record) => getItemLabel(record, props.nameKey);\n instance.current.getItemChildren = (record) => getItemChildren(record, props.childrenKey);\n\n instance.current.decorators = decorators;\n instance.current.getListProps = reducePropsGetter(decorators.getListProps, instance.current);\n instance.current.getItemProps = reducePropsGetter(decorators.getItemProps, instance.current);\n instance.current.itemRenderer = composeFormatters(instance.current.decorators.itemRenderer, instance.current);\n\n instance.current.records = useMemo(() => {\n // record iterator TREE / Simple\n let nextRecords = recordIterator(\n data,\n instance.current.decorators.recordIterator,\n decorators.record,\n instance.current,\n );\n\n // compose all records\n nextRecords = decorators.records.reduce((nextRows, getter) => getter(nextRows, instance.current), nextRecords);\n\n return nextRecords;\n });\n\n if (props.instanceRef) setRef(props.instanceRef, instance.current);\n\n return instance.current;\n};\n\nexport default useDataList;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,SAAS,cAAc;AAChC,SAAS,cAAc;AACvB,SAA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OAAO;AAE5G,WAAS,QAAQ,UAAU,QAAQ,MAAM;AAEvC,QAAI,cAAc;AAAA,MAChB;AAAA,MACA,SAAS,QAAQ,WAAW;AAAA,MAC5B,WAAW;AAAA,MACX,SAAS;AAAA,IACX;AAGA,kBAAc,WAAW,QAAQ,OAAO,CAAC,UAAU,WAAW,OAAO,UAAU,SAAS,OAAO,GAAG,WAAW;AAE7G,WAAO;AAAA,EACT,CAAC;AAED,MAAI,MAAM;AAAa,WAAO,MAAM,aAAa,SAAS,OAAO;AAEjE,SAAO,SAAS;AAClB;AAEA,IAAO,sBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/esm/utils.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
const objectType = (obj) => Object.prototype.toString.call(obj).slice(8, -1);
|
|
3
|
-
const isDefined = (param) => typeof param !== "undefined";
|
|
4
|
-
const isUndefined = (param) => typeof param === "undefined";
|
|
5
|
-
const isFunction = (param) => typeof param === "function";
|
|
6
|
-
const isNumber = (param) => typeof param === "number" && !isNaN(param);
|
|
7
|
-
const isString = (str) => objectType(str) === "String";
|
|
8
|
-
const isArray = (arr) => objectType(arr) === "Array";
|
|
9
|
-
const closest = (target, selector) => {
|
|
10
|
-
while (target) {
|
|
11
|
-
if (target.matches && target.matches(selector))
|
|
12
|
-
return target;
|
|
13
|
-
if (target.msMatchesSelector && target.msMatchesSelector(selector))
|
|
14
|
-
return target;
|
|
15
|
-
target = target.parentNode;
|
|
16
|
-
}
|
|
17
|
-
return null;
|
|
18
|
-
};
|
|
19
|
-
const getOffsetRect = (elem) => {
|
|
20
|
-
const box = elem.getBoundingClientRect();
|
|
21
|
-
const { body, documentElement } = document;
|
|
22
|
-
const scrollTop = window.pageYOffset || documentElement.scrollTop || body.scrollTop;
|
|
23
|
-
const scrollLeft = window.pageXOffset || documentElement.scrollLeft || body.scrollLeft;
|
|
24
|
-
const clientTop = documentElement.clientTop || body.clientTop || 0;
|
|
25
|
-
const clientLeft = documentElement.clientLeft || body.clientLeft || 0;
|
|
26
|
-
const top = box.top + scrollTop - clientTop;
|
|
27
|
-
const left = box.left + scrollLeft - clientLeft;
|
|
28
|
-
return { top: Math.round(top), left: Math.round(left) };
|
|
29
|
-
};
|
|
30
|
-
const getTotalScroll = (elem) => {
|
|
31
|
-
let top = 0;
|
|
32
|
-
let left = 0;
|
|
33
|
-
while (elem = elem.parentNode) {
|
|
34
|
-
top += elem.scrollTop || 0;
|
|
35
|
-
left += elem.scrollLeft || 0;
|
|
36
|
-
}
|
|
37
|
-
return { top, left };
|
|
38
|
-
};
|
|
39
|
-
const getTransformProps = (x, y) => ({
|
|
40
|
-
transform: `translate(${x}px, ${y}px)`
|
|
41
|
-
});
|
|
42
|
-
const listWithChildren = (list, childrenProp) => list.map((item) => ({
|
|
43
|
-
...item,
|
|
44
|
-
[childrenProp]: item[childrenProp] ? listWithChildren(item[childrenProp], childrenProp) : []
|
|
45
|
-
}));
|
|
46
|
-
const getAllNonEmptyNodesIds = (items, childrenProp) => {
|
|
47
|
-
let childrenIds = [];
|
|
48
|
-
const ids = items.filter((item) => item[childrenProp].length).map((item) => {
|
|
49
|
-
childrenIds = childrenIds.concat(getAllNonEmptyNodesIds(item[childrenProp], childrenProp));
|
|
50
|
-
return item.id;
|
|
51
|
-
});
|
|
52
|
-
return ids.concat(childrenIds);
|
|
53
|
-
};
|
|
54
|
-
const isInternetExplorer = () => {
|
|
55
|
-
const ua = window.navigator.userAgent;
|
|
56
|
-
const msie = ua.indexOf("MSIE ");
|
|
57
|
-
if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv:11\./)) {
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
return false;
|
|
61
|
-
};
|
|
62
|
-
export {
|
|
63
|
-
closest,
|
|
64
|
-
getAllNonEmptyNodesIds,
|
|
65
|
-
getOffsetRect,
|
|
66
|
-
getTotalScroll,
|
|
67
|
-
getTransformProps,
|
|
68
|
-
isArray,
|
|
69
|
-
isDefined,
|
|
70
|
-
isFunction,
|
|
71
|
-
isInternetExplorer,
|
|
72
|
-
isNumber,
|
|
73
|
-
isString,
|
|
74
|
-
isUndefined,
|
|
75
|
-
listWithChildren,
|
|
76
|
-
objectType
|
|
77
|
-
};
|
|
78
|
-
//# sourceMappingURL=utils.js.map
|
package/dist/esm/utils.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/utils.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-cond-assign */\nexport const objectType = (obj) => Object.prototype.toString.call(obj).slice(8, -1);\nexport const isDefined = (param) => typeof param !== 'undefined';\nexport const isUndefined = (param) => typeof param === 'undefined';\nexport const isFunction = (param) => typeof param === 'function';\nexport const isNumber = param => typeof param === 'number' && !isNaN(param); // eslint-disable-line\nexport const isString = (str) => objectType(str) === 'String';\nexport const isArray = (arr) => objectType(arr) === 'Array';\n\nexport const closest = (target, selector) => {\n // closest(e.target, '.field')\n while (target) {\n // eslint-disable-line\n if (target.matches && target.matches(selector)) return target;\n if (target.msMatchesSelector && target.msMatchesSelector(selector)) return target;\n // eslint-disable-next-line no-param-reassign\n target = target.parentNode;\n }\n return null;\n};\n\nexport const getOffsetRect = (elem) => {\n // (1)\n const box = elem.getBoundingClientRect();\n\n const { body, documentElement } = document;\n\n // (2)\n const scrollTop = window.pageYOffset || documentElement.scrollTop || body.scrollTop;\n const scrollLeft = window.pageXOffset || documentElement.scrollLeft || body.scrollLeft;\n\n // (3)\n const clientTop = documentElement.clientTop || body.clientTop || 0;\n const clientLeft = documentElement.clientLeft || body.clientLeft || 0;\n\n // (4)\n const top = box.top + scrollTop - clientTop;\n const left = box.left + scrollLeft - clientLeft;\n\n return { top: Math.round(top), left: Math.round(left) };\n};\n\nexport const getTotalScroll = (elem) => {\n let top = 0;\n let left = 0;\n\n // eslint-disable-next-line no-param-reassign\n while ((elem = elem.parentNode)) {\n top += elem.scrollTop || 0;\n left += elem.scrollLeft || 0;\n }\n\n return { top, left };\n};\n\nexport const getTransformProps = (x, y) => ({\n transform: `translate(${x}px, ${y}px)`,\n});\n\nexport const listWithChildren = (list, childrenProp) =>\n list.map((item) => ({\n ...item,\n [childrenProp]: item[childrenProp] ? listWithChildren(item[childrenProp], childrenProp) : [],\n }));\n\nexport const getAllNonEmptyNodesIds = (items, childrenProp) => {\n let childrenIds = [];\n const ids = items\n .filter((item) => item[childrenProp].length)\n .map((item) => {\n childrenIds = childrenIds.concat(getAllNonEmptyNodesIds(item[childrenProp], childrenProp));\n return item.id;\n });\n\n return ids.concat(childrenIds);\n};\n\nexport const isInternetExplorer = () => {\n const ua = window.navigator.userAgent;\n const msie = ua.indexOf('MSIE ');\n // If Internet Explorer, return version number\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv:11\\./)) {\n return true;\n }\n return false;\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACChB,MAAM,aAAa,CAAC,QAAQ,OAAO,UAAU,SAAS,KAAK,GAAG,EAAE,MAAM,GAAG,EAAE;AAC3E,MAAM,YAAY,CAAC,UAAU,OAAO,UAAU;AAC9C,MAAM,cAAc,CAAC,UAAU,OAAO,UAAU;AAChD,MAAM,aAAa,CAAC,UAAU,OAAO,UAAU;AAC/C,MAAM,WAAW,WAAS,OAAO,UAAU,YAAY,CAAC,MAAM,KAAK;AACnE,MAAM,WAAW,CAAC,QAAQ,WAAW,GAAG,MAAM;AAC9C,MAAM,UAAU,CAAC,QAAQ,WAAW,GAAG,MAAM;AAE7C,MAAM,UAAU,CAAC,QAAQ,aAAa;AAE3C,SAAO,QAAQ;AAEb,QAAI,OAAO,WAAW,OAAO,QAAQ,QAAQ;AAAG,aAAO;AACvD,QAAI,OAAO,qBAAqB,OAAO,kBAAkB,QAAQ;AAAG,aAAO;AAE3E,aAAS,OAA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AAC/B;AAEO,MAAM,qBAAqB,MAAM;AACtC,QAAM,KAAK,OAAO,UAAU;AAC5B,QAAM,OAAO,GAAG,QAAQ,OAAO;AAE/B,MAAI,OAAO,KAAK,CAAC,CAAC,UAAU,UAAU,MAAM,kBAAkB,GAAG;AAC/D,WAAO;AAAA,EACT;AACA,SAAO;AACT;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef, useRef } from "react";
|
|
4
|
-
import { FixedSizeList as List } from "react-window";
|
|
5
|
-
import { cx, useWindowScrollerList, mergeRefs } from "@elliemae/ds-utilities";
|
|
6
|
-
const AutoHeightList = forwardRef(
|
|
7
|
-
({
|
|
8
|
-
itemCount,
|
|
9
|
-
className,
|
|
10
|
-
innerRef,
|
|
11
|
-
itemData,
|
|
12
|
-
itemKey,
|
|
13
|
-
itemSize,
|
|
14
|
-
outerRef,
|
|
15
|
-
component: ListComponent = List,
|
|
16
|
-
...otherProps
|
|
17
|
-
}, ref) => {
|
|
18
|
-
const listRef = useRef();
|
|
19
|
-
const outerListRef = useRef();
|
|
20
|
-
useWindowScrollerList({
|
|
21
|
-
listInstance: listRef,
|
|
22
|
-
outerListRef
|
|
23
|
-
});
|
|
24
|
-
return /* @__PURE__ */ jsx(
|
|
25
|
-
ListComponent,
|
|
26
|
-
{
|
|
27
|
-
...otherProps,
|
|
28
|
-
ref: mergeRefs(ref, listRef),
|
|
29
|
-
className: cx(className, "window-scroller-override"),
|
|
30
|
-
height: window.innerHeight,
|
|
31
|
-
innerRef,
|
|
32
|
-
itemCount,
|
|
33
|
-
itemData,
|
|
34
|
-
itemKey,
|
|
35
|
-
itemSize,
|
|
36
|
-
outerRef: mergeRefs(outerListRef, outerRef),
|
|
37
|
-
overscanCount: 10,
|
|
38
|
-
useIsScrolling: true
|
|
39
|
-
}
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
);
|
|
43
|
-
export {
|
|
44
|
-
AutoHeightList
|
|
45
|
-
};
|
|
46
|
-
//# sourceMappingURL=AutoHeightList.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/virtualization/AutoHeightList.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { forwardRef, useRef } from 'react';\nimport { FixedSizeList as List } from 'react-window';\nimport { cx, useWindowScrollerList, mergeRefs } from '@elliemae/ds-utilities';\n\nexport const AutoHeightList = forwardRef(\n (\n {\n itemCount,\n className,\n innerRef,\n itemData,\n itemKey,\n itemSize,\n outerRef,\n component: ListComponent = List,\n ...otherProps\n },\n ref,\n ) => {\n const listRef = useRef();\n const outerListRef = useRef();\n\n useWindowScrollerList({\n listInstance: listRef,\n outerListRef,\n });\n\n return (\n <ListComponent\n {...otherProps}\n ref={mergeRefs(ref, listRef)}\n className={cx(className, 'window-scroller-override')}\n height={window.innerHeight}\n innerRef={innerRef}\n itemCount={itemCount}\n itemData={itemData}\n itemKey={itemKey}\n itemSize={itemSize}\n outerRef={mergeRefs(outerListRef, outerRef)}\n overscanCount={10}\n useIsScrolling\n />\n );\n },\n);\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;AC4BjB;AA5BN,SAAgB,YAAY,cAAc;AAC1C,SAAS,iBAAiB,YAAY;AACtC,SAAS,IAAI,uBAAuB,iBAAiB;AAE9C,MAAM,iBAAiB;AAAA,EAC5B,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW,gBAAgB;AAAA,IAC3B,GAAG;AAAA,EACL,GACA,QACG;AACH,UAAM,UAAU,OAAO;AACvB,UAAM,eAAe,OAAO;AAE5B,0BAAsB;AAAA,MACpB,cAAc;AAAA,MACd;AAAA,IACF,CAAC;AAED,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ,KAAK,UAAU,KAAK,OAAO;AAAA,QAC3B,WAAW,GAAG,WAAW,0BAA0B;AAAA,QACnD,QAAQ,OAAO;AAAA,QACf;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,UAAU,UAAU,cAAc,QAAQ;AAAA,QAC1C,eAAe;AAAA,QACf,gBAAc;AAAA;AAAA,IAChB;AAAA,EAEJ;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef } from "react";
|
|
4
|
-
import AutoSizer from "react-virtualized-auto-sizer";
|
|
5
|
-
const FluidHeightList = forwardRef(({ component: Component, ...props }, ref) => /* @__PURE__ */ jsx(AutoSizer, { disableWidth: true, children: ({ height: fluidHeight }) => /* @__PURE__ */ jsx(
|
|
6
|
-
Component,
|
|
7
|
-
{
|
|
8
|
-
...props,
|
|
9
|
-
ref,
|
|
10
|
-
height: fluidHeight - 32
|
|
11
|
-
}
|
|
12
|
-
) }));
|
|
13
|
-
export {
|
|
14
|
-
FluidHeightList
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=FluidHeightList.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/virtualization/FluidHeightList.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { forwardRef } from 'react';\nimport AutoSizer from 'react-virtualized-auto-sizer';\n\nexport const FluidHeightList = forwardRef(({ component: Component, ...props }, ref) => (\n <AutoSizer disableWidth>\n {({ height: fluidHeight }) => (\n <Component\n {...props}\n ref={ref}\n height={fluidHeight - 32} // taking in count the margins of the list\n />\n )}\n </AutoSizer>\n));\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACMjB;AANN,SAAgB,kBAAkB;AAClC,OAAO,eAAe;AAEf,MAAM,kBAAkB,WAAW,CAAC,EAAE,WAAW,WAAW,GAAG,MAAM,GAAG,QAC7E,oBAAC,aAAU,cAAY,MACpB,WAAC,EAAE,QAAQ,YAAY,MACtB;AAAA,EAAC;AAAA;AAAA,IACE,GAAG;AAAA,IACJ;AAAA,IACA,QAAQ,cAAc;AAAA;AACxB,GAEJ,CACD;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { FluidHeightList } from "./FluidHeightList.js";
|
|
3
|
-
import { AutoHeightList } from "./AutoHeightList.js";
|
|
4
|
-
function getVirtualListComponent({ component: Component, fluid, height, autoHeight }) {
|
|
5
|
-
if (autoHeight)
|
|
6
|
-
return AutoHeightList;
|
|
7
|
-
if (fluid)
|
|
8
|
-
return FluidHeightList;
|
|
9
|
-
return Component;
|
|
10
|
-
}
|
|
11
|
-
export {
|
|
12
|
-
AutoHeightList,
|
|
13
|
-
FluidHeightList,
|
|
14
|
-
getVirtualListComponent
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/virtualization/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { FluidHeightList } from './FluidHeightList.js';\nimport { AutoHeightList } from './AutoHeightList.js';\n\nexport { FluidHeightList, AutoHeightList };\n\nexport function getVirtualListComponent({ component: Component, fluid, height, autoHeight }) {\n if (autoHeight) return AutoHeightList;\n if (fluid) return FluidHeightList;\n return Component;\n}\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,uBAAuB;AAChC,SAAS,sBAAsB;AAIxB,SAAS,wBAAwB,EAAE,WAAW,WAAW,OAAO,QAAQ,WAAW,GAAG;AAC3F,MAAI;AAAY,WAAO;AACvB,MAAI;AAAO,WAAO;AAClB,SAAO;AACT;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
declare const BaseAnimation: ({ keys, items, duration, enter, from, leave, onRest, children, }: {
|
|
2
|
-
keys?: undefined;
|
|
3
|
-
items?: never[] | undefined;
|
|
4
|
-
duration?: number | undefined;
|
|
5
|
-
enter?: {} | undefined;
|
|
6
|
-
from?: {} | undefined;
|
|
7
|
-
leave?: {} | undefined;
|
|
8
|
-
onRest?: (() => null) | undefined;
|
|
9
|
-
children: any;
|
|
10
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export { BaseAnimation };
|
|
12
|
-
export default BaseAnimation;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
declare const Grow: ({ keys, duration, items, from, to, children, onRest }: {
|
|
2
|
-
keys?: undefined;
|
|
3
|
-
duration: any;
|
|
4
|
-
items?: undefined;
|
|
5
|
-
from?: number | undefined;
|
|
6
|
-
to?: number | undefined;
|
|
7
|
-
children: any;
|
|
8
|
-
onRest?: (() => null) | undefined;
|
|
9
|
-
}) => import("react/jsx-runtime.js").JSX.Element;
|
|
10
|
-
export { Grow };
|
|
11
|
-
export default Grow;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
declare const GrowRight: ({ keys, items, duration, from, to, children, onRest, }: {
|
|
2
|
-
keys?: undefined;
|
|
3
|
-
items?: undefined;
|
|
4
|
-
duration?: number | undefined;
|
|
5
|
-
from?: number | undefined;
|
|
6
|
-
to?: number | undefined;
|
|
7
|
-
children: any;
|
|
8
|
-
onRest?: (() => null) | undefined;
|
|
9
|
-
}) => import("react/jsx-runtime.js").JSX.Element;
|
|
10
|
-
export { GrowRight };
|
|
11
|
-
export default GrowRight;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
declare const GrowVertical: ({ keys, duration, items, from, to, children, onRest, }: {
|
|
2
|
-
keys?: undefined;
|
|
3
|
-
duration: any;
|
|
4
|
-
items?: undefined;
|
|
5
|
-
from?: number | undefined;
|
|
6
|
-
to?: number | undefined;
|
|
7
|
-
children: any;
|
|
8
|
-
onRest?: (() => null) | undefined;
|
|
9
|
-
}) => import("react/jsx-runtime.js").JSX.Element;
|
|
10
|
-
export { GrowVertical };
|
|
11
|
-
export default GrowVertical;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export declare function useCheckableGroup({ children, active: activeProp, multi, onCheck }: {
|
|
2
|
-
children: any;
|
|
3
|
-
active: any;
|
|
4
|
-
multi: any;
|
|
5
|
-
onCheck?: (() => null) | undefined;
|
|
6
|
-
}): any;
|
|
7
|
-
export declare const CheckableGroup: {
|
|
8
|
-
({ active, multi, children, }: {
|
|
9
|
-
active?: never[] | undefined;
|
|
10
|
-
multi?: boolean | undefined;
|
|
11
|
-
children: any;
|
|
12
|
-
}): any;
|
|
13
|
-
propTypes: {
|
|
14
|
-
active: any;
|
|
15
|
-
multi: any;
|
|
16
|
-
onCheck: any;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export default CheckableGroup;
|