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

rc-tree-select

Package Overview
Dependencies
Maintainers
1
Versions
264
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-tree-select - npm Package Compare versions

Comparing version 0.3.6 to 0.4.0

24

lib/Select.js

@@ -245,3 +245,3 @@ 'use strict';

var check = info.event === 'check';
if (!check && !info.selected) {
if (!check && typeof info.selected === 'boolean' && !info.selected) {
this.onDeselect(info);

@@ -275,4 +275,6 @@ // return;

}
value = [selectedValue];
label = [selectedLabel];
value = !check ? [selectedValue] : [].concat(_toConsumableArray(info.checkedKeys));
label = !check ? [selectedLabel] : info.allCheckedNodesKeys.map(function (i) {
return _this.getLabelFromOption(i.node);
});
this.setOpenState(false);

@@ -475,2 +477,14 @@ }

isValueChange: function isValueChange(value) {
var sv = this.state.value;
if (typeof sv === 'string') {
sv = [sv];
}
if (value.length !== sv.length || !value.every(function (val, index) {
return sv[index] === val;
})) {
return true;
}
},
fireChange: function fireChange(value, label) {

@@ -483,3 +497,5 @@ var props = this.props;

}
props.onChange(this.getVLForOnChange(value), this.getVLForOnChange(label));
if (this.isValueChange(value)) {
props.onChange(this.getVLForOnChange(value), this.getVLForOnChange(label), [].concat(_toConsumableArray(this.state.value)));
}
},

@@ -486,0 +502,0 @@ renderTopControlNode: function renderTopControlNode() {

4

lib/util.js

@@ -94,4 +94,4 @@ 'use strict';

if (item.pos === nodePos || nArr.length > iArr.length && isInclude(iArr, nArr) || nArr.length < iArr.length && isInclude(nArr, iArr)) {
// 过滤掉 非父级节点 和 所有子节点。
// 因为 node节点 不选时,其 非父级节点 和 所有子节点 都不选。
// 过滤掉 父级节点 和 所有子节点。
// 因为 node节点 不选时,其 父级节点 和 所有子节点 都不选。
return;

@@ -98,0 +98,0 @@ }

{
"name": "rc-tree-select",
"version": "0.3.6",
"version": "0.4.0",
"description": "tree-select ui component for react",

@@ -5,0 +5,0 @@ "keywords": [

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