rc-cascader
Advanced tools
Comparing version 3.14.1 to 3.15.0
@@ -45,2 +45,3 @@ import type { BuildInPlacements } from '@rc-component/trigger/lib/interface'; | ||
showCheckedStrategy?: ShowCheckedStrategy; | ||
autoClearSearchValue?: boolean; | ||
showSearch?: boolean | ShowSearchType<OptionType>; | ||
@@ -47,0 +48,0 @@ searchValue?: string; |
@@ -5,3 +5,3 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; | ||
var _excluded = ["id", "prefixCls", "fieldNames", "defaultValue", "value", "changeOnSelect", "onChange", "displayRender", "checkable", "searchValue", "onSearch", "showSearch", "expandTrigger", "options", "dropdownPrefixCls", "loadData", "popupVisible", "open", "popupClassName", "dropdownClassName", "dropdownMenuColumnStyle", "popupPlacement", "placement", "onDropdownVisibleChange", "onPopupVisibleChange", "expandIcon", "loadingIcon", "children", "dropdownMatchSelectWidth", "showCheckedStrategy"]; | ||
var _excluded = ["id", "prefixCls", "fieldNames", "defaultValue", "value", "changeOnSelect", "onChange", "displayRender", "checkable", "autoClearSearchValue", "searchValue", "onSearch", "showSearch", "expandTrigger", "options", "dropdownPrefixCls", "loadData", "popupVisible", "open", "popupClassName", "dropdownClassName", "dropdownMenuColumnStyle", "popupPlacement", "placement", "onDropdownVisibleChange", "onPopupVisibleChange", "expandIcon", "loadingIcon", "children", "dropdownMatchSelectWidth", "showCheckedStrategy"]; | ||
import { BaseSelect } from 'rc-select'; | ||
@@ -48,2 +48,4 @@ import useId from "rc-select/es/hooks/useId"; | ||
checkable = props.checkable, | ||
_props$autoClearSearc = props.autoClearSearchValue, | ||
autoClearSearchValue = _props$autoClearSearc === void 0 ? true : _props$autoClearSearc, | ||
searchValue = props.searchValue, | ||
@@ -186,3 +188,5 @@ onSearch = props.onSearch, | ||
var onInternalSelect = useEvent(function (valuePath) { | ||
setSearchValue(''); | ||
if (!multiple || autoClearSearchValue) { | ||
setSearchValue(''); | ||
} | ||
if (!multiple) { | ||
@@ -302,2 +306,3 @@ triggerChange(valuePath); | ||
prefixCls: prefixCls, | ||
autoClearSearchValue: autoClearSearchValue, | ||
dropdownMatchSelectWidth: dropdownMatchSelectWidth, | ||
@@ -304,0 +309,0 @@ dropdownStyle: dropdownStyle |
@@ -45,2 +45,3 @@ import type { BuildInPlacements } from '@rc-component/trigger/lib/interface'; | ||
showCheckedStrategy?: ShowCheckedStrategy; | ||
autoClearSearchValue?: boolean; | ||
showSearch?: boolean | ShowSearchType<OptionType>; | ||
@@ -47,0 +48,0 @@ searchValue?: string; |
@@ -29,3 +29,3 @@ "use strict"; | ||
var _warningPropsUtil = _interopRequireWildcard(require("./utils/warningPropsUtil")); | ||
var _excluded = ["id", "prefixCls", "fieldNames", "defaultValue", "value", "changeOnSelect", "onChange", "displayRender", "checkable", "searchValue", "onSearch", "showSearch", "expandTrigger", "options", "dropdownPrefixCls", "loadData", "popupVisible", "open", "popupClassName", "dropdownClassName", "dropdownMenuColumnStyle", "popupPlacement", "placement", "onDropdownVisibleChange", "onPopupVisibleChange", "expandIcon", "loadingIcon", "children", "dropdownMatchSelectWidth", "showCheckedStrategy"]; | ||
var _excluded = ["id", "prefixCls", "fieldNames", "defaultValue", "value", "changeOnSelect", "onChange", "displayRender", "checkable", "autoClearSearchValue", "searchValue", "onSearch", "showSearch", "expandTrigger", "options", "dropdownPrefixCls", "loadData", "popupVisible", "open", "popupClassName", "dropdownClassName", "dropdownMenuColumnStyle", "popupPlacement", "placement", "onDropdownVisibleChange", "onPopupVisibleChange", "expandIcon", "loadingIcon", "children", "dropdownMatchSelectWidth", "showCheckedStrategy"]; | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
@@ -58,2 +58,4 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
checkable = props.checkable, | ||
_props$autoClearSearc = props.autoClearSearchValue, | ||
autoClearSearchValue = _props$autoClearSearc === void 0 ? true : _props$autoClearSearc, | ||
searchValue = props.searchValue, | ||
@@ -196,3 +198,5 @@ onSearch = props.onSearch, | ||
var onInternalSelect = (0, _useEvent.default)(function (valuePath) { | ||
setSearchValue(''); | ||
if (!multiple || autoClearSearchValue) { | ||
setSearchValue(''); | ||
} | ||
if (!multiple) { | ||
@@ -312,2 +316,3 @@ triggerChange(valuePath); | ||
prefixCls: prefixCls, | ||
autoClearSearchValue: autoClearSearchValue, | ||
dropdownMatchSelectWidth: dropdownMatchSelectWidth, | ||
@@ -314,0 +319,0 @@ dropdownStyle: dropdownStyle |
{ | ||
"name": "rc-cascader", | ||
"version": "3.14.1", | ||
"version": "3.15.0", | ||
"description": "cascade select ui component for react", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -119,2 +119,8 @@ # rc-cascader | ||
<tr> | ||
<td>autoClearSearchValue</td> | ||
<td>boolean</td> | ||
<td>true</td> | ||
<td>Whether the current search will be cleared on selecting an item. Only applies when checkable</td> | ||
</tr> | ||
<tr> | ||
<td>options</td> | ||
@@ -121,0 +127,0 @@ <td>Object</td> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
165171
3141
302