New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-virtualized-sticky-tree

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-virtualized-sticky-tree - npm Package Compare versions

Comparing version 2.1.14 to 2.1.15

52

dist/commonjs/StickyTree.js

@@ -89,2 +89,5 @@ 'use strict';

var isLastChild = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
var _this2 = this;
var parentIndex = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : undefined;

@@ -125,5 +128,16 @@ var context = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : { totalHeight: 0 };

// itself has changed.
if (children === undefined || this.getChildrenCache[node.id] !== children) {
var oldChildren = this.getChildrenCache[node.id];
if (children === undefined || oldChildren !== children) {
delete this.rowRenderCache[node.id];
this.getChildrenCache[node.id] = children;
// Check for structure changes...
if (children && oldChildren && (children.length !== oldChildren.length || !children.every(function (child, i) {
return child.id === oldChildren[i].id;
}))) {
// We need to update the entire branch if the structure has changed.
this.getBranchChildrenIds(children).forEach(function (id) {
return delete _this2.rowRenderCache[id];
});
}
}

@@ -149,2 +163,22 @@ }

}, {
key: 'getBranchChildrenIds',
value: function () {
function getBranchChildrenIds(children) {
var _this3 = this;
var arr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
if (!children) {
return arr;
}
children.forEach(function (child) {
arr.push(child.id);
_this3.getBranchChildrenIds(_this3.getChildrenCache[child.id], arr);
});
return arr;
}
return getBranchChildrenIds;
}()
}, {
key: 'componentWillMount',

@@ -684,3 +718,3 @@ value: function () {

function renderChildren(props, state, parent, indexesToRender) {
var _this2 = this;
var _this4 = this;

@@ -690,7 +724,7 @@ var nodes = [];

parent.children.forEach(function (index) {
var child = _this2.nodes[index];
var child = _this4.nodes[index];
if (indexesToRender.has(index)) {
if (child.children && child.children.length > 0) {
nodes.push(_this2.renderChildWithChildren(props, state, child, top, indexesToRender));
nodes.push(_this4.renderChildWithChildren(props, state, child, top, indexesToRender));
} else {

@@ -705,7 +739,7 @@ // Sticky nodes will need a container so that their top is correct. The sticky node itself will have a top

key: 'rv-node-' + child.id,
style: _this2.getChildContainerStyle(child, top) },
_this2.renderNode(props, state, child, _this2.getClientNodeStyle(child))
style: _this4.getChildContainerStyle(child, top) },
_this4.renderNode(props, state, child, _this4.getClientNodeStyle(child))
));
} else {
nodes.push(_this2.renderNode(props, state, child, _this2.getClientLeafNodeStyle(child, top)));
nodes.push(_this4.renderNode(props, state, child, _this4.getClientLeafNodeStyle(child, top)));
}

@@ -895,3 +929,3 @@ }

function render() {
var _this3 = this;
var _this5 = this;

@@ -910,3 +944,3 @@ var style = { overflow: 'auto', position: 'relative' };

function ref(elem) {
return _this3.elem = elem;
return _this5.elem = elem;
}

@@ -913,0 +947,0 @@

@@ -89,2 +89,5 @@ 'use strict';

var isLastChild = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
var _this2 = this;
var parentIndex = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : undefined;

@@ -125,5 +128,16 @@ var context = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : { totalHeight: 0 };

// itself has changed.
if (children === undefined || this.getChildrenCache[node.id] !== children) {
var oldChildren = this.getChildrenCache[node.id];
if (children === undefined || oldChildren !== children) {
delete this.rowRenderCache[node.id];
this.getChildrenCache[node.id] = children;
// Check for structure changes...
if (children && oldChildren && (children.length !== oldChildren.length || !children.every(function (child, i) {
return child.id === oldChildren[i].id;
}))) {
// We need to update the entire branch if the structure has changed.
this.getBranchChildrenIds(children).forEach(function (id) {
return delete _this2.rowRenderCache[id];
});
}
}

@@ -149,2 +163,22 @@ }

}, {
key: 'getBranchChildrenIds',
value: function () {
function getBranchChildrenIds(children) {
var _this3 = this;
var arr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
if (!children) {
return arr;
}
children.forEach(function (child) {
arr.push(child.id);
_this3.getBranchChildrenIds(_this3.getChildrenCache[child.id], arr);
});
return arr;
}
return getBranchChildrenIds;
}()
}, {
key: 'componentWillMount',

@@ -684,3 +718,3 @@ value: function () {

function renderChildren(props, state, parent, indexesToRender) {
var _this2 = this;
var _this4 = this;

@@ -690,7 +724,7 @@ var nodes = [];

parent.children.forEach(function (index) {
var child = _this2.nodes[index];
var child = _this4.nodes[index];
if (indexesToRender.has(index)) {
if (child.children && child.children.length > 0) {
nodes.push(_this2.renderChildWithChildren(props, state, child, top, indexesToRender));
nodes.push(_this4.renderChildWithChildren(props, state, child, top, indexesToRender));
} else {

@@ -705,7 +739,7 @@ // Sticky nodes will need a container so that their top is correct. The sticky node itself will have a top

key: 'rv-node-' + child.id,
style: _this2.getChildContainerStyle(child, top) },
_this2.renderNode(props, state, child, _this2.getClientNodeStyle(child))
style: _this4.getChildContainerStyle(child, top) },
_this4.renderNode(props, state, child, _this4.getClientNodeStyle(child))
));
} else {
nodes.push(_this2.renderNode(props, state, child, _this2.getClientLeafNodeStyle(child, top)));
nodes.push(_this4.renderNode(props, state, child, _this4.getClientLeafNodeStyle(child, top)));
}

@@ -895,3 +929,3 @@ }

function render() {
var _this3 = this;
var _this5 = this;

@@ -910,3 +944,3 @@ var style = { overflow: 'auto', position: 'relative' };

function ref(elem) {
return _this3.elem = elem;
return _this5.elem = elem;
}

@@ -913,0 +947,0 @@

2

package.json
{
"name": "react-virtualized-sticky-tree",
"description": "A React component for efficiently rendering tree like structures with support for position: sticky",
"version": "2.1.14",
"version": "2.1.15",
"author": "Marc McIntyre <marchaos@gmail.com>",

@@ -6,0 +6,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc