@elliemae/ds-shared 3.0.0-next.8 → 3.0.0-rc.0
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 +9 -16
- package/dist/cjs/Animations/BaseAnimation.js.map +1 -1
- package/dist/cjs/Animations/Grow.js +9 -16
- package/dist/cjs/Animations/Grow.js.map +1 -1
- package/dist/cjs/Animations/GrowRight.js +9 -16
- package/dist/cjs/Animations/GrowRight.js.map +1 -1
- package/dist/cjs/Animations/GrowVertical.js +19 -10
- package/dist/cjs/Animations/GrowVertical.js.map +3 -3
- package/dist/cjs/Animations/index.js +25 -0
- package/dist/cjs/Animations/index.js.map +7 -0
- package/dist/cjs/CheckableGroup.js +10 -22
- package/dist/cjs/CheckableGroup.js.map +2 -2
- package/dist/cjs/DeferRenderAfterComputation.js +9 -16
- package/dist/cjs/DeferRenderAfterComputation.js.map +1 -1
- package/dist/cjs/FocusGroup/FocusGrid.js +9 -16
- package/dist/cjs/FocusGroup/FocusGrid.js.map +1 -1
- package/dist/cjs/FocusGroup/FocusGroup.js +27 -16
- package/dist/cjs/FocusGroup/FocusGroup.js.map +2 -2
- package/dist/cjs/FocusGroup/FocusGroupContext.js +9 -16
- package/dist/cjs/FocusGroup/FocusGroupContext.js.map +1 -1
- package/dist/cjs/FocusGroup/FocusGroupManager.js +9 -16
- package/dist/cjs/FocusGroup/FocusGroupManager.js.map +1 -1
- package/dist/cjs/FocusGroup/focusGroupManagerHoc.js +9 -16
- package/dist/cjs/FocusGroup/focusGroupManagerHoc.js.map +1 -1
- package/dist/cjs/FocusGroup/index.js +16 -26
- package/dist/cjs/FocusGroup/index.js.map +2 -2
- package/dist/cjs/FocusGroup/useFocusGroupItem.js +9 -16
- package/dist/cjs/FocusGroup/useFocusGroupItem.js.map +1 -1
- package/dist/cjs/FocusGroup/utils/getNextCellPosition.js +9 -16
- package/dist/cjs/FocusGroup/utils/getNextCellPosition.js.map +1 -1
- package/dist/cjs/GroupContext/Group.js +9 -16
- package/dist/cjs/GroupContext/Group.js.map +1 -1
- package/dist/cjs/GroupContext/GroupContext.js +9 -16
- package/dist/cjs/GroupContext/GroupContext.js.map +1 -1
- package/dist/cjs/GroupContext/GroupItem.js +9 -16
- package/dist/cjs/GroupContext/GroupItem.js.map +1 -1
- package/dist/cjs/GroupContext/index.js +9 -16
- package/dist/cjs/GroupContext/index.js.map +1 -1
- package/dist/cjs/ScrollSync/ScrollSync.js +11 -24
- package/dist/cjs/ScrollSync/ScrollSync.js.map +2 -2
- package/dist/cjs/ScrollSync/ScrollSyncPane.js +9 -16
- package/dist/cjs/ScrollSync/ScrollSyncPane.js.map +1 -1
- package/dist/cjs/ScrollSync/ScrollSyncProvider.js +11 -24
- package/dist/cjs/ScrollSync/ScrollSyncProvider.js.map +2 -2
- package/dist/cjs/ScrollSync/index.js +12 -16
- package/dist/cjs/ScrollSync/index.js.map +2 -2
- package/dist/cjs/ScrollSync/useScrollSync.js +9 -16
- package/dist/cjs/ScrollSync/useScrollSync.js.map +1 -1
- package/dist/cjs/constants.js +9 -16
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/createDataInstance/createInstancePlugin.js +11 -17
- package/dist/cjs/createDataInstance/createInstancePlugin.js.map +2 -2
- package/dist/cjs/createDataInstance/createInstanceRef.js +9 -16
- package/dist/cjs/createDataInstance/createInstanceRef.js.map +1 -1
- package/dist/cjs/createDataInstance/index.js +24 -0
- package/dist/cjs/createDataInstance/index.js.map +7 -0
- package/dist/cjs/createDataInstance/utils.js +9 -16
- package/dist/cjs/createDataInstance/utils.js.map +1 -1
- package/dist/cjs/defer-render-hoc/index.js +9 -16
- package/dist/cjs/defer-render-hoc/index.js.map +1 -1
- package/dist/cjs/dimsum.config.js +9 -16
- package/dist/cjs/dimsum.config.js.map +1 -1
- package/dist/cjs/index.js +26 -29
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/prop-types.js +9 -16
- package/dist/cjs/prop-types.js.map +1 -1
- package/dist/cjs/react-spring/index.js +11 -17
- package/dist/cjs/react-spring/index.js.map +1 -1
- package/dist/cjs/react-spring/renderprops.js +11 -17
- package/dist/cjs/react-spring/renderprops.js.map +1 -1
- package/dist/cjs/toolbar/ToolbarProvider.js +11 -18
- package/dist/cjs/toolbar/ToolbarProvider.js.map +2 -2
- package/dist/cjs/useDataGrid/VolatileRowsListener.js +9 -16
- package/dist/cjs/useDataGrid/VolatileRowsListener.js.map +1 -1
- package/dist/cjs/useDataGrid/index.js +13 -25
- package/dist/cjs/useDataGrid/index.js.map +2 -2
- package/dist/cjs/useDataGrid/initColumnDefinition.js +9 -16
- package/dist/cjs/useDataGrid/initColumnDefinition.js.map +1 -1
- package/dist/cjs/useDataGrid/useDataGrid.js +9 -16
- package/dist/cjs/useDataGrid/useDataGrid.js.map +1 -1
- package/dist/cjs/useDataList/index.js +12 -25
- package/dist/cjs/useDataList/index.js.map +2 -2
- package/dist/cjs/useDataList/recordIterator.js +9 -16
- package/dist/cjs/useDataList/recordIterator.js.map +1 -1
- package/dist/cjs/useDataList/useDataList.js +9 -16
- package/dist/cjs/useDataList/useDataList.js.map +1 -1
- package/dist/cjs/utils.js +9 -16
- package/dist/cjs/utils.js.map +1 -1
- package/dist/cjs/virtualization/AutoHeightList.js +9 -16
- package/dist/cjs/virtualization/AutoHeightList.js.map +1 -1
- package/dist/cjs/virtualization/FluidHeightList.js +9 -16
- package/dist/cjs/virtualization/FluidHeightList.js.map +1 -1
- package/dist/cjs/virtualization/index.js +10 -22
- package/dist/cjs/virtualization/index.js.map +2 -2
- package/dist/esm/Animations/BaseAnimation.js.map +1 -1
- package/dist/esm/Animations/Grow.js.map +1 -1
- package/dist/esm/Animations/GrowRight.js.map +1 -1
- package/dist/esm/Animations/GrowVertical.js +5 -0
- package/dist/esm/Animations/GrowVertical.js.map +2 -2
- package/dist/esm/Animations/index.js +6 -0
- package/dist/esm/Animations/index.js.map +7 -0
- package/dist/esm/CheckableGroup.js +1 -6
- package/dist/esm/CheckableGroup.js.map +2 -2
- package/dist/esm/DeferRenderAfterComputation.js.map +1 -1
- package/dist/esm/FocusGroup/FocusGrid.js.map +1 -1
- package/dist/esm/FocusGroup/FocusGroup.js +18 -0
- package/dist/esm/FocusGroup/FocusGroup.js.map +2 -2
- package/dist/esm/FocusGroup/FocusGroupContext.js.map +1 -1
- package/dist/esm/FocusGroup/FocusGroupManager.js.map +1 -1
- package/dist/esm/FocusGroup/focusGroupManagerHoc.js.map +1 -1
- package/dist/esm/FocusGroup/index.js +6 -10
- package/dist/esm/FocusGroup/index.js.map +2 -2
- 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 +1 -1
- package/dist/esm/GroupContext/GroupContext.js.map +1 -1
- package/dist/esm/GroupContext/GroupItem.js.map +1 -1
- package/dist/esm/ScrollSync/ScrollSync.js +2 -8
- package/dist/esm/ScrollSync/ScrollSync.js.map +2 -2
- package/dist/esm/ScrollSync/ScrollSyncPane.js.map +1 -1
- package/dist/esm/ScrollSync/ScrollSyncProvider.js +2 -8
- package/dist/esm/ScrollSync/ScrollSyncProvider.js.map +2 -2
- package/dist/esm/ScrollSync/index.js +2 -0
- package/dist/esm/ScrollSync/index.js.map +2 -2
- package/dist/esm/ScrollSync/useScrollSync.js.map +1 -1
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/createDataInstance/createInstancePlugin.js +2 -1
- package/dist/esm/createDataInstance/createInstancePlugin.js.map +2 -2
- package/dist/esm/createDataInstance/createInstanceRef.js.map +1 -1
- package/dist/esm/createDataInstance/index.js +5 -0
- package/dist/esm/createDataInstance/index.js.map +7 -0
- package/dist/esm/createDataInstance/utils.js.map +1 -1
- package/dist/esm/defer-render-hoc/index.js.map +1 -1
- package/dist/esm/dimsum.config.js.map +1 -1
- package/dist/esm/index.js +16 -9
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/prop-types.js.map +1 -1
- package/dist/esm/toolbar/ToolbarProvider.js +1 -1
- package/dist/esm/toolbar/ToolbarProvider.js.map +2 -2
- package/dist/esm/useDataGrid/VolatileRowsListener.js.map +1 -1
- package/dist/esm/useDataGrid/index.js +3 -5
- package/dist/esm/useDataGrid/index.js.map +2 -2
- package/dist/esm/useDataGrid/initColumnDefinition.js.map +1 -1
- package/dist/esm/useDataGrid/useDataGrid.js.map +1 -1
- package/dist/esm/useDataList/index.js +2 -5
- package/dist/esm/useDataList/index.js.map +2 -2
- package/dist/esm/useDataList/recordIterator.js.map +1 -1
- package/dist/esm/useDataList/useDataList.js.map +1 -1
- package/dist/esm/utils.js.map +1 -1
- package/dist/esm/virtualization/AutoHeightList.js.map +1 -1
- package/dist/esm/virtualization/FluidHeightList.js.map +1 -1
- package/dist/esm/virtualization/index.js +1 -6
- package/dist/esm/virtualization/index.js.map +2 -2
- package/package.json +11 -11
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
export * from "./FocusGroup";
|
|
3
|
+
export * from "./FocusGroupContext";
|
|
4
|
+
export * from "./FocusGroupManager";
|
|
5
|
+
export * from "./useFocusGroupItem";
|
|
6
6
|
import { FocusGroupHoc } from "./focusGroupManagerHoc";
|
|
7
7
|
import { FocusGridProvider, FocusGridContext } from "./FocusGrid";
|
|
8
|
+
export * from "./utils/getNextCellPosition";
|
|
8
9
|
export {
|
|
9
10
|
FocusGridProvider as FocusGrid,
|
|
10
11
|
FocusGridContext,
|
|
11
|
-
|
|
12
|
-
FocusGroupContext,
|
|
13
|
-
FocusGroupManager,
|
|
14
|
-
FocusGroupHoc as focusGroupManagerHoc,
|
|
15
|
-
useFocusGroupItem,
|
|
16
|
-
useFocusGroupWithState
|
|
12
|
+
FocusGroupHoc as focusGroupManagerHoc
|
|
17
13
|
};
|
|
18
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/FocusGroup/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;",
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './FocusGroup';\nexport * from './FocusGroupContext';\nexport * from './FocusGroupManager';\nexport * from './useFocusGroupItem';\nexport { FocusGroupHoc as focusGroupManagerHoc } from './focusGroupManagerHoc';\nexport { FocusGridProvider as FocusGrid, FocusGridContext } from './FocusGrid';\nexport * from './utils/getNextCellPosition';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/FocusGroup/useFocusGroupItem.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useContext, useEffect } from 'react';\nimport { FocusGroupContext } from './FocusGroupContext';\n\nfunction useFocusGroupItem(ref = {}, props) {\n const { register, unregister, ...otherActions } =\n useContext(FocusGroupContext) || {};\n\n useEffect(() => {\n if (ref.current && register) register(ref.current, props);\n return () => {\n if (ref.current && unregister) unregister(ref.current);\n };\n });\n\n // if the focus item is not wrapped with the focus provider then return null\n if (!register) return {};\n return otherActions;\n}\n\nexport const useFocusGroupWithState = (ref = {}, props) => {\n const { register, unregister, ...otherActions } =\n useContext(FocusGroupContext) || {};\n\n useEffect(() => {\n if (ref && register) register(ref, props);\n return () => {\n if (ref && unregister) unregister(ref);\n };\n }, [ref]);\n\n // if the focus item is not wrapped with the focus provider then return null\n if (!register) return {};\n return otherActions;\n};\n\nexport { useFocusGroupItem };\nexport default useFocusGroupItem;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;AAAA;ACAA;AACA;AAEA,2BAA2B,MAAM,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;ACAA;AACA;AAEA,2BAA2B,MAAM,CAAC,GAAG,OAAO;AAC1C,QACE,gBAAW,iBAAiB,KAAK,CAAC,GAD5B,YAAU,eAChB,IAD+B,yBAC/B,IAD+B,CAAzB,YAAU;AAGlB,YAAU,MAAM;AACd,QAAI,IAAI,WAAW;AAAU,eAAS,IAAI,SAAS,KAAK;AACxD,WAAO,MAAM;AACX,UAAI,IAAI,WAAW;AAAY,mBAAW,IAAI,OAAO;AAAA,IACvD;AAAA,EACF,CAAC;AAGD,MAAI,CAAC;AAAU,WAAO,CAAC;AACvB,SAAO;AACT;AAEO,MAAM,yBAAyB,CAAC,MAAM,CAAC,GAAG,UAAU;AACzD,QACE,gBAAW,iBAAiB,KAAK,CAAC,GAD5B,YAAU,eAChB,IAD+B,yBAC/B,IAD+B,CAAzB,YAAU;AAGlB,YAAU,MAAM;AACd,QAAI,OAAO;AAAU,eAAS,KAAK,KAAK;AACxC,WAAO,MAAM;AACX,UAAI,OAAO;AAAY,mBAAW,GAAG;AAAA,IACvC;AAAA,EACF,GAAG,CAAC,GAAG,CAAC;AAGR,MAAI,CAAC;AAAU,WAAO,CAAC;AACvB,SAAO;AACT;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/FocusGroup/utils/getNextCellPosition.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "// eslint-disable-next-line max-statements\nfunction getNextCellPosition({\n grid,\n currentRow = 0,\n currentCell = 0,\n directionY,\n directionX,\n shouldWrapCells,\n shouldWrapRows,\n}) {\n let nextRow = currentRow + directionY;\n let nextCell = currentCell + directionX;\n const rowCount = grid.length;\n const isLeftRight = directionX !== 0;\n\n if (!rowCount) {\n return false;\n }\n\n const cellsLength = grid[0].length;\n\n // moving horizontally\n if (shouldWrapCells && isLeftRight) {\n // to left\n if (nextCell < 0) {\n nextCell = cellsLength - 1;\n nextRow -= 1;\n }\n\n if (nextCell >= cellsLength) {\n nextCell = 0;\n nextRow += 1;\n }\n }\n\n // moving vertically\n if (shouldWrapRows && !isLeftRight) {\n // to top\n if (nextRow < 0) {\n nextCell -= 1;\n nextRow = rowCount - 1;\n if (grid[nextRow] && nextCell >= 0 && !grid[nextRow][nextCell]) {\n nextRow -= 1;\n }\n } else if (nextRow >= rowCount || !grid[nextRow][nextCell]) {\n nextRow = 0;\n nextCell += 1;\n }\n }\n\n return {\n cellIndex: nextCell,\n rowIndex: nextRow,\n };\n}\n\nexport { getNextCellPosition };\nexport default getNextCellPosition;"],
|
|
5
|
-
"mappings": "AAAA;ACCA,6BAA6B;AAAA,EAC3B;AAAA,EACA,aAAa;AAAA,EACb,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,GACC;AACD,MAAI,UAAU,aAAa;AAC3B,MAAI,WAAW,cAAc;AAC7B,QAAM,WAAW,KAAK;AACtB,QAAM,cAAc,eAAe;AAEnC,MAAI,CAAC,UAAU;AACb,WAAO;AAAA;
|
|
5
|
+
"mappings": "AAAA;ACCA,6BAA6B;AAAA,EAC3B;AAAA,EACA,aAAa;AAAA,EACb,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,GACC;AACD,MAAI,UAAU,aAAa;AAC3B,MAAI,WAAW,cAAc;AAC7B,QAAM,WAAW,KAAK;AACtB,QAAM,cAAc,eAAe;AAEnC,MAAI,CAAC,UAAU;AACb,WAAO;AAAA,EACT;AAEA,QAAM,cAAc,KAAK,GAAG;AAG5B,MAAI,mBAAmB,aAAa;AAElC,QAAI,WAAW,GAAG;AAChB,iBAAW,cAAc;AACzB,iBAAW;AAAA,IACb;AAEA,QAAI,YAAY,aAAa;AAC3B,iBAAW;AACX,iBAAW;AAAA,IACb;AAAA,EACF;AAGA,MAAI,kBAAkB,CAAC,aAAa;AAElC,QAAI,UAAU,GAAG;AACf,kBAAY;AACZ,gBAAU,WAAW;AACrB,UAAI,KAAK,YAAY,YAAY,KAAK,CAAC,KAAK,SAAS,WAAW;AAC9D,mBAAW;AAAA,MACb;AAAA,IACF,WAAW,WAAW,YAAY,CAAC,KAAK,SAAS,WAAW;AAC1D,gBAAU;AACV,kBAAY;AAAA,IACd;AAAA,EACF;AAEA,SAAO;AAAA,IACL,WAAW;AAAA,IACX,UAAU;AAAA,EACZ;AACF;AAGA,IAAO,8BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/GroupContext/Group.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/no-unused-state */\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { GroupContext } from './GroupContext';\n\nconst getValueItem = (e) => {\n const { target, currentTarget } = e;\n if (target) {\n const { value } = target;\n return value;\n }\n if (currentTarget) {\n const { value } = currentTarget;\n return value;\n }\n return e;\n};\n\nconst toggleItemValue = (array, e) => {\n const newvalue = getValueItem(e);\n const res = array;\n const index = array.indexOf(newvalue);\n\n if (index === -1) {\n res.push(newvalue);\n } else {\n res.splice(index, 1);\n }\n\n return res;\n};\n\nconst { Provider } = GroupContext;\n/** deprecated use CheckableGroup instead */\nclass Group extends Component {\n constructor(props) {\n super(props);\n const { activeValue, disabled } = props;\n this.state = {\n activeValue,\n disabled,\n prevValue: null,\n onChange: this.handleChange.bind(this),\n };\n }\n\n static getDerivedStateFromProps(nextProps, { prevValue }) {\n if (nextProps.activeValue === prevValue) return null;\n return {\n activeValue: nextProps.activeValue,\n prevValue: nextProps.activeValue,\n };\n }\n\n handleChange(e, ...rest) {\n const { multiple, onChange } = this.props;\n const { activeValue } = this.state;\n const value = getValueItem(e);\n let newValue;\n if (multiple) {\n newValue = toggleItemValue(activeValue || [], value);\n } else if (activeValue !== value) {\n // default behaviour it will be toggle the active value\n newValue = value;\n }\n\n this.setState({\n activeValue: newValue,\n });\n\n if (onChange) onChange(newValue, ...rest);\n }\n\n render() {\n const { children } = this.props;\n return <Provider value={this.state}>{children}</Provider>;\n }\n}\n\nGroup.defaultProps = {\n multiple: false,\n};\n\nGroup.propTypes = {\n children: PropTypes.array,\n multiple: PropTypes.bool,\n onChange: PropTypes.func,\n activeValue: PropTypes.oneOfType([PropTypes.array, PropTypes.number]),\n disabled: PropTypes.bool,\n};\n\nexport { Group };\nexport default Group;\n"],
|
|
5
|
-
"mappings": "AAAA;ACCA;AACA;AACA;AAEA,MAAM,eAAe,CAAC,MAAM;AAC1B,QAAM,EAAE,QAAQ,kBAAkB;AAClC,MAAI,QAAQ;AACV,UAAM,EAAE,UAAU;AAClB,WAAO;AAAA;
|
|
5
|
+
"mappings": "AAAA;ACCA;AACA;AACA;AAEA,MAAM,eAAe,CAAC,MAAM;AAC1B,QAAM,EAAE,QAAQ,kBAAkB;AAClC,MAAI,QAAQ;AACV,UAAM,EAAE,UAAU;AAClB,WAAO;AAAA,EACT;AACA,MAAI,eAAe;AACjB,UAAM,EAAE,UAAU;AAClB,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAEA,MAAM,kBAAkB,CAAC,OAAO,MAAM;AACpC,QAAM,WAAW,aAAa,CAAC;AAC/B,QAAM,MAAM;AACZ,QAAM,QAAQ,MAAM,QAAQ,QAAQ;AAEpC,MAAI,UAAU,IAAI;AAChB,QAAI,KAAK,QAAQ;AAAA,EACnB,OAAO;AACL,QAAI,OAAO,OAAO,CAAC;AAAA,EACrB;AAEA,SAAO;AACT;AAEA,MAAM,EAAE,aAAa;AAErB,MAAM,cAAc,UAAU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../../../src/GroupContext/GroupContext.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\n\nexport const GroupContext = React.createContext();\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AAEO,MAAM,eAAe,OAAM;",
|
|
5
|
+
"mappings": "AAAA;ACAA;AAEO,MAAM,eAAe,OAAM,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/GroupContext/GroupItem.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { GroupContext } from './GroupContext';\n\nconst { Consumer } = GroupContext;\n\nconst GroupItem = ({ render }) => (\n <Consumer>{context => render(context)}</Consumer>\n);\n\nexport { GroupItem };\nexport default GroupItem;\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AAEA,MAAM,EAAE,aAAa;AAErB,MAAM,YAAY,CAAC,EAAE,aACnB,qCAAC,
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AAEA,MAAM,EAAE,aAAa;AAErB,MAAM,YAAY,CAAC,EAAE,aACnB,qCAAC,gBAAU,aAAW,OAAO,OAAO,CAAE;AAIxC,IAAO,oBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -65,16 +65,10 @@ class ScrollSync extends Component {
|
|
|
65
65
|
registerPane: this.registerPane,
|
|
66
66
|
unregisterPane: this.unregisterPane
|
|
67
67
|
};
|
|
68
|
+
this.syncScrollPosition = this.syncScrollPosition.bind(this);
|
|
68
69
|
}
|
|
69
70
|
syncScrollPosition(scrolledPane, pane) {
|
|
70
|
-
const {
|
|
71
|
-
scrollTop,
|
|
72
|
-
scrollHeight,
|
|
73
|
-
clientHeight,
|
|
74
|
-
scrollLeft,
|
|
75
|
-
scrollWidth,
|
|
76
|
-
clientWidth
|
|
77
|
-
} = scrolledPane;
|
|
71
|
+
const { scrollTop, scrollHeight, clientHeight, scrollLeft, scrollWidth, clientWidth } = scrolledPane;
|
|
78
72
|
const scrollTopOffset = scrollHeight - clientHeight;
|
|
79
73
|
const scrollLeftOffset = scrollWidth - clientWidth;
|
|
80
74
|
const { proportional, vertical, horizontal } = this.props;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/ScrollSync/ScrollSync.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { Component } from 'react';\n\nconst ScrollSyncContext = React.createContext();\n\nconst { Provider } = ScrollSyncContext;\n\nclass ScrollSync extends Component {\n panes = {};\n\n static defaultProps = {\n proportional: true,\n vertical: true,\n horizontal: true,\n enabled: true,\n };\n\n constructor(props) {\n super(props);\n this.syncContext = {\n registerPane: this.registerPane,\n unregisterPane: this.unregisterPane,\n };\n }\n\n registerPane = (node, groups) => {\n groups.forEach((group) => {\n if (!this.panes[group]) {\n this.panes[group] = [];\n }\n\n if (this.panes[group].length > 0) {\n this.syncScrollPosition(this.panes[group][0], node);\n }\n this.panes[group].push(node);\n });\n this.addEvents(node, groups);\n };\n\n 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\n 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\n removeEvents = (node) => {\n /* For some reason element.removeEventListener doesnt work with document.body */\n node.onscroll = null; // eslint-disable-line\n };\n\n findPane = (node, group) => {\n if (!this.panes[group]) {\n return false;\n }\n\n return this.panes[group].find((pane) => pane === node);\n };\n\n handlePaneScroll = (node, groups, e) => {\n const { enabled } = this.props;\n if (this.props.onScroll) this.props.onScroll(e);\n\n if (!enabled) return;\n\n window.requestAnimationFrame(() => {\n this.syncScrollPositions(node, groups);\n });\n };\n\n 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\n syncScrollPosition(scrolledPane, pane) {\n const {
|
|
5
|
-
"mappings": "AAAA;ACAA;AAEA,MAAM,oBAAoB,OAAM;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { Component } from 'react';\n\nconst ScrollSyncContext = React.createContext();\n\nconst { Provider } = ScrollSyncContext;\n\nclass ScrollSync extends Component {\n panes = {};\n\n static defaultProps = {\n proportional: true,\n vertical: true,\n horizontal: true,\n enabled: true,\n };\n\n constructor(props) {\n super(props);\n this.syncContext = {\n registerPane: this.registerPane,\n unregisterPane: this.unregisterPane,\n };\n\n this.syncScrollPosition = this.syncScrollPosition.bind(this);\n }\n\n registerPane = (node, groups) => {\n groups.forEach((group) => {\n if (!this.panes[group]) {\n this.panes[group] = [];\n }\n\n if (this.panes[group].length > 0) {\n this.syncScrollPosition(this.panes[group][0], node);\n }\n this.panes[group].push(node);\n });\n this.addEvents(node, groups);\n };\n\n 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\n 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\n removeEvents = (node) => {\n /* For some reason element.removeEventListener doesnt work with document.body */\n node.onscroll = null; // eslint-disable-line\n };\n\n findPane = (node, group) => {\n if (!this.panes[group]) {\n return false;\n }\n\n return this.panes[group].find((pane) => pane === node);\n };\n\n handlePaneScroll = (node, groups, e) => {\n const { enabled } = this.props;\n if (this.props.onScroll) this.props.onScroll(e);\n\n if (!enabled) return;\n\n window.requestAnimationFrame(() => {\n this.syncScrollPositions(node, groups);\n });\n };\n\n 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\n syncScrollPosition(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 render() {\n const { children } = this.props;\n return <Provider value={this.syncContext}>{React.Children.only(children)}</Provider>;\n }\n}\n\nexport { ScrollSync, ScrollSyncContext };\nexport default ScrollSync;\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AAEA,MAAM,oBAAoB,OAAM,cAAc;AAE9C,MAAM,EAAE,aAAa;AAErB,MAAM,mBAAmB,UAAU;AAAA,EAUjC,YAAY,OAAO;AACjB,UAAM,KA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ources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/ScrollSync/ScrollSyncPane.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/display-name */\nimport React, { Component } from 'react';\nimport { ScrollSyncContext } from './ScrollSync';\n\n/**\n * MODIFIED FROM react-scroll-sync\n *\n * ScrollSyncPane Component\n *\n * Wrap your content in it to keep its scroll position in sync with other panes\n *\n * @param groups\n * @example ./example.md\n */\nclass ScrollSyncPane extends Component {\n static defaultProps = {\n group: 'default',\n enabled: true,\n };\n\n componentWillUnmount() {\n const { enabled, group, syncContext } = this.props;\n const { unregisterPane } = syncContext;\n\n if (enabled) unregisterPane(this.node, this.toArray(group));\n }\n\n toArray = groups => [].concat(groups);\n\n render() {\n const { children, group, syncContext, notPaginated } = this.props;\n const { registerPane } = syncContext;\n\n return children({\n registerPane: node => {\n if (notPaginated) {\n const virtualizedBody = node.querySelector(\n '.virtualized-body-wrapper',\n );\n if (virtualizedBody) {\n registerPane(virtualizedBody, this.toArray(group));\n }\n }\n return registerPane(node, this.toArray(group));\n },\n });\n }\n}\n\nexport const ScrollSyncPaneHOC = props => (\n <ScrollSyncContext.Consumer>\n {context => <ScrollSyncPane {...props} syncContext={context} />}\n </ScrollSyncContext.Consumer>\n);\n\nexport default ScrollSyncPaneHOC;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AAYA,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AAYA,MAAM,uBAAuB,UAAU;AAAA,EAAvC;AAAA;AAaE,mBAAU,YAAU,CAAC,EAAE,OAAO,MAAM;AAAA;AAAA,EAPpC,uBAAuB;AACrB,UAAM,EAAE,SAAS,OAAO,gBAAgB,KAAK;AAC7C,UAAM,EAAE,mBAAmB;AAE3B,QAAI;AAAS,qBAAe,KAAK,MAAM,KAAK,QAAQ,KAAK,CAAC;AAAA,EAC5D;AAAA,EAIA,SAAS;AACP,UAAM,EAAE,UAAU,OAAO,aAAa,iBAAiB,KAAK;AAC5D,UAAM,EAAE,iBAAiB;AAEzB,WAAO,SAAS;AAAA,MACd,cAAc,UAAQ;AACpB,YAAI,cAAc;AAChB,gBAAM,kBAAkB,KAAK,cAC3B,2BACF;AACA,cAAI,iBAAiB;AACnB,yBAAa,iBAAiB,KAAK,QAAQ,KAAK,CAAC;AAAA,UACnD;AAAA,QACF;AACA,eAAO,aAAa,MAAM,KAAK,QAAQ,KAAK,CAAC;AAAA,MAC/C;AAAA,IACF,CAAC;AAAA,EACH;AACF;AAhCS,AADT,eACS,eAAe;AAAA,EACpB,OAAO;AAAA,EACP,SAAS;AACX;AA+BK,MAAM,oBAAoB,WAC/B,qCAAC,kBAAkB,UAAlB,MACE,aAAW,qCAAC,iDAAmB,QAAnB;AAAA,EAA0B,aAAa;AAAA,EAAS,CAC/D;AAGF,IAAO,yBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -60,14 +60,7 @@ function ScrollSyncProvider({ enabled, horizontal, vertical, children }) {
|
|
|
60
60
|
});
|
|
61
61
|
};
|
|
62
62
|
const syncScrollPosition = raf((scrolledPane, pane) => {
|
|
63
|
-
const {
|
|
64
|
-
scrollTop,
|
|
65
|
-
scrollHeight,
|
|
66
|
-
clientHeight,
|
|
67
|
-
scrollLeft,
|
|
68
|
-
scrollWidth,
|
|
69
|
-
clientWidth
|
|
70
|
-
} = scrolledPane;
|
|
63
|
+
const { scrollTop, scrollHeight, clientHeight, scrollLeft, scrollWidth, clientWidth } = scrolledPane;
|
|
71
64
|
const scrollTopOffset = scrollHeight - clientHeight;
|
|
72
65
|
const scrollLeftOffset = scrollWidth - clientWidth;
|
|
73
66
|
const { proportional, vertical: vertical2, horizontal: horizontal2 } = this.props;
|
|
@@ -86,6 +79,7 @@ ScrollSyncProvider.propTypes = {};
|
|
|
86
79
|
ScrollSyncProvider.defaultProps = {};
|
|
87
80
|
var ScrollSyncProvider_default = ScrollSyncProvider;
|
|
88
81
|
export {
|
|
82
|
+
ScrollSyncProvider,
|
|
89
83
|
ScrollSyncProvider_default as default
|
|
90
84
|
};
|
|
91
85
|
//# sourceMappingURL=ScrollSyncProvider.js.map
|
|
@@ -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\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 {
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AAGA,MAAM,oBAAoB,OAAM;
|
|
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 ScrollSyncProvider;\nexport { ScrollSyncProvider };\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AAGA,MAAM,oBAAoB,OAAM,cAAc;AAE9C,MAAM,EAAE,aAAa;AAErB,4BAA4B,EAAE,SAAS,YAAY,UAAU,YAAY;AACvE,QAAM,QAAQ,OAAO;AAErB,QAAM,eAAe,CAAC,MAAM,WAAW;AACrC,WAAO,QAAQ,CAAC,UAAU;AACxB,UAAI,CAAC,KAAK,MAAM,QAAQ;AACtB,aAAK,MAAM,SAAS,CAAC;AAAA,MACvB;AAEA,UAAI,CAAC,KAAK,SAAS,MAAM,KAAK,GAAG;AAC/B,YAAI,KAAK,MAAM,OAAO,SAAS,GAAG;AAChC,eAAK,mBAAmB,KAAK,MAAM,OAAO,IAAI,IAAI;AAAA,QACpD;AACA,a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WAAW,cAAc,cAAc,YAAY,aAAa,gBAAgB;AAExF,UAAM,kBAAkB,eAAe;AACvC,UAAM,mBAAmB,cAAc;AAEvC,UAAM,EAAE,cAAc,qBAAU,4BAAe,KAAK;AAGpD,UAAM,aAAa,KAAK,eAAe;AACvC,UAAM,YAAY,KAAK,cAAc;AAErC,QAAI,aAAY,kBAAkB,GAAG;AACnC,WAAK,YAAY,eAAgB,aAAa,YAAa,kBAAkB;AAAA,IAC/E;AACA,QAAI,eAAc,mBAAmB,GAAG;AACtC,WAAK,aAAa,eAAgB,YAAY,aAAc,mBAAmB;AAAA,IACjF;AAAA,EACF,CAAC;AAED,SAAO,qCAAC,gBAAU,QAAS;AAC7B;AAEA,mBAAmB,YAAY,CAAC;AAChC,mBAAmB,eAAe,CAAC;AAEnC,IAAO,6BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { ScrollSync } from "./ScrollSync";
|
|
3
3
|
import { ScrollSyncPaneHOC } from "./ScrollSyncPane";
|
|
4
|
+
export * from "./ScrollSyncProvider";
|
|
5
|
+
export * from "./useScrollSync";
|
|
4
6
|
export {
|
|
5
7
|
ScrollSync,
|
|
6
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';\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;",
|
|
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;ACAA;AACA;AACA;AACA;",
|
|
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;ACGA,MAAM,gBAAgB,CAAC,UAAU;AAC/B,SAAO;
|
|
5
|
+
"mappings": "AAAA;ACGA,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;ACAO,MAAM,qBAAqB;AAC3B,MAAM,sBAAsB;AAC5B,MAAM,cAAc,CAAC,SAAS,UAAU,SAAS;
|
|
5
|
+
"mappings": "AAAA;ACAO,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
|
}
|
|
@@ -30,6 +30,7 @@ const createInstancePlugin = (name, hooks) => (decorators) => getDecoratorsFromH
|
|
|
30
30
|
var createInstancePlugin_default = createInstancePlugin;
|
|
31
31
|
export {
|
|
32
32
|
createInstancePlugin,
|
|
33
|
-
createInstancePlugin_default as default
|
|
33
|
+
createInstancePlugin_default as default,
|
|
34
|
+
getDecoratorsFromHooks
|
|
34
35
|
};
|
|
35
36
|
//# sourceMappingURL=createInstancePlugin.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/createDataInstance/createInstancePlugin.tsx"],
|
|
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"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;AAAA;ACAA,MAAM,yBAAyB,CAAC,OAAO,eAAe;AACpD,QAAM,iBAAiB,mBAAK;AAE5B,SAAO,KAAK,
|
|
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;ACAA,MAAM,yBAAyB,CAAC,OAAO,eAAe;AACpD,QAAM,iBAAiB,mBAAK;AAE5B,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
|
}
|
|
@@ -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;ACAA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAMA,MAAM,oBAAoB;AAAA,EACxB,UAAU;AAAA,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAMA,MAAM,oBAAoB;AAAA,EACxB,UAAU,CAAC;AAAA,EACX,OAAO,CAAC;AAAA,EACR,SAAS,CAAC;AAAA,EACV,WAAW,CAAC;AAAA,EACZ,aAAa,CAAC;AAChB;AAEA,+BAA+B,IAO5B;AAP4B,eAC7B;AAAA,UAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MAL6B,IAM1B,kBAN0B,IAM1B;AAAA,IALH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAIA,QAAM,WAAW,OAAO;AAExB,QAAM,CAAC,QAAQ,SAAS,YAAa,OAAM,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,kCAAK,oBAAsB;AAEhD,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,QACpB,eAAe,MACf,CAAC,SAAS,KAAK,KACjB;AAAA,IACJ,CAAC;AAED,WAAO;AAAA,EACT,GAAG,CAAC,CAAC;AAIL,WAAS,UAAU,WAAW,SAAS,OACrC,eACA,SAAS,OACX;AACA,WAAS,UAAU,WAAW,MAAM,OAClC,6BACA,SAAS,OACX;AACA,WAAS,UAAU,WAAW,QAAQ,OACpC,+BACA,SAAS,OACX;AACA,WAAS,QAAQ,YAAY,WAAW,UAAU,OAChD,CAAC,QAAQ,cAAc,UAAU,QAAQ,SAAS,OAAO,GACzD,SACF;AAEA,SAAO,EAAE,UAAU,WAAW;AAChC;AAGA,IAAO,4BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -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 return reduceHotKey(instance, hotKeys);\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;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AO,YAAY,UAAU,QAAQ;AAC7C,SAAO,iCACF,WADE;AAAA,IAEL,OAAO,kCACF,SAAS,QACT;AAAA,IAEL,SAAS,kCACJ,SAAS,UACT;AAAA,EAEP;AACF;AAEA,MAAM,eAAe,CACnB,UACA,EAAE,KAAK,SAAS,SAAS,2BACrB,iCACD,WADC;AAAA,EAEJ,SAAS,iCACJ,SAAS,UADL;AAAA,KAEN,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;ACAA;AACA;AACA;AASO,MAAM,uBAAuB,CAAC,kBAAkB,aAAa;AAClE,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AASO,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,qCAAC,qCAAqB,KAAK,MAAO,IAElC;AAAA,IAEJ;AAAA,EACF;AAEA,SAAO,oBAAoB,uBAAuB,gBAAgB;AACpE;AAEA,IAAO,2BAAQ;",
|
|
6
6
|
"names": []
|
|
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;ACAA,MAAM,eAAe;AAAA,EACnB,iBAAiB;
|
|
5
|
+
"mappings": "AAAA;ACAA,MAAM,eAAe;AAAA,EACnB,iBAAiB;AACnB;AAGA,IAAO,wBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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";
|
|
11
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
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;",
|
|
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;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;",
|
|
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;ACAO,MAAM,eAAe,CAAC,KAAc,KAAc;
|
|
5
|
+
"mappings": "AAAA;ACAO,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,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,MAAM,aAAa;AAAA,EACxB,CAAC,WAAW,KAAK;AAAA,EACjB,CAAC,WAAW,GAAG;AAAA,EACf,CAAC,UAAU,KAAK;AAAA,EAChB,CAAC,WAAW,KAAK;AAAA,EACjB,CAAC,WAAW,KAAK;AAAA,EACjB,CAAC,iBAAiB,KAAK;AACzB;AAEO,MAAM,mBAAmB;AAAA,EAC9B,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,OAAO;AACT;AACO,MAAM,mBAAmB;AAAA,EAC9B,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,iBAAiB;AACnB;AAEO,MAAM,mBAAmB;AAAA,EAC9B,SAAS;AAAA,EACT,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,UAAU;AAAA,EACV,OAAO;AACT;AAEO,MAAM,mBAAmB;AAAA,EAC9B,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,iBAAiB;AACnB;AAEO,MAAM,eAAe;AAAA,EAC1B,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEO,MAAM,WAAW;AAAA,EACtB,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AACV;AAEO,MAAM,YAAY;AAAA,EACvB,YAAY;AAAA,EACZ,YAAY;AACd;AAEO,MAAM,cAAc,CAAC,cAAuB,UAAmB;AAE/D,MAAM,sBAAsB;AAAA,EACjC,YAAY;AAAA,EACZ,UAAU;AACZ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -19,7 +19,7 @@ var __spreadValues = (a, b) => {
|
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
import * as React from "react";
|
|
21
21
|
import React2, { useMemo, useRef, useState, useEffect, memo } from "react";
|
|
22
|
-
import { DSPopover } from "@elliemae/ds-
|
|
22
|
+
import { DSPopover } from "@elliemae/ds-popover";
|
|
23
23
|
import { useOnClickOutside } from "@elliemae/ds-utilities";
|
|
24
24
|
const ToolbarContext = React2.createContext();
|
|
25
25
|
const { Provider } = ToolbarContext;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/toolbar/ToolbarProvider.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useMemo, useRef, useState, useEffect, memo } from 'react';\nimport { DSPopover } from '@elliemae/ds-
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AAEO,MAAM,iBAAiB,OAAM;
|
|
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;ACAA;AACA;AACA;AAEO,MAAM,iBAAiB,OAAM,cAAc;AAElD,MAA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QACZ,MAAO;AAAA,IACL,OAAO;AAAA,IACP;AAAA,IACA;AAAA,EACF,IACA,CAAC,aAAa,SAAS,CACzB;AAEA,SACE,qCAAC;AAAA,IAAS;AAAA,KACP,UACD,qCAAC;AAAA,IACC,YAAW;AAAA,KACN,aAAa,WAAW,CAAC,IAF/B;AAAA,IAGC,SAAS,aAAa;AAAA,IACtB,WAAU;AAAA,IACV,aAAa,aAAa;AAAA,IAC1B,UAAU,CAAC,EAAE,IAAI,WAAW,OAAO,UAAU,cAC3C,qCAAC;AAAA,MAAI,KAAK;AAAA,MAAY,cAAc,CAAC,MAAM,KAAK,cAAc,CAAC;AAAA,MAAG,cAAc;AAAA,OAC9E,qCAAC;AAAA,MAAU;AAAA,OAAe,OAAQ,CACpC;AAAA,IAEF,OAAO,aAAa;AAAA,IACpB,SAAS,aAAa;AAAA,IACxB,CACF;AAEJ,CAAC;AAGD,IAAO,0BAAQ;",
|
|
6
6
|
"names": []
|
|
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;ACAA;AAEA,
|
|
5
|
+
"mappings": "AAAA;ACAA;AAEA,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
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
default3 as useDataGrid
|
|
6
|
-
};
|
|
2
|
+
export * from "./initColumnDefinition";
|
|
3
|
+
export * from "./VolatileRowsListener";
|
|
4
|
+
export * from "./useDataGrid";
|
|
7
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
|
|
5
|
-
"mappings": "AAAA;ACAA;",
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './initColumnDefinition';\nexport * from './VolatileRowsListener';\nexport * from './useDataGrid';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -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;ACEA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUO,MAAM,wBAAwB,MAAM,CAAC,WAAW,WAAY,iCAC9D,SAD8D;AAAA,EAEjE,QAAQ,iCACH,OAAO,SADJ;AAAA,IAEN,YAAY,CAAC,GAAG,IAAI,QAAQ,qBAAqB,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACEA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUO,MAAM,wBAAwB,MAAM,CAAC,WAAW,WAAY,iCAC9D,SAD8D;AAAA,EAEjE,QAAQ,iCACH,OAAO,SADJ;AAAA,IAEN,YAAY,CAAC,GAAG,IAAI,QAAQ,qBAAqB,CAAC,CAAC,GAAG,SAAS;AAAA,EACjE;AACF,EAAE;AAEK,MAAM,sBAAsB,MACjC,CAAC,WAAW,QAAQ,OAAO,iBAAiB;AAC1C,QAAM,aAAa,UAAU,MAAM;AACnC,QAAM,aAAa,IAAI,YAAY,CAAC,QAAQ,IAAI,GAAG,CAAC,CAAC;AACrD,QAAM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