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

Upgraded to Babel 6.x #113

Merged
merged 3 commits into from
Feb 18, 2016
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
56 changes: 34 additions & 22 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,28 +1,40 @@
{
"stage": 0,
"env": {
"development": {
"plugins": ["react-transform"],
"extra": {
"react-transform": {
"transforms": [{
"transform": "react-transform-hmr",
"imports": ["react"],
"locals": ["module"]
}, {
"transform": "react-transform-catch-errors",
"imports": ["react", "redbox-react"]
}]
}
}
},
"es": {
ignore: [
"*.example.js",
"*.test.js",
"source/demo",
"source/tests.js"
"plugins": [
"typecheck",
[
"react-transform",
{
"transforms": [
{
"transform": "react-transform-hmr",
"imports": [
"react"
],
"locals": [
"module"
]
},
{
"transform": "react-transform-catch-errors",
"imports": [
"react",
"redbox-react"
]
}
]
}
]
]
}
}
},
"plugins": [
"transform-decorators-legacy"
],
"presets": [
"es2015",
"react",
"stage-0"
]
}
981 changes: 309 additions & 672 deletions dist/react-virtualized.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/react-virtualized.js.map

Large diffs are not rendered by default.

101 changes: 48 additions & 53 deletions es/AutoSizer/AutoSizer.js
Original file line number Diff line number Diff line change
@@ -1,77 +1,54 @@
'use strict';

Object.defineProperty(exports, '__esModule', {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;

var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
var _class, _temp;

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _react = require('react');

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var _react2 = _interopRequireDefault(_react);

function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _function = require('react-pure-render/function');

var _react = require('react');
var _function2 = _interopRequireDefault(_function);

var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _reactPureRenderFunction = require('react-pure-render/function');
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var _reactPureRenderFunction2 = _interopRequireDefault(_reactPureRenderFunction);
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

/**
* Decorator component that automatically adjusts the width and height of a single child.
* Child component should not be declared as a child but should rather be specified by a `ChildComponent` property.
* All other properties will be passed through to the child component.
*/

var AutoSizer = (function (_Component) {
var AutoSizer = (_temp = _class = function (_Component) {
_inherits(AutoSizer, _Component);

_createClass(AutoSizer, null, [{
key: 'propTypes',
value: {
/**
* Function respondible for rendering children.
* This function should implement the following signature:
* ({ height, width }) => PropTypes.element
*/
children: _react.PropTypes.func.isRequired,

/** Disable dynamic :height property */
disableHeight: _react.PropTypes.bool,

/** Disable dynamic :width property */
disableWidth: _react.PropTypes.bool,

/** Callback to be invoked on-resize: ({ height, width }) */
onResize: _react.PropTypes.func.isRequired
},
enumerable: true
}, {
key: 'defaultProps',
value: {
onResize: function onResize() {}
},
enumerable: true
}]);

function AutoSizer(props) {
_classCallCheck(this, AutoSizer);

_get(Object.getPrototypeOf(AutoSizer.prototype), 'constructor', this).call(this, props);
var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(AutoSizer).call(this, props));

_this.shouldComponentUpdate = _function2.default;


this.shouldComponentUpdate = _reactPureRenderFunction2['default'];
this.state = {
_this.state = {
height: 0,
width: 0
};

this._onResize = this._onResize.bind(this);
this._setRef = this._setRef.bind(this);
_this._onResize = _this._onResize.bind(_this);
_this._setRef = _this._setRef.bind(_this);
return _this;
}

_createClass(AutoSizer, [{
Expand Down Expand Up @@ -103,6 +80,7 @@ var AutoSizer = (function (_Component) {
// Outer div should not force width/height since that may prevent containers from shrinking.
// Inner component should overflow and use calculated width/height.
// See issue #68 for more information.

var outerStyle = { overflow: 'visible' };

if (!disableHeight) {
Expand All @@ -113,7 +91,7 @@ var AutoSizer = (function (_Component) {
outerStyle.width = 0;
}

return _react2['default'].createElement(
return _react2.default.createElement(
'div',
{
ref: this._setRef,
Expand All @@ -127,10 +105,11 @@ var AutoSizer = (function (_Component) {
value: function _onResize() {
var onResize = this.props.onResize;

var _parentNode$getBoundingClientRect = this._parentNode.getBoundingClientRect();
var _parentNode$getBoundi = this._parentNode.getBoundingClientRect();

var height = _parentNode$getBoundi.height;
var width = _parentNode$getBoundi.width;

var height = _parentNode$getBoundingClientRect.height;
var width = _parentNode$getBoundingClientRect.width;

var style = getComputedStyle(this._parentNode);
var paddingLeft = parseInt(style.paddingLeft, 10);
Expand All @@ -154,7 +133,23 @@ var AutoSizer = (function (_Component) {
}]);

return AutoSizer;
})(_react.Component);

exports['default'] = AutoSizer;
module.exports = exports['default'];
}(_react.Component), _class.propTypes = {
/**
* Function respondible for rendering children.
* This function should implement the following signature:
* ({ height, width }) => PropTypes.element
*/
children: _react.PropTypes.func.isRequired,

/** Disable dynamic :height property */
disableHeight: _react.PropTypes.bool,

/** Disable dynamic :width property */
disableWidth: _react.PropTypes.bool,

/** Callback to be invoked on-resize: ({ height, width }) */
onResize: _react.PropTypes.func.isRequired
}, _class.defaultProps = {
onResize: function onResize() {}
}, _temp);
exports.default = AutoSizer;
12 changes: 5 additions & 7 deletions es/AutoSizer/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
'use strict';

Object.defineProperty(exports, '__esModule', {
Object.defineProperty(exports, "__esModule", {
value: true
});

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
exports.AutoSizer = exports.default = undefined;

var _AutoSizer2 = require('./AutoSizer');

var _AutoSizer3 = _interopRequireDefault(_AutoSizer2);

exports['default'] = _AutoSizer3['default'];

var _AutoSizer4 = _interopRequireDefault(_AutoSizer2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

exports.AutoSizer = _AutoSizer4['default'];
exports.default = _AutoSizer3.default;
exports.AutoSizer = _AutoSizer3.default;
Loading