Socket
Socket
Sign inDemoInstall

rc-cascader

Package Overview
Dependencies
Maintainers
5
Versions
166
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-cascader - npm Package Compare versions

Comparing version 3.14.0 to 3.14.1

6

es/Cascader.js

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

import { conductCheck } from "rc-tree/es/utils/conductUtil";
import useEvent from "rc-util/es/hooks/useEvent";
import useMergedState from "rc-util/es/hooks/useMergedState";

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

import useMissingValues from "./hooks/useMissingValues";
import useRefFunc from "./hooks/useRefFunc";
import useSearchConfig from "./hooks/useSearchConfig";

@@ -167,3 +167,3 @@ import useSearchOptions from "./hooks/useSearchOptions";

// =========================== Change ===========================
var triggerChange = useRefFunc(function (nextValues) {
var triggerChange = useEvent(function (nextValues) {
setRawValues(nextValues);

@@ -186,3 +186,3 @@

// =========================== Select ===========================
var onInternalSelect = useRefFunc(function (valuePath) {
var onInternalSelect = useEvent(function (valuePath) {
setSearchValue('');

@@ -189,0 +189,0 @@ if (!multiple) {

@@ -5,3 +5,9 @@ import type { DefaultOptionType, FieldNames, InternalFieldNames, SingleValueType } from '../Cascader';

export declare const SHOW_CHILD = "SHOW_CHILD";
/**
* Will convert value to string, and join with `VALUE_SPLIT`
*/
export declare function toPathKey(value: SingleValueType): string;
/**
* Batch convert value to string, and join with `VALUE_SPLIT`
*/
export declare function toPathKeys(value: SingleValueType[]): string[];

@@ -8,0 +14,0 @@ export declare function toPathValueStr(pathKey: string): string[];

@@ -5,5 +5,13 @@ import { SEARCH_MARK } from "../hooks/useSearchOptions";

export var SHOW_CHILD = 'SHOW_CHILD';
/**
* Will convert value to string, and join with `VALUE_SPLIT`
*/
export function toPathKey(value) {
return value.join(VALUE_SPLIT);
}
/**
* Batch convert value to string, and join with `VALUE_SPLIT`
*/
export function toPathKeys(value) {

@@ -10,0 +18,0 @@ return value.map(toPathKey);

@@ -9,2 +9,5 @@ import { SHOW_CHILD } from "./commonUtil";

var children = entity ? entity.children : null;
if (entity && entity.node.disabled) {
return true;
}
return showCheckedStrategy === SHOW_CHILD ? !(children && children.some(function (child) {

@@ -11,0 +14,0 @@ return child.key && valueSet.has(child.key);

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

var _conductUtil = require("rc-tree/lib/utils/conductUtil");
var _useEvent = _interopRequireDefault(require("rc-util/lib/hooks/useEvent"));
var _useMergedState5 = _interopRequireDefault(require("rc-util/lib/hooks/useMergedState"));

@@ -23,3 +24,2 @@ var React = _interopRequireWildcard(require("react"));

var _useMissingValues = _interopRequireDefault(require("./hooks/useMissingValues"));
var _useRefFunc = _interopRequireDefault(require("./hooks/useRefFunc"));
var _useSearchConfig3 = _interopRequireDefault(require("./hooks/useSearchConfig"));

@@ -177,3 +177,3 @@ var _useSearchOptions = _interopRequireDefault(require("./hooks/useSearchOptions"));

// =========================== Change ===========================
var triggerChange = (0, _useRefFunc.default)(function (nextValues) {
var triggerChange = (0, _useEvent.default)(function (nextValues) {
setRawValues(nextValues);

@@ -196,3 +196,3 @@

// =========================== Select ===========================
var onInternalSelect = (0, _useRefFunc.default)(function (valuePath) {
var onInternalSelect = (0, _useEvent.default)(function (valuePath) {
setSearchValue('');

@@ -199,0 +199,0 @@ if (!multiple) {

@@ -5,3 +5,9 @@ import type { DefaultOptionType, FieldNames, InternalFieldNames, SingleValueType } from '../Cascader';

export declare const SHOW_CHILD = "SHOW_CHILD";
/**
* Will convert value to string, and join with `VALUE_SPLIT`
*/
export declare function toPathKey(value: SingleValueType): string;
/**
* Batch convert value to string, and join with `VALUE_SPLIT`
*/
export declare function toPathKeys(value: SingleValueType[]): string[];

@@ -8,0 +14,0 @@ export declare function toPathValueStr(pathKey: string): string[];

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

var SHOW_CHILD = 'SHOW_CHILD';
/**
* Will convert value to string, and join with `VALUE_SPLIT`
*/
exports.SHOW_CHILD = SHOW_CHILD;

@@ -25,2 +29,6 @@ function toPathKey(value) {

}
/**
* Batch convert value to string, and join with `VALUE_SPLIT`
*/
function toPathKeys(value) {

@@ -27,0 +35,0 @@ return value.map(toPathKey);

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

var children = entity ? entity.children : null;
if (entity && entity.node.disabled) {
return true;
}
return showCheckedStrategy === _commonUtil.SHOW_CHILD ? !(children && children.some(function (child) {

@@ -18,0 +21,0 @@ return child.key && valueSet.has(child.key);

{
"name": "rc-cascader",
"version": "3.14.0",
"version": "3.14.1",
"description": "cascade select ui component for react",

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

"rc-tree": "~5.7.0",
"rc-util": "^5.6.1"
"rc-util": "^5.35.0"
},

@@ -81,0 +81,0 @@ "peerDependencies": {

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