Merge remote-tracking branch 'origin/master' into 4.0-prepare

This commit is contained in:
zombiej 2019-07-29 14:35:15 +08:00
commit 514ee9bef9
63 changed files with 840 additions and 147 deletions

14
.github/main.workflow vendored Normal file
View File

@ -0,0 +1,14 @@
workflow "Deploy website" {
on = "release"
resolves = ["Deploy"]
}
action "Deploy" {
uses = "docker://node:10"
runs = [
"sh",
"-c",
"git remote set-url origin https://${DEPLOY_TOKEN}@github.com/ant-design/ant-design.git && npm install && npm run deploy"
],
secrets = ["DEPLOY_TOKEN"]
}

View File

@ -15,6 +15,64 @@ timeline: true
---
## 3.20.7
- 🐞 Fix Upload can not click in Form.Item. [#17897](https://github.com/ant-design/ant-design/pull/17897)
## 3.20.6
`2019-07-24`
- 🐞 Fix Col miss the place when its height is 0. [#17748](https://github.com/ant-design/ant-design/pull/17748) [@yoyo837](https://github.com/yoyo837)
- 🐞 Fix Cascader was broken when `options`'s `children` is `null`. [#17756](https://github.com/ant-design/ant-design/pull/17756)
- 🐞 Fix Checkbox padding where all spans align left. [#17752](https://github.com/ant-design/ant-design/pull/17752) [#17761](https://github.com/ant-design/ant-design/pull/17761) [@inovux](https://github.com/inovux)
- 🐞 Fix Input line height style bug in IE. [#17759](https://github.com/ant-design/ant-design/pull/17759)
- 🐞 Fix last item of Rate has additional margin. [#17764](https://github.com/ant-design/ant-design/pull/17764) [@inovux](https://github.com/inovux)
- 🐞 Fix Radio.Button disabled item border style. [#17775](https://github.com/ant-design/ant-design/pull/17775)
- 🐞 Fix DatePicker `@input-hover-border-color` variables not working. [#17784](https://github.com/ant-design/ant-design/pull/17784)
- 🐞 Fix Transfer not re-render list when `dataSource` with `lazy`. [#17783](https://github.com/ant-design/ant-design/pull/17783)
- 🐞 Fix RangePicker `defaultValue` startTime later than endTime. [#17694](https://github.com/ant-design/ant-design/pull/17694) [@mraiguo](https://github.com/mraiguo)
- 💄 Tweak long `placeholder` truncate style. [#17797](https://github.com/ant-design/ant-design/pull/17797) [@Kapiroska](https://github.com/Kapiroska)
- 🐞 Fix Menu circular dependencies. [#17805](https://github.com/ant-design/ant-design/pull/17805) [@phthhieu](https://github.com/phthhieu)
- 🐞 Fix Alert `message` style. [#17808](https://github.com/ant-design/ant-design/pull/17808) [@mtadams007](https://github.com/mtadams007)
- 🐞 Fix Result `extra` is not centered. [#17786](https://github.com/ant-design/ant-design/pull/17786) [@nnecec](https://github.com/nnecec)
- 🐞 Fix Progress with mini `value` not keeps bar radius round. [#17819](https://github.com/ant-design/ant-design/pull/17819)
- 🐞 Fix Statistic.Countdown `format` not escaping characters in square brackets. [#17841](https://github.com/ant-design/ant-design/pull/17841)
- 🐞 Fix Table custom `filterDropdown` always triggering `onChange` in some situations. [#17846](https://github.com/ant-design/ant-design/pull/17846)
- 🐞 Fix TimePicker weird render bug in Safari. [#17857](https://github.com/ant-design/ant-design/pull/17857)
## 3.20.5
`2019-07-19`
- 🐞 Fix `<Button type="danger" ghost />` broken style. [#17743](https://github.com/ant-design/ant-design/pull/17743)
## 3.20.4
`2019-07-19`
- 🐞 Fix multiple level Drawer with falsy `mask`, parent Drawer can not collapse after removing sub component. [#17698](https://github.com/ant-design/ant-design/pull/17698)
- 🐞 Fix Table border radius missing in Firefox. [#17641](https://github.com/ant-design/ant-design/pull/17641)
- 🐞 Fix Menu throw warning `Cannot update during an existing state transition`. [#17657](https://github.com/ant-design/ant-design/pull/17657)
- 🐞 Fix Affix not resize when container size changed. [#17678](https://github.com/ant-design/ant-design/pull/17678)
- 🐞 Fix Anchor not update bind element when `getContainer` changed. [#17677](https://github.com/ant-design/ant-design/pull/17677)
- 🐞 Fix window scroll issue when using Modal and Drawer same time. [#17600](https://github.com/ant-design/ant-design/pull/17600)
- 🌟 Empty `description` supports `false`. [#17659](https://github.com/ant-design/ant-design/pull/17659) [@billfeller](https://github.com/billfeller)
- 💄 Remove Pagination element underline style to avoid polluted by global style. [#17728](https://github.com/ant-design/ant-design/pull/17728)
- 💄 Extends Card action click area. [#17705](https://github.com/ant-design/ant-design/pull/17705) [@lhx6538665](https://github.com/lhx6538665)
- 💄 Tweak less variables and UI to improve style customization. [#17705](https://github.com/ant-design/ant-design/pull/17705)
- Optimize danger Button UI design.
<img width="103" class="markdown-inline-image" alt="image" src="https://user-images.githubusercontent.com/507615/61370809-e37aa480-a8c5-11e9-98b3-51ce06dfba24.png">
- Fix `@border-radius-sm` not working for Slider, TreeSelect.
- Added some less variables for Progress, Tabs, Slider and Timeline.
- TypeScript
- 💄 Improve type definition of Form. [#17676](https://github.com/ant-design/ant-design/pull/17676) [@lixiaoyang1992](https://github.com/lixiaoyang1992)
- 💄 Improve type definition of Tabs. [#17675](https://github.com/ant-design/ant-design/pull/17675)
## 3.20.3
`2019-07-15`
@ -27,9 +85,15 @@ timeline: true
- 📖 Add version description for every features. [#17373](https://github.com/ant-design/ant-design/pull/17373) [@muzea](https://github.com/muzea)
- 🐞 Fix Button transition style when loading. [#17596](https://github.com/ant-design/ant-design/pull/17596) [@LilyWakana](https://github.com/LilyWakana)
- Cascader - 🐞 Fix not display `notFoundContent` when options.length is 0. [#17538](https://github.com/ant-design/ant-design/pull/17538) - 🐞 Fix option's loading not aligned when `isLeaf` is true. [#17550](https://github.com/ant-design/ant-design/pull/17550) - 🐞 Fix over-length text covered by arrow. [#17583](https://github.com/ant-design/ant-design/pull/17583)
- Cascader
- 🐞 Fix not display `notFoundContent` when options.length is 0. [#17538](https://github.com/ant-design/ant-design/pull/17538)
- 🐞 Fix option's loading not aligned when `isLeaf` is true. [#17550](https://github.com/ant-design/ant-design/pull/17550)
- 🐞 Fix over-length text covered by arrow. [#17583](https://github.com/ant-design/ant-design/pull/17583)
- 🐞 Fix Input style when suffix and clear icon exist both. [#17508](https://github.com/ant-design/ant-design/pull/17508) [@LilyWakana](https://github.com/LilyWakana)
- TypeScript - 💄 Improve type definition of Cascader's option. [#17581](https://github.com/ant-design/ant-design/pull/17581) [@MrHeer](https://github.com/MrHeer) - 🐞 Fix type definition of Descriptions.title. [#17412](https://github.com/ant-design/ant-design/pull/17412) - 🐞 Fix type definition of Collapse.activeKey, Collapse.defaultActiveKey and CollapsePanel.key. [#17557](https://github.com/ant-design/ant-design/pull/17557) [@thylsky](https://github.com/thylsky)
- TypeScript
- 💄 Improve type definition of Cascader's option. [#17581](https://github.com/ant-design/ant-design/pull/17581) [@MrHeer](https://github.com/MrHeer)
- 🐞 Fix type definition of Descriptions.title. [#17559](https://github.com/ant-design/ant-design/pull/17559)
- 🐞 Fix type definition of Collapse.activeKey, Collapse.defaultActiveKey and CollapsePanel.key. [#17557](https://github.com/ant-design/ant-design/pull/17557) [@thylsky](https://github.com/thylsky)
## 3.20.1
@ -51,7 +115,7 @@ timeline: true
- 🔥 Descriptions support vertical layout. [#17330](https://github.com/ant-design/ant-design/pull/17330) [@hengkx](https://github.com/hengkx)
- 🔥 Progress.Circle support gradient line color. [#17315](https://github.com/ant-design/ant-design/pull/17315) [@hengkx](https://github.com/hengkx)
<img class="markdown-inline-image" src="https://gw.alipayobjects.com/zos/antfincdn/WogwW6kA4O/method-draw-image.svg" alt="Progress">
<img class="markdown-inline-image" src="https://gw.alipayobjects.com/zos/antfincdn/WogwW6kA4O/method-draw-image.svg" alt="Progress">
- 🔥 Optimize PageHeader className naming. [#17321](https://github.com/ant-design/ant-design/pull/17321)
- 🐞 Drawer fixes `maskCloseble` to false, keyboard ESC closes invalid. [#17316](https://github.com/ant-design/ant-design/pull/17316)

View File

@ -15,6 +15,64 @@ timeline: true
---
## 3.20.7
- 🐞 修复 Upload 在 Form.Item 中无法点击的问题。[#17897](https://github.com/ant-design/ant-design/pull/17897)
## 3.20.6
`2019-07-24`
- 🐞 修复 Col 在高度为 0 时的占位问题。 [#17748](https://github.com/ant-design/ant-design/pull/17748) [@yoyo837](https://github.com/yoyo837)
- 🐞 修复 Cascader `options``children``null` 时报错的问题。[#17756](https://github.com/ant-design/ant-design/pull/17756)
- 🐞 修复 Checkbox 左对齐的内边距问题。[#17752](https://github.com/ant-design/ant-design/pull/17752) [#17761](https://github.com/ant-design/ant-design/pull/17761) [@inovux](https://github.com/inovux)
- 🐞 修复 Input 在 IE 下错位的问题。[#17759](https://github.com/ant-design/ant-design/pull/17759)
- 🐞 修复最后一个 Rate 有额外边距的问题。[#17764](https://github.com/ant-design/ant-design/pull/17764) [@inovux](https://github.com/inovux)
- 🐞 修复 Radio.Button 失效项的边框样式问题。[#17775](https://github.com/ant-design/ant-design/pull/17775)
- 🐞 修复 DatePicker `@input-hover-border-color` 变量不生效的问题。[#17784](https://github.com/ant-design/ant-design/pull/17784)
- 🐞 修复 Transfer 在 `lazy` 时更新数据不触发重新渲染的问题。[#17783](https://github.com/ant-design/ant-design/pull/17783)
- 🐞 修复 RangePicker `defaultValue` 中开始时间可大于结束时间的问题。[#17694](https://github.com/ant-design/ant-design/pull/17694) [@mraiguo](https://github.com/mraiguo)
- 💄 优化 `placeholder` 文字过长时的截断样式兼容性问题。[#17797](https://github.com/ant-design/ant-design/pull/17797) [@Kapiroska](https://github.com/Kapiroska)
- 🐞 修复 Menu 循环依赖的问题。[#17805](https://github.com/ant-design/ant-design/pull/17805) [@phthhieu](https://github.com/phthhieu)
- 🐞 修复 Alert `message` 样式问题。[#17808](https://github.com/ant-design/ant-design/pull/17808) [@mtadams007](https://github.com/mtadams007)
- 🐞 修复 Result `extra` 部分不居中的问题。[#17786](https://github.com/ant-design/ant-design/pull/17786) [@nnecec](https://github.com/nnecec)
- 🐞 修复 Progress 在 `value` 较小时,左边条不够圆的问题。[#17819](https://github.com/ant-design/ant-design/pull/17819)
- 🐞 修复 Statistic.Countdown `format` 不支持方括号保留字符串的问题。[#17841](https://github.com/ant-design/ant-design/pull/17841)
- 🐞 修复 Table 自定义 `filterDropdown` 在某些情况下消失时总是触发 `onChange` 的问题。[#17846](https://github.com/ant-design/ant-design/pull/17846)
- 🐞 修复 TimePicker 在 Safari 下的滚动条渲染问题。[#17857](https://github.com/ant-design/ant-design/pull/17857)
## 3.20.5
`2019-07-19`
- 🐞 修复 `<Button type="danger" ghost />` 样式问题。[#17743](https://github.com/ant-design/ant-design/pull/17743)
## 3.20.4
`2019-07-19`
- 🐞 修复多层级 Drawer 的 `mask` 为 false 时,卸载子级组件后父抽屉不收回的问题。[#17698](https://github.com/ant-design/ant-design/pull/17698)
- 🐞 修复 Table 圆角样式在 Firefox 下丢失的问题。[#17641](https://github.com/ant-design/ant-design/pull/17641)
- 🐞 修复 Menu 抛出 `Cannot update during an existing state transition` 警告的问题。[#17657](https://github.com/ant-design/ant-design/pull/17657)
- 🐞 修复 Affix 容器变化时尺寸不变的问题。[#17678](https://github.com/ant-design/ant-design/pull/17678)
- 🐞 修复 Anchor 监听元素不随着 `getContainer` 变化的问题。[#17677](https://github.com/ant-design/ant-design/pull/17677)
- 🐞 修复 Modal 和 Drawer 同时使用导致的窗体滚动条冲突的问题。[#17600](https://github.com/ant-design/ant-design/pull/17600)
- 🌟 Empty `description` 支持 `false`。 [#17659](https://github.com/ant-design/ant-design/pull/17659) [@billfeller](https://github.com/billfeller)
- 💄 去除 Pagination 元素下划线以防止被全局样式污染。[#17728](https://github.com/ant-design/ant-design/pull/17728)
- 💄 拓展 Card action 可点击区域。[#17705](https://github.com/ant-design/ant-design/pull/17705) [@lhx6538665](https://github.com/lhx6538665)
- 💄 对 Less 变量进行了一波调整,以适应更多细节风格定制。[#17697](https://github.com/ant-design/ant-design/pull/17697)
- 调整危险按钮样式。
<img width="103" class="markdown-inline-image" alt="image" src="https://user-images.githubusercontent.com/507615/61370809-e37aa480-a8c5-11e9-98b3-51ce06dfba24.png">
- 修复 `@border-radius-sm` 对 Slider、TreeSelect 不生效的问题。
- Progress、Tabs、Slider、Timeline 组件补充 less 变量。
- TypeScript
- 💄 完善 Form 的类型定义。[#17676](https://github.com/ant-design/ant-design/pull/17676) [@lixiaoyang1992](https://github.com/lixiaoyang1992)
- 💄 完善 Tabs 的类型定义。[#17675](https://github.com/ant-design/ant-design/pull/17675)
## 3.20.3
`2019-07-15`
@ -27,9 +85,15 @@ timeline: true
- 📖 文档中增加对组件新特性的版本说明。[#17373](https://github.com/ant-design/ant-design/pull/17373) [@muzea](https://github.com/muzea)
- 🐞 修复 Button 组件的 loading 样式问题。[#17596](https://github.com/ant-design/ant-design/pull/17596) [@LilyWakana](https://github.com/LilyWakana)
- Cascader - 🐞 修复 options 为空时不展示空内容的问题。[#17538](https://github.com/ant-design/ant-design/pull/17538) - 🐞 修复 option 的 isLeaf 为 true 时 loading 样式没有对齐的问题。[#17550](https://github.com/ant-design/ant-design/pull/17550) - 🐞 修复文本过长被箭头遮挡的问题。[#17583](https://github.com/ant-design/ant-design/pull/17583)
- Cascader
- 🐞 修复 options 为空时不展示空内容的问题。[#17538](https://github.com/ant-design/ant-design/pull/17538)
- 🐞 修复 option 的 isLeaf 为 true 时 loading 样式没有对齐的问题。[#17550](https://github.com/ant-design/ant-design/pull/17550)
- 🐞 修复文本过长被箭头遮挡的问题。[#17583](https://github.com/ant-design/ant-design/pull/17583)
- 🐞 修复 Input 组件存在多个后缀图标时的样式错乱问题。[#17508](https://github.com/ant-design/ant-design/pull/17508) [@LilyWakana](https://github.com/LilyWakana)
- TypeScript - 💄 完善 Cascader 的 `option` 类型定义。[#17581](https://github.com/ant-design/ant-design/pull/17581) [@MrHeer](https://github.com/MrHeer) - 🐞 修复 Descriptions 的 `title` 类型定义。[#17412](https://github.com/ant-design/ant-design/pull/17412) - 🐞 修复 Collapse 的 activeKey、defaultActiveKey 以及 Collapse.Panel 的 key 类型定义。[#17557](https://github.com/ant-design/ant-design/pull/17557) [@thylsky](https://github.com/thylsky)
- TypeScript
- 💄 完善 Cascader 的 `option` 类型定义。[#17581](https://github.com/ant-design/ant-design/pull/17581) [@MrHeer](https://github.com/MrHeer)
- 🐞 修复 Descriptions 的 `title` 类型定义。[#17559](https://github.com/ant-design/ant-design/pull/17559)
- 🐞 修复 Collapse 的 activeKey、defaultActiveKey 以及 Collapse.Panel 的 key 类型定义。[#17557](https://github.com/ant-design/ant-design/pull/17557) [@thylsky](https://github.com/thylsky)
## 3.20.1
@ -52,7 +116,7 @@ timeline: true
- 🔥 优化 PageHeader 的 `className` 定义。[#17321](https://github.com/ant-design/ant-design/pull/17321)
- 🔥 Progress.Circle 支持渐变色。[#17315](https://github.com/ant-design/ant-design/pull/17315) [@hengkx](https://github.com/hengkx)
<img class="markdown-inline-image" src="https://gw.alipayobjects.com/zos/antfincdn/WogwW6kA4O/method-draw-image.svg" alt="Progress">
<img class="markdown-inline-image" src="https://gw.alipayobjects.com/zos/antfincdn/WogwW6kA4O/method-draw-image.svg" alt="Progress">
- 🐞 Drawer 修复 `maskCloseble` 为 false键盘 ESC 关闭无效的问题。[#17316](https://github.com/ant-design/ant-design/pull/17316)
- 🐞 修复在 Edge 下 Drawer 关闭后没有调用 `afterVisibleChange` 的问题。[#17311](https://github.com/ant-design/ant-design/pull/17311)

View File

@ -124,6 +124,10 @@
font-size: @font-size-lg;
}
&-message {
color: @alert-message-color;
}
&-with-description &-description {
display: block;
}

View File

@ -26,12 +26,11 @@ title: Breadcrumb
### Breadcrumb.Item
| 参数 | 参数 | 类型 | 默认值 | 版本 |
| --------- | -------------- | -------------------------------------- | ------ | ------ |
| href | 链接的目的地 | string | - | 3.17.0 |
| separator | 自定义的分隔符 | string\|ReactNode | '/' | 3.17.0 |
| overlay | 下拉菜单的内容 | [Menu](/components/menu) \| () => Menu | - | 3.17.0 |
| onClick | 单击事件 | (e:MouseEvent)=>void | - | 3.17.0 |
| 参数 | 参数 | 类型 | 默认值 | 版本 |
| ------- | -------------- | -------------------------------------- | ------ | ------ |
| href | 链接的目的地 | string | - | 3.17.0 |
| overlay | 下拉菜单的内容 | [Menu](/components/menu) \| () => Menu | - | 3.17.0 |
| onClick | 单击事件 | (e:MouseEvent)=>void | - | 3.17.0 |
### routes

View File

@ -167,7 +167,7 @@
}
&-background-ghost&-danger {
.button-variant-ghost(@btn-danger-color);
.button-variant-ghost(@btn-danger-border);
}
&-background-ghost&-link {

View File

@ -451,4 +451,24 @@ describe('Cascader', () => {
);
errorSpy.mockRestore();
});
// https://github.com/ant-design/ant-design/issues/17690
it('should not breaks when children is null', () => {
const optionsWithChildrenNull = [
{
value: 'zhejiang',
label: 'Zhejiang',
children: [
{
value: 'hangzhou',
label: 'Hangzhou',
children: null,
},
],
},
];
expect(() => {
mount(<Cascader options={optionsWithChildrenNull} />);
}).not.toThrow();
});
});

View File

@ -206,8 +206,8 @@ function flattenTree(
const defaultDisplayRender = (label: string[]) => label.join(' / ');
function warningValueNotExist(list: CascaderOptionType[] = [], fieldNames: FieldNamesType = {}) {
list.forEach(item => {
function warningValueNotExist(list: CascaderOptionType[], fieldNames: FieldNamesType = {}) {
(list || []).forEach(item => {
const valueFieldName = fieldNames.value || 'value';
warning(valueFieldName in item, 'Cascader', 'Not found `value` in `options`.');
warningValueNotExist(item[fieldNames.children || 'children'], fieldNames);

View File

@ -150,7 +150,6 @@
}
}
.@{checkbox-prefix-cls}-wrapper + span,
.@{checkbox-prefix-cls} + span {
padding-right: 8px;
padding-left: 8px;

View File

@ -150,6 +150,9 @@ class RangePicker extends React.Component<any, RangePickerState> {
showDate: getShowDateFromValue(value) || showDate,
}));
}
if (value[0] && value[0].diff(value[1]) > 0) {
value[1] = undefined;
}
const [start, end] = value;
props.onChange(value, [formatDate(start, props.format), formatDate(end, props.format)]);
};

View File

@ -387,4 +387,17 @@ describe('RangePicker', () => {
).toBe(false);
});
});
// https://github.com/ant-design/ant-design/issues/17135
it('the end time should be less than the start time', () => {
const wrapper = mount(
<RangePicker defaultValue={[moment(), moment()]} />,
);
wrapper.find('.ant-calendar-picker-input').simulate('click');
const firstInput = wrapper.find('.ant-calendar-input').first();
const secondInput = wrapper.find('.ant-calendar-input').last();
firstInput.simulate('change', { target: { value: moment().add(1, 'day').format('YYYY-MM-DD')}});
expect(firstInput.getDOMNode().value).toBe(moment().add(1, 'day').format('YYYY-MM-DD'));
expect(secondInput.getDOMNode().value).toBe('');
});
});

View File

@ -55,7 +55,7 @@
}
&:hover &-input:not(.@{ant-prefix}-input-disabled) {
border-color: @primary-color;
border-color: @input-hover-border-color;
}
&:focus &-input:not(.@{ant-prefix}-input-disabled) {

View File

@ -61,6 +61,8 @@
}
.@{ant-prefix}-col {
// Prevent columns from collapsing when empty
min-height: 1px;
position: relative;
}

View File

@ -22,8 +22,6 @@
.col(@index, @list) when (@index > @grid-columns) {
@{list} {
position: relative;
// Prevent columns from collapsing when empty
min-height: 1px;
padding-right: (@grid-gutter-width / 2);
padding-left: (@grid-gutter-width / 2);
}

View File

@ -45,7 +45,6 @@ class Input extends React.Component<InputProps, any> {
static defaultProps = {
type: 'text',
disabled: false,
};
static propTypes = {

View File

@ -3,7 +3,6 @@
exports[`Input allowClear should change type when click 1`] = `
<Input
allowClear={true}
disabled={false}
type="text"
>
<span
@ -11,7 +10,6 @@ exports[`Input allowClear should change type when click 1`] = `
>
<input
className="ant-input"
disabled={false}
onChange={[Function]}
onKeyDown={[Function]}
style={null}
@ -70,7 +68,6 @@ exports[`Input allowClear should change type when click 1`] = `
exports[`Input allowClear should change type when click 2`] = `
<Input
allowClear={true}
disabled={false}
type="text"
>
<span
@ -78,7 +75,6 @@ exports[`Input allowClear should change type when click 2`] = `
>
<input
className="ant-input"
disabled={false}
onChange={[Function]}
onKeyDown={[Function]}
style={null}
@ -96,7 +92,6 @@ exports[`Input allowClear should not show icon if defaultValue is undefined, nul
<Input
allowClear={true}
defaultValue={null}
disabled={false}
type="text"
>
<span
@ -104,7 +99,6 @@ exports[`Input allowClear should not show icon if defaultValue is undefined, nul
>
<input
className="ant-input"
disabled={false}
onChange={[Function]}
onKeyDown={[Function]}
style={null}
@ -121,7 +115,6 @@ exports[`Input allowClear should not show icon if defaultValue is undefined, nul
exports[`Input allowClear should not show icon if defaultValue is undefined, null or empty string 2`] = `
<Input
allowClear={true}
disabled={false}
type="text"
>
<span
@ -129,7 +122,6 @@ exports[`Input allowClear should not show icon if defaultValue is undefined, nul
>
<input
className="ant-input"
disabled={false}
onChange={[Function]}
onKeyDown={[Function]}
style={null}
@ -147,7 +139,6 @@ exports[`Input allowClear should not show icon if defaultValue is undefined, nul
<Input
allowClear={true}
defaultValue=""
disabled={false}
type="text"
>
<span
@ -155,7 +146,6 @@ exports[`Input allowClear should not show icon if defaultValue is undefined, nul
>
<input
className="ant-input"
disabled={false}
onChange={[Function]}
onKeyDown={[Function]}
style={null}
@ -172,7 +162,6 @@ exports[`Input allowClear should not show icon if defaultValue is undefined, nul
exports[`Input allowClear should not show icon if value is undefined, null or empty string 1`] = `
<Input
allowClear={true}
disabled={false}
type="text"
value={null}
>
@ -181,7 +170,6 @@ exports[`Input allowClear should not show icon if value is undefined, null or em
>
<input
className="ant-input"
disabled={false}
onChange={[Function]}
onKeyDown={[Function]}
style={null}
@ -198,7 +186,6 @@ exports[`Input allowClear should not show icon if value is undefined, null or em
exports[`Input allowClear should not show icon if value is undefined, null or empty string 2`] = `
<Input
allowClear={true}
disabled={false}
type="text"
>
<span
@ -206,7 +193,6 @@ exports[`Input allowClear should not show icon if value is undefined, null or em
>
<input
className="ant-input"
disabled={false}
onChange={[Function]}
onKeyDown={[Function]}
style={null}
@ -223,7 +209,6 @@ exports[`Input allowClear should not show icon if value is undefined, null or em
exports[`Input allowClear should not show icon if value is undefined, null or empty string 3`] = `
<Input
allowClear={true}
disabled={false}
type="text"
value=""
>
@ -232,7 +217,6 @@ exports[`Input allowClear should not show icon if value is undefined, null or em
>
<input
className="ant-input"
disabled={false}
onChange={[Function]}
onKeyDown={[Function]}
style={null}
@ -248,13 +232,11 @@ exports[`Input allowClear should not show icon if value is undefined, null or em
exports[`Input should support maxLength 1`] = `
<Input
disabled={false}
maxLength={3}
type="text"
>
<input
className="ant-input"
disabled={false}
maxLength={3}
onChange={[Function]}
onKeyDown={[Function]}
@ -274,7 +256,6 @@ exports[`Input.Password should change type when click 1`] = `
<Input
action="click"
className="ant-input-password"
disabled={false}
prefixCls="ant-input"
suffix={
<Icon
@ -292,7 +273,6 @@ exports[`Input.Password should change type when click 1`] = `
<input
action="click"
className="ant-input"
disabled={false}
onChange={[Function]}
onKeyDown={[Function]}
style={null}
@ -363,7 +343,6 @@ exports[`Input.Password should change type when click 2`] = `
<Input
action="click"
className="ant-input-password"
disabled={false}
prefixCls="ant-input"
suffix={
<Icon
@ -381,7 +360,6 @@ exports[`Input.Password should change type when click 2`] = `
<input
action="click"
className="ant-input"
disabled={false}
onChange={[Function]}
onKeyDown={[Function]}
style={null}
@ -448,7 +426,6 @@ exports[`Input.Password should change type when click 3`] = `
<Input
action="click"
className="ant-input-password"
disabled={false}
prefixCls="ant-input"
suffix={
<Icon
@ -466,7 +443,6 @@ exports[`Input.Password should change type when click 3`] = `
<input
action="click"
className="ant-input"
disabled={false}
onChange={[Function]}
onKeyDown={[Function]}
style={null}
@ -534,7 +510,6 @@ exports[`Input.Search should support suffix 1`] = `
>
<Input
className="ant-input-search"
disabled={false}
onPressEnter={[Function]}
prefixCls="ant-input"
suffix={
@ -554,7 +529,6 @@ exports[`Input.Search should support suffix 1`] = `
>
<input
className="ant-input"
disabled={false}
onChange={[Function]}
onKeyDown={[Function]}
style={null}

View File

@ -9,12 +9,14 @@
padding: @input-padding-vertical-lg @input-padding-horizontal-lg;
font-size: @font-size-lg;
line-height: @input-height-lg;
line-height: ~'@{line-height-base} \9'; // https://github.com/ant-design/ant-design/issues/17753
}
.input-sm() {
height: @input-height-sm;
padding: @input-padding-vertical-sm @input-padding-horizontal-sm;
line-height: @input-height-sm;
line-height: ~'@{line-height-base} \9'; // https://github.com/ant-design/ant-design/issues/17753
}
// input status
@ -28,7 +30,7 @@
// == when hoverd
.hover(@color: @input-hover-border-color) {
border-color: ~`colorPalette('@{color}', 5) `;
border-color: @color;
border-right-width: @border-width-base !important;
}
@ -52,6 +54,7 @@
color: @input-color;
font-size: @font-size-base;
line-height: @input-height-base;
line-height: ~'@{line-height-base} \9'; // https://github.com/ant-design/ant-design/issues/17753
background-color: @input-bg;
background-image: none;
border: @border-width-base @border-style-base @input-border-color;

View File

@ -175812,9 +175812,9 @@ exports[`Locale Provider should display the text as pt-br 1`] = `
<div
class="ant-select-selection-selected-value"
style="display: block; opacity: 1;"
title="10 / páginas"
title="10 / página"
>
10 / páginas
10 / página
</div>
</div>
<span

View File

@ -0,0 +1,14 @@
import createContext from '@ant-design/create-react-context';
export type MenuTheme = 'light' | 'dark';
export interface MenuContextProps {
inlineCollapsed: boolean;
antdMenuTheme?: MenuTheme;
}
const MenuContext = createContext<MenuContextProps>({
inlineCollapsed: false,
});
export default MenuContext;

View File

@ -1,7 +1,7 @@
import * as React from 'react';
import { Item } from 'rc-menu';
import { ClickParam } from '.';
import { MenuContext, MenuContextProps } from './';
import MenuContext, { MenuContextProps } from './MenuContext';
import Tooltip, { TooltipProps } from '../tooltip';
import { SiderContext, SiderContextProps } from '../layout/Sider';

View File

@ -3,7 +3,7 @@ import * as PropTypes from 'prop-types';
import { SubMenu as RcSubMenu } from 'rc-menu';
import classNames from 'classnames';
import { MenuContext, MenuContextProps } from './index';
import MenuContext, { MenuContextProps } from './MenuContext';
interface TitleEventEntity {
key: string;

View File

@ -1,6 +1,5 @@
import * as React from 'react';
import RcMenu, { Divider, ItemGroup } from 'rc-menu';
import createContext from '@ant-design/create-react-context';
import classNames from 'classnames';
import omit from 'omit.js';
import SubMenu from './SubMenu';
@ -11,6 +10,7 @@ import warning from '../_util/warning';
import { polyfill } from 'react-lifecycles-compat';
import { SiderContext, SiderContextProps } from '../layout/Sider';
import raf from '../_util/raf';
import MenuContext, { MenuTheme } from './MenuContext';
export interface SelectParam {
key: string;
@ -29,8 +29,6 @@ export interface ClickParam {
export type MenuMode = 'vertical' | 'vertical-left' | 'vertical-right' | 'horizontal' | 'inline';
export type MenuTheme = 'light' | 'dark';
export interface MenuProps {
id?: string;
theme?: MenuTheme;
@ -74,15 +72,6 @@ export interface MenuState {
mounted: boolean;
}
export interface MenuContextProps {
inlineCollapsed: boolean;
antdMenuTheme?: MenuTheme;
}
export const MenuContext = createContext<MenuContextProps>({
inlineCollapsed: false,
});
class InternalMenu extends React.Component<InternalMenuProps, MenuState> {
static defaultProps: Partial<MenuProps> = {
className: '',

View File

@ -37,6 +37,7 @@
vertical-align: middle;
background-color: @progress-remaining-color;
border-radius: @progress-radius;
overflow: hidden;
}
&-circle-trail {

View File

@ -26,7 +26,6 @@ function getCheckedValue(children: React.ReactNode) {
class RadioGroup extends React.Component<RadioGroupProps, RadioGroupState> {
static defaultProps = {
disabled: false,
buttonStyle: 'outline' as RadioGroupButtonStyle,
};

View File

@ -231,16 +231,18 @@ span.@{radio-prefix-cls} + * {
pointer-events: none;
}
&-checked {
&-checked:not(&-disabled) {
z-index: 1;
color: @radio-dot-color;
background: @radio-button-checked-bg;
border-color: @radio-dot-color;
box-shadow: -1px 0 0 0 @radio-dot-color;
&::before {
background-color: @radio-dot-color !important;
opacity: 0.1;
}
&:first-child {
border-color: @radio-dot-color;
box-shadow: none !important;

View File

@ -1133,7 +1133,11 @@ exports[`renders ./components/rate/demo/clear.md correctly 1`] = `
</div>
</li>
</ul>
allowClear: true
<span
class="ant-rate-text"
>
allowClear: true
</span>
<br />
<ul
class="ant-rate"
@ -1431,7 +1435,11 @@ exports[`renders ./components/rate/demo/clear.md correctly 1`] = `
</div>
</li>
</ul>
allowClear: false
<span
class="ant-rate-text"
>
allowClear: false
</span>
</div>
`;

View File

@ -18,9 +18,11 @@ import { Rate } from 'antd';
ReactDOM.render(
<div>
<Rate defaultValue={3} /> allowClear: true
<Rate defaultValue={3} />
<span className="ant-rate-text">allowClear: true</span>
<br />
<Rate allowClear={false} defaultValue={3} /> allowClear: false
<Rate allowClear={false} defaultValue={3} />
<span className="ant-rate-text">allowClear: false</span>
</div>,
mountNode,
);

View File

@ -26,12 +26,15 @@
position: relative;
display: inline-block;
margin: 0;
margin-right: 8px;
padding: 0;
color: inherit;
cursor: pointer;
transition: all 0.3s;
&:not(:last-child) {
margin-right: 8px;
}
> div {
&:focus {
outline: 0;

View File

@ -57,6 +57,9 @@
text-align: center;
> * {
margin-right: 8px;
&:last-child {
margin-right: 0;
}
}
}

View File

@ -59,6 +59,7 @@ title: Select
| onChange | 选中 option或 input 的 value 变化combobox 模式下)时,调用此函数 | function(value, option:Option/Array&lt;Option>) | - | |
| onDeselect | 取消选中时调用,参数为选中项的 value (或 key) 值,仅在 multiple 或 tags 模式下生效 | function(string\|number\|LabeledValue) | - | |
| onFocus | 获得焦点时回调 | function | - | |
| onInputKeyDown | 按键按下时回调 | function | - | 3.1.0 |
| onMouseEnter | 鼠标移入时回调 | function | - | |
| onMouseLeave | 鼠标移出时回调 | function | - | |
| onPopupScroll | 下拉列表滚动时的回调 | function | - | |

View File

@ -3,6 +3,7 @@ import MockDate from 'mockdate';
import moment from 'moment';
import { mount } from 'enzyme';
import Statistic from '..';
import { formatTimeStr } from '../utils';
const delay = timeout => new Promise(resolve => setTimeout(resolve, timeout));
@ -104,4 +105,10 @@ describe('Statistic', () => {
});
});
});
describe('utils', () => {
it('format should support escape', () => {
expect(formatTimeStr(1000 * 60 * 60 * 24, 'D [Day]')).toBe('1 Day');
});
});
});

View File

@ -35,10 +35,14 @@ const timeUnits: [string, number][] = [
['S', 1], // million seconds
];
function formatTimeStr(duration: number, format: string) {
export function formatTimeStr(duration: number, format: string) {
let leftDuration: number = duration;
return timeUnits.reduce((current, [name, unit]) => {
const escapeRegex = /\[[^\]]*\]/g;
const keepList: string[] = (format.match(escapeRegex) || []).map(str => str.slice(1, -1));
const templateText = format.replace(escapeRegex, '[]');
const replacedText = timeUnits.reduce((current, [name, unit]) => {
if (current.indexOf(name) !== -1) {
const value = Math.floor(leftDuration / unit);
leftDuration -= value * unit;
@ -48,7 +52,14 @@ function formatTimeStr(duration: number, format: string) {
});
}
return current;
}, format);
}, templateText);
let index = 0;
return replacedText.replace(escapeRegex, () => {
const match = keepList[index];
index += 1;
return match;
});
}
export function formatCountdown(value: countdownValueType, config: CountdownFormatConfig) {

View File

@ -15,4 +15,8 @@
&::-webkit-input-placeholder {
color: @color;
}
&:placeholder-shown {
text-overflow: ellipsis;
}
}

View File

@ -316,7 +316,7 @@
@input-bg: @component-background;
@input-number-handler-active-bg: #f4f4f4;
@input-addon-bg: @background-color-light;
@input-hover-border-color: @primary-color;
@input-hover-border-color: @primary-5;
@input-disabled-bg: @disabled-bg;
@input-outline-offset: 0 0;

View File

@ -621,6 +621,39 @@ describe('Table.filter', () => {
expect(wrapper.find('.ant-input').instance().value).toBe('');
});
// https://github.com/ant-design/ant-design/issues/17833
it('should not trigger onChange when bluring custom filterDropdown', () => {
const onChange = jest.fn();
const wrapper = mount(
createTable({
onChange,
columns: [
{
title: 'Name',
dataIndex: 'name',
key: 'name',
filterDropdown: ({ setSelectedKeys }) => (
<input onChange={e => setSelectedKeys([e.target.value])} />
),
},
],
}),
);
wrapper
.find('.ant-dropdown-trigger')
.first()
.simulate('click');
wrapper
.find('input')
.first()
.simulate('change', { target: { value: 'whatevervalue' } });
wrapper
.find('.ant-dropdown-trigger')
.first()
.simulate('click');
expect(onChange).not.toHaveBeenCalled();
});
// https://github.com/ant-design/ant-design/issues/17089
it('not crash when dynamic change filter', () => {
const onChange = jest.fn();

View File

@ -25,7 +25,12 @@ const ResizeableTitle = props => {
}
return (
<Resizable width={width} height={0} onResize={onResize}>
<Resizable
width={width}
height={0}
onResize={onResize}
draggableOpts={{ enableUserSelectHack: false }}
>
<th {...restProps} />
</Resizable>
);

View File

@ -132,18 +132,21 @@ class FilterMenu<T> extends React.Component<FilterMenuProps<T>, FilterMenuState<
onVisibleChange = (visible: boolean) => {
this.setVisible(visible);
if (!visible) {
const { column } = this.props;
// https://github.com/ant-design/ant-design/issues/17833
if (!visible && !(column.filterDropdown instanceof Function)) {
this.confirmFilter();
}
};
confirmFilter() {
const { column, selectedKeys: propSelectedKeys, confirmFilter } = this.props;
const { selectedKeys, valueKeys } = this.state;
const { filterDropdown } = this.props.column;
const { filterDropdown } = column;
if (!shallowequal(selectedKeys, this.props.selectedKeys)) {
this.props.confirmFilter(
this.props.column,
if (!shallowequal(selectedKeys, propSelectedKeys)) {
confirmFilter(
column,
filterDropdown
? selectedKeys
: selectedKeys.map(key => valueKeys[key]).filter(key => key !== undefined),

View File

@ -473,6 +473,10 @@
overflow: hidden;
}
.@{ant-prefix}-checkbox-wrapper + span {
padding-left: 8px;
}
> .@{ant-prefix}-dropdown-menu > .@{ant-prefix}-dropdown-menu-item:last-child,
> .@{ant-prefix}-dropdown-menu
> .@{ant-prefix}-dropdown-menu-submenu:last-child

View File

@ -73,6 +73,8 @@
> .@{table-prefix-cls}-thead > tr > th,
> .@{table-prefix-cls}-tbody > tr > td {
padding: @table-padding-vertical-sm @table-padding-horizontal-sm;
}
> .@{table-prefix-cls}-thead > tr > th {
background-color: transparent;
}
> .@{table-prefix-cls}-thead > tr {

View File

@ -66,7 +66,6 @@ class TimePicker extends React.Component<TimePickerProps, any> {
align: {
offset: [0, -2],
},
disabled: false,
disabledHours: undefined,
disabledMinutes: undefined,
disabledSeconds: undefined,

View File

@ -79,7 +79,9 @@
}
ul {
width: 100%;
// use fixed width instead of 100%
// to fix strange render bug in safari: https://github.com/ant-design/ant-design/issues/17842
width: @time-picker-panel-column-width;
margin: 0;
padding: 0 0 @timepicker-item-height * 5;
list-style: none;

View File

@ -37,7 +37,7 @@ export default class ListItem extends React.Component<any, any> {
onClick={disabled || item.disabled ? undefined : () => onClick(item)}
>
<Checkbox checked={checked} disabled={disabled || item.disabled} />
<span>{renderedEl}</span>
<span className={`${prefixCls}-content-item-text`}>{renderedEl}</span>
</li>
);
let children: JSX.Element | null = null;

View File

@ -62,7 +62,9 @@ exports[`Transfer should render correctly 1`] = `
/>
</span>
</label>
<span />
<span
class="ant-transfer-list-content-item-text"
/>
</li>
<li
class="ant-transfer-list-content-item ant-transfer-list-content-item-disabled"
@ -83,7 +85,9 @@ exports[`Transfer should render correctly 1`] = `
/>
</span>
</label>
<span />
<span
class="ant-transfer-list-content-item-text"
/>
</li>
</ul>
</div>
@ -197,7 +201,9 @@ exports[`Transfer should render correctly 1`] = `
/>
</span>
</label>
<span />
<span
class="ant-transfer-list-content-item-text"
/>
</li>
</ul>
</div>
@ -266,7 +272,9 @@ exports[`Transfer should show sorted targetkey 1`] = `
/>
</span>
</label>
<span>
<span
class="ant-transfer-list-content-item-text"
>
a
</span>
</li>
@ -384,7 +392,9 @@ exports[`Transfer should show sorted targetkey 1`] = `
/>
</span>
</label>
<span>
<span
class="ant-transfer-list-content-item-text"
>
c
</span>
</li>
@ -407,7 +417,9 @@ exports[`Transfer should show sorted targetkey 1`] = `
/>
</span>
</label>
<span>
<span
class="ant-transfer-list-content-item-text"
>
b
</span>
</li>

View File

@ -60,7 +60,9 @@ exports[`Transfer.List should render correctly 1`] = `
/>
</span>
</label>
<span />
<span
class="ant-transfer-list-content-item-text"
/>
</li>
<li
class="ant-transfer-list-content-item"
@ -81,7 +83,9 @@ exports[`Transfer.List should render correctly 1`] = `
/>
</span>
</label>
<span />
<span
class="ant-transfer-list-content-item-text"
/>
</li>
<li
class="ant-transfer-list-content-item ant-transfer-list-content-item-disabled"
@ -103,7 +107,9 @@ exports[`Transfer.List should render correctly 1`] = `
/>
</span>
</label>
<span />
<span
class="ant-transfer-list-content-item-text"
/>
</li>
</ul>
</div>

View File

@ -7,7 +7,6 @@ exports[`Transfer.Search should show cross icon when input value exists 1`] = `
>
<div>
<Input
disabled={false}
onChange={[Function]}
placeholder=""
type="text"
@ -15,7 +14,6 @@ exports[`Transfer.Search should show cross icon when input value exists 1`] = `
>
<input
className="ant-input"
disabled={false}
onChange={[Function]}
onKeyDown={[Function]}
placeholder=""
@ -72,7 +70,6 @@ exports[`Transfer.Search should show cross icon when input value exists 2`] = `
>
<div>
<Input
disabled={false}
onChange={[Function]}
placeholder=""
type="text"
@ -80,7 +77,6 @@ exports[`Transfer.Search should show cross icon when input value exists 2`] = `
>
<input
className="ant-input"
disabled={false}
onChange={[Function]}
onKeyDown={[Function]}
placeholder=""

View File

@ -1,4 +1,5 @@
import * as React from 'react';
import { findDOMNode } from 'react-dom';
import Animate from 'rc-animate';
import raf from '../_util/raf';
import { Omit, tuple } from '../_util/type';
@ -22,6 +23,7 @@ class ListBody extends React.Component<TransferListBodyProps> {
};
private mountId: number;
private lazyId: number;
componentDidMount() {
this.mountId = raf(() => {
@ -29,8 +31,27 @@ class ListBody extends React.Component<TransferListBodyProps> {
});
}
componentDidUpdate(prevProps: TransferListBodyProps) {
if (
prevProps.filteredRenderItems.length !== this.props.filteredRenderItems.length &&
this.props.lazy !== false
) {
// TODO: Replace this with ref when react 15 support removed.
const container = findDOMNode(this);
raf.cancel(this.lazyId);
this.lazyId = raf(() => {
if (container) {
const scrollEvent = new Event('scroll', { bubbles: true });
container.dispatchEvent(scrollEvent);
}
});
}
}
componentWillUnmount() {
raf.cancel(this.mountId);
raf.cancel(this.lazyId);
}
onItemSelect = (item: TransferItem) => {

View File

@ -76,6 +76,10 @@
position: absolute;
right: 12px;
}
.@{ant-prefix}-checkbox-wrapper + span {
padding-left: 8px;
}
}
&-body {
@ -116,6 +120,9 @@
> span {
padding-right: 0;
}
&-text {
padding-left: 8px;
}
}
&-item:not(&-item-disabled):hover {

View File

@ -332,12 +332,13 @@ class Upload extends React.Component<UploadProps, UploadState> {
if (listType === 'picture-card') {
return (
<span className={className}>
<span className={classNames(className, `${prefixCls}-picture-card-wrapper`)}>
{uploadList}
{uploadButton}
</span>
);
}
return (
<span className={className}>
{uploadButton}

View File

@ -89,7 +89,11 @@ export default class UploadList extends React.Component<UploadListProps, any> {
);
} else {
const thumbnail = isImageUrl(file) ? (
<img src={file.thumbUrl || file.url} alt={file.name} />
<img
src={file.thumbUrl || file.url}
alt={file.name}
className={`${prefixCls}-list-item-image`}
/>
) : (
<Icon type="file" className={`${prefixCls}-list-item-icon`} theme="twoTone" />
);

View File

@ -2,7 +2,7 @@
exports[`renders ./components/upload/demo/avatar.md correctly 1`] = `
<span
class="avatar-uploader"
class="avatar-uploader ant-upload-picture-card-wrapper"
>
<div
class="ant-upload ant-upload-select ant-upload-select-picture-card"
@ -318,7 +318,7 @@ exports[`renders ./components/upload/demo/picture-card.md correctly 1`] = `
class="clearfix"
>
<span
class=""
class="ant-upload-picture-card-wrapper"
>
<div
class="ant-upload-list ant-upload-list-picture-card"
@ -337,7 +337,8 @@ exports[`renders ./components/upload/demo/picture-card.md correctly 1`] = `
target="_blank"
>
<img
alt="xxx.png"
alt="image.png"
class="ant-upload-list-item-image"
src="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
/>
</a>
@ -346,9 +347,337 @@ exports[`renders ./components/upload/demo/picture-card.md correctly 1`] = `
href="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
rel="noopener noreferrer"
target="_blank"
title="xxx.png"
title="image.png"
>
xxx.png
image.png
</a>
</span>
</div>
<span
class="ant-upload-list-item-actions"
>
<a
href="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
rel="noopener noreferrer"
target="_blank"
title="Preview file"
>
<i
aria-label="icon: eye-o"
class="anticon anticon-eye-o"
>
<svg
aria-hidden="true"
class=""
data-icon="eye"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 0 0 0 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"
/>
</svg>
</i>
</a>
<i
aria-label="icon: delete"
class="anticon anticon-delete"
tabindex="-1"
title="Remove file"
>
<svg
aria-hidden="true"
class=""
data-icon="delete"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"
/>
</svg>
</i>
</span>
</div>
<div
class="ant-upload-list-item ant-upload-list-item-done"
>
<div
class="ant-upload-list-item-info"
>
<span>
<a
class="ant-upload-list-item-thumbnail"
href="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
rel="noopener noreferrer"
target="_blank"
>
<img
alt="image.png"
class="ant-upload-list-item-image"
src="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
/>
</a>
<a
class="ant-upload-list-item-name"
href="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
rel="noopener noreferrer"
target="_blank"
title="image.png"
>
image.png
</a>
</span>
</div>
<span
class="ant-upload-list-item-actions"
>
<a
href="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
rel="noopener noreferrer"
target="_blank"
title="Preview file"
>
<i
aria-label="icon: eye-o"
class="anticon anticon-eye-o"
>
<svg
aria-hidden="true"
class=""
data-icon="eye"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 0 0 0 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"
/>
</svg>
</i>
</a>
<i
aria-label="icon: delete"
class="anticon anticon-delete"
tabindex="-1"
title="Remove file"
>
<svg
aria-hidden="true"
class=""
data-icon="delete"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"
/>
</svg>
</i>
</span>
</div>
<div
class="ant-upload-list-item ant-upload-list-item-done"
>
<div
class="ant-upload-list-item-info"
>
<span>
<a
class="ant-upload-list-item-thumbnail"
href="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
rel="noopener noreferrer"
target="_blank"
>
<img
alt="image.png"
class="ant-upload-list-item-image"
src="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
/>
</a>
<a
class="ant-upload-list-item-name"
href="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
rel="noopener noreferrer"
target="_blank"
title="image.png"
>
image.png
</a>
</span>
</div>
<span
class="ant-upload-list-item-actions"
>
<a
href="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
rel="noopener noreferrer"
target="_blank"
title="Preview file"
>
<i
aria-label="icon: eye-o"
class="anticon anticon-eye-o"
>
<svg
aria-hidden="true"
class=""
data-icon="eye"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 0 0 0 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"
/>
</svg>
</i>
</a>
<i
aria-label="icon: delete"
class="anticon anticon-delete"
tabindex="-1"
title="Remove file"
>
<svg
aria-hidden="true"
class=""
data-icon="delete"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"
/>
</svg>
</i>
</span>
</div>
<div
class="ant-upload-list-item ant-upload-list-item-done"
>
<div
class="ant-upload-list-item-info"
>
<span>
<a
class="ant-upload-list-item-thumbnail"
href="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
rel="noopener noreferrer"
target="_blank"
>
<img
alt="image.png"
class="ant-upload-list-item-image"
src="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
/>
</a>
<a
class="ant-upload-list-item-name"
href="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
rel="noopener noreferrer"
target="_blank"
title="image.png"
>
image.png
</a>
</span>
</div>
<span
class="ant-upload-list-item-actions"
>
<a
href="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
rel="noopener noreferrer"
target="_blank"
title="Preview file"
>
<i
aria-label="icon: eye-o"
class="anticon anticon-eye-o"
>
<svg
aria-hidden="true"
class=""
data-icon="eye"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 0 0 0 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"
/>
</svg>
</i>
</a>
<i
aria-label="icon: delete"
class="anticon anticon-delete"
tabindex="-1"
title="Remove file"
>
<svg
aria-hidden="true"
class=""
data-icon="delete"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"
/>
</svg>
</i>
</span>
</div>
<div
class="ant-upload-list-item ant-upload-list-item-done"
>
<div
class="ant-upload-list-item-info"
>
<span>
<a
class="ant-upload-list-item-thumbnail"
href="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
rel="noopener noreferrer"
target="_blank"
>
<img
alt="image.png"
class="ant-upload-list-item-image"
src="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
/>
</a>
<a
class="ant-upload-list-item-name"
href="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
rel="noopener noreferrer"
target="_blank"
title="image.png"
>
image.png
</a>
</span>
</div>
@ -438,6 +767,7 @@ exports[`renders ./components/upload/demo/picture-style.md correctly 1`] = `
>
<img
alt="xxx.png"
class="ant-upload-list-item-image"
src="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
/>
</a>
@ -489,6 +819,7 @@ exports[`renders ./components/upload/demo/picture-style.md correctly 1`] = `
>
<img
alt="yyy.png"
class="ant-upload-list-item-image"
src="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
/>
</a>
@ -553,6 +884,7 @@ exports[`renders ./components/upload/demo/picture-style.md correctly 1`] = `
>
<img
alt="xxx.png"
class="ant-upload-list-item-image"
src="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
/>
</a>
@ -604,6 +936,7 @@ exports[`renders ./components/upload/demo/picture-style.md correctly 1`] = `
>
<img
alt="yyy.png"
class="ant-upload-list-item-image"
src="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
/>
</a>

View File

@ -440,6 +440,7 @@ exports[`Upload List should non-image format file preview 1`] = `
>
<img
alt="image"
class="ant-upload-list-item-image"
src="https://cdn.xxx.com/aaa"
/>
</a>
@ -633,6 +634,7 @@ exports[`Upload List should non-image format file preview 1`] = `
>
<img
alt="image"
class="ant-upload-list-item-image"
src="https://cdn.xxx.com/xx.xx/aaa.png"
/>
</a>
@ -684,6 +686,7 @@ exports[`Upload List should non-image format file preview 1`] = `
>
<img
alt="image"
class="ant-upload-list-item-image"
src="data:image/png;base64,UEsDBAoAAAAAADYZYkwAAAAAAAAAAAAAAAAdAAk"
/>
</a>
@ -735,6 +738,7 @@ exports[`Upload List should non-image format file preview 1`] = `
>
<img
alt="image"
class="ant-upload-list-item-image"
src="https://cdn.xxx.com/xx.xx/aaa.png?query=123"
/>
</a>
@ -786,6 +790,7 @@ exports[`Upload List should non-image format file preview 1`] = `
>
<img
alt="image"
class="ant-upload-list-item-image"
src="https://cdn.xxx.com/xx.xx/aaa.png#anchor"
/>
</a>
@ -837,6 +842,7 @@ exports[`Upload List should non-image format file preview 1`] = `
>
<img
alt="image"
class="ant-upload-list-item-image"
src="https://cdn.xxx.com/xx.xx/aaa.png?query=some.query.with.dot"
/>
</a>
@ -888,6 +894,7 @@ exports[`Upload List should non-image format file preview 1`] = `
>
<img
alt="image"
class="ant-upload-list-item-image"
src="https://publish-pic-cpu.baidu.com/1296beb3-50d9-4276-885f-52645cbb378e.jpeg@w_228%2ch_152"
/>
</a>

View File

@ -27,15 +27,15 @@ function getBase64(img, callback) {
}
function beforeUpload(file) {
const isJPG = file.type === 'image/jpeg';
if (!isJPG) {
message.error('You can only upload JPG file!');
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
if (!isJpgOrPng) {
message.error('You can only upload JPG/PNG file!');
}
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isLt2M) {
message.error('Image must smaller than 2MB!');
}
return isJPG && isLt2M;
return isJpgOrPng && isLt2M;
}
class Avatar extends React.Component {
@ -77,7 +77,7 @@ class Avatar extends React.Component {
beforeUpload={beforeUpload}
onChange={this.handleChange}
>
{imageUrl ? <img src={imageUrl} alt="avatar" /> : uploadButton}
{imageUrl ? <img src={imageUrl} alt="avatar" style={{ width: '100%' }} /> : uploadButton}
</Upload>
);
}

View File

@ -32,7 +32,31 @@ class PicturesWall extends React.Component {
fileList: [
{
uid: '-1',
name: 'xxx.png',
name: 'image.png',
status: 'done',
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
},
{
uid: '-2',
name: 'image.png',
status: 'done',
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
},
{
uid: '-3',
name: 'image.png',
status: 'done',
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
},
{
uid: '-4',
name: 'image.png',
status: 'done',
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
},
{
uid: '-5',
name: 'image.png',
status: 'done',
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
},
@ -71,7 +95,7 @@ class PicturesWall extends React.Component {
onPreview={this.handlePreview}
onChange={this.handleChange}
>
{fileList.length >= 3 ? null : uploadButton}
{fileList.length >= 8 ? null : uploadButton}
</Upload>
<Modal visible={previewVisible} footer={null} onCancel={this.handleCancel}>
<img alt="example" style={{ width: '100%' }} src={previewImage} />

View File

@ -35,6 +35,7 @@
&&-select-picture-card {
display: table;
float: left;
width: @upload-picture-card-size;
height: @upload-picture-card-size;
margin-right: 8px;
@ -127,6 +128,12 @@
color: @text-color-secondary;
}
}
&-picture-card-wrapper {
.clearfix;
display: inline-block;
}
}
.@{upload-prefix-cls}-list {
@ -257,6 +264,10 @@
transform: translate(-50%, -50%);
}
.@{upload-item}-image {
max-width: 100%;
}
.@{upload-item}-thumbnail img {
display: block;
width: 48px;
@ -299,9 +310,6 @@
}
&-picture-card {
// https://github.com/ant-design/ant-design/issues/11183
float: left;
&.@{upload-prefix-cls}-list::after {
display: none;
}

View File

@ -129,6 +129,13 @@ You must import styles as less format. A common mistake would be importing multi
- If you import styles by specifying the `style` option of [babel-plugin-import](https://github.com/ant-design/babel-plugin-import), change it from `'css'` to `true`, which will import the `less` version of antd.
- If you import styles from `'antd/dist/antd.css'`, change it to `antd/dist/antd.less`.
## Offcial Themes 🌈
We have some offcial themes, try on and give us feedback!
- [Dark Theme (Beta)](https://github.com/ant-design/ant-design-dark-theme)
- [Aliyun Console Theme (Beta)](https://github.com/ant-design/ant-design-aliyun-theme)
## Related Articles
- [Using Ant Design in Sass-Styled Webpack Projects with `antd-scss-theme-plugin`](https://intoli.com/blog/antd-scss-theme-plugin/)

View File

@ -107,6 +107,13 @@ module.exports = {
- 如果你在使用 [babel-plugin-import](https://github.com/ant-design/babel-plugin-import) 的 `style` 配置来引入样式,需要将配置值从 `'css'` 改为 `true`,这样会引入 less 文件。
- 如果你是通过 `'antd/dist/antd.css'` 引入样式的,改为 `antd/dist/antd.less`
## 官方主题 🌈
我们提供了一些官方主题,欢迎在项目中试用,并且给我们提供反馈。
- [黑色主题Beta](https://github.com/ant-design/ant-design-dark-theme)
- [阿里云控制台主题Beta](https://github.com/ant-design/ant-design-aliyun-theme)
## 社区教程
- [Using Ant Design in Sass-Styled Webpack Projects with `antd-scss-theme-plugin`](https://intoli.com/blog/antd-scss-theme-plugin/)

View File

@ -3,31 +3,31 @@ order: 9
title: FAQ
---
Here are the frequently asked questions about Ant Design and antd that you should look up before you ask in community or create new issue. We also maintain a [FAQ issues label](http://u.ant.design/faq) for common github issues.
Here are the frequently asked questions about Ant Design and antd that you should look up before you ask in the community or create new a issue. We also maintain a [FAQ issues label](http://u.ant.design/faq) for common github issues.
---
### Are you going to provide Sass/Stylus(etc...) style file?
### Are you going to provide Sass/Stylus(etc.) style file?
No, actually, you can convert Less to Sass/Stylus(etc...) with tools (which you can Google).
No, but you can convert Less to Sass/Stylus(etc.) with tools that you can find on Google.
### `Select Dropdown DatePicker TimePicker Popover Popconfirm` disappear when I click another popup component inside it, How to resolve it?
### `Select Dropdown DatePicker TimePicker Popover Popconfirm` disappears when I click another popup component inside it. How do I resolve this?
This has been fixed since `3.11.x`. If you're still using old version, you can use `<Select getPopupContainer={trigger => trigger.parentNode}>` to render component inside Popover. (Or other getXxxxContainer props)
This has been fixed since `3.11.x`. If you're using an older version, you can use `<Select getPopupContainer={trigger => trigger.parentNode}>` to render a component inside Popover. (Or other getXxxxContainer props)
https://ant.design/components/select/#Select-props
related issue: [#3487](https://github.com/ant-design/ant-design/issues/3487) [#3438](https://github.com/ant-design/ant-design/issues/3438)
### `Select Dropdown DatePicker TimePicker Popover Popconfirm` scroll with the page?
### `Select Dropdown DatePicker TimePicker Popover Popconfirm` scrolls with the page?
Use `<Select getPopupContainer={trigger => trigger.parentNode}>` to render component inside the scroll area. (Or other getXxxxContainer props).
Use `<Select getPopupContainer={trigger => trigger.parentNode}>` to render a component inside the scroll area. (Or other getXxxxContainer props).
https://ant.design/components/select/#Select-props
related issue: [#3487](https://github.com/ant-design/ant-design/issues/3487) [#3438](https://github.com/ant-design/ant-design/issues/3438)
### How to modify the default theme of Ant Design?
### How do I modify the default theme of Ant Design?
See: https://ant.design/docs/react/customize-theme .
@ -35,11 +35,11 @@ See: https://ant.design/docs/react/customize-theme .
No, we follow Ant Design specification. https://github.com/ant-design/ant-design/issues/1241
### How to modify `Menu`/`Button`(etc...)'s style?
### How to modify `Menu`/`Button`(etc.)'s style?
You can override its style, but we don't recommend doing so. antd is not only a set of React components but also a design specification.
You can override its style but we don't recommend doing so. antd is not only a set of React components but also a design specification.
### I just want to use `Menu`/`Button`(etc...), but it seems that I have to import the whole antd and its style.
### I just want to use `Menu`/`Button`(etc.), but it seems that I have to import the whole of antd and its style.
Try [babel-plugin-import](https://github.com/ant-design/babel-plugin-import), or import what you need in this way:
@ -54,31 +54,31 @@ or (ES6 way with tree shaking):
import { Menu, Breadcrumb, Icon } from 'antd';
```
### How to optimize momentjs bundle size with webpack?
### How can I optimize momentjs bundle size with webpack?
See: https://github.com/jmblog/how-to-optimize-momentjs-with-webpack
### It doesn't work when I change `defaultValue` dynamically.
The `defaultXxxx` (like `defaultValue`) of `Input`/`Select`(etc...) only works in first render. It is a specification of React; please read [React's documentation](https://facebook.github.io/react/docs/forms.html#controlled-components).
The `defaultXxxx` (like `defaultValue`) of `Input`/`Select`(etc...) only works on the first render. It is a specification of React. Please read [React's documentation](https://facebook.github.io/react/docs/forms.html#controlled-components).
### I set the `value` of `Input`/`Select`(etc...), and then, it cannot be changed by user's action.
### I set the `value` of `Input`/`Select`(etc.), and then it cannot be changed by user's action.
Try `defaultValue` or `onChange` to change `value`, and please read [React's documentation](https://facebook.github.io/react/docs/forms.html#controlled-components).
### antd override my global styles!
### antd overrides my global styles
Yes, antd is designed to develop a complete background application, we override some global styles for styling convenience, and it can't be removed now. More info trace https://github.com/ant-design/ant-design/issues/4331 .
Yes, antd is designed to develop a complete background application, we override some global styles for styling convenience, and it can't be removed now. More info at https://github.com/ant-design/ant-design/issues/4331 .
Or, follow the instructions in [How to avoid modifying global styles?](docs/react/customize-theme#How-to-avoid-modifying-global-styles-?)
Alternatively, follow the instructions in [How to avoid modifying global styles?](docs/react/customize-theme#How-to-avoid-modifying-global-styles-?)
### I cannot install `antd` and `antd`'s dependencies(etc...). FYI, I live in China mainland.
### I cannot install `antd` and `antd`'s dependencies in mainland China.
Long live the Girl Friend Wall! And try [cnpm](http://npm.taobao.org/).
### I set `dependencies.antd` as git repository in package.json, but it doesn't work.
Yes, please install `antd` with npm.
Yes, please install `antd` with npm or yarn.
### `message` and `notification` is lower case, but other components are capitalized. Typo?
@ -88,29 +88,29 @@ No, as `message` is just a function, not a React Component.
Please check [And Design Mobile](http://mobile.ant.design) for details. `antd` has not been optimized to do so. You may try [react-component](https://github.com/react-component/), those repositories which start with 'm-' 'rn-' are designed for mobile.
### Does `antd` supply standalone files like 'react' do?
### Does `antd` supply standalone files like 'React'?
Yep, you can [import `antd` with script tag](https://ant.design/docs/react/install?locale=en-US#Import-in-Browser). But we recommend using `npm` to import `antd`, it is simple and easy to maintain.
Yes, you can [import `antd` with script tag](https://ant.design/docs/react/install?locale=en-US#Import-in-Browser). But we recommend using `npm` to import `antd`, it is simple and easy to maintain.
### I can't visit `icon` in my network environment.
You should deploy the iconfont files to your network by following this [example](https://github.com/ant-design/antd-init/tree/7c1a33cadb98f2fd8688fe527dd7f98215b9bced/examples/local-iconfont). [#1070](https://github.com/ant-design/ant-design/issues/1070)
After 3.9.x [we are using svg icon](/components/icon#svg-icons), so you don't need to deploy iconfont locally anymore!
After 3.9.x [we are using svg icon](/components/icon#svg-icons), so you don't need to deploy iconfont locally anymore.
### How to extend antd's components?
### How do I extend antd's components?
If you need some features which should not be included in antd, try to extend antd's component with [HOC](https://gist.github.com/sebmarkbage/ef0bf1f338a7182b6775). [more](https://medium.com/@dan_abramov/mixins-are-dead-long-live-higher-order-components-94a0d2f9e750#.eeu8q01s1)
### How to fix dynamic style when open Content Security Policy (CSP)?
### How do I fix dynamic style when open Content Security Policy (CSP)?
You can config `nonce` by [ConfigProvider](/components/config-provider/#Content-Security-Policy).
You can configure `nonce` by [ConfigProvider](/components/config-provider/#Content-Security-Policy).
### When set `mode` to DatePicker/RangePicker, cannot select year or month anymore?
### When I set `mode` to DatePicker/RangePicker, I 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!
In a 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
- Reproduction 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).

View File

@ -36,7 +36,7 @@ title: Ant Design of React
- 现代浏览器和 IE9 及以上(需要 [polyfills](https://ant.design/docs/react/getting-started-cn#兼容性))。
- 支持服务端渲染。
- [Electron](http://electron.atom.io/)
- [Electron](https://electronjs.org/)
## 版本

View File

@ -201,7 +201,7 @@ We use `modifyVars` option of [less-loader](https://github.com/webpack/less-load
## eject
You can also eject your application using [yarn run eject](https://github.com/facebookincubator/create-react-app#converting-to-a-custom-setup) for a custom setup of create-react-app, although you should dig into it by yourself.
You can also eject your application using [yarn run eject](https://facebook.github.io/create-react-app/docs/available-scripts#npm-run-eject) for a custom setup of create-react-app, although you should dig into it by yourself.
## Source code and other boilerplates

View File

@ -203,7 +203,7 @@ module.exports = override(
## eject
你也可以使用 create-react-app 提供的 [yarn run eject](https://github.com/facebookincubator/create-react-app#converting-to-a-custom-setup) 命令将所有内建的配置暴露出来。不过这种配置方式需要你自行探索,不在本文讨论范围内。
你也可以使用 create-react-app 提供的 [yarn run eject](https://facebook.github.io/create-react-app/docs/available-scripts#npm-run-eject) 命令将所有内建的配置暴露出来。不过这种配置方式需要你自行探索,不在本文讨论范围内。
## 源码和其他脚手架

View File

@ -98,4 +98,16 @@ Please find below some of the design resources and tools about Ant Design that w
<span class="resource-card-description">Large library of components and styles for Desktop</span>
</div>
</a>
<a target="_blank" href="https://store.framer.com/package/bhaveshchow/ant-design-system" class="resource-card">
<div class="resource-card-icon">
<img width="65" src="https://raw.githubusercontent.com/bhaveshc20/antdesign-framer/master/framerant-icon.png">
</div>
<div class="resource-card-content">
<span class="resource-card-title">
UI Kit for Framer X
<span class="resource-card-hot-badge">NEW</span>
</span>
<span class="resource-card-description">Library of fully customizable components</span>
</div>
</a>
</div>

View File

@ -1,6 +1,6 @@
{
"name": "antd",
"version": "3.20.3",
"version": "3.20.7",
"title": "Ant Design",
"description": "An enterprise-class UI design language and React components implementation",
"homepage": "http://ant.design/",
@ -54,7 +54,7 @@
"dom-closest": "^0.2.0",
"dom-scroll-into-view": "^1.2.1",
"enquire.js": "^2.1.6",
"lodash": "^4.17.11",
"lodash": "^4.17.13",
"moment": "^2.24.0",
"omit.js": "^1.0.2",
"prop-types": "^15.7.2",

View File

@ -18,7 +18,7 @@
}
.markdown p > img.markdown-inline-image {
margin: 0 34px;
margin: 0;
box-shadow: none;
}