react-sheet
Advanced tools
Comparing version 0.0.42 to 0.0.44
@@ -14,3 +14,3 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
// TODO: REFACTOR THIS! | ||
function renderRow(data, columns, selection, focusedCell, setSelection, focus, onEnter, setSelectionEnd, selectionEnd, onMouseUp, onMouseDown, onMouseOver, setDragCopyValue) { | ||
function renderRow(data, columns, selection, focusedCell, setSelection, focus, onEnter, setSelectionEnd, selectionEnd, onMouseUp, onMouseDown, onMouseOver, setDragCopyValue, isSelecting) { | ||
return function (_ref) { | ||
@@ -37,2 +37,3 @@ var key = _ref.key, | ||
onMouseUp: onMouseUp, | ||
isSelecting: isSelecting, | ||
onMouseDown: onMouseDown, | ||
@@ -87,2 +88,3 @@ onMouseOver: onMouseOver, | ||
focus = _props.focus, | ||
isSelecting = _props.isSelecting, | ||
onEnter = _props.onEnter, | ||
@@ -111,3 +113,3 @@ _props$selectionEnd = _props.selectionEnd, | ||
rowHeight: rowHeight || 28, | ||
rowRenderer: renderRow(data, columns, selection, focusedCell, setSelection, focus, onEnter, setSelectionEnd, selectionEnd, onMouseUp, onMouseDown, onMouseOver, setDragCopyValue), | ||
rowRenderer: renderRow(data, columns, selection, focusedCell, setSelection, focus, onEnter, setSelectionEnd, selectionEnd, onMouseUp, onMouseDown, onMouseOver, setDragCopyValue, isSelecting), | ||
ref: function ref(instance) { | ||
@@ -114,0 +116,0 @@ return _this2.List = instance; |
@@ -90,2 +90,3 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
onEnter = _props.onEnter, | ||
isSelecting = _props.isSelecting, | ||
focusedCell = _props.focusedCell, | ||
@@ -128,2 +129,3 @@ onMouseUp = _props.onMouseUp, | ||
focus: focus, | ||
isSelecting: isSelecting, | ||
onEnter: onEnter, | ||
@@ -130,0 +132,0 @@ columns: columns, |
@@ -499,3 +499,3 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
if (dragCopyValue) { | ||
if (dragCopyValue || dragCopyValue === 0) { | ||
var state = _this.props.state; | ||
@@ -581,2 +581,3 @@ var cells = _this.getSelectedCells(); | ||
selection = _state.selection, | ||
isSelecting = _state.isSelecting, | ||
selectionEnd = _state.selectionEnd, | ||
@@ -588,2 +589,3 @@ focusedCell = _state.focusedCell; | ||
removeAllListeners: this.removeAllListeners, | ||
isSelecting: isSelecting, | ||
focus: this.focus, | ||
@@ -590,0 +592,0 @@ onClick: this.addListeners, |
@@ -13,2 +13,4 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
import { isBetween } from './utils/calculations'; | ||
var Row = function (_Component) { | ||
@@ -15,0 +17,0 @@ _inherits(Row, _Component); |
@@ -26,2 +26,18 @@ /** | ||
return arr; | ||
} | ||
export function isBetween(start, end, value) { | ||
var startPos = start; | ||
var endPos = end; | ||
if (endPos < startPos) { | ||
startPos = end; | ||
endPos = start; | ||
} | ||
if (value >= startPos && value <= endPos) { | ||
return true; | ||
} | ||
return false; | ||
} |
@@ -26,3 +26,3 @@ 'use strict'; | ||
// TODO: REFACTOR THIS! | ||
function renderRow(data, columns, selection, focusedCell, setSelection, focus, onEnter, setSelectionEnd, selectionEnd, onMouseUp, onMouseDown, onMouseOver, setDragCopyValue) { | ||
function renderRow(data, columns, selection, focusedCell, setSelection, focus, onEnter, setSelectionEnd, selectionEnd, onMouseUp, onMouseDown, onMouseOver, setDragCopyValue, isSelecting) { | ||
return function (_ref) { | ||
@@ -49,2 +49,3 @@ var key = _ref.key, | ||
onMouseUp: onMouseUp, | ||
isSelecting: isSelecting, | ||
onMouseDown: onMouseDown, | ||
@@ -99,2 +100,3 @@ onMouseOver: onMouseOver, | ||
focus = _props.focus, | ||
isSelecting = _props.isSelecting, | ||
onEnter = _props.onEnter, | ||
@@ -123,3 +125,3 @@ _props$selectionEnd = _props.selectionEnd, | ||
rowHeight: rowHeight || 28, | ||
rowRenderer: renderRow(data, columns, selection, focusedCell, setSelection, focus, onEnter, setSelectionEnd, selectionEnd, onMouseUp, onMouseDown, onMouseOver, setDragCopyValue), | ||
rowRenderer: renderRow(data, columns, selection, focusedCell, setSelection, focus, onEnter, setSelectionEnd, selectionEnd, onMouseUp, onMouseDown, onMouseOver, setDragCopyValue, isSelecting), | ||
ref: function ref(instance) { | ||
@@ -126,0 +128,0 @@ return _this2.List = instance; |
@@ -108,2 +108,3 @@ 'use strict'; | ||
onEnter = _props.onEnter, | ||
isSelecting = _props.isSelecting, | ||
focusedCell = _props.focusedCell, | ||
@@ -146,2 +147,3 @@ onMouseUp = _props.onMouseUp, | ||
focus: focus, | ||
isSelecting: isSelecting, | ||
onEnter: onEnter, | ||
@@ -148,0 +150,0 @@ columns: columns, |
@@ -523,3 +523,3 @@ 'use strict'; | ||
if (dragCopyValue) { | ||
if (dragCopyValue || dragCopyValue === 0) { | ||
var state = _this.props.state; | ||
@@ -605,2 +605,3 @@ var cells = _this.getSelectedCells(); | ||
selection = _state.selection, | ||
isSelecting = _state.isSelecting, | ||
selectionEnd = _state.selectionEnd, | ||
@@ -612,2 +613,3 @@ focusedCell = _state.focusedCell; | ||
removeAllListeners: this.removeAllListeners, | ||
isSelecting: isSelecting, | ||
focus: this.focus, | ||
@@ -614,0 +616,0 @@ onClick: this.addListeners, |
@@ -21,2 +21,4 @@ 'use strict'; | ||
var _calculations = require('./utils/calculations'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -23,0 +25,0 @@ |
@@ -5,2 +5,3 @@ "use strict"; | ||
exports.getRange = getRange; | ||
exports.isBetween = isBetween; | ||
/** | ||
@@ -31,2 +32,18 @@ * Returns an array containing number from start to end | ||
return arr; | ||
} | ||
function isBetween(start, end, value) { | ||
var startPos = start; | ||
var endPos = end; | ||
if (endPos < startPos) { | ||
startPos = end; | ||
endPos = start; | ||
} | ||
if (value >= startPos && value <= endPos) { | ||
return true; | ||
} | ||
return false; | ||
} |
{ | ||
"name": "react-sheet", | ||
"version": "0.0.42", | ||
"version": "0.0.44", | ||
"description": "Spreadsheet component for react", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3763563
45704