Skip to content

Feat 1.3.0 #398

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 68 commits into from
Jan 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
a47c6ef
feat: add multiFormats
tangjinzhou Dec 27, 2018
20c0cf4
Merge branch 'feat-1.3.0' of https://github.com/vueComponent/ant-desi…
tangjinzhou Dec 28, 2018
d805107
feat: update vc-cascaser vc-checkbox vc-collapse
tangjinzhou Dec 31, 2018
429e7f4
feat: add comment
wangxueliang Jan 1, 2019
13b78b9
docs: comment doc
wangxueliang Jan 1, 2019
754d897
feat: update vc-drawer vc-form
tangjinzhou Jan 1, 2019
c4f08e4
Merge branch 'feat-1.3.0' of https://github.com/vueComponent/ant-desi…
tangjinzhou Jan 1, 2019
6799f17
Merge branch 'master' into feat-1.3.0
tangjinzhou Jan 1, 2019
0aa764d
feat: update form ts
tangjinzhou Jan 1, 2019
6395479
feat: update vc-notification vc-pagination
tangjinzhou Jan 1, 2019
75e5f04
feat: update vc-table vc-upload
tangjinzhou Jan 1, 2019
f597775
feat: update comment
tangjinzhou Jan 2, 2019
1ba0b84
fix: drawer class
tangjinzhou Jan 2, 2019
05deb53
test: update datepicker test
tangjinzhou Jan 2, 2019
7dbf5ed
feat: add config-provider
tangjinzhou Jan 2, 2019
7422026
fix: button
tangjinzhou Jan 2, 2019
e13f4c5
fix: DatePicker
tangjinzhou Jan 2, 2019
9ecc5e1
feat: checkbox group support custom label
tangjinzhou Jan 2, 2019
3534e7d
fix: drawer style to wrapStyle
tangjinzhou Jan 2, 2019
5cd17e0
feat: update ts
tangjinzhou Jan 2, 2019
9252b65
feat: calendar add da_DK he_IL hu_HU id_ID
tangjinzhou Jan 2, 2019
8eaf6da
feat: dropdown add overlayClassName overlayStyle,
tangjinzhou Jan 2, 2019
43a503f
feat: avatar add srcSet
tangjinzhou Jan 2, 2019
daccfd1
fix: fixed the issue that when the Alert is in closable, the icon wil…
tangjinzhou Jan 2, 2019
9eb923c
feat: update
tangjinzhou Jan 2, 2019
14dfeba
feat: update style to 3.11.6
tangjinzhou Jan 2, 2019
5a9eb88
fix: drawer style to wrapStyle
tangjinzhou Jan 2, 2019
27d8caa
test: update snapshots
tangjinzhou Jan 2, 2019
27880b0
feat: optimize the display of the button icon
tangjinzhou Jan 3, 2019
843b074
feat: badge support slot type count
tangjinzhou Jan 3, 2019
3a49503
feat: cascader support limit
tangjinzhou Jan 3, 2019
4d6627d
docs: update form demo
tangjinzhou Jan 3, 2019
0178c35
perf: input icon grid
tangjinzhou Jan 3, 2019
e706170
test: update snapshots
tangjinzhou Jan 3, 2019
435b8a1
feat: update vc-select
tangjinzhou Jan 4, 2019
30af93b
feat: update vc-select
tangjinzhou Jan 4, 2019
b698d74
docs: update layout doc
tangjinzhou Jan 5, 2019
6a0f934
feat: local add da_DK he_IL hu_HU id_ID ne-NP
tangjinzhou Jan 5, 2019
7b5fb53
fix: update list `pagination` props type
tangjinzhou Jan 5, 2019
8933cc5
feat: menu add title
tangjinzhou Jan 5, 2019
0d49773
feat: notification add onClick
tangjinzhou Jan 5, 2019
032655f
feat: slider add tooltipVisible and optimize experience
tangjinzhou Jan 5, 2019
439d9cf
feat: slider add tooltipVisible and optimize experience
tangjinzhou Jan 5, 2019
380e4cd
perf: some code
tangjinzhou Jan 5, 2019
b955d50
feat: update ts types
tangjinzhou Jan 5, 2019
c094790
feat: select add dropdownRender removeIcon clearIcon menuItemSelected…
tangjinzhou Jan 5, 2019
ad07278
test: update snapshots
tangjinzhou Jan 5, 2019
8340a0b
feat: table add expandIcon
tangjinzhou Jan 5, 2019
bbc6c29
feat: table sortTitle opt
tangjinzhou Jan 6, 2019
fc206c7
chore: fix isValidElement
tangjinzhou Jan 6, 2019
4055a23
docs: update demo
tangjinzhou Jan 6, 2019
06fe9ec
feat: tabs activeKey support number
tangjinzhou Jan 7, 2019
b2d6577
feat: time-picker and tooltip support configProvider.getPopupContainer
tangjinzhou Jan 7, 2019
948499a
fix: input trigger multiple change event
tangjinzhou Jan 7, 2019
41ee8ea
feat: transfer change `searchChange` to `search`
tangjinzhou Jan 7, 2019
cfe0021
feat: tree-select support searchValue
tangjinzhou Jan 7, 2019
7a279f6
docs: update upload doc
tangjinzhou Jan 7, 2019
e67fc35
update ts
tangjinzhou Jan 7, 2019
b5ca022
perf: tree
tangjinzhou Jan 7, 2019
1fb3ce3
Merge branch 'master' into feat-1.3.0
tangjinzhou Jan 7, 2019
98eb6b2
test: update snapshots
tangjinzhou Jan 7, 2019
ac88e49
refactor: tag
tangjinzhou Jan 8, 2019
6f15a47
feat: update vc-menu vc-select
tangjinzhou Jan 8, 2019
8a9964d
feat: update vc-tabs vc-steps
tangjinzhou Jan 9, 2019
dcefca2
Merge branch 'master' into feat-1.3.0
tangjinzhou Jan 10, 2019
eba3547
docs: udpate demo
tangjinzhou Jan 10, 2019
eee43a3
docs: add 1.3.0 zh changelog
tangjinzhou Jan 10, 2019
e43c0c3
docs: add changelog
tangjinzhou Jan 12, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
52 changes: 52 additions & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,59 @@
# Change Log

`ant-design-vue` strictly follows [Semantic Versioning 2.0.0](http://semver.org/).

#### Release Schedule

* Weekly release: patch version at the end of every week for routine bugfix (anytime for urgent bugfix).
* Monthly release: minor version for new features.
* Major version release is not included in this schedule for breaking change and new features.

---

## 1.3.0
`2019-01-12`

- 🎉 🎉 🎉 Publish the vscode plugin [ant-design-vue-helper](https://marketplace.visualstudio.com/items?itemName=ant-design-vue.vscode-ant-design-vue-helper)

### Component features and styles are synchronized to antd version 3.11.6.
1.3.0 brings two new Components, a lot of exciting changes and new features.

- 🔥 Added a new component [Comment](https://vuecomponent.github.io/ant-design-vue/components/comment/)。
- 🔥 dded a new component [ConfigProvider](https://vuecomponent.github.io/ant-design-vue/components/config-provider/) for user to customize some global setting.

Component Fixes / Enhancements:

- 🌟 Avatar Added `srcSet` prop that is a list of sources to use for different screen resolutions.
- 🌟 Notification Added `onClick` prop that is called when the notification is clicked.
- Transfer
- 🌟 Added `search` event that is executed when search field are changed and deprecated `searchChange` event.
- 🌟 Added `disabled` prop that whether disable transfer.
- 🌟 Refactor Badge, support `count` as custom component.
- Slider
- 🌟 Added `tooltipVisible` prop that whether Tooltip will always show.
- 🌟 Optimize the focus effect
- 🐞 Fix tooltip does not display the problem when focus through the keyboard tab.
- 🐞 Fix the hidden switch problem of Tooltip while dragging.
- Calendar
- 🌟 Support multiple date format.
- 🌟 showSearch added `limit` prop that support limit filtered item count.
- Table
- 🌟 Added `expandIcon` prop that custom the default expand icon.
- 🌟 customCell added `index` prop.
- Select
- 🌟 Added `removeIcon`、`clearIcon`、`menuItemSelectedIcon` prop,allow setting `remove`、`clear`、`menuItemSelected` custom icons.
- 🌟 Added `dropdownRender` prop that custom dropdown content.
- 🌟 Added `loading` prop that indicate loading state.
- 🌟 Optimize the display of the Button when it contains an Icon.
- ⚡️ Refactor Tag component with less code and better performance.
- 💄 Added `title` prop that Menu.Item support tooltip title when collapsed.
- 💄 Chore Card header and loading UI.
- 💄 Optimized Spin wrapper styles and improve performance slightly.
- 🐞 Fix TextArea use resize observer to check textarea size.
- 🐞 Fix Tooltip in the disabled state, the style error problem.[#389](https://github.com/vueComponent/ant-design-vue/issues/389)
- 🐞 Fix some component TypeScript definitions.


## 1.2.5
`2019-01-06`

Expand Down
52 changes: 52 additions & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,59 @@
# 更新日志

`ant-design-vue` 严格遵循 [Semantic Versioning 2.0.0](http://semver.org/lang/zh-CN/) 语义化版本规范。

#### 发布周期

* 修订版本号:每周末会进行日常 bugfix 更新。(如果有紧急的 bugfix,则任何时候都可发布)
* 次版本号:带有新特性的向下兼容的版本。
* 主版本号:含有破坏性更新和新特性,不在发布周期内。

---

## 1.3.0
`2019-01-12`

- 🎉 🎉 🎉 发布 vscode 插件 [ant-design-vue-helper](https://marketplace.visualstudio.com/items?itemName=ant-design-vue.vscode-ant-design-vue-helper)

### 组件功能和样式同步到 antd 3.11.6 版本。
1.3.0 版本带来了两个新组件,还有很多激动人心的变化和新特性。

- 🔥 增加了一个新组件 [Comment](https://vuecomponent.github.io/ant-design-vue/components/comment-cn/)。
- 🔥 增加了一个新组件 [ConfigProvider](https://vuecomponent.github.io/ant-design-vue/components/config-provider-cn/) 为组件提供统一的全局化配置。

组件修复/功能增强:

- 🌟 Avatar 组件增加 `srcSet` 属性,用于设置图片类头像响应式资源地址。
- 🌟 Notification 组件增加 `onClick` 属性,点击通知时触发的回调函数。
- Transfer
- 🌟 增加 `search` 事件,搜索框内容时改变时的回调函数,并废弃 `searchChange` 事件。
- 🌟 增加 `disabled` 属性,用于禁用搜索框。
- 🌟 Badge 进行了重构,`count` 支持自定义组件。
- Slider
- 🌟 增加 `tooltipVisible` 属性,用于 Tooltip 是否始终显示。
- 🌟 优化focus效果
- 🐞 修复键盘tab键聚焦时,Tooltip不显示问题。
- 🐞 修复拖动时Tooltip不停的显隐切换问题。
- Calendar
- 🌟 支持多种时间格式。
- 🌟 showSearch 方法增加 `limit` 参数,用于限制搜索结果展示数量。
- Table
- 🌟 增加 `expandIcon` 属性,用于自定义表格展开图标。
- 🌟 customCell 方法增加 `index` 参数。
- Select
- 🌟 增加 `removeIcon`、`clearIcon`、`menuItemSelectedIcon` 属性,用于自定义删除、清空、选中的图标。
- 🌟 增加 `dropdownRender` 属性, 用于自定义下拉框内容。
- 🌟 增加 `loading` 属性, 用于展示加载中状态。
- 🌟 优化 Button 在含有Icon时的显示效果。
- ⚡️ 重构 Tag 组件,简化代码并提升性能。
- 💄 Menu.Item 组件增加 `title` 属性,用于在收缩时展示的悬浮标题。
- 💄 微调 Card 头部和加载中的样式细节。
- 💄 优化 Spin 样式并略微提升了切换状态的性能。
- 🐞 修复 TextArea 组件高度不能自适应问题。
- 🐞 修复 Tooltip 在disabled状态下Button中,样式错误问题。[#389](https://github.com/vueComponent/ant-design-vue/issues/389)
- 🐞 修复一些组件 TypeScript 定义。


## 1.2.5
`2019-01-06`

Expand Down
28 changes: 14 additions & 14 deletions components/_util/BaseMixin.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@

export default {
directives: {
ref: {
bind: function (el, binding, vnode) {
binding.value(vnode.componentInstance ? vnode.componentInstance : vnode.elm)
},
update: function (el, binding, vnode) {
binding.value(vnode.componentInstance ? vnode.componentInstance : vnode.elm)
},
unbind: function (el, binding, vnode) {
binding.value(null)
},
},
},
// directives: {
// ref: {
// bind: function (el, binding, vnode) {
// binding.value(vnode.componentInstance ? vnode.componentInstance : vnode.elm)
// },
// update: function (el, binding, vnode) {
// binding.value(vnode.componentInstance ? vnode.componentInstance : vnode.elm)
// },
// unbind: function (el, binding, vnode) {
// binding.value(null)
// },
// },
// },
methods: {
setState (state, callback) {
const newState = typeof state === 'function' ? state(this.$data) : state
const newState = typeof state === 'function' ? state(this.$data, this.$props) : state
// if (this.getDerivedStateFromProps) {
// Object.assign(newState, this.getDerivedStateFromProps(getOptionProps(this), { ...this.$data, ...newState }, true) || {})
// }
Expand Down
4 changes: 2 additions & 2 deletions components/_util/Dom/addEventListener.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import addDOMEventListener from 'add-dom-event-listener'

export default function addEventListenerWrap (target, eventType, cb) {
return addDOMEventListener(target, eventType, cb)
export default function addEventListenerWrap (target, eventType, cb, option) {
return addDOMEventListener(target, eventType, cb, option)
}
20 changes: 13 additions & 7 deletions components/_util/props-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,11 @@ const getSlots = (ele) => {
const children = ele.children || componentOptions.children || []
const slots = {}
children.forEach(child => {
const name = (child.data && child.data.slot) || 'default'
slots[name] = slots[name] || []
slots[name].push(child)
if (!isEmptyElement(child)) {
const name = (child.data && child.data.slot) || 'default'
slots[name] = slots[name] || []
slots[name].push(child)
}
})
return slots
}
Expand Down Expand Up @@ -215,12 +217,12 @@ export function getComponentName (opts) {
return opts && (opts.Ctor.options.name || opts.tag)
}

export function isEmptyElement (ele) {
return !(ele.tag || ele.text.trim() !== '')
export function isEmptyElement (c) {
return !(c.tag || (c.text && c.text.trim() !== ''))
}

export function filterEmpty (children = []) {
return children.filter(c => c.tag || (c.text && c.text.trim() !== ''))
return children.filter(c => !isEmptyElement(c))
}
const initDefaultProps = (propTypes, defaultProps) => {
Object.keys(defaultProps).forEach(k => {
Expand Down Expand Up @@ -252,7 +254,11 @@ export function mergeProps () {
}

function isValidElement (element) {
return element && element.context && element.context._isVue
return element &&
typeof element === 'object' &&
'componentOptions' in element &&
'context' in element &&
element.tag !== undefined // remove text node
}

export {
Expand Down
2 changes: 1 addition & 1 deletion components/_util/wave.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export default {
},

resetEffect (node) {
if (!node || node === this.extraNode) {
if (!node || node === this.extraNode || !(node instanceof Element)) {
return
}
const { insertExtraNode } = this.$props
Expand Down
2 changes: 2 additions & 0 deletions components/affix/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ const Affix = {
// Wait for parent component ref has its value
this.timeout = setTimeout(() => {
this.setTargetEventListeners(target)
// Mock Event object.
this.updatePosition({})
})
},
watch: {
Expand Down
2 changes: 1 addition & 1 deletion components/affix/style/index.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "../../style/themes/default";
@import '../../style/themes/default';

.@{ant-prefix}-affix {
position: fixed;
Expand Down
10 changes: 5 additions & 5 deletions components/alert/__tests__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exports[`renders ./components/alert/demo/banner.md correctly 1`] = `
<div data-show="true" class="ant-alert ant-alert-warning ant-alert-banner"><i class="ant-alert-icon anticon anticon-exclamation-circle"><svg viewBox="64 64 896 896" data-icon="exclamation-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true" class="">
<path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 0 1 0-96 48.01 48.01 0 0 1 0 96z"></path>
</svg></i><span class="ant-alert-message">Warning text</span><span class="ant-alert-description"></span></div> <br>
<div data-show="true" class="ant-alert ant-alert-warning ant-alert-banner"><i class="ant-alert-icon anticon anticon-exclamation-circle"><svg viewBox="64 64 896 896" data-icon="exclamation-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true" class="">
<div data-show="true" class="ant-alert ant-alert-warning ant-alert-banner ant-alert-closable"><i class="ant-alert-icon anticon anticon-exclamation-circle"><svg viewBox="64 64 896 896" data-icon="exclamation-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true" class="">
<path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 0 1 0-96 48.01 48.01 0 0 1 0 96z"></path>
</svg></i><span class="ant-alert-message">Very long warning text warning text text text text text text text</span><span class="ant-alert-description"></span><a class="ant-alert-close-icon"><i class="anticon anticon-close"><svg viewBox="64 64 896 896" data-icon="close" width="1em" height="1em" fill="currentColor" aria-hidden="true" class="">
<path d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"></path>
Expand All @@ -21,16 +21,16 @@ exports[`renders ./components/alert/demo/basic.md correctly 1`] = `<div data-sho

exports[`renders ./components/alert/demo/closable.md correctly 1`] = `
<div>
<div data-show="true" class="ant-alert ant-alert-warning ant-alert-no-icon"><span class="ant-alert-message">Warning Text Warning Text Warning TextW arning Text Warning Text Warning TextWarning Text</span><span class="ant-alert-description"></span><a class="ant-alert-close-icon"><i class="anticon anticon-close"><svg viewBox="64 64 896 896" data-icon="close" width="1em" height="1em" fill="currentColor" aria-hidden="true" class="">
<div data-show="true" class="ant-alert ant-alert-warning ant-alert-no-icon ant-alert-closable"><span class="ant-alert-message">Warning Text Warning Text Warning TextW arning Text Warning Text Warning TextWarning Text</span><span class="ant-alert-description"></span><a class="ant-alert-close-icon"><i class="anticon anticon-close"><svg viewBox="64 64 896 896" data-icon="close" width="1em" height="1em" fill="currentColor" aria-hidden="true" class="">
<path d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"></path>
</svg></i></a></div>
<div data-show="true" class="ant-alert ant-alert-error ant-alert-with-description ant-alert-no-icon"><span class="ant-alert-message">Error Text</span><span class="ant-alert-description">Error Description Error Description Error Description Error Description Error Description Error Description</span><a class="ant-alert-close-icon"><i class="anticon anticon-close"><svg viewBox="64 64 896 896" data-icon="close" width="1em" height="1em" fill="currentColor" aria-hidden="true" class="">
<div data-show="true" class="ant-alert ant-alert-error ant-alert-with-description ant-alert-no-icon ant-alert-closable"><span class="ant-alert-message">Error Text</span><span class="ant-alert-description">Error Description Error Description Error Description Error Description Error Description Error Description</span><a class="ant-alert-close-icon"><i class="anticon anticon-close"><svg viewBox="64 64 896 896" data-icon="close" width="1em" height="1em" fill="currentColor" aria-hidden="true" class="">
<path d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"></path>
</svg></i></a></div>
</div>
`;

exports[`renders ./components/alert/demo/close-text.md correctly 1`] = `<div data-show="true" class="ant-alert ant-alert-info ant-alert-no-icon"><span class="ant-alert-message">Info Text</span><span class="ant-alert-description"></span><a class="ant-alert-close-icon">Close Now</a></div>`;
exports[`renders ./components/alert/demo/close-text.md correctly 1`] = `<div data-show="true" class="ant-alert ant-alert-info ant-alert-no-icon ant-alert-closable"><span class="ant-alert-message">Info Text</span><span class="ant-alert-description"></span><a class="ant-alert-close-icon">Close Now</a></div>`;

exports[`renders ./components/alert/demo/custom-icon.md correctly 1`] = `
<div>
Expand Down Expand Up @@ -92,7 +92,7 @@ exports[`renders ./components/alert/demo/icon.md correctly 1`] = `

exports[`renders ./components/alert/demo/smooth-closed.md correctly 1`] = `
<div>
<div data-show="true" class="ant-alert ant-alert-success ant-alert-no-icon"><span class="ant-alert-message">Alert Message Text</span><span class="ant-alert-description"></span><a class="ant-alert-close-icon"><i class="anticon anticon-close"><svg viewBox="64 64 896 896" data-icon="close" width="1em" height="1em" fill="currentColor" aria-hidden="true" class="">
<div data-show="true" class="ant-alert ant-alert-success ant-alert-no-icon ant-alert-closable"><span class="ant-alert-message">Alert Message Text</span><span class="ant-alert-description"></span><a class="ant-alert-close-icon"><i class="anticon anticon-close"><svg viewBox="64 64 896 896" data-icon="close" width="1em" height="1em" fill="currentColor" aria-hidden="true" class="">
<path d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"></path>
</svg></i></a></div>
</div>
Expand Down
11 changes: 6 additions & 5 deletions components/alert/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,20 @@ const Alert = {
}
}

// closeable when closeText is assigned
if (closeText) {
closable = true
}

const alertCls = classNames(prefixCls, {
[`${prefixCls}-${type}`]: true,
[`${prefixCls}-close`]: !closing,
[`${prefixCls}-with-description`]: !!description,
[`${prefixCls}-no-icon`]: !showIcon,
[`${prefixCls}-banner`]: !!banner,
[`${prefixCls}-closable`]: closable,
})

// closeable when closeText is assigned
if (closeText) {
closable = true
}

const closeIcon = closable ? (
<a onClick={this.handleClose} class={`${prefixCls}-close-icon`}>
{closeText || <Icon type='close' />}
Expand Down
19 changes: 12 additions & 7 deletions components/alert/style/index.less
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
@import "../../style/themes/default";
@import "../../style/mixins/index";
@import '../../style/themes/default';
@import '../../style/mixins/index';

@alert-prefix-cls: ~"@{ant-prefix}-alert";
@alert-prefix-cls: ~'@{ant-prefix}-alert';

@alert-message-color: @heading-color;
@alert-text-color: @text-color;
@alert-close-color: @text-color-secondary;
@alert-close-hover-color: #404040;

.@{alert-prefix-cls} {
.reset-component;
Expand All @@ -17,6 +18,10 @@
padding: 8px 15px;
}

&&-closable {
padding-right: 30px;
}

&-icon {
top: 8px + @font-size-base * @line-height-base / 2 - @font-size-base / 2;
left: 16px;
Expand Down Expand Up @@ -72,9 +77,9 @@

.@{iconfont-css-prefix}-close {
color: @alert-close-color;
transition: color .3s;
transition: color 0.3s;
&:hover {
color: #404040;
color: @alert-close-hover-color;
}
}
}
Expand Down Expand Up @@ -127,12 +132,12 @@
margin: 0;
padding-top: 0;
padding-bottom: 0;
transition: all .3s @ease-in-out-circ;
transition: all 0.3s @ease-in-out-circ;
transform-origin: 50% 0;
}

&-slide-up-leave {
animation: antAlertSlideUpOut .3s @ease-in-out-circ;
animation: antAlertSlideUpOut 0.3s @ease-in-out-circ;
animation-fill-mode: both;
}

Expand Down
8 changes: 4 additions & 4 deletions components/anchor/style/index.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import "../../style/themes/default";
@import "../../style/mixins/index";
@import '../../style/themes/default';
@import '../../style/mixins/index';

@anchor-border-width: 2px;

Expand Down Expand Up @@ -38,7 +38,7 @@
border: 2px solid @primary-color;
background-color: @component-background;
left: 50%;
transition: top .3s ease-in-out;
transition: top 0.3s ease-in-out;
transform: translateX(-50%);
&.visible {
display: inline-block;
Expand All @@ -57,7 +57,7 @@
&-title {
display: block;
position: relative;
transition: all .3s;
transition: all 0.3s;
color: @text-color;
white-space: nowrap;
overflow: hidden;
Expand Down
Loading