Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ant-design/ant-design int…
Browse files Browse the repository at this point in the history
…o fix-step-type
  • Loading branch information
heiyu4585 committed Dec 16, 2022
2 parents 5fa89de + a14b53b commit 2c6b470
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 19 deletions.
Expand Up @@ -142,7 +142,7 @@ export default function generateRangePicker<DateType>(generateConfig: GenerateCo
compactItemClassnames,
className,
)}
locale={locale!.lang}
locale={locale.lang}
prefixCls={prefixCls}
getPopupContainer={customGetPopupContainer || getPopupContainer}
generateConfig={generateConfig}
Expand Down
6 changes: 3 additions & 3 deletions components/spin/__tests__/delay.test.tsx
@@ -1,12 +1,12 @@
import React from 'react';
import { render } from '@testing-library/react';
import debounce from 'lodash/debounce';
import { debounce } from 'throttle-debounce';
import Spin from '..';
import { waitFakeTimer } from '../../../tests/utils';

jest.mock('lodash/debounce');
jest.mock('throttle-debounce');
(debounce as jest.Mock).mockImplementation((...args: any[]) =>
jest.requireActual('lodash/debounce')(...args),
jest.requireActual('throttle-debounce').debounce(...args),
);

describe('delay spinning', () => {
Expand Down
8 changes: 4 additions & 4 deletions components/spin/index.tsx
@@ -1,5 +1,5 @@
import classNames from 'classnames';
import debounce from 'lodash/debounce';
import { debounce } from 'throttle-debounce';
import omit from 'rc-util/lib/omit';
import * as React from 'react';
import type { ConfigConsumerProps } from '../config-provider';
Expand Down Expand Up @@ -75,7 +75,7 @@ const Spin: React.FC<SpinClassProps> = (props) => {
const {
spinPrefixCls: prefixCls,
spinning: customSpinning = true,
delay,
delay = 0,
className,
size = 'default',
tip,
Expand All @@ -91,9 +91,9 @@ const Spin: React.FC<SpinClassProps> = (props) => {
);

React.useEffect(() => {
const updateSpinning = debounce<() => void>(() => {
const updateSpinning = debounce(delay, () => {
setSpinning(customSpinning);
}, delay);
});
updateSpinning();
return () => {
updateSpinning?.cancel?.();
Expand Down
10 changes: 5 additions & 5 deletions components/table/hooks/useFilter/FilterDropdown.tsx
@@ -1,6 +1,6 @@
import FilterFilled from '@ant-design/icons/FilterFilled';
import classNames from 'classnames';
import isEqual from 'lodash/isEqual';
import shallowEqual from 'shallowequal';
import type { FieldDataNode } from 'rc-tree';
import * as React from 'react';
import type { MenuProps } from '../../../menu';
Expand Down Expand Up @@ -232,7 +232,7 @@ function FilterDropdown<RecordType>(props: FilterDropdownProps<RecordType>) {
return null;
}

if (isEqual(mergedKeys, filterState?.filteredKeys)) {
if (shallowEqual(mergedKeys, filterState?.filteredKeys)) {
return null;
}

Expand Down Expand Up @@ -339,7 +339,7 @@ function FilterDropdown<RecordType>(props: FilterDropdownProps<RecordType>) {
} else if (column.filterDropdown) {
dropdownContent = column.filterDropdown;
} else {
const selectedKeys = (getFilteredKeysSync() || []) as any;
const selectedKeys = getFilteredKeysSync() || [];
const getFilterComponent = () => {
if ((column.filters || []).length === 0) {
return (
Expand Down Expand Up @@ -425,7 +425,7 @@ function FilterDropdown<RecordType>(props: FilterDropdownProps<RecordType>) {
className={dropdownMenuClass}
onSelect={onSelectKeys}
onDeselect={onSelectKeys}
selectedKeys={selectedKeys}
selectedKeys={selectedKeys as string[]}
getPopupContainer={getPopupContainer}
openKeys={openKeys}
onOpenChange={onOpenChange}
Expand All @@ -444,7 +444,7 @@ function FilterDropdown<RecordType>(props: FilterDropdownProps<RecordType>) {

const getResetDisabled = () => {
if (filterResetToDefaultFilteredValue) {
return isEqual(
return shallowEqual(
(defaultFilteredValue || []).map((key) => String(key)),
selectedKeys,
);
Expand Down
10 changes: 4 additions & 6 deletions package.json
Expand Up @@ -119,7 +119,6 @@
"classnames": "^2.2.6",
"copy-to-clipboard": "^3.2.0",
"dayjs": "^1.11.1",
"lodash": "^4.17.21",
"rc-cascader": "~3.8.0",
"rc-checkbox": "~2.3.0",
"rc-collapse": "~3.4.2",
Expand Down Expand Up @@ -154,7 +153,8 @@
"rc-upload": "~4.3.0",
"rc-util": "^5.25.2",
"scroll-into-view-if-needed": "^3.0.3",
"shallowequal": "^1.1.0"
"shallowequal": "^1.1.0",
"throttle-debounce": "^5.0.0"
},
"devDependencies": {
"@ant-design/tools": "^16.1.0-alpha.2",
Expand Down Expand Up @@ -189,6 +189,7 @@
"@types/react-sticky": "^6.0.4",
"@types/react-window": "^1.8.2",
"@types/shallowequal": "^1.1.1",
"@types/throttle-debounce": "^5.0.0",
"@types/warning": "^3.0.0",
"@typescript-eslint/eslint-plugin": "^5.40.0",
"@typescript-eslint/parser": "^5.40.0",
Expand All @@ -199,7 +200,6 @@
"chalk": "^4.0.0",
"cheerio": "1.0.0-rc.12",
"cross-env": "^7.0.0",
"css-minimizer-webpack-plugin": "^1.3.0",
"dekko": "^0.2.1",
"dumi": "^2.0.2",
"duplicate-package-checker-webpack-plugin": "^3.0.0",
Expand All @@ -221,7 +221,6 @@
"fs-extra": "^11.0.0",
"gh-pages": "^4.0.0",
"glob": "^8.0.1",
"highlight.js": "^11.5.0",
"http-server": "^14.0.0",
"husky": "^8.0.1",
"identity-obj-proxy": "^3.0.0",
Expand All @@ -239,10 +238,9 @@
"jsdom": "^20.0.0",
"jsonml-to-react-element": "^1.1.11",
"jsonml.js": "^0.1.0",
"less-vars-to-js": "^1.3.0",
"lint-staged": "^13.0.3",
"lodash": "^4.17.21",
"lz-string": "^1.4.4",
"mini-css-extract-plugin": "^1.6.2",
"mockdate": "^3.0.0",
"open": "^8.0.1",
"prettier": "^2.3.2",
Expand Down

0 comments on commit 2c6b470

Please sign in to comment.