From ec51ab46dc8004e8bc08acf6368165628d832e27 Mon Sep 17 00:00:00 2001 From: Bohdan Hontarenko Date: Mon, 29 Jul 2019 11:15:28 +0300 Subject: [PATCH 1/2] classNames for react-list wrappers --- docs/index.js | 4 ++-- package-lock.json | 2 +- react-list.es6 | 4 ++-- react-list.js | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/index.js b/docs/index.js index e73d237..6eff924 100644 --- a/docs/index.js +++ b/docs/index.js @@ -21136,10 +21136,10 @@ Cogs.define("react-list.js", function (COGS_REQUIRE, COGS_REQUIRE_ASYNC, module, 'div', { style: style, ref: function ref(c) { return _this4.el = c; - } }, + }, className: 'ReactList' }, _react2.default.createElement( 'div', - { style: listStyle }, + { className: 'ReactList__inner', style: listStyle }, items ) ); diff --git a/package-lock.json b/package-lock.json index 8463112..cd617e1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "react-list", - "version": "0.8.10", + "version": "0.8.11", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/react-list.es6 b/react-list.es6 index 90d9ece..b82f3c7 100644 --- a/react-list.es6 +++ b/react-list.es6 @@ -498,8 +498,8 @@ module.exports = class ReactList extends Component { transform }; return ( -
this.el = c}> -
{items}
+
this.el = c} className={'ReactList'}> +
{items}
); } diff --git a/react-list.js b/react-list.js index 8719233..f84d011 100644 --- a/react-list.js +++ b/react-list.js @@ -651,10 +651,10 @@ 'div', { style: style, ref: function ref(c) { return _this4.el = c; - } }, + }, className: 'ReactList' }, _react2.default.createElement( 'div', - { style: listStyle }, + { className: 'ReactList__inner', style: listStyle }, items ) ); From 27b911032075369adba74588ebb19b136a83ef07 Mon Sep 17 00:00:00 2001 From: Bohdan Hontarenko Date: Mon, 29 Jul 2019 11:17:55 +0300 Subject: [PATCH 2/2] make className configurable --- docs/index.js | 16 +++++++++++----- react-list.es6 | 14 +++++++++----- react-list.js | 16 +++++++++++----- 3 files changed, 31 insertions(+), 15 deletions(-) diff --git a/docs/index.js b/docs/index.js index 6eff924..341ce71 100644 --- a/docs/index.js +++ b/docs/index.js @@ -21106,7 +21106,9 @@ Cogs.define("react-list.js", function (COGS_REQUIRE, COGS_REQUIRE_ASYNC, module, axis = _props7.axis, length = _props7.length, type = _props7.type, - useTranslate3d = _props7.useTranslate3d; + useTranslate3d = _props7.useTranslate3d, + className = _props7.className, + classNameInner = _props7.classNameInner; var _state7 = this.state, from = _state7.from, itemsPerRow = _state7.itemsPerRow; @@ -21136,10 +21138,10 @@ Cogs.define("react-list.js", function (COGS_REQUIRE, COGS_REQUIRE_ASYNC, module, 'div', { style: style, ref: function ref(c) { return _this4.el = c; - }, className: 'ReactList' }, + }, className: className }, _react2.default.createElement( 'div', - { className: 'ReactList__inner', style: listStyle }, + { style: listStyle, className: classNameInner }, items ) ); @@ -21162,7 +21164,9 @@ Cogs.define("react-list.js", function (COGS_REQUIRE, COGS_REQUIRE_ASYNC, module, threshold: _propTypes2.default.number, type: _propTypes2.default.oneOf(['simple', 'variable', 'uniform']), useStaticSize: _propTypes2.default.bool, - useTranslate3d: _propTypes2.default.bool + useTranslate3d: _propTypes2.default.bool, + className: _propTypes2.default.string, + classNameInner: _propTypes2.default.string }, _class.defaultProps = { axis: 'y', itemRenderer: function itemRenderer(index, key) { @@ -21187,7 +21191,9 @@ Cogs.define("react-list.js", function (COGS_REQUIRE, COGS_REQUIRE_ASYNC, module, threshold: 100, type: 'simple', useStaticSize: false, - useTranslate3d: false + useTranslate3d: false, + className: 'ReactList', + classNameInner: 'ReactList__inner' }, _temp); }); }); diff --git a/react-list.es6 b/react-list.es6 index b82f3c7..da49a24 100644 --- a/react-list.es6 +++ b/react-list.es6 @@ -78,7 +78,9 @@ module.exports = class ReactList extends Component { threshold: PropTypes.number, type: PropTypes.oneOf(['simple', 'variable', 'uniform']), useStaticSize: PropTypes.bool, - useTranslate3d: PropTypes.bool + useTranslate3d: PropTypes.bool, + className: PropTypes.string, + classNameInner: PropTypes.string }; static defaultProps = { @@ -93,7 +95,9 @@ module.exports = class ReactList extends Component { threshold: 100, type: 'simple', useStaticSize: false, - useTranslate3d: false + useTranslate3d: false, + className: 'ReactList', + classNameInner: 'ReactList__inner' }; constructor(props) { @@ -471,7 +475,7 @@ module.exports = class ReactList extends Component { } render() { - const {axis, length, type, useTranslate3d} = this.props; + const {axis, length, type, useTranslate3d, className, classNameInner} = this.props; const {from, itemsPerRow} = this.state; const items = this.renderItems(); @@ -498,8 +502,8 @@ module.exports = class ReactList extends Component { transform }; return ( -
this.el = c} className={'ReactList'}> -
{items}
+
this.el = c} className={className}> +
{items}
); } diff --git a/react-list.js b/react-list.js index f84d011..43f4952 100644 --- a/react-list.js +++ b/react-list.js @@ -621,7 +621,9 @@ axis = _props7.axis, length = _props7.length, type = _props7.type, - useTranslate3d = _props7.useTranslate3d; + useTranslate3d = _props7.useTranslate3d, + className = _props7.className, + classNameInner = _props7.classNameInner; var _state7 = this.state, from = _state7.from, itemsPerRow = _state7.itemsPerRow; @@ -651,10 +653,10 @@ 'div', { style: style, ref: function ref(c) { return _this4.el = c; - }, className: 'ReactList' }, + }, className: className }, _react2.default.createElement( 'div', - { className: 'ReactList__inner', style: listStyle }, + { style: listStyle, className: classNameInner }, items ) ); @@ -677,7 +679,9 @@ threshold: _propTypes2.default.number, type: _propTypes2.default.oneOf(['simple', 'variable', 'uniform']), useStaticSize: _propTypes2.default.bool, - useTranslate3d: _propTypes2.default.bool + useTranslate3d: _propTypes2.default.bool, + className: _propTypes2.default.string, + classNameInner: _propTypes2.default.string }, _class.defaultProps = { axis: 'y', itemRenderer: function itemRenderer(index, key) { @@ -702,6 +706,8 @@ threshold: 100, type: 'simple', useStaticSize: false, - useTranslate3d: false + useTranslate3d: false, + className: 'ReactList', + classNameInner: 'ReactList__inner' }, _temp); });