@elliemae/ds-shared 3.5.0-rc.2 → 3.5.0-rc.5
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 +4 -1
- package/dist/cjs/Animations/BaseAnimation.js.map +2 -2
- package/dist/cjs/Animations/Grow.js +4 -1
- package/dist/cjs/Animations/Grow.js.map +2 -2
- package/dist/cjs/Animations/GrowRight.js +4 -1
- package/dist/cjs/Animations/GrowRight.js.map +2 -2
- package/dist/cjs/Animations/GrowVertical.js +4 -1
- package/dist/cjs/Animations/GrowVertical.js.map +2 -2
- package/dist/cjs/Animations/index.js +4 -1
- package/dist/cjs/Animations/index.js.map +1 -1
- package/dist/cjs/CheckableGroup.js +4 -1
- package/dist/cjs/CheckableGroup.js.map +2 -2
- package/dist/cjs/DeferRenderAfterComputation.js +11 -4
- package/dist/cjs/DeferRenderAfterComputation.js.map +2 -2
- package/dist/cjs/FocusGroup/FocusGrid.js +10 -4
- package/dist/cjs/FocusGroup/FocusGrid.js.map +2 -2
- package/dist/cjs/FocusGroup/FocusGroup.js +10 -3
- package/dist/cjs/FocusGroup/FocusGroup.js.map +2 -2
- package/dist/cjs/FocusGroup/FocusGroupContext.js +4 -1
- package/dist/cjs/FocusGroup/FocusGroupContext.js.map +2 -2
- package/dist/cjs/FocusGroup/FocusGroupManager.js +4 -1
- package/dist/cjs/FocusGroup/FocusGroupManager.js.map +2 -2
- package/dist/cjs/FocusGroup/focusGroupManagerHoc.js +4 -1
- package/dist/cjs/FocusGroup/focusGroupManagerHoc.js.map +2 -2
- package/dist/cjs/FocusGroup/index.js +4 -1
- package/dist/cjs/FocusGroup/index.js.map +1 -1
- package/dist/cjs/FocusGroup/useFocusGroupItem.js +4 -1
- package/dist/cjs/FocusGroup/useFocusGroupItem.js.map +1 -1
- package/dist/cjs/FocusGroup/utils/getNextCellPosition.js +4 -1
- package/dist/cjs/FocusGroup/utils/getNextCellPosition.js.map +1 -1
- package/dist/cjs/GroupContext/Group.js +4 -1
- package/dist/cjs/GroupContext/Group.js.map +2 -2
- package/dist/cjs/GroupContext/GroupContext.js +4 -1
- package/dist/cjs/GroupContext/GroupContext.js.map +2 -2
- package/dist/cjs/GroupContext/GroupItem.js +4 -1
- package/dist/cjs/GroupContext/GroupItem.js.map +2 -2
- package/dist/cjs/GroupContext/index.js +4 -1
- package/dist/cjs/GroupContext/index.js.map +1 -1
- package/dist/cjs/ScrollSync/ScrollSync.js +4 -1
- package/dist/cjs/ScrollSync/ScrollSync.js.map +2 -2
- package/dist/cjs/ScrollSync/ScrollSyncPane.js +7 -2
- package/dist/cjs/ScrollSync/ScrollSyncPane.js.map +2 -2
- package/dist/cjs/ScrollSync/ScrollSyncProvider.js +4 -1
- package/dist/cjs/ScrollSync/ScrollSyncProvider.js.map +2 -2
- package/dist/cjs/ScrollSync/index.js +4 -1
- package/dist/cjs/ScrollSync/index.js.map +1 -1
- package/dist/cjs/ScrollSync/useScrollSync.js +4 -1
- package/dist/cjs/ScrollSync/useScrollSync.js.map +1 -1
- package/dist/cjs/constants.js +4 -1
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/createDataInstance/createInstancePlugin.js +4 -1
- package/dist/cjs/createDataInstance/createInstancePlugin.js.map +1 -1
- package/dist/cjs/createDataInstance/createInstanceRef.js +24 -6
- package/dist/cjs/createDataInstance/createInstanceRef.js.map +2 -2
- package/dist/cjs/createDataInstance/index.js +4 -1
- package/dist/cjs/createDataInstance/index.js.map +1 -1
- package/dist/cjs/createDataInstance/utils.js +24 -6
- package/dist/cjs/createDataInstance/utils.js.map +1 -1
- package/dist/cjs/defer-render-hoc/index.js +4 -1
- package/dist/cjs/defer-render-hoc/index.js.map +2 -2
- package/dist/cjs/dimsum.config.js +4 -1
- package/dist/cjs/dimsum.config.js.map +1 -1
- package/dist/cjs/index.js +4 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/prop-types.js +4 -1
- package/dist/cjs/prop-types.js.map +1 -1
- package/dist/cjs/react-spring/index.js +4 -1
- package/dist/cjs/react-spring/index.js.map +1 -1
- package/dist/cjs/react-spring/renderprops.js +4 -1
- package/dist/cjs/react-spring/renderprops.js.map +1 -1
- package/dist/cjs/toolbar/ToolbarProvider.js +26 -14
- package/dist/cjs/toolbar/ToolbarProvider.js.map +2 -2
- package/dist/cjs/useDataGrid/VolatileRowsListener.js +4 -1
- package/dist/cjs/useDataGrid/VolatileRowsListener.js.map +1 -1
- package/dist/cjs/useDataGrid/index.js +4 -1
- package/dist/cjs/useDataGrid/index.js.map +1 -1
- package/dist/cjs/useDataGrid/initColumnDefinition.js +21 -16
- package/dist/cjs/useDataGrid/initColumnDefinition.js.map +2 -2
- package/dist/cjs/useDataGrid/useDataGrid.js +84 -40
- package/dist/cjs/useDataGrid/useDataGrid.js.map +2 -2
- package/dist/cjs/useDataList/index.js +4 -1
- package/dist/cjs/useDataList/index.js.map +1 -1
- package/dist/cjs/useDataList/recordIterator.js +4 -1
- package/dist/cjs/useDataList/recordIterator.js.map +1 -1
- package/dist/cjs/useDataList/useDataList.js +26 -6
- package/dist/cjs/useDataList/useDataList.js.map +2 -2
- package/dist/cjs/utils.js +7 -2
- package/dist/cjs/utils.js.map +1 -1
- package/dist/cjs/virtualization/AutoHeightList.js +34 -29
- package/dist/cjs/virtualization/AutoHeightList.js.map +2 -2
- package/dist/cjs/virtualization/FluidHeightList.js +13 -8
- package/dist/cjs/virtualization/FluidHeightList.js.map +2 -2
- package/dist/cjs/virtualization/index.js +4 -1
- package/dist/cjs/virtualization/index.js.map +1 -1
- package/dist/esm/Animations/BaseAnimation.js.map +2 -2
- package/dist/esm/Animations/Grow.js.map +2 -2
- package/dist/esm/Animations/GrowRight.js.map +2 -2
- package/dist/esm/Animations/GrowVertical.js.map +2 -2
- package/dist/esm/Animations/index.js.map +1 -1
- package/dist/esm/CheckableGroup.js.map +2 -2
- package/dist/esm/DeferRenderAfterComputation.js +7 -3
- package/dist/esm/DeferRenderAfterComputation.js.map +1 -1
- package/dist/esm/FocusGroup/FocusGrid.js +6 -3
- package/dist/esm/FocusGroup/FocusGrid.js.map +2 -2
- package/dist/esm/FocusGroup/FocusGroup.js +6 -2
- package/dist/esm/FocusGroup/FocusGroup.js.map +1 -1
- package/dist/esm/FocusGroup/FocusGroupContext.js.map +2 -2
- package/dist/esm/FocusGroup/FocusGroupManager.js.map +2 -2
- package/dist/esm/FocusGroup/focusGroupManagerHoc.js.map +2 -2
- package/dist/esm/FocusGroup/index.js.map +1 -1
- package/dist/esm/FocusGroup/useFocusGroupItem.js.map +1 -1
- package/dist/esm/FocusGroup/utils/getNextCellPosition.js.map +1 -1
- package/dist/esm/GroupContext/Group.js.map +2 -2
- package/dist/esm/GroupContext/GroupContext.js.map +2 -2
- package/dist/esm/GroupContext/GroupItem.js.map +2 -2
- package/dist/esm/GroupContext/index.js.map +1 -1
- package/dist/esm/ScrollSync/ScrollSync.js.map +2 -2
- package/dist/esm/ScrollSync/ScrollSyncPane.js +3 -1
- package/dist/esm/ScrollSync/ScrollSyncPane.js.map +2 -2
- package/dist/esm/ScrollSync/ScrollSyncProvider.js.map +2 -2
- package/dist/esm/ScrollSync/index.js.map +1 -1
- package/dist/esm/ScrollSync/useScrollSync.js.map +1 -1
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/createDataInstance/createInstancePlugin.js.map +1 -1
- package/dist/esm/createDataInstance/createInstanceRef.js +20 -5
- package/dist/esm/createDataInstance/createInstanceRef.js.map +1 -1
- package/dist/esm/createDataInstance/index.js.map +1 -1
- package/dist/esm/createDataInstance/utils.js +20 -5
- package/dist/esm/createDataInstance/utils.js.map +1 -1
- package/dist/esm/defer-render-hoc/index.js.map +2 -2
- package/dist/esm/dimsum.config.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/prop-types.js.map +1 -1
- package/dist/esm/react-spring/index.js.map +1 -1
- package/dist/esm/react-spring/renderprops.js.map +1 -1
- package/dist/esm/toolbar/ToolbarProvider.js +22 -13
- package/dist/esm/toolbar/ToolbarProvider.js.map +2 -2
- package/dist/esm/useDataGrid/VolatileRowsListener.js.map +1 -1
- package/dist/esm/useDataGrid/index.js.map +1 -1
- package/dist/esm/useDataGrid/initColumnDefinition.js +17 -15
- package/dist/esm/useDataGrid/initColumnDefinition.js.map +2 -2
- package/dist/esm/useDataGrid/useDataGrid.js +80 -39
- package/dist/esm/useDataGrid/useDataGrid.js.map +1 -1
- package/dist/esm/useDataList/index.js.map +1 -1
- package/dist/esm/useDataList/recordIterator.js.map +1 -1
- package/dist/esm/useDataList/useDataList.js +22 -5
- package/dist/esm/useDataList/useDataList.js.map +1 -1
- package/dist/esm/utils.js +3 -1
- package/dist/esm/utils.js.map +1 -1
- package/dist/esm/virtualization/AutoHeightList.js +30 -28
- package/dist/esm/virtualization/AutoHeightList.js.map +2 -2
- package/dist/esm/virtualization/FluidHeightList.js +9 -7
- package/dist/esm/virtualization/FluidHeightList.js.map +2 -2
- package/dist/esm/virtualization/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/ScrollSync/ScrollSyncProvider.tsx"],
|
|
4
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\nfunction 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>;\n}\n\nScrollSyncProvider.propTypes = {};\nScrollSyncProvider.defaultProps = {};\n\nexport default Scroll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
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/ScrollSync/index.tsx"],
|
|
4
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"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,kBAAkB;AAC3B,SAA8B,yBAAsB;AACpD,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/ScrollSync/useScrollSync.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst useScrollSync = (props) => {\n return {};\n}\n\nuseScrollSync.propTypes = {};\nuseScrollSync.defaultProps = {};\n\nexport { useScrollSync };\nexport default useScrollSync;\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACGvB,MAAM,gBAAgB,CAAC,UAAU;AAC/B,SAAO,CAAC;AACV;AAEA,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/constants.ts"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const DEFAULT_DELAY_OPEN = 200;\nexport const DEFAULT_DELAY_CLOSE = 300;\nexport const sizeOptions = ['small', 'medium', 'large', 'x-large'];\nexport const AM = 'am';\nexport const PM = 'pm';\nexport const ARROW_UP = 'ArrowUp';\nexport const ARROW_DOWN = 'ArrowDown';\nexport const BACKSPACE = 'Backspace';\nexport const ESCAPE = 'Escape';\nexport const HOME = 'Home';\nexport const SHIFT = 'Shift';\nexport const END = 'End';\nexport const HOUR_RANGE_12 = { min: 0, max: 12 };\nexport const HOUR_RANGE_24 = { min: 0, max: 24 };\nexport const GENERAL_TIME_RANGE = { min: 0, max: 59 };\nexport const PLACEHOLDER_TIME = {\n hour: 'hour',\n minutes: 'minutes',\n seconds: 'seconds',\n meridiem: 'meridiem',\n};\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,qBAAqB;AAC3B,MAAM,sBAAsB;AAC5B,MAAM,cAAc,CAAC,SAAS,UAAU,SAAS,SAAS;AAC1D,MAAM,KAAK;AACX,MAAM,KAAK;AACX,MAAM,WAAW;AACjB,MAAM,aAAa;AACnB,MAAM,YAAY;AAClB,MAAM,SAAS;AACf,MAAM,OAAO;AACb,MAAM,QAAQ;AACd,MAAM,MAAM;AACZ,MAAM,gBAAgB,EAAE,KAAK,GAAG,KAAK,GAAG;AACxC,MAAM,gBAAgB,EAAE,KAAK,GAAG,KAAK,GAAG;AACxC,MAAM,qBAAqB,EAAE,KAAK,GAAG,KAAK,GAAG;AAC7C,MAAM,mBAAmB;AAAA,EAC9B,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,UAAU;AACZ;",
|
|
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;
|
|
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,UAAU,GAAG;AACxC,qBAAe,aAAa,CAAC,GAAG,WAAW,YAAY,MAAM,UAAU;AAAA,IACzE,OAAO;AACL,qBAAe,aAAa,MAAM;AAAA,IACpC;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
|
}
|
|
@@ -49,14 +49,29 @@ function createDataInstanceRef({
|
|
|
49
49
|
});
|
|
50
50
|
Object.keys(nextDecorators).forEach((key) => {
|
|
51
51
|
if (Array.isArray(nextDecorators[key]))
|
|
52
|
-
nextDecorators[key] = orderBy(
|
|
52
|
+
nextDecorators[key] = orderBy(
|
|
53
|
+
nextDecorators[key],
|
|
54
|
+
(item) => item.order
|
|
55
|
+
);
|
|
53
56
|
});
|
|
54
57
|
return nextDecorators;
|
|
55
58
|
}, []);
|
|
56
|
-
instance.current = decorators.instance.reduce(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
instance.current = decorators.instance.reduce(
|
|
60
|
+
mergeInstance,
|
|
61
|
+
instance.current
|
|
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
|
+
);
|
|
71
|
+
instance.current.renderers = decorators.renderers.reduce(
|
|
72
|
+
(result, decorator) => decorator(result, instance.current),
|
|
73
|
+
renderers
|
|
74
|
+
);
|
|
60
75
|
return { instance, decorators };
|
|
61
76
|
}
|
|
62
77
|
var createInstanceRef_default = createDataInstanceRef;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/createDataInstance/createInstanceRef.tsx"],
|
|
4
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 {\n mergeInstance,\n registerHotKeysHookToInstance,\n registerStateHookToInstance,\n} from './utils';\n\nconst defaultDecorators = {\n instance: [],\n state: [],\n hotKeys: [],\n renderers: [],\n composeData: [],\n};\n\nfunction createDataInstanceRef({\n uuid: uuidProp,\n data,\n renderers,\n plugins,\n customDecorators,\n ...props\n}) {\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]))\n nextDecorators[key] = orderBy(\n nextDecorators[key],\n (item) => item.order,\n );\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(\n mergeInstance,\n instance.current,\n );\n instance.current = decorators.state.reduce(\n registerStateHookToInstance,\n instance.current,\n );\n instance.current = decorators.hotKeys.reduce(\n registerHotKeysHookToInstance,\n instance.current,\n );\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;"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,MAAM,cAAc;AAC7B,SAAS,SAAS,QAAQ,gBAAgB;AAC1C,SAAS,eAAe;AACxB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,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;AAAA,EAC7B,MAAM;AAAA,EACN;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,KACG;AACL,GAAG;AAED,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,IACV,cAAc;AAAA,IACd,SAAS,CAAC;AAAA,IACV;AAAA,IACA,IAAI,KAAK;AAEP,aAAO,CAAC,SAAU,SAAS,QAAQ,KAAK,OAAO;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,IAAI;AACnC,uBAAe,OAAO;AAAA,UACpB,eAAe;AAAA,UACf,CAAC,SAAS,KAAK;AAAA,QACjB;AAAA,IACJ,CAAC;AAED,WAAO;AAAA,EACT,GAAG,CAAC,CAAC;AAIL,WAAS,UAAU,WAAW,SAAS;AAAA,IACrC;AAAA,IACA,SAAS;AAAA,EACX;AACA,WAAS,UAAU,WAAW,MAAM;AAAA,IAClC;AAAA,IACA,SAAS;AAAA,EACX;AACA,WAAS,UAAU,WAAW,QAAQ;AAAA,IACpC;AAAA,IACA,SAAS;AAAA,EACX;AACA,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
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/createDataInstance/index.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './createInstancePlugin';\nexport * from './createInstanceRef';\nexport * from './utils';\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -14,15 +14,30 @@ 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(
|
|
17
|
+
return formatters.reduce(
|
|
18
|
+
(result, formatter) => formatter(result, extraParams, grid),
|
|
19
|
+
value
|
|
20
|
+
);
|
|
18
21
|
}
|
|
19
22
|
function composeFormatters(formatters, instance, getItemValue = (record) => record.data.name) {
|
|
20
|
-
return (props) => formatters.reduce(
|
|
23
|
+
return (props) => formatters.reduce(
|
|
24
|
+
(result, formatter) => formatter(result, props, instance),
|
|
25
|
+
getItemValue(props.record)
|
|
26
|
+
);
|
|
21
27
|
}
|
|
22
|
-
const applyDecorators = (subject, decorators = [], ...args) => decorators.reduce(
|
|
28
|
+
const applyDecorators = (subject, decorators = [], ...args) => decorators.reduce(
|
|
29
|
+
(nextSubject, decorator) => decorator(nextSubject, ...args),
|
|
30
|
+
subject
|
|
31
|
+
);
|
|
23
32
|
const decorateColumns = (columns, decorators, grid) => {
|
|
24
|
-
const nextColumns = applyDecorators(
|
|
25
|
-
|
|
33
|
+
const nextColumns = applyDecorators(
|
|
34
|
+
columns,
|
|
35
|
+
decorators.decorateColumns,
|
|
36
|
+
grid
|
|
37
|
+
);
|
|
38
|
+
return nextColumns.map(
|
|
39
|
+
(column, index) => applyDecorators(column, decorators.decorateColumn, grid, index)
|
|
40
|
+
);
|
|
26
41
|
};
|
|
27
42
|
const mergeInstance = (instance, instanceHook) => ({
|
|
28
43
|
...instance,
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/createDataInstance/utils.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const reducePropsGetter = (decorators = [], grid) => (\n props = {},\n extraParams,\n) => {\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(\n transforms,\n value,\n extraParams = {},\n props = {},\n grid,\n) {\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(\n (result, formatter) => formatter(result, extraParams, grid),\n value,\n );\n}\n\nexport function composeFormatters(\n formatters,\n instance,\n getItemValue = (record) => record.data.name,\n) {\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(\n (result, formatter) => formatter(result, props, instance),\n getItemValue(props.record),\n );\n}\n\nexport const applyDecorators = (subject, decorators = [], ...args) =>\n decorators.reduce(\n (nextSubject, decorator) => decorator(nextSubject, ...args),\n subject,\n );\n\nexport const decorateColumns = (columns, decorators, grid) => {\n const nextColumns = applyDecorators(\n columns,\n decorators.decorateColumns,\n grid,\n );\n return nextColumns.map((column, index) =>\n applyDecorators(column, decorators.decorateColumn, grid, index),\n );\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 = (\n instance,\n { key, handler, options, allowDocumentHandler },\n) => ({\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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C,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,CACnB,UACA,EAAE,KAAK,SAAS,SAAS,qBAAqB,OAC1C;AAAA,EACJ,GAAG;AAAA,EACH,SAAS;AAAA,IACP,GAAG,SAAS;AAAA,IACZ,CAAC,MAAM,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
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/defer-render-hoc/index.tsx"],
|
|
4
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 ? (\n <WrappedComponent {...this.props} />\n ) : (\n fallback\n );\n }\n }\n\n return hoistNonReactStatic(DeferredRenderWrapper, WrappedComponent);\n};\n\nexport default deferComponentRender;\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,UAAS,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,eAChB,gBAAAA,OAAA,cAAC;AAAA,QAAkB,GAAG,KAAK;AAAA,OAAO,IAElC;AAAA,IAEJ;AAAA,EACF;AAEA,SAAO,oBAAoB,uBAAuB,gBAAgB;AACpE;AAEA,IAAO,2BAAQ;",
|
|
6
|
+
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/dimsum.config.ts"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "const dimsumConfig = {\n classNamePrefix: 'em-ds',\n};\n\nexport { dimsumConfig };\nexport default dimsumConfig;\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,MAAM,eAAe;AAAA,EACnB,iBAAiB;AACnB;AAGA,IAAO,wBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
|
|
4
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"],
|
|
5
|
-
"mappings": "AAAA;
|
|
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
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/prop-types.ts"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const dsBasicSizes = ['s' as const, 'm' as const, 'l' as const];\n\nexport const sizes = ['xsmall' as const, 'small' as const, 'medium' as const, 'large' as const, 'xlarge' as const];\n\nexport const iconSizes = [\n 'xxs' as const,\n 'xs' as const,\n 's' as const,\n 'm' as const,\n 'l' as const,\n 'xl' as const,\n 'xxl' as const,\n];\n\nexport const iconColors = [\n ['neutral', '900'] as const,\n ['neutral', '0'] as const,\n ['danger', '900'] as const,\n ['warning', '500'] as const,\n ['success', '900'] as const,\n ['brand-primary', '600'] as const,\n] as const;\n\nexport const CHECKBOX_VARIANT = {\n DEFAULT: 'variant-default' as const,\n FOCUS: 'variant-focus' as const,\n ACTIVE: 'variant-active' as const,\n DISABLED: 'variant-disabled' as const,\n ERROR: 'variant-error' as const,\n};\nexport const checkboxVariants = [\n CHECKBOX_VARIANT.DEFAULT,\n CHECKBOX_VARIANT.FOCUS,\n CHECKBOX_VARIANT.ACTIVE,\n CHECKBOX_VARIANT.DISABLED,\n CHECKBOX_VARIANT.ERROR,\n] as const;\n\nexport const COMBOBOX_VARIANT = {\n DEFAULT: 'variant-default' as const,\n FOCUS: 'variant-focus-input' as const,\n FOCUS_ICON: 'variant-focus-icon' as const,\n ACTIVE: 'variant-active-input' as const,\n ACTIVE_ICON: 'variant-active-icon' as const,\n DISABLED: 'variant-disabled' as const,\n ERROR: 'variant-error' as const,\n};\n\nexport const comboBoxVariants = [\n COMBOBOX_VARIANT.DEFAULT,\n COMBOBOX_VARIANT.FOCUS,\n COMBOBOX_VARIANT.FOCUS_ICON,\n COMBOBOX_VARIANT.ACTIVE,\n COMBOBOX_VARIANT.ACTIVE_ICON,\n COMBOBOX_VARIANT.DISABLED,\n COMBOBOX_VARIANT.ERROR,\n] as const;\n\nexport const sizeVariants = {\n S: 's' as const,\n M: 'm' as const,\n L: 'l' as const,\n};\n\nexport const position = {\n LEFT: 'left' as const,\n RIGHT: 'right' as const,\n CENTER: 'center' as const,\n};\n\nexport const fontColor = {\n NEUTRAL500: 'neutral500' as const,\n NEUTRAL700: 'neutral700' as const,\n};\n\nexport const orientation = ['horizontal' as const, 'vertical' as const] as const;\n\nexport const orientationVariants = {\n HORIZONTAL: 'horizontal' as const,\n VERTICAL: 'vertical' as const,\n};\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,eAAe,CAAC,KAAc,KAAc,GAAY;AAE9D,MAAM,QAAQ,CAAC,UAAmB,SAAkB,UAAmB,SAAkB,QAAiB;AAE1G,MAAM,YAAY;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA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-shim.js", "../../../src/react-spring/index.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from 'react-spring/web';\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/react-spring/renderprops.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from 'react-spring/renderprops';\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -21,19 +21,25 @@ const ToolbarProvider = memo(({ delay = 200, children, onHide = noop, onShow = n
|
|
|
21
21
|
const show = (state) => {
|
|
22
22
|
if (state.reference === tooltipState.reference)
|
|
23
23
|
clearTimeout(hideTimer.current);
|
|
24
|
-
showTimer.current = setTimeout(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
showTimer.current = setTimeout(
|
|
25
|
+
() => setTooltipState({
|
|
26
|
+
...state,
|
|
27
|
+
visible: true
|
|
28
|
+
}),
|
|
29
|
+
delay
|
|
30
|
+
);
|
|
28
31
|
onShow();
|
|
29
32
|
};
|
|
30
33
|
const hide = (e, force) => {
|
|
31
34
|
if (!force)
|
|
32
35
|
clearTimeout(showTimer.current);
|
|
33
|
-
hideTimer.current = setTimeout(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
hideTimer.current = setTimeout(
|
|
37
|
+
() => setTooltipState((prevState) => ({
|
|
38
|
+
...prevState,
|
|
39
|
+
visible: false
|
|
40
|
+
})),
|
|
41
|
+
100
|
|
42
|
+
);
|
|
37
43
|
onHide(tooltipState, e);
|
|
38
44
|
};
|
|
39
45
|
useScrollListener((e) => hide(e, true), tooltipState.visible);
|
|
@@ -49,11 +55,14 @@ const ToolbarProvider = memo(({ delay = 200, children, onHide = noop, onShow = n
|
|
|
49
55
|
window.removeEventListener("keydown", keyDownHandler);
|
|
50
56
|
};
|
|
51
57
|
});
|
|
52
|
-
const value = useMemo(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
const value = useMemo(
|
|
59
|
+
() => ({
|
|
60
|
+
state: tooltipState,
|
|
61
|
+
show,
|
|
62
|
+
hide
|
|
63
|
+
}),
|
|
64
|
+
[tooltipState.reference]
|
|
65
|
+
);
|
|
57
66
|
return /* @__PURE__ */ React2.createElement(Provider, {
|
|
58
67
|
value
|
|
59
68
|
}, children, /* @__PURE__ */ React2.createElement(DSPopover, {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/toolbar/ToolbarProvider.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useMemo, useRef, useState, useEffect, memo } from 'react';\nimport { DSPopover } from '@elliemae/ds-popover';\nimport { useOnClickOutside } from '@elliemae/ds-utilities';\n\nexport const ToolbarContext = React.createContext();\n\nconst { Provider } = ToolbarContext;\n\nconst useScrollListener = (callback, dependencies) => {\n useEffect(() => {\n window.addEventListener('scroll', callback, true);\n return () => {\n window.removeEventListener('scroll', callback, true);\n };\n }, [dependencies]);\n};\n\nconst noop = () => null;\nconst ToolbarProvider = memo(({ delay = 200, children, onHide = noop, onShow = noop }) => {\n const showTimer = useRef();\n const hideTimer = useRef();\n const toolbarRef = useRef();\n const [tooltipState, setTooltipState] = useState({});\n\n const show = (state) => {\n if (state.reference === tooltipState.reference) clearTimeout(hideTimer.current);\n showTimer.current = setTimeout(\n () =>\n setTooltipState({\n ...state,\n visible: true,\n }),\n delay,\n );\n onShow();\n };\n\n const hide = (e, force) => {\n if (!force) clearTimeout(showTimer.current);\n hideTimer.current = setTimeout(\n () =>\n setTooltipState((prevState) => ({\n ...prevState,\n visible: false,\n })),\n 100,\n );\n onHide(tooltipState, e);\n };\n\n useScrollListener((e) => hide(e, true), tooltipState.visible);\n useOnClickOutside(toolbarRef, () => hide());\n\n const keyDownHandler = (e) => {\n if (e.key === 'Escape') {\n hide(e);\n }\n };\n\n useEffect(() => {\n window.addEventListener('keydown', keyDownHandler);\n return () => {\n window.removeEventListener('keydown', keyDownHandler);\n };\n });\n\n const value = useMemo(\n () => ({\n state: tooltipState,\n show,\n hide,\n }),\n [tooltipState.reference],\n );\n\n return (\n <Provider value={value}>\n {children}\n <DSPopover\n boundaries=\"scrollParent\"\n {...(tooltipState.options || {})}\n content={tooltipState.renderer}\n placement=\"left\"\n referenceEl={tooltipState.reference}\n renderer={({ as: Component, style, children: Content }) => (\n <div ref={toolbarRef} onMouseEnter={(e) => show(tooltipState, e)} onMouseLeave={hide}>\n <Component style={style}>{Content}</Component>\n </div>\n )}\n style={tooltipState.style}\n visible={tooltipState.visible}\n />\n </Provider>\n );\n});\n\nexport { ToolbarProvider };\nexport default ToolbarProvider;\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,UAAS,SAAS,QAAQ,UAAU,WAAW,YAAY;AAClE,SAAS,iBAAiB;AAC1B,SAAS,yBAAyB;AAE3B,MAAM,iBAAiBA,OAAM,cAAc;AAElD,MAAM,EAAE,SAAS,IAAI;AAErB,MAAM,oBAAoB,CAAC,UAAU,iBAAiB;AACpD,YAAU,MAAM;AACd,WAAO,iBAAiB,UAAU,UAAU,IAAI;AAChD,WAAO,MAAM;AACX,aAAO,oBAAoB,UAAU,UAAU,IAAI;AAAA,IACrD;AAAA,EACF,GAAG,CAAC,YAAY,CAAC;AACnB;AAEA,MAAM,OAAO,MAAM;AACnB,MAAM,kBAAkB,KAAK,CAAC,EAA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WAAW,CAAC;AAAA,IAC9B,SAAS,aAAa;AAAA,IACtB,WAAU;AAAA,IACV,aAAa,aAAa;AAAA,IAC1B,UAAU,CAAC,EAAE,IAAI,WAAW,OAAO,UAAU,QAAQ,MACnD,gBAAAA,OAAA,cAAC;AAAA,MAAI,KAAK;AAAA,MAAY,cAAc,CAAC,MAAM,KAAK,cAAc,CAAC;AAAA,MAAG,cAAc;AAAA,OAC9E,gBAAAA,OAAA,cAAC;AAAA,MAAU;AAAA,OAAe,OAAQ,CACpC;AAAA,IAEF,OAAO,aAAa;AAAA,IACpB,SAAS,aAAa;AAAA,GACxB,CACF;AAEJ,CAAC;AAGD,IAAO,0BAAQ;",
|
|
6
|
+
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/useDataGrid/VolatileRowsListener.tsx"],
|
|
4
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;
|
|
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,cAAY,SAAS,UAAU,QAAQ,CAAC;AAC/D,SAAK,YAAY,CAAC;AAAA,EACpB;AACF;AAGA,IAAO,+BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/useDataGrid/index.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './initColumnDefinition';\nexport * from './VolatileRowsListener';\nexport * from './useDataGrid';\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -15,22 +15,24 @@ const appendHeaderFormatter = curry((formatter, column) => ({
|
|
|
15
15
|
formatters: [...get(column, "header.formatters", []), formatter]
|
|
16
16
|
}
|
|
17
17
|
}));
|
|
18
|
-
const appendCellFormatter = curry(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if (formatter
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
const appendCellFormatter = curry(
|
|
19
|
+
(formatter, column, path = "formatters") => {
|
|
20
|
+
const nextColumn = cloneDeep(column);
|
|
21
|
+
const formatters = get(nextColumn, ["cell", path], []);
|
|
22
|
+
const scrollingFormatters = get(nextColumn, "cell.scrollingFormatters", []);
|
|
23
|
+
if (Array.isArray(formatter)) {
|
|
24
|
+
if (formatter[1])
|
|
25
|
+
scrollingFormatters.push(formatter[1]);
|
|
26
|
+
formatters.push(formatter[0]);
|
|
27
|
+
} else {
|
|
28
|
+
formatters.push(formatter);
|
|
29
|
+
scrollingFormatters.push(formatter);
|
|
30
|
+
}
|
|
31
|
+
set(nextColumn, ["cell", path], formatters);
|
|
32
|
+
set(nextColumn, "cell.scrollingFormatters", scrollingFormatters);
|
|
33
|
+
return nextColumn;
|
|
29
34
|
}
|
|
30
|
-
|
|
31
|
-
set(nextColumn, "cell.scrollingFormatters", scrollingFormatters);
|
|
32
|
-
return nextColumn;
|
|
33
|
-
});
|
|
35
|
+
);
|
|
34
36
|
const defaultColumnDefinitionOptions = {
|
|
35
37
|
normalize: false,
|
|
36
38
|
useTextTruncation: true,
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/useDataGrid/initColumnDefinition.tsx"],
|
|
4
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 {\n get,\n curry,\n set,\n cloneDeep,\n isFunction,\n} 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(\n (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);\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 = (options = {}) => {\n // eslint-disable-next-line complexity\n return (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 { useTextTruncation = true, isUserColumn, visible, normalize } = {\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 (\n useTextTruncation &&\n !(\n isFunction(column.customHeaderRenderer) ||\n column.header.formatters.length\n )\n ) {\n column.header.formatters.push((value) => (\n <span className=\"cell-value\">{value}</span>\n ));\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 (\n useTextTruncation &&\n !(isFunction(column.customRenderer) || column.cell.formatters.length)\n ) {\n column.cell.formatters.push((value) => (\n <span\n className=\"cell-value\"\n style={{\n justifyContent:\n 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};\n\nexport default initColumnDefinition;\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACEvB,OAAOA,YAAW;AAClB,SAAS,MAAM,cAAc;AAC7B;AAAA,EACE;AAA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AAK,WAAW,KAAK,CAAC,UAC3B,gBAAAA,OAAA,cAAC;AAAA,QACC,WAAU;AAAA,QACV,OAAO;AAAA,UACL,gBACE,OAAO,SAAS,WAAW,aAAa;AAAA,QAC5C;AAAA,SAEC,KACH,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;AACF;AAEA,IAAO,+BAAQ;",
|
|
6
|
+
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -43,7 +43,10 @@ const useDataGrid = ({
|
|
|
43
43
|
const [originalRows, updateRows] = useDerivedStateFromProps(rows, {
|
|
44
44
|
onUpdate: resolve.resolve({
|
|
45
45
|
columns,
|
|
46
|
-
method: (extra) => compose(
|
|
46
|
+
method: (extra) => compose(
|
|
47
|
+
resolve.byFunction("valueTransformation")(extra),
|
|
48
|
+
resolve.nested(extra)
|
|
49
|
+
)
|
|
47
50
|
}),
|
|
48
51
|
updateOnStateChange: true
|
|
49
52
|
});
|
|
@@ -92,11 +95,13 @@ const useDataGrid = ({
|
|
|
92
95
|
registerHotKeys: [],
|
|
93
96
|
decorateColumn: [],
|
|
94
97
|
decorateColumns: [
|
|
95
|
-
(cols) => cols.map(
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
(cols) => cols.map(
|
|
99
|
+
(col) => initColumnDefinition({
|
|
100
|
+
useTextTruncation: col.useTextTruncation,
|
|
101
|
+
wrapText: props.wrapText,
|
|
102
|
+
normalize: props.normalizeDataKeys
|
|
103
|
+
})(col)
|
|
104
|
+
)
|
|
100
105
|
],
|
|
101
106
|
decorateRenderers: [],
|
|
102
107
|
getRowProps: [],
|
|
@@ -111,24 +116,30 @@ const useDataGrid = ({
|
|
|
111
116
|
plugins.forEach((plugin) => nextDecorators = plugin(nextDecorators));
|
|
112
117
|
return nextDecorators;
|
|
113
118
|
}, [plugins]);
|
|
114
|
-
instance.current = decorators.decorateGrid.reduce(
|
|
115
|
-
|
|
116
|
-
...decorator(instance.current)
|
|
117
|
-
}), instance.current);
|
|
118
|
-
instance.current = decorators.registerStateHook.reduce((nextInstance, decorator) => {
|
|
119
|
-
const { state, actions } = decorator(instance.current);
|
|
120
|
-
return {
|
|
119
|
+
instance.current = decorators.decorateGrid.reduce(
|
|
120
|
+
(nextInstance, decorator) => ({
|
|
121
121
|
...nextInstance,
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
122
|
+
...decorator(instance.current)
|
|
123
|
+
}),
|
|
124
|
+
instance.current
|
|
125
|
+
);
|
|
126
|
+
instance.current = decorators.registerStateHook.reduce(
|
|
127
|
+
(nextInstance, decorator) => {
|
|
128
|
+
const { state, actions } = decorator(instance.current);
|
|
129
|
+
return {
|
|
130
|
+
...nextInstance,
|
|
131
|
+
state: {
|
|
132
|
+
...nextInstance.state,
|
|
133
|
+
...state
|
|
134
|
+
},
|
|
135
|
+
actions: {
|
|
136
|
+
...nextInstance.actions,
|
|
137
|
+
...actions
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
},
|
|
141
|
+
instance.current
|
|
142
|
+
);
|
|
132
143
|
const reduceHotKey = (nextInstance, { key, handler, options }) => ({
|
|
133
144
|
...nextInstance,
|
|
134
145
|
hotKeys: {
|
|
@@ -136,31 +147,61 @@ const useDataGrid = ({
|
|
|
136
147
|
[key]: { handler, options }
|
|
137
148
|
}
|
|
138
149
|
});
|
|
139
|
-
instance.current = decorators.registerHotKeys.reduce(
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
150
|
+
instance.current = decorators.registerHotKeys.reduce(
|
|
151
|
+
(nextInstance, decorator) => {
|
|
152
|
+
const hotKeys = decorator(nextInstance);
|
|
153
|
+
if (Array.isArray(hotKeys)) {
|
|
154
|
+
return hotKeys.reduce(reduceHotKey, nextInstance);
|
|
155
|
+
}
|
|
156
|
+
return reduceHotKey(nextInstance, hotKeys);
|
|
157
|
+
},
|
|
158
|
+
instance.current
|
|
159
|
+
);
|
|
160
|
+
instance.current.decoratedRenderers = applyDecorators(
|
|
161
|
+
instance.current.decoratedRenderers,
|
|
162
|
+
decorators.decorateRenderers,
|
|
163
|
+
instance.current
|
|
164
|
+
);
|
|
147
165
|
instance.current.decoratedColumns = useMemo(() => {
|
|
148
|
-
const visibleColumns = cloneDeep(columns).filter(
|
|
166
|
+
const visibleColumns = cloneDeep(columns).filter(
|
|
167
|
+
(column) => typeof column.visible === "undefined" || column.visible
|
|
168
|
+
);
|
|
149
169
|
return visibleColumns.length ? decorateColumns(visibleColumns, decorators, instance.current) : [];
|
|
150
170
|
}, [columns]);
|
|
151
|
-
instance.current.getBodyProps = reducePropsGetter(
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
instance.current.
|
|
156
|
-
|
|
171
|
+
instance.current.getBodyProps = reducePropsGetter(
|
|
172
|
+
decorators.getBodyProps,
|
|
173
|
+
instance.current
|
|
174
|
+
);
|
|
175
|
+
instance.current.getHeaderProps = reducePropsGetter(
|
|
176
|
+
decorators.getHeaderProps,
|
|
177
|
+
instance.current
|
|
178
|
+
);
|
|
179
|
+
instance.current.getRowProps = reducePropsGetter(
|
|
180
|
+
decorators.getRowProps,
|
|
181
|
+
instance.current
|
|
182
|
+
);
|
|
183
|
+
instance.current.getHeaderRowProps = reducePropsGetter(
|
|
184
|
+
decorators.getHeaderRowProps,
|
|
185
|
+
instance.current
|
|
186
|
+
);
|
|
187
|
+
instance.current.getTableProps = reducePropsGetter(
|
|
188
|
+
decorators.getTableProps,
|
|
189
|
+
instance.current
|
|
190
|
+
);
|
|
191
|
+
instance.current.composedRows = decorators.composeRows.reduce(
|
|
192
|
+
(nextRows, getter) => getter(nextRows, instance.current),
|
|
193
|
+
instance.current.composedRows
|
|
194
|
+
);
|
|
157
195
|
RowsObserver.notify(instance.current.composedRows);
|
|
158
196
|
const currentShouldRefocus = instance.current.shouldRefocus.current;
|
|
159
197
|
const prevState = usePrevious(instance.current.state);
|
|
160
198
|
if (isObject(currentShouldRefocus) && currentShouldRefocus.forced) {
|
|
161
199
|
instance.current.shouldRefocus.current = currentShouldRefocus.value;
|
|
162
200
|
} else {
|
|
163
|
-
instance.current.shouldRefocus.current = !isEqual(
|
|
201
|
+
instance.current.shouldRefocus.current = !isEqual(
|
|
202
|
+
prevState,
|
|
203
|
+
instance.current.state
|
|
204
|
+
);
|
|
164
205
|
}
|
|
165
206
|
if (props.instanceRef)
|
|
166
207
|
setRef(props.instanceRef, instance.current);
|