-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
yxh01132861
committed
Sep 20, 2023
1 parent
6015e07
commit d6ef7db
Showing
3 changed files
with
2 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 1 addition & 19 deletions
20
packages/li-p2/src/components/Formily/ControlPositionSelect/Select/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,12 @@ | ||
/* eslint-disable react/no-array-index-key */ | ||
import { usePrefixCls } from '@formily/antd-v5/esm/__builtins__'; | ||
import type { SelectProps } from 'antd'; | ||
import { Select } from 'antd'; | ||
import cls from 'classnames'; | ||
import React from 'react'; | ||
import { POSITION } from './contants'; | ||
import useStyle from './style'; | ||
|
||
const PositionSelect: React.FC<SelectProps> = (props) => { | ||
const { options, ...prop } = props; | ||
const prefixCls = usePrefixCls('formily-position-select'); | ||
const [wrapSSR, hashId] = useStyle(prefixCls); | ||
|
||
return wrapSSR( | ||
<Select {...prop} popupClassName={cls(`${prefixCls}`, hashId)}> | ||
{(options ?? POSITION).map((item, index) => { | ||
return ( | ||
<Select.Option value={item.value} key={index}> | ||
<div className={cls(`${prefixCls}-item`, hashId)}> | ||
<span>{item.label}</span> | ||
</div> | ||
</Select.Option> | ||
); | ||
})} | ||
</Select>, | ||
); | ||
return <Select {...prop} options={options ?? POSITION} />; | ||
}; | ||
|
||
export default PositionSelect; |
13 changes: 0 additions & 13 deletions
13
packages/li-p2/src/components/Formily/ControlPositionSelect/Select/style.ts
This file was deleted.
Oops, something went wrong.