Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rc-tree

Package Overview
Dependencies
Maintainers
10
Versions
308
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-tree - npm Package Compare versions

Comparing version 4.1.4 to 4.1.5

1

es/DropIndicator.d.ts

@@ -1,2 +0,1 @@

/// <reference types="react" />
export default function DropIndicator({ dropPosition, dropLevelOffset, indent, }: {

@@ -3,0 +2,0 @@ dropPosition: -1 | 0 | 1;

@@ -1,2 +0,1 @@

/// <reference types="react" />
interface IndentProps {

@@ -3,0 +2,0 @@ prefixCls: string;

1

es/TreeNode.d.ts

@@ -71,2 +71,3 @@ import * as React from 'react';

isSelectable(): boolean;
renderSwitcherIconDom: (isLeaf: boolean) => any;
renderSwitcher: () => JSX.Element;

@@ -73,0 +74,0 @@ renderCheckbox: () => JSX.Element;

@@ -228,2 +228,16 @@ import _extends from "@babel/runtime/helpers/esm/extends";

}
};
_this.renderSwitcherIconDom = function (isLeaf) {
var switcherIconFromProps = _this.props.switcherIcon;
var switcherIconFromCtx = _this.props.context.switcherIcon;
var switcherIcon = switcherIconFromProps || switcherIconFromCtx; // if switcherIconDom is null, no render switcher span
if (typeof switcherIcon === 'function') {
return switcherIcon(_objectSpread(_objectSpread({}, _this.props), {}, {
isLeaf: isLeaf
}));
}
return switcherIcon;
}; // Switcher

@@ -233,25 +247,22 @@

_this.renderSwitcher = function () {
var _this$props4 = _this.props,
expanded = _this$props4.expanded,
switcherIconFromProps = _this$props4.switcherIcon;
var _this$props$context2 = _this.props.context,
prefixCls = _this$props$context2.prefixCls,
switcherIconFromCtx = _this$props$context2.switcherIcon;
var switcherIcon = switcherIconFromProps || switcherIconFromCtx;
var expanded = _this.props.expanded;
var prefixCls = _this.props.context.prefixCls;
if (_this.isLeaf()) {
return /*#__PURE__*/React.createElement("span", {
// if switcherIconDom is null, no render switcher span
var _switcherIconDom = _this.renderSwitcherIconDom(true);
return _switcherIconDom !== false ? /*#__PURE__*/React.createElement("span", {
className: classNames("".concat(prefixCls, "-switcher"), "".concat(prefixCls, "-switcher-noop"))
}, typeof switcherIcon === 'function' ? switcherIcon(_objectSpread(_objectSpread({}, _this.props), {}, {
isLeaf: true
})) : switcherIcon);
}, _switcherIconDom) : null;
}
var switcherCls = classNames("".concat(prefixCls, "-switcher"), "".concat(prefixCls, "-switcher_").concat(expanded ? ICON_OPEN : ICON_CLOSE));
return /*#__PURE__*/React.createElement("span", {
var switcherIconDom = _this.renderSwitcherIconDom(false);
return switcherIconDom !== false ? /*#__PURE__*/React.createElement("span", {
onClick: _this.onExpand,
className: switcherCls
}, typeof switcherIcon === 'function' ? switcherIcon(_objectSpread(_objectSpread({}, _this.props), {}, {
isLeaf: false
})) : switcherIcon);
}, switcherIconDom) : null;
}; // Checkbox

@@ -261,6 +272,6 @@

_this.renderCheckbox = function () {
var _this$props5 = _this.props,
checked = _this$props5.checked,
halfChecked = _this$props5.halfChecked,
disableCheckbox = _this$props5.disableCheckbox;
var _this$props4 = _this.props,
checked = _this$props4.checked,
halfChecked = _this$props4.halfChecked,
disableCheckbox = _this$props4.disableCheckbox;
var prefixCls = _this.props.context.prefixCls;

@@ -292,15 +303,15 @@

var dragNodeHighlight = _this.state.dragNodeHighlight;
var _this$props6 = _this.props,
title = _this$props6.title,
selected = _this$props6.selected,
icon = _this$props6.icon,
loading = _this$props6.loading,
data = _this$props6.data;
var _this$props$context3 = _this.props.context,
prefixCls = _this$props$context3.prefixCls,
showIcon = _this$props$context3.showIcon,
treeIcon = _this$props$context3.icon,
draggable = _this$props$context3.draggable,
loadData = _this$props$context3.loadData,
titleRender = _this$props$context3.titleRender;
var _this$props5 = _this.props,
title = _this$props5.title,
selected = _this$props5.selected,
icon = _this$props5.icon,
loading = _this$props5.loading,
data = _this$props5.data;
var _this$props$context2 = _this.props.context,
prefixCls = _this$props$context2.prefixCls,
showIcon = _this$props$context2.showIcon,
treeIcon = _this$props$context2.icon,
draggable = _this$props$context2.draggable,
loadData = _this$props$context2.loadData,
titleRender = _this$props$context2.titleRender;

@@ -353,14 +364,14 @@ var disabled = _this.isDisabled();

_this.renderDropIndicator = function () {
var _this$props7 = _this.props,
disabled = _this$props7.disabled,
eventKey = _this$props7.eventKey;
var _this$props$context4 = _this.props.context,
draggable = _this$props$context4.draggable,
dropLevelOffset = _this$props$context4.dropLevelOffset,
dropPosition = _this$props$context4.dropPosition,
prefixCls = _this$props$context4.prefixCls,
indent = _this$props$context4.indent,
dropIndicatorRender = _this$props$context4.dropIndicatorRender,
dragOverNodeKey = _this$props$context4.dragOverNodeKey,
direction = _this$props$context4.direction;
var _this$props6 = _this.props,
disabled = _this$props6.disabled,
eventKey = _this$props6.eventKey;
var _this$props$context3 = _this.props.context,
draggable = _this$props$context3.draggable,
dropLevelOffset = _this$props$context3.dropLevelOffset,
dropPosition = _this$props$context3.dropPosition,
prefixCls = _this$props$context3.prefixCls,
indent = _this$props$context3.indent,
dropIndicatorRender = _this$props$context3.dropIndicatorRender,
dragOverNodeKey = _this$props$context3.dragOverNodeKey,
direction = _this$props$context3.direction;
var mergedDraggable = draggable !== false; // allowDrop is calculated in Tree.tsx, there is no need for calc it here

@@ -409,30 +420,30 @@

var _this$props8 = this.props,
eventKey = _this$props8.eventKey,
className = _this$props8.className,
style = _this$props8.style,
dragOver = _this$props8.dragOver,
dragOverGapTop = _this$props8.dragOverGapTop,
dragOverGapBottom = _this$props8.dragOverGapBottom,
isLeaf = _this$props8.isLeaf,
isStart = _this$props8.isStart,
isEnd = _this$props8.isEnd,
expanded = _this$props8.expanded,
selected = _this$props8.selected,
checked = _this$props8.checked,
halfChecked = _this$props8.halfChecked,
loading = _this$props8.loading,
domRef = _this$props8.domRef,
active = _this$props8.active,
data = _this$props8.data,
onMouseMove = _this$props8.onMouseMove,
otherProps = _objectWithoutProperties(_this$props8, ["eventKey", "className", "style", "dragOver", "dragOverGapTop", "dragOverGapBottom", "isLeaf", "isStart", "isEnd", "expanded", "selected", "checked", "halfChecked", "loading", "domRef", "active", "data", "onMouseMove"]);
var _this$props7 = this.props,
eventKey = _this$props7.eventKey,
className = _this$props7.className,
style = _this$props7.style,
dragOver = _this$props7.dragOver,
dragOverGapTop = _this$props7.dragOverGapTop,
dragOverGapBottom = _this$props7.dragOverGapBottom,
isLeaf = _this$props7.isLeaf,
isStart = _this$props7.isStart,
isEnd = _this$props7.isEnd,
expanded = _this$props7.expanded,
selected = _this$props7.selected,
checked = _this$props7.checked,
halfChecked = _this$props7.halfChecked,
loading = _this$props7.loading,
domRef = _this$props7.domRef,
active = _this$props7.active,
data = _this$props7.data,
onMouseMove = _this$props7.onMouseMove,
otherProps = _objectWithoutProperties(_this$props7, ["eventKey", "className", "style", "dragOver", "dragOverGapTop", "dragOverGapBottom", "isLeaf", "isStart", "isEnd", "expanded", "selected", "checked", "halfChecked", "loading", "domRef", "active", "data", "onMouseMove"]);
var _this$props$context5 = this.props.context,
prefixCls = _this$props$context5.prefixCls,
filterTreeNode = _this$props$context5.filterTreeNode,
draggable = _this$props$context5.draggable,
keyEntities = _this$props$context5.keyEntities,
dropContainerKey = _this$props$context5.dropContainerKey,
dropTargetKey = _this$props$context5.dropTargetKey;
var _this$props$context4 = this.props.context,
prefixCls = _this$props$context4.prefixCls,
filterTreeNode = _this$props$context4.filterTreeNode,
draggable = _this$props$context4.draggable,
keyEntities = _this$props$context4.keyEntities,
dropContainerKey = _this$props$context4.dropContainerKey,
dropTargetKey = _this$props$context4.dropTargetKey;
var disabled = this.isDisabled();

@@ -439,0 +450,0 @@ var dataOrAriaAttributeProps = getDataAndAria(otherProps);

@@ -1,2 +0,1 @@

/// <reference types="react" />
export default function DropIndicator({ dropPosition, dropLevelOffset, indent, }: {

@@ -3,0 +2,0 @@ dropPosition: -1 | 0 | 1;

@@ -1,2 +0,1 @@

/// <reference types="react" />
interface IndentProps {

@@ -3,0 +2,0 @@ prefixCls: string;

@@ -71,2 +71,3 @@ import * as React from 'react';

isSelectable(): boolean;
renderSwitcherIconDom: (isLeaf: boolean) => any;
renderSwitcher: () => JSX.Element;

@@ -73,0 +74,0 @@ renderCheckbox: () => JSX.Element;

@@ -253,2 +253,16 @@ "use strict";

}
};
_this.renderSwitcherIconDom = function (isLeaf) {
var switcherIconFromProps = _this.props.switcherIcon;
var switcherIconFromCtx = _this.props.context.switcherIcon;
var switcherIcon = switcherIconFromProps || switcherIconFromCtx; // if switcherIconDom is null, no render switcher span
if (typeof switcherIcon === 'function') {
return switcherIcon((0, _objectSpread2.default)((0, _objectSpread2.default)({}, _this.props), {}, {
isLeaf: isLeaf
}));
}
return switcherIcon;
}; // Switcher

@@ -258,25 +272,22 @@

_this.renderSwitcher = function () {
var _this$props4 = _this.props,
expanded = _this$props4.expanded,
switcherIconFromProps = _this$props4.switcherIcon;
var _this$props$context2 = _this.props.context,
prefixCls = _this$props$context2.prefixCls,
switcherIconFromCtx = _this$props$context2.switcherIcon;
var switcherIcon = switcherIconFromProps || switcherIconFromCtx;
var expanded = _this.props.expanded;
var prefixCls = _this.props.context.prefixCls;
if (_this.isLeaf()) {
return /*#__PURE__*/React.createElement("span", {
// if switcherIconDom is null, no render switcher span
var _switcherIconDom = _this.renderSwitcherIconDom(true);
return _switcherIconDom !== false ? /*#__PURE__*/React.createElement("span", {
className: (0, _classnames.default)("".concat(prefixCls, "-switcher"), "".concat(prefixCls, "-switcher-noop"))
}, typeof switcherIcon === 'function' ? switcherIcon((0, _objectSpread2.default)((0, _objectSpread2.default)({}, _this.props), {}, {
isLeaf: true
})) : switcherIcon);
}, _switcherIconDom) : null;
}
var switcherCls = (0, _classnames.default)("".concat(prefixCls, "-switcher"), "".concat(prefixCls, "-switcher_").concat(expanded ? ICON_OPEN : ICON_CLOSE));
return /*#__PURE__*/React.createElement("span", {
var switcherIconDom = _this.renderSwitcherIconDom(false);
return switcherIconDom !== false ? /*#__PURE__*/React.createElement("span", {
onClick: _this.onExpand,
className: switcherCls
}, typeof switcherIcon === 'function' ? switcherIcon((0, _objectSpread2.default)((0, _objectSpread2.default)({}, _this.props), {}, {
isLeaf: false
})) : switcherIcon);
}, switcherIconDom) : null;
}; // Checkbox

@@ -286,6 +297,6 @@

_this.renderCheckbox = function () {
var _this$props5 = _this.props,
checked = _this$props5.checked,
halfChecked = _this$props5.halfChecked,
disableCheckbox = _this$props5.disableCheckbox;
var _this$props4 = _this.props,
checked = _this$props4.checked,
halfChecked = _this$props4.halfChecked,
disableCheckbox = _this$props4.disableCheckbox;
var prefixCls = _this.props.context.prefixCls;

@@ -317,15 +328,15 @@

var dragNodeHighlight = _this.state.dragNodeHighlight;
var _this$props6 = _this.props,
title = _this$props6.title,
selected = _this$props6.selected,
icon = _this$props6.icon,
loading = _this$props6.loading,
data = _this$props6.data;
var _this$props$context3 = _this.props.context,
prefixCls = _this$props$context3.prefixCls,
showIcon = _this$props$context3.showIcon,
treeIcon = _this$props$context3.icon,
draggable = _this$props$context3.draggable,
loadData = _this$props$context3.loadData,
titleRender = _this$props$context3.titleRender;
var _this$props5 = _this.props,
title = _this$props5.title,
selected = _this$props5.selected,
icon = _this$props5.icon,
loading = _this$props5.loading,
data = _this$props5.data;
var _this$props$context2 = _this.props.context,
prefixCls = _this$props$context2.prefixCls,
showIcon = _this$props$context2.showIcon,
treeIcon = _this$props$context2.icon,
draggable = _this$props$context2.draggable,
loadData = _this$props$context2.loadData,
titleRender = _this$props$context2.titleRender;

@@ -378,14 +389,14 @@ var disabled = _this.isDisabled();

_this.renderDropIndicator = function () {
var _this$props7 = _this.props,
disabled = _this$props7.disabled,
eventKey = _this$props7.eventKey;
var _this$props$context4 = _this.props.context,
draggable = _this$props$context4.draggable,
dropLevelOffset = _this$props$context4.dropLevelOffset,
dropPosition = _this$props$context4.dropPosition,
prefixCls = _this$props$context4.prefixCls,
indent = _this$props$context4.indent,
dropIndicatorRender = _this$props$context4.dropIndicatorRender,
dragOverNodeKey = _this$props$context4.dragOverNodeKey,
direction = _this$props$context4.direction;
var _this$props6 = _this.props,
disabled = _this$props6.disabled,
eventKey = _this$props6.eventKey;
var _this$props$context3 = _this.props.context,
draggable = _this$props$context3.draggable,
dropLevelOffset = _this$props$context3.dropLevelOffset,
dropPosition = _this$props$context3.dropPosition,
prefixCls = _this$props$context3.prefixCls,
indent = _this$props$context3.indent,
dropIndicatorRender = _this$props$context3.dropIndicatorRender,
dragOverNodeKey = _this$props$context3.dragOverNodeKey,
direction = _this$props$context3.direction;
var mergedDraggable = draggable !== false; // allowDrop is calculated in Tree.tsx, there is no need for calc it here

@@ -434,29 +445,29 @@

var _this$props8 = this.props,
eventKey = _this$props8.eventKey,
className = _this$props8.className,
style = _this$props8.style,
dragOver = _this$props8.dragOver,
dragOverGapTop = _this$props8.dragOverGapTop,
dragOverGapBottom = _this$props8.dragOverGapBottom,
isLeaf = _this$props8.isLeaf,
isStart = _this$props8.isStart,
isEnd = _this$props8.isEnd,
expanded = _this$props8.expanded,
selected = _this$props8.selected,
checked = _this$props8.checked,
halfChecked = _this$props8.halfChecked,
loading = _this$props8.loading,
domRef = _this$props8.domRef,
active = _this$props8.active,
data = _this$props8.data,
onMouseMove = _this$props8.onMouseMove,
otherProps = (0, _objectWithoutProperties2.default)(_this$props8, ["eventKey", "className", "style", "dragOver", "dragOverGapTop", "dragOverGapBottom", "isLeaf", "isStart", "isEnd", "expanded", "selected", "checked", "halfChecked", "loading", "domRef", "active", "data", "onMouseMove"]);
var _this$props$context5 = this.props.context,
prefixCls = _this$props$context5.prefixCls,
filterTreeNode = _this$props$context5.filterTreeNode,
draggable = _this$props$context5.draggable,
keyEntities = _this$props$context5.keyEntities,
dropContainerKey = _this$props$context5.dropContainerKey,
dropTargetKey = _this$props$context5.dropTargetKey;
var _this$props7 = this.props,
eventKey = _this$props7.eventKey,
className = _this$props7.className,
style = _this$props7.style,
dragOver = _this$props7.dragOver,
dragOverGapTop = _this$props7.dragOverGapTop,
dragOverGapBottom = _this$props7.dragOverGapBottom,
isLeaf = _this$props7.isLeaf,
isStart = _this$props7.isStart,
isEnd = _this$props7.isEnd,
expanded = _this$props7.expanded,
selected = _this$props7.selected,
checked = _this$props7.checked,
halfChecked = _this$props7.halfChecked,
loading = _this$props7.loading,
domRef = _this$props7.domRef,
active = _this$props7.active,
data = _this$props7.data,
onMouseMove = _this$props7.onMouseMove,
otherProps = (0, _objectWithoutProperties2.default)(_this$props7, ["eventKey", "className", "style", "dragOver", "dragOverGapTop", "dragOverGapBottom", "isLeaf", "isStart", "isEnd", "expanded", "selected", "checked", "halfChecked", "loading", "domRef", "active", "data", "onMouseMove"]);
var _this$props$context4 = this.props.context,
prefixCls = _this$props$context4.prefixCls,
filterTreeNode = _this$props$context4.filterTreeNode,
draggable = _this$props$context4.draggable,
keyEntities = _this$props$context4.keyEntities,
dropContainerKey = _this$props$context4.dropContainerKey,
dropTargetKey = _this$props$context4.dropTargetKey;
var disabled = this.isDisabled();

@@ -463,0 +474,0 @@ var dataOrAriaAttributeProps = (0, _util.getDataAndAria)(otherProps);

{
"name": "rc-tree",
"version": "4.1.4",
"version": "4.1.5",
"description": "tree ui component for react",

@@ -5,0 +5,0 @@ "engines": {

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