@elliemae/ds-shared 3.16.0 → 3.16.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 +5 -13
- package/dist/cjs/Animations/BaseAnimation.js.map +2 -2
- package/dist/cjs/Animations/Grow.js +6 -10
- package/dist/cjs/Animations/Grow.js.map +2 -2
- package/dist/cjs/Animations/GrowRight.js +5 -1
- package/dist/cjs/Animations/GrowRight.js.map +2 -2
- package/dist/cjs/Animations/GrowVertical.js +5 -1
- package/dist/cjs/Animations/GrowVertical.js.map +2 -2
- package/dist/cjs/Animations/index.js +8 -4
- package/dist/cjs/Animations/index.js.map +2 -2
- package/dist/cjs/CheckableGroup.js +10 -4
- package/dist/cjs/CheckableGroup.js.map +2 -2
- package/dist/cjs/DeferRenderAfterComputation.js +5 -6
- package/dist/cjs/DeferRenderAfterComputation.js.map +2 -2
- package/dist/cjs/FocusGroup/FocusGrid.js +5 -1
- package/dist/cjs/FocusGroup/FocusGrid.js.map +2 -2
- package/dist/cjs/FocusGroup/FocusGroup.js +4 -0
- package/dist/cjs/FocusGroup/FocusGroup.js.map +1 -1
- package/dist/cjs/FocusGroup/FocusGroupContext.js +4 -0
- package/dist/cjs/FocusGroup/FocusGroupContext.js.map +1 -1
- package/dist/cjs/FocusGroup/FocusGroupManager.js +6 -2
- package/dist/cjs/FocusGroup/FocusGroupManager.js.map +2 -2
- package/dist/cjs/FocusGroup/focusGroupManagerHoc.js +17 -16
- package/dist/cjs/FocusGroup/focusGroupManagerHoc.js.map +2 -2
- package/dist/cjs/FocusGroup/index.js +11 -7
- package/dist/cjs/FocusGroup/index.js.map +2 -2
- package/dist/cjs/FocusGroup/useFocusGroupItem.js +5 -1
- package/dist/cjs/FocusGroup/useFocusGroupItem.js.map +2 -2
- package/dist/cjs/FocusGroup/utils/getNextCellPosition.js +4 -0
- package/dist/cjs/FocusGroup/utils/getNextCellPosition.js.map +2 -2
- package/dist/cjs/GroupContext/Group.js +5 -1
- package/dist/cjs/GroupContext/Group.js.map +2 -2
- package/dist/cjs/GroupContext/GroupContext.js +4 -0
- package/dist/cjs/GroupContext/GroupContext.js.map +1 -1
- package/dist/cjs/GroupContext/GroupItem.js +5 -1
- package/dist/cjs/GroupContext/GroupItem.js.map +2 -2
- package/dist/cjs/GroupContext/index.js +7 -3
- package/dist/cjs/GroupContext/index.js.map +2 -2
- package/dist/cjs/ScrollSync/ScrollSync.js +4 -0
- package/dist/cjs/ScrollSync/ScrollSync.js.map +1 -1
- package/dist/cjs/ScrollSync/ScrollSyncPane.js +6 -4
- package/dist/cjs/ScrollSync/ScrollSyncPane.js.map +2 -2
- package/dist/cjs/ScrollSync/ScrollSyncProvider.js +25 -21
- package/dist/cjs/ScrollSync/ScrollSyncProvider.js.map +2 -2
- package/dist/cjs/ScrollSync/index.js +8 -4
- package/dist/cjs/ScrollSync/index.js.map +2 -2
- package/dist/cjs/ScrollSync/useScrollSync.js +5 -3
- package/dist/cjs/ScrollSync/useScrollSync.js.map +2 -2
- package/dist/cjs/constants.js +4 -0
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/createDataInstance/createInstancePlugin.js +4 -0
- package/dist/cjs/createDataInstance/createInstancePlugin.js.map +1 -1
- package/dist/cjs/createDataInstance/createInstanceRef.js +12 -25
- package/dist/cjs/createDataInstance/createInstanceRef.js.map +2 -2
- package/dist/cjs/createDataInstance/index.js +7 -3
- package/dist/cjs/createDataInstance/index.js.map +2 -2
- package/dist/cjs/createDataInstance/utils.js +9 -20
- package/dist/cjs/createDataInstance/utils.js.map +2 -2
- package/dist/cjs/defer-render-hoc/index.js +4 -0
- package/dist/cjs/defer-render-hoc/index.js.map +2 -2
- package/dist/cjs/dimsum.config.js +4 -0
- package/dist/cjs/dimsum.config.js.map +1 -1
- package/dist/cjs/index.js +20 -16
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/prop-types.js +4 -0
- package/dist/cjs/prop-types.js.map +1 -1
- package/dist/cjs/react-spring/index.js +4 -0
- package/dist/cjs/react-spring/index.js.map +1 -1
- package/dist/cjs/react-spring/renderprops.js +4 -0
- package/dist/cjs/react-spring/renderprops.js.map +1 -1
- package/dist/cjs/toolbar/ToolbarProvider.js +4 -0
- package/dist/cjs/toolbar/ToolbarProvider.js.map +1 -1
- package/dist/cjs/useDataGrid/VolatileRowsListener.js +4 -0
- package/dist/cjs/useDataGrid/VolatileRowsListener.js.map +2 -2
- package/dist/cjs/useDataGrid/index.js +7 -3
- package/dist/cjs/useDataGrid/index.js.map +2 -2
- package/dist/cjs/useDataGrid/initColumnDefinition.js +9 -4
- package/dist/cjs/useDataGrid/initColumnDefinition.js.map +2 -2
- package/dist/cjs/useDataGrid/useDataGrid.js +10 -4
- package/dist/cjs/useDataGrid/useDataGrid.js.map +2 -2
- package/dist/cjs/useDataList/index.js +6 -2
- package/dist/cjs/useDataList/index.js.map +2 -2
- package/dist/cjs/useDataList/recordIterator.js +4 -0
- package/dist/cjs/useDataList/recordIterator.js.map +2 -2
- package/dist/cjs/useDataList/useDataList.js +15 -22
- package/dist/cjs/useDataList/useDataList.js.map +3 -3
- package/dist/cjs/utils.js +5 -3
- package/dist/cjs/utils.js.map +2 -2
- package/dist/cjs/virtualization/AutoHeightList.js +4 -0
- package/dist/cjs/virtualization/AutoHeightList.js.map +1 -1
- package/dist/cjs/virtualization/FluidHeightList.js +12 -10
- package/dist/cjs/virtualization/FluidHeightList.js.map +2 -2
- package/dist/cjs/virtualization/index.js +6 -2
- package/dist/cjs/virtualization/index.js.map +2 -2
- package/dist/esm/Animations/BaseAnimation.js +1 -13
- package/dist/esm/Animations/BaseAnimation.js.map +2 -2
- package/dist/esm/Animations/Grow.js +2 -10
- package/dist/esm/Animations/Grow.js.map +2 -2
- package/dist/esm/Animations/GrowRight.js +1 -1
- package/dist/esm/Animations/GrowRight.js.map +1 -1
- package/dist/esm/Animations/GrowVertical.js +1 -1
- package/dist/esm/Animations/GrowVertical.js.map +1 -1
- package/dist/esm/Animations/index.js +4 -4
- package/dist/esm/Animations/index.js.map +1 -1
- package/dist/esm/CheckableGroup.js +6 -4
- package/dist/esm/CheckableGroup.js.map +2 -2
- package/dist/esm/DeferRenderAfterComputation.js +1 -6
- package/dist/esm/DeferRenderAfterComputation.js.map +2 -2
- package/dist/esm/FocusGroup/FocusGrid.js +1 -1
- package/dist/esm/FocusGroup/FocusGrid.js.map +2 -2
- package/dist/esm/FocusGroup/FocusGroup.js.map +1 -1
- package/dist/esm/FocusGroup/FocusGroupManager.js +2 -2
- package/dist/esm/FocusGroup/FocusGroupManager.js.map +2 -2
- package/dist/esm/FocusGroup/focusGroupManagerHoc.js +13 -16
- package/dist/esm/FocusGroup/focusGroupManagerHoc.js.map +2 -2
- package/dist/esm/FocusGroup/index.js +7 -7
- package/dist/esm/FocusGroup/index.js.map +1 -1
- package/dist/esm/FocusGroup/useFocusGroupItem.js +1 -1
- package/dist/esm/FocusGroup/useFocusGroupItem.js.map +2 -2
- package/dist/esm/FocusGroup/utils/getNextCellPosition.js.map +2 -2
- package/dist/esm/GroupContext/Group.js +1 -1
- package/dist/esm/GroupContext/Group.js.map +1 -1
- package/dist/esm/GroupContext/GroupItem.js +1 -1
- package/dist/esm/GroupContext/GroupItem.js.map +2 -2
- package/dist/esm/GroupContext/index.js +3 -3
- package/dist/esm/GroupContext/index.js.map +1 -1
- package/dist/esm/ScrollSync/ScrollSync.js.map +1 -1
- package/dist/esm/ScrollSync/ScrollSyncPane.js +2 -4
- package/dist/esm/ScrollSync/ScrollSyncPane.js.map +2 -2
- package/dist/esm/ScrollSync/ScrollSyncProvider.js +21 -21
- package/dist/esm/ScrollSync/ScrollSyncProvider.js.map +2 -2
- package/dist/esm/ScrollSync/index.js +4 -4
- package/dist/esm/ScrollSync/index.js.map +1 -1
- package/dist/esm/ScrollSync/useScrollSync.js +1 -3
- package/dist/esm/ScrollSync/useScrollSync.js.map +2 -2
- package/dist/esm/createDataInstance/createInstancePlugin.js.map +1 -1
- package/dist/esm/createDataInstance/createInstanceRef.js +8 -29
- package/dist/esm/createDataInstance/createInstanceRef.js.map +2 -2
- package/dist/esm/createDataInstance/index.js +3 -3
- package/dist/esm/createDataInstance/index.js.map +1 -1
- package/dist/esm/createDataInstance/utils.js +5 -20
- package/dist/esm/createDataInstance/utils.js.map +2 -2
- package/dist/esm/defer-render-hoc/index.js.map +2 -2
- package/dist/esm/index.js +16 -16
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/package.json +7 -0
- package/dist/esm/useDataGrid/VolatileRowsListener.js.map +2 -2
- package/dist/esm/useDataGrid/index.js +3 -3
- package/dist/esm/useDataGrid/index.js.map +1 -1
- package/dist/esm/useDataGrid/initColumnDefinition.js +5 -4
- package/dist/esm/useDataGrid/initColumnDefinition.js.map +2 -2
- package/dist/esm/useDataGrid/useDataGrid.js +6 -4
- package/dist/esm/useDataGrid/useDataGrid.js.map +2 -2
- package/dist/esm/useDataList/index.js +2 -2
- package/dist/esm/useDataList/index.js.map +1 -1
- package/dist/esm/useDataList/recordIterator.js.map +2 -2
- package/dist/esm/useDataList/useDataList.js +9 -23
- package/dist/esm/useDataList/useDataList.js.map +2 -2
- package/dist/esm/utils.js +1 -3
- package/dist/esm/utils.js.map +2 -2
- package/dist/esm/virtualization/AutoHeightList.js.map +1 -1
- package/dist/esm/virtualization/FluidHeightList.js +8 -10
- package/dist/esm/virtualization/FluidHeightList.js.map +2 -2
- package/dist/esm/virtualization/index.js +2 -2
- package/dist/esm/virtualization/index.js.map +1 -1
- package/dist/types/Animations/BaseAnimation.d.ts +1 -0
- package/dist/types/Animations/Grow.d.ts +2 -1
- package/dist/types/Animations/GrowRight.d.ts +1 -0
- package/dist/types/Animations/GrowVertical.d.ts +1 -0
- package/dist/types/Animations/index.d.ts +4 -4
- package/dist/types/CheckableGroup.d.ts +8 -9
- package/dist/types/DeferRenderAfterComputation.d.ts +1 -1
- package/dist/types/FocusGroup/focusGroupManagerHoc.d.ts +1 -0
- package/dist/types/FocusGroup/index.d.ts +7 -7
- package/dist/types/GroupContext/GroupItem.d.ts +1 -0
- package/dist/types/GroupContext/index.d.ts +3 -3
- package/dist/types/ScrollSync/ScrollSyncPane.d.ts +1 -0
- package/dist/types/ScrollSync/ScrollSyncProvider.d.ts +11 -10
- package/dist/types/ScrollSync/index.d.ts +4 -4
- package/dist/types/createDataInstance/index.d.ts +3 -3
- package/dist/types/index.d.ts +16 -16
- package/dist/types/useDataGrid/index.d.ts +3 -3
- package/dist/types/useDataList/index.d.ts +2 -2
- package/dist/types/virtualization/index.d.ts +2 -2
- package/package.json +7 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/ScrollSync/ScrollSyncProvider.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport raf from 'raf';\nimport PropTypes from 'prop-types';\n\nconst ScrollSyncContext = React.createContext();\n\nconst { Provider } = ScrollSyncContext;\n\
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;AC4Fd;AA5FT,OAAOA,YAAW;AAClB,OAAO,SAAS;AAGhB,MAAM,oBAAoBA,OAAM,cAAc;AAE9C,MAAM,EAAE,SAAS,IAAI;AAErB,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport raf from 'raf';\nimport PropTypes from 'prop-types';\n\nconst ScrollSyncContext = React.createContext();\n\nconst { Provider } = ScrollSyncContext;\n\nconst ScrollSyncProvider = ({ enabled, horizontal, vertical, children }) => {\n const panes = useRef();\n\n const registerPane = (node, groups) => {\n groups.forEach((group) => {\n if (!this.panes[group]) {\n this.panes[group] = [];\n }\n\n if (!this.findPane(node, group)) {\n if (this.panes[group].length > 0) {\n this.syncScrollPosition(this.panes[group][0], node);\n }\n this.panes[group].push(node);\n }\n });\n this.addEvents(node, groups);\n };\n const unregisterPane = (node, groups) => {\n groups.forEach((group) => {\n if (this.findPane(node, group)) {\n this.removeEvents(node);\n this.panes[group].splice(this.panes[group].indexOf(node), 1);\n }\n });\n };\n const addEvents = (node, groups) => {\n /* For some reason element.addEventListener doesnt work with document.body */\n node.onscroll = this.handlePaneScroll.bind(this, node, groups); // eslint-disable-line\n };\n const removeEvents = (node) => {\n /* For some reason element.removeEventListener doesnt work with document.body */\n node.onscroll = null; // eslint-disable-line\n };\n const findPane = (node, group) => {\n if (!this.panes[group]) {\n return false;\n }\n\n return this.panes[group].find((pane) => pane === node);\n };\n const handlePaneScroll = (node, groups) => {\n if (!enabled) return;\n\n window.requestAnimationFrame(() => {\n this.syncScrollPositions(node, groups);\n });\n };\n const syncScrollPositions = (scrolledPane, groups) => {\n groups.forEach((group) => {\n this.panes[group].forEach((pane) => {\n /* For all panes beside the currently scrolling one */\n if (scrolledPane !== pane) {\n /* Remove event listeners from the node that we'll manipulate */\n this.removeEvents(pane, group);\n this.syncScrollPosition(scrolledPane, pane);\n /* Re-attach event listeners after we're done scrolling */\n window.requestAnimationFrame(() => {\n this.addEvents(pane, groups);\n });\n }\n });\n });\n };\n const syncScrollPosition = raf((scrolledPane, pane) => {\n const { scrollTop, scrollHeight, clientHeight, scrollLeft, scrollWidth, clientWidth } = scrolledPane;\n\n const scrollTopOffset = scrollHeight - clientHeight;\n const scrollLeftOffset = scrollWidth - clientWidth;\n\n const { proportional, vertical, horizontal } = this.props;\n\n /* Calculate the actual pane height */\n const paneHeight = pane.scrollHeight - clientHeight;\n const paneWidth = pane.scrollWidth - clientWidth;\n /* Adjust the scrollTop position of it accordingly */\n if (vertical && scrollTopOffset > 0) {\n pane.scrollTop = proportional ? (paneHeight * scrollTop) / scrollTopOffset : scrollTop; // eslint-disable-line\n }\n if (horizontal && scrollLeftOffset > 0) {\n pane.scrollLeft = proportional ? (paneWidth * scrollLeft) / scrollLeftOffset : scrollLeft; // eslint-disable-line\n }\n });\n\n return <Provider>{children}</Provider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EnC,IAAO,6BAAQ;",
|
|
6
6
|
"names": ["React", "vertical", "horizontal"]
|
|
7
7
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { ScrollSync } from "./ScrollSync";
|
|
3
|
-
import { ScrollSyncPaneHOC } from "./ScrollSyncPane";
|
|
4
|
-
export * from "./ScrollSyncProvider";
|
|
5
|
-
export * from "./useScrollSync";
|
|
2
|
+
import { ScrollSync } from "./ScrollSync.js";
|
|
3
|
+
import { ScrollSyncPaneHOC } from "./ScrollSyncPane.js";
|
|
4
|
+
export * from "./ScrollSyncProvider.js";
|
|
5
|
+
export * from "./useScrollSync.js";
|
|
6
6
|
export {
|
|
7
7
|
ScrollSync,
|
|
8
8
|
ScrollSyncPaneHOC as ScrollSyncPane
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/ScrollSync/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { ScrollSync } from './ScrollSync';\nexport { ScrollSyncPaneHOC as ScrollSyncPane } from './ScrollSyncPane';\nexport * from './ScrollSyncProvider';\nexport * from './useScrollSync';\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { ScrollSync } from './ScrollSync.js';\nexport { ScrollSyncPaneHOC as ScrollSyncPane } from './ScrollSyncPane.js';\nexport * from './ScrollSyncProvider.js';\nexport * from './useScrollSync.js';\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,kBAAkB;AAC3B,SAA8B,yBAAsB;AACpD,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/ScrollSync/useScrollSync.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst useScrollSync = (props) => {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACGvB,MAAM,gBAAgB,CAAC,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst useScrollSync = (props) => ({});\n\nuseScrollSync.propTypes = {};\nuseScrollSync.defaultProps = {};\n\nexport { useScrollSync };\nexport default useScrollSync;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACGvB,MAAM,gBAAgB,CAAC,WAAW,CAAC;AAEnC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAG9B,IAAO,wBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/createDataInstance/createInstancePlugin.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "const getDecoratorsFromHooks = (hooks, decorators) => {\n const nextDecorators = { ...decorators };\n\n Object.keys(hooks).forEach((decorator) => {\n if (Array.isArray(decorators[decorator])) {\n nextDecorators[decorator] = [...decorators[decorator], hooks[decorator]];\n } else {\n nextDecorators[decorator] = hooks[decorator];\n }\n });\n\n return nextDecorators;\n};\n\nexport const createInstancePlugin = (name, hooks) => (decorators) => getDecoratorsFromHooks(hooks, decorators);\n\nexport default createInstancePlugin;\n\nexport { getDecoratorsFromHooks };\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,MAAM,yBAAyB,CAAC,OAAO,eAAe;AACpD,QAAM,iBAAiB,EAAE,GAAG,WAAW;AAEvC,SAAO,KAAK,KAAK,EAAE,QAAQ,CAAC,cAAc;AACxC,QAAI,MAAM,QAAQ,WAAW,
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,MAAM,yBAAyB,CAAC,OAAO,eAAe;AACpD,QAAM,iBAAiB,EAAE,GAAG,WAAW;AAEvC,SAAO,KAAK,KAAK,EAAE,QAAQ,CAAC,cAAc;AACxC,QAAI,MAAM,QAAQ,WAAW,SAAS,CAAC,GAAG;AACxC,qBAAe,SAAS,IAAI,CAAC,GAAG,WAAW,SAAS,GAAG,MAAM,SAAS,CAAC;AAAA,IACzE,OAAO;AACL,qBAAe,SAAS,IAAI,MAAM,SAAS;AAAA,IAC7C;AAAA,EACF,CAAC;AAED,SAAO;AACT;AAEO,MAAM,uBAAuB,CAAC,MAAM,UAAU,CAAC,eAAe,uBAAuB,OAAO,UAAU;AAE7G,IAAO,+BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,11 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import { v4 as uuidv4 } from "uuid";
|
|
3
3
|
import { useMemo, useRef, useState } from "react";
|
|
4
4
|
import { orderBy } from "lodash";
|
|
5
|
-
import {
|
|
6
|
-
mergeInstance,
|
|
7
|
-
registerHotKeysHookToInstance,
|
|
8
|
-
registerStateHookToInstance
|
|
9
|
-
} from "./utils";
|
|
5
|
+
import { mergeInstance, registerHotKeysHookToInstance, registerStateHookToInstance } from "./utils.js";
|
|
10
6
|
const defaultDecorators = {
|
|
11
7
|
instance: [],
|
|
12
8
|
state: [],
|
|
@@ -14,14 +10,7 @@ const defaultDecorators = {
|
|
|
14
10
|
renderers: [],
|
|
15
11
|
composeData: []
|
|
16
12
|
};
|
|
17
|
-
function createDataInstanceRef({
|
|
18
|
-
uuid: uuidProp,
|
|
19
|
-
data,
|
|
20
|
-
renderers,
|
|
21
|
-
plugins,
|
|
22
|
-
customDecorators,
|
|
23
|
-
...props
|
|
24
|
-
}) {
|
|
13
|
+
function createDataInstanceRef({ uuid: uuidProp, data, renderers, plugins, customDecorators, ...props }) {
|
|
25
14
|
const instance = useRef();
|
|
26
15
|
const [uuid] = useState(uuidProp || (() => uuidv4()));
|
|
27
16
|
instance.current = {
|
|
@@ -29,8 +18,10 @@ function createDataInstanceRef({
|
|
|
29
18
|
state: {},
|
|
30
19
|
actions: {},
|
|
31
20
|
hotKeys: {},
|
|
21
|
+
// keyboard hotkeys to run specific actions
|
|
32
22
|
originalData: data,
|
|
33
23
|
records: [],
|
|
24
|
+
// item abstraction with meta data for originalData
|
|
34
25
|
renderers,
|
|
35
26
|
ref(key) {
|
|
36
27
|
return (node) => instance.current.refs[key] = node;
|
|
@@ -49,25 +40,13 @@ function createDataInstanceRef({
|
|
|
49
40
|
});
|
|
50
41
|
Object.keys(nextDecorators).forEach((key) => {
|
|
51
42
|
if (Array.isArray(nextDecorators[key]))
|
|
52
|
-
nextDecorators[key] = orderBy(
|
|
53
|
-
nextDecorators[key],
|
|
54
|
-
(item) => item.order
|
|
55
|
-
);
|
|
43
|
+
nextDecorators[key] = orderBy(nextDecorators[key], (item) => item.order);
|
|
56
44
|
});
|
|
57
45
|
return nextDecorators;
|
|
58
46
|
}, []);
|
|
59
|
-
instance.current = decorators.instance.reduce(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
);
|
|
63
|
-
instance.current = decorators.state.reduce(
|
|
64
|
-
registerStateHookToInstance,
|
|
65
|
-
instance.current
|
|
66
|
-
);
|
|
67
|
-
instance.current = decorators.hotKeys.reduce(
|
|
68
|
-
registerHotKeysHookToInstance,
|
|
69
|
-
instance.current
|
|
70
|
-
);
|
|
47
|
+
instance.current = decorators.instance.reduce(mergeInstance, instance.current);
|
|
48
|
+
instance.current = decorators.state.reduce(registerStateHookToInstance, instance.current);
|
|
49
|
+
instance.current = decorators.hotKeys.reduce(registerHotKeysHookToInstance, instance.current);
|
|
71
50
|
instance.current.renderers = decorators.renderers.reduce(
|
|
72
51
|
(result, decorator) => decorator(result, instance.current),
|
|
73
52
|
renderers
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/createDataInstance/createInstanceRef.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { v4 as uuidv4 } from 'uuid';\nimport { useMemo, useRef, useState } from 'react';\nimport { orderBy } from 'lodash';\nimport {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,MAAM,cAAc;AAC7B,SAAS,SAAS,QAAQ,gBAAgB;AAC1C,SAAS,eAAe;AACxB
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { v4 as uuidv4 } from 'uuid';\nimport { useMemo, useRef, useState } from 'react';\nimport { orderBy } from 'lodash';\nimport { mergeInstance, registerHotKeysHookToInstance, registerStateHookToInstance } from './utils.js';\n\nconst defaultDecorators = {\n instance: [],\n state: [],\n hotKeys: [],\n renderers: [],\n composeData: [],\n};\n\nfunction createDataInstanceRef({ uuid: uuidProp, data, renderers, plugins, customDecorators, ...props }) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const instance = useRef();\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const [uuid] = useState(uuidProp || (() => uuidv4()));\n\n instance.current = {\n uuid,\n state: {},\n actions: {},\n hotKeys: {}, // keyboard hotkeys to run specific actions\n originalData: data,\n records: [], // item abstraction with meta data for originalData\n renderers,\n ref(key) {\n // eslint-disable-next-line no-return-assign\n return (node) => (instance.current.refs[key] = node);\n },\n getInstance() {\n return instance.current;\n },\n props,\n };\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const decorators = useMemo(() => {\n let nextDecorators = { ...defaultDecorators, ...customDecorators };\n\n plugins.forEach((plugin) => {\n if (!plugin) return;\n nextDecorators = plugin(nextDecorators);\n });\n\n Object.keys(nextDecorators).forEach((key) => {\n if (Array.isArray(nextDecorators[key])) nextDecorators[key] = orderBy(nextDecorators[key], (item) => item.order);\n });\n\n return nextDecorators;\n }, []); // the plugins are defined on creation, but not changed at runtime\n\n // todo: test if getting the hooks without registering them\n // here would be beneficial to memoize instance and squeeze performance\n instance.current = decorators.instance.reduce(mergeInstance, instance.current);\n instance.current = decorators.state.reduce(registerStateHookToInstance, instance.current);\n instance.current = decorators.hotKeys.reduce(registerHotKeysHookToInstance, instance.current);\n instance.current.renderers = decorators.renderers.reduce(\n (result, decorator) => decorator(result, instance.current),\n renderers,\n );\n\n return { instance, decorators };\n}\n\nexport { createDataInstanceRef };\nexport default createDataInstanceRef;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,MAAM,cAAc;AAC7B,SAAS,SAAS,QAAQ,gBAAgB;AAC1C,SAAS,eAAe;AACxB,SAAS,eAAe,+BAA+B,mCAAmC;AAE1F,MAAM,oBAAoB;AAAA,EACxB,UAAU,CAAC;AAAA,EACX,OAAO,CAAC;AAAA,EACR,SAAS,CAAC;AAAA,EACV,WAAW,CAAC;AAAA,EACZ,aAAa,CAAC;AAChB;AAEA,SAAS,sBAAsB,EAAE,MAAM,UAAU,MAAM,WAAW,SAAS,kBAAkB,GAAG,MAAM,GAAG;AAEvG,QAAM,WAAW,OAAO;AAExB,QAAM,CAAC,IAAI,IAAI,SAAS,aAAa,MAAM,OAAO,EAAE;AAEpD,WAAS,UAAU;AAAA,IACjB;AAAA,IACA,OAAO,CAAC;AAAA,IACR,SAAS,CAAC;AAAA,IACV,SAAS,CAAC;AAAA;AAAA,IACV,cAAc;AAAA,IACd,SAAS,CAAC;AAAA;AAAA,IACV;AAAA,IACA,IAAI,KAAK;AAEP,aAAO,CAAC,SAAU,SAAS,QAAQ,KAAK,GAAG,IAAI;AAAA,IACjD;AAAA,IACA,cAAc;AACZ,aAAO,SAAS;AAAA,IAClB;AAAA,IACA;AAAA,EACF;AAGA,QAAM,aAAa,QAAQ,MAAM;AAC/B,QAAI,iBAAiB,EAAE,GAAG,mBAAmB,GAAG,iBAAiB;AAEjE,YAAQ,QAAQ,CAAC,WAAW;AAC1B,UAAI,CAAC;AAAQ;AACb,uBAAiB,OAAO,cAAc;AAAA,IACxC,CAAC;AAED,WAAO,KAAK,cAAc,EAAE,QAAQ,CAAC,QAAQ;AAC3C,UAAI,MAAM,QAAQ,eAAe,GAAG,CAAC;AAAG,uBAAe,GAAG,IAAI,QAAQ,eAAe,GAAG,GAAG,CAAC,SAAS,KAAK,KAAK;AAAA,IACjH,CAAC;AAED,WAAO;AAAA,EACT,GAAG,CAAC,CAAC;AAIL,WAAS,UAAU,WAAW,SAAS,OAAO,eAAe,SAAS,OAAO;AAC7E,WAAS,UAAU,WAAW,MAAM,OAAO,6BAA6B,SAAS,OAAO;AACxF,WAAS,UAAU,WAAW,QAAQ,OAAO,+BAA+B,SAAS,OAAO;AAC5F,WAAS,QAAQ,YAAY,WAAW,UAAU;AAAA,IAChD,CAAC,QAAQ,cAAc,UAAU,QAAQ,SAAS,OAAO;AAAA,IACzD;AAAA,EACF;AAEA,SAAO,EAAE,UAAU,WAAW;AAChC;AAGA,IAAO,4BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
export * from "./createInstancePlugin";
|
|
3
|
-
export * from "./createInstanceRef";
|
|
4
|
-
export * from "./utils";
|
|
2
|
+
export * from "./createInstancePlugin.js";
|
|
3
|
+
export * from "./createInstanceRef.js";
|
|
4
|
+
export * from "./utils.js";
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/createDataInstance/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './createInstancePlugin';\nexport * from './createInstanceRef';\nexport * from './utils';\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './createInstancePlugin.js';\nexport * from './createInstanceRef.js';\nexport * from './utils.js';\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -14,30 +14,15 @@ function evaluateTransforms(transforms, value, extraParams = {}, props = {}, gri
|
|
|
14
14
|
return nextProps;
|
|
15
15
|
}
|
|
16
16
|
function evaluateFormatters(formatters, value, extraParams = {}, grid) {
|
|
17
|
-
return formatters.reduce(
|
|
18
|
-
(result, formatter) => formatter(result, extraParams, grid),
|
|
19
|
-
value
|
|
20
|
-
);
|
|
17
|
+
return formatters.reduce((result, formatter) => formatter(result, extraParams, grid), value);
|
|
21
18
|
}
|
|
22
19
|
function composeFormatters(formatters, instance, getItemValue = (record) => record.data.name) {
|
|
23
|
-
return (props) => formatters.reduce(
|
|
24
|
-
(result, formatter) => formatter(result, props, instance),
|
|
25
|
-
getItemValue(props.record)
|
|
26
|
-
);
|
|
20
|
+
return (props) => formatters.reduce((result, formatter) => formatter(result, props, instance), getItemValue(props.record));
|
|
27
21
|
}
|
|
28
|
-
const applyDecorators = (subject, decorators = [], ...args) => decorators.reduce(
|
|
29
|
-
(nextSubject, decorator) => decorator(nextSubject, ...args),
|
|
30
|
-
subject
|
|
31
|
-
);
|
|
22
|
+
const applyDecorators = (subject, decorators = [], ...args) => decorators.reduce((nextSubject, decorator) => decorator(nextSubject, ...args), subject);
|
|
32
23
|
const decorateColumns = (columns, decorators, grid) => {
|
|
33
|
-
const nextColumns = applyDecorators(
|
|
34
|
-
|
|
35
|
-
decorators.decorateColumns,
|
|
36
|
-
grid
|
|
37
|
-
);
|
|
38
|
-
return nextColumns.map(
|
|
39
|
-
(column, index) => applyDecorators(column, decorators.decorateColumn, grid, index)
|
|
40
|
-
);
|
|
24
|
+
const nextColumns = applyDecorators(columns, decorators.decorateColumns, grid);
|
|
25
|
+
return nextColumns.map((column, index) => applyDecorators(column, decorators.decorateColumn, grid, index));
|
|
41
26
|
};
|
|
42
27
|
const mergeInstance = (instance, instanceHook) => ({
|
|
43
28
|
...instance,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/createDataInstance/utils.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const reducePropsGetter
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const reducePropsGetter =\n (decorators = [], grid) =>\n (props = {}, extraParams) => {\n let nextProps = props;\n decorators.forEach((decorator) => {\n nextProps = decorator(nextProps, grid, extraParams);\n });\n return nextProps;\n };\n\n/* eslint-disable-next-line max-params */\nexport function evaluateTransforms(transforms, value, extraParams = {}, props = {}, grid) {\n let nextProps = props;\n transforms.forEach((transform) => {\n nextProps = transform(value, extraParams, nextProps, grid);\n });\n return nextProps;\n}\n\n/* eslint-disable-next-line max-params */\nexport function evaluateFormatters(formatters, value, extraParams = {}, grid) {\n return formatters.reduce((result, formatter) => formatter(result, extraParams, grid), value);\n}\n\nexport function composeFormatters(formatters, instance, getItemValue = (record) => record.data.name) {\n // todo: make the formatters subscribe to the item props instead of getting the whole instance\n // todo: addd should formatter update to memoize specific ones\n return (props) =>\n formatters.reduce((result, formatter) => formatter(result, props, instance), getItemValue(props.record));\n}\n\nexport const applyDecorators = (subject, decorators = [], ...args) =>\n decorators.reduce((nextSubject, decorator) => decorator(nextSubject, ...args), subject);\n\nexport const decorateColumns = (columns, decorators, grid) => {\n const nextColumns = applyDecorators(columns, decorators.decorateColumns, grid);\n return nextColumns.map((column, index) => applyDecorators(column, decorators.decorateColumn, grid, index));\n};\n\nexport const mergeInstance = (instance, instanceHook) => ({\n ...instance,\n ...instanceHook(instance),\n});\n\nexport const registerStateHookToInstance = (instance, stateHook) => {\n const { state, actions } = stateHook(instance);\n return {\n ...instance,\n state: {\n ...instance.state,\n ...state,\n },\n actions: {\n ...instance.actions,\n ...actions,\n },\n };\n};\n\nconst reduceHotKey = (instance, { key, handler, options, allowDocumentHandler }) => ({\n ...instance,\n hotKeys: {\n ...instance.hotKeys,\n [key]: { handler, options, allowDocumentHandler },\n },\n});\n\nexport const registerHotKeysHookToInstance = (instance, hotKeysHook) => {\n const hotKeys = hotKeysHook(instance);\n if (Array.isArray(hotKeys)) {\n return hotKeys.reduce(reduceHotKey, instance);\n }\n return reduceHotKey(instance, hotKeys);\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,oBACX,CAAC,aAAa,CAAC,GAAG,SAChB,CAAC,QAAQ,CAAC,GAAG,gBAAgB;AAC3B,MAAI,YAAY;AAChB,aAAW,QAAQ,CAAC,cAAc;AAChC,gBAAY,UAAU,WAAW,MAAM,WAAW;AAAA,EACpD,CAAC;AACD,SAAO;AACT;AAGG,SAAS,mBAAmB,YAAY,OAAO,cAAc,CAAC,GAAG,QAAQ,CAAC,GAAG,MAAM;AACxF,MAAI,YAAY;AAChB,aAAW,QAAQ,CAAC,cAAc;AAChC,gBAAY,UAAU,OAAO,aAAa,WAAW,IAAI;AAAA,EAC3D,CAAC;AACD,SAAO;AACT;AAGO,SAAS,mBAAmB,YAAY,OAAO,cAAc,CAAC,GAAG,MAAM;AAC5E,SAAO,WAAW,OAAO,CAAC,QAAQ,cAAc,UAAU,QAAQ,aAAa,IAAI,GAAG,KAAK;AAC7F;AAEO,SAAS,kBAAkB,YAAY,UAAU,eAAe,CAAC,WAAW,OAAO,KAAK,MAAM;AAGnG,SAAO,CAAC,UACN,WAAW,OAAO,CAAC,QAAQ,cAAc,UAAU,QAAQ,OAAO,QAAQ,GAAG,aAAa,MAAM,MAAM,CAAC;AAC3G;AAEO,MAAM,kBAAkB,CAAC,SAAS,aAAa,CAAC,MAAM,SAC3D,WAAW,OAAO,CAAC,aAAa,cAAc,UAAU,aAAa,GAAG,IAAI,GAAG,OAAO;AAEjF,MAAM,kBAAkB,CAAC,SAAS,YAAY,SAAS;AAC5D,QAAM,cAAc,gBAAgB,SAAS,WAAW,iBAAiB,IAAI;AAC7E,SAAO,YAAY,IAAI,CAAC,QAAQ,UAAU,gBAAgB,QAAQ,WAAW,gBAAgB,MAAM,KAAK,CAAC;AAC3G;AAEO,MAAM,gBAAgB,CAAC,UAAU,kBAAkB;AAAA,EACxD,GAAG;AAAA,EACH,GAAG,aAAa,QAAQ;AAC1B;AAEO,MAAM,8BAA8B,CAAC,UAAU,cAAc;AAClE,QAAM,EAAE,OAAO,QAAQ,IAAI,UAAU,QAAQ;AAC7C,SAAO;AAAA,IACL,GAAG;AAAA,IACH,OAAO;AAAA,MACL,GAAG,SAAS;AAAA,MACZ,GAAG;AAAA,IACL;AAAA,IACA,SAAS;AAAA,MACP,GAAG,SAAS;AAAA,MACZ,GAAG;AAAA,IACL;AAAA,EACF;AACF;AAEA,MAAM,eAAe,CAAC,UAAU,EAAE,KAAK,SAAS,SAAS,qBAAqB,OAAO;AAAA,EACnF,GAAG;AAAA,EACH,SAAS;AAAA,IACP,GAAG,SAAS;AAAA,IACZ,CAAC,GAAG,GAAG,EAAE,SAAS,SAAS,qBAAqB;AAAA,EAClD;AACF;AAEO,MAAM,gCAAgC,CAAC,UAAU,gBAAgB;AACtE,QAAM,UAAU,YAAY,QAAQ;AACpC,MAAI,MAAM,QAAQ,OAAO,GAAG;AAC1B,WAAO,QAAQ,OAAO,cAAc,QAAQ;AAAA,EAC9C;AACA,SAAO,aAAa,UAAU,OAAO;AACvC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/defer-render-hoc/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { PureComponent } from 'react';\nimport raf from 'raf';\nimport hoistNonReactStatic from 'hoist-non-react-statics';\n\n/**\n * Allows two animation frames to complete to allow other components to update\n * and re-render before mounting and rendering an expensive `WrappedComponent`.\n *\n * @param WrappedComponent\n * @param fallback\n */\nexport const deferComponentRender = (WrappedComponent, fallback) => {\n class DeferredRenderWrapper extends PureComponent {\n state = { shouldRender: false };\n\n componentDidMount() {\n raf(() => raf(() => this.setState({ shouldRender: true })));\n }\n\n render() {\n // eslint-disable-next-line react/destructuring-assignment\n return this.state.shouldRender ?
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { PureComponent } from 'react';\nimport raf from 'raf';\nimport hoistNonReactStatic from 'hoist-non-react-statics';\n\n/**\n * Allows two animation frames to complete to allow other components to update\n * and re-render before mounting and rendering an expensive `WrappedComponent`.\n *\n * @param WrappedComponent\n * @param fallback\n */\nexport const deferComponentRender = (WrappedComponent, fallback) => {\n class DeferredRenderWrapper extends PureComponent {\n state = { shouldRender: false };\n\n componentDidMount() {\n raf(() => raf(() => this.setState({ shouldRender: true })));\n }\n\n render() {\n // eslint-disable-next-line react/destructuring-assignment\n return this.state.shouldRender ? <WrappedComponent {...this.props} /> : fallback;\n }\n }\n\n return hoistNonReactStatic(DeferredRenderWrapper, WrappedComponent);\n};\n\nexport default deferComponentRender;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACqBgB;AArBvC,SAAgB,qBAAqB;AACrC,OAAO,SAAS;AAChB,OAAO,yBAAyB;AASzB,MAAM,uBAAuB,CAAC,kBAAkB,aAAa;AAClE,QAAM,8BAA8B,cAAc;AAAA,IAAlD;AAAA;AACE,mBAAQ,EAAE,cAAc,MAAM;AAAA;AAAA,IAE9B,oBAAoB;AAClB,UAAI,MAAM,IAAI,MAAM,KAAK,SAAS,EAAE,cAAc,KAAK,CAAC,CAAC,CAAC;AAAA,IAC5D;AAAA,IAEA,SAAS;AAEP,aAAO,KAAK,MAAM,eAAe,oBAAC,oBAAkB,GAAG,KAAK,OAAO,IAAK;AAAA,IAC1E;AAAA,EACF;AAEA,SAAO,oBAAoB,uBAAuB,gBAAgB;AACpE;AAEA,IAAO,2BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
export * from "./Animations";
|
|
3
|
-
export * from "./createDataInstance";
|
|
4
|
-
export * from "./defer-render-hoc";
|
|
5
|
-
export * from "./FocusGroup";
|
|
6
|
-
export * from "./GroupContext";
|
|
7
|
-
export * from "./ScrollSync";
|
|
8
|
-
export * from "./toolbar/ToolbarProvider";
|
|
9
|
-
export * from "./useDataGrid";
|
|
10
|
-
export * from "./useDataList";
|
|
11
|
-
export * from "./virtualization";
|
|
12
|
-
export * from "./CheckableGroup";
|
|
13
|
-
export * from "./constants";
|
|
14
|
-
export * from "./DeferRenderAfterComputation";
|
|
15
|
-
export * from "./dimsum.config";
|
|
16
|
-
export * from "./prop-types";
|
|
17
|
-
export * from "./utils";
|
|
2
|
+
export * from "./Animations/index.js";
|
|
3
|
+
export * from "./createDataInstance/index.js";
|
|
4
|
+
export * from "./defer-render-hoc/index.js";
|
|
5
|
+
export * from "./FocusGroup/index.js";
|
|
6
|
+
export * from "./GroupContext/index.js";
|
|
7
|
+
export * from "./ScrollSync/index.js";
|
|
8
|
+
export * from "./toolbar/ToolbarProvider.js";
|
|
9
|
+
export * from "./useDataGrid/index.js";
|
|
10
|
+
export * from "./useDataList/index.js";
|
|
11
|
+
export * from "./virtualization/index.js";
|
|
12
|
+
export * from "./CheckableGroup.js";
|
|
13
|
+
export * from "./constants.js";
|
|
14
|
+
export * from "./DeferRenderAfterComputation.js";
|
|
15
|
+
export * from "./dimsum.config.js";
|
|
16
|
+
export * from "./prop-types.js";
|
|
17
|
+
export * from "./utils.js";
|
|
18
18
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './Animations';\nexport * from './createDataInstance';\nexport * from './defer-render-hoc';\nexport * from './FocusGroup';\nexport * from './GroupContext';\nexport * from './ScrollSync';\nexport * from './toolbar/ToolbarProvider';\nexport * from './useDataGrid';\nexport * from './useDataList';\nexport * from './virtualization';\n\nexport * from './CheckableGroup';\nexport * from './constants';\nexport * from './DeferRenderAfterComputation';\nexport * from './dimsum.config';\nexport * from './prop-types';\nexport * from './utils';\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './Animations/index.js';\nexport * from './createDataInstance/index.js';\nexport * from './defer-render-hoc/index.js';\nexport * from './FocusGroup/index.js';\nexport * from './GroupContext/index.js';\nexport * from './ScrollSync/index.js';\nexport * from './toolbar/ToolbarProvider.js';\nexport * from './useDataGrid/index.js';\nexport * from './useDataList/index.js';\nexport * from './virtualization/index.js';\n\nexport * from './CheckableGroup.js';\nexport * from './constants.js';\nexport * from './DeferRenderAfterComputation.js';\nexport * from './dimsum.config.js';\nexport * from './prop-types.js';\nexport * from './utils.js';\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/useDataGrid/VolatileRowsListener.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { safeCall } from '@elliemae/ds-utilities';\n\nclass VolatileRowsListener {\n observers = [];\n\n observe(listener) {\n this.observers.push(listener);\n }\n\n notify(nextRows) {\n this.observers.forEach(observer => safeCall(observer, nextRows));\n this.observers = [];\n }\n}\n\nexport { VolatileRowsListener };\nexport default VolatileRowsListener;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,gBAAgB;AAEzB,MAAM,qBAAqB;AAAA,EAA3B;AACE,qBAAY,CAAC;AAAA;AAAA,EAEb,QAAQ,UAAU;AAChB,SAAK,UAAU,KAAK,QAAQ;AAAA,EAC9B;AAAA,EAEA,OAAO,UAAU;AACf,SAAK,UAAU,QAAQ,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { safeCall } from '@elliemae/ds-utilities';\n\nclass VolatileRowsListener {\n observers = [];\n\n observe(listener) {\n this.observers.push(listener);\n }\n\n notify(nextRows) {\n this.observers.forEach((observer) => safeCall(observer, nextRows));\n this.observers = [];\n }\n}\n\nexport { VolatileRowsListener };\nexport default VolatileRowsListener;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,gBAAgB;AAEzB,MAAM,qBAAqB;AAAA,EAA3B;AACE,qBAAY,CAAC;AAAA;AAAA,EAEb,QAAQ,UAAU;AAChB,SAAK,UAAU,KAAK,QAAQ;AAAA,EAC9B;AAAA,EAEA,OAAO,UAAU;AACf,SAAK,UAAU,QAAQ,CAAC,aAAa,SAAS,UAAU,QAAQ,CAAC;AACjE,SAAK,YAAY,CAAC;AAAA,EACpB;AACF;AAGA,IAAO,+BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
export * from "./initColumnDefinition";
|
|
3
|
-
export * from "./VolatileRowsListener";
|
|
4
|
-
export * from "./useDataGrid";
|
|
2
|
+
export * from "./initColumnDefinition.js";
|
|
3
|
+
export * from "./VolatileRowsListener.js";
|
|
4
|
+
export * from "./useDataGrid.js";
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/useDataGrid/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './initColumnDefinition';\nexport * from './VolatileRowsListener';\nexport * from './useDataGrid';\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './initColumnDefinition.js';\nexport * from './VolatileRowsListener.js';\nexport * from './useDataGrid.js';\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -45,8 +45,9 @@ const mergeClassNameToColumnHeader = curry((className, column) => {
|
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
});
|
|
48
|
-
const initColumnDefinition = (options = {}) =>
|
|
49
|
-
|
|
48
|
+
const initColumnDefinition = (options = {}) => (
|
|
49
|
+
// eslint-disable-next-line complexity
|
|
50
|
+
(column) => {
|
|
50
51
|
if (column.type === "number") {
|
|
51
52
|
column.cellStyle = {
|
|
52
53
|
textAlign: "right"
|
|
@@ -106,8 +107,8 @@ const initColumnDefinition = (options = {}) => {
|
|
|
106
107
|
column.isUserColumn = column.isUserColumn || isUserColumn;
|
|
107
108
|
column.headerHookEffects = [];
|
|
108
109
|
return column;
|
|
109
|
-
}
|
|
110
|
-
|
|
110
|
+
}
|
|
111
|
+
);
|
|
111
112
|
var initColumnDefinition_default = initColumnDefinition;
|
|
112
113
|
export {
|
|
113
114
|
appendCellFormatter,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/useDataGrid/initColumnDefinition.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable react/display-name */\nimport React from 'react';\nimport { v4 as uuidv4 } from 'uuid';\nimport { get, curry, set, cloneDeep, isFunction } from '@elliemae/ds-utilities';\n\n// TODO: use lenses to access nested fields\n\nexport const appendHeaderFormatter = curry((formatter, column) => ({\n ...column,\n header: {\n ...column.header,\n formatters: [...get(column, 'header.formatters', []), formatter],\n },\n}));\n\nexport const appendCellFormatter = curry((formatter, column, path = 'formatters') => {\n const nextColumn = cloneDeep(column);\n const formatters = get(nextColumn, ['cell', path], []);\n const scrollingFormatters = get(nextColumn, 'cell.scrollingFormatters', []);\n if (Array.isArray(formatter)) {\n if (formatter[1]) scrollingFormatters.push(formatter[1]);\n formatters.push(formatter[0]);\n } else {\n formatters.push(formatter);\n scrollingFormatters.push(formatter);\n }\n set(nextColumn, ['cell', path], formatters);\n set(nextColumn, 'cell.scrollingFormatters', scrollingFormatters);\n return nextColumn;\n});\n\nconst defaultColumnDefinitionOptions = {\n normalize: false,\n useTextTruncation: true,\n isUserColumn: true,\n visible: true,\n};\n\nexport const mergeClassNameToColumnHeader = curry((className, column) => {\n const headerProps = get(column, ['header', 'props'], {});\n const headerClassName = headerProps.className || '';\n return {\n ...column,\n header: {\n ...column.header,\n props: {\n ...headerProps,\n className: `${headerClassName} ${className}`,\n },\n },\n };\n});\n\nexport const initColumnDefinition
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable react/display-name */\nimport React from 'react';\nimport { v4 as uuidv4 } from 'uuid';\nimport { get, curry, set, cloneDeep, isFunction } from '@elliemae/ds-utilities';\n\n// TODO: use lenses to access nested fields\n\nexport const appendHeaderFormatter = curry((formatter, column) => ({\n ...column,\n header: {\n ...column.header,\n formatters: [...get(column, 'header.formatters', []), formatter],\n },\n}));\n\nexport const appendCellFormatter = curry((formatter, column, path = 'formatters') => {\n const nextColumn = cloneDeep(column);\n const formatters = get(nextColumn, ['cell', path], []);\n const scrollingFormatters = get(nextColumn, 'cell.scrollingFormatters', []);\n if (Array.isArray(formatter)) {\n if (formatter[1]) scrollingFormatters.push(formatter[1]);\n formatters.push(formatter[0]);\n } else {\n formatters.push(formatter);\n scrollingFormatters.push(formatter);\n }\n set(nextColumn, ['cell', path], formatters);\n set(nextColumn, 'cell.scrollingFormatters', scrollingFormatters);\n return nextColumn;\n});\n\nconst defaultColumnDefinitionOptions = {\n normalize: false,\n useTextTruncation: true,\n isUserColumn: true,\n visible: true,\n};\n\nexport const mergeClassNameToColumnHeader = curry((className, column) => {\n const headerProps = get(column, ['header', 'props'], {});\n const headerClassName = headerProps.className || '';\n return {\n ...column,\n header: {\n ...column.header,\n props: {\n ...headerProps,\n className: `${headerClassName} ${className}`,\n },\n },\n };\n});\n\nexport const initColumnDefinition =\n (options = {}) =>\n // eslint-disable-next-line complexity\n (column) => {\n // todo: clean this\n if (column.type === 'number') {\n // eslint-disable-next-line no-param-reassign\n column.cellStyle = {\n textAlign: 'right',\n };\n }\n const {\n useTextTruncation = true,\n isUserColumn,\n visible,\n normalize,\n } = {\n ...defaultColumnDefinitionOptions,\n ...options,\n };\n\n if (normalize) {\n // eslint-disable-next-line no-param-reassign\n column.originalProperty = column.property;\n // eslint-disable-next-line no-param-reassign\n column.property = column.property.replace(/\\s+/g, '');\n }\n\n // eslint-disable-next-line no-param-reassign\n column.props = {\n ...column.props,\n style: {},\n };\n // eslint-disable-next-line no-param-reassign\n column.header = {\n ...column.header,\n label: column.label,\n formatters: [...get(column, ['header', 'formatters'], [])],\n props: {\n style: column.headerStyle || {},\n },\n };\n if (useTextTruncation && !(isFunction(column.customHeaderRenderer) || column.header.formatters.length)) {\n column.header.formatters.push((value) => <span className=\"cell-value\">{value}</span>);\n }\n\n // eslint-disable-next-line no-param-reassign\n column.cell = {\n ...column.cell,\n transforms: [],\n formatters: [...get(column, ['cell', 'formatters'], [])],\n scrollingFormatters: [...get(column, ['cell', 'formatters'], [])],\n props: {\n style: column.cellStyle || {},\n },\n };\n\n if (useTextTruncation && !(isFunction(column.customRenderer) || column.cell.formatters.length)) {\n column.cell.formatters.push((value) => (\n <span\n className=\"cell-value\"\n style={{\n justifyContent: column.type === 'number' ? 'flex-end' : 'flex-start',\n }}\n >\n {value}\n </span>\n ));\n }\n // eslint-disable-next-line no-param-reassign\n column.uuid = column.uuid || uuidv4();\n // eslint-disable-next-line no-param-reassign\n column.visible = column.visible === undefined ? visible : column.visible;\n // eslint-disable-next-line no-param-reassign, max-lines\n column.isUserColumn = column.isUserColumn || isUserColumn;\n // eslint-disable-next-line no-param-reassign\n column.headerHookEffects = [];\n return column;\n };\n\nexport default initColumnDefinition;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACiGwB;AA9F/C,SAAS,MAAM,cAAc;AAC7B,SAAS,KAAK,OAAO,KAAK,WAAW,kBAAkB;AAIhD,MAAM,wBAAwB,MAAM,CAAC,WAAW,YAAY;AAAA,EACjE,GAAG;AAAA,EACH,QAAQ;AAAA,IACN,GAAG,OAAO;AAAA,IACV,YAAY,CAAC,GAAG,IAAI,QAAQ,qBAAqB,CAAC,CAAC,GAAG,SAAS;AAAA,EACjE;AACF,EAAE;AAEK,MAAM,sBAAsB,MAAM,CAAC,WAAW,QAAQ,OAAO,iBAAiB;AACnF,QAAM,aAAa,UAAU,MAAM;AACnC,QAAM,aAAa,IAAI,YAAY,CAAC,QAAQ,IAAI,GAAG,CAAC,CAAC;AACrD,QAAM,sBAAsB,IAAI,YAAY,4BAA4B,CAAC,CAAC;AAC1E,MAAI,MAAM,QAAQ,SAAS,GAAG;AAC5B,QAAI,UAAU,CAAC;AAAG,0BAAoB,KAAK,UAAU,CAAC,CAAC;AACvD,eAAW,KAAK,UAAU,CAAC,CAAC;AAAA,EAC9B,OAAO;A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OAAO,OAAO,eAAe,CAAC;AAAA,MAChC;AAAA,IACF;AACA,QAAI,qBAAqB,EAAE,WAAW,OAAO,oBAAoB,KAAK,OAAO,OAAO,WAAW,SAAS;AACtG,aAAO,OAAO,WAAW,KAAK,CAAC,UAAU,oBAAC,UAAK,WAAU,cAAc,iBAAM,CAAO;AAAA,IACtF;AAGA,WAAO,OAAO;AAAA,MACZ,GAAG,OAAO;AAAA,MACV,YAAY,CAAC;AAAA,MACb,YAAY,CAAC,GAAG,IAAI,QAAQ,CAAC,QAAQ,YAAY,GAAG,CAAC,CAAC,CAAC;AAAA,MACvD,qBAAqB,CAAC,GAAG,IAAI,QAAQ,CAAC,QAAQ,YAAY,GAAG,CAAC,CAAC,CAAC;AAAA,MAChE,OAAO;AAAA,QACL,OAAO,OAAO,aAAa,CAAC;AAAA,MAC9B;AAAA,IACF;AAEA,QAAI,qBAAqB,EAAE,WAAW,OAAO,cAAc,KAAK,OAAO,KAAK,WAAW,SAAS;AAC9F,aAAO,KAAK,WAAW,KAAK,CAAC,UAC3B;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,OAAO;AAAA,YACL,gBAAgB,OAAO,SAAS,WAAW,aAAa;AAAA,UAC1D;AAAA,UAEC;AAAA;AAAA,MACH,CACD;AAAA,IACH;AAEA,WAAO,OAAO,OAAO,QAAQ,OAAO;AAEpC,WAAO,UAAU,OAAO,YAAY,SAAY,UAAU,OAAO;AAEjE,WAAO,eAAe,OAAO,gBAAgB;AAE7C,WAAO,oBAAoB,CAAC;AAC5B,WAAO;AAAA,EACT;AAAA;AAEF,IAAO,+BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -11,10 +11,10 @@ import {
|
|
|
11
11
|
import { useMemo, useRef, useState } from "react";
|
|
12
12
|
import { v4 as uuidv4 } from "uuid";
|
|
13
13
|
import * as resolve from "table-resolver";
|
|
14
|
-
import { initColumnDefinition } from "./initColumnDefinition";
|
|
15
|
-
import { applyDecorators, decorateColumns, reducePropsGetter } from "../createDataInstance/utils";
|
|
16
|
-
import { VolatileRowsListener } from "./VolatileRowsListener";
|
|
17
|
-
import { isInternetExplorer } from "../utils";
|
|
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
18
|
const IS_INTERNET_EXPLORER = isInternetExplorer();
|
|
19
19
|
const useDataGrid = ({ uuid: uuidProp, plugins: pluginsFromProps, rows, columns, renderers = {}, ...props }) => {
|
|
20
20
|
const plugins = pluginsFromProps;
|
|
@@ -62,7 +62,9 @@ const useDataGrid = ({ uuid: uuidProp, plugins: pluginsFromProps, rows, columns,
|
|
|
62
62
|
updateRows
|
|
63
63
|
},
|
|
64
64
|
updateRows,
|
|
65
|
+
// eslint-disable-next-line no-return-assign
|
|
65
66
|
enableEvents: () => document.body.style.pointerEvents = IS_INTERNET_EXPLORER ? "" : null,
|
|
67
|
+
// eslint-disable-next-line no-return-assign
|
|
66
68
|
disableEvents: () => document.body.style.pointerEvents = "none",
|
|
67
69
|
observeRows: (observer) => RowsObserver.observe(observer),
|
|
68
70
|
hotKeys: {},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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';\nimport { applyDecorators, decorateColumns, reducePropsGetter } from '../createDataInstance/utils';\nimport { VolatileRowsListener } from './VolatileRowsListener';\nimport { isInternetExplorer } from '../utils';\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;AACrC,SAAS,iBAAiB,iBAAiB,yBAAyB;AACpE,SAAS,4BAA4B;AACrC,SAAS,0BAA0B;AAEnC,MAAM,uBAAuB,mBAAmB;AAKzC,MAAM,cAAc,CAAC,EAAE,MAAM,UAAU,SAAS,kBAAkB,MAAM,SAAS,YAAY,CAAC,
|
|
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;AACrC,SAAS,iBAAiB,iBAAiB,yBAAyB;AACpE,SAAS,4BAA4B;AACrC,SAAS,0BAA0B;AAEnC,MAAM,uBAAuB,mBAAmB;AAKzC,MAAM,cAAc,CAAC,EAAE,MAAM,UAAU,SAAS,kBAAkB,MAAM,SAAS,YAAY,CAAC,GAAG,GAAG,MAAM,MAAM;AACrH,QAAM,UAAU;AAChB,QAAM,WAAW,OAAO;AACxB,QAAM,WAAW,OAAO;A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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
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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';\nexport * from './recordIterator';\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './useDataList.js';\nexport * from './recordIterator.js';\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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(
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,MAAM,kBAAkB,MAAM;AAC5B,QAAM,MAAM,oDAAoD;AAClE;AAEO,SAAS,
|
|
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
6
|
"names": []
|
|
7
7
|
}
|