mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-30 14:29:33 +08:00
Merge pull request #17103 from ant-design/feature-to-resolve-conflict-with-master
Feature to resolve conflict with master
This commit is contained in:
commit
f5382c1cee
@ -15,6 +15,41 @@ timeline: true
|
||||
|
||||
---
|
||||
|
||||
## 3.19.3
|
||||
|
||||
`2019-06-06`
|
||||
|
||||
- 📝 Add FAQ for DatePicker/RangePicker with `mode` cannot be selected. [#16984](https://github.com/ant-design/ant-design/pull/16984)
|
||||
- 🐞 Fix Breadcrumb validateDOMNesting warning. [#16929](https://github.com/ant-design/ant-design/pull/16929)
|
||||
- 🐞 Fix Breadcrumb path error when `children` is selected. [#16885](https://github.com/ant-design/ant-design/pull/16885) [@haianweifeng](https://github.com/haianweifeng)
|
||||
- 🐞 Fix InputNumber with `number` type display native spinner. [#16926](https://github.com/ant-design/ant-design/pull/16926)
|
||||
- 🐞 Fix Transfer render Empty when customize without data. [#16925](https://github.com/ant-design/ant-design/pull/16925)
|
||||
- 🐞 **Fix Table header extra vertical scrollbar problem.** [#16950](https://github.com/ant-design/ant-design/pull/16950)
|
||||
- 🐞 Fix Table miss `border-radius` in Firefox. [#16957](https://github.com/ant-design/ant-design/pull/16957)
|
||||
- 🐞 Fix Table error when `rowSelection.getCheckboxProps()` has no return value. [#15224](https://github.com/ant-design/ant-design/pull/15224)
|
||||
- 🐞 Fix Table abnormal scrollbar in Chrome when using `title` and `rowSelection`.
|
||||
[#16934](https://github.com/ant-design/ant-design/pull/16934)
|
||||
- 🐞 Fix Divider `orientation="center"` style. [#16988](https://github.com/ant-design/ant-design/pull/16988)
|
||||
- 🐞 Fix Cascader error when type space. [#16918](https://github.com/ant-design/ant-design/pull/16918) [@Durisvk](https://github.com/Durisvk)
|
||||
- 🐞 Fix missing spanish translations. [#17002](https://github.com/ant-design/ant-design/pull/17002) [@morellan](https://github.com/morellan)
|
||||
- TypeScript
|
||||
- 🐞 Fix Upload `RcFile` definition. [#16851](https://github.com/ant-design/ant-design/pull/16851)
|
||||
- ⚡️ Export `TextProps` type in Typography. [#17003](https://github.com/ant-design/ant-design/pull/17003) [@Jarvis1010](https://github.com/Jarvis1010)
|
||||
|
||||
## 3.19.2
|
||||
|
||||
`2019-06-01`
|
||||
|
||||
- 🐞 Fix Tabs vertical card mode not scrollable. [#16825](https://github.com/ant-design/ant-design/pull/16825)
|
||||
- 🐞 Fix Transfer warn `setStart` on an unmounted component. [#16822](https://github.com/ant-design/ant-design/pull/16822) [@shiningjason](https://github.com/shiningjason)
|
||||
- 💄 Using less variables `@error-color`, `@warning-color` instead of `@text-color-danger`, `@text-color-warning`. [#16890](https://github.com/ant-design/ant-design/pull/16890) [@MrHeer](https://github.com/MrHeer)
|
||||
- 💄 Add warning if Menu use `inlineCollapsed` under Sider. [#16826](https://github.com/ant-design/ant-design/pull/16826)
|
||||
- TypeScript
|
||||
- ⚡️ Add `forceSubmenuRender` into MenuProps. [#16827](https://github.com/ant-design/ant-design/pull/16827)
|
||||
- ⚡️ Export `TypographyProps` type. [#16835](https://github.com/ant-design/ant-design/pull/16835)
|
||||
- ⚡️ Add `onChange` prop type definition to Steps. [#16845](https://github.com/ant-design/ant-design/pull/16845) [@JonathanLee-LX](https://github.com/JonathanLee-LX)
|
||||
- ⚡️ Add `webkitRelativePath` prop type definition to Upload. [#16850](https://github.com/ant-design/ant-design/pull/16850) [@DiamondYuan](https://github.com/DiamondYuan)
|
||||
|
||||
## 3.19.1
|
||||
|
||||
`2019-05-27`
|
||||
|
@ -15,6 +15,40 @@ timeline: true
|
||||
|
||||
---
|
||||
|
||||
## 3.19.3
|
||||
|
||||
`2019-06-06`
|
||||
|
||||
- 📝 增加 DatePicker/RangePicker 指定 `mode` 后无法选择的文档说明。[#16984](https://github.com/ant-design/ant-design/pull/16984)
|
||||
- 🐞 修复 Breadcrumb 的 `validateDOMNesting` 警告信息。[#16929](https://github.com/ant-design/ant-design/pull/16929)
|
||||
- 🐞 修复 Breadcrumb 选中子路由时浏览器路径问题。[#16885](https://github.com/ant-design/ant-design/pull/16885) [@haianweifeng](https://github.com/haianweifeng)
|
||||
- 🐞 修复 InputNumber 设置 `number` 类型时会展示原生按钮的问题。[#16926](https://github.com/ant-design/ant-design/pull/16926)
|
||||
- 🐞 修复 Transfer 在自定义列表为空时展示 Empty 样式。[#16925](https://github.com/ant-design/ant-design/pull/16925)
|
||||
- 🐞 **修复 Table 头部多余的垂直滚动条样式。**[#16950](https://github.com/ant-design/ant-design/pull/16950)
|
||||
- 🐞 修复 Table 的 `rowSelection.getCheckboxProps()` 在没有返回值时报错的问题。[#15224](https://github.com/ant-design/ant-design/pull/15224)
|
||||
- 🐞 修复 Firefox 的 Table 丢失 `border-radius` 样式问题。[#16957](https://github.com/ant-design/ant-design/pull/16957)
|
||||
- 🐞 修复 Table 当 `title` 和 `rowSelection` 同时指定时在 Chrome 下滚动条异常的问题。[#16934](https://github.com/ant-design/ant-design/pull/16934)
|
||||
- 🐞 修复 Divider `orientation="center"` 时样式错位的问题。[#16988](https://github.com/ant-design/ant-design/pull/16988)
|
||||
- 🐞 修复 Cascader 搜索时不支持空格输入的问题。[#16918](https://github.com/ant-design/ant-design/pull/16918) [@Durisvk](https://github.com/Durisvk)
|
||||
- 🐞 修复部分组件的西班牙语言翻译。[#17002](https://github.com/ant-design/ant-design/pull/17002) [@morellan](https://github.com/morellan)
|
||||
- TypeScript
|
||||
- 🐞 修复 Upload 的 `RcFile` 类型定义。[#16851](https://github.com/ant-design/ant-design/pull/16851)
|
||||
- ⚡️ 导出 Typography 中 `TextProps` 的类型定义。[#17003](https://github.com/ant-design/ant-design/pull/17003) [@Jarvis1010](https://github.com/Jarvis1010)
|
||||
|
||||
## 3.19.2
|
||||
|
||||
`2019-06-01`
|
||||
|
||||
- 🐞 修复 Tabs 在垂直卡片模式下标签不能滚动的问题。[#16825](https://github.com/ant-design/ant-design/pull/16825)
|
||||
- 🐞 修复 Transfer 组件在 unmount 时 `setState` 警告。[#16822](https://github.com/ant-design/ant-design/pull/16822) [@shiningjason](https://github.com/shiningjason)
|
||||
- 💄 使用 Less 变量 `@error-color`、`@warning-color` 代替 `@text-color-danger`、`@text-color-warning`。[#16890](https://github.com/ant-design/ant-design/pull/16890) [@MrHeer](https://github.com/MrHeer)
|
||||
- 💄 增加在 Sider 内 Menu 使用 `inlineCollapsed` 时的提示信息。[#16826](https://github.com/ant-design/ant-design/pull/16826)
|
||||
- TypeScript
|
||||
- ⚡️ 增加 Menu 中 `forceSubMenuRender` 类型定义。[#16827](https://github.com/ant-design/ant-design/pull/16827)
|
||||
- ⚡️ 导出 Typography 类型定义。[#16835](https://github.com/ant-design/ant-design/pull/16835)
|
||||
- ⚡️ 增加 Steps 中的 `onChange` 类型定义。[#16845](https://github.com/ant-design/ant-design/pull/16845) [@JonathanLee-LX](https://github.com/JonathanLee-LX)
|
||||
- ⚡️ 增加 Upload 中 `webkitRelativePath` 类型定义。[#16850](https://github.com/ant-design/ant-design/pull/16850) [@DiamondYuan](https://github.com/DiamondYuan)
|
||||
|
||||
## 3.19.1
|
||||
|
||||
`2019-05-27`
|
||||
|
@ -443,6 +443,7 @@ exports[`renders ./components/auto-complete/demo/uncertain-category.md correctly
|
||||
>
|
||||
<button
|
||||
class="ant-btn search-btn ant-btn-primary ant-btn-lg"
|
||||
style="margin-right:-12px"
|
||||
type="button"
|
||||
>
|
||||
<i
|
||||
|
@ -20,7 +20,7 @@ const { Option, OptGroup } = AutoComplete;
|
||||
|
||||
const dataSource = [
|
||||
{
|
||||
title: '话题',
|
||||
title: 'Libraries',
|
||||
children: [
|
||||
{
|
||||
title: 'AntDesign',
|
||||
@ -33,23 +33,23 @@ const dataSource = [
|
||||
],
|
||||
},
|
||||
{
|
||||
title: '问题',
|
||||
title: 'Solutions',
|
||||
children: [
|
||||
{
|
||||
title: 'AntDesign UI 有多好',
|
||||
title: 'AntDesign UI',
|
||||
count: 60100,
|
||||
},
|
||||
{
|
||||
title: 'AntDesign 是啥',
|
||||
title: 'AntDesign',
|
||||
count: 30010,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: '文章',
|
||||
title: 'Articles',
|
||||
children: [
|
||||
{
|
||||
title: 'AntDesign 是一个设计语言',
|
||||
title: 'AntDesign design language',
|
||||
count: 100000,
|
||||
},
|
||||
],
|
||||
@ -66,7 +66,7 @@ function renderTitle(title) {
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
更多
|
||||
more
|
||||
</a>
|
||||
</span>
|
||||
);
|
||||
@ -78,7 +78,7 @@ const options = dataSource
|
||||
{group.children.map(opt => (
|
||||
<Option key={opt.title} value={opt.title}>
|
||||
{opt.title}
|
||||
<span className="certain-search-item-count">{opt.count} 人 关注</span>
|
||||
<span className="certain-search-item-count">{opt.count} people</span>
|
||||
</Option>
|
||||
))}
|
||||
</OptGroup>
|
||||
@ -86,7 +86,7 @@ const options = dataSource
|
||||
.concat([
|
||||
<Option disabled key="all" className="show-all">
|
||||
<a href="https://www.google.com/search?q=antd" target="_blank" rel="noopener noreferrer">
|
||||
查看所有结果
|
||||
View all results
|
||||
</a>
|
||||
</Option>,
|
||||
]);
|
||||
|
@ -42,7 +42,7 @@ function renderOption(item) {
|
||||
<Option key={item.category} text={item.category}>
|
||||
<div className="global-search-item">
|
||||
<span className="global-search-item-desc">
|
||||
{item.query} 在
|
||||
Found {item.query} on
|
||||
<a
|
||||
href={`https://s.taobao.com/search?q=${item.query}`}
|
||||
target="_blank"
|
||||
@ -50,9 +50,8 @@ function renderOption(item) {
|
||||
>
|
||||
{item.category}
|
||||
</a>
|
||||
区块中
|
||||
</span>
|
||||
<span className="global-search-item-count">约 {item.count} 个结果</span>
|
||||
<span className="global-search-item-count">{item.count} results</span>
|
||||
</div>
|
||||
</Option>
|
||||
);
|
||||
@ -85,7 +84,12 @@ class Complete extends React.Component {
|
||||
>
|
||||
<Input
|
||||
suffix={
|
||||
<Button className="search-btn" size="large" type="primary">
|
||||
<Button
|
||||
className="search-btn"
|
||||
style={{ marginRight: -12 }}
|
||||
size="large"
|
||||
type="primary"
|
||||
>
|
||||
<Icon type="search" />
|
||||
</Button>
|
||||
}
|
||||
@ -116,10 +120,6 @@ ReactDOM.render(<Complete />, mountNode);
|
||||
padding-right: 62px;
|
||||
}
|
||||
|
||||
.global-search.ant-select-auto-complete .ant-input-affix-wrapper .ant-input-suffix {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.global-search.ant-select-auto-complete .ant-input-affix-wrapper .ant-input-suffix button {
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
|
@ -31,6 +31,7 @@ const dataSource = ['12345', '23456', '34567'];
|
||||
| defaultValue | 指定默认选中的条目 | string\|string\[]\| 无 |
|
||||
| disabled | 是否禁用 | boolean | false |
|
||||
| filterOption | 是否根据输入项进行筛选。当其为一个函数时,会接收 `inputValue` `option` 两个参数,当 `option` 符合筛选条件时,应返回 `true`,反之则返回 `false`。 | boolean or function(inputValue, option) | true |
|
||||
| getPopupContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。[示例](https://codesandbox.io/s/4j168r7jw0) | Function(triggerNode) | () => document.body |
|
||||
| optionLabelProp | 回填到选择框的 Option 的属性值,默认是 Option 的子元素。比如在子元素需要高亮效果时,此值可以设为 `value`。 | string | `children` |
|
||||
| placeholder | 输入框提示 | string | - |
|
||||
| value | 指定当前选中的条目 | string\|string\[]\|{ key: string, label: string\|ReactNode }\|Array<{ key: string, label: string\|ReactNode }> | 无 |
|
||||
|
@ -70,6 +70,24 @@ export default class Breadcrumb extends React.Component<BreadcrumbProps, any> {
|
||||
'see: https://u.ant.design/item-render.',
|
||||
);
|
||||
}
|
||||
|
||||
getPath = (path: string, params: any) => {
|
||||
path = (path || '').replace(/^\//, '');
|
||||
Object.keys(params).forEach(key => {
|
||||
path = path.replace(`:${key}`, params[key]);
|
||||
});
|
||||
return path;
|
||||
}
|
||||
|
||||
addChildPath = (paths: string[], childPath: string = '', params: any) => {
|
||||
const originalPaths = [...paths];
|
||||
const path = this.getPath(childPath, params);
|
||||
if (path) {
|
||||
originalPaths.push(path);
|
||||
}
|
||||
return originalPaths;
|
||||
}
|
||||
|
||||
genForRoutes = ({
|
||||
routes = [],
|
||||
params = {},
|
||||
@ -78,11 +96,7 @@ export default class Breadcrumb extends React.Component<BreadcrumbProps, any> {
|
||||
}: BreadcrumbProps) => {
|
||||
const paths: string[] = [];
|
||||
return routes.map(route => {
|
||||
route.path = route.path || '';
|
||||
let path = route.path.replace(/^\//, '');
|
||||
Object.keys(params).forEach(key => {
|
||||
path = path.replace(`:${key}`, params[key]);
|
||||
});
|
||||
const path = this.getPath(route.path, params);
|
||||
|
||||
if (path) {
|
||||
paths.push(path);
|
||||
@ -93,10 +107,12 @@ export default class Breadcrumb extends React.Component<BreadcrumbProps, any> {
|
||||
overlay = (
|
||||
<Menu>
|
||||
{route.children.map(child => (
|
||||
<Menu.Item key={child.breadcrumbName || child.path}>
|
||||
{itemRender(child, params, routes, paths)}
|
||||
</Menu.Item>
|
||||
))}
|
||||
<Menu.Item key={child.breadcrumbName || child.path}>
|
||||
{
|
||||
itemRender(child, params, routes, this.addChildPath(paths, child.path, params))
|
||||
}
|
||||
</Menu.Item>
|
||||
))}
|
||||
</Menu>
|
||||
);
|
||||
}
|
||||
|
@ -71,10 +71,10 @@ export default class BreadcrumbItem extends React.Component<BreadcrumbItemProps,
|
||||
if (overlay) {
|
||||
return (
|
||||
<DropDown overlay={overlay} placement="bottomCenter">
|
||||
<a className={`${prefixCls}-overlay-link`}>
|
||||
<span className={`${prefixCls}-overlay-link`}>
|
||||
{breadcrumbItem}
|
||||
<Icon type="down" />
|
||||
</a>
|
||||
</span>
|
||||
</DropDown>
|
||||
);
|
||||
}
|
||||
|
@ -71,42 +71,43 @@ exports[`Breadcrumb should render a menu 1`] = `
|
||||
</span>
|
||||
</span>
|
||||
<span>
|
||||
<a
|
||||
<span
|
||||
class="ant-breadcrumb-overlay-link ant-dropdown-trigger"
|
||||
>
|
||||
<span
|
||||
class="ant-breadcrumb-link"
|
||||
/>
|
||||
</a>
|
||||
<a
|
||||
href="#/index/first"
|
||||
>
|
||||
<a
|
||||
href="#/index/first"
|
||||
>
|
||||
first
|
||||
</a>
|
||||
</span>
|
||||
<i
|
||||
aria-label="icon: down"
|
||||
class="anticon anticon-down"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class=""
|
||||
data-icon="down"
|
||||
fill="currentColor"
|
||||
focusable="false"
|
||||
height="1em"
|
||||
viewBox="64 64 896 896"
|
||||
width="1em"
|
||||
>
|
||||
<path
|
||||
d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"
|
||||
/>
|
||||
</svg>
|
||||
</i>
|
||||
</span>
|
||||
<span
|
||||
class="ant-breadcrumb-separator"
|
||||
>
|
||||
first
|
||||
</a>
|
||||
</span>
|
||||
<i
|
||||
aria-label="icon: down"
|
||||
class="anticon anticon-down"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class=""
|
||||
data-icon="down"
|
||||
fill="currentColor"
|
||||
focusable="false"
|
||||
height="1em"
|
||||
viewBox="64 64 896 896"
|
||||
width="1em"
|
||||
>
|
||||
<path
|
||||
d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"
|
||||
/>
|
||||
</svg>
|
||||
</i>
|
||||
<span
|
||||
class="ant-breadcrumb-separator"
|
||||
>
|
||||
/
|
||||
/
|
||||
</span>
|
||||
</span>
|
||||
<span>
|
||||
<span
|
||||
|
@ -64,89 +64,88 @@ exports[`renders ./components/breadcrumb/demo/basic.md correctly 1`] = `
|
||||
`;
|
||||
|
||||
exports[`renders ./components/breadcrumb/demo/overlay.md correctly 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="ant-breadcrumb"
|
||||
>
|
||||
<span>
|
||||
<span
|
||||
class="ant-breadcrumb-link"
|
||||
>
|
||||
Ant Design
|
||||
</span>
|
||||
<span
|
||||
class="ant-breadcrumb-separator"
|
||||
>
|
||||
/
|
||||
</span>
|
||||
<div
|
||||
class="ant-breadcrumb"
|
||||
>
|
||||
<span>
|
||||
<span
|
||||
class="ant-breadcrumb-link"
|
||||
>
|
||||
Ant Design
|
||||
</span>
|
||||
<span>
|
||||
<span
|
||||
class="ant-breadcrumb-separator"
|
||||
>
|
||||
/
|
||||
</span>
|
||||
</span>
|
||||
<span>
|
||||
<span
|
||||
class="ant-breadcrumb-link"
|
||||
>
|
||||
<a
|
||||
href=""
|
||||
>
|
||||
Component
|
||||
</a>
|
||||
</span>
|
||||
<span
|
||||
class="ant-breadcrumb-separator"
|
||||
>
|
||||
/
|
||||
</span>
|
||||
</span>
|
||||
<span>
|
||||
<span
|
||||
class="ant-breadcrumb-overlay-link ant-dropdown-trigger"
|
||||
>
|
||||
<span
|
||||
class="ant-breadcrumb-link"
|
||||
>
|
||||
<a
|
||||
href=""
|
||||
>
|
||||
Component
|
||||
General
|
||||
</a>
|
||||
</span>
|
||||
<span
|
||||
class="ant-breadcrumb-separator"
|
||||
<i
|
||||
aria-label="icon: down"
|
||||
class="anticon anticon-down"
|
||||
>
|
||||
/
|
||||
</span>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class=""
|
||||
data-icon="down"
|
||||
fill="currentColor"
|
||||
focusable="false"
|
||||
height="1em"
|
||||
viewBox="64 64 896 896"
|
||||
width="1em"
|
||||
>
|
||||
<path
|
||||
d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"
|
||||
/>
|
||||
</svg>
|
||||
</i>
|
||||
</span>
|
||||
<span>
|
||||
<a
|
||||
class="ant-breadcrumb-overlay-link ant-dropdown-trigger"
|
||||
>
|
||||
<span
|
||||
class="ant-breadcrumb-link"
|
||||
/>
|
||||
</a>
|
||||
<a
|
||||
href=""
|
||||
>
|
||||
General
|
||||
</a>
|
||||
</span>
|
||||
<i
|
||||
aria-label="icon: down"
|
||||
class="anticon anticon-down"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class=""
|
||||
data-icon="down"
|
||||
fill="currentColor"
|
||||
focusable="false"
|
||||
height="1em"
|
||||
viewBox="64 64 896 896"
|
||||
width="1em"
|
||||
>
|
||||
<path
|
||||
d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"
|
||||
/>
|
||||
</svg>
|
||||
</i>
|
||||
<span
|
||||
class="ant-breadcrumb-separator"
|
||||
>
|
||||
/
|
||||
</span>
|
||||
<span>
|
||||
<span
|
||||
class="ant-breadcrumb-link"
|
||||
>
|
||||
Button
|
||||
</span>
|
||||
<span
|
||||
class="ant-breadcrumb-separator"
|
||||
>
|
||||
/
|
||||
</span>
|
||||
</span>
|
||||
<span>
|
||||
<span
|
||||
class="ant-breadcrumb-link"
|
||||
>
|
||||
Button
|
||||
</span>
|
||||
</div>
|
||||
<span
|
||||
class="ant-breadcrumb-separator"
|
||||
>
|
||||
/
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
`;
|
||||
|
||||
|
@ -37,18 +37,16 @@ const menu = (
|
||||
);
|
||||
|
||||
ReactDOM.render(
|
||||
<div>
|
||||
<Breadcrumb>
|
||||
<Breadcrumb.Item>Ant Design</Breadcrumb.Item>
|
||||
<Breadcrumb.Item>
|
||||
<a href="">Component</a>
|
||||
</Breadcrumb.Item>
|
||||
<Breadcrumb.Item overlay={menu}>
|
||||
<a href="">General</a>
|
||||
</Breadcrumb.Item>
|
||||
<Breadcrumb.Item>Button</Breadcrumb.Item>
|
||||
</Breadcrumb>
|
||||
</div>,
|
||||
<Breadcrumb>
|
||||
<Breadcrumb.Item>Ant Design</Breadcrumb.Item>
|
||||
<Breadcrumb.Item>
|
||||
<a href="">Component</a>
|
||||
</Breadcrumb.Item>
|
||||
<Breadcrumb.Item overlay={menu}>
|
||||
<a href="">General</a>
|
||||
</Breadcrumb.Item>
|
||||
<Breadcrumb.Item>Button</Breadcrumb.Item>
|
||||
</Breadcrumb>,
|
||||
mountNode,
|
||||
);
|
||||
```
|
||||
|
@ -7,11 +7,11 @@ title:
|
||||
|
||||
## zh-CN
|
||||
|
||||
按钮有四种类型:主按钮、次按钮、虚线按钮、危险按钮。主按钮在同一个操作区域最多出现一次。
|
||||
按钮有五种类型:主按钮、次按钮、虚线按钮、危险按钮和链接按钮。主按钮在同一个操作区域最多出现一次。
|
||||
|
||||
## en-US
|
||||
|
||||
There are `primary` button, `default` button, `dashed` button and `danger` button in antd.
|
||||
There are `primary` button, `default` button, `dashed` button, `danger` button and `link` button in antd.
|
||||
|
||||
```jsx
|
||||
import { Button } from 'antd';
|
||||
|
@ -292,7 +292,8 @@ class Cascader extends React.Component<CascaderProps, CascaderState> {
|
||||
};
|
||||
|
||||
handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
|
||||
if (e.keyCode === KeyCode.BACKSPACE) {
|
||||
// SPACE => https://github.com/ant-design/ant-design/issues/16871
|
||||
if (e.keyCode === KeyCode.BACKSPACE || e.keyCode === KeyCode.SPACE) {
|
||||
e.stopPropagation();
|
||||
}
|
||||
};
|
||||
|
@ -175,7 +175,7 @@
|
||||
// 半选状态
|
||||
.@{checkbox-prefix-cls}-indeterminate {
|
||||
.@{checkbox-inner-prefix-cls} {
|
||||
background-color: #fff;
|
||||
background-color: @component-background;
|
||||
border-color: @border-color-base;
|
||||
}
|
||||
.@{checkbox-inner-prefix-cls}::after {
|
||||
|
@ -37,9 +37,7 @@
|
||||
top: 50%;
|
||||
left: @padding-md;
|
||||
display: inline-block;
|
||||
margin-top: 2px;
|
||||
font-size: @font-size-sm;
|
||||
line-height: 46px;
|
||||
transform: translateY(-50%);
|
||||
|
||||
& svg {
|
||||
|
@ -27,25 +27,25 @@
|
||||
position: relative;
|
||||
flex: 1 1 auto;
|
||||
min-width: 1px;
|
||||
font-size: 14px;
|
||||
font-size: @comment-font-size-base;
|
||||
word-wrap: break-word;
|
||||
|
||||
&-author {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
margin-bottom: 4px;
|
||||
font-size: 14px;
|
||||
font-size: @comment-font-size-base;
|
||||
& > a,
|
||||
& > span {
|
||||
height: 18px;
|
||||
padding-right: 8px;
|
||||
font-size: 12px;
|
||||
font-size: @comment-font-size-sm;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
&-name {
|
||||
color: @comment-author-name-color;
|
||||
font-size: 14px;
|
||||
font-size: @comment-font-size-base;
|
||||
transition: color 0.3s;
|
||||
> * {
|
||||
color: @comment-author-name-color;
|
||||
@ -76,7 +76,7 @@
|
||||
> span {
|
||||
padding-right: 10px;
|
||||
color: @comment-action-color;
|
||||
font-size: 12px;
|
||||
font-size: @comment-font-size-sm;
|
||||
cursor: pointer;
|
||||
transition: color 0.3s;
|
||||
user-select: none;
|
||||
|
@ -8175,6 +8175,7 @@ exports[`ConfigProvider components Modal configProvider 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="config-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="config-modal-close-x"
|
||||
@ -8266,6 +8267,7 @@ exports[`ConfigProvider components Modal normal 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -8357,6 +8359,7 @@ exports[`ConfigProvider components Modal prefixCls 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="prefix-Modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="prefix-Modal-close-x"
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as React from 'react';
|
||||
import createReactContext, { Context } from '@ant-design/create-react-context';
|
||||
import createReactContext from '@ant-design/create-react-context';
|
||||
|
||||
import defaultRenderEmpty, { RenderEmptyHandler } from './renderEmpty';
|
||||
|
||||
@ -36,7 +36,7 @@ export interface ConfigProviderProps {
|
||||
autoInsertSpaceInButton?: boolean;
|
||||
}
|
||||
|
||||
const ConfigContext: Context<ConfigConsumerProps | null> = createReactContext({
|
||||
const ConfigContext = createReactContext<ConfigConsumerProps>({
|
||||
// We provide a default function for Context without provider
|
||||
getPrefixCls: (suffixCls: string, customizePrefixCls?: string) => {
|
||||
if (customizePrefixCls) return customizePrefixCls;
|
||||
|
@ -135,3 +135,7 @@ The following APIs are shared by DatePicker, MonthPicker, RangePicker, WeekPicke
|
||||
margin: 0 8px 12px 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
## FAQ
|
||||
|
||||
- [When set mode to DatePicker/RangePicker, cannot select year or month anymore?](/docs/react/faq#When-set-mode-to-DatePicker/RangePicker,-cannot-select-year-or-month-anymore?)
|
||||
|
@ -138,3 +138,7 @@ moment.locale('zh-cn');
|
||||
margin: 0 8px 12px 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
## FAQ
|
||||
|
||||
- [当我指定了 DatePicker/RangePicker 的 `mode` 属性后,点击后无法选择年份/月份?](/docs/react/faq-cn#当我指定了-DatePicker/RangePicker-的-mode-属性后,点击后无法选择年份/月份?)
|
||||
|
@ -11,6 +11,10 @@ const locale = {
|
||||
timePickerLocale: {
|
||||
...TimePickerLocale,
|
||||
},
|
||||
dateFormat: 'DD-MM-YYYY',
|
||||
monthFormat: 'MM-YYYY',
|
||||
dateTimeFormat: 'DD-MM-YYYY HH:mm:ss',
|
||||
weekFormat: 'wo-YYYY',
|
||||
};
|
||||
|
||||
// All settings at:
|
||||
|
@ -12,7 +12,7 @@ exports[`renders ./components/divider/demo/horizontal.md correctly 1`] = `
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
|
||||
</p>
|
||||
<div
|
||||
class="ant-divider ant-divider-horizontal ant-divider-with-text"
|
||||
class="ant-divider ant-divider-horizontal ant-divider-with-text-center"
|
||||
>
|
||||
<span
|
||||
class="ant-divider-inner-text"
|
||||
|
@ -5,7 +5,7 @@ import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
|
||||
export interface DividerProps {
|
||||
prefixCls?: string;
|
||||
type?: 'horizontal' | 'vertical';
|
||||
orientation?: 'left' | 'right' | '';
|
||||
orientation?: 'left' | 'right' | 'center';
|
||||
className?: string;
|
||||
children?: React.ReactNode;
|
||||
dashed?: boolean;
|
||||
@ -18,7 +18,7 @@ const Divider: React.SFC<DividerProps> = props => (
|
||||
const {
|
||||
prefixCls: customizePrefixCls,
|
||||
type = 'horizontal',
|
||||
orientation = '',
|
||||
orientation = 'center',
|
||||
className,
|
||||
children,
|
||||
dashed,
|
||||
|
@ -18,6 +18,7 @@
|
||||
margin: 0 8px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
&-horizontal {
|
||||
display: block;
|
||||
clear: both;
|
||||
@ -27,7 +28,7 @@
|
||||
margin: 24px 0;
|
||||
}
|
||||
|
||||
&-horizontal&-with-text,
|
||||
&-horizontal&-with-text-center,
|
||||
&-horizontal&-with-text-left,
|
||||
&-horizontal&-with-text-right {
|
||||
display: table;
|
||||
@ -89,7 +90,7 @@
|
||||
background: none;
|
||||
border-top: 1px dashed @border-color-split;
|
||||
}
|
||||
&-horizontal&-with-text&-dashed,
|
||||
&-horizontal&-with-text-center&-dashed,
|
||||
&-horizontal&-with-text-left&-dashed,
|
||||
&-horizontal&-with-text-right&-dashed {
|
||||
border-top: 0;
|
||||
|
@ -1,14 +1,14 @@
|
||||
import * as React from 'react';
|
||||
import * as PropTypes from 'prop-types';
|
||||
import RcDrawer from 'rc-drawer';
|
||||
import createReactContext, { Context } from '@ant-design/create-react-context';
|
||||
import createReactContext from '@ant-design/create-react-context';
|
||||
import warning from '../_util/warning';
|
||||
import classNames from 'classnames';
|
||||
import Icon from '../icon';
|
||||
import { withConfigConsumer, ConfigConsumerProps } from '../config-provider';
|
||||
import { tuple } from '../_util/type';
|
||||
|
||||
const DrawerContext: Context<Drawer | null> = createReactContext(null);
|
||||
const DrawerContext = createReactContext<Drawer | null>(null);
|
||||
|
||||
type EventType = React.MouseEvent<HTMLDivElement> | React.MouseEvent<HTMLButtonElement>;
|
||||
|
||||
|
@ -102,7 +102,7 @@
|
||||
|
||||
&-selected,
|
||||
&-selected > a {
|
||||
color: @primary-color;
|
||||
color: @dropdown-selected-color;
|
||||
background-color: @item-active-bg;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import createReactContext, { Context } from '@ant-design/create-react-context';
|
||||
import createReactContext from '@ant-design/create-react-context';
|
||||
import { ColProps } from '../grid/col';
|
||||
import { FormLabelAlign } from './FormItem';
|
||||
|
||||
@ -10,7 +10,7 @@ export interface FormContextProps {
|
||||
wrapperCol?: ColProps;
|
||||
}
|
||||
|
||||
export const FormContext: Context<FormContextProps> = createReactContext({
|
||||
export const FormContext = createReactContext<FormContextProps>({
|
||||
labelAlign: 'right',
|
||||
vertical: false,
|
||||
});
|
||||
|
@ -77,8 +77,14 @@
|
||||
border-radius: @border-radius-base;
|
||||
outline: 0;
|
||||
transition: all 0.3s linear;
|
||||
-moz-appearance: textfield;
|
||||
-moz-appearance: textfield !important;
|
||||
.placeholder();
|
||||
|
||||
&[type='number']::-webkit-inner-spin-button,
|
||||
&[type='number']::-webkit-outer-spin-button {
|
||||
margin: 0;
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
}
|
||||
|
||||
&-lg {
|
||||
|
@ -8,11 +8,13 @@
|
||||
height: @input-height-lg;
|
||||
padding: @input-padding-vertical-lg @input-padding-horizontal-lg;
|
||||
font-size: @font-size-lg;
|
||||
line-height: @input-height-lg;
|
||||
}
|
||||
|
||||
.input-sm() {
|
||||
height: @input-height-sm;
|
||||
padding: @input-padding-vertical-sm @input-padding-horizontal-sm;
|
||||
line-height: @input-height-sm;
|
||||
}
|
||||
|
||||
// input status
|
||||
@ -49,7 +51,7 @@
|
||||
padding: @input-padding-vertical-base @input-padding-horizontal-base;
|
||||
color: @input-color;
|
||||
font-size: @font-size-base;
|
||||
line-height: @line-height-base;
|
||||
line-height: @input-height-base;
|
||||
background-color: @input-bg;
|
||||
background-image: none;
|
||||
border: @border-width-base @border-style-base @input-border-color;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import createContext, { Context } from '@ant-design/create-react-context';
|
||||
import createContext from '@ant-design/create-react-context';
|
||||
import { SiderProps } from './Sider';
|
||||
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
|
||||
|
||||
@ -19,7 +19,7 @@ export interface LayoutContextProps {
|
||||
removeSider: (id: string) => void;
|
||||
};
|
||||
}
|
||||
export const LayoutContext: Context<LayoutContextProps> = createContext({
|
||||
export const LayoutContext = createContext<LayoutContextProps>({
|
||||
siderHook: {
|
||||
addSider: () => null,
|
||||
removeSider: () => null,
|
||||
|
@ -7523,6 +7523,7 @@ exports[`Locale Provider should display the text as ar 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -12626,6 +12627,7 @@ exports[`Locale Provider should display the text as bg 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -17729,6 +17731,7 @@ exports[`Locale Provider should display the text as ca 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -22832,6 +22835,7 @@ exports[`Locale Provider should display the text as cs 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -27935,6 +27939,7 @@ exports[`Locale Provider should display the text as da 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -33038,6 +33043,7 @@ exports[`Locale Provider should display the text as de 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -38141,6 +38147,7 @@ exports[`Locale Provider should display the text as el 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -43244,6 +43251,7 @@ exports[`Locale Provider should display the text as en 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -48347,6 +48355,7 @@ exports[`Locale Provider should display the text as en-gb 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -48438,7 +48447,7 @@ exports[`Locale Provider should display the text as es 1`] = `
|
||||
class="ant-pagination-item-link"
|
||||
>
|
||||
<i
|
||||
aria-label="icon: left"
|
||||
aria-label="ícono: left"
|
||||
class="anticon anticon-left"
|
||||
>
|
||||
<svg
|
||||
@ -48513,7 +48522,7 @@ exports[`Locale Provider should display the text as es 1`] = `
|
||||
class="ant-pagination-item-link"
|
||||
>
|
||||
<i
|
||||
aria-label="icon: right"
|
||||
aria-label="ícono: right"
|
||||
class="anticon anticon-right"
|
||||
>
|
||||
<svg
|
||||
@ -48566,7 +48575,7 @@ exports[`Locale Provider should display the text as es 1`] = `
|
||||
unselectable="on"
|
||||
>
|
||||
<i
|
||||
aria-label="icon: down"
|
||||
aria-label="ícono: down"
|
||||
class="anticon anticon-down ant-select-arrow-icon"
|
||||
>
|
||||
<svg
|
||||
@ -48632,7 +48641,7 @@ exports[`Locale Provider should display the text as es 1`] = `
|
||||
unselectable="on"
|
||||
>
|
||||
<i
|
||||
aria-label="icon: down"
|
||||
aria-label="ícono: down"
|
||||
class="anticon anticon-down ant-select-arrow-icon"
|
||||
>
|
||||
<svg
|
||||
@ -48666,7 +48675,7 @@ exports[`Locale Provider should display the text as es 1`] = `
|
||||
value=""
|
||||
/>
|
||||
<i
|
||||
aria-label="icon: calendar"
|
||||
aria-label="ícono: calendar"
|
||||
class="anticon anticon-calendar ant-calendar-picker-icon"
|
||||
>
|
||||
<svg
|
||||
@ -49475,7 +49484,7 @@ exports[`Locale Provider should display the text as es 1`] = `
|
||||
class="ant-time-picker-icon"
|
||||
>
|
||||
<i
|
||||
aria-label="icon: clock-circle"
|
||||
aria-label="ícono: clock-circle"
|
||||
class="anticon anticon-clock-circle ant-time-picker-clock-icon"
|
||||
>
|
||||
<svg
|
||||
@ -50433,7 +50442,7 @@ exports[`Locale Provider should display the text as es 1`] = `
|
||||
value=""
|
||||
/>
|
||||
<i
|
||||
aria-label="icon: calendar"
|
||||
aria-label="ícono: calendar"
|
||||
class="anticon anticon-calendar ant-calendar-picker-icon"
|
||||
>
|
||||
<svg
|
||||
@ -51968,7 +51977,7 @@ exports[`Locale Provider should display the text as es 1`] = `
|
||||
class="ant-popover-message"
|
||||
>
|
||||
<i
|
||||
aria-label="icon: exclamation-circle"
|
||||
aria-label="ícono: exclamation-circle"
|
||||
class="anticon anticon-exclamation-circle"
|
||||
>
|
||||
<svg
|
||||
@ -52071,7 +52080,7 @@ exports[`Locale Provider should display the text as es 1`] = `
|
||||
class="ant-transfer-list-search-action"
|
||||
>
|
||||
<i
|
||||
aria-label="icon: search"
|
||||
aria-label="ícono: search"
|
||||
class="anticon anticon-search"
|
||||
>
|
||||
<svg
|
||||
@ -52124,7 +52133,7 @@ exports[`Locale Provider should display the text as es 1`] = `
|
||||
type="button"
|
||||
>
|
||||
<i
|
||||
aria-label="icon: right"
|
||||
aria-label="ícono: right"
|
||||
class="anticon anticon-right"
|
||||
>
|
||||
<svg
|
||||
@ -52149,7 +52158,7 @@ exports[`Locale Provider should display the text as es 1`] = `
|
||||
type="button"
|
||||
>
|
||||
<i
|
||||
aria-label="icon: left"
|
||||
aria-label="ícono: left"
|
||||
class="anticon anticon-left"
|
||||
>
|
||||
<svg
|
||||
@ -52219,7 +52228,7 @@ exports[`Locale Provider should display the text as es 1`] = `
|
||||
class="ant-transfer-list-search-action"
|
||||
>
|
||||
<i
|
||||
aria-label="icon: search"
|
||||
aria-label="ícono: search"
|
||||
class="anticon anticon-search"
|
||||
>
|
||||
<svg
|
||||
@ -52300,7 +52309,7 @@ exports[`Locale Provider should display the text as es 1`] = `
|
||||
unselectable="on"
|
||||
>
|
||||
<i
|
||||
aria-label="icon: down"
|
||||
aria-label="ícono: down"
|
||||
class="anticon anticon-down ant-select-arrow-icon"
|
||||
>
|
||||
<svg
|
||||
@ -52351,7 +52360,7 @@ exports[`Locale Provider should display the text as es 1`] = `
|
||||
unselectable="on"
|
||||
>
|
||||
<i
|
||||
aria-label="icon: down"
|
||||
aria-label="ícono: down"
|
||||
class="anticon anticon-down ant-select-arrow-icon"
|
||||
>
|
||||
<svg
|
||||
@ -53352,7 +53361,7 @@ exports[`Locale Provider should display the text as es 1`] = `
|
||||
</div>
|
||||
</span>
|
||||
<i
|
||||
aria-label="icon: filter"
|
||||
aria-label="ícono: filter"
|
||||
class="anticon anticon-filter ant-dropdown-trigger"
|
||||
tabindex="-1"
|
||||
title="Filtrar menú"
|
||||
@ -53450,12 +53459,13 @@ exports[`Locale Provider should display the text as es 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
>
|
||||
<i
|
||||
aria-label="icon: close"
|
||||
aria-label="ícono: close"
|
||||
class="anticon anticon-close ant-modal-close-icon"
|
||||
>
|
||||
<svg
|
||||
@ -58553,6 +58563,7 @@ exports[`Locale Provider should display the text as et 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -63656,6 +63667,7 @@ exports[`Locale Provider should display the text as fa 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -68759,6 +68771,7 @@ exports[`Locale Provider should display the text as fi 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -73862,6 +73875,7 @@ exports[`Locale Provider should display the text as fr 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -78965,6 +78979,7 @@ exports[`Locale Provider should display the text as fr 2`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -84068,6 +84083,7 @@ exports[`Locale Provider should display the text as he 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -89171,6 +89187,7 @@ exports[`Locale Provider should display the text as hi 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -94274,6 +94291,7 @@ exports[`Locale Provider should display the text as hr 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -99377,6 +99395,7 @@ exports[`Locale Provider should display the text as hu 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -104480,6 +104499,7 @@ exports[`Locale Provider should display the text as id 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -109583,6 +109603,7 @@ exports[`Locale Provider should display the text as is 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -114686,6 +114707,7 @@ exports[`Locale Provider should display the text as it 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -119789,6 +119811,7 @@ exports[`Locale Provider should display the text as ja 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -124892,6 +124915,7 @@ exports[`Locale Provider should display the text as kn 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -129995,6 +130019,7 @@ exports[`Locale Provider should display the text as ko 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -135098,6 +135123,7 @@ exports[`Locale Provider should display the text as ku-iq 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -140201,6 +140227,7 @@ exports[`Locale Provider should display the text as mn-mn 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -145304,6 +145331,7 @@ exports[`Locale Provider should display the text as nb 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -150407,6 +150435,7 @@ exports[`Locale Provider should display the text as ne-np 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -155510,6 +155539,7 @@ exports[`Locale Provider should display the text as nl 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -160613,6 +160643,7 @@ exports[`Locale Provider should display the text as nl-be 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -165716,6 +165747,7 @@ exports[`Locale Provider should display the text as pl 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -170819,6 +170851,7 @@ exports[`Locale Provider should display the text as pt 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -175922,6 +175955,7 @@ exports[`Locale Provider should display the text as pt-br 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -181025,6 +181059,7 @@ exports[`Locale Provider should display the text as ru 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -186128,6 +186163,7 @@ exports[`Locale Provider should display the text as sk 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -191231,6 +191267,7 @@ exports[`Locale Provider should display the text as sl 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -196334,6 +196371,7 @@ exports[`Locale Provider should display the text as sr 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -201437,6 +201475,7 @@ exports[`Locale Provider should display the text as sv 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -206540,6 +206579,7 @@ exports[`Locale Provider should display the text as th 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -211643,6 +211683,7 @@ exports[`Locale Provider should display the text as tr 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -216746,6 +216787,7 @@ exports[`Locale Provider should display the text as uk 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -221849,6 +221891,7 @@ exports[`Locale Provider should display the text as vi 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -226952,6 +226995,7 @@ exports[`Locale Provider should display the text as zh-cn 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -232055,6 +232099,7 @@ exports[`Locale Provider should display the text as zh-tw 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
|
@ -9,12 +9,16 @@ export default {
|
||||
DatePicker,
|
||||
TimePicker,
|
||||
Calendar,
|
||||
global: {
|
||||
placeholder: 'Seleccione',
|
||||
},
|
||||
Table: {
|
||||
filterTitle: 'Filtrar menú',
|
||||
filterConfirm: 'Aceptar',
|
||||
filterReset: 'Reiniciar',
|
||||
selectAll: 'Seleccionar todo',
|
||||
selectInvert: 'Invertir selección',
|
||||
sortTitle: 'Ordenar',
|
||||
},
|
||||
Modal: {
|
||||
okText: 'Aceptar',
|
||||
@ -39,4 +43,16 @@ export default {
|
||||
Empty: {
|
||||
description: 'No hay datos',
|
||||
},
|
||||
Icon: {
|
||||
icon: 'ícono',
|
||||
},
|
||||
Text: {
|
||||
edit: 'editar',
|
||||
copy: 'copiar',
|
||||
copied: 'copiado',
|
||||
expand: 'expandir',
|
||||
},
|
||||
PageHeader: {
|
||||
back: 'volver',
|
||||
},
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as React from 'react';
|
||||
import RcMenu, { Divider, ItemGroup } from 'rc-menu';
|
||||
import createContext, { Context } from '@ant-design/create-react-context';
|
||||
import createContext from '@ant-design/create-react-context';
|
||||
import classNames from 'classnames';
|
||||
import omit from 'omit.js';
|
||||
import SubMenu from './SubMenu';
|
||||
@ -79,7 +79,7 @@ export interface MenuContextProps {
|
||||
antdMenuTheme?: MenuTheme;
|
||||
}
|
||||
|
||||
export const MenuContext: Context<MenuContextProps> = createContext({
|
||||
export const MenuContext = createContext<MenuContextProps>({
|
||||
inlineCollapsed: false,
|
||||
});
|
||||
|
||||
|
@ -43,6 +43,10 @@
|
||||
padding 0.15s @ease-in-out;
|
||||
}
|
||||
|
||||
&-submenu-selected {
|
||||
color: @menu-highlight-color;
|
||||
}
|
||||
|
||||
&-item:active,
|
||||
&-submenu-title:active {
|
||||
background: @menu-item-active-bg;
|
||||
|
@ -17,15 +17,15 @@ Messages of success, error and warning types.
|
||||
import { message, Button } from 'antd';
|
||||
|
||||
const success = () => {
|
||||
message.success('This is a message of success');
|
||||
message.success('This is a success message');
|
||||
};
|
||||
|
||||
const error = () => {
|
||||
message.error('This is a message of error');
|
||||
message.error('This is an error message');
|
||||
};
|
||||
|
||||
const warning = () => {
|
||||
message.warning('This is message of warning');
|
||||
message.warning('This is a warning message');
|
||||
};
|
||||
|
||||
ReactDOM.render(
|
||||
|
@ -28,6 +28,7 @@ exports[`Modal render correctly 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
@ -120,6 +121,7 @@ exports[`Modal render without footer 1`] = `
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
|
@ -70,7 +70,7 @@ const renderTitle = (prefixCls: string, props: PageHeaderProps) => {
|
||||
const titlePrefixCls = `${prefixCls}-title-view`;
|
||||
if (title || subTitle || tags || extra) {
|
||||
return (
|
||||
<div className={`${prefixCls}-title-view`}>
|
||||
<div className={titlePrefixCls}>
|
||||
{title && <span className={`${titlePrefixCls}-title`}>{title}</span>}
|
||||
{subTitle && <span className={`${titlePrefixCls}-sub-title`}>{subTitle}</span>}
|
||||
{tags && <span className={`${titlePrefixCls}-tags`}>{tags}</span>}
|
||||
|
@ -65,10 +65,10 @@
|
||||
top: 16px;
|
||||
right: @page-header-padding-horizontal;
|
||||
> * {
|
||||
margin-right: 8px;
|
||||
margin-left: 8px;
|
||||
}
|
||||
> *:last-child {
|
||||
margin-right: 0;
|
||||
> *:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -31,6 +31,7 @@ A long list can be divided into several pages by `Pagination`, and only one page
|
||||
| showLessItems | show less page items | boolean | false | |
|
||||
| showQuickJumper | determine whether you can jump to pages directly | boolean \| `{ goButton: ReactNode }` | false | |
|
||||
| showSizeChanger | determine whether `pageSize` can be changed | boolean | false | |
|
||||
| showTitle | show page items title | boolean | true | |
|
||||
| showTotal | to display the total number and range | Function(total, range) | - | |
|
||||
| simple | whether to use simple mode | boolean | - | |
|
||||
| size | specify the size of `Pagination`, can be set to `small` | string | "" | |
|
||||
|
@ -47,8 +47,6 @@
|
||||
@code-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
|
||||
@text-color: fade(@black, 65%);
|
||||
@text-color-secondary: fade(@black, 45%);
|
||||
@text-color-warning: @gold-7;
|
||||
@text-color-danger: @red-7;
|
||||
@text-color-inverse: @white;
|
||||
@icon-color: inherit;
|
||||
@icon-color-hover: fade(@black, 75%);
|
||||
@ -155,7 +153,7 @@
|
||||
@btn-primary-bg: @primary-color;
|
||||
|
||||
@btn-default-color: @text-color;
|
||||
@btn-default-bg: #fff;
|
||||
@btn-default-bg: @component-background;
|
||||
@btn-default-border: @border-color-base;
|
||||
|
||||
@btn-danger-color: @error-color;
|
||||
@ -188,6 +186,10 @@
|
||||
@checkbox-check-color: #fff;
|
||||
@checkbox-border-width: @border-width-base;
|
||||
|
||||
// Dropdown
|
||||
|
||||
@dropdown-selected-color: @primary-color;
|
||||
|
||||
// Empty
|
||||
@empty-font-size: @font-size-base;
|
||||
|
||||
@ -311,7 +313,7 @@
|
||||
@input-placeholder-color: hsv(0, 0, 75%);
|
||||
@input-color: @text-color;
|
||||
@input-border-color: @border-color-base;
|
||||
@input-bg: #fff;
|
||||
@input-bg: @component-background;
|
||||
@input-number-handler-active-bg: #f4f4f4;
|
||||
@input-addon-bg: @background-color-light;
|
||||
@input-hover-border-color: @primary-color;
|
||||
@ -341,7 +343,7 @@
|
||||
// Popover
|
||||
// ---
|
||||
// Popover body background color
|
||||
@popover-bg: #fff;
|
||||
@popover-bg: @component-background;
|
||||
// Popover text color
|
||||
@popover-color: @text-color;
|
||||
// Popover maximum width
|
||||
@ -381,6 +383,7 @@
|
||||
@menu-item-active-bg: @item-active-bg;
|
||||
@menu-item-active-border-width: 3px;
|
||||
@menu-item-group-title-color: @text-color-secondary;
|
||||
|
||||
// dark theme
|
||||
@menu-dark-color: @text-color-secondary-dark;
|
||||
@menu-dark-bg: @layout-header-background;
|
||||
@ -459,6 +462,8 @@
|
||||
// ---
|
||||
@comment-padding-base: 16px 0;
|
||||
@comment-nest-indent: 44px;
|
||||
@comment-font-size-base: @font-size-base;
|
||||
@comment-font-size-sm: @font-size-sm;
|
||||
@comment-author-name-color: @text-color-secondary;
|
||||
@comment-author-time-color: #ccc;
|
||||
@comment-action-color: @text-color-secondary;
|
||||
|
@ -156,7 +156,8 @@ export default class Table<T> extends React.Component<TableProps<T>, TableState<
|
||||
const key = this.getRecordKey(item, index);
|
||||
// Cache checkboxProps
|
||||
if (!this.CheckboxPropsCache[key]) {
|
||||
const checkboxProps = (this.CheckboxPropsCache[key] = rowSelection.getCheckboxProps(item));
|
||||
this.CheckboxPropsCache[key] = rowSelection.getCheckboxProps(item) || {};
|
||||
const checkboxProps = this.CheckboxPropsCache[key];
|
||||
warning(
|
||||
!('checked' in checkboxProps) && !('defaultChecked' in checkboxProps),
|
||||
'Table',
|
||||
@ -413,6 +414,9 @@ export default class Table<T> extends React.Component<TableProps<T>, TableState<
|
||||
if (!column.sorter) {
|
||||
return;
|
||||
}
|
||||
|
||||
const pagination = { ...this.state.pagination };
|
||||
|
||||
const sortDirections = column.sortDirections || (this.props.sortDirections as SortOrder[]);
|
||||
const { sortOrder, sortColumn } = this.state;
|
||||
// 只同时允许一列进行排序,否则会导致排序顺序的逻辑问题
|
||||
@ -427,7 +431,14 @@ export default class Table<T> extends React.Component<TableProps<T>, TableState<
|
||||
newSortOrder = sortDirections[0];
|
||||
}
|
||||
|
||||
if (this.props.pagination) {
|
||||
// Reset current prop
|
||||
pagination.current = 1;
|
||||
pagination.onChange!(pagination.current);
|
||||
}
|
||||
|
||||
const newState = {
|
||||
pagination,
|
||||
sortOrder: newSortOrder,
|
||||
sortColumn: newSortOrder ? column : null,
|
||||
};
|
||||
|
@ -587,4 +587,23 @@ describe('Table.sorter', () => {
|
||||
wrapper.find('.ant-table-column-sorters').simulate('click');
|
||||
expect(renderedNames(wrapper)).toEqual(['Jack', 'Lucy', 'Tom', 'Jerry']);
|
||||
});
|
||||
|
||||
it('pagination back', () => {
|
||||
const onPageChange = jest.fn();
|
||||
const onChange = jest.fn();
|
||||
|
||||
const wrapper = mount(
|
||||
createTable({
|
||||
pagination: {
|
||||
pageSize: 2,
|
||||
onChange: onPageChange,
|
||||
},
|
||||
onChange,
|
||||
}),
|
||||
);
|
||||
|
||||
wrapper.find('.ant-table-column-sorters').simulate('click');
|
||||
expect(onChange.mock.calls[0][0].current).toBe(1);
|
||||
expect(onPageChange.mock.calls[0][0]).toBe(1);
|
||||
});
|
||||
});
|
||||
|
@ -8877,7 +8877,9 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
|
||||
<col
|
||||
style="width:100px;min-width:100px"
|
||||
/>
|
||||
<col />
|
||||
<col
|
||||
style="width:200px;min-width:200px"
|
||||
/>
|
||||
<col />
|
||||
<col
|
||||
style="width:80px;min-width:80px"
|
||||
@ -9214,7 +9216,9 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
|
||||
<col
|
||||
style="width:100px;min-width:100px"
|
||||
/>
|
||||
<col />
|
||||
<col
|
||||
style="width:200px;min-width:200px"
|
||||
/>
|
||||
<col />
|
||||
<col
|
||||
style="width:80px;min-width:80px"
|
||||
|
@ -82,6 +82,7 @@ const columns = [
|
||||
title: 'Company Address',
|
||||
dataIndex: 'companyAddress',
|
||||
key: 'companyAddress',
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
title: 'Company Name',
|
||||
|
@ -32,175 +32,170 @@
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
&-thead > tr {
|
||||
// For Chrome extra space:
|
||||
// - https://github.com/ant-design/ant-design/issues/14926
|
||||
// - https://github.com/ant-design/ant-design/issues/16131
|
||||
&-thead > tr > th {
|
||||
color: @table-header-color;
|
||||
font-weight: 500;
|
||||
text-align: left;
|
||||
background: @table-header-bg;
|
||||
border-bottom: @border-width-base @border-style-base @border-color-split;
|
||||
transition: background 0.3s ease;
|
||||
|
||||
> th {
|
||||
color: @table-header-color;
|
||||
font-weight: 500;
|
||||
text-align: left;
|
||||
background: transparent;
|
||||
border-bottom: @border-width-base @border-style-base @border-color-split;
|
||||
transition: background 0.3s ease;
|
||||
&[colspan] {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
&[colspan] {
|
||||
text-align: center;
|
||||
}
|
||||
.@{iconfont-css-prefix}-filter,
|
||||
.@{table-prefix-cls}-filter-icon {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 28px;
|
||||
height: 100%;
|
||||
color: @table-header-icon-color;
|
||||
font-size: @font-size-sm;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s;
|
||||
|
||||
.@{iconfont-css-prefix}-filter,
|
||||
.@{table-prefix-cls}-filter-icon {
|
||||
> svg {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 28px;
|
||||
height: 100%;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-top: -@font-size-sm / 2 + 1px;
|
||||
margin-left: -@font-size-sm / 2;
|
||||
}
|
||||
}
|
||||
|
||||
.@{table-prefix-cls}-filter-selected.@{iconfont-css-prefix}-filter {
|
||||
color: @primary-color;
|
||||
}
|
||||
|
||||
.@{table-prefix-cls}-column-sorter {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
|
||||
.@{table-prefix-cls}-column-sorter-inner {
|
||||
height: 1em;
|
||||
margin-top: 0.35em;
|
||||
margin-left: 0.57142857em;
|
||||
color: @table-header-icon-color;
|
||||
font-size: @font-size-sm;
|
||||
line-height: 1em;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s;
|
||||
|
||||
> svg {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-top: -@font-size-sm / 2 + 1px;
|
||||
margin-left: -@font-size-sm / 2;
|
||||
}
|
||||
}
|
||||
.@{table-prefix-cls}-column-sorter-up,
|
||||
.@{table-prefix-cls}-column-sorter-down {
|
||||
.iconfont-size-under-12px(11px);
|
||||
|
||||
.@{table-prefix-cls}-filter-selected.@{iconfont-css-prefix}-filter {
|
||||
color: @primary-color;
|
||||
}
|
||||
|
||||
.@{table-prefix-cls}-column-sorter {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
|
||||
.@{table-prefix-cls}-column-sorter-inner {
|
||||
display: block;
|
||||
height: 1em;
|
||||
margin-top: 0.35em;
|
||||
margin-left: 0.57142857em;
|
||||
color: @table-header-icon-color;
|
||||
line-height: 1em;
|
||||
text-align: center;
|
||||
transition: all 0.3s;
|
||||
&.on {
|
||||
color: @primary-color;
|
||||
}
|
||||
}
|
||||
|
||||
&-full {
|
||||
margin-top: -0.15em;
|
||||
|
||||
.@{table-prefix-cls}-column-sorter-up,
|
||||
.@{table-prefix-cls}-column-sorter-down {
|
||||
.iconfont-size-under-12px(11px);
|
||||
|
||||
display: block;
|
||||
height: 1em;
|
||||
line-height: 1em;
|
||||
transition: all 0.3s;
|
||||
&.on {
|
||||
color: @primary-color;
|
||||
}
|
||||
height: 0.5em;
|
||||
line-height: 0.5em;
|
||||
}
|
||||
|
||||
&-full {
|
||||
margin-top: -0.15em;
|
||||
|
||||
.@{table-prefix-cls}-column-sorter-up,
|
||||
.@{table-prefix-cls}-column-sorter-down {
|
||||
height: 0.5em;
|
||||
line-height: 0.5em;
|
||||
}
|
||||
|
||||
.@{table-prefix-cls}-column-sorter-down {
|
||||
margin-top: 0.125em;
|
||||
}
|
||||
.@{table-prefix-cls}-column-sorter-down {
|
||||
margin-top: 0.125em;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.@{table-prefix-cls}-column-has-actions {
|
||||
position: relative;
|
||||
background-clip: padding-box; // For Firefox background bug, https://github.com/ant-design/ant-design/issues/12628
|
||||
&.@{table-prefix-cls}-column-has-actions {
|
||||
position: relative;
|
||||
background-clip: padding-box; // For Firefox background bug, https://github.com/ant-design/ant-design/issues/12628
|
||||
/* stylelint-disable-next-line */
|
||||
-webkit-background-clip: border-box; // For Chrome extra space: https://github.com/ant-design/ant-design/issues/14926
|
||||
|
||||
&.@{table-prefix-cls}-column-has-filters {
|
||||
// https://github.com/ant-design/ant-design/issues/12650
|
||||
padding-right: 30px !important;
|
||||
&.@{table-prefix-cls}-column-has-filters {
|
||||
// https://github.com/ant-design/ant-design/issues/12650
|
||||
padding-right: 30px !important;
|
||||
|
||||
.@{iconfont-css-prefix}-filter,
|
||||
.@{table-prefix-cls}-filter-icon {
|
||||
&.@{table-prefix-cls}-filter-open {
|
||||
color: @text-color-secondary;
|
||||
background: @table-header-filter-active-bg;
|
||||
}
|
||||
}
|
||||
// Very complicated styles logic but necessary
|
||||
&:hover {
|
||||
.@{iconfont-css-prefix}-filter,
|
||||
.@{table-prefix-cls}-filter-icon {
|
||||
&.@{table-prefix-cls}-filter-open {
|
||||
&:hover {
|
||||
color: @text-color-secondary;
|
||||
background: @table-header-filter-active-bg;
|
||||
}
|
||||
}
|
||||
// Very complicated styles logic but necessary
|
||||
&:hover {
|
||||
.@{iconfont-css-prefix}-filter,
|
||||
.@{table-prefix-cls}-filter-icon {
|
||||
&:hover {
|
||||
color: @text-color-secondary;
|
||||
background: @table-header-filter-active-bg;
|
||||
}
|
||||
&:active {
|
||||
color: @text-color;
|
||||
}
|
||||
&:active {
|
||||
color: @text-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.@{table-prefix-cls}-column-has-sorters {
|
||||
cursor: pointer;
|
||||
&:hover {
|
||||
background: @table-header-sort-active-bg;
|
||||
.@{iconfont-css-prefix}-filter,
|
||||
.@{table-prefix-cls}-filter-icon {
|
||||
background: @table-header-sort-active-bg;
|
||||
}
|
||||
}
|
||||
&:active {
|
||||
.@{table-prefix-cls}-column-sorter-up:not(.on),
|
||||
.@{table-prefix-cls}-column-sorter-down:not(.on) {
|
||||
color: @text-color-secondary;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.@{table-prefix-cls}-header-column {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
|
||||
.@{table-prefix-cls}-column-sorters {
|
||||
display: table;
|
||||
|
||||
> .@{table-prefix-cls}-column-title {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
> *:not(.@{table-prefix-cls}-column-sorter) {
|
||||
position: relative;
|
||||
}
|
||||
&::before {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background: transparent;
|
||||
transition: all 0.3s;
|
||||
content: '';
|
||||
}
|
||||
&:hover::before {
|
||||
background: rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.@{table-prefix-cls}-column-has-sorters {
|
||||
user-select: none;
|
||||
cursor: pointer;
|
||||
&:hover {
|
||||
background: @table-header-sort-active-bg;
|
||||
.@{iconfont-css-prefix}-filter,
|
||||
.@{table-prefix-cls}-filter-icon {
|
||||
background: @table-header-sort-active-bg;
|
||||
}
|
||||
}
|
||||
&:active {
|
||||
.@{table-prefix-cls}-column-sorter-up:not(.on),
|
||||
.@{table-prefix-cls}-column-sorter-down:not(.on) {
|
||||
color: @text-color-secondary;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.@{table-prefix-cls}-header-column {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
|
||||
.@{table-prefix-cls}-column-sorters {
|
||||
display: table;
|
||||
|
||||
> .@{table-prefix-cls}-column-title {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
> *:not(.@{table-prefix-cls}-column-sorter) {
|
||||
position: relative;
|
||||
}
|
||||
&::before {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background: transparent;
|
||||
transition: all 0.3s;
|
||||
content: '';
|
||||
}
|
||||
&:hover::before {
|
||||
background: rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.@{table-prefix-cls}-column-has-sorters {
|
||||
user-select: none;
|
||||
}
|
||||
}
|
||||
|
||||
&-thead > tr:first-child > th {
|
||||
@ -248,6 +243,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
&-thead > tr:hover {
|
||||
background: none;
|
||||
}
|
||||
|
||||
&-footer {
|
||||
position: relative;
|
||||
padding: @table-padding-vertical @table-padding-horizontal;
|
||||
@ -284,8 +283,8 @@
|
||||
|
||||
&-title + &-content {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
border-radius: @table-border-radius-base @table-border-radius-base 0 0;
|
||||
|
||||
.@{table-prefix-cls}-bordered & {
|
||||
&,
|
||||
table,
|
||||
@ -611,6 +610,32 @@
|
||||
// Workaround for additional scroll bar on the table header
|
||||
// https://github.com/ant-design/ant-design/issues/6515#issuecomment-419634369
|
||||
opacity: 0.9999;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
border: 1px solid @border-color-split;
|
||||
border-width: 0 0 1px 0;
|
||||
}
|
||||
}
|
||||
|
||||
&-hide-scrollbar {
|
||||
// https://github.com/ant-design/ant-design/issues/4637
|
||||
// https://stackoverflow.com/a/54101063
|
||||
// https://github.com/react-component/table/pull/333
|
||||
scrollbar-color: transparent transparent;
|
||||
&::-webkit-scrollbar {
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
// optimize header style of borderd table after hide extra scrollbar
|
||||
&-bordered&-fixed-header &-scroll &-header {
|
||||
&::-webkit-scrollbar {
|
||||
border: 1px solid @border-color-split;
|
||||
border-width: 1px 1px 1px 0;
|
||||
}
|
||||
&.@{table-prefix-cls}-hide-scrollbar .@{table-prefix-cls}-thead > tr > th:last-child {
|
||||
border-right-color: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
&-fixed-left,
|
||||
@ -708,4 +733,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Another fix of Firefox:
|
||||
* - https://github.com/ant-design/ant-design/issues/12628
|
||||
* - https://github.com/ant-design/ant-design/issues/12628
|
||||
*/
|
||||
@supports (-moz-appearance: meterbar) {
|
||||
.@{table-prefix-cls}-thead > tr > th.@{table-prefix-cls}-column-has-actions {
|
||||
background-clip: padding-box;
|
||||
}
|
||||
}
|
||||
|
||||
@import './size';
|
||||
|
@ -225,3 +225,14 @@
|
||||
right: @control-padding-horizontal-sm - 1px;
|
||||
}
|
||||
}
|
||||
|
||||
// Fix cursor height in safari
|
||||
// https://stackoverflow.com/q/3843408/3040605
|
||||
// https://browserstrangeness.github.io/css_hacks.html#safari
|
||||
@media not all and (min-resolution: 0.001dpcm) {
|
||||
@supports (-webkit-appearance: none) and (stroke-color: transparent) {
|
||||
.@{ant-prefix}-input {
|
||||
line-height: @line-height-base;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -159,26 +159,25 @@ export default class TransferList extends React.Component<TransferListProps, Tra
|
||||
</div>
|
||||
) : null;
|
||||
|
||||
const searchNotFound = !filteredItems.length && (
|
||||
<div className={`${prefixCls}-body-not-found`}>{notFoundContent}</div>
|
||||
);
|
||||
|
||||
let listBody: React.ReactNode = bodyDom;
|
||||
if (!listBody) {
|
||||
let bodyNode: React.ReactNode = searchNotFound;
|
||||
if (!bodyNode) {
|
||||
const { bodyContent, customize } = renderListNode(renderList, {
|
||||
...omit(this.props, OmitProps),
|
||||
filteredItems,
|
||||
filteredRenderItems,
|
||||
selectedKeys: checkedKeys,
|
||||
});
|
||||
let bodyNode: React.ReactNode;
|
||||
|
||||
// We should wrap customize list body in a classNamed div to use flex layout.
|
||||
bodyNode = customize ? (
|
||||
<div className={`${prefixCls}-body-customize-wrapper`}>{bodyContent}</div>
|
||||
) : (
|
||||
const { bodyContent, customize } = renderListNode(renderList, {
|
||||
...omit(this.props, OmitProps),
|
||||
filteredItems,
|
||||
filteredRenderItems,
|
||||
selectedKeys: checkedKeys,
|
||||
});
|
||||
|
||||
// We should wrap customize list body in a classNamed div to use flex layout.
|
||||
if (customize) {
|
||||
bodyNode = <div className={`${prefixCls}-body-customize-wrapper`}>{bodyContent}</div>;
|
||||
} else {
|
||||
bodyNode = filteredItems.length ? (
|
||||
bodyContent
|
||||
) : (
|
||||
<div className={`${prefixCls}-body-not-found`}>{notFoundContent}</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -244,7 +244,8 @@
|
||||
left: 12px;
|
||||
width: 1px;
|
||||
height: 100%;
|
||||
margin: 22px 0;
|
||||
height: calc(100% - 22px); // Remove additional height if support
|
||||
margin: 22px 0 0;
|
||||
border-left: 1px solid @border-color-base;
|
||||
content: ' ';
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ import * as React from 'react';
|
||||
import warning from '../_util/warning';
|
||||
import Base, { BlockProps } from './Base';
|
||||
|
||||
interface TextProps extends BlockProps {
|
||||
export interface TextProps extends BlockProps {
|
||||
ellipsis?: boolean;
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@ const Text: React.SFC<TextProps> = ({ ellipsis, ...restProps }) => {
|
||||
warning(
|
||||
typeof ellipsis !== 'object',
|
||||
'Typography.Text',
|
||||
'`ellipsis` is only support boolean value.',
|
||||
'`ellipsis` only supports boolean value.',
|
||||
);
|
||||
return <Base {...restProps} ellipsis={!!ellipsis} component="span" />;
|
||||
};
|
||||
|
@ -39,11 +39,11 @@
|
||||
}
|
||||
|
||||
&&-warning {
|
||||
color: @text-color-warning;
|
||||
color: @warning-color;
|
||||
}
|
||||
|
||||
&&-danger {
|
||||
color: @text-color-danger;
|
||||
color: @error-color;
|
||||
}
|
||||
|
||||
&&-disabled {
|
||||
|
@ -8,7 +8,8 @@ export interface HttpRequestHeader {
|
||||
|
||||
export interface RcFile extends File {
|
||||
uid: string;
|
||||
lastModifiedDate: Date;
|
||||
readonly lastModifiedDate: Date;
|
||||
readonly webkitRelativePath: string;
|
||||
}
|
||||
|
||||
export interface UploadFile {
|
||||
@ -27,7 +28,6 @@ export interface UploadFile {
|
||||
error?: any;
|
||||
linkProps?: any;
|
||||
type: string;
|
||||
webkitRelativePath?: string;
|
||||
}
|
||||
|
||||
export interface UploadChangeParam<T extends object = UploadFile> {
|
||||
@ -59,7 +59,7 @@ export interface UploadProps {
|
||||
name?: string;
|
||||
defaultFileList?: Array<UploadFile>;
|
||||
fileList?: Array<UploadFile>;
|
||||
action?: string | ((file: UploadFile) => string) | ((file: UploadFile) => PromiseLike<string>);
|
||||
action?: string | ((file: RcFile) => string) | ((file: RcFile) => PromiseLike<string>);
|
||||
directory?: boolean;
|
||||
data?: Object | ((file: UploadFile) => any);
|
||||
headers?: HttpRequestHeader;
|
||||
|
@ -106,6 +106,19 @@ If you need some features which should not be included in antd, try to extend an
|
||||
|
||||
You can config `nonce` by [ConfigProvider](/components/config-provider/#Content-Security-Policy).
|
||||
|
||||
### When set `mode` to DatePicker/RangePicker, cannot select year or month anymore?
|
||||
|
||||
In real world development, you may need a YearPicker, MonthRangePicker or WeekRangePicker. You are trying to add `mode` to DatePicker/RangePicker expected to implement those pickers. However, the DatePicker/RangePicker cannot be selected and the panels won't close now!
|
||||
|
||||
- Reproduce link: https://codesandbox.io/s/dank-brook-v1csy
|
||||
- Same issues:[#15572](https://github.com/ant-design/ant-design/issues/15572), [#16436](https://github.com/ant-design/ant-design/issues/16436), [#11938](https://github.com/ant-design/ant-design/issues/11938), [#11735](https://github.com/ant-design/ant-design/issues/11735), [#11586](https://github.com/ant-design/ant-design/issues/11586), [#10425](https://github.com/ant-design/ant-design/issues/10425), [#11053](https://github.com/ant-design/ant-design/issues/11053)
|
||||
|
||||
Like [the explaination](https://github.com/ant-design/ant-design/issues/11586#issuecomment-429189877) here, that is because `<DatePicker mode="year" />` do not equal to `YearPicker`, `<RangePicker mode="month" />` do not equal to `MonthRangePicker` either. The `mode` property was added to support [showing time picker panel in DatePicker](https://github.com/ant-design/ant-design/issues/5190) in antd 3.0, which simply control the displayed panel and won't change the original date picking behavior of `DatePicker/RangePicker` (for instance you still need to click date cell to finish selection in a DatePicker, whatever the `mode` is).
|
||||
|
||||
##### Workaround
|
||||
|
||||
You can refer to [this article](https://juejin.im/post/5cf65c366fb9a07eca6968f9) or [this article](https://www.cnblogs.com/zyl-Tara/p/10197177.html), using `mode` and `onPanelChange` to encapsulate a `YearPicker` or `MonthRangePicker` for your needs. Or you can wait for our [antd@4.0](https://github.com/ant-design/ant-design/issues/16911), in which we are planing to [add more XxxPickers](https://github.com/ant-design/ant-design/issues/4524#issuecomment-480576884) for those requirments.
|
||||
|
||||
### How to spell Ant Design correctly?
|
||||
|
||||
- ✅ **Ant Design**: Capitalized with space, for the design language.
|
||||
|
@ -110,6 +110,19 @@ import { Menu, Breadcrumb, Icon } from 'antd';
|
||||
|
||||
你可以通过 [ConfigProvider](/components/config-provider/#Content-Security-Policy) 来配置 `nonce` 属性。
|
||||
|
||||
### 当我指定了 DatePicker/RangePicker 的 `mode` 属性后,点击后无法选择年份/月份?
|
||||
|
||||
在业务开发中,你可能有年份选择,月份范围选择,周范围选择等需求,此时你给现有组件增加了 `mode` 属性,却发现无法进行点击选择行为,面板也不会关闭。
|
||||
|
||||
- 重现链接:https://codesandbox.io/s/dank-brook-v1csy
|
||||
- 相同 issue:[#15572](https://github.com/ant-design/ant-design/issues/15572)、[#16436](https://github.com/ant-design/ant-design/issues/16436)、[#11938](https://github.com/ant-design/ant-design/issues/11938)、[#11735](https://github.com/ant-design/ant-design/issues/11735)、[#11586](https://github.com/ant-design/ant-design/issues/11586)、[#10425](https://github.com/ant-design/ant-design/issues/10425)、[#11053](https://github.com/ant-design/ant-design/issues/11053)
|
||||
|
||||
就像[这个回复](https://github.com/ant-design/ant-design/issues/15572#issuecomment-475476135)里解释的一样,这是因为 `<DatePicker mode="year" />` 不等于 `YearPicker`,`<RangePicker mode="month" />` 不等于 `MonthRangePicker`。 `mode` 属性是在 antd 3.0 时,为了控制面板展现状态而添加的属性,以支持[展示时间面板](https://github.com/ant-design/ant-design/issues/5190)等需求而添加的。`mode` 只会简单的改变当前显示的面板,不会修改默认的交互行为(比如 DatePicker 依然是点击日才会完成选择并关闭面板)。
|
||||
|
||||
##### 解决办法
|
||||
|
||||
你可以参照 [这篇文章](https://juejin.im/post/5cf65c366fb9a07eca6968f9) 或者 [这篇文章](https://www.cnblogs.com/zyl-Tara/p/10197177.html) 里的做法,利用 `mode` 和 `onPanelChange` 等方法去封装一个 `YearPicker` 等组件。我们计划在 [antd@4.0](https://github.com/ant-design/ant-design/issues/16911) 中直接[添加更多相关日期组件](https://github.com/ant-design/ant-design/issues/4524#issuecomment-480576884)来支持这些需求。
|
||||
|
||||
### 如何正确的拼写 Ant Design?
|
||||
|
||||
- ✅ **Ant Design**:用空格分隔的首字母大写单词,指代设计语言。
|
||||
|
@ -38,7 +38,7 @@ Ant Design 的色板还具备进一步拓展的能力。经过设计师和程序
|
||||
|
||||
### 中性色板
|
||||
|
||||
中性色包含了黑、白、灰。在蚂蚁中后台的网页设计中被大量使用到,合理的选择中性色能够令页面信息具备良好的主次关系,助力阅读体验。Ant Design 的中性色板一共包含了从白到黑的 10 个颜色。
|
||||
中性色包含了黑、白、灰。在蚂蚁中后台的网页设计中被大量使用到,合理地选择中性色能够令页面信息具备良好的主次关系,助力阅读体验。Ant Design 的中性色板一共包含了从白到黑的 10 个颜色。
|
||||
|
||||
```__react
|
||||
import Palette from '../../site/theme/template/Color/Palette';
|
||||
@ -99,7 +99,7 @@ ReactDOM.render(<ColorPaletteTool />, mountNode);
|
||||
|
||||
<img class="preview-img no-padding" align="right" src="https://gw.alipayobjects.com/zos/rmsportal/msiCkgfDaDgrTUuumxlq.png">
|
||||
|
||||
品牌色是体现产品特性和传播理念最直观的视觉元素之一。在色彩选取时,需要先明确品牌色在界面中的使用场景及范围。在基础色板中选择主色,我们建议选择色板从浅自深的第六个颜色作为主色。 Ant Design 的品牌色取自基础色板的蓝色,Hex 值为 1890FF,应用场景包括:关键行动点,操作状态、重要信息高亮,图形化等场景。
|
||||
品牌色是体现产品特性和传播理念最直观的视觉元素之一。在色彩选取时,需要先明确品牌色在界面中的使用场景及范围。在基础色板中选择主色,我们建议选择色板从浅至深的第六个颜色作为主色。 Ant Design 的品牌色取自基础色板的蓝色,Hex 值为 `#1890FF`,应用场景包括:关键行动点,操作状态、重要信息高亮,图形化等场景。
|
||||
|
||||
### 功能色
|
||||
|
||||
|
@ -71,7 +71,7 @@ When the operation takes a while (usually more than 2 seconds) to complete, the
|
||||
|
||||
<br />
|
||||
|
||||
<img class="preview-img no-padding" align="right" src="https://gw.alipayobjects.com/zos/rmsportal/cHaaqZTvzgCZiYUnfNom.png" description="Used when the operation takes a long time to complete, showing the current progress and status of the operation.">
|
||||
<img class="preview-img no-padding" align="right" src="https://gw.alipayobjects.com/zos/antfincdn/j6XiEx6UUV/676a18a1-bf60-4d93-8f94-55f1882dd13e.png" description="Used when the operation takes a long time to complete, showing the current progress and status of the operation.">
|
||||
|
||||
> Note: If the loading time is long, a cancel operation should be provided.
|
||||
|
||||
|
@ -71,7 +71,7 @@ title: 反馈
|
||||
|
||||
<br />
|
||||
|
||||
<img class="preview-img no-padding" align="right" src="https://gw.alipayobjects.com/zos/rmsportal/cHaaqZTvzgCZiYUnfNom.png" description="在操作需要较长时间才能完成时使用,显示该操作的当前进度和状态。">
|
||||
<img class="preview-img no-padding" align="right" src="https://gw.alipayobjects.com/zos/antfincdn/j6XiEx6UUV/676a18a1-bf60-4d93-8f94-55f1882dd13e.png" description="在操作需要较长时间才能完成时使用,显示该操作的当前进度和状态。">
|
||||
|
||||
> 注:若加载时间较长,应提供取消操作。
|
||||
|
||||
|
173
package.json
173
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "antd",
|
||||
"version": "3.19.1",
|
||||
"version": "3.19.3",
|
||||
"title": "Ant Design",
|
||||
"description": "An enterprise-class UI design language and React components implementation",
|
||||
"homepage": "http://ant.design/",
|
||||
@ -44,154 +44,155 @@
|
||||
"dependencies": {
|
||||
"@ant-design/create-react-context": "^0.2.4",
|
||||
"@ant-design/icons": "~2.1.0",
|
||||
"@ant-design/icons-react": "~2.0.0",
|
||||
"@types/react-slick": "^0.23.3",
|
||||
"@ant-design/icons-react": "~2.0.1",
|
||||
"@types/react-slick": "^0.23.4",
|
||||
"array-tree-filter": "^2.1.0",
|
||||
"babel-runtime": "6.x",
|
||||
"classnames": "~2.2.6",
|
||||
"copy-to-clipboard": "^3.0.8",
|
||||
"copy-to-clipboard": "^3.2.0",
|
||||
"css-animation": "^1.5.0",
|
||||
"dom-closest": "^0.2.0",
|
||||
"enquire.js": "^2.1.6",
|
||||
"lodash": "^4.17.11",
|
||||
"moment": "^2.24.0",
|
||||
"omit.js": "^1.0.0",
|
||||
"prop-types": "^15.6.2",
|
||||
"raf": "^3.4.0",
|
||||
"rc-animate": "^2.5.4",
|
||||
"rc-calendar": "~9.14.0",
|
||||
"rc-cascader": "~0.17.0",
|
||||
"rc-checkbox": "~2.1.5",
|
||||
"rc-collapse": "~1.11.1",
|
||||
"omit.js": "^1.0.2",
|
||||
"prop-types": "^15.7.2",
|
||||
"raf": "^3.4.1",
|
||||
"rc-animate": "^2.8.3",
|
||||
"rc-calendar": "~9.15.0",
|
||||
"rc-cascader": "~0.17.4",
|
||||
"rc-checkbox": "~2.1.6",
|
||||
"rc-collapse": "~1.11.3",
|
||||
"rc-dialog": "~7.4.0",
|
||||
"rc-drawer": "~1.9.3",
|
||||
"rc-drawer": "~1.9.8",
|
||||
"rc-dropdown": "~2.4.1",
|
||||
"rc-editor-mention": "^1.1.7",
|
||||
"rc-form": "^2.4.0",
|
||||
"rc-input-number": "~4.4.0",
|
||||
"rc-editor-mention": "^1.1.13",
|
||||
"rc-form": "^2.4.5",
|
||||
"rc-input-number": "~4.4.5",
|
||||
"rc-mentions": "~0.3.1",
|
||||
"rc-menu": "~7.4.12",
|
||||
"rc-notification": "~3.3.0",
|
||||
"rc-menu": "~7.4.23",
|
||||
"rc-notification": "~3.3.1",
|
||||
"rc-pagination": "~1.20.1",
|
||||
"rc-progress": "~2.3.0",
|
||||
"rc-rate": "~2.5.0",
|
||||
"rc-select": "~9.1.0",
|
||||
"rc-slider": "~8.6.5",
|
||||
"rc-select": "~9.1.4",
|
||||
"rc-slider": "~8.6.11",
|
||||
"rc-steps": "~3.4.1",
|
||||
"rc-switch": "~1.9.0",
|
||||
"rc-table": "~6.5.0",
|
||||
"rc-tabs": "~9.6.0",
|
||||
"rc-time-picker": "~3.6.1",
|
||||
"rc-table": "~6.6.0",
|
||||
"rc-tabs": "~9.6.4",
|
||||
"rc-time-picker": "~3.6.6",
|
||||
"rc-tooltip": "~3.7.3",
|
||||
"rc-tree": "~2.1.0",
|
||||
"rc-tree-select": "~2.9.1",
|
||||
"rc-trigger": "^2.6.2",
|
||||
"rc-upload": "~2.6.0",
|
||||
"rc-util": "^4.5.1",
|
||||
"rc-upload": "~2.6.7",
|
||||
"rc-util": "^4.6.0",
|
||||
"react-lazy-load": "^3.0.13",
|
||||
"react-lifecycles-compat": "^3.0.4",
|
||||
"react-slick": "~0.24.0",
|
||||
"resize-observer-polyfill": "^1.5.0",
|
||||
"resize-observer-polyfill": "^1.5.1",
|
||||
"shallowequal": "^1.1.0",
|
||||
"warning": "~4.0.2"
|
||||
"warning": "~4.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ant-design/colors": "^3.0.0",
|
||||
"@sentry/browser": "^5.0.3",
|
||||
"@types/classnames": "^2.2.6",
|
||||
"@types/prop-types": "^15.5.6",
|
||||
"@types/react": "~16.8.1",
|
||||
"@types/react-dom": "^16.0.11",
|
||||
"@types/react-intl": "^2.3.14",
|
||||
"@ant-design/colors": "^3.1.0",
|
||||
"@packtracker/webpack-plugin": "^2.0.1",
|
||||
"@sentry/browser": "^5.4.0",
|
||||
"@types/classnames": "^2.2.8",
|
||||
"@types/prop-types": "^15.7.1",
|
||||
"@types/react": "~16.8.19",
|
||||
"@types/react-dom": "^16.8.4",
|
||||
"@types/react-intl": "^2.3.17",
|
||||
"@types/warning": "^3.0.0",
|
||||
"@yesmeck/offline-plugin": "^5.0.5",
|
||||
"ansi-styles": "^3.2.1",
|
||||
"antd-theme-generator": "^1.1.4",
|
||||
"ansi-styles": "^4.0.0",
|
||||
"antd-theme-generator": "^1.1.6",
|
||||
"antd-tools": "^7.3.5",
|
||||
"babel-eslint": "^10.0.1",
|
||||
"babel-plugin-add-react-displayname": "^0.0.5",
|
||||
"bisheng": "^1.2.4",
|
||||
"bisheng-plugin-antd": "^1.0.1",
|
||||
"bisheng-plugin-antd": "^1.0.2",
|
||||
"bisheng-plugin-description": "^0.1.4",
|
||||
"bisheng-plugin-react": "^1.0.0",
|
||||
"bisheng-plugin-toc": "^0.4.4",
|
||||
"chalk": "^2.4.2",
|
||||
"commander": "^2.18.0",
|
||||
"commander": "^2.20.0",
|
||||
"cross-env": "^5.2.0",
|
||||
"css-split-webpack-plugin": "^0.2.6",
|
||||
"dekko": "^0.2.1",
|
||||
"docsearch.js": "^2.5.2",
|
||||
"docsearch.js": "^2.6.3",
|
||||
"enquire-js": "^0.2.1",
|
||||
"enzyme": "^3.7.0",
|
||||
"enzyme-adapter-react-16": "^1.6.0",
|
||||
"enzyme-to-json": "^3.3.4",
|
||||
"eslint": "^5.6.1",
|
||||
"enzyme": "^3.10.0",
|
||||
"enzyme-adapter-react-16": "^1.14.0",
|
||||
"enzyme-to-json": "^3.3.5",
|
||||
"eslint": "^5.16.0",
|
||||
"eslint-config-airbnb": "^17.1.0",
|
||||
"eslint-config-prettier": "^4.0.0",
|
||||
"eslint-plugin-babel": "^5.2.1",
|
||||
"eslint-plugin-import": "^2.17.1",
|
||||
"eslint-plugin-jest": "^22.4.1",
|
||||
"eslint-plugin-jsx-a11y": "^6.1.2",
|
||||
"eslint-plugin-markdown": "~1.0.0-beta.6",
|
||||
"eslint-plugin-react": "^7.11.1",
|
||||
"eslint-config-prettier": "^4.3.0",
|
||||
"eslint-plugin-babel": "^5.3.0",
|
||||
"eslint-plugin-import": "^2.17.3",
|
||||
"eslint-plugin-jest": "^22.6.4",
|
||||
"eslint-plugin-jsx-a11y": "^6.2.1",
|
||||
"eslint-plugin-markdown": "~1.0.0",
|
||||
"eslint-plugin-react": "^7.13.0",
|
||||
"eslint-tinker": "^0.5.0",
|
||||
"fetch-jsonp": "^1.1.3",
|
||||
"glob": "^7.1.3",
|
||||
"glob": "^7.1.4",
|
||||
"immutability-helper": "^3.0.0",
|
||||
"intersection-observer": "^0.7.0",
|
||||
"jest": "^24.0.0",
|
||||
"jsdom": "^15.0.0",
|
||||
"jest": "^24.8.0",
|
||||
"jsdom": "^15.1.1",
|
||||
"jsonml.js": "^0.1.0",
|
||||
"lint-staged": "^8.0.2",
|
||||
"lint-staged": "^8.1.7",
|
||||
"logrocket": "^1.0.0",
|
||||
"logrocket-react": "^3.0.0",
|
||||
"lz-string": "^1.4.4",
|
||||
"majo": "^0.7.1",
|
||||
"majo": "^0.8.0",
|
||||
"mockdate": "^2.0.2",
|
||||
"node-fetch": "^2.3.0",
|
||||
"node-fetch": "^2.6.0",
|
||||
"pre-commit": "^1.2.2",
|
||||
"preact": "^8.3.1",
|
||||
"preact-compat": "^3.18.4",
|
||||
"prettier": "^1.17.0",
|
||||
"preact": "^8.4.2",
|
||||
"preact-compat": "^3.18.5",
|
||||
"prettier": "^1.17.1",
|
||||
"querystring": "^0.2.0",
|
||||
"rc-queue-anim": "^1.6.6",
|
||||
"rc-scroll-anim": "^2.5.7",
|
||||
"rc-tween-one": "^2.4.0",
|
||||
"rc-queue-anim": "^1.6.12",
|
||||
"rc-scroll-anim": "^2.5.8",
|
||||
"rc-tween-one": "^2.4.1",
|
||||
"react": "^16.5.2",
|
||||
"react-color": "^2.14.1",
|
||||
"react-color": "^2.17.3",
|
||||
"react-copy-to-clipboard": "^5.0.1",
|
||||
"react-dnd": "^7.0.2",
|
||||
"react-dnd-html5-backend": "^7.0.2",
|
||||
"react-dnd": "^7.4.5",
|
||||
"react-dnd-html5-backend": "^7.4.4",
|
||||
"react-document-title": "^2.0.3",
|
||||
"react-dom": "^16.5.2",
|
||||
"react-github-button": "^0.1.11",
|
||||
"react-highlight-words": "^0.16.0",
|
||||
"react-infinite-scroller": "^1.2.1",
|
||||
"react-intl": "^2.7.0",
|
||||
"react-infinite-scroller": "^1.2.4",
|
||||
"react-intl": "^2.9.0",
|
||||
"react-resizable": "^1.8.0",
|
||||
"react-router-dom": "^5.0.0",
|
||||
"react-router-dom": "^5.0.1",
|
||||
"react-sticky": "^6.0.3",
|
||||
"react-test-renderer": "^16.6.3",
|
||||
"react-virtualized": "~9.21.0",
|
||||
"react-test-renderer": "^16.8.6",
|
||||
"react-virtualized": "~9.21.1",
|
||||
"remark-cli": "^6.0.1",
|
||||
"remark-frontmatter": "^1.3.0",
|
||||
"remark-frontmatter": "^1.3.1",
|
||||
"remark-lint": "^6.0.4",
|
||||
"remark-parse": "^6.0.0",
|
||||
"remark-parse": "^6.0.3",
|
||||
"remark-preset-lint-recommended": "^3.0.2",
|
||||
"remark-stringify": "^6.0.0",
|
||||
"remark-yaml-config": "^4.0.2",
|
||||
"remark-stringify": "^6.0.4",
|
||||
"remark-yaml-config": "^4.0.3",
|
||||
"reqwest": "^2.0.5",
|
||||
"rimraf": "^2.6.2",
|
||||
"rimraf": "^2.6.3",
|
||||
"scrollama": "^2.0.0",
|
||||
"simple-git": "^1.110.0",
|
||||
"stylelint": "^10.0.0",
|
||||
"stylelint-config-prettier": "^5.0.0",
|
||||
"stylelint-config-rational-order": "^0.1.0",
|
||||
"stylelint-config-standard": "^18.2.0",
|
||||
"stylelint-declaration-block-no-ignored-properties": "^2.0.0",
|
||||
"simple-git": "^1.113.0",
|
||||
"stylelint": "^10.0.1",
|
||||
"stylelint-config-prettier": "^5.2.0",
|
||||
"stylelint-config-rational-order": "^0.1.2",
|
||||
"stylelint-config-standard": "^18.3.0",
|
||||
"stylelint-declaration-block-no-ignored-properties": "^2.1.0",
|
||||
"stylelint-order": "^3.0.0",
|
||||
"typescript": "~3.4.1",
|
||||
"unified": "^7.0.0",
|
||||
"typescript": "~3.5.1",
|
||||
"unified": "^7.1.0",
|
||||
"xhr-mock": "^2.4.1",
|
||||
"xhr2": "^0.2.0"
|
||||
},
|
||||
@ -246,5 +247,11 @@
|
||||
"es/**/style/*",
|
||||
"lib/**/style/*",
|
||||
"*.less"
|
||||
],
|
||||
"browserslist": [
|
||||
"last 2 version",
|
||||
"Firefox ESR",
|
||||
"> 1%",
|
||||
"ie >= 9"
|
||||
]
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ module.exports = {
|
||||
'app.header.menu.spec': 'Guidelines',
|
||||
'app.header.menu.resource': 'Resources',
|
||||
'app.header.menu.mobile': 'Mobile',
|
||||
'app.header.menu.pro': 'Ant Design Pro',
|
||||
'app.header.menu.pro.v4': 'Ant Design Pro v4',
|
||||
'app.header.menu.ecosystem': 'Ecosystem',
|
||||
'app.header.lang': '中文',
|
||||
'app.content.edit-page': 'Edit this page on GitHub!',
|
||||
|
@ -51,7 +51,8 @@ ul.toc > li {
|
||||
.ant-affix {
|
||||
z-index: 9;
|
||||
max-height: ~'calc(100vh - 16px)';
|
||||
overflow: auto;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
background: #fff;
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
||||
import { Link } from 'bisheng/router';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
import classNames from 'classnames';
|
||||
import { Select, Menu, Row, Col, Icon, Popover, Input, Button } from 'antd';
|
||||
import { Select, Menu, Row, Col, Icon, Popover, Input, Button, Badge } from 'antd';
|
||||
import Santa from './Santa';
|
||||
import * as utils from '../utils';
|
||||
import { version as antdVersion } from '../../../../package.json';
|
||||
@ -179,7 +179,11 @@ export default class Header extends React.Component {
|
||||
<Menu.SubMenu
|
||||
key="ecosystem"
|
||||
className="hide-in-home-page"
|
||||
title={<FormattedMessage id="app.header.menu.ecosystem" />}
|
||||
title={
|
||||
<Badge dot>
|
||||
<FormattedMessage id="app.header.menu.ecosystem" />
|
||||
</Badge>
|
||||
}
|
||||
>
|
||||
<Menu.Item key="pro">
|
||||
<a
|
||||
@ -188,7 +192,9 @@ export default class Header extends React.Component {
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<FormattedMessage id="app.header.menu.pro" />
|
||||
<Badge dot>
|
||||
<FormattedMessage id="app.header.menu.pro.v4" />
|
||||
</Badge>
|
||||
</a>
|
||||
</Menu.Item>
|
||||
<Menu.Item key="ng">
|
||||
|
@ -12,7 +12,7 @@ module.exports = {
|
||||
'app.header.menu.spec': '设计语言',
|
||||
'app.header.menu.resource': '资源',
|
||||
'app.header.menu.mobile': '移动版',
|
||||
'app.header.menu.pro': 'Ant Design Pro',
|
||||
'app.header.menu.pro.v4': 'Ant Design Pro v4',
|
||||
'app.header.menu.ecosystem': '生态',
|
||||
'app.header.lang': 'English',
|
||||
'app.content.edit-page': '在 GitHub 上编辑此页!',
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* eslint no-param-reassign: 0 */
|
||||
// This config is for building dist files
|
||||
const getWebpackConfig = require('antd-tools/lib/getWebpackConfig');
|
||||
const PacktrackerPlugin = require('@packtracker/webpack-plugin');
|
||||
|
||||
const { webpack } = getWebpackConfig;
|
||||
|
||||
@ -35,6 +36,15 @@ if (process.env.RUN_ENV === 'PRODUCTION') {
|
||||
ignoreMomentLocale(config);
|
||||
externalMoment(config);
|
||||
addLocales(config);
|
||||
// https://docs.packtracker.io/uploading-your-webpack-stats/webpack-plugin
|
||||
config.plugins.push(
|
||||
new PacktrackerPlugin({
|
||||
project_token: '8adbb892-ee4a-4d6f-93bb-a03219fb6778',
|
||||
upload: process.env.CI === 'true',
|
||||
fail_build: true,
|
||||
exclude_assets: name => !['antd.min.js', 'antd.min.css'].includes(name),
|
||||
}),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user