Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ lib
es
yarn.lock
package-lock.json
pnpm-lock.yaml
coverage
# umi
.umi
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@
"@rc-component/select": "~1.1.0",
"@rc-component/tree": "~1.0.0",
"@rc-component/util": "^1.3.0",
"classnames": "^2.3.1"
"clsx": "^2.1.1"
},
"devDependencies": {
"@rc-component/father-plugin": "^2.0.2",
"@rc-component/np": "^1.0.3",
"@rc-component/trigger": "^3.0.0",
"@testing-library/react": "^12.1.5",
"@types/classnames": "^2.2.6",
"@types/enzyme": "^3.1.15",
"@types/jest": "^29.4.0",
"@types/node": "^24.5.2",
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"@types/warning": "^3.0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/OptionList/Checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import classNames from 'classnames';
import { clsx } from 'clsx';
import CascaderContext from '../context';

export interface CheckboxProps {
Expand All @@ -25,7 +25,7 @@ export default function Checkbox({

return (
<span
className={classNames(`${prefixCls}`, {
className={clsx(`${prefixCls}`, {
[`${prefixCls}-checked`]: checked,
[`${prefixCls}-indeterminate`]: !checked && halfChecked,
[`${prefixCls}-disabled`]: disabled || disableCheckbox,
Expand Down
13 changes: 5 additions & 8 deletions src/OptionList/Column.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import cls from 'classnames';
import { clsx } from 'clsx';
import * as React from 'react';
import pickAttrs from 'rc-util/lib/pickAttrs';
import pickAttrs from '@rc-component/util/lib/pickAttrs';
import type { DefaultOptionType, SingleValueType } from '../Cascader';
import CascaderContext from '../context';
import { SEARCH_MARK } from '../hooks/useSearchOptions';
Expand Down Expand Up @@ -121,7 +121,7 @@ export default function Column<OptionType extends DefaultOptionType = DefaultOpt
// ============================ Render ============================
return (
<ul
className={cls(menuPrefixCls, classNames?.popup?.list)}
className={clsx(menuPrefixCls, classNames?.popup?.list)}
style={styles?.popup?.list}
ref={menuRef}
role="menu"
Expand All @@ -140,10 +140,7 @@ export default function Column<OptionType extends DefaultOptionType = DefaultOpt
fullPathKey,
disableCheckbox,
}) => {
const ariaProps = pickAttrs(option, {
aria: true,
data: true
});
const ariaProps = pickAttrs(option, { aria: true, data: true });
// >>>>> Open
const triggerOpenPath = () => {
if (isOptionDisabled(disabled)) {
Expand Down Expand Up @@ -176,7 +173,7 @@ export default function Column<OptionType extends DefaultOptionType = DefaultOpt
<li
key={fullPathKey}
{...ariaProps}
className={cls(menuItemPrefixCls, classNames?.popup?.listItem, {
className={clsx(menuItemPrefixCls, classNames?.popup?.listItem, {
[`${menuItemPrefixCls}-expand`]: !isMergedLeaf,
[`${menuItemPrefixCls}-active`]:
activeValue === value || activeValue === fullPathKey,
Expand Down
4 changes: 2 additions & 2 deletions src/OptionList/List.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable default-case */
import classNames from 'classnames';
import { clsx } from 'clsx';
import type { useBaseProps } from '@rc-component/select';
import type { RefOptionListProps } from '@rc-component/select/lib/OptionList';
import * as React from 'react';
Expand Down Expand Up @@ -248,7 +248,7 @@ const RawOptionList = React.forwardRef<RefOptionListProps, RawOptionListProps>((
return (
<CacheContent open={open}>
<div
className={classNames(`${mergedPrefixCls}-menus`, {
className={clsx(`${mergedPrefixCls}-menus`, {
[`${mergedPrefixCls}-menu-empty`]: isEmpty,
[`${mergedPrefixCls}-rtl`]: rtl,
})}
Expand Down
9 changes: 3 additions & 6 deletions src/Panel.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import classNames from 'classnames';
import { clsx } from 'clsx';
import { useEvent, useControlledState } from '@rc-component/util';
import * as React from 'react';
import type {
Expand Down Expand Up @@ -184,12 +184,9 @@ export default function Panel<
return (
<CascaderContext.Provider value={cascaderContext}>
<div
className={classNames(
className={clsx(
panelPrefixCls,
{
[`${panelPrefixCls}-rtl`]: direction === 'rtl',
[`${panelPrefixCls}-empty`]: isEmpty,
},
{ [`${panelPrefixCls}-rtl`]: direction === 'rtl', [`${panelPrefixCls}-empty`]: isEmpty },
className,
)}
style={style}
Expand Down
Loading