Comparing version 7.47.4 to 7.47.5
@@ -21,4 +21,4 @@ import _typeof from "@babel/runtime/helpers/esm/typeof"; | ||
var container = getContainer() || defaultContainer; | ||
var isSticky = !!sticky; | ||
return React.useMemo(function () { | ||
var isSticky = !!sticky; | ||
return { | ||
@@ -32,3 +32,3 @@ isSticky: isSticky, | ||
}; | ||
}, [offsetScroll, offsetHeader, offsetSummary, prefixCls, container]); | ||
}, [isSticky, offsetScroll, offsetHeader, offsetSummary, prefixCls, container]); | ||
} |
@@ -60,3 +60,3 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
import ColumnGroup from "./sugar/ColumnGroup"; | ||
import { getColumnsKey, validateValue } from "./utils/valueUtil"; | ||
import { getColumnsKey, validateValue, validNumberValue } from "./utils/valueUtil"; | ||
import { getDOM } from "rc-util/es/Dom/findDOMNode"; | ||
@@ -201,5 +201,3 @@ export var DEFAULT_PREFIX = 'rc-table'; | ||
key = config.key; | ||
// * 考虑top为0的情况 | ||
if (top || top === 0) { | ||
if (validNumberValue(top)) { | ||
var _scrollBodyRef$curren; | ||
@@ -206,0 +204,0 @@ (_scrollBodyRef$curren = scrollBodyRef.current) === null || _scrollBodyRef$curren === void 0 || _scrollBodyRef$curren.scrollTo({ |
@@ -9,1 +9,2 @@ /// <reference types="react" /> | ||
export declare function validateValue<T>(val: T): boolean; | ||
export declare function validNumberValue(value: any): boolean; |
@@ -26,2 +26,5 @@ var INTERNAL_KEY_PREFIX = 'RC_TABLE_KEY'; | ||
return val !== null && val !== undefined; | ||
} | ||
export function validNumberValue(value) { | ||
return typeof value === 'number' && !Number.isNaN(value); | ||
} |
@@ -31,4 +31,4 @@ "use strict"; | ||
var container = getContainer() || defaultContainer; | ||
var isSticky = !!sticky; | ||
return React.useMemo(function () { | ||
var isSticky = !!sticky; | ||
return { | ||
@@ -42,3 +42,3 @@ isSticky: isSticky, | ||
}; | ||
}, [offsetScroll, offsetHeader, offsetSummary, prefixCls, container]); | ||
}, [isSticky, offsetScroll, offsetHeader, offsetSummary, prefixCls, container]); | ||
} |
@@ -211,5 +211,3 @@ "use strict"; | ||
key = config.key; | ||
// * 考虑top为0的情况 | ||
if (top || top === 0) { | ||
if ((0, _valueUtil.validNumberValue)(top)) { | ||
var _scrollBodyRef$curren; | ||
@@ -216,0 +214,0 @@ (_scrollBodyRef$curren = scrollBodyRef.current) === null || _scrollBodyRef$curren === void 0 || _scrollBodyRef$curren.scrollTo({ |
@@ -9,1 +9,2 @@ /// <reference types="react" /> | ||
export declare function validateValue<T>(val: T): boolean; | ||
export declare function validNumberValue(value: any): boolean; |
@@ -7,2 +7,3 @@ "use strict"; | ||
exports.getColumnsKey = getColumnsKey; | ||
exports.validNumberValue = validNumberValue; | ||
exports.validateValue = validateValue; | ||
@@ -34,2 +35,5 @@ var INTERNAL_KEY_PREFIX = 'RC_TABLE_KEY'; | ||
return val !== null && val !== undefined; | ||
} | ||
function validNumberValue(value) { | ||
return typeof value === 'number' && !Number.isNaN(value); | ||
} |
{ | ||
"name": "rc-table", | ||
"version": "7.47.4", | ||
"version": "7.47.5", | ||
"description": "table ui component for react", | ||
@@ -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
400067
8858