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

rc-tree-select

Package Overview
Dependencies
Maintainers
6
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 4.3.0 to 4.3.1

4

es/Context.d.ts
import * as React from 'react';
import { IconType } from 'rc-tree/lib/interface';
import { Key, LegacyDataNode } from './interface';
import type { IconType } from 'rc-tree/lib/interface';
import type { Key, LegacyDataNode } from './interface';
interface ContextProps {

@@ -5,0 +5,0 @@ checkable: boolean | React.ReactNode;

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

import { FlattenDataNode } from '../interface';
import type { FlattenDataNode, Key } from '../interface';
/**

@@ -6,2 +6,2 @@ * Return cached Key Value map with DataNode.

*/
export default function useKeyValueMap(flattenOptions: FlattenDataNode[]): Map<string | number, FlattenDataNode>[];
export default function useKeyValueMap(flattenOptions: FlattenDataNode[]): Map<Key, FlattenDataNode>[];

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

import { FlattenDataNode, Key, RawValueType } from '../interface';
import type { FlattenDataNode, Key, RawValueType } from '../interface';
export declare type SkipType = null | 'select' | 'checkbox';

@@ -3,0 +3,0 @@ export declare function isDisabled(dataNode: FlattenDataNode, skipType: SkipType): boolean;

import * as React from 'react';
import { DefaultValueType } from 'rc-select/lib/interface/generator';
import { DataEntity } from 'rc-tree/lib/interface';
import { RawValueType, FlattenDataNode, Key, LabelValueType, DataNode } from '../interface';
import { SkipType } from './useKeyValueMapping';
import { CheckedStrategy } from '../utils/strategyUtil';
import type { DefaultValueType } from 'rc-select/lib/interface/generator';
import type { DataEntity } from 'rc-tree/lib/interface';
import type { RawValueType, FlattenDataNode, Key, LabelValueType, DataNode } from '../interface';
import type { SkipType } from './useKeyValueMapping';
import type { CheckedStrategy } from '../utils/strategyUtil';
interface Config {

@@ -8,0 +8,0 @@ treeConduction: boolean;

import * as React from 'react';
import { DataNode, InnerDataNode, SimpleModeConfig } from '../interface';
import type { DataNode, InnerDataNode, SimpleModeConfig } from '../interface';
/**

@@ -4,0 +4,0 @@ * Convert `treeData` or `children` into formatted `treeData`.

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

import * as React from 'react';
import type * as React from 'react';
export declare type SelectSource = 'option' | 'selection' | 'input' | 'clear';

@@ -3,0 +3,0 @@ export declare type Key = string | number;

import * as React from 'react';
import { RefOptionListProps } from 'rc-select/lib/OptionList';
import { FlattenDataNode, RawValueType, DataNode } from './interface';
import type { RefOptionListProps } from 'rc-select/lib/OptionList';
import type { ScrollTo } from 'rc-tree/lib/interface';
import type { FlattenDataNode, RawValueType, DataNode } from './interface';
export interface OptionListProps<OptionsType extends object[]> {

@@ -29,3 +30,6 @@ prefixCls: string;

}
declare const RefOptionList: React.ForwardRefExoticComponent<OptionListProps<DataNode[]> & React.RefAttributes<RefOptionListProps>>;
declare type ReviseRefOptionListProps = Omit<RefOptionListProps, 'scrollTo'> & {
scrollTo: ScrollTo;
};
declare const RefOptionList: React.ForwardRefExoticComponent<OptionListProps<DataNode[]> & React.RefAttributes<ReviseRefOptionListProps>>;
export default RefOptionList;

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

import _extends from "@babel/runtime/helpers/esm/extends";
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";

@@ -173,5 +174,8 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";

React.useImperativeHandle(ref, function () {
var _treeRef$current2;
return {
scrollTo: (_treeRef$current2 = treeRef.current) === null || _treeRef$current2 === void 0 ? void 0 : _treeRef$current2.scrollTo,
onKeyDown: function onKeyDown(event) {
var _treeRef$current2;
var _treeRef$current3;

@@ -186,3 +190,3 @@ var which = event.which;

case KeyCode.RIGHT:
(_treeRef$current2 = treeRef.current) === null || _treeRef$current2 === void 0 ? void 0 : _treeRef$current2.onKeyDown(event);
(_treeRef$current3 = treeRef.current) === null || _treeRef$current3 === void 0 ? void 0 : _treeRef$current3.onKeyDown(event);
break;

@@ -193,3 +197,5 @@ // >>> Select item

{
if (activeEntity !== null) {
var _activeEntity$data;
if ((activeEntity === null || activeEntity === void 0 ? void 0 : (_activeEntity$data = activeEntity.data) === null || _activeEntity$data === void 0 ? void 0 : _activeEntity$data.selectable) !== false) {
onInternalSelect(null, {

@@ -241,3 +247,3 @@ node: {

"aria-live": "assertive"
}, activeEntity.data.value), /*#__PURE__*/React.createElement(Tree, Object.assign({
}, activeEntity.data.value), /*#__PURE__*/React.createElement(Tree, _extends({
ref: treeRef,

@@ -256,4 +262,4 @@ focusable: false,

loadData: searchValue ? null : loadData,
motion: treeMotion,
// We handle keys by out instead tree self
motion: treeMotion // We handle keys by out instead tree self
,
checkable: checkable,

@@ -260,0 +266,0 @@ checkStrictly: true,

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

import * as React from 'react';
import { DataNode, Key } from './interface';
import type * as React from 'react';
import type { DataNode, Key } from './interface';
export interface TreeNodeProps extends Omit<DataNode, 'children'> {

@@ -4,0 +4,0 @@ value: Key;

import * as React from 'react';
import { SelectProps, RefSelectProps } from 'rc-select/lib/generate';
import { IconType } from 'rc-tree/lib/interface';
import { FilterFunc } from 'rc-select/lib/interface/generator';
import { Key, DefaultValueType, DataNode, LabelValueType, SimpleModeConfig, ChangeEventExtra, LegacyDataNode } from './interface';
import { CheckedStrategy, SHOW_ALL, SHOW_PARENT, SHOW_CHILD } from './utils/strategyUtil';
import type { SelectProps, RefSelectProps } from 'rc-select/lib/generate';
import type { IconType } from 'rc-tree/lib/interface';
import type { FilterFunc } from 'rc-select/lib/interface/generator';
import type { Key, DefaultValueType, DataNode, LabelValueType, SimpleModeConfig, ChangeEventExtra, LegacyDataNode } from './interface';
import type { CheckedStrategy } from './utils/strategyUtil';
import { SHOW_ALL, SHOW_PARENT, SHOW_CHILD } from './utils/strategyUtil';
export interface TreeSelectProps<ValueType = DefaultValueType> extends Omit<SelectProps<DataNode[], ValueType>, 'onChange' | 'mode' | 'menuItemSelectedIcon' | 'dropdownAlign' | 'backfill' | 'getInputElement' | 'optionLabelProp' | 'tokenSeparators' | 'filterOption'> {

@@ -8,0 +9,0 @@ multiple?: boolean;

@@ -5,2 +5,3 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";

import _createSuper from "@babel/runtime/helpers/esm/createSuper";
import _extends from "@babel/runtime/helpers/esm/extends";
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";

@@ -95,2 +96,3 @@ import _typeof from "@babel/runtime/helpers/esm/typeof";

return {
scrollTo: selectRef.current.scrollTo,
focus: selectRef.current.focus,

@@ -428,8 +430,8 @@ blur: selectRef.current.blur

}
}, /*#__PURE__*/React.createElement(RefSelect, Object.assign({
}, /*#__PURE__*/React.createElement(RefSelect, _extends({
ref: selectRef,
mode: mergedMultiple ? 'multiple' : null
}, props, selectProps, {
value: selectValues,
// We will handle this ourself since we need calculate conduction
value: selectValues // We will handle this ourself since we need calculate conduction
,
labelInValue: true,

@@ -472,3 +474,3 @@ options: mergedTreeData,

value: function render() {
return /*#__PURE__*/React.createElement(RefTreeSelect, Object.assign({
return /*#__PURE__*/React.createElement(RefTreeSelect, _extends({
ref: this.selectRef

@@ -475,0 +477,0 @@ }, this.props));

import * as React from 'react';
import { DataNode, LegacyDataNode, ChangeEventExtra, InnerDataNode, RawValueType } from '../interface';
import type { DataNode, LegacyDataNode, ChangeEventExtra, InnerDataNode, RawValueType } from '../interface';
export declare function convertChildrenToData(nodes: React.ReactNode): DataNode[];
export declare function fillLegacyProps(dataNode: DataNode): LegacyDataNode;
export declare function fillAdditionalInfo(extra: ChangeEventExtra, triggerValue: RawValueType, checkedValues: RawValueType[], treeData: InnerDataNode[], showPosition: boolean): void;

@@ -66,3 +66,3 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";

var children = dig(dataNode.children || [], pos, included);
var node = /*#__PURE__*/React.createElement(TreeNode, Object.assign({}, dataNode), children.map(function (child) {
var node = /*#__PURE__*/React.createElement(TreeNode, dataNode, children.map(function (child) {
return child.node;

@@ -69,0 +69,0 @@ })); // Link with trigger node

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

import { DataEntity } from 'rc-tree/lib/interface';
import { RawValueType, Key } from '../interface';
import type { DataEntity } from 'rc-tree/lib/interface';
import type { RawValueType, Key } from '../interface';
export declare const SHOW_ALL = "SHOW_ALL";

@@ -4,0 +4,0 @@ export declare const SHOW_PARENT = "SHOW_PARENT";

/// <reference types="react" />
import { FilterFunc } from 'rc-select/lib/interface/generator';
import { FlattenDataNode, RawValueType, DataNode, DefaultValueType, LabelValueType, LegacyDataNode } from '../interface';
import { SkipType } from '../hooks/useKeyValueMapping';
import type { FilterFunc } from 'rc-select/lib/interface/generator';
import type { FlattenDataNode, RawValueType, DataNode, DefaultValueType, LabelValueType, LegacyDataNode } from '../interface';
import type { SkipType } from '../hooks/useKeyValueMapping';
declare type CompatibleDataNode = Omit<FlattenDataNode, 'level'>;

@@ -20,4 +20,4 @@ export declare function toArray<T>(value: T | T[]): T[];

export declare function getRawValueLabeled(values: RawValueType[], prevValue: DefaultValueType, getEntityByValue: (value: RawValueType, skipType?: SkipType, ignoreDisabledCheck?: boolean) => FlattenDataNode, getLabelProp: (node: DataNode) => React.ReactNode): LabelValueType[];
export declare function addValue(rawValues: RawValueType[], value: RawValueType): (string | number)[];
export declare function removeValue(rawValues: RawValueType[], value: RawValueType): (string | number)[];
export declare function addValue(rawValues: RawValueType[], value: RawValueType): RawValueType[];
export declare function removeValue(rawValues: RawValueType[], value: RawValueType): RawValueType[];
export {};

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

import { TreeSelectProps } from '../TreeSelect';
import type { TreeSelectProps } from '../TreeSelect';
declare function warningProps(props: TreeSelectProps): void;
export default warningProps;
import * as React from 'react';
import { IconType } from 'rc-tree/lib/interface';
import { Key, LegacyDataNode } from './interface';
import type { IconType } from 'rc-tree/lib/interface';
import type { Key, LegacyDataNode } from './interface';
interface ContextProps {

@@ -5,0 +5,0 @@ checkable: boolean | React.ReactNode;

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

import { FlattenDataNode } from '../interface';
import type { FlattenDataNode, Key } from '../interface';
/**

@@ -6,2 +6,2 @@ * Return cached Key Value map with DataNode.

*/
export default function useKeyValueMap(flattenOptions: FlattenDataNode[]): Map<string | number, FlattenDataNode>[];
export default function useKeyValueMap(flattenOptions: FlattenDataNode[]): Map<Key, FlattenDataNode>[];

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

import { FlattenDataNode, Key, RawValueType } from '../interface';
import type { FlattenDataNode, Key, RawValueType } from '../interface';
export declare type SkipType = null | 'select' | 'checkbox';

@@ -3,0 +3,0 @@ export declare function isDisabled(dataNode: FlattenDataNode, skipType: SkipType): boolean;

import * as React from 'react';
import { DefaultValueType } from 'rc-select/lib/interface/generator';
import { DataEntity } from 'rc-tree/lib/interface';
import { RawValueType, FlattenDataNode, Key, LabelValueType, DataNode } from '../interface';
import { SkipType } from './useKeyValueMapping';
import { CheckedStrategy } from '../utils/strategyUtil';
import type { DefaultValueType } from 'rc-select/lib/interface/generator';
import type { DataEntity } from 'rc-tree/lib/interface';
import type { RawValueType, FlattenDataNode, Key, LabelValueType, DataNode } from '../interface';
import type { SkipType } from './useKeyValueMapping';
import type { CheckedStrategy } from '../utils/strategyUtil';
interface Config {

@@ -8,0 +8,0 @@ treeConduction: boolean;

import * as React from 'react';
import { DataNode, InnerDataNode, SimpleModeConfig } from '../interface';
import type { DataNode, InnerDataNode, SimpleModeConfig } from '../interface';
/**

@@ -4,0 +4,0 @@ * Convert `treeData` or `children` into formatted `treeData`.

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

import * as React from 'react';
import type * as React from 'react';
export declare type SelectSource = 'option' | 'selection' | 'input' | 'clear';

@@ -3,0 +3,0 @@ export declare type Key = string | number;

import * as React from 'react';
import { RefOptionListProps } from 'rc-select/lib/OptionList';
import { FlattenDataNode, RawValueType, DataNode } from './interface';
import type { RefOptionListProps } from 'rc-select/lib/OptionList';
import type { ScrollTo } from 'rc-tree/lib/interface';
import type { FlattenDataNode, RawValueType, DataNode } from './interface';
export interface OptionListProps<OptionsType extends object[]> {

@@ -29,3 +30,6 @@ prefixCls: string;

}
declare const RefOptionList: React.ForwardRefExoticComponent<OptionListProps<DataNode[]> & React.RefAttributes<RefOptionListProps>>;
declare type ReviseRefOptionListProps = Omit<RefOptionListProps, 'scrollTo'> & {
scrollTo: ScrollTo;
};
declare const RefOptionList: React.ForwardRefExoticComponent<OptionListProps<DataNode[]> & React.RefAttributes<ReviseRefOptionListProps>>;
export default RefOptionList;

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

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));

@@ -194,5 +196,8 @@

React.useImperativeHandle(ref, function () {
var _treeRef$current2;
return {
scrollTo: (_treeRef$current2 = treeRef.current) === null || _treeRef$current2 === void 0 ? void 0 : _treeRef$current2.scrollTo,
onKeyDown: function onKeyDown(event) {
var _treeRef$current2;
var _treeRef$current3;

@@ -207,3 +212,3 @@ var which = event.which;

case _KeyCode.default.RIGHT:
(_treeRef$current2 = treeRef.current) === null || _treeRef$current2 === void 0 ? void 0 : _treeRef$current2.onKeyDown(event);
(_treeRef$current3 = treeRef.current) === null || _treeRef$current3 === void 0 ? void 0 : _treeRef$current3.onKeyDown(event);
break;

@@ -214,3 +219,5 @@ // >>> Select item

{
if (activeEntity !== null) {
var _activeEntity$data;
if ((activeEntity === null || activeEntity === void 0 ? void 0 : (_activeEntity$data = activeEntity.data) === null || _activeEntity$data === void 0 ? void 0 : _activeEntity$data.selectable) !== false) {
onInternalSelect(null, {

@@ -262,3 +269,3 @@ node: {

"aria-live": "assertive"
}, activeEntity.data.value), /*#__PURE__*/React.createElement(_rcTree.default, Object.assign({
}, activeEntity.data.value), /*#__PURE__*/React.createElement(_rcTree.default, (0, _extends2.default)({
ref: treeRef,

@@ -277,4 +284,4 @@ focusable: false,

loadData: searchValue ? null : loadData,
motion: treeMotion,
// We handle keys by out instead tree self
motion: treeMotion // We handle keys by out instead tree self
,
checkable: checkable,

@@ -281,0 +288,0 @@ checkStrictly: true,

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

import * as React from 'react';
import { DataNode, Key } from './interface';
import type * as React from 'react';
import type { DataNode, Key } from './interface';
export interface TreeNodeProps extends Omit<DataNode, 'children'> {

@@ -4,0 +4,0 @@ value: Key;

import * as React from 'react';
import { SelectProps, RefSelectProps } from 'rc-select/lib/generate';
import { IconType } from 'rc-tree/lib/interface';
import { FilterFunc } from 'rc-select/lib/interface/generator';
import { Key, DefaultValueType, DataNode, LabelValueType, SimpleModeConfig, ChangeEventExtra, LegacyDataNode } from './interface';
import { CheckedStrategy, SHOW_ALL, SHOW_PARENT, SHOW_CHILD } from './utils/strategyUtil';
import type { SelectProps, RefSelectProps } from 'rc-select/lib/generate';
import type { IconType } from 'rc-tree/lib/interface';
import type { FilterFunc } from 'rc-select/lib/interface/generator';
import type { Key, DefaultValueType, DataNode, LabelValueType, SimpleModeConfig, ChangeEventExtra, LegacyDataNode } from './interface';
import type { CheckedStrategy } from './utils/strategyUtil';
import { SHOW_ALL, SHOW_PARENT, SHOW_CHILD } from './utils/strategyUtil';
export interface TreeSelectProps<ValueType = DefaultValueType> extends Omit<SelectProps<DataNode[], ValueType>, 'onChange' | 'mode' | 'menuItemSelectedIcon' | 'dropdownAlign' | 'backfill' | 'getInputElement' | 'optionLabelProp' | 'tokenSeparators' | 'filterOption'> {

@@ -8,0 +9,0 @@ multiple?: boolean;

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

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));

@@ -131,2 +133,3 @@

return {
scrollTo: selectRef.current.scrollTo,
focus: selectRef.current.focus,

@@ -464,8 +467,8 @@ blur: selectRef.current.blur

}
}, /*#__PURE__*/React.createElement(RefSelect, Object.assign({
}, /*#__PURE__*/React.createElement(RefSelect, (0, _extends2.default)({
ref: selectRef,
mode: mergedMultiple ? 'multiple' : null
}, props, selectProps, {
value: selectValues,
// We will handle this ourself since we need calculate conduction
value: selectValues // We will handle this ourself since we need calculate conduction
,
labelInValue: true,

@@ -507,3 +510,3 @@ options: mergedTreeData,

value: function render() {
return /*#__PURE__*/React.createElement(RefTreeSelect, Object.assign({
return /*#__PURE__*/React.createElement(RefTreeSelect, (0, _extends2.default)({
ref: this.selectRef

@@ -510,0 +513,0 @@ }, this.props));

import * as React from 'react';
import { DataNode, LegacyDataNode, ChangeEventExtra, InnerDataNode, RawValueType } from '../interface';
import type { DataNode, LegacyDataNode, ChangeEventExtra, InnerDataNode, RawValueType } from '../interface';
export declare function convertChildrenToData(nodes: React.ReactNode): DataNode[];
export declare function fillLegacyProps(dataNode: DataNode): LegacyDataNode;
export declare function fillAdditionalInfo(extra: ChangeEventExtra, triggerValue: RawValueType, checkedValues: RawValueType[], treeData: InnerDataNode[], showPosition: boolean): void;

@@ -85,3 +85,3 @@ "use strict";

var children = dig(dataNode.children || [], pos, included);
var node = /*#__PURE__*/React.createElement(_TreeNode.default, Object.assign({}, dataNode), children.map(function (child) {
var node = /*#__PURE__*/React.createElement(_TreeNode.default, dataNode, children.map(function (child) {
return child.node;

@@ -88,0 +88,0 @@ })); // Link with trigger node

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

import { DataEntity } from 'rc-tree/lib/interface';
import { RawValueType, Key } from '../interface';
import type { DataEntity } from 'rc-tree/lib/interface';
import type { RawValueType, Key } from '../interface';
export declare const SHOW_ALL = "SHOW_ALL";

@@ -4,0 +4,0 @@ export declare const SHOW_PARENT = "SHOW_PARENT";

/// <reference types="react" />
import { FilterFunc } from 'rc-select/lib/interface/generator';
import { FlattenDataNode, RawValueType, DataNode, DefaultValueType, LabelValueType, LegacyDataNode } from '../interface';
import { SkipType } from '../hooks/useKeyValueMapping';
import type { FilterFunc } from 'rc-select/lib/interface/generator';
import type { FlattenDataNode, RawValueType, DataNode, DefaultValueType, LabelValueType, LegacyDataNode } from '../interface';
import type { SkipType } from '../hooks/useKeyValueMapping';
declare type CompatibleDataNode = Omit<FlattenDataNode, 'level'>;

@@ -20,4 +20,4 @@ export declare function toArray<T>(value: T | T[]): T[];

export declare function getRawValueLabeled(values: RawValueType[], prevValue: DefaultValueType, getEntityByValue: (value: RawValueType, skipType?: SkipType, ignoreDisabledCheck?: boolean) => FlattenDataNode, getLabelProp: (node: DataNode) => React.ReactNode): LabelValueType[];
export declare function addValue(rawValues: RawValueType[], value: RawValueType): (string | number)[];
export declare function removeValue(rawValues: RawValueType[], value: RawValueType): (string | number)[];
export declare function addValue(rawValues: RawValueType[], value: RawValueType): RawValueType[];
export declare function removeValue(rawValues: RawValueType[], value: RawValueType): RawValueType[];
export {};

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

import { TreeSelectProps } from '../TreeSelect';
import type { TreeSelectProps } from '../TreeSelect';
declare function warningProps(props: TreeSelectProps): void;
export default warningProps;
{
"name": "rc-tree-select",
"version": "4.3.0",
"version": "4.3.1",
"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