-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove ReactDataGrid dependency from addons bundle (#1272)
* Fix some zIndex issues around frozen cells and editors * Remove rdg dependency from addons package * Fix object assign * Adress PR comments * Fix tests * Fix lint error * add ref to draggable header cell * Adress PR comments
- Loading branch information
1 parent
5134c89
commit ab2da43
Showing
81 changed files
with
261 additions
and
265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...cells/headerCells/FilterableHeaderCell.js → ...cells/headerCells/FilterableHeaderCell.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import * as CellNavigationMode from './CellNavigationMode'; | ||
import * as EventTypes from './EventTypes'; | ||
import keyMirror from 'keymirror'; | ||
|
||
|
||
const UpdateActions = keyMirror({ | ||
CELL_UPDATE: null, | ||
COLUMN_FILL: null, | ||
COPY_PASTE: null, | ||
CELL_DRAG: null | ||
}); | ||
|
||
const DragItemTypes = { | ||
Column: 'column' | ||
}; | ||
|
||
const CellExpand = { | ||
DOWN_TRIANGLE: String.fromCharCode(9660), | ||
RIGHT_TRIANGLE: String.fromCharCode(9654) | ||
}; | ||
|
||
|
||
export { | ||
CellNavigationMode, | ||
EventTypes, | ||
UpdateActions, | ||
CellExpand, | ||
DragItemTypes | ||
}; |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...t-data-grid/src/editors/CheckboxEditor.js → packages/common/editors/CheckboxEditor.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...react-data-grid/src/editors/EditorBase.js → packages/common/editors/EditorBase.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
37 changes: 17 additions & 20 deletions
37
packages/react-data-grid/src/RowComparer.js → packages/common/utils/RowComparer.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,17 @@ | ||
import ColumnMetrics from './ColumnMetrics'; | ||
|
||
export const shouldRowUpdate = (nextProps, currentProps) => { | ||
return !(ColumnMetrics.sameColumns(currentProps.columns, nextProps.columns, ColumnMetrics.sameColumn)) || | ||
nextProps.row !== currentProps.row || | ||
currentProps.colOverscanStartIdx !== nextProps.colOverscanStartIdx || | ||
currentProps.colOverscanEndIdx !== nextProps.colOverscanEndIdx || | ||
currentProps.colVisibleStartIdx !== nextProps.colVisibleStartIdx || | ||
currentProps.colVisibleEndIdx !== nextProps.colVisibleEndIdx || | ||
currentProps.isSelected !== nextProps.isSelected || | ||
currentProps.isScrolling !== nextProps.isScrolling || | ||
nextProps.height !== currentProps.height || | ||
currentProps.isOver !== nextProps.isOver || | ||
currentProps.expandedRows !== nextProps.expandedRows || | ||
currentProps.canDrop !== nextProps.canDrop || | ||
currentProps.forceUpdate === true || | ||
currentProps.extraClasses !== nextProps.extraClasses; | ||
}; | ||
|
||
export default shouldRowUpdate; | ||
export default function shouldRowUpdate(nextProps, currentProps) { | ||
return currentProps.columns !== nextProps.columns || | ||
nextProps.row !== currentProps.row || | ||
currentProps.colOverscanStartIdx !== nextProps.colOverscanStartIdx || | ||
currentProps.colOverscanEndIdx !== nextProps.colOverscanEndIdx || | ||
currentProps.colVisibleStartIdx !== nextProps.colVisibleStartIdx || | ||
currentProps.colVisibleEndIdx !== nextProps.colVisibleEndIdx || | ||
currentProps.isSelected !== nextProps.isSelected || | ||
currentProps.isScrolling !== nextProps.isScrolling || | ||
nextProps.height !== currentProps.height || | ||
currentProps.isOver !== nextProps.isOver || | ||
currentProps.expandedRows !== nextProps.expandedRows || | ||
currentProps.canDrop !== nextProps.canDrop || | ||
currentProps.forceUpdate === true || | ||
currentProps.extraClasses !== nextProps.extraClasses; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { List, Iterable, Map } from 'immutable'; | ||
|
||
export const isColumnsImmutable = (columns) => { | ||
return (typeof Immutable !== 'undefined' && (columns instanceof Immutable.List)); | ||
}; | ||
|
||
export const isEmptyArray = (obj) => { | ||
return Array.isArray(obj) && obj.length === 0; | ||
}; | ||
|
||
export const isFunction = (functionToCheck) => { | ||
let getType = {}; | ||
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; | ||
}; | ||
|
||
export const isEmptyObject = (obj) => { | ||
return Object.keys(obj).length === 0 && obj.constructor === Object; | ||
}; | ||
|
||
export const isImmutableCollection = objToVerify => { | ||
return Iterable.isIterable(objToVerify); | ||
}; | ||
|
||
export const getMixedTypeValueRetriever = (isImmutable) => { | ||
let retObj = {}; | ||
const retriever = (item, key) => { return item[key]; }; | ||
const immutableRetriever = (immutable, key) => { return immutable.get(key); }; | ||
|
||
retObj.getValue = isImmutable ? immutableRetriever : retriever; | ||
|
||
return retObj; | ||
}; | ||
|
||
export const isImmutableMap = Map.isMap; | ||
|
||
export const last = arrayOrList => { | ||
if (arrayOrList == null) { | ||
throw new Error('arrayOrCollection is null'); | ||
} | ||
|
||
if (List.isList(arrayOrList)) { | ||
return arrayOrList.last(); | ||
} | ||
|
||
if (Array.isArray(arrayOrList)) { | ||
return arrayOrList[arrayOrList.length - 1]; | ||
} | ||
|
||
throw new Error('Cant get last of: ' + typeof(arrayOrList)); | ||
}; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/react-data-grid-addons/src/cells/headerCells/filters/NumericFilter.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
packages/react-data-grid-addons/src/data/RowGrouperResolver.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.