mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-30 02:59:04 +08:00
commit
f65db14a88
@ -48,7 +48,6 @@
|
||||
&-select {
|
||||
position: relative; // Fix chrome weird render bug
|
||||
float: left;
|
||||
box-sizing: border-box;
|
||||
height: 226px;
|
||||
overflow: hidden;
|
||||
font-size: @font-size-base;
|
||||
@ -68,7 +67,6 @@
|
||||
}
|
||||
|
||||
ul {
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
max-height: 206px;
|
||||
margin: 0;
|
||||
@ -77,30 +75,35 @@
|
||||
}
|
||||
|
||||
li {
|
||||
box-sizing: content-box;
|
||||
width: 100%;
|
||||
height: 24px;
|
||||
margin: 0;
|
||||
padding-left: 32px;
|
||||
line-height: 24px;
|
||||
text-align: center;
|
||||
list-style: none;
|
||||
cursor: pointer;
|
||||
transition: background 0.3s ease;
|
||||
transition: all .3s;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
li:last-child::after {
|
||||
display: block;
|
||||
height: 202px;
|
||||
content: '';
|
||||
}
|
||||
&:last-child::after {
|
||||
display: block;
|
||||
height: 202px;
|
||||
content: '';
|
||||
}
|
||||
|
||||
li:hover {
|
||||
background: @item-hover-bg;
|
||||
&:hover {
|
||||
background: @item-hover-bg;
|
||||
}
|
||||
|
||||
&:focus {
|
||||
color: @primary-color;
|
||||
font-weight: 600;
|
||||
outline: none;
|
||||
}
|
||||
}
|
||||
|
||||
li&-option-selected {
|
||||
font-weight: bold;
|
||||
font-weight: 600;
|
||||
background: @time-picker-selected-bg;
|
||||
}
|
||||
|
||||
|
@ -241,7 +241,11 @@ describe('utils', () => {
|
||||
expect(errorSpy).toHaveBeenLastCalledWith(
|
||||
"Warning: [antd: Icon] Icon 'canlendar' is typo and depracated, please use 'calendar' instead.",
|
||||
);
|
||||
expect(errorSpy).toHaveBeenCalledTimes(3);
|
||||
render(<Icon type="colum-height" />);
|
||||
expect(errorSpy).toHaveBeenLastCalledWith(
|
||||
"Warning: [antd: Icon] Icon 'colum-height' is typo and depracated, please use 'column-height' instead.",
|
||||
);
|
||||
expect(errorSpy).toHaveBeenCalledTimes(4);
|
||||
errorSpy.mockRestore();
|
||||
});
|
||||
});
|
||||
|
@ -63,6 +63,10 @@ export function alias(type: string) {
|
||||
case 'canlendar':
|
||||
newType = 'calendar';
|
||||
break;
|
||||
// https://github.com/ant-design/ant-design/issues/17448
|
||||
case 'colum-height':
|
||||
newType = 'column-height';
|
||||
break;
|
||||
default:
|
||||
}
|
||||
warning(
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Popconfirm should show overlay when trigger is clicked 1`] = `"<div class=\\"ant-popover-content\\"><div class=\\"ant-popover-arrow\\"></div><div class=\\"ant-popover-inner\\" role=\\"tooltip\\"><div><div class=\\"ant-popover-inner-content\\"><div class=\\"ant-popover-message\\"><i aria-label=\\"icon: exclamation-circle\\" class=\\"anticon anticon-exclamation-circle\\"><svg viewBox=\\"64 64 896 896\\" class=\\"\\" data-icon=\\"exclamation-circle\\" width=\\"1em\\" height=\\"1em\\" fill=\\"currentColor\\" aria-hidden=\\"true\\" focusable=\\"false\\"><path d=\\"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 0 1 0-96 48.01 48.01 0 0 1 0 96z\\"></path></svg></i><div class=\\"ant-popover-message-title\\">code</div></div><div class=\\"ant-popover-buttons\\"><button type=\\"button\\" class=\\"ant-btn ant-btn-sm\\"><span>Cancel</span></button><button type=\\"button\\" class=\\"ant-btn ant-btn-primary ant-btn-sm\\"><span>OK</span></button></div></div></div></div></div>"`;
|
||||
exports[`Popconfirm should show overlay when trigger is clicked 1`] = `"<div class=\\"ant-popover-content\\"><div class=\\"ant-popover-arrow\\"></div><div class=\\"ant-popover-inner\\" role=\\"tooltip\\"><div><div class=\\"ant-popover-inner-content\\"><div class=\\"ant-popover-message\\"><i aria-label=\\"icon: exclamation-circle\\" class=\\"anticon anticon-exclamation-circle\\"><svg viewBox=\\"64 64 896 896\\" focusable=\\"false\\" class=\\"\\" data-icon=\\"exclamation-circle\\" width=\\"1em\\" height=\\"1em\\" fill=\\"currentColor\\" aria-hidden=\\"true\\"><path d=\\"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 0 1 0-96 48.01 48.01 0 0 1 0 96z\\"></path></svg></i><div class=\\"ant-popover-message-title\\">code</div></div><div class=\\"ant-popover-buttons\\"><button type=\\"button\\" class=\\"ant-btn ant-btn-sm\\"><span>Cancel</span></button><button type=\\"button\\" class=\\"ant-btn ant-btn-primary ant-btn-sm\\"><span>OK</span></button></div></div></div></div></div>"`;
|
||||
|
||||
exports[`Popconfirm should show overlay when trigger is clicked 2`] = `"<div class=\\"ant-popover-content\\"><div class=\\"ant-popover-arrow\\"></div><div class=\\"ant-popover-inner\\" role=\\"tooltip\\"><div><div class=\\"ant-popover-inner-content\\"><div class=\\"ant-popover-message\\"><i aria-label=\\"icon: exclamation-circle\\" class=\\"anticon anticon-exclamation-circle\\"><svg viewBox=\\"64 64 896 896\\" class=\\"\\" data-icon=\\"exclamation-circle\\" width=\\"1em\\" height=\\"1em\\" fill=\\"currentColor\\" aria-hidden=\\"true\\" focusable=\\"false\\"><path d=\\"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 0 1 0-96 48.01 48.01 0 0 1 0 96z\\"></path></svg></i><div class=\\"ant-popover-message-title\\">code</div></div><div class=\\"ant-popover-buttons\\"><button type=\\"button\\" class=\\"ant-btn ant-btn-sm\\"><span>Cancel</span></button><button type=\\"button\\" class=\\"ant-btn ant-btn-primary ant-btn-sm\\"><span>OK</span></button></div></div></div></div></div>"`;
|
||||
exports[`Popconfirm should show overlay when trigger is clicked 2`] = `"<div class=\\"ant-popover-content\\"><div class=\\"ant-popover-arrow\\"></div><div class=\\"ant-popover-inner\\" role=\\"tooltip\\"><div><div class=\\"ant-popover-inner-content\\"><div class=\\"ant-popover-message\\"><i aria-label=\\"icon: exclamation-circle\\" class=\\"anticon anticon-exclamation-circle\\"><svg viewBox=\\"64 64 896 896\\" focusable=\\"false\\" class=\\"\\" data-icon=\\"exclamation-circle\\" width=\\"1em\\" height=\\"1em\\" fill=\\"currentColor\\" aria-hidden=\\"true\\"><path d=\\"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 0 1 0-96 48.01 48.01 0 0 1 0 96z\\"></path></svg></i><div class=\\"ant-popover-message-title\\">code</div></div><div class=\\"ant-popover-buttons\\"><button type=\\"button\\" class=\\"ant-btn ant-btn-sm\\"><span>Cancel</span></button><button type=\\"button\\" class=\\"ant-btn ant-btn-primary ant-btn-sm\\"><span>OK</span></button></div></div></div></div></div>"`;
|
||||
|
File diff suppressed because it is too large
Load Diff
28
components/result/demo/403.md
Normal file
28
components/result/demo/403.md
Normal file
@ -0,0 +1,28 @@
|
||||
---
|
||||
order: 4
|
||||
title:
|
||||
zh-CN: 403
|
||||
en-US: 403
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
||||
你没有此页面的访问权限。
|
||||
|
||||
## en-US
|
||||
|
||||
you are not authorized to access this page.
|
||||
|
||||
```jsx
|
||||
import { Result, Button } from 'antd';
|
||||
|
||||
ReactDOM.render(
|
||||
<Result
|
||||
status="403"
|
||||
title="403"
|
||||
subTitle="Sorry, you are not authorized to access this page."
|
||||
extra={<Button type="primary">Back Home</Button>}
|
||||
/>,
|
||||
mountNode,
|
||||
);
|
||||
```
|
28
components/result/demo/404.md
Normal file
28
components/result/demo/404.md
Normal file
@ -0,0 +1,28 @@
|
||||
---
|
||||
order: 5
|
||||
title:
|
||||
zh-CN: 404
|
||||
en-US: 404
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
||||
此页面未找到。
|
||||
|
||||
## en-US
|
||||
|
||||
The page you visited does not exist.
|
||||
|
||||
```jsx
|
||||
import { Result, Button } from 'antd';
|
||||
|
||||
ReactDOM.render(
|
||||
<Result
|
||||
status="404"
|
||||
title="404"
|
||||
subTitle="'Sorry, the page you visited does not exist."
|
||||
extra={<Button type="primary">Back Home</Button>}
|
||||
/>,
|
||||
mountNode,
|
||||
);
|
||||
```
|
28
components/result/demo/500.md
Normal file
28
components/result/demo/500.md
Normal file
@ -0,0 +1,28 @@
|
||||
---
|
||||
order: 6
|
||||
title:
|
||||
zh-CN: 500
|
||||
en-US: 500
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
||||
服务器发生了错误。
|
||||
|
||||
## en-US
|
||||
|
||||
The server is wrong.
|
||||
|
||||
```jsx
|
||||
import { Result, Button } from 'antd';
|
||||
|
||||
ReactDOM.render(
|
||||
<Result
|
||||
status="500"
|
||||
title="500"
|
||||
subTitle="Sorry, the server is wrong."
|
||||
extra={<Button type="primary">Back Home</Button>}
|
||||
/>,
|
||||
mountNode,
|
||||
);
|
||||
```
|
@ -1,106 +0,0 @@
|
||||
---
|
||||
order: 0
|
||||
title:
|
||||
zh-CN: 基本
|
||||
en-US: Basic
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
||||
默认支持的各种状态的展示。
|
||||
|
||||
## en-US
|
||||
|
||||
The display of the default status.
|
||||
|
||||
```jsx
|
||||
import { Result, Radio, Button } from 'antd';
|
||||
|
||||
const StatusMap = {
|
||||
'403': {
|
||||
title: '403',
|
||||
subTitle: 'Sorry, you are not authorized to access this page.',
|
||||
extra: <Button type="primary">Back Home</Button>,
|
||||
},
|
||||
'404': {
|
||||
title: '404',
|
||||
subTitle: 'Sorry, the page you visited does not exist.',
|
||||
extra: <Button type="primary">Back Home</Button>,
|
||||
},
|
||||
'500': {
|
||||
title: '500',
|
||||
subTitle: 'Sorry, the server is wrong.',
|
||||
extra: <Button type="primary">Back Home</Button>,
|
||||
},
|
||||
success: {
|
||||
title: 'Successfully Purchased Cloud Server ECS!',
|
||||
subTitle:
|
||||
'Order number: 2017182818828182881 Cloud server configuration takes 1-5 minutes, please wait.',
|
||||
extra: [
|
||||
<Button type="primary" key="console">
|
||||
Go Console
|
||||
</Button>,
|
||||
<Button key="buy">Buy Again</Button>,
|
||||
],
|
||||
},
|
||||
info: {
|
||||
title: 'Your operation has been executed',
|
||||
extra: (
|
||||
<Button type="primary" key="console">
|
||||
Go Console
|
||||
</Button>
|
||||
),
|
||||
},
|
||||
error: {
|
||||
title: 'Submission Failed',
|
||||
subTitle: 'Please check and modify the following information before resubmitting.',
|
||||
extra: [
|
||||
<Button type="primary" key="console">
|
||||
Go Console
|
||||
</Button>,
|
||||
],
|
||||
},
|
||||
warning: {
|
||||
title: 'There are some problems with your operation.',
|
||||
extra: (
|
||||
<Button type="primary" key="console">
|
||||
Go Console
|
||||
</Button>
|
||||
),
|
||||
},
|
||||
};
|
||||
|
||||
const StatusArray = Object.keys(StatusMap);
|
||||
|
||||
class ResultDemo extends React.Component {
|
||||
state = {
|
||||
status: '403',
|
||||
};
|
||||
|
||||
onChange = e => {
|
||||
console.log('status checked', e.target.value);
|
||||
this.setState({
|
||||
status: e.target.value,
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { status } = this.state;
|
||||
const resultProps = StatusMap[status];
|
||||
return (
|
||||
<div>
|
||||
<p>
|
||||
<Radio.Group onChange={this.onChange} value={status}>
|
||||
{StatusArray.map(statusItem => (
|
||||
<Radio value={statusItem}>{statusItem}</Radio>
|
||||
))}
|
||||
</Radio.Group>
|
||||
</p>
|
||||
<Result status={status} {...resultProps} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
ReactDOM.render(<ResultDemo />, mountNode);
|
||||
```
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
order: 2
|
||||
order: 8
|
||||
title:
|
||||
zh-CN: 自定义 icon
|
||||
en-US: Custom icon
|
||||
|
@ -1,22 +1,22 @@
|
||||
---
|
||||
order: 1
|
||||
order: 7
|
||||
title:
|
||||
zh-CN: 复杂的例子
|
||||
en-US: Complex example
|
||||
zh-CN: Error
|
||||
en-US: Error
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
||||
提供更加复杂的反馈。
|
||||
复杂的错误反馈。
|
||||
|
||||
## en-US
|
||||
|
||||
Provide more complex feedback.
|
||||
Complex error feedback.
|
||||
|
||||
```jsx
|
||||
import { Result, Button, Icon, Typography } from 'antd';
|
||||
|
||||
const { Title, Paragraph } = Typography;
|
||||
const { Paragraph, Text } = Typography;
|
||||
|
||||
ReactDOM.render(
|
||||
<Result
|
||||
@ -31,14 +31,23 @@ ReactDOM.render(
|
||||
]}
|
||||
>
|
||||
<div className="desc">
|
||||
<Title level={4}>The content you submitted has the following error:</Title>
|
||||
<Paragraph>
|
||||
<Text
|
||||
strong
|
||||
style={{
|
||||
fontSize: 16,
|
||||
}}
|
||||
>
|
||||
The content you submitted has the following error:
|
||||
</Text>
|
||||
</Paragraph>
|
||||
<Paragraph>
|
||||
<Icon style={{ color: 'red' }} type="close-circle" /> Your account has been frozen{' '}
|
||||
<a>Thaw immediately ></a>
|
||||
</Paragraph>
|
||||
<Paragraph>
|
||||
<Icon type="close-circle" /> Your account is not yet eligible to apply{' '}
|
||||
<a>Apply immediately ></a>
|
||||
<Icon style={{ color: 'red' }} type="close-circle" /> Your account is not yet eligible to
|
||||
apply <a>Apply Unlock ></a>
|
||||
</Paragraph>
|
||||
</div>
|
||||
</Result>,
|
30
components/result/demo/info.md
Normal file
30
components/result/demo/info.md
Normal file
@ -0,0 +1,30 @@
|
||||
---
|
||||
order: 1
|
||||
title:
|
||||
zh-CN: Info
|
||||
en-US: Info
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
||||
展示处理结果。
|
||||
|
||||
## en-US
|
||||
|
||||
Show processing results.
|
||||
|
||||
```jsx
|
||||
import { Result, Button } from 'antd';
|
||||
|
||||
ReactDOM.render(
|
||||
<Result
|
||||
title="Your operation has been executed"
|
||||
extra={
|
||||
<Button type="primary" key="console">
|
||||
Go Console
|
||||
</Button>
|
||||
}
|
||||
/>,
|
||||
mountNode,
|
||||
);
|
||||
```
|
33
components/result/demo/success.md
Normal file
33
components/result/demo/success.md
Normal file
@ -0,0 +1,33 @@
|
||||
---
|
||||
order: 0
|
||||
title:
|
||||
zh-CN: Success
|
||||
en-US: Success
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
||||
成功的结果。
|
||||
|
||||
## en-US
|
||||
|
||||
Show successful results.
|
||||
|
||||
```jsx
|
||||
import { Result, Button } from 'antd';
|
||||
|
||||
ReactDOM.render(
|
||||
<Result
|
||||
status="success"
|
||||
title="Successfully Purchased Cloud Server ECS!"
|
||||
subTitle="Order number: 2017182818828182881 Cloud server configuration takes 1-5 minutes, please wait."
|
||||
extra={[
|
||||
<Button type="primary" key="console">
|
||||
Go Console
|
||||
</Button>,
|
||||
<Button key="buy">Buy Again</Button>,
|
||||
]}
|
||||
/>,
|
||||
mountNode,
|
||||
);
|
||||
```
|
31
components/result/demo/warning.md
Normal file
31
components/result/demo/warning.md
Normal file
@ -0,0 +1,31 @@
|
||||
---
|
||||
order: 2
|
||||
title:
|
||||
zh-CN: Warning
|
||||
en-US: Warning
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
||||
警告类型的结果。
|
||||
|
||||
## en-US
|
||||
|
||||
The result of the warning.
|
||||
|
||||
```jsx
|
||||
import { Result, Button } from 'antd';
|
||||
|
||||
ReactDOM.render(
|
||||
<Result
|
||||
status="warning"
|
||||
title="There are some problems with your operation."
|
||||
extra={
|
||||
<Button type="primary" key="console">
|
||||
Go Console
|
||||
</Button>
|
||||
}
|
||||
/>,
|
||||
mountNode,
|
||||
);
|
||||
```
|
@ -39,7 +39,6 @@
|
||||
|
||||
&-wrap {
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
padding: 7px 2px 7px @control-padding-horizontal;
|
||||
border-bottom: @border-width-base @border-style-base @border-color-split;
|
||||
}
|
||||
@ -56,7 +55,6 @@
|
||||
&-select {
|
||||
position: relative; // Fix chrome weird render bug
|
||||
float: left;
|
||||
box-sizing: border-box;
|
||||
width: @time-picker-panel-column-width;
|
||||
max-height: @timepicker-item-height * 6;
|
||||
overflow: hidden;
|
||||
@ -81,7 +79,6 @@
|
||||
}
|
||||
|
||||
ul {
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
padding: 0 0 @timepicker-item-height * 5;
|
||||
@ -89,7 +86,6 @@
|
||||
}
|
||||
|
||||
li {
|
||||
box-sizing: content-box;
|
||||
width: 100%;
|
||||
height: @timepicker-item-height;
|
||||
margin: 0;
|
||||
@ -98,8 +94,14 @@
|
||||
text-align: left;
|
||||
list-style: none;
|
||||
cursor: pointer;
|
||||
transition: background 0.3s;
|
||||
transition: all 0.3s;
|
||||
user-select: none;
|
||||
|
||||
&:focus {
|
||||
color: @primary-color;
|
||||
font-weight: 600;
|
||||
outline: none;
|
||||
}
|
||||
}
|
||||
|
||||
li:hover {
|
||||
@ -107,7 +109,7 @@
|
||||
}
|
||||
|
||||
li&-option-selected {
|
||||
font-weight: bold;
|
||||
font-weight: 600;
|
||||
background: @time-picker-selected-bg;
|
||||
&:hover {
|
||||
background: @time-picker-selected-bg;
|
||||
|
@ -43,7 +43,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@ant-design/create-react-context": "^0.2.4",
|
||||
"@ant-design/icons": "~2.1.0",
|
||||
"@ant-design/icons": "~2.1.1",
|
||||
"@ant-design/icons-react": "~2.0.1",
|
||||
"@types/react-slick": "^0.23.4",
|
||||
"array-tree-filter": "^2.1.0",
|
||||
|
@ -6,7 +6,9 @@ Object.keys(manifest).forEach(theme => {
|
||||
});
|
||||
|
||||
// Hide typo-name icons
|
||||
allIcons = allIcons.filter((name: string) => !['interation', 'canlendar'].includes(name));
|
||||
allIcons = allIcons.filter(
|
||||
(name: string) => !['interation', 'canlendar', 'colum-height'].includes(name),
|
||||
);
|
||||
|
||||
export const categories = {
|
||||
all: [...new Set(allIcons)],
|
||||
@ -125,8 +127,6 @@ export const categories = {
|
||||
'font-colors',
|
||||
'font-size',
|
||||
'line-height',
|
||||
'colum-height',
|
||||
'colum-width',
|
||||
'dash',
|
||||
'small-dash',
|
||||
'sort-ascending',
|
||||
@ -136,6 +136,7 @@ export const categories = {
|
||||
'unordered-list',
|
||||
'radius-setting',
|
||||
'column-width',
|
||||
'column-height',
|
||||
],
|
||||
data: [
|
||||
'area-chart',
|
||||
|
Loading…
Reference in New Issue
Block a user