-
- -
+
-
- -
+
+ -
A
A
- -
+
-
A
A
- -
+
-
A
A
- -
+
-
A
A
- -
+
-
A
A
-
- -
+
+ -
好
好
- -
+
-
好
好
- -
+
-
好
好
- -
+
-
好
好
- -
+
-
好
好
@@ -98,47 +98,47 @@ exports[`renders ./components/rate/demo/character.md correctly 1`] = `
exports[`renders ./components/rate/demo/clear.md correctly 1`] = `
-
- -
+ allowClear: true
-
- -
+
+ -
- -
+
-
- -
+
-
- -
+
-
- -
+
-
@@ -148,24 +148,24 @@ exports[`renders ./components/rate/demo/clear.md correctly 1`] = `
`;
exports[`renders ./components/rate/demo/disabled.md correctly 1`] = `
-
- -
+
+ -
- -
+
-
- -
+
-
- -
+
-
- -
+
-
@@ -173,28 +173,28 @@ exports[`renders ./components/rate/demo/disabled.md correctly 1`] = `
`;
exports[`renders ./components/rate/demo/half.md correctly 1`] = `
-
- -
+
`;
-exports[`renders ./components/rate/demo/text.md correctly 1`] = ` 3 stars`;
+exports[`renders ./components/rate/demo/text.md correctly 1`] = ` 3 stars`;
diff --git a/components/vc-notification/Notice.jsx b/components/vc-notification/Notice.jsx
index 3f6610671..9e695d213 100644
--- a/components/vc-notification/Notice.jsx
+++ b/components/vc-notification/Notice.jsx
@@ -1,6 +1,6 @@
import PropTypes from '../_util/vue-types'
-import { getStyle } from '../_util/props-util'
+import { getStyle, getComponentFromProp } from '../_util/props-util'
import BaseMixin from '../_util/BaseMixin'
export default {
@@ -10,6 +10,7 @@ export default {
closable: PropTypes.bool,
prefixCls: PropTypes.string,
update: PropTypes.bool,
+ closeIcon: PropTypes.any,
},
mounted () {
@@ -65,6 +66,7 @@ export default {
[`${componentClass}-closable`]: closable,
}
const style = getStyle(this)
+ const closeIcon = getComponentFromProp(this, 'closeIcon')
return (
{$slots.default}
{closable
?
-
+ {closeIcon || }
: null
}
diff --git a/components/vc-notification/Notification.jsx b/components/vc-notification/Notification.jsx
index b9d6c1903..6352044bd 100644
--- a/components/vc-notification/Notification.jsx
+++ b/components/vc-notification/Notification.jsx
@@ -1,7 +1,7 @@
import Vue from 'vue'
import PropTypes from '../_util/vue-types'
-import { getStyle } from '../_util/props-util'
+import { getStyle, getComponentFromProp } from '../_util/props-util'
import BaseMixin from '../_util/BaseMixin'
import createChainedFunction from '../_util/createChainedFunction'
import getTransitionProps from '../_util/getTransitionProps'
@@ -21,6 +21,7 @@ const Notification = {
transitionName: PropTypes.string,
animation: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).def('fade'),
maxCount: PropTypes.number,
+ closeIcon: PropTypes.any,
},
data () {
return {
@@ -86,6 +87,7 @@ const Notification = {
duration,
closable,
update,
+ closeIcon: getComponentFromProp(this, 'closeIcon'),
},
on: {
close,
diff --git a/components/vc-notification/index.js b/components/vc-notification/index.js
index 536660e94..a30798b2a 100644
--- a/components/vc-notification/index.js
+++ b/components/vc-notification/index.js
@@ -1,3 +1,3 @@
-// based on rc-notification 3.1.1
+// based on rc-notification 3.2.0
import Notification from './Notification'
export default Notification
diff --git a/components/vc-pagination/Pagination.jsx b/components/vc-pagination/Pagination.jsx
index 2d3a272c4..299d8b403 100644
--- a/components/vc-pagination/Pagination.jsx
+++ b/components/vc-pagination/Pagination.jsx
@@ -1,7 +1,7 @@
import PropTypes from '../_util/vue-types'
import BaseMixin from '../_util/BaseMixin'
-import { hasProp } from '../_util/props-util'
+import { hasProp, getComponentFromProp } from '../_util/props-util'
import Pager from './Pager'
import Options from './Options'
import LOCALE from './locale/zh_CN'
@@ -46,6 +46,10 @@ export default {
simple: PropTypes.bool,
locale: PropTypes.object.def(LOCALE),
itemRender: PropTypes.func.def(defaultItemRender),
+ prevIcon: PropTypes.any,
+ nextIcon: PropTypes.any,
+ jumpPrevIcon: PropTypes.any,
+ jumpNextIcon: PropTypes.any,
},
model: {
prop: 'current',
@@ -111,6 +115,11 @@ export default {
isValid (page) {
return isInteger(page) && page >= 1 && page !== this.stateCurrent
},
+ getItemIcon (icon) {
+ const { prefixCls } = this.$props
+ const iconNode = getComponentFromProp(this, icon, this.$props) ||
+ return iconNode
+ },
calculatePage (p) {
let pageSize = p
if (typeof pageSize === 'undefined') {
@@ -255,7 +264,7 @@ export default {
if (this.hideOnSinglePage === true && this.total <= this.statePageSize) {
return null
}
-
+ const props = this.$props
const locale = this.locale
const prefixCls = this.prefixCls
@@ -313,7 +322,7 @@ export default {
class={`${hasPrev ? '' : `${prefixCls}-disabled`} ${prefixCls}-prev`}
aria-disabled={!this.hasPrev()}
>
- {this.itemRender(prevPage, 'prev', )}
+ {this.itemRender(prevPage, 'prev', this.getItemIcon('prevIcon'))}
-
- {this.itemRender(nextPage, 'next', )}
+ {this.itemRender(nextPage, 'next', this.getItemIcon('nextIcon'))}
{gotoButton}
@@ -365,6 +374,10 @@ export default {
const prevItemTitle = this.showLessItems ? locale.prev_3 : locale.prev_5
const nextItemTitle = this.showLessItems ? locale.next_3 : locale.next_5
if (this.showPrevNextJumpers) {
+ let jumpPrevClassString = `${prefixCls}-jump-prev`
+ if (props.jumpPrevIcon) {
+ jumpPrevClassString += ` ${prefixCls}-jump-prev-custom-icon`
+ }
jumpPrev = (
-
{this.itemRender(
- this.getJumpPrevPage(), 'jump-prev',
+ this.getJumpPrevPage(),
+ 'jump-prev',
+ this.getItemIcon('jumpPrevIcon')
)}
)
+ let jumpNextClassString = `${prefixCls}-jump-next`
+ if (props.jumpNextIcon) {
+ jumpNextClassString += ` ${prefixCls}-jump-next-custom-icon`
+ }
jumpNext = (
-
{this.itemRender(
- this.getJumpNextPage(), 'jump-next',
+ this.getJumpNextPage(),
+ 'jump-next',
+ this.getItemIcon('jumpNextIcon')
)}
)
@@ -527,7 +548,10 @@ export default {
class={`${!prevDisabled ? '' : `${prefixCls}-disabled`} ${prefixCls}-prev`}
aria-disabled={prevDisabled}
>
- {this.itemRender(prevPage, 'prev', )}
+ {this.itemRender(prevPage,
+ 'prev',
+ this.getItemIcon('prevIcon')
+ )}
{pagerList}
-
- {this.itemRender(nextPage, 'next', )}
+ {this.itemRender(nextPage,
+ 'next',
+ this.getItemIcon('nextIcon')
+ )}
{stars}
diff --git a/components/vc-rate/src/Star.jsx b/components/vc-rate/src/Star.jsx
index 7615ac7f8..7405ea6de 100644
--- a/components/vc-rate/src/Star.jsx
+++ b/components/vc-rate/src/Star.jsx
@@ -1,9 +1,10 @@
import PropTypes from '../../_util/vue-types'
-
+import BaseMixin from '../../_util/BaseMixin'
function noop () {}
export default {
name: 'Star',
+ mixins: [BaseMixin],
props: {
value: PropTypes.number,
index: PropTypes.number,
@@ -12,6 +13,7 @@ export default {
disabled: PropTypes.bool,
character: PropTypes.any,
focused: PropTypes.bool,
+ count: PropTypes.number,
},
methods: {
onHover (e) {
@@ -22,6 +24,12 @@ export default {
const { index } = this
this.$emit('click', e, index)
},
+ onKeyDown (e) {
+ const { index } = this.$props
+ if (e.keyCode === 13) {
+ this.__emit('click', e, index)
+ }
+ },
getClassName () {
const { prefixCls, index, value, allowHalf, focused } = this
const starValue = index + 1
@@ -43,7 +51,7 @@ export default {
},
},
render () {
- const { onHover, onClick, disabled, prefixCls } = this
+ const { onHover, onClick, onKeyDown, disabled, prefixCls, index, count, value } = this
let character = this.character
if (character === undefined) {
character = this.$slots.character
@@ -52,7 +60,13 @@ export default {
index ? 'true' : 'false'}
+ aria-posinset={index + 1}
+ aria-setsize={count}
+ tabIndex={0}
>
{character}
{character}
diff --git a/components/vc-tree/index.js b/components/vc-tree/index.js
index 94f5145d3..7a671c351 100644
--- a/components/vc-tree/index.js
+++ b/components/vc-tree/index.js
@@ -1,4 +1,4 @@
-// based on rc-tree 1.14.6
+// based on rc-tree 1.14.8
'use strict'
module.exports = require('./src/')
diff --git a/components/vc-tree/src/Tree.jsx b/components/vc-tree/src/Tree.jsx
index 68e99a8bd..42fad61a4 100644
--- a/components/vc-tree/src/Tree.jsx
+++ b/components/vc-tree/src/Tree.jsx
@@ -313,6 +313,7 @@ const Tree = {
_dragOverNodeKey: '',
})
this.__emit('dragend', { event, node })
+ this.dragNode = null
},
onNodeDrop (event, node) {
const { _dragNodesKeys = [], _dropPosition } = this.$data
@@ -342,6 +343,7 @@ const Tree = {
dropResult.dropToGap = true
}
this.__emit('drop', dropResult)
+ this.dragNode = null
},
onNodeClick (e, treeNode) {
@@ -455,18 +457,21 @@ const Tree = {
const promise = loadData(treeNode)
promise.then(() => {
const newLoadedKeys = arrAdd(this.$data._loadedKeys, eventKey)
- this.setUncontrolledState({
- _loadedKeys: newLoadedKeys,
- })
- this.setState({
- _loadingKeys: arrDel(this.$data._loadingKeys, eventKey),
- })
+ const newLoadingKeys = arrDel(this.$data._loadingKeys, eventKey)
+
+ // onLoad should trigger before internal setState to avoid `loadData` trigger twice.
+ // https://github.com/ant-design/ant-design/issues/12464
const eventObj = {
event: 'load',
node: treeNode,
}
this.__emit('load', eventObj)
-
+ this.setUncontrolledState({
+ _loadedKeys: newLoadedKeys,
+ })
+ this.setState({
+ _loadingKeys: newLoadingKeys,
+ })
resolve()
})