mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 03:59:01 +08:00
977a9a92ff
* fix: Fix the problem that the clear icon is not displayed when the Select series component hovers under the Space component * refactor: 修改 Space.Compact css 优先级以及简化调用 * refactor: 修改 Space.Compact 垂直方向 css 优先级以及简化调用 * docs: 添加注释 * fix: lint * test: update snapshot * test: update snapshot
215 lines
6.3 KiB
TypeScript
215 lines
6.3 KiB
TypeScript
import React from 'react';
|
|
import { CopyOutlined } from '@ant-design/icons';
|
|
import {
|
|
AutoComplete,
|
|
Button,
|
|
Cascader,
|
|
DatePicker,
|
|
Input,
|
|
InputNumber,
|
|
Select,
|
|
Space,
|
|
TimePicker,
|
|
Tooltip,
|
|
TreeSelect,
|
|
} from 'antd';
|
|
|
|
const { Option } = Select;
|
|
const { TreeNode } = TreeSelect;
|
|
|
|
const App: React.FC = () => (
|
|
<div className="site-space-compact-wrapper">
|
|
<Space.Compact block>
|
|
<Input style={{ width: '20%' }} defaultValue="0571" />
|
|
<Input style={{ width: '30%' }} defaultValue="26888888" />
|
|
</Space.Compact>
|
|
<br />
|
|
<Space.Compact block size="small">
|
|
<Input style={{ width: 'calc(100% - 200px)' }} defaultValue="https://ant.design" />
|
|
<Button type="primary">Submit</Button>
|
|
</Space.Compact>
|
|
<br />
|
|
<Space.Compact block>
|
|
<Input style={{ width: 'calc(100% - 200px)' }} defaultValue="https://ant.design" />
|
|
<Button type="primary">Submit</Button>
|
|
</Space.Compact>
|
|
<br />
|
|
<Space.Compact block>
|
|
<Input
|
|
style={{ width: 'calc(100% - 200px)' }}
|
|
defaultValue="git@github.com:ant-design/ant-design.git"
|
|
/>
|
|
<Tooltip title="copy git url">
|
|
<Button icon={<CopyOutlined />} />
|
|
</Tooltip>
|
|
</Space.Compact>
|
|
<br />
|
|
<Space.Compact block>
|
|
<Select defaultValue="Zhejiang" allowClear>
|
|
<Option value="Zhejiang">Zhejiang</Option>
|
|
<Option value="Jiangsu">Jiangsu</Option>
|
|
</Select>
|
|
<Input style={{ width: '50%' }} defaultValue="Xihu District, Hangzhou" />
|
|
</Space.Compact>
|
|
<br />
|
|
<Space.Compact block>
|
|
<Select allowClear mode="multiple" defaultValue="Zhejianggggg" style={{ width: '50%' }}>
|
|
<Option value="Zhejianggggg">Zhejianggggg</Option>
|
|
<Option value="Jiangsu">Jiangsu</Option>
|
|
</Select>
|
|
<Input style={{ width: '50%' }} defaultValue="Xihu District, Hangzhou" />
|
|
</Space.Compact>
|
|
<br />
|
|
<Space.Compact block>
|
|
<Input.Search style={{ width: '30%' }} defaultValue="0571" />
|
|
<Input.Search allowClear style={{ width: '50%' }} defaultValue="26888888" />
|
|
<Input.Search style={{ width: '20%' }} defaultValue="+1" />
|
|
</Space.Compact>
|
|
<br />
|
|
<Space.Compact block>
|
|
<Select defaultValue="Option1">
|
|
<Option value="Option1">Option1</Option>
|
|
<Option value="Option2">Option2</Option>
|
|
</Select>
|
|
<Input style={{ width: '50%' }} defaultValue="input content" />
|
|
<InputNumber defaultValue={12} />
|
|
</Space.Compact>
|
|
<br />
|
|
<Space.Compact block>
|
|
<Input style={{ width: '50%' }} defaultValue="input content" />
|
|
<DatePicker style={{ width: '50%' }} />
|
|
</Space.Compact>
|
|
<br />
|
|
<Space.Compact block>
|
|
<DatePicker.RangePicker style={{ width: '70%' }} />
|
|
<Input style={{ width: '30%' }} defaultValue="input content" />
|
|
<Button type="primary">查询</Button>
|
|
</Space.Compact>
|
|
<br />
|
|
<Space.Compact block>
|
|
<Input style={{ width: '30%' }} defaultValue="input content" />
|
|
<DatePicker.RangePicker style={{ width: '70%' }} />
|
|
</Space.Compact>
|
|
<br />
|
|
<Space.Compact block>
|
|
<Select defaultValue="Option1-1">
|
|
<Option value="Option1-1">Option1-1</Option>
|
|
<Option value="Option1-2">Option1-2</Option>
|
|
</Select>
|
|
<Select defaultValue="Option2-2">
|
|
<Option value="Option2-1">Option2-1</Option>
|
|
<Option value="Option2-2">Option2-2</Option>
|
|
</Select>
|
|
</Space.Compact>
|
|
<br />
|
|
<Space.Compact block>
|
|
<Select defaultValue="1">
|
|
<Option value="1">Between</Option>
|
|
<Option value="2">Except</Option>
|
|
</Select>
|
|
<Input style={{ width: 100, textAlign: 'center' }} placeholder="Minimum" />
|
|
<Input
|
|
className="site-input-split"
|
|
style={{
|
|
width: 30,
|
|
borderLeft: 0,
|
|
borderRight: 0,
|
|
pointerEvents: 'none',
|
|
}}
|
|
placeholder="~"
|
|
disabled
|
|
/>
|
|
<Input
|
|
className="site-input-right"
|
|
style={{
|
|
width: 100,
|
|
textAlign: 'center',
|
|
}}
|
|
placeholder="Maximum"
|
|
/>
|
|
</Space.Compact>
|
|
<br />
|
|
<Space.Compact block>
|
|
<Select defaultValue="Sign Up" style={{ width: '30%' }}>
|
|
<Option value="Sign Up">Sign Up</Option>
|
|
<Option value="Sign In">Sign In</Option>
|
|
</Select>
|
|
<AutoComplete
|
|
style={{ width: '70%' }}
|
|
placeholder="Email"
|
|
options={[{ value: 'text 1' }, { value: 'text 2' }]}
|
|
/>
|
|
</Space.Compact>
|
|
<br />
|
|
<Space.Compact block>
|
|
<TimePicker style={{ width: '70%' }} />
|
|
<Cascader
|
|
style={{ width: '70%' }}
|
|
options={[
|
|
{
|
|
value: 'zhejiang',
|
|
label: 'Zhejiang',
|
|
children: [
|
|
{
|
|
value: 'hangzhou',
|
|
label: 'Hangzhou',
|
|
children: [
|
|
{
|
|
value: 'xihu',
|
|
label: 'West Lake',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
value: 'jiangsu',
|
|
label: 'Jiangsu',
|
|
children: [
|
|
{
|
|
value: 'nanjing',
|
|
label: 'Nanjing',
|
|
children: [
|
|
{
|
|
value: 'zhonghuamen',
|
|
label: 'Zhong Hua Men',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
]}
|
|
placeholder="Select Address"
|
|
/>
|
|
</Space.Compact>
|
|
<br />
|
|
<Space.Compact block>
|
|
<TimePicker.RangePicker />
|
|
<TreeSelect
|
|
showSearch
|
|
style={{ width: '60%' }}
|
|
value="leaf1"
|
|
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
|
placeholder="Please select"
|
|
allowClear
|
|
treeDefaultExpandAll
|
|
onChange={() => {}}
|
|
>
|
|
<TreeNode value="parent 1" title="parent 1">
|
|
<TreeNode value="parent 1-0" title="parent 1-0">
|
|
<TreeNode value="leaf1" title="leaf1" />
|
|
<TreeNode value="leaf2" title="leaf2" />
|
|
</TreeNode>
|
|
<TreeNode value="parent 1-1" title="parent 1-1">
|
|
<TreeNode value="leaf3" title={<b style={{ color: '#08c' }}>leaf3</b>} />
|
|
</TreeNode>
|
|
</TreeNode>
|
|
</TreeSelect>
|
|
<Button type="primary">Submit</Button>
|
|
</Space.Compact>
|
|
<br />
|
|
</div>
|
|
);
|
|
|
|
export default App;
|