rc-select
Advanced tools
Comparing version 14.7.1 to 14.7.2
@@ -53,3 +53,3 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import SelectContext from "./SelectContext"; | ||
import { hasValue, toArray } from "./utils/commonUtil"; | ||
import { hasValue, isComboNoValue, toArray } from "./utils/commonUtil"; | ||
import { fillFieldNames, flattenOptions, injectPropsWithOption } from "./utils/valueUtil"; | ||
@@ -194,4 +194,4 @@ import warningProps, { warningNullOptions } from "./utils/warningPropsUtil"; | ||
// combobox no need save value when it's no value | ||
if (mode === 'combobox' && !((_values$ = values[0]) !== null && _values$ !== void 0 && _values$.value)) { | ||
// combobox no need save value when it's no value (exclude value equal 0) | ||
if (mode === 'combobox' && isComboNoValue((_values$ = values[0]) === null || _values$ === void 0 ? void 0 : _values$.value)) { | ||
return []; | ||
@@ -198,0 +198,0 @@ } |
@@ -7,2 +7,4 @@ import type { DisplayValueType } from '../BaseSelect'; | ||
export declare function hasValue(value: any): boolean; | ||
/** combo mode no value judgment function */ | ||
export declare function isComboNoValue(value: any): boolean; | ||
export declare function getTitle(item: DisplayValueType): string; |
@@ -15,2 +15,7 @@ import _typeof from "@babel/runtime/helpers/esm/typeof"; | ||
} | ||
/** combo mode no value judgment function */ | ||
export function isComboNoValue(value) { | ||
return !value && value !== 0; | ||
} | ||
function isTitleType(title) { | ||
@@ -17,0 +22,0 @@ return ['string', 'number'].includes(_typeof(title)); |
@@ -202,4 +202,4 @@ "use strict"; | ||
// combobox no need save value when it's no value | ||
if (mode === 'combobox' && !((_values$ = values[0]) !== null && _values$ !== void 0 && _values$.value)) { | ||
// combobox no need save value when it's no value (exclude value equal 0) | ||
if (mode === 'combobox' && (0, _commonUtil.isComboNoValue)((_values$ = values[0]) === null || _values$ === void 0 ? void 0 : _values$.value)) { | ||
return []; | ||
@@ -206,0 +206,0 @@ } |
@@ -7,2 +7,4 @@ import type { DisplayValueType } from '../BaseSelect'; | ||
export declare function hasValue(value: any): boolean; | ||
/** combo mode no value judgment function */ | ||
export declare function isComboNoValue(value: any): boolean; | ||
export declare function getTitle(item: DisplayValueType): string; |
@@ -10,2 +10,3 @@ "use strict"; | ||
exports.isClient = exports.isBrowserClient = void 0; | ||
exports.isComboNoValue = isComboNoValue; | ||
exports.toArray = toArray; | ||
@@ -28,2 +29,7 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); | ||
} | ||
/** combo mode no value judgment function */ | ||
function isComboNoValue(value) { | ||
return !value && value !== 0; | ||
} | ||
function isTitleType(title) { | ||
@@ -30,0 +36,0 @@ return ['string', 'number'].includes((0, _typeof2.default)(title)); |
{ | ||
"name": "rc-select", | ||
"version": "14.7.1", | ||
"version": "14.7.2", | ||
"description": "React Select", | ||
@@ -5,0 +5,0 @@ "engines": { |
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
330477
7025