Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove hasteResolver in favor of standard esm relative imports [Fix #513] #519

Merged
merged 1 commit into from
Sep 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 0 additions & 42 deletions build_helpers/resolvers.js

This file was deleted.

169 changes: 73 additions & 96 deletions dist/fixed-data-table.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
"@babel/plugin-transform-object-assign": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@types/chai": "^4.2.10",
"@types/mocha": "^7.0.2",
"aphrodite": "2.4.0",
"autoprefixer": "9.6.1",
"babel-loader": "^8.0.0",
Expand Down
6 changes: 3 additions & 3 deletions src/ColumnResizerLine.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
* @typechecks
*/

import DOMMouseMoveTracker from 'DOMMouseMoveTracker';
import React from 'react';
import PropTypes from 'prop-types';

import clamp from 'clamp';
import cx from 'cx';
import clamp from './vendor_upstream/core/clamp';
import cx from './vendor_upstream/stubs/cx';
import DOMMouseMoveTracker from './vendor_upstream/dom/DOMMouseMoveTracker';

class ColumnResizerLine extends React.PureComponent {
static propTypes = {
Expand Down
76 changes: 39 additions & 37 deletions src/FixedDataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,25 @@

/*eslint no-bitwise:1*/

import FixedDataTableBufferedRows from 'FixedDataTableBufferedRows';
import ColumnResizerLine from 'ColumnResizerLine';
import FixedDataTableEventHelper from 'FixedDataTableEventHelper';
import FixedDataTableRow from 'FixedDataTableRow';
import React from 'react';
import PropTypes from 'prop-types';
import ReactTouchHandler from 'ReactTouchHandler';
import ReactWheelHandler from 'ReactWheelHandler';
import ariaAttributesSelector from 'ariaAttributes';
import columnTemplatesSelector from 'columnTemplates';
import cx from 'cx';
import debounceCore from 'debounceCore';
import isNaN from 'lodash/isNaN';
import joinClasses from 'joinClasses';
import scrollbarsVisible from 'scrollbarsVisible';
import tableHeightsSelector from 'tableHeights';
import shallowEqual from 'shallowEqual';

import cx from './vendor_upstream/stubs/cx';
import debounceCore from './vendor_upstream/core/debounceCore';
import joinClasses from './vendor_upstream/core/joinClasses';
import shallowEqual from './vendor_upstream/core/shallowEqual';
import ReactWheelHandler from './vendor_upstream/dom/ReactWheelHandler';

import ariaAttributesSelector from './selectors/ariaAttributes';
import columnTemplatesSelector from './selectors/columnTemplates';
import scrollbarsVisible from './selectors/scrollbarsVisible';
import tableHeightsSelector from './selectors/tableHeights';
import ColumnResizerLine from './ColumnResizerLine';
import FixedDataTableBufferedRows from './FixedDataTableBufferedRows';
import FixedDataTableEventHelper from './FixedDataTableEventHelper';
import FixedDataTableRow from './FixedDataTableRow';
import ReactTouchHandler from './ReactTouchHandler';

var ARROW_SCROLL_SPEED = 25;

Expand Down Expand Up @@ -675,29 +677,29 @@ class FixedDataTable extends React.Component {
* @private
*/
_reportScrollBarsUpdates() {
const {
bodyOffsetTop,
scrollbarXOffsetTop,
visibleRowsHeight,
} = tableHeightsSelector(this.props);
const { tableSize: {width}, scrollContentHeight, scrollY, scrollX} = this.props;
const newScrollState = {
viewportHeight: visibleRowsHeight,
contentHeight: scrollContentHeight,
scrollbarYOffsetTop: bodyOffsetTop,
scrollY,
viewportWidth: width,
contentWidth: width + this.props.maxScrollX,
scrollbarXOffsetTop,
scrollX,
scrollTo: this._scrollTo,
scrollToX: this._scrollToX,
scrollToY: this._scrollToY
};
if (!shallowEqual(this.previousScrollState, newScrollState)) {
this.props.onScrollBarsUpdate(newScrollState);
this.previousScrollState = newScrollState;
}
const {
bodyOffsetTop,
scrollbarXOffsetTop,
visibleRowsHeight,
} = tableHeightsSelector(this.props);
const { tableSize: { width }, scrollContentHeight, scrollY, scrollX } = this.props;
const newScrollState = {
viewportHeight: visibleRowsHeight,
contentHeight: scrollContentHeight,
scrollbarYOffsetTop: bodyOffsetTop,
scrollY,
viewportWidth: width,
contentWidth: width + this.props.maxScrollX,
scrollbarXOffsetTop,
scrollX,
scrollTo: this._scrollTo,
scrollToX: this._scrollToX,
scrollToY: this._scrollToY
};
if (!shallowEqual(this.previousScrollState, newScrollState)) {
this.props.onScrollBarsUpdate(newScrollState);
this.previousScrollState = newScrollState;
}
}

render() /*object*/ {
Expand Down
19 changes: 12 additions & 7 deletions src/FixedDataTableBufferedRows.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
* @typechecks
*/

import FixedDataTableRow from 'FixedDataTableRow';
import PropTypes from 'prop-types';
import React from 'react';
import cx from 'cx';
import emptyFunction from 'emptyFunction';
import joinClasses from 'joinClasses';
import inRange from 'lodash/inRange';

import cx from './vendor_upstream/stubs/cx';
import emptyFunction from './vendor_upstream/core/emptyFunction';
import joinClasses from './vendor_upstream/core/joinClasses';

import FixedDataTableRow from './FixedDataTableRow';

class FixedDataTableBufferedRows extends React.Component {
static propTypes = {
ariaRowIndexOffset: PropTypes.number,
Expand Down Expand Up @@ -112,9 +114,12 @@ class FixedDataTableBufferedRows extends React.Component {
}

/**
* @param {number} rowIndex
* @param {number} key
* @param {number} baseOffsetTop
* @typedef RowProps
* @prop {number} rowIndex
* @prop {number} key
* @prop {number} baseOffsetTop
*
* @param {RowProps} rowProps
* @return {!Object}
*/
renderRow({ rowIndex, key, baseOffsetTop }) /*object*/ {
Expand Down
12 changes: 7 additions & 5 deletions src/FixedDataTableCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
* @typechecks
*/

import FixedDataTableCellDefault from 'FixedDataTableCellDefault';
import FixedDataTableColumnReorderHandle from './FixedDataTableColumnReorderHandle';
import React from 'react';
import PropTypes from 'prop-types';
import cx from 'cx';
import joinClasses from 'joinClasses';
import shallowEqual from 'shallowEqual';

import cx from './vendor_upstream/stubs/cx';
import joinClasses from './vendor_upstream/core/joinClasses';
import shallowEqual from './vendor_upstream/core/shallowEqual';

import FixedDataTableCellDefault from './FixedDataTableCellDefault';
import FixedDataTableColumnReorderHandle from './FixedDataTableColumnReorderHandle';

class FixedDataTableCell extends React.Component {
/**
Expand Down
7 changes: 3 additions & 4 deletions src/FixedDataTableCellDefault.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
*/

import React from 'react';

import PropTypes from 'prop-types';

import cx from 'cx';
import joinClasses from 'joinClasses';
import cx from './vendor_upstream/stubs/cx';
import joinClasses from './vendor_upstream/core/joinClasses';

/**
* Component that handles default cell layout and styling.
Expand Down Expand Up @@ -75,7 +74,7 @@ class FixedDataTableCellDefault extends React.Component {

render() {
//Remove some props like columnKey and rowIndex so we don't pass it into the div
var {height, width, style, className, children, columnKey, rowIndex, ...props} = this.props;
var { height, width, style, className, children, columnKey, rowIndex, ...props } = this.props;

var innerStyle = {
height,
Expand Down
13 changes: 7 additions & 6 deletions src/FixedDataTableCellGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@

'use strict';

import FixedDataTableCell from 'FixedDataTableCell';
import FixedDataTableTranslateDOMPosition from 'FixedDataTableTranslateDOMPosition';
import PropTypes from 'prop-types';
import React from 'react';
import cx from 'cx';
import { sumPropWidths } from 'widthHelper';
import PropTypes from 'prop-types';

import cx from './vendor_upstream/stubs/cx';
import { sumPropWidths } from './helper/widthHelper';
import FixedDataTableCell from './FixedDataTableCell';
import FixedDataTableTranslateDOMPosition from './FixedDataTableTranslateDOMPosition';

class FixedDataTableCellGroupImpl extends React.Component {
/**
Expand Down Expand Up @@ -79,7 +80,7 @@ class FixedDataTableCellGroupImpl extends React.Component {
var cells = new Array(columns.length);
var contentWidth = sumPropWidths(columns);

var isColumnReordering = props.isColumnReordering && columns.reduce(function (acc, column) {
var isColumnReordering = props.isColumnReordering && columns.reduce(function(acc, column) {
return acc || props.columnReorderingData.columnKey === column.props.columnKey;
}, false);

Expand Down
Loading