forked from ant-design/ant-design
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature-2.12
- Loading branch information
Showing
90 changed files
with
837 additions
and
370 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
const libDir = process.env.LIB_DIR; | ||
|
||
const transformIgnorePatterns = [ | ||
'/dist/', | ||
'/node_modules/reqwest', | ||
]; | ||
|
||
if (libDir !== 'es') { | ||
transformIgnorePatterns.push('/node_modules/'); | ||
} | ||
|
||
module.exports = { | ||
setupFiles: [ | ||
'./tests/setup.js', | ||
], | ||
moduleFileExtensions: [ | ||
'ts', | ||
'tsx', | ||
'js', | ||
'jsx', | ||
'json', | ||
'md', | ||
], | ||
modulePathIgnorePatterns: [ | ||
'/_site/', | ||
], | ||
testPathIgnorePatterns: [ | ||
'/node_modules/', | ||
'dekko', | ||
'node', | ||
], | ||
transform: { | ||
'\\.tsx?$': './node_modules/typescript-babel-jest', | ||
'\\.js$': './node_modules/babel-jest', | ||
'\\.md$': './node_modules/antd-demo-jest', | ||
}, | ||
testRegex: libDir === 'dist' ? 'demo\\.test\\.js$' : '.*\\.test\\.js$', | ||
collectCoverageFrom: [ | ||
'components/**/*.{ts,tsx}', | ||
'!components/*/style/index.tsx', | ||
'!components/style/index.tsx', | ||
'!components/*/locale/index.tsx', | ||
], | ||
transformIgnorePatterns, | ||
snapshotSerializers: [ | ||
'enzyme-to-json/serializer', | ||
], | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module.exports = { | ||
setupFiles: [ | ||
'./tests/setup.js', | ||
], | ||
moduleFileExtensions: [ | ||
'ts', | ||
'tsx', | ||
'js', | ||
'md', | ||
], | ||
transform: { | ||
'\\.tsx?$': './node_modules/typescript-babel-jest', | ||
'\\.js$': './node_modules/babel-jest', | ||
'\\.md$': './node_modules/antd-demo-jest', | ||
}, | ||
testRegex: 'demo\\.test\\.js$', | ||
testEnvironment: 'node', | ||
snapshotSerializers: [ | ||
'enzyme-to-json/serializer' | ||
], | ||
}; |
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react'; | ||
import { mount } from 'enzyme'; | ||
import BackTop from '..'; | ||
|
||
const delay = timeout => new Promise(resolve => setTimeout(resolve, timeout)); | ||
|
||
describe('BackTop', () => { | ||
it('should scroll to top after click it', async () => { | ||
const wrapper = mount(<BackTop visibilityHeight={-1} />); | ||
document.documentElement.scrollTop = 400; | ||
// trigger scroll manually | ||
wrapper.node.handleScroll(); | ||
await delay(500); | ||
wrapper.find('.ant-back-top').simulate('click'); | ||
await delay(500); | ||
expect(Math.round(document.documentElement.scrollTop)).toBe(0); | ||
}); | ||
}); |
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
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react'; | ||
import classNames from 'classnames'; | ||
|
||
export interface CardGridProps { | ||
prefixCls?: string; | ||
style?: React.CSSProperties; | ||
className?: string; | ||
} | ||
|
||
export default (props: CardGridProps) => { | ||
const { prefixCls = 'ant-card', className, ...others } = props; | ||
const classString = classNames(`${prefixCls}-grid`, className); | ||
return <div {...others} className={classString} />; | ||
}; |
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
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
order: 6 | ||
title: | ||
zh-CN: 网格型内嵌卡片 | ||
en-US: Grid card | ||
--- | ||
|
||
## zh-CN | ||
|
||
一种常见的卡片内容区隔模式。 | ||
|
||
## en-US | ||
|
||
Grid style card content. | ||
|
||
````jsx | ||
import { Card } from 'antd'; | ||
|
||
const gridStyle = { | ||
width: '25%', | ||
textAlign: 'center', | ||
}; | ||
|
||
ReactDOM.render( | ||
<Card title="卡片标题" noHovering bodyStyle={{ padding: 0 }}> | ||
<Card.Grid style={gridStyle}>卡片内容</Card.Grid> | ||
<Card.Grid style={gridStyle}>卡片内容</Card.Grid> | ||
<Card.Grid style={gridStyle}>卡片内容</Card.Grid> | ||
<Card.Grid style={gridStyle}>卡片内容</Card.Grid> | ||
<Card.Grid style={gridStyle}>卡片内容</Card.Grid> | ||
<Card.Grid style={gridStyle}>卡片内容</Card.Grid> | ||
<Card.Grid style={gridStyle}>卡片内容</Card.Grid> | ||
</Card> | ||
, mountNode); | ||
```` |
Oops, something went wrong.