feat: 1.升级 Ant Design Ui 至 v6 2. 修复企业充值金额输入限制
This commit is contained in:
@@ -129,7 +129,7 @@ export const Button = forwardRef(function Button(
|
||||
danger={danger}
|
||||
size={useConsoleControlSize(size)}
|
||||
shape={circle ? 'circle' : undefined}
|
||||
iconPosition={iconPosition === 'right' ? 'end' : 'start'}
|
||||
iconPlacement={iconPosition === 'right' ? 'end' : 'start'}
|
||||
/>
|
||||
);
|
||||
});
|
||||
@@ -193,6 +193,10 @@ export function Select({
|
||||
prefix,
|
||||
dropdownStyle,
|
||||
dropdownClassName,
|
||||
autoClearSearchValue,
|
||||
onSearch,
|
||||
searchValue,
|
||||
filterSort,
|
||||
...props
|
||||
}) {
|
||||
const canSearch =
|
||||
@@ -210,28 +214,39 @@ export function Select({
|
||||
}
|
||||
styles={{
|
||||
...props.styles,
|
||||
popup: { ...props.styles?.popup, root: dropdownStyle },
|
||||
popup: {
|
||||
...props.styles?.popup,
|
||||
root: dropdownStyle ?? props.styles?.popup?.root,
|
||||
},
|
||||
}}
|
||||
classNames={{
|
||||
...props.classNames,
|
||||
popup: { ...props.classNames?.popup, root: dropdownClassName },
|
||||
popup: {
|
||||
...props.classNames?.popup,
|
||||
root: dropdownClassName ?? props.classNames?.popup?.root,
|
||||
},
|
||||
}}
|
||||
options={optionList || options}
|
||||
allowClear={showClear ?? props.allowClear}
|
||||
showSearch={canSearch}
|
||||
filterOption={
|
||||
remote
|
||||
showSearch={{
|
||||
enabled: canSearch,
|
||||
filterOption: remote
|
||||
? false
|
||||
: typeof filter === 'function'
|
||||
? filter
|
||||
: filter === false
|
||||
? false
|
||||
: undefined
|
||||
}
|
||||
optionFilterProp='label'
|
||||
: undefined,
|
||||
optionFilterProp: 'label',
|
||||
...(typeof props.showSearch === 'object' ? props.showSearch : {}),
|
||||
...(autoClearSearchValue !== undefined ? { autoClearSearchValue } : {}),
|
||||
...(onSearch !== undefined ? { onSearch } : {}),
|
||||
...(searchValue !== undefined ? { searchValue } : {}),
|
||||
...(filterSort !== undefined ? { filterSort } : {}),
|
||||
}}
|
||||
notFoundContent={emptyContent}
|
||||
status={statusOf(validateStatus)}
|
||||
onOpenChange={onDropdownVisibleChange}
|
||||
onOpenChange={onDropdownVisibleChange ?? props.onOpenChange}
|
||||
prefix={prefix}
|
||||
popupRender={
|
||||
outerBottomSlot || innerBottomSlot
|
||||
@@ -348,7 +363,7 @@ export function Switch({
|
||||
{...props}
|
||||
checkedChildren={checkedText}
|
||||
unCheckedChildren={uncheckedText}
|
||||
size={size === 'small' ? 'small' : 'default'}
|
||||
size={size === 'small' ? 'small' : 'medium'}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -369,6 +384,8 @@ export function DatePicker({
|
||||
presets,
|
||||
size,
|
||||
inputReadOnly,
|
||||
dropdownClassName,
|
||||
dropdownStyle,
|
||||
...props
|
||||
}) {
|
||||
const range = type?.toLowerCase().includes('range');
|
||||
@@ -377,6 +394,20 @@ export function DatePicker({
|
||||
return (
|
||||
<Component
|
||||
{...props}
|
||||
classNames={{
|
||||
...props.classNames,
|
||||
popup: {
|
||||
...props.classNames?.popup,
|
||||
root: dropdownClassName ?? props.classNames?.popup?.root,
|
||||
},
|
||||
}}
|
||||
styles={{
|
||||
...props.styles,
|
||||
popup: {
|
||||
...props.styles?.popup,
|
||||
root: dropdownStyle ?? props.styles?.popup?.root,
|
||||
},
|
||||
}}
|
||||
{...(value !== undefined ? { value: convert(value) } : {})}
|
||||
defaultValue={
|
||||
defaultValue === undefined ? undefined : convert(defaultValue)
|
||||
@@ -426,11 +457,13 @@ export function TreeSelect({
|
||||
{...props}
|
||||
treeData={treeNodes(treeData)}
|
||||
allowClear={showClear}
|
||||
showSearch={!!filterTreeNode}
|
||||
treeNodeFilterProp='title'
|
||||
filterTreeNode={
|
||||
typeof filterTreeNode === 'function' ? filterTreeNode : undefined
|
||||
}
|
||||
showSearch={{
|
||||
enabled: !!filterTreeNode,
|
||||
filterTreeNode:
|
||||
typeof filterTreeNode === 'function' ? filterTreeNode : undefined,
|
||||
treeNodeFilterProp: 'title',
|
||||
...(typeof props.showSearch === 'object' ? props.showSearch : {}),
|
||||
}}
|
||||
treeDefaultExpandAll={expandAll}
|
||||
/>
|
||||
);
|
||||
@@ -461,12 +494,19 @@ export function AutoComplete({
|
||||
renderItem,
|
||||
emptyContent,
|
||||
onEnterPress,
|
||||
onSearch,
|
||||
showSearch,
|
||||
size,
|
||||
...props
|
||||
}) {
|
||||
return (
|
||||
<AntAutoComplete
|
||||
{...props}
|
||||
showSearch={
|
||||
onSearch
|
||||
? { ...(typeof showSearch === 'object' ? showSearch : {}), onSearch }
|
||||
: showSearch
|
||||
}
|
||||
options={data?.map((item) =>
|
||||
typeof item === 'string' ? { value: item } : item,
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user