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

rc-tree-select

Package Overview
Dependencies
Maintainers
7
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 5.5.0 to 5.5.1

4

es/hooks/useCache.js

@@ -1,3 +0,4 @@

import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
import * as React from 'react';
/**

@@ -7,3 +8,2 @@ * This function will try to call requestIdleCallback if available to save performance.

*/
export default (function (values) {

@@ -10,0 +10,0 @@ var cacheRef = React.useRef({

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

import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
import * as React from 'react';

@@ -3,0 +3,0 @@ import { conductCheck } from "rc-tree/es/utils/conductUtil";

@@ -1,6 +0,6 @@

import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
import * as React from 'react';
import { convertDataToEntities } from "rc-tree/es/utils/treeUtil";
import warning from "rc-util/es/warning";
import { isNil } from '../utils/valueUtil';
import warning from 'rc-util/lib/warning';
import { isNil } from "../utils/valueUtil";
export default (function (treeData, fieldNames) {

@@ -7,0 +7,0 @@ return React.useMemo(function () {

@@ -1,5 +0,5 @@

import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
import * as React from 'react';
import { fillLegacyProps } from '../utils/legacyUtil';
import { fillLegacyProps } from "../utils/legacyUtil";
export default (function (treeData, searchValue, _ref) {

@@ -6,0 +6,0 @@ var treeNodeFilterProp = _ref.treeNodeFilterProp,

@@ -1,4 +0,4 @@

import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
import * as React from 'react';
import { convertChildrenToData } from '../utils/legacyUtil';
import { convertChildrenToData } from "../utils/legacyUtil";

@@ -5,0 +5,0 @@ function parseSimpleTreeData(treeData, _ref) {

@@ -1,5 +0,5 @@

import TreeSelect from './TreeSelect';
import TreeNode from './TreeNode';
import { SHOW_ALL, SHOW_CHILD, SHOW_PARENT } from './utils/strategyUtil';
import TreeSelect from "./TreeSelect";
import TreeNode from "./TreeNode";
import { SHOW_ALL, SHOW_CHILD, SHOW_PARENT } from "./utils/strategyUtil";
export { TreeNode, SHOW_ALL, SHOW_CHILD, SHOW_PARENT };
export default TreeSelect;

@@ -1,12 +0,12 @@

import _extends from "@babel/runtime/helpers/esm/extends";
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
import _extends from "@babel/runtime/helpers/extends";
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
import * as React from 'react';
import KeyCode from "rc-util/es/KeyCode";
import useMemo from "rc-util/es/hooks/useMemo";
import KeyCode from 'rc-util/lib/KeyCode';
import useMemo from 'rc-util/lib/hooks/useMemo';
import { useBaseProps } from 'rc-select';
import Tree from 'rc-tree';
import LegacyContext from './LegacyContext';
import TreeSelectContext from './TreeSelectContext';
import { getAllKeys, isCheckDisabled } from './utils/valueUtil';
import LegacyContext from "./LegacyContext";
import TreeSelectContext from "./TreeSelectContext";
import { getAllKeys, isCheckDisabled } from "./utils/valueUtil";
var HIDDEN_STYLE = {

@@ -13,0 +13,0 @@ width: 0,

@@ -0,1 +1,3 @@

/* istanbul ignore file */
/** This is a placeholder, not real render in dom */

@@ -2,0 +4,0 @@ var TreeNode = function TreeNode() {

@@ -1,7 +0,7 @@

import _extends from "@babel/runtime/helpers/esm/extends";
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
import _typeof from "@babel/runtime/helpers/esm/typeof";
import _extends from "@babel/runtime/helpers/extends";
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
import _typeof from "@babel/runtime/helpers/typeof";
var _excluded = ["id", "prefixCls", "value", "defaultValue", "onChange", "onSelect", "onDeselect", "searchValue", "inputValue", "onSearch", "autoClearSearchValue", "filterTreeNode", "treeNodeFilterProp", "showCheckedStrategy", "treeNodeLabelProp", "multiple", "treeCheckable", "treeCheckStrictly", "labelInValue", "fieldNames", "treeDataSimpleMode", "treeData", "children", "loadData", "treeLoadedKeys", "onTreeLoad", "treeDefaultExpandAll", "treeExpandedKeys", "treeDefaultExpandedKeys", "onTreeExpand", "treeExpandAction", "virtual", "listHeight", "listItemHeight", "onDropdownVisibleChange", "dropdownMatchSelectWidth", "treeLine", "treeIcon", "showTreeIcon", "switcherIcon", "treeMotion"];

@@ -11,19 +11,19 @@ import * as React from 'react';

import { conductCheck } from "rc-tree/es/utils/conductUtil";
import useId from "rc-select/es/hooks/useId";
import useMergedState from "rc-util/es/hooks/useMergedState";
import OptionList from './OptionList';
import TreeNode from './TreeNode';
import { formatStrategyValues, SHOW_ALL, SHOW_PARENT, SHOW_CHILD } from './utils/strategyUtil';
import TreeSelectContext from './TreeSelectContext';
import LegacyContext from './LegacyContext';
import useTreeData from './hooks/useTreeData';
import { toArray, fillFieldNames, isNil } from './utils/valueUtil';
import useCache from './hooks/useCache';
import useRefFunc from './hooks/useRefFunc';
import useDataEntities from './hooks/useDataEntities';
import { fillAdditionalInfo, fillLegacyProps } from './utils/legacyUtil';
import useCheckedKeys from './hooks/useCheckedKeys';
import useFilterTreeData from './hooks/useFilterTreeData';
import warningProps from './utils/warningPropsUtil';
import warning from "rc-util/es/warning";
import useId from 'rc-select/lib/hooks/useId';
import useMergedState from 'rc-util/lib/hooks/useMergedState';
import OptionList from "./OptionList";
import TreeNode from "./TreeNode";
import { formatStrategyValues, SHOW_ALL, SHOW_PARENT, SHOW_CHILD } from "./utils/strategyUtil";
import TreeSelectContext from "./TreeSelectContext";
import LegacyContext from "./LegacyContext";
import useTreeData from "./hooks/useTreeData";
import { toArray, fillFieldNames, isNil } from "./utils/valueUtil";
import useCache from "./hooks/useCache";
import useRefFunc from "./hooks/useRefFunc";
import useDataEntities from "./hooks/useDataEntities";
import { fillAdditionalInfo, fillLegacyProps } from "./utils/legacyUtil";
import useCheckedKeys from "./hooks/useCheckedKeys";
import useFilterTreeData from "./hooks/useFilterTreeData";
import warningProps from "./utils/warningPropsUtil";
import warning from 'rc-util/lib/warning';

@@ -89,4 +89,12 @@ function isRawValue(value) {

var mergedLabelInValue = treeCheckStrictly || labelInValue;
var mergedMultiple = mergedCheckable || multiple; // ========================== Warning ===========================
var mergedMultiple = mergedCheckable || multiple;
var _useMergedState = useMergedState(defaultValue, {
value: value
}),
_useMergedState2 = _slicedToArray(_useMergedState, 2),
internalValue = _useMergedState2[0],
setInternalValue = _useMergedState2[1]; // ========================== Warning ===========================
if (process.env.NODE_ENV !== 'production') {

@@ -101,5 +109,7 @@ warningProps(props);

/* eslint-disable react-hooks/exhaustive-deps */
[JSON.stringify(fieldNames)]); // =========================== Search ===========================
[JSON.stringify(fieldNames)]
/* eslint-enable react-hooks/exhaustive-deps */
); // =========================== Search ===========================
var _useMergedState = useMergedState('', {
var _useMergedState3 = useMergedState('', {
value: searchValue !== undefined ? searchValue : inputValue,

@@ -110,5 +120,5 @@ postState: function postState(search) {

}),
_useMergedState2 = _slicedToArray(_useMergedState, 2),
mergedSearchValue = _useMergedState2[0],
setSearchValue = _useMergedState2[1];
_useMergedState4 = _slicedToArray(_useMergedState3, 2),
mergedSearchValue = _useMergedState4[0],
setSearchValue = _useMergedState4[1];

@@ -200,2 +210,8 @@ var onInternalSearch = function onInternalSearch(searchText) {

rawDisabled = entity.node.disabled;
} else if (rawLabel === undefined) {
// We try to find in current `labelInValue` value
var labelInValueItem = toLabeledValues(internalValue).find(function (labeledItem) {
return labeledItem.value === rawValue;
});
rawLabel = labelInValueItem.label;
}

@@ -210,11 +226,4 @@

});
}, [valueEntities, getLabel, toLabeledValues]); // =========================== Values ===========================
}, [valueEntities, getLabel, toLabeledValues, internalValue]); // =========================== Values ===========================
var _useMergedState3 = useMergedState(defaultValue, {
value: value
}),
_useMergedState4 = _slicedToArray(_useMergedState3, 2),
internalValue = _useMergedState4[0],
setInternalValue = _useMergedState4[1];
var rawMixedLabeledValues = React.useMemo(function () {

@@ -221,0 +230,0 @@ return toLabeledValues(internalValue);

@@ -1,8 +0,8 @@

import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["children", "value"];
import * as React from 'react';
import toArray from "rc-util/es/Children/toArray";
import warning from "rc-util/es/warning";
import TreeNode from '../TreeNode';
import toArray from 'rc-util/lib/Children/toArray';
import warning from 'rc-util/lib/warning';
import TreeNode from "../TreeNode";
export function convertChildrenToData(nodes) {

@@ -14,7 +14,8 @@ return toArray(nodes).map(function (node) {

var key = node.key,
_node$props = node.props,
children = _node$props.children,
value = _node$props.value,
restProps = _objectWithoutProperties(_node$props, _excluded);
var _ref = node,
key = _ref.key,
_ref$props = _ref.props,
children = _ref$props.children,
value = _ref$props.value,
restProps = _objectWithoutProperties(_ref$props, _excluded);

@@ -100,5 +101,5 @@ var data = _objectSpread({

nodeList.sort(function (_ref, _ref2) {
var val1 = _ref.node.props.value;
var val2 = _ref2.node.props.value;
nodeList.sort(function (_ref2, _ref3) {
var val1 = _ref2.node.props.value;
var val2 = _ref3.node.props.value;
var index1 = checkedValues.indexOf(val1);

@@ -127,4 +128,4 @@ var index2 = checkedValues.indexOf(val2);

return nodeList.map(function (_ref3) {
var node = _ref3.node;
return nodeList.map(function (_ref4) {
var node = _ref4.node;
return node;

@@ -131,0 +132,0 @@ });

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

import { isCheckDisabled } from './valueUtil';
import { isCheckDisabled } from "./valueUtil";
export var SHOW_ALL = 'SHOW_ALL';

@@ -3,0 +3,0 @@ export var SHOW_PARENT = 'SHOW_PARENT';

@@ -1,4 +0,4 @@

import _typeof from "@babel/runtime/helpers/esm/typeof";
import warning from "rc-util/es/warning";
import { toArray } from './valueUtil';
import _typeof from "@babel/runtime/helpers/typeof";
import warning from 'rc-util/lib/warning';
import { toArray } from "./valueUtil";

@@ -5,0 +5,0 @@ function warningProps(props) {

@@ -8,2 +8,4 @@ "use strict";

/* istanbul ignore file */
/** This is a placeholder, not real render in dom */

@@ -10,0 +12,0 @@ var TreeNode = function TreeNode() {

@@ -128,4 +128,12 @@ "use strict";

var mergedLabelInValue = treeCheckStrictly || labelInValue;
var mergedMultiple = mergedCheckable || multiple; // ========================== Warning ===========================
var mergedMultiple = mergedCheckable || multiple;
var _useMergedState = (0, _useMergedState5.default)(defaultValue, {
value: value
}),
_useMergedState2 = (0, _slicedToArray2.default)(_useMergedState, 2),
internalValue = _useMergedState2[0],
setInternalValue = _useMergedState2[1]; // ========================== Warning ===========================
if (process.env.NODE_ENV !== 'production') {

@@ -140,5 +148,7 @@ (0, _warningPropsUtil.default)(props);

/* eslint-disable react-hooks/exhaustive-deps */
[JSON.stringify(fieldNames)]); // =========================== Search ===========================
[JSON.stringify(fieldNames)]
/* eslint-enable react-hooks/exhaustive-deps */
); // =========================== Search ===========================
var _useMergedState = (0, _useMergedState5.default)('', {
var _useMergedState3 = (0, _useMergedState5.default)('', {
value: searchValue !== undefined ? searchValue : inputValue,

@@ -149,5 +159,5 @@ postState: function postState(search) {

}),
_useMergedState2 = (0, _slicedToArray2.default)(_useMergedState, 2),
mergedSearchValue = _useMergedState2[0],
setSearchValue = _useMergedState2[1];
_useMergedState4 = (0, _slicedToArray2.default)(_useMergedState3, 2),
mergedSearchValue = _useMergedState4[0],
setSearchValue = _useMergedState4[1];

@@ -239,2 +249,8 @@ var onInternalSearch = function onInternalSearch(searchText) {

rawDisabled = entity.node.disabled;
} else if (rawLabel === undefined) {
// We try to find in current `labelInValue` value
var labelInValueItem = toLabeledValues(internalValue).find(function (labeledItem) {
return labeledItem.value === rawValue;
});
rawLabel = labelInValueItem.label;
}

@@ -249,11 +265,4 @@

});
}, [valueEntities, getLabel, toLabeledValues]); // =========================== Values ===========================
}, [valueEntities, getLabel, toLabeledValues, internalValue]); // =========================== Values ===========================
var _useMergedState3 = (0, _useMergedState5.default)(defaultValue, {
value: value
}),
_useMergedState4 = (0, _slicedToArray2.default)(_useMergedState3, 2),
internalValue = _useMergedState4[0],
setInternalValue = _useMergedState4[1];
var rawMixedLabeledValues = React.useMemo(function () {

@@ -260,0 +269,0 @@ return toLabeledValues(internalValue);

@@ -38,7 +38,8 @@ "use strict";

var key = node.key,
_node$props = node.props,
children = _node$props.children,
value = _node$props.value,
restProps = (0, _objectWithoutProperties2.default)(_node$props, _excluded);
var _ref = node,
key = _ref.key,
_ref$props = _ref.props,
children = _ref$props.children,
value = _ref$props.value,
restProps = (0, _objectWithoutProperties2.default)(_ref$props, _excluded);
var data = (0, _objectSpread2.default)({

@@ -124,5 +125,5 @@ key: key,

nodeList.sort(function (_ref, _ref2) {
var val1 = _ref.node.props.value;
var val2 = _ref2.node.props.value;
nodeList.sort(function (_ref2, _ref3) {
var val1 = _ref2.node.props.value;
var val2 = _ref3.node.props.value;
var index1 = checkedValues.indexOf(val1);

@@ -151,4 +152,4 @@ var index2 = checkedValues.indexOf(val2);

return nodeList.map(function (_ref3) {
var node = _ref3.node;
return nodeList.map(function (_ref4) {
var node = _ref4.node;
return node;

@@ -155,0 +156,0 @@ });

{
"name": "rc-tree-select",
"version": "5.5.0",
"version": "5.5.1",
"description": "tree-select ui component for react",

@@ -39,3 +39,3 @@ "keywords": [

"prettier": "prettier '{src,tests}/**/*.{ts,tsx}' 'tests/**/*.js' --write",
"test": "father test",
"test": "rc-test",
"now-build": "npm run build"

@@ -48,2 +48,3 @@ },

"devDependencies": {
"@testing-library/react": "^12.0.0",
"@types/jest": "^26.0.5",

@@ -53,2 +54,3 @@ "@types/react": "^16.8.19",

"@types/warning": "^3.0.0",
"@umijs/fabric": "^3.0.0",
"cross-env": "^7.0.2",

@@ -60,3 +62,3 @@ "dumi": "^1.1.12",

"eslint": "^7.1.0",
"father": "^2.13.2",
"father": "^4.0.0",
"glob": "^7.1.6",

@@ -66,2 +68,3 @@ "np": "^6.2.0",

"rc-field-form": "^1.0.0",
"rc-test": "^7.0.4",
"rc-trigger": "^4.0.0",

@@ -68,0 +71,0 @@ "rc-virtual-list": "^1.1.0",

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