mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-02 20:18:22 +08:00
Merge branch 'feat-3.10.3' of https://github.com/vueComponent/ant-design into feat-3.10.3
This commit is contained in:
commit
ad47206792
@ -88,19 +88,19 @@ const getOptionProps = (instance) => {
|
||||
return filterProps($props, $options.propsData)
|
||||
}
|
||||
|
||||
const getComponentFromProp = (instance, prop) => {
|
||||
const getComponentFromProp = (instance, prop, options) => {
|
||||
if (instance.$createElement) {
|
||||
const h = instance.$createElement
|
||||
const temp = instance[prop]
|
||||
if (temp !== undefined) {
|
||||
return typeof temp === 'function' ? temp(h) : temp
|
||||
return typeof temp === 'function' ? temp(h, options) : temp
|
||||
}
|
||||
return instance.$slots[prop]
|
||||
return instance.$slots[prop] || (instance.$scopedSlots[prop] && instance.$scopedSlots[prop](options)) || undefined
|
||||
} else {
|
||||
const h = instance.context.$createElement
|
||||
const temp = getPropsData(instance)[prop]
|
||||
if (temp !== undefined) {
|
||||
return typeof temp === 'function' ? temp(h) : temp
|
||||
return typeof temp === 'function' ? temp(h, options) : temp
|
||||
}
|
||||
const slotsProp = []
|
||||
const componentOptions = instance.componentOptions || {};
|
||||
|
@ -26,6 +26,7 @@ export default function connect (mapStateToProps) {
|
||||
},
|
||||
data () {
|
||||
this.store = this.storeContext.store
|
||||
this.preProps = { ...omit(getOptionProps(this), ['__propsSymbol__']) }
|
||||
return {
|
||||
subscribed: finnalMapStateToProps(this.store.getState(), this.$props),
|
||||
}
|
||||
@ -49,10 +50,10 @@ export default function connect (mapStateToProps) {
|
||||
if (!this.unsubscribe) {
|
||||
return
|
||||
}
|
||||
|
||||
const nextState = finnalMapStateToProps(this.store.getState(), this.$props)
|
||||
if (!shallowEqual(this.subscribed, nextState)) {
|
||||
this.subscribed = nextState
|
||||
const props = getOptionProps(this)
|
||||
const nextSubscribed = finnalMapStateToProps(this.store.getState(), props)
|
||||
if (!shallowEqual(this.preProps, props) || !shallowEqual(this.subscribed, nextSubscribed)) {
|
||||
this.subscribed = nextSubscribed
|
||||
}
|
||||
},
|
||||
|
||||
@ -74,8 +75,10 @@ export default function connect (mapStateToProps) {
|
||||
},
|
||||
},
|
||||
render () {
|
||||
this.preProps = { ...this.$props }
|
||||
const { $listeners, $slots = {}, $attrs, $scopedSlots, subscribed, store } = this
|
||||
const props = getOptionProps(this)
|
||||
this.preProps = { ...omit(props, ['__propsSymbol__']) }
|
||||
const wrapProps = {
|
||||
props: {
|
||||
...props,
|
||||
|
@ -520,7 +520,7 @@ exports[`renders ./components/form/demo/validate-other.vue correctly 1`] = `
|
||||
<div class="ant-row ant-form-item">
|
||||
<div class="ant-col-6 ant-form-item-label"><label for="input-number" title="InputNumber" class="">InputNumber</label></div>
|
||||
<div class="ant-col-14 ant-form-item-control-wrapper">
|
||||
<div class="ant-form-item-control has-success"><span class="ant-form-item-children"><div class="ant-input-number" data-__meta="[object Object]" data-__field="[object Object]" id="input-number"><div class="ant-input-number-handler-wrap"><span unselectable="unselectable" role="button" aria-label="Increase Value" class="ant-input-number-handler ant-input-number-handler-up "><span unselectable="unselectable" class="ant-input-number-handler-up-inner"></span></span><span unselectable="unselectable" role="button" aria-label="Decrease Value" class="ant-input-number-handler ant-input-number-handler-down "><span unselectable="unselectable" class="ant-input-number-handler-down-inner"></span></span></div>
|
||||
<div class="ant-form-item-control has-success"><span class="ant-form-item-children"><div class="ant-input-number" data-__meta="[object Object]" data-__field="[object Object]" id="input-number"><div class="ant-input-number-handler-wrap"><span class="ant-input-number-handler ant-input-number-handler-up " unselectable="unselectable" role="button" aria-label="Increase Value"><span unselectable="unselectable" class="ant-input-number-handler-up-inner"></span></span><span class="ant-input-number-handler ant-input-number-handler-down " unselectable="unselectable" role="button" aria-label="Decrease Value"><span unselectable="unselectable" class="ant-input-number-handler-down-inner"></span></span></div>
|
||||
<div role="spinbutton" aria-valuemin="1" aria-valuemax="10" aria-valuenow="3" class="ant-input-number-input-wrap"><input autocomplete="off" max="10" min="1" step="1" class="ant-input-number-input"></div>
|
||||
</div><span class="ant-form-text"> machines</span></span>
|
||||
<!---->
|
||||
@ -565,7 +565,7 @@ exports[`renders ./components/form/demo/validate-other.vue correctly 1`] = `
|
||||
<div class="ant-row ant-form-item">
|
||||
<div class="ant-col-6 ant-form-item-label"><label for="rate" title="Rate" class="">Rate</label></div>
|
||||
<div class="ant-col-14 ant-form-item-control-wrapper">
|
||||
<div class="ant-form-item-control has-success"><span class="ant-form-item-children"><ul tabindex="0" class="ant-rate" data-__meta="[object Object]" data-__field="[object Object]" id="rate"><li class="ant-rate-star ant-rate-star-full"><div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div><div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div></li><li class="ant-rate-star ant-rate-star-full"><div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div><div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div></li><li class="ant-rate-star ant-rate-star-full"><div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div><div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div></li><li class="ant-rate-star ant-rate-star-half ant-rate-star-active"><div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div><div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div></li><li class="ant-rate-star ant-rate-star-zero"><div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div><div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div></li></ul></span>
|
||||
<div class="ant-form-item-control has-success"><span class="ant-form-item-children"><ul tabindex="0" role="radiogroup" class="ant-rate" data-__meta="[object Object]" data-__field="[object Object]" id="rate"><li role="radio" aria-checked="true" aria-posinset="1" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-full"><div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div><div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div></li><li role="radio" aria-checked="true" aria-posinset="2" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-full"><div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div><div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div></li><li role="radio" aria-checked="true" aria-posinset="3" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-full"><div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div><div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div></li><li role="radio" aria-checked="true" aria-posinset="4" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-half ant-rate-star-active"><div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div><div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div></li><li role="radio" aria-checked="false" aria-posinset="5" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-zero"><div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div><div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div></li></ul></span>
|
||||
<!---->
|
||||
</div>
|
||||
</div>
|
||||
@ -708,7 +708,7 @@ exports[`renders ./components/form/demo/validate-static.vue correctly 1`] = `
|
||||
<div class="ant-row ant-form-item">
|
||||
<div class="ant-col-xs-24 ant-col-sm-5 ant-form-item-label"><label title="Success" class="">Success</label></div>
|
||||
<div class="ant-col-xs-24 ant-col-sm-12 ant-form-item-control-wrapper">
|
||||
<div class="ant-form-item-control has-feedback has-success"><span class="ant-form-item-children"><div class="ant-input-number" style="width: 100%;"><div class="ant-input-number-handler-wrap"><span unselectable="unselectable" role="button" aria-label="Increase Value" class="ant-input-number-handler ant-input-number-handler-up "><span unselectable="unselectable" class="ant-input-number-handler-up-inner"></span></span><span unselectable="unselectable" role="button" aria-label="Decrease Value" class="ant-input-number-handler ant-input-number-handler-down "><span unselectable="unselectable" class="ant-input-number-handler-down-inner"></span></span></div>
|
||||
<div class="ant-form-item-control has-feedback has-success"><span class="ant-form-item-children"><div class="ant-input-number" style="width: 100%;"><div class="ant-input-number-handler-wrap"><span class="ant-input-number-handler ant-input-number-handler-up " unselectable="unselectable" role="button" aria-label="Increase Value"><span unselectable="unselectable" class="ant-input-number-handler-up-inner"></span></span><span class="ant-input-number-handler ant-input-number-handler-down " unselectable="unselectable" role="button" aria-label="Decrease Value"><span unselectable="unselectable" class="ant-input-number-handler-down-inner"></span></span></div>
|
||||
<div role="spinbutton" aria-valuemin="-9007199254740991" class="ant-input-number-input-wrap"><input autocomplete="off" min="-9007199254740991" step="1" class="ant-input-number-input"></div>
|
||||
</div></span>
|
||||
<!---->
|
||||
@ -723,7 +723,7 @@ exports[`renders ./components/form/demo/without-form-create.vue correctly 1`] =
|
||||
<div class="ant-row ant-form-item ant-form-item-with-help">
|
||||
<div class="ant-col-7 ant-form-item-label"><label title="Prime between 8 & 12" class="">Prime between 8 & 12</label></div>
|
||||
<div class="ant-col-12 ant-form-item-control-wrapper">
|
||||
<div class="ant-form-item-control"><span class="ant-form-item-children"><div class="ant-input-number"><div class="ant-input-number-handler-wrap"><span unselectable="unselectable" role="button" aria-label="Increase Value" class="ant-input-number-handler ant-input-number-handler-up "><span unselectable="unselectable" class="ant-input-number-handler-up-inner"></span></span><span unselectable="unselectable" role="button" aria-label="Decrease Value" class="ant-input-number-handler ant-input-number-handler-down "><span unselectable="unselectable" class="ant-input-number-handler-down-inner"></span></span></div>
|
||||
<div class="ant-form-item-control"><span class="ant-form-item-children"><div class="ant-input-number"><div class="ant-input-number-handler-wrap"><span class="ant-input-number-handler ant-input-number-handler-up " unselectable="unselectable" role="button" aria-label="Increase Value"><span unselectable="unselectable" class="ant-input-number-handler-up-inner"></span></span><span class="ant-input-number-handler ant-input-number-handler-down " unselectable="unselectable" role="button" aria-label="Decrease Value"><span unselectable="unselectable" class="ant-input-number-handler-down-inner"></span></span></div>
|
||||
<div role="spinbutton" aria-valuemin="8" aria-valuemax="12" aria-valuenow="11" class="ant-input-number-input-wrap"><input autocomplete="off" max="12" min="8" step="1" class="ant-input-number-input"></div>
|
||||
</div></span>
|
||||
<div class="ant-form-explain show-help-enter">A prime is a natural number greater than 1 that has no positive divisors other than 1 and itself.</div>
|
||||
|
@ -3,7 +3,7 @@
|
||||
exports[`renders ./components/input-number/demo/basic.md correctly 1`] = `
|
||||
<div>
|
||||
<div class="ant-input-number">
|
||||
<div class="ant-input-number-handler-wrap"><span unselectable="unselectable" role="button" aria-label="Increase Value" class="ant-input-number-handler ant-input-number-handler-up "><span unselectable="unselectable" class="ant-input-number-handler-up-inner"></span></span><span unselectable="unselectable" role="button" aria-label="Decrease Value" class="ant-input-number-handler ant-input-number-handler-down "><span unselectable="unselectable" class="ant-input-number-handler-down-inner"></span></span></div>
|
||||
<div class="ant-input-number-handler-wrap"><span class="ant-input-number-handler ant-input-number-handler-up " unselectable="unselectable" role="button" aria-label="Increase Value"><span unselectable="unselectable" class="ant-input-number-handler-up-inner"></span></span><span class="ant-input-number-handler ant-input-number-handler-down " unselectable="unselectable" role="button" aria-label="Decrease Value"><span unselectable="unselectable" class="ant-input-number-handler-down-inner"></span></span></div>
|
||||
<div role="spinbutton" aria-valuemin="1" aria-valuemax="10" aria-valuenow="3" class="ant-input-number-input-wrap"><input autocomplete="off" max="10" min="1" step="1" class="ant-input-number-input"></div>
|
||||
</div>
|
||||
当前值:3
|
||||
@ -12,7 +12,7 @@ exports[`renders ./components/input-number/demo/basic.md correctly 1`] = `
|
||||
|
||||
exports[`renders ./components/input-number/demo/digit.md correctly 1`] = `
|
||||
<div class="ant-input-number">
|
||||
<div class="ant-input-number-handler-wrap"><span unselectable="unselectable" role="button" aria-label="Increase Value" class="ant-input-number-handler ant-input-number-handler-up "><span unselectable="unselectable" class="ant-input-number-handler-up-inner"></span></span><span unselectable="unselectable" role="button" aria-label="Decrease Value" class="ant-input-number-handler ant-input-number-handler-down "><span unselectable="unselectable" class="ant-input-number-handler-down-inner"></span></span></div>
|
||||
<div class="ant-input-number-handler-wrap"><span class="ant-input-number-handler ant-input-number-handler-up " unselectable="unselectable" role="button" aria-label="Increase Value"><span unselectable="unselectable" class="ant-input-number-handler-up-inner"></span></span><span class="ant-input-number-handler ant-input-number-handler-down " unselectable="unselectable" role="button" aria-label="Decrease Value"><span unselectable="unselectable" class="ant-input-number-handler-down-inner"></span></span></div>
|
||||
<div role="spinbutton" aria-valuemin="0" aria-valuemax="10" class="ant-input-number-input-wrap"><input autocomplete="off" max="10" min="0" step="0.1" class="ant-input-number-input"></div>
|
||||
</div>
|
||||
`;
|
||||
@ -20,7 +20,7 @@ exports[`renders ./components/input-number/demo/digit.md correctly 1`] = `
|
||||
exports[`renders ./components/input-number/demo/disabled.md correctly 1`] = `
|
||||
<div>
|
||||
<div class="ant-input-number ant-input-number-disabled">
|
||||
<div class="ant-input-number-handler-wrap"><span unselectable="unselectable" role="button" aria-label="Increase Value" aria-disabled="true" class="ant-input-number-handler ant-input-number-handler-up "><span unselectable="unselectable" class="ant-input-number-handler-up-inner"></span></span><span unselectable="unselectable" role="button" aria-label="Decrease Value" aria-disabled="true" class="ant-input-number-handler ant-input-number-handler-down "><span unselectable="unselectable" class="ant-input-number-handler-down-inner"></span></span></div>
|
||||
<div class="ant-input-number-handler-wrap"><span class="ant-input-number-handler ant-input-number-handler-up " unselectable="unselectable" role="button" aria-label="Increase Value" aria-disabled="true"><span unselectable="unselectable" class="ant-input-number-handler-up-inner"></span></span><span class="ant-input-number-handler ant-input-number-handler-down " unselectable="unselectable" role="button" aria-label="Decrease Value" aria-disabled="true"><span unselectable="unselectable" class="ant-input-number-handler-down-inner"></span></span></div>
|
||||
<div role="spinbutton" aria-valuemin="1" aria-valuemax="10" aria-valuenow="3" class="ant-input-number-input-wrap"><input autocomplete="off" disabled="disabled" max="10" min="1" step="1" class="ant-input-number-input"></div>
|
||||
</div>
|
||||
<div style="margin-top: 20px;"><button type="button" class="ant-btn ant-btn-primary"><span>Toggle disabled</span></button></div>
|
||||
@ -30,11 +30,11 @@ exports[`renders ./components/input-number/demo/disabled.md correctly 1`] = `
|
||||
exports[`renders ./components/input-number/demo/formatter.md correctly 1`] = `
|
||||
<div>
|
||||
<div class="ant-input-number">
|
||||
<div class="ant-input-number-handler-wrap"><span unselectable="unselectable" role="button" aria-label="Increase Value" class="ant-input-number-handler ant-input-number-handler-up "><span unselectable="unselectable" class="ant-input-number-handler-up-inner"></span></span><span unselectable="unselectable" role="button" aria-label="Decrease Value" class="ant-input-number-handler ant-input-number-handler-down "><span unselectable="unselectable" class="ant-input-number-handler-down-inner"></span></span></div>
|
||||
<div class="ant-input-number-handler-wrap"><span class="ant-input-number-handler ant-input-number-handler-up " unselectable="unselectable" role="button" aria-label="Increase Value"><span unselectable="unselectable" class="ant-input-number-handler-up-inner"></span></span><span class="ant-input-number-handler ant-input-number-handler-down " unselectable="unselectable" role="button" aria-label="Decrease Value"><span unselectable="unselectable" class="ant-input-number-handler-down-inner"></span></span></div>
|
||||
<div role="spinbutton" aria-valuemin="-9007199254740991" aria-valuenow="1000" class="ant-input-number-input-wrap"><input autocomplete="off" min="-9007199254740991" step="1" class="ant-input-number-input"></div>
|
||||
</div>
|
||||
<div class="ant-input-number">
|
||||
<div class="ant-input-number-handler-wrap"><span unselectable="unselectable" role="button" aria-label="Increase Value" aria-disabled="true" class="ant-input-number-handler ant-input-number-handler-up ant-input-number-handler-up-disabled"><span unselectable="unselectable" class="ant-input-number-handler-up-inner"></span></span><span unselectable="unselectable" role="button" aria-label="Decrease Value" class="ant-input-number-handler ant-input-number-handler-down "><span unselectable="unselectable" class="ant-input-number-handler-down-inner"></span></span></div>
|
||||
<div class="ant-input-number-handler-wrap"><span class="ant-input-number-handler ant-input-number-handler-up ant-input-number-handler-up-disabled" unselectable="unselectable" role="button" aria-label="Increase Value" aria-disabled="true"><span unselectable="unselectable" class="ant-input-number-handler-up-inner"></span></span><span class="ant-input-number-handler ant-input-number-handler-down " unselectable="unselectable" role="button" aria-label="Decrease Value"><span unselectable="unselectable" class="ant-input-number-handler-down-inner"></span></span></div>
|
||||
<div role="spinbutton" aria-valuemin="0" aria-valuemax="100" aria-valuenow="100" class="ant-input-number-input-wrap"><input autocomplete="off" max="100" min="0" step="1" class="ant-input-number-input"></div>
|
||||
</div>
|
||||
</div>
|
||||
@ -43,15 +43,15 @@ exports[`renders ./components/input-number/demo/formatter.md correctly 1`] = `
|
||||
exports[`renders ./components/input-number/demo/size.md correctly 1`] = `
|
||||
<div>
|
||||
<div class="ant-input-number ant-input-number-lg">
|
||||
<div class="ant-input-number-handler-wrap"><span unselectable="unselectable" role="button" aria-label="Increase Value" class="ant-input-number-handler ant-input-number-handler-up "><span unselectable="unselectable" class="ant-input-number-handler-up-inner"></span></span><span unselectable="unselectable" role="button" aria-label="Decrease Value" class="ant-input-number-handler ant-input-number-handler-down "><span unselectable="unselectable" class="ant-input-number-handler-down-inner"></span></span></div>
|
||||
<div class="ant-input-number-handler-wrap"><span class="ant-input-number-handler ant-input-number-handler-up " unselectable="unselectable" role="button" aria-label="Increase Value"><span unselectable="unselectable" class="ant-input-number-handler-up-inner"></span></span><span class="ant-input-number-handler ant-input-number-handler-down " unselectable="unselectable" role="button" aria-label="Decrease Value"><span unselectable="unselectable" class="ant-input-number-handler-down-inner"></span></span></div>
|
||||
<div role="spinbutton" aria-valuemin="1" aria-valuemax="100000" aria-valuenow="3" class="ant-input-number-input-wrap"><input autocomplete="off" max="100000" min="1" step="1" class="ant-input-number-input"></div>
|
||||
</div>
|
||||
<div class="ant-input-number">
|
||||
<div class="ant-input-number-handler-wrap"><span unselectable="unselectable" role="button" aria-label="Increase Value" class="ant-input-number-handler ant-input-number-handler-up "><span unselectable="unselectable" class="ant-input-number-handler-up-inner"></span></span><span unselectable="unselectable" role="button" aria-label="Decrease Value" class="ant-input-number-handler ant-input-number-handler-down "><span unselectable="unselectable" class="ant-input-number-handler-down-inner"></span></span></div>
|
||||
<div class="ant-input-number-handler-wrap"><span class="ant-input-number-handler ant-input-number-handler-up " unselectable="unselectable" role="button" aria-label="Increase Value"><span unselectable="unselectable" class="ant-input-number-handler-up-inner"></span></span><span class="ant-input-number-handler ant-input-number-handler-down " unselectable="unselectable" role="button" aria-label="Decrease Value"><span unselectable="unselectable" class="ant-input-number-handler-down-inner"></span></span></div>
|
||||
<div role="spinbutton" aria-valuemin="1" aria-valuemax="100000" aria-valuenow="3" class="ant-input-number-input-wrap"><input autocomplete="off" max="100000" min="1" step="1" class="ant-input-number-input"></div>
|
||||
</div>
|
||||
<div class="ant-input-number ant-input-number-sm">
|
||||
<div class="ant-input-number-handler-wrap"><span unselectable="unselectable" role="button" aria-label="Increase Value" class="ant-input-number-handler ant-input-number-handler-up "><span unselectable="unselectable" class="ant-input-number-handler-up-inner"></span></span><span unselectable="unselectable" role="button" aria-label="Decrease Value" class="ant-input-number-handler ant-input-number-handler-down "><span unselectable="unselectable" class="ant-input-number-handler-down-inner"></span></span></div>
|
||||
<div class="ant-input-number-handler-wrap"><span class="ant-input-number-handler ant-input-number-handler-up " unselectable="unselectable" role="button" aria-label="Increase Value"><span unselectable="unselectable" class="ant-input-number-handler-up-inner"></span></span><span class="ant-input-number-handler ant-input-number-handler-down " unselectable="unselectable" role="button" aria-label="Decrease Value"><span unselectable="unselectable" class="ant-input-number-handler-down-inner"></span></span></div>
|
||||
<div role="spinbutton" aria-valuemin="1" aria-valuemax="100000" aria-valuenow="3" class="ant-input-number-input-wrap"><input autocomplete="off" max="100000" min="1" step="1" class="ant-input-number-input"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -45,7 +45,7 @@ exports[`renders ./components/layout/demo/custom-trigger.md correctly 1`] = `
|
||||
<div class="ant-layout-sider ant-layout-sider-dark" style="max-width: 200px; min-width: 200px; width: 200px;">
|
||||
<div class="ant-layout-sider-children">
|
||||
<div class="logo"></div>
|
||||
<ul class="ant-menu ant-menu-inline ant-menu-root ant-menu-dark" role="menu">
|
||||
<ul role="menu" class="ant-menu ant-menu-inline ant-menu-root ant-menu-dark">
|
||||
<li role="menuitem" class="ant-menu-item ant-menu-item-selected" style="padding-left: 24px;"><i class="anticon anticon-user"></i> <span>nav 1</span></li>
|
||||
<li role="menuitem" class="ant-menu-item" style="padding-left: 24px;"><i class="anticon anticon-video-camera"></i> <span>nav 2</span></li>
|
||||
<li role="menuitem" class="ant-menu-item" style="padding-left: 24px;"><i class="anticon anticon-upload"></i> <span>nav 3</span></li>
|
||||
@ -65,10 +65,22 @@ exports[`renders ./components/layout/demo/fixed.md correctly 1`] = `
|
||||
<div class="ant-layout" id="components-layout-demo-fixed">
|
||||
<div class="ant-layout-header" style="position: fixed; z-index: 1; width: 100%;">
|
||||
<div class="logo"></div>
|
||||
<ul class="ant-menu ant-menu-horizontal ant-menu-root ant-menu-dark" role="menu" style="line-height: 64px;">
|
||||
<ul role="menu" class="ant-menu ant-menu-horizontal ant-menu-root ant-menu-dark" style="line-height: 64px;">
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="display: none;">
|
||||
<div aria-haspopup="true" class="ant-menu-submenu-title"><i class="ant-menu-submenu-arrow"></i></div>
|
||||
</li>
|
||||
<li role="menuitem" class="ant-menu-item">nav 1</li>
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="display: none;">
|
||||
<div aria-haspopup="true" class="ant-menu-submenu-title"><i class="ant-menu-submenu-arrow"></i></div>
|
||||
</li>
|
||||
<li role="menuitem" class="ant-menu-item ant-menu-item-selected">nav 2</li>
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="display: none;">
|
||||
<div aria-haspopup="true" class="ant-menu-submenu-title"><i class="ant-menu-submenu-arrow"></i></div>
|
||||
</li>
|
||||
<li role="menuitem" class="ant-menu-item">nav 3</li>
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="visibility: hidden; position: absolute; display: none;">
|
||||
<div aria-haspopup="true" class="ant-menu-submenu-title"><i class="ant-menu-submenu-arrow"></i></div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="ant-layout-content" style="padding: 0px 50px; margin-top: 64px;">
|
||||
@ -86,7 +98,7 @@ exports[`renders ./components/layout/demo/fixed-sider.md correctly 1`] = `
|
||||
<div class="ant-layout-sider ant-layout-sider-dark" style="max-width: 200px; min-width: 200px; width: 200px; overflow: auto; height: 100vh; position: fixed; left: 0px;">
|
||||
<div class="ant-layout-sider-children">
|
||||
<div class="logo"></div>
|
||||
<ul class="ant-menu ant-menu-inline ant-menu-root ant-menu-dark" role="menu">
|
||||
<ul role="menu" class="ant-menu ant-menu-inline ant-menu-root ant-menu-dark">
|
||||
<li role="menuitem" class="ant-menu-item" style="padding-left: 24px;"><i class="anticon anticon-user"></i> <span class="nav-text">nav 1</span></li>
|
||||
<li role="menuitem" class="ant-menu-item" style="padding-left: 24px;"><i class="anticon anticon-video-camera"></i> <span class="nav-text">nav 2</span></li>
|
||||
<li role="menuitem" class="ant-menu-item" style="padding-left: 24px;"><i class="anticon anticon-upload"></i> <span class="nav-text">nav 3</span></li>
|
||||
@ -129,7 +141,7 @@ exports[`renders ./components/layout/demo/responsive.md correctly 1`] = `
|
||||
<div class="ant-layout-sider ant-layout-sider-dark" style="max-width: 200px; min-width: 200px; width: 200px;">
|
||||
<div class="ant-layout-sider-children">
|
||||
<div class="logo"></div>
|
||||
<ul class="ant-menu ant-menu-inline ant-menu-root ant-menu-dark" role="menu">
|
||||
<ul role="menu" class="ant-menu ant-menu-inline ant-menu-root ant-menu-dark">
|
||||
<li role="menuitem" class="ant-menu-item" style="padding-left: 24px;"><i class="anticon anticon-user"></i> <span class="nav-text">nav 1</span></li>
|
||||
<li role="menuitem" class="ant-menu-item" style="padding-left: 24px;"><i class="anticon anticon-video-camera"></i> <span class="nav-text">nav 2</span></li>
|
||||
<li role="menuitem" class="ant-menu-item" style="padding-left: 24px;"><i class="anticon anticon-upload"></i> <span class="nav-text">nav 3</span></li>
|
||||
@ -156,7 +168,7 @@ exports[`renders ./components/layout/demo/side.md correctly 1`] = `
|
||||
<div class="ant-layout-sider ant-layout-sider-dark ant-layout-sider-has-trigger" style="max-width: 200px; min-width: 200px; width: 200px;">
|
||||
<div class="ant-layout-sider-children">
|
||||
<div class="logo"></div>
|
||||
<ul class="ant-menu ant-menu-inline ant-menu-root ant-menu-dark" role="menu">
|
||||
<ul role="menu" class="ant-menu ant-menu-inline ant-menu-root ant-menu-dark">
|
||||
<li role="menuitem" class="ant-menu-item ant-menu-item-selected" style="padding-left: 24px;"><i class="anticon anticon-pie-chart"></i> <span>Option 1</span></li>
|
||||
<li role="menuitem" class="ant-menu-item" style="padding-left: 24px;"><i class="anticon anticon-desktop"></i> <span>Option 2</span></li>
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-inline">
|
||||
@ -191,10 +203,22 @@ exports[`renders ./components/layout/demo/top.md correctly 1`] = `
|
||||
<div class="layout ant-layout" id="components-layout-demo-top">
|
||||
<div class="ant-layout-header">
|
||||
<div class="logo"></div>
|
||||
<ul class="ant-menu ant-menu-horizontal ant-menu-root ant-menu-dark" role="menu" style="line-height: 64px;">
|
||||
<ul role="menu" class="ant-menu ant-menu-horizontal ant-menu-root ant-menu-dark" style="line-height: 64px;">
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="display: none;">
|
||||
<div aria-haspopup="true" class="ant-menu-submenu-title"><i class="ant-menu-submenu-arrow"></i></div>
|
||||
</li>
|
||||
<li role="menuitem" class="ant-menu-item">nav 1</li>
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="display: none;">
|
||||
<div aria-haspopup="true" class="ant-menu-submenu-title"><i class="ant-menu-submenu-arrow"></i></div>
|
||||
</li>
|
||||
<li role="menuitem" class="ant-menu-item ant-menu-item-selected">nav 2</li>
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="display: none;">
|
||||
<div aria-haspopup="true" class="ant-menu-submenu-title"><i class="ant-menu-submenu-arrow"></i></div>
|
||||
</li>
|
||||
<li role="menuitem" class="ant-menu-item">nav 3</li>
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="visibility: hidden; position: absolute; display: none;">
|
||||
<div aria-haspopup="true" class="ant-menu-submenu-title"><i class="ant-menu-submenu-arrow"></i></div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="ant-layout-content" style="padding: 0px 50px;">
|
||||
@ -211,10 +235,22 @@ exports[`renders ./components/layout/demo/top-side.md correctly 1`] = `
|
||||
<div class="ant-layout" id="components-layout-demo-top-side">
|
||||
<div class="header ant-layout-header">
|
||||
<div class="logo"></div>
|
||||
<ul class="ant-menu ant-menu-horizontal ant-menu-root ant-menu-dark" role="menu" style="line-height: 64px;">
|
||||
<ul role="menu" class="ant-menu ant-menu-horizontal ant-menu-root ant-menu-dark" style="line-height: 64px;">
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="display: none;">
|
||||
<div aria-haspopup="true" class="ant-menu-submenu-title"><i class="ant-menu-submenu-arrow"></i></div>
|
||||
</li>
|
||||
<li role="menuitem" class="ant-menu-item">nav 1</li>
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="display: none;">
|
||||
<div aria-haspopup="true" class="ant-menu-submenu-title"><i class="ant-menu-submenu-arrow"></i></div>
|
||||
</li>
|
||||
<li role="menuitem" class="ant-menu-item ant-menu-item-selected">nav 2</li>
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="display: none;">
|
||||
<div aria-haspopup="true" class="ant-menu-submenu-title"><i class="ant-menu-submenu-arrow"></i></div>
|
||||
</li>
|
||||
<li role="menuitem" class="ant-menu-item">nav 3</li>
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="visibility: hidden; position: absolute; display: none;">
|
||||
<div aria-haspopup="true" class="ant-menu-submenu-title"><i class="ant-menu-submenu-arrow"></i></div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="ant-layout-content" style="padding: 0px 50px;">
|
||||
@ -222,10 +258,10 @@ exports[`renders ./components/layout/demo/top-side.md correctly 1`] = `
|
||||
<div class="ant-layout" style="padding: 24px 0px; background: rgb(255, 255, 255);">
|
||||
<div class="ant-layout-sider ant-layout-sider-dark" style="max-width: 200px; min-width: 200px; width: 200px; background: rgb(255, 255, 255);">
|
||||
<div class="ant-layout-sider-children">
|
||||
<ul class="ant-menu ant-menu-inline ant-menu-root ant-menu-light" role="menu" style="height: 100%;">
|
||||
<ul role="menu" class="ant-menu ant-menu-inline ant-menu-root ant-menu-light" style="height: 100%;">
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-inline ant-menu-submenu-open ant-menu-submenu-selected">
|
||||
<div aria-expanded="true" aria-owns="sub1$Menu" aria-haspopup="true" class="ant-menu-submenu-title" style="padding-left: 24px;"><span><i class="anticon anticon-user"></i>subnav 1</span><i class="ant-menu-submenu-arrow"></i></div>
|
||||
<ul class="ant-menu ant-menu-inline ant-menu-sub" role="menu">
|
||||
<ul role="menu" class="ant-menu ant-menu-inline ant-menu-sub">
|
||||
<li role="menuitem" class="ant-menu-item ant-menu-item-selected" style="padding-left: 48px;">option1</li>
|
||||
<li role="menuitem" class="ant-menu-item" style="padding-left: 48px;">option2</li>
|
||||
<li role="menuitem" class="ant-menu-item" style="padding-left: 48px;">option3</li>
|
||||
@ -258,19 +294,31 @@ exports[`renders ./components/layout/demo/top-side-2.md correctly 1`] = `
|
||||
<div class="ant-layout" id="components-layout-demo-top-side-2">
|
||||
<div class="header ant-layout-header">
|
||||
<div class="logo"></div>
|
||||
<ul class="ant-menu ant-menu-horizontal ant-menu-root ant-menu-dark" role="menu" style="line-height: 64px;">
|
||||
<ul role="menu" class="ant-menu ant-menu-horizontal ant-menu-root ant-menu-dark" style="line-height: 64px;">
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="display: none;">
|
||||
<div aria-haspopup="true" class="ant-menu-submenu-title"><i class="ant-menu-submenu-arrow"></i></div>
|
||||
</li>
|
||||
<li role="menuitem" class="ant-menu-item">nav 1</li>
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="display: none;">
|
||||
<div aria-haspopup="true" class="ant-menu-submenu-title"><i class="ant-menu-submenu-arrow"></i></div>
|
||||
</li>
|
||||
<li role="menuitem" class="ant-menu-item ant-menu-item-selected">nav 2</li>
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="display: none;">
|
||||
<div aria-haspopup="true" class="ant-menu-submenu-title"><i class="ant-menu-submenu-arrow"></i></div>
|
||||
</li>
|
||||
<li role="menuitem" class="ant-menu-item">nav 3</li>
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="visibility: hidden; position: absolute; display: none;">
|
||||
<div aria-haspopup="true" class="ant-menu-submenu-title"><i class="ant-menu-submenu-arrow"></i></div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="ant-layout">
|
||||
<div class="ant-layout-sider ant-layout-sider-dark" style="max-width: 200px; min-width: 200px; width: 200px; background: rgb(255, 255, 255);">
|
||||
<div class="ant-layout-sider-children">
|
||||
<ul class="ant-menu ant-menu-inline ant-menu-root ant-menu-light" role="menu" style="height: 100%; border-right: 0;">
|
||||
<ul role="menu" class="ant-menu ant-menu-inline ant-menu-root ant-menu-light" style="height: 100%; border-right: 0;">
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-inline ant-menu-submenu-open ant-menu-submenu-selected">
|
||||
<div aria-expanded="true" aria-owns="sub1$Menu" aria-haspopup="true" class="ant-menu-submenu-title" style="padding-left: 24px;"><span><i class="anticon anticon-user"></i>subnav 1</span><i class="ant-menu-submenu-arrow"></i></div>
|
||||
<ul class="ant-menu ant-menu-inline ant-menu-sub" role="menu">
|
||||
<ul role="menu" class="ant-menu ant-menu-inline ant-menu-sub">
|
||||
<li role="menuitem" class="ant-menu-item ant-menu-item-selected" style="padding-left: 48px;">option1</li>
|
||||
<li role="menuitem" class="ant-menu-item" style="padding-left: 48px;">option2</li>
|
||||
<li role="menuitem" class="ant-menu-item" style="padding-left: 48px;">option3</li>
|
||||
|
@ -9748,7 +9748,7 @@ exports[`Locale Provider should display the text as ru 1`] = `
|
||||
<div class="ant-select ant-select-enabled ant-pagination-options-size-changer">
|
||||
<div role="combobox" aria-autocomplete="list" aria-haspopup="true" tabindex="0" class="ant-select-selection ant-select-selection--single">
|
||||
<div class="ant-select-selection__rendered">
|
||||
<div title="10 /странице" class="ant-select-selection-selected-value" style="display: block; opacity: 1;">10 /странице</div>
|
||||
<div title="10 / стр." class="ant-select-selection-selected-value" style="display: block; opacity: 1;">10 / стр.</div>
|
||||
</div><span unselectable="unselectable" class="ant-select-arrow"><b></b></span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -2,25 +2,40 @@
|
||||
|
||||
exports[`renders ./components/menu/demo/horizontal.md correctly 1`] = `
|
||||
<div>
|
||||
<ul class="ant-menu ant-menu-horizontal ant-menu-root ant-menu-light" role="menu">
|
||||
<ul role="menu" class="ant-menu ant-menu-horizontal ant-menu-root ant-menu-light">
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="display: none;">
|
||||
<div aria-haspopup="true" class="ant-menu-submenu-title"><i class="ant-menu-submenu-arrow"></i></div>
|
||||
</li>
|
||||
<li role="menuitem" class="ant-menu-item ant-menu-item-selected"><i class="anticon anticon-mail"></i>Navigation One
|
||||
</li>
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="display: none;">
|
||||
<div aria-haspopup="true" class="ant-menu-submenu-title"><i class="ant-menu-submenu-arrow"></i></div>
|
||||
</li>
|
||||
<li role="menuitem" aria-disabled="true" class="ant-menu-item ant-menu-item-disabled"><i class="anticon anticon-appstore"></i>Navigation Two
|
||||
</li>
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="display: none;">
|
||||
<div aria-haspopup="true" class="ant-menu-submenu-title"><i class="ant-menu-submenu-arrow"></i></div>
|
||||
</li>
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal">
|
||||
<div aria-haspopup="true" class="ant-menu-submenu-title"><span><i class="anticon anticon-setting"></i>Navigation Three - Submenu</span><i class="ant-menu-submenu-arrow"></i></div>
|
||||
</li>
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="display: none;">
|
||||
<div aria-haspopup="true" class="ant-menu-submenu-title"><i class="ant-menu-submenu-arrow"></i></div>
|
||||
</li>
|
||||
<li role="menuitem" class="ant-menu-item"><a href="https://ant.design" target="_blank" rel="noopener noreferrer">Navigation Four - Link</a></li>
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="visibility: hidden; position: absolute; display: none;">
|
||||
<div aria-haspopup="true" class="ant-menu-submenu-title"><i class="ant-menu-submenu-arrow"></i></div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/menu/demo/inline.md correctly 1`] = `
|
||||
<div>
|
||||
<ul class="ant-menu ant-menu-inline ant-menu-root ant-menu-light" role="menu" style="width: 256px;">
|
||||
<ul role="menu" class="ant-menu ant-menu-inline ant-menu-root ant-menu-light" style="width: 256px;">
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-inline ant-menu-submenu-open ant-menu-submenu-selected">
|
||||
<div aria-expanded="true" aria-owns="sub1$Menu" aria-haspopup="true" class="ant-menu-submenu-title" style="padding-left: 24px;"><span><i class="anticon anticon-mail"></i><span>Navigation One</span></span><i class="ant-menu-submenu-arrow"></i></div>
|
||||
<ul class="ant-menu ant-menu-inline ant-menu-sub" role="menu">
|
||||
<ul role="menu" class="ant-menu ant-menu-inline ant-menu-sub">
|
||||
<li class="ant-menu-item-group">
|
||||
<div class="ant-menu-item-group-title"><i class="anticon anticon-qq"></i><span>Item 1</span></div>
|
||||
<ul class="ant-menu-item-group-list">
|
||||
@ -51,13 +66,13 @@ exports[`renders ./components/menu/demo/inline.md correctly 1`] = `
|
||||
|
||||
exports[`renders ./components/menu/demo/inline-collapsed.md correctly 1`] = `
|
||||
<div style="width: 256px;"><button type="button" class="ant-btn ant-btn-primary" style="margin-bottom: 16px;"><i class="anticon anticon-menu-fold"></i></button>
|
||||
<ul class="ant-menu ant-menu-inline ant-menu-root ant-menu-dark" role="menu">
|
||||
<ul role="menu" class="ant-menu ant-menu-inline ant-menu-root ant-menu-dark">
|
||||
<li role="menuitem" class="ant-menu-item ant-menu-item-selected" style="padding-left: 24px;"><i class="anticon anticon-pie-chart"></i> <span>Option 1</span></li>
|
||||
<li role="menuitem" class="ant-menu-item" style="padding-left: 24px;"><i class="anticon anticon-desktop"></i> <span>Option 2</span></li>
|
||||
<li role="menuitem" class="ant-menu-item" style="padding-left: 24px;"><i class="anticon anticon-inbox"></i> <span>Option 3</span></li>
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-inline ant-menu-submenu-open">
|
||||
<div aria-expanded="true" aria-owns="sub1$Menu" aria-haspopup="true" class="ant-menu-submenu-title" style="padding-left: 24px;"><span><i class="anticon anticon-mail"></i><span>Navigation One</span></span><i class="ant-menu-submenu-arrow"></i></div>
|
||||
<ul class="ant-menu ant-menu-inline ant-menu-sub" role="menu">
|
||||
<ul role="menu" class="ant-menu ant-menu-inline ant-menu-sub">
|
||||
<li role="menuitem" class="ant-menu-item" style="padding-left: 48px;">Option 5</li>
|
||||
<li role="menuitem" class="ant-menu-item" style="padding-left: 48px;">Option 6</li>
|
||||
<li role="menuitem" class="ant-menu-item" style="padding-left: 48px;">Option 7</li>
|
||||
@ -74,10 +89,10 @@ exports[`renders ./components/menu/demo/inline-collapsed.md correctly 1`] = `
|
||||
|
||||
exports[`renders ./components/menu/demo/sider-current.md correctly 1`] = `
|
||||
<div>
|
||||
<ul class="ant-menu ant-menu-inline ant-menu-root ant-menu-light" role="menu" style="width: 256px;">
|
||||
<ul role="menu" class="ant-menu ant-menu-inline ant-menu-root ant-menu-light" style="width: 256px;">
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-inline ant-menu-submenu-open">
|
||||
<div aria-expanded="true" aria-owns="sub1$Menu" aria-haspopup="true" class="ant-menu-submenu-title" style="padding-left: 24px;"><span><i class="anticon anticon-mail"></i><span>Navigation One</span></span><i class="ant-menu-submenu-arrow"></i></div>
|
||||
<ul class="ant-menu ant-menu-inline ant-menu-sub" role="menu">
|
||||
<ul role="menu" class="ant-menu ant-menu-inline ant-menu-sub">
|
||||
<li role="menuitem" class="ant-menu-item" style="padding-left: 48px;">Option 1</li>
|
||||
<li role="menuitem" class="ant-menu-item" style="padding-left: 48px;">Option 2</li>
|
||||
<li role="menuitem" class="ant-menu-item" style="padding-left: 48px;">Option 3</li>
|
||||
@ -100,7 +115,7 @@ exports[`renders ./components/menu/demo/switch-mode.md correctly 1`] = `
|
||||
<div><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input" value=""><span class="ant-checkbox-inner"></span></span></label> Change Mode
|
||||
<span classname="ant-divider" style="margin: 0px 1em;"></span> <label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input" value=""><span class="ant-checkbox-inner"></span></span></label> Change Theme
|
||||
<br> <br>
|
||||
<ul class="ant-menu ant-menu-inline ant-menu-root ant-menu-light" role="menu" style="width: 256px;">
|
||||
<ul role="menu" class="ant-menu ant-menu-inline ant-menu-root ant-menu-light" style="width: 256px;">
|
||||
<li role="menuitem" class="ant-menu-item ant-menu-item-selected" style="padding-left: 24px;"><i class="anticon anticon-mail"></i>
|
||||
Navigation One
|
||||
</li>
|
||||
@ -109,7 +124,7 @@ exports[`renders ./components/menu/demo/switch-mode.md correctly 1`] = `
|
||||
</li>
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-inline ant-menu-submenu-open">
|
||||
<div aria-expanded="true" aria-owns="sub1$Menu" aria-haspopup="true" class="ant-menu-submenu-title" style="padding-left: 24px;"><span><i class="anticon anticon-appstore"></i><span>Navigation Three</span></span><i class="ant-menu-submenu-arrow"></i></div>
|
||||
<ul class="ant-menu ant-menu-inline ant-menu-sub" role="menu">
|
||||
<ul role="menu" class="ant-menu ant-menu-inline ant-menu-sub">
|
||||
<li role="menuitem" class="ant-menu-item" style="padding-left: 48px;">Option 3</li>
|
||||
<li role="menuitem" class="ant-menu-item" style="padding-left: 48px;">Option 4</li>
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-inline">
|
||||
@ -128,7 +143,7 @@ exports[`renders ./components/menu/demo/switch-mode.md correctly 1`] = `
|
||||
|
||||
exports[`renders ./components/menu/demo/template.md correctly 1`] = `
|
||||
<div style="width: 256px;"><button type="button" class="ant-btn ant-btn-primary" style="margin-bottom: 16px;"><i class="anticon anticon-menu-fold"></i></button>
|
||||
<ul class="ant-menu ant-menu-inline ant-menu-root ant-menu-dark" role="menu">
|
||||
<ul role="menu" class="ant-menu ant-menu-inline ant-menu-root ant-menu-dark">
|
||||
<li role="menuitem" class="ant-menu-item ant-menu-item-selected" style="padding-left: 24px;"><i class="anticon anticon-pie-chart"></i> <span>Option 1</span></li>
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-inline" menuinfo="[object Object]">
|
||||
<div aria-haspopup="true" class="ant-menu-submenu-title" style="padding-left: 24px;"><span><i class="anticon anticon-mail"></i><span>Navigation 2</span></span><i class="ant-menu-submenu-arrow"></i></div>
|
||||
@ -141,7 +156,7 @@ exports[`renders ./components/menu/demo/template.md correctly 1`] = `
|
||||
exports[`renders ./components/menu/demo/theme.md correctly 1`] = `
|
||||
<div><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input" value=""><span class="ant-checkbox-inner"></span></span></label> Change Theme
|
||||
<br> <br>
|
||||
<ul class="ant-menu ant-menu-inline ant-menu-root ant-menu-dark" role="menu" style="width: 256px;">
|
||||
<ul role="menu" class="ant-menu ant-menu-inline ant-menu-root ant-menu-dark" style="width: 256px;">
|
||||
<li role="menuitem" class="ant-menu-item ant-menu-item-selected" style="padding-left: 24px;"><i class="anticon anticon-mail"></i>
|
||||
Navigation One
|
||||
</li>
|
||||
@ -150,7 +165,7 @@ exports[`renders ./components/menu/demo/theme.md correctly 1`] = `
|
||||
</li>
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-inline ant-menu-submenu-open">
|
||||
<div aria-expanded="true" aria-owns="sub1$Menu" aria-haspopup="true" class="ant-menu-submenu-title" style="padding-left: 24px;"><span><i class="anticon anticon-appstore"></i><span>Navigation Three</span></span><i class="ant-menu-submenu-arrow"></i></div>
|
||||
<ul class="ant-menu ant-menu-inline ant-menu-sub" role="menu">
|
||||
<ul role="menu" class="ant-menu ant-menu-inline ant-menu-sub">
|
||||
<li role="menuitem" class="ant-menu-item" style="padding-left: 48px;">Option 3</li>
|
||||
<li role="menuitem" class="ant-menu-item" style="padding-left: 48px;">Option 4</li>
|
||||
<li role="menuitem" class="ant-menu-submenu ant-menu-submenu-inline">
|
||||
@ -169,7 +184,7 @@ exports[`renders ./components/menu/demo/theme.md correctly 1`] = `
|
||||
|
||||
exports[`renders ./components/menu/demo/vertical.md correctly 1`] = `
|
||||
<div>
|
||||
<ul class="ant-menu ant-menu-vertical ant-menu-root ant-menu-light" role="menu" style="width: 256px;">
|
||||
<ul role="menu" class="ant-menu ant-menu-vertical ant-menu-root ant-menu-light" style="width: 256px;">
|
||||
<li role="menuitem" class="ant-menu-item"><i class="anticon anticon-mail"></i>
|
||||
Navigation One
|
||||
</li>
|
||||
|
@ -13,9 +13,9 @@ describe('Menu', () => {
|
||||
// jest.useFakeTimers()
|
||||
})
|
||||
|
||||
// afterEach(() => {
|
||||
// jest.useRealTimers()
|
||||
// })
|
||||
afterEach(() => {
|
||||
// jest.useRealTimers()
|
||||
})
|
||||
it('If has select nested submenu item ,the menu items on the grandfather level should be highlight', async () => {
|
||||
const wrapper = mount({
|
||||
render () {
|
||||
@ -123,12 +123,12 @@ describe('Menu', () => {
|
||||
wrapper.setProps({ openKeys: [] })
|
||||
await asyncExpect(() => {
|
||||
expect($$('.ant-menu-sub')[0].parentElement.style.display).toBe('none')
|
||||
})
|
||||
}, 0)
|
||||
|
||||
wrapper.setProps({ openKeys: ['1'] })
|
||||
await asyncExpect(() => {
|
||||
expect($$('.ant-menu-sub')[0].parentElement.style.display).not.toBe('none')
|
||||
})
|
||||
}, 0)
|
||||
})
|
||||
|
||||
it('inline', async () => {
|
||||
@ -159,11 +159,11 @@ describe('Menu', () => {
|
||||
wrapper.setProps({ openKeys: [] })
|
||||
await asyncExpect(() => {
|
||||
expect($$('.ant-menu-sub')[0].style.display).toBe('none')
|
||||
})
|
||||
}, 0)
|
||||
wrapper.setProps({ openKeys: ['1'] })
|
||||
await asyncExpect(() => {
|
||||
expect($$('.ant-menu-sub')[0].style.display).not.toBe('none')
|
||||
})
|
||||
}, 0)
|
||||
})
|
||||
|
||||
it('vertical', async () => {
|
||||
@ -194,11 +194,11 @@ describe('Menu', () => {
|
||||
wrapper.setProps({ openKeys: [] })
|
||||
await asyncExpect(() => {
|
||||
expect($$('.ant-menu-sub')[0].parentElement.style.display).toBe('none')
|
||||
})
|
||||
}, 0)
|
||||
wrapper.setProps({ openKeys: ['1'] })
|
||||
await asyncExpect(() => {
|
||||
expect($$('.ant-menu-sub')[0].parentElement.style.display).not.toBe('none')
|
||||
})
|
||||
}, 0)
|
||||
})
|
||||
|
||||
// https://github.com/ant-design/ant-design/pulls/4677
|
||||
@ -375,15 +375,15 @@ describe('Menu', () => {
|
||||
await asyncExpect(() => {
|
||||
expect($$('.ant-menu-sub').length).toBe(0)
|
||||
toggleMenu(wrapper, 0, 'click')
|
||||
})
|
||||
}, 0)
|
||||
await asyncExpect(() => {
|
||||
expect($$('.ant-menu-sub').length).toBe(1)
|
||||
expect($$('.ant-menu-sub')[0].style.display).not.toBe('none')
|
||||
toggleMenu(wrapper, 0, 'click')
|
||||
})
|
||||
}, 500)
|
||||
await asyncExpect(() => {
|
||||
expect($$('.ant-menu-sub')[0].style.display).toBe('none')
|
||||
})
|
||||
}, 500)
|
||||
})
|
||||
|
||||
it('vertical', async () => {
|
||||
@ -403,7 +403,7 @@ describe('Menu', () => {
|
||||
await asyncExpect(() => {
|
||||
expect($$('.ant-menu-sub').length).toBe(0)
|
||||
toggleMenu(wrapper, 0, 'mouseenter')
|
||||
})
|
||||
}, 0)
|
||||
await asyncExpect(() => {
|
||||
expect($$('.ant-menu-sub').length).toBe(1)
|
||||
expect($$('.ant-menu-sub')[0].parentElement.style.display).not.toBe('none')
|
||||
@ -430,12 +430,12 @@ describe('Menu', () => {
|
||||
}, { attachToDocument: true, sync: false })
|
||||
await asyncExpect(() => {
|
||||
expect($$('.ant-menu-sub').length).toBe(0)
|
||||
toggleMenu(wrapper, 0, 'mouseenter')
|
||||
})
|
||||
toggleMenu(wrapper, 1, 'mouseenter')
|
||||
}, 0)
|
||||
await asyncExpect(() => {
|
||||
expect($$('.ant-menu-sub').length).toBe(1)
|
||||
expect($$('.ant-menu-sub')[0].parentElement.style.display).not.toBe('none')
|
||||
toggleMenu(wrapper, 0, 'mouseleave')
|
||||
toggleMenu(wrapper, 1, 'mouseleave')
|
||||
}, 500)
|
||||
await asyncExpect(() => {
|
||||
expect($$('.ant-menu-sub')[0].parentElement.style.display).toBe('none')
|
||||
|
@ -1,6 +1,7 @@
|
||||
<script>
|
||||
import Horizontal from './horizontal'
|
||||
import InlineCollapsed from './inline-collapsed'
|
||||
import Inline from './inline'
|
||||
import SiderCurrent from './sider-current'
|
||||
import SwitchMode from './switch-mode'
|
||||
import Theme from './theme'
|
||||
@ -32,6 +33,7 @@ export default {
|
||||
<md cn={md.cn} us={md.us}/>
|
||||
<Horizontal />
|
||||
<InlineCollapsed />
|
||||
<Inline />
|
||||
<SiderCurrent />
|
||||
<SwitchMode />
|
||||
<Theme />
|
||||
|
@ -3,7 +3,7 @@
|
||||
exports[`Popconfirm should show overlay when trigger is clicked 1`] = `
|
||||
<div class="ant-popover-content">
|
||||
<div class="ant-popover-arrow"></div>
|
||||
<div class="ant-popover-inner">
|
||||
<div role="tooltip" class="ant-popover-inner">
|
||||
<div class="ant-popover-inner-content">
|
||||
<div class="ant-popover-message"><i class="anticon anticon-exclamation-circle"></i>
|
||||
<div class="ant-popover-message-title">code</div>
|
||||
|
@ -3,7 +3,7 @@
|
||||
exports[`Popover should show overlay when trigger is clicked 1`] = `
|
||||
<div class="ant-popover-content">
|
||||
<div class="ant-popover-arrow"></div>
|
||||
<div class="ant-popover-inner">
|
||||
<div role="tooltip" class="ant-popover-inner">
|
||||
<div>
|
||||
<div class="ant-popover-title">code</div>
|
||||
<div class="ant-popover-inner-content">console.log('hello world')</div>
|
||||
@ -15,7 +15,7 @@ exports[`Popover should show overlay when trigger is clicked 1`] = `
|
||||
exports[`Popover should show overlay when trigger is clicked 2`] = `
|
||||
<div class="ant-popover-content">
|
||||
<div class="ant-popover-arrow"></div>
|
||||
<div class="ant-popover-inner">
|
||||
<div role="tooltip" class="ant-popover-inner">
|
||||
<div>
|
||||
<div class="ant-popover-title">code</div>
|
||||
<div class="ant-popover-inner-content">console.log('hello world')</div>
|
||||
|
@ -6,30 +6,30 @@ exports[`renders ./components/progress/demo/circle.md correctly 1`] = `
|
||||
<div class="ant-progress-inner" style="width: 120px; height: 120px; font-size: 24px;"><svg viewBox="0 0 100 100" class="ant-progress-circle">
|
||||
<path d="M 50,50 m 0,-47
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94" stroke="#f3f3f3" stroke-width="6" fill-opacity="0" class="ant-progress-circle-trail" style="stroke-dasharray: 295.3097094374406px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
a 47,47 0 1 1 0,-94" stroke="#f3f3f3" stroke-width="6" fill-opacity="0" class="ant-progress-circle-trail" style="stroke: #108ee9; stroke-dasharray: 295.3097094374406px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
<path d="M 50,50 m 0,-47
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94" stroke-linecap="round" stroke="#108ee9" stroke-width="6" fill-opacity="0" class="ant-progress-circle-path" style="stroke-dasharray: 221.48228207808043px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
a 47,47 0 1 1 0,-94" stroke-linecap="round" stroke-width="6" fill-opacity="0" class="ant-progress-circle-path" style="stroke-dasharray: 221.48228207808043px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
</svg><span class="ant-progress-text">75%</span></div>
|
||||
</div>
|
||||
<div class="ant-progress ant-progress-circle ant-progress-status-exception ant-progress-show-info ant-progress-default">
|
||||
<div class="ant-progress-inner" style="width: 120px; height: 120px; font-size: 24px;"><svg viewBox="0 0 100 100" class="ant-progress-circle">
|
||||
<path d="M 50,50 m 0,-47
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94" stroke="#f3f3f3" stroke-width="6" fill-opacity="0" class="ant-progress-circle-trail" style="stroke-dasharray: 295.3097094374406px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
a 47,47 0 1 1 0,-94" stroke="#f3f3f3" stroke-width="6" fill-opacity="0" class="ant-progress-circle-trail" style="stroke: #ff5500; stroke-dasharray: 295.3097094374406px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
<path d="M 50,50 m 0,-47
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94" stroke-linecap="round" stroke="#ff5500" stroke-width="6" fill-opacity="0" class="ant-progress-circle-path" style="stroke-dasharray: 206.7167966062084px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
a 47,47 0 1 1 0,-94" stroke-linecap="round" stroke-width="6" fill-opacity="0" class="ant-progress-circle-path" style="stroke-dasharray: 206.7167966062084px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
</svg><span class="ant-progress-text"><i class="anticon anticon-cross"></i></span></div>
|
||||
</div>
|
||||
<div class="ant-progress ant-progress-circle ant-progress-status-success ant-progress-show-info ant-progress-default">
|
||||
<div class="ant-progress-inner" style="width: 120px; height: 120px; font-size: 24px;"><svg viewBox="0 0 100 100" class="ant-progress-circle">
|
||||
<path d="M 50,50 m 0,-47
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94" stroke="#f3f3f3" stroke-width="6" fill-opacity="0" class="ant-progress-circle-trail" style="stroke-dasharray: 295.3097094374406px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
a 47,47 0 1 1 0,-94" stroke="#f3f3f3" stroke-width="6" fill-opacity="0" class="ant-progress-circle-trail" style="stroke: #87d068; stroke-dasharray: 295.3097094374406px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
<path d="M 50,50 m 0,-47
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94" stroke-linecap="round" stroke="#87d068" stroke-width="6" fill-opacity="0" class="ant-progress-circle-path" style="stroke-dasharray: 295.3097094374406px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
a 47,47 0 1 1 0,-94" stroke-linecap="round" stroke-width="6" fill-opacity="0" class="ant-progress-circle-path" style="stroke-dasharray: 295.3097094374406px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
</svg><span class="ant-progress-text"><i class="anticon anticon-check"></i></span></div>
|
||||
</div>
|
||||
</div>
|
||||
@ -41,7 +41,7 @@ exports[`renders ./components/progress/demo/circle-dynamic.md correctly 1`] = `
|
||||
<div class="ant-progress-inner" style="width: 120px; height: 120px; font-size: 24px;"><svg viewBox="0 0 100 100" class="ant-progress-circle">
|
||||
<path d="M 50,50 m 0,-47
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94" stroke="#f3f3f3" stroke-width="6" fill-opacity="0" class="ant-progress-circle-trail" style="stroke-dasharray: 295.3097094374406px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
a 47,47 0 1 1 0,-94" stroke="#f3f3f3" stroke-width="6" fill-opacity="0" class="ant-progress-circle-trail" style="stroke: #108ee9; stroke-dasharray: 295.3097094374406px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
</svg><span class="ant-progress-text">0%</span></div>
|
||||
</div>
|
||||
<div class="ant-btn-group"><button type="button" class="ant-btn ant-btn-default"><i class="anticon anticon-minus"></i></button><button type="button" class="ant-btn ant-btn-default"><i class="anticon anticon-plus"></i></button></div>
|
||||
@ -54,30 +54,30 @@ exports[`renders ./components/progress/demo/circle-mini.md correctly 1`] = `
|
||||
<div class="ant-progress-inner" style="width: 80px; height: 80px; font-size: 18px;"><svg viewBox="0 0 100 100" class="ant-progress-circle">
|
||||
<path d="M 50,50 m 0,-47
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94" stroke="#f3f3f3" stroke-width="6" fill-opacity="0" class="ant-progress-circle-trail" style="stroke-dasharray: 295.3097094374406px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
a 47,47 0 1 1 0,-94" stroke="#f3f3f3" stroke-width="6" fill-opacity="0" class="ant-progress-circle-trail" style="stroke: #108ee9; stroke-dasharray: 295.3097094374406px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
<path d="M 50,50 m 0,-47
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94" stroke-linecap="round" stroke="#108ee9" stroke-width="6" fill-opacity="0" class="ant-progress-circle-path" style="stroke-dasharray: 88.59291283123217px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
a 47,47 0 1 1 0,-94" stroke-linecap="round" stroke-width="6" fill-opacity="0" class="ant-progress-circle-path" style="stroke-dasharray: 88.59291283123217px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
</svg><span class="ant-progress-text">30%</span></div>
|
||||
</div>
|
||||
<div class="ant-progress ant-progress-circle ant-progress-status-exception ant-progress-show-info ant-progress-default">
|
||||
<div class="ant-progress-inner" style="width: 80px; height: 80px; font-size: 18px;"><svg viewBox="0 0 100 100" class="ant-progress-circle">
|
||||
<path d="M 50,50 m 0,-47
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94" stroke="#f3f3f3" stroke-width="6" fill-opacity="0" class="ant-progress-circle-trail" style="stroke-dasharray: 295.3097094374406px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
a 47,47 0 1 1 0,-94" stroke="#f3f3f3" stroke-width="6" fill-opacity="0" class="ant-progress-circle-trail" style="stroke: #ff5500; stroke-dasharray: 295.3097094374406px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
<path d="M 50,50 m 0,-47
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94" stroke-linecap="round" stroke="#ff5500" stroke-width="6" fill-opacity="0" class="ant-progress-circle-path" style="stroke-dasharray: 206.7167966062084px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
a 47,47 0 1 1 0,-94" stroke-linecap="round" stroke-width="6" fill-opacity="0" class="ant-progress-circle-path" style="stroke-dasharray: 206.7167966062084px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
</svg><span class="ant-progress-text"><i class="anticon anticon-cross"></i></span></div>
|
||||
</div>
|
||||
<div class="ant-progress ant-progress-circle ant-progress-status-success ant-progress-show-info ant-progress-default">
|
||||
<div class="ant-progress-inner" style="width: 80px; height: 80px; font-size: 18px;"><svg viewBox="0 0 100 100" class="ant-progress-circle">
|
||||
<path d="M 50,50 m 0,-47
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94" stroke="#f3f3f3" stroke-width="6" fill-opacity="0" class="ant-progress-circle-trail" style="stroke-dasharray: 295.3097094374406px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
a 47,47 0 1 1 0,-94" stroke="#f3f3f3" stroke-width="6" fill-opacity="0" class="ant-progress-circle-trail" style="stroke: #87d068; stroke-dasharray: 295.3097094374406px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
<path d="M 50,50 m 0,-47
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94" stroke-linecap="round" stroke="#87d068" stroke-width="6" fill-opacity="0" class="ant-progress-circle-path" style="stroke-dasharray: 295.3097094374406px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
a 47,47 0 1 1 0,-94" stroke-linecap="round" stroke-width="6" fill-opacity="0" class="ant-progress-circle-path" style="stroke-dasharray: 295.3097094374406px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
</svg><span class="ant-progress-text"><i class="anticon anticon-check"></i></span></div>
|
||||
</div>
|
||||
</div>
|
||||
@ -89,10 +89,10 @@ exports[`renders ./components/progress/demo/dashboard.md correctly 1`] = `
|
||||
<div class="ant-progress-inner" style="width: 120px; height: 120px; font-size: 24px;"><svg viewBox="0 0 100 100" class="ant-progress-circle">
|
||||
<path d="M 50,50 m 0,47
|
||||
a 47,47 0 1 1 0,-94
|
||||
a 47,47 0 1 1 0,94" stroke="#f3f3f3" stroke-width="6" fill-opacity="0" class="ant-progress-circle-trail" style="stroke-dasharray: 220.30970943744057px 295.3097094374406px; stroke-dashoffset: -37.5px;"></path>
|
||||
a 47,47 0 1 1 0,94" stroke="#f3f3f3" stroke-width="6" fill-opacity="0" class="ant-progress-circle-trail" style="stroke: #108ee9; stroke-dasharray: 220.30970943744057px 295.3097094374406px; stroke-dashoffset: -37.5px;"></path>
|
||||
<path d="M 50,50 m 0,47
|
||||
a 47,47 0 1 1 0,-94
|
||||
a 47,47 0 1 1 0,94" stroke-linecap="round" stroke="#108ee9" stroke-width="6" fill-opacity="0" class="ant-progress-circle-path" style="stroke-dasharray: 165.23228207808043px 295.3097094374406px; stroke-dashoffset: -37.5px;"></path>
|
||||
a 47,47 0 1 1 0,94" stroke-linecap="round" stroke-width="6" fill-opacity="0" class="ant-progress-circle-path" style="stroke-dasharray: 165.23228207808043px 295.3097094374406px; stroke-dashoffset: -37.5px;"></path>
|
||||
</svg><span class="ant-progress-text">75%</span></div>
|
||||
</div>
|
||||
</div>
|
||||
@ -119,20 +119,20 @@ exports[`renders ./components/progress/demo/format.md correctly 1`] = `
|
||||
<div class="ant-progress-inner" style="width: 120px; height: 120px; font-size: 24px;"><svg viewBox="0 0 100 100" class="ant-progress-circle">
|
||||
<path d="M 50,50 m 0,-47
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94" stroke="#f3f3f3" stroke-width="6" fill-opacity="0" class="ant-progress-circle-trail" style="stroke-dasharray: 295.3097094374406px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
a 47,47 0 1 1 0,-94" stroke="#f3f3f3" stroke-width="6" fill-opacity="0" class="ant-progress-circle-trail" style="stroke: #108ee9; stroke-dasharray: 295.3097094374406px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
<path d="M 50,50 m 0,-47
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94" stroke-linecap="round" stroke="#108ee9" stroke-width="6" fill-opacity="0" class="ant-progress-circle-path" style="stroke-dasharray: 221.48228207808043px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
a 47,47 0 1 1 0,-94" stroke-linecap="round" stroke-width="6" fill-opacity="0" class="ant-progress-circle-path" style="stroke-dasharray: 221.48228207808043px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
</svg><span class="ant-progress-text">75 Days</span></div>
|
||||
</div>
|
||||
<div class="ant-progress ant-progress-circle ant-progress-status-success ant-progress-show-info ant-progress-default">
|
||||
<div class="ant-progress-inner" style="width: 120px; height: 120px; font-size: 24px;"><svg viewBox="0 0 100 100" class="ant-progress-circle">
|
||||
<path d="M 50,50 m 0,-47
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94" stroke="#f3f3f3" stroke-width="6" fill-opacity="0" class="ant-progress-circle-trail" style="stroke-dasharray: 295.3097094374406px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
a 47,47 0 1 1 0,-94" stroke="#f3f3f3" stroke-width="6" fill-opacity="0" class="ant-progress-circle-trail" style="stroke: #87d068; stroke-dasharray: 295.3097094374406px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
<path d="M 50,50 m 0,-47
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94" stroke-linecap="round" stroke="#87d068" stroke-width="6" fill-opacity="0" class="ant-progress-circle-path" style="stroke-dasharray: 295.3097094374406px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
a 47,47 0 1 1 0,-94" stroke-linecap="round" stroke-width="6" fill-opacity="0" class="ant-progress-circle-path" style="stroke-dasharray: 295.3097094374406px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
</svg><span class="ant-progress-text">Done</span></div>
|
||||
</div>
|
||||
</div>
|
||||
@ -244,20 +244,20 @@ exports[`renders ./components/progress/demo/linecap.md correctly 1`] = `
|
||||
<div class="ant-progress-inner" style="width: 120px; height: 120px; font-size: 24px;"><svg viewBox="0 0 100 100" class="ant-progress-circle">
|
||||
<path d="M 50,50 m 0,-47
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94" stroke="#f3f3f3" stroke-width="6" fill-opacity="0" class="ant-progress-circle-trail" style="stroke-dasharray: 295.3097094374406px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
a 47,47 0 1 1 0,-94" stroke="#f3f3f3" stroke-width="6" fill-opacity="0" class="ant-progress-circle-trail" style="stroke: #108ee9; stroke-dasharray: 295.3097094374406px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
<path d="M 50,50 m 0,-47
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94" stroke-linecap="square" stroke="#108ee9" stroke-width="6" fill-opacity="0" class="ant-progress-circle-path" style="stroke-dasharray: 221.48228207808043px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
a 47,47 0 1 1 0,-94" stroke-linecap="square" stroke-width="6" fill-opacity="0" class="ant-progress-circle-path" style="stroke-dasharray: 221.48228207808043px 295.3097094374406px; stroke-dashoffset: -0px;"></path>
|
||||
</svg><span class="ant-progress-text">75%</span></div>
|
||||
</div>
|
||||
<div class="ant-progress ant-progress-circle ant-progress-status-normal ant-progress-show-info ant-progress-default">
|
||||
<div class="ant-progress-inner" style="width: 120px; height: 120px; font-size: 24px;"><svg viewBox="0 0 100 100" class="ant-progress-circle">
|
||||
<path d="M 50,50 m 0,47
|
||||
a 47,47 0 1 1 0,-94
|
||||
a 47,47 0 1 1 0,94" stroke="#f3f3f3" stroke-width="6" fill-opacity="0" class="ant-progress-circle-trail" style="stroke-dasharray: 220.30970943744057px 295.3097094374406px; stroke-dashoffset: -37.5px;"></path>
|
||||
a 47,47 0 1 1 0,94" stroke="#f3f3f3" stroke-width="6" fill-opacity="0" class="ant-progress-circle-trail" style="stroke: #108ee9; stroke-dasharray: 220.30970943744057px 295.3097094374406px; stroke-dashoffset: -37.5px;"></path>
|
||||
<path d="M 50,50 m 0,47
|
||||
a 47,47 0 1 1 0,-94
|
||||
a 47,47 0 1 1 0,94" stroke-linecap="square" stroke="#108ee9" stroke-width="6" fill-opacity="0" class="ant-progress-circle-path" style="stroke-dasharray: 165.23228207808043px 295.3097094374406px; stroke-dashoffset: -37.5px;"></path>
|
||||
a 47,47 0 1 1 0,94" stroke-linecap="square" stroke-width="6" fill-opacity="0" class="ant-progress-circle-path" style="stroke-dasharray: 165.23228207808043px 295.3097094374406px; stroke-dashoffset: -37.5px;"></path>
|
||||
</svg><span class="ant-progress-text">75%</span></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,24 +1,24 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`renders ./components/rate/demo/basic.md correctly 1`] = `
|
||||
<ul tabindex="0" class="ant-rate">
|
||||
<li class="ant-rate-star ant-rate-star-full">
|
||||
<ul tabindex="0" role="radiogroup" class="ant-rate">
|
||||
<li role="radio" aria-checked="true" aria-posinset="1" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-full">
|
||||
<div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div>
|
||||
<div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div>
|
||||
</li>
|
||||
<li class="ant-rate-star ant-rate-star-full">
|
||||
<li role="radio" aria-checked="true" aria-posinset="2" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-full">
|
||||
<div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div>
|
||||
<div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div>
|
||||
</li>
|
||||
<li class="ant-rate-star ant-rate-star-zero">
|
||||
<li role="radio" aria-checked="false" aria-posinset="3" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-zero">
|
||||
<div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div>
|
||||
<div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div>
|
||||
</li>
|
||||
<li class="ant-rate-star ant-rate-star-zero">
|
||||
<li role="radio" aria-checked="false" aria-posinset="4" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-zero">
|
||||
<div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div>
|
||||
<div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div>
|
||||
</li>
|
||||
<li class="ant-rate-star ant-rate-star-zero">
|
||||
<li role="radio" aria-checked="false" aria-posinset="5" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-zero">
|
||||
<div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div>
|
||||
<div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div>
|
||||
</li>
|
||||
@ -27,68 +27,68 @@ exports[`renders ./components/rate/demo/basic.md correctly 1`] = `
|
||||
|
||||
exports[`renders ./components/rate/demo/character.md correctly 1`] = `
|
||||
<div>
|
||||
<ul tabindex="0" class="ant-rate">
|
||||
<li class="ant-rate-star ant-rate-star-zero">
|
||||
<ul tabindex="0" role="radiogroup" class="ant-rate">
|
||||
<li role="radio" aria-checked="false" aria-posinset="1" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-zero">
|
||||
<div class="ant-rate-star-first"><i class="anticon anticon-heart"></i></div>
|
||||
<div class="ant-rate-star-second"><i class="anticon anticon-heart"></i></div>
|
||||
</li>
|
||||
<li class="ant-rate-star ant-rate-star-zero">
|
||||
<li role="radio" aria-checked="false" aria-posinset="2" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-zero">
|
||||
<div class="ant-rate-star-first"><i class="anticon anticon-heart"></i></div>
|
||||
<div class="ant-rate-star-second"><i class="anticon anticon-heart"></i></div>
|
||||
</li>
|
||||
<li class="ant-rate-star ant-rate-star-zero">
|
||||
<li role="radio" aria-checked="false" aria-posinset="3" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-zero">
|
||||
<div class="ant-rate-star-first"><i class="anticon anticon-heart"></i></div>
|
||||
<div class="ant-rate-star-second"><i class="anticon anticon-heart"></i></div>
|
||||
</li>
|
||||
<li class="ant-rate-star ant-rate-star-zero">
|
||||
<li role="radio" aria-checked="false" aria-posinset="4" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-zero">
|
||||
<div class="ant-rate-star-first"><i class="anticon anticon-heart"></i></div>
|
||||
<div class="ant-rate-star-second"><i class="anticon anticon-heart"></i></div>
|
||||
</li>
|
||||
<li class="ant-rate-star ant-rate-star-zero">
|
||||
<li role="radio" aria-checked="false" aria-posinset="5" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-zero">
|
||||
<div class="ant-rate-star-first"><i class="anticon anticon-heart"></i></div>
|
||||
<div class="ant-rate-star-second"><i class="anticon anticon-heart"></i></div>
|
||||
</li>
|
||||
</ul> <br>
|
||||
<ul tabindex="0" class="ant-rate" style="font-size: 36px;">
|
||||
<li class="ant-rate-star ant-rate-star-zero">
|
||||
<ul tabindex="0" role="radiogroup" class="ant-rate" style="font-size: 36px;">
|
||||
<li role="radio" aria-checked="false" aria-posinset="1" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-zero">
|
||||
<div class="ant-rate-star-first">A</div>
|
||||
<div class="ant-rate-star-second">A</div>
|
||||
</li>
|
||||
<li class="ant-rate-star ant-rate-star-zero">
|
||||
<li role="radio" aria-checked="false" aria-posinset="2" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-zero">
|
||||
<div class="ant-rate-star-first">A</div>
|
||||
<div class="ant-rate-star-second">A</div>
|
||||
</li>
|
||||
<li class="ant-rate-star ant-rate-star-zero">
|
||||
<li role="radio" aria-checked="false" aria-posinset="3" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-zero">
|
||||
<div class="ant-rate-star-first">A</div>
|
||||
<div class="ant-rate-star-second">A</div>
|
||||
</li>
|
||||
<li class="ant-rate-star ant-rate-star-zero">
|
||||
<li role="radio" aria-checked="false" aria-posinset="4" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-zero">
|
||||
<div class="ant-rate-star-first">A</div>
|
||||
<div class="ant-rate-star-second">A</div>
|
||||
</li>
|
||||
<li class="ant-rate-star ant-rate-star-zero">
|
||||
<li role="radio" aria-checked="false" aria-posinset="5" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-zero">
|
||||
<div class="ant-rate-star-first">A</div>
|
||||
<div class="ant-rate-star-second">A</div>
|
||||
</li>
|
||||
</ul> <br>
|
||||
<ul tabindex="0" class="ant-rate">
|
||||
<li class="ant-rate-star ant-rate-star-zero">
|
||||
<ul tabindex="0" role="radiogroup" class="ant-rate">
|
||||
<li role="radio" aria-checked="false" aria-posinset="1" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-zero">
|
||||
<div class="ant-rate-star-first">好</div>
|
||||
<div class="ant-rate-star-second">好</div>
|
||||
</li>
|
||||
<li class="ant-rate-star ant-rate-star-zero">
|
||||
<li role="radio" aria-checked="false" aria-posinset="2" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-zero">
|
||||
<div class="ant-rate-star-first">好</div>
|
||||
<div class="ant-rate-star-second">好</div>
|
||||
</li>
|
||||
<li class="ant-rate-star ant-rate-star-zero">
|
||||
<li role="radio" aria-checked="false" aria-posinset="3" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-zero">
|
||||
<div class="ant-rate-star-first">好</div>
|
||||
<div class="ant-rate-star-second">好</div>
|
||||
</li>
|
||||
<li class="ant-rate-star ant-rate-star-zero">
|
||||
<li role="radio" aria-checked="false" aria-posinset="4" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-zero">
|
||||
<div class="ant-rate-star-first">好</div>
|
||||
<div class="ant-rate-star-second">好</div>
|
||||
</li>
|
||||
<li class="ant-rate-star ant-rate-star-zero">
|
||||
<li role="radio" aria-checked="false" aria-posinset="5" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-zero">
|
||||
<div class="ant-rate-star-first">好</div>
|
||||
<div class="ant-rate-star-second">好</div>
|
||||
</li>
|
||||
@ -98,47 +98,47 @@ exports[`renders ./components/rate/demo/character.md correctly 1`] = `
|
||||
|
||||
exports[`renders ./components/rate/demo/clear.md correctly 1`] = `
|
||||
<div>
|
||||
<ul tabindex="0" class="ant-rate">
|
||||
<li class="ant-rate-star ant-rate-star-full">
|
||||
<ul tabindex="0" role="radiogroup" class="ant-rate">
|
||||
<li role="radio" aria-checked="true" aria-posinset="1" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-full">
|
||||
<div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div>
|
||||
<div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div>
|
||||
</li>
|
||||
<li class="ant-rate-star ant-rate-star-full">
|
||||
<li role="radio" aria-checked="true" aria-posinset="2" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-full">
|
||||
<div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div>
|
||||
<div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div>
|
||||
</li>
|
||||
<li class="ant-rate-star ant-rate-star-full">
|
||||
<li role="radio" aria-checked="true" aria-posinset="3" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-full">
|
||||
<div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div>
|
||||
<div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div>
|
||||
</li>
|
||||
<li class="ant-rate-star ant-rate-star-zero">
|
||||
<li role="radio" aria-checked="false" aria-posinset="4" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-zero">
|
||||
<div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div>
|
||||
<div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div>
|
||||
</li>
|
||||
<li class="ant-rate-star ant-rate-star-zero">
|
||||
<li role="radio" aria-checked="false" aria-posinset="5" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-zero">
|
||||
<div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div>
|
||||
<div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div>
|
||||
</li>
|
||||
</ul> allowClear: true
|
||||
<br>
|
||||
<ul tabindex="0" class="ant-rate">
|
||||
<li class="ant-rate-star ant-rate-star-full">
|
||||
<ul tabindex="0" role="radiogroup" class="ant-rate">
|
||||
<li role="radio" aria-checked="true" aria-posinset="1" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-full">
|
||||
<div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div>
|
||||
<div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div>
|
||||
</li>
|
||||
<li class="ant-rate-star ant-rate-star-full">
|
||||
<li role="radio" aria-checked="true" aria-posinset="2" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-full">
|
||||
<div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div>
|
||||
<div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div>
|
||||
</li>
|
||||
<li class="ant-rate-star ant-rate-star-full">
|
||||
<li role="radio" aria-checked="true" aria-posinset="3" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-full">
|
||||
<div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div>
|
||||
<div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div>
|
||||
</li>
|
||||
<li class="ant-rate-star ant-rate-star-zero">
|
||||
<li role="radio" aria-checked="false" aria-posinset="4" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-zero">
|
||||
<div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div>
|
||||
<div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div>
|
||||
</li>
|
||||
<li class="ant-rate-star ant-rate-star-zero">
|
||||
<li role="radio" aria-checked="false" aria-posinset="5" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-zero">
|
||||
<div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div>
|
||||
<div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div>
|
||||
</li>
|
||||
@ -148,24 +148,24 @@ exports[`renders ./components/rate/demo/clear.md correctly 1`] = `
|
||||
`;
|
||||
|
||||
exports[`renders ./components/rate/demo/disabled.md correctly 1`] = `
|
||||
<ul tabindex="-1" class="ant-rate ant-rate-disabled">
|
||||
<li class="ant-rate-star ant-rate-star-full">
|
||||
<ul tabindex="-1" role="radiogroup" class="ant-rate ant-rate-disabled">
|
||||
<li role="radio" aria-checked="true" aria-posinset="1" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-full">
|
||||
<div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div>
|
||||
<div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div>
|
||||
</li>
|
||||
<li class="ant-rate-star ant-rate-star-full">
|
||||
<li role="radio" aria-checked="true" aria-posinset="2" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-full">
|
||||
<div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div>
|
||||
<div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div>
|
||||
</li>
|
||||
<li class="ant-rate-star ant-rate-star-zero">
|
||||
<li role="radio" aria-checked="false" aria-posinset="3" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-zero">
|
||||
<div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div>
|
||||
<div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div>
|
||||
</li>
|
||||
<li class="ant-rate-star ant-rate-star-zero">
|
||||
<li role="radio" aria-checked="false" aria-posinset="4" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-zero">
|
||||
<div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div>
|
||||
<div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div>
|
||||
</li>
|
||||
<li class="ant-rate-star ant-rate-star-zero">
|
||||
<li role="radio" aria-checked="false" aria-posinset="5" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-zero">
|
||||
<div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div>
|
||||
<div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div>
|
||||
</li>
|
||||
@ -173,28 +173,28 @@ exports[`renders ./components/rate/demo/disabled.md correctly 1`] = `
|
||||
`;
|
||||
|
||||
exports[`renders ./components/rate/demo/half.md correctly 1`] = `
|
||||
<ul tabindex="0" class="ant-rate">
|
||||
<li class="ant-rate-star ant-rate-star-full">
|
||||
<ul tabindex="0" role="radiogroup" class="ant-rate">
|
||||
<li role="radio" aria-checked="true" aria-posinset="1" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-full">
|
||||
<div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div>
|
||||
<div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div>
|
||||
</li>
|
||||
<li class="ant-rate-star ant-rate-star-full">
|
||||
<li role="radio" aria-checked="true" aria-posinset="2" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-full">
|
||||
<div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div>
|
||||
<div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div>
|
||||
</li>
|
||||
<li class="ant-rate-star ant-rate-star-half ant-rate-star-active">
|
||||
<li role="radio" aria-checked="true" aria-posinset="3" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-half ant-rate-star-active">
|
||||
<div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div>
|
||||
<div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div>
|
||||
</li>
|
||||
<li class="ant-rate-star ant-rate-star-zero">
|
||||
<li role="radio" aria-checked="false" aria-posinset="4" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-zero">
|
||||
<div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div>
|
||||
<div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div>
|
||||
</li>
|
||||
<li class="ant-rate-star ant-rate-star-zero">
|
||||
<li role="radio" aria-checked="false" aria-posinset="5" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-zero">
|
||||
<div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div>
|
||||
<div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div>
|
||||
</li>
|
||||
</ul>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/rate/demo/text.md correctly 1`] = `<span><ul tabindex="0" class="ant-rate"><li class="ant-rate-star ant-rate-star-full"><div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div><div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div></li><li class="ant-rate-star ant-rate-star-full"><div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div><div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div></li><li class="ant-rate-star ant-rate-star-full"><div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div><div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div></li><li class="ant-rate-star ant-rate-star-zero"><div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div><div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div></li><li class="ant-rate-star ant-rate-star-zero"><div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div><div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div></li></ul> <span class="ant-rate-text">3 stars</span></span>`;
|
||||
exports[`renders ./components/rate/demo/text.md correctly 1`] = `<span><ul tabindex="0" role="radiogroup" class="ant-rate"><li role="radio" aria-checked="true" aria-posinset="1" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-full"><div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div><div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div></li><li role="radio" aria-checked="true" aria-posinset="2" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-full"><div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div><div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div></li><li role="radio" aria-checked="true" aria-posinset="3" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-full"><div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div><div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div></li><li role="radio" aria-checked="false" aria-posinset="4" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-zero"><div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div><div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div></li><li role="radio" aria-checked="false" aria-posinset="5" aria-setsize="5" tabindex="0" class="ant-rate-star ant-rate-star-zero"><div class="ant-rate-star-first"><i class="anticon anticon-star"></i></div><div class="ant-rate-star-second"><i class="anticon anticon-star"></i></div></li></ul> <span class="ant-rate-text">3 stars</span></span>`;
|
||||
|
@ -74,7 +74,7 @@ exports[`renders ./components/slider/demo/input-number.md correctly 1`] = `
|
||||
</div>
|
||||
<div class="ant-col-4">
|
||||
<div class="ant-input-number" style="margin-left: 16px;">
|
||||
<div class="ant-input-number-handler-wrap"><span unselectable="unselectable" role="button" aria-label="Increase Value" class="ant-input-number-handler ant-input-number-handler-up "><span unselectable="unselectable" class="ant-input-number-handler-up-inner"></span></span><span unselectable="unselectable" role="button" aria-label="Decrease Value" aria-disabled="true" class="ant-input-number-handler ant-input-number-handler-down ant-input-number-handler-down-disabled"><span unselectable="unselectable" class="ant-input-number-handler-down-inner"></span></span></div>
|
||||
<div class="ant-input-number-handler-wrap"><span class="ant-input-number-handler ant-input-number-handler-up " unselectable="unselectable" role="button" aria-label="Increase Value"><span unselectable="unselectable" class="ant-input-number-handler-up-inner"></span></span><span class="ant-input-number-handler ant-input-number-handler-down ant-input-number-handler-down-disabled" unselectable="unselectable" role="button" aria-label="Decrease Value" aria-disabled="true"><span unselectable="unselectable" class="ant-input-number-handler-down-inner"></span></span></div>
|
||||
<div role="spinbutton" aria-valuemin="1" aria-valuemax="20" aria-valuenow="1" class="ant-input-number-input-wrap"><input autocomplete="off" max="20" min="1" step="1" class="ant-input-number-input"></div>
|
||||
</div>
|
||||
</div>
|
||||
@ -91,7 +91,7 @@ exports[`renders ./components/slider/demo/input-number.md correctly 1`] = `
|
||||
</div>
|
||||
<div class="ant-col-4">
|
||||
<div class="ant-input-number" style="margin-left: 16px;">
|
||||
<div class="ant-input-number-handler-wrap"><span unselectable="unselectable" role="button" aria-label="Increase Value" class="ant-input-number-handler ant-input-number-handler-up "><span unselectable="unselectable" class="ant-input-number-handler-up-inner"></span></span><span unselectable="unselectable" role="button" aria-label="Decrease Value" aria-disabled="true" class="ant-input-number-handler ant-input-number-handler-down ant-input-number-handler-down-disabled"><span unselectable="unselectable" class="ant-input-number-handler-down-inner"></span></span></div>
|
||||
<div class="ant-input-number-handler-wrap"><span class="ant-input-number-handler ant-input-number-handler-up " unselectable="unselectable" role="button" aria-label="Increase Value"><span unselectable="unselectable" class="ant-input-number-handler-up-inner"></span></span><span class="ant-input-number-handler ant-input-number-handler-down ant-input-number-handler-down-disabled" unselectable="unselectable" role="button" aria-label="Decrease Value" aria-disabled="true"><span unselectable="unselectable" class="ant-input-number-handler-down-inner"></span></span></div>
|
||||
<div role="spinbutton" aria-valuemin="0" aria-valuemax="1" aria-valuenow="0" class="ant-input-number-input-wrap"><input autocomplete="off" max="1" min="0" step="0.01" class="ant-input-number-input"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -5,7 +5,7 @@ exports[`Slider should show tooltip when hovering slider handler 1`] = `
|
||||
<div class="ant-tooltip ant-tooltip-placement-top" style="left: -999px; top: -1003px;">
|
||||
<div class="ant-tooltip-content">
|
||||
<div class="ant-tooltip-arrow"></div>
|
||||
<div class="ant-tooltip-inner">30</div>
|
||||
<div role="tooltip" class="ant-tooltip-inner">30</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -16,7 +16,7 @@ exports[`Slider should show tooltip when hovering slider handler 2`] = `
|
||||
<div class="ant-tooltip ant-tooltip-placement-top" style="display: none;">
|
||||
<div class="ant-tooltip-content">
|
||||
<div class="ant-tooltip-arrow"></div>
|
||||
<div class="ant-tooltip-inner">30</div>
|
||||
<div role="tooltip" class="ant-tooltip-inner">30</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -43,7 +43,7 @@ exports[`Table.filter renders menu correctly 1`] = `
|
||||
<div>
|
||||
<div class="ant-dropdown ant-dropdown-placement-bottomLeft" style="display: none;">
|
||||
<div class="ant-table-filter-dropdown ant-dropdown-content">
|
||||
<ul class="ant-dropdown-menu ant-dropdown-menu-vertical ant-dropdown-menu-root" role="menu" tabindex="0">
|
||||
<ul role="menu" tabindex="0" class="ant-dropdown-menu ant-dropdown-menu-vertical ant-dropdown-menu-root">
|
||||
<li role="menuitem" class="ant-dropdown-menu-item"><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input" value=""><span class="ant-checkbox-inner"></span></span></label><span>Boy</span></li>
|
||||
<li role="menuitem" class="ant-dropdown-menu-item"><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input" value=""><span class="ant-checkbox-inner"></span></span></label><span>Girl</span></li>
|
||||
<li role="menuitem" class="ant-dropdown-menu-submenu ant-dropdown-menu-submenu-vertical">
|
||||
@ -60,7 +60,7 @@ exports[`Table.filter renders radio filter correctly 1`] = `
|
||||
<div>
|
||||
<div class="ant-dropdown ant-dropdown-placement-bottomLeft" style="display: none;">
|
||||
<div class="ant-table-filter-dropdown ant-dropdown-content">
|
||||
<ul class="ant-dropdown-menu ant-dropdown-menu-vertical ant-dropdown-menu-root" role="menu" tabindex="0">
|
||||
<ul role="menu" tabindex="0" class="ant-dropdown-menu ant-dropdown-menu-vertical ant-dropdown-menu-root">
|
||||
<li role="menuitem" class="ant-dropdown-menu-item"><label class="ant-radio-wrapper"><span class="ant-radio"><input type="radio" class="ant-radio-input" value=""><span class="ant-radio-inner"></span></span></label><span>Boy</span></li>
|
||||
<li role="menuitem" class="ant-dropdown-menu-item"><label class="ant-radio-wrapper"><span class="ant-radio"><input type="radio" class="ant-radio-input" value=""><span class="ant-radio-inner"></span></span></label><span>Girl</span></li>
|
||||
<li role="menuitem" class="ant-dropdown-menu-submenu ant-dropdown-menu-submenu-vertical">
|
||||
|
@ -76,7 +76,7 @@ exports[`Table.rowSelection fix selection column on the left 1`] = `
|
||||
exports[`Table.rowSelection render with default selection correctly 1`] = `
|
||||
<div>
|
||||
<div class="ant-dropdown ant-dropdown-placement-bottomLeft" style="display: none;">
|
||||
<ul class="ant-dropdown-menu ant-dropdown-menu-vertical ant-dropdown-menu-root ant-dropdown-menu-light ant-table-selection-menu ant-dropdown-content" role="menu" tabindex="0">
|
||||
<ul role="menu" tabindex="0" class="ant-dropdown-menu ant-dropdown-menu-vertical ant-dropdown-menu-root ant-dropdown-menu-light ant-table-selection-menu ant-dropdown-content">
|
||||
<li role="menuitem" class="ant-dropdown-menu-item">
|
||||
<div>Select current page</div>
|
||||
</li>
|
||||
|
@ -6,7 +6,7 @@ import { cloneElement } from '../../_util/vnode'
|
||||
import createChainedFunction from '../../_util/createChainedFunction'
|
||||
import KeyCode from '../../_util/KeyCode'
|
||||
import placements from './picker/placements'
|
||||
import Trigger from '../../trigger'
|
||||
import Trigger from '../../vc-trigger'
|
||||
import moment from 'moment'
|
||||
import { setTimeout } from 'timers'
|
||||
function isMoment (value) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { getComponentFromProp } from '../_util/props-util'
|
||||
import PropTypes from '../_util/vue-types'
|
||||
import Trigger from '../trigger'
|
||||
import Trigger from '../vc-trigger'
|
||||
import Menus from './Menus'
|
||||
import KeyCode from '../_util/KeyCode'
|
||||
import arrayTreeFilter from 'array-tree-filter'
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
import PropTypes from '../../_util/vue-types'
|
||||
import Trigger from '../../trigger'
|
||||
import Trigger from '../../vc-trigger'
|
||||
import placements from './placements'
|
||||
import { hasProp, getEvents, getOptionProps } from '../../_util/props-util'
|
||||
import BaseMixin from '../../_util/BaseMixin'
|
||||
|
@ -1,3 +1,3 @@
|
||||
// based on rc-form 2.2.1
|
||||
// based on rc-form 2.2.6
|
||||
import { createForm, createFormField } from './src/'
|
||||
export { createForm, createFormField }
|
||||
|
@ -59,7 +59,11 @@ function createBaseForm (option = {}, mixins = []) {
|
||||
|
||||
this.instances = {}
|
||||
this.cachedBind = {}
|
||||
this.clearedFieldMetaCache = {};
|
||||
this.clearedFieldMetaCache = {}
|
||||
|
||||
this.renderFields = {}
|
||||
this.domFields = {};
|
||||
|
||||
// HACK: https://github.com/ant-design/ant-design/issues/6406
|
||||
['getFieldsValue',
|
||||
'getFieldValue',
|
||||
@ -91,9 +95,11 @@ function createBaseForm (option = {}, mixins = []) {
|
||||
},
|
||||
mounted () {
|
||||
this.wrappedComponentRef(this.$refs.WrappedComponent)
|
||||
this.cleanUpUselessFields()
|
||||
},
|
||||
updated () {
|
||||
this.wrappedComponentRef(this.$refs.WrappedComponent)
|
||||
this.cleanUpUselessFields()
|
||||
},
|
||||
destroyed () {
|
||||
this.wrappedComponentRef(null)
|
||||
@ -151,25 +157,21 @@ function createBaseForm (option = {}, mixins = []) {
|
||||
this.cachedBind[name] = {}
|
||||
}
|
||||
const cache = this.cachedBind[name]
|
||||
if (!cache[action]) {
|
||||
cache[action] = fn.bind(this, name, action)
|
||||
}
|
||||
return cache[action]
|
||||
},
|
||||
|
||||
recoverClearedField (name) {
|
||||
if (this.clearedFieldMetaCache[name]) {
|
||||
this.fieldsStore.setFields({
|
||||
[name]: this.clearedFieldMetaCache[name].field,
|
||||
})
|
||||
this.fieldsStore.setFieldMeta(name, this.clearedFieldMetaCache[name].meta)
|
||||
delete this.clearedFieldMetaCache[name]
|
||||
if (!cache[action] || cache[action].oriFn !== fn) {
|
||||
cache[action] = {
|
||||
fn: fn.bind(this, name, action),
|
||||
oriFn: fn,
|
||||
}
|
||||
}
|
||||
return cache[action].fn
|
||||
},
|
||||
|
||||
getFieldDecorator (name, fieldOption) {
|
||||
const { props, ...restProps } = this.getFieldProps(name, fieldOption)
|
||||
return (fieldElem) => {
|
||||
// We should put field in record if it is rendered
|
||||
this.renderFields[name] = true
|
||||
|
||||
const fieldMeta = this.fieldsStore.getFieldMeta(name)
|
||||
const originalProps = getOptionProps(fieldElem)
|
||||
const originalEvents = getEvents(fieldElem)
|
||||
@ -288,7 +290,8 @@ function createBaseForm (option = {}, mixins = []) {
|
||||
if (fieldDataProp) {
|
||||
inputAttrs[fieldDataProp] = this.fieldsStore.getField(name)
|
||||
}
|
||||
|
||||
// This field is rendered, record it
|
||||
this.renderFields[name] = true
|
||||
return {
|
||||
props: omit(inputProps, ['id']),
|
||||
// id: inputProps.id,
|
||||
@ -338,19 +341,6 @@ function createBaseForm (option = {}, mixins = []) {
|
||||
})
|
||||
},
|
||||
|
||||
resetFields (ns) {
|
||||
const newFields = this.fieldsStore.resetFields(ns)
|
||||
if (Object.keys(newFields).length > 0) {
|
||||
this.setFields(newFields)
|
||||
}
|
||||
if (ns) {
|
||||
const names = Array.isArray(ns) ? ns : [ns]
|
||||
names.forEach(name => delete this.clearedFieldMetaCache[name])
|
||||
} else {
|
||||
this.clearedFieldMetaCache = {}
|
||||
}
|
||||
},
|
||||
|
||||
setFieldsValue (changedValues, callback) {
|
||||
const { fieldsMeta } = this.fieldsStore
|
||||
const values = this.fieldsStore.flattenRegisteredFields(changedValues)
|
||||
@ -385,11 +375,11 @@ function createBaseForm (option = {}, mixins = []) {
|
||||
field: this.fieldsStore.getField(name),
|
||||
meta: this.fieldsStore.getFieldMeta(name),
|
||||
}
|
||||
this.fieldsStore.clearField(name)
|
||||
delete this.instances[name]
|
||||
delete this.cachedBind[name]
|
||||
this.clearField(name)
|
||||
delete this.domFields[name]
|
||||
return
|
||||
}
|
||||
this.domFields[name] = true
|
||||
this.recoverClearedField(name)
|
||||
// const fieldMeta = this.fieldsStore.getFieldMeta(name)
|
||||
// if (fieldMeta) {
|
||||
@ -404,6 +394,46 @@ function createBaseForm (option = {}, mixins = []) {
|
||||
this.instances[name] = component
|
||||
},
|
||||
|
||||
cleanUpUselessFields () {
|
||||
const fieldList = this.fieldsStore.getAllFieldsName()
|
||||
const removedList = fieldList.filter(field => (
|
||||
!this.renderFields[field] && !this.domFields[field]
|
||||
))
|
||||
if (removedList.length) {
|
||||
removedList.forEach(this.clearField)
|
||||
}
|
||||
this.renderFields = {}
|
||||
},
|
||||
|
||||
clearField (name) {
|
||||
this.fieldsStore.clearField(name)
|
||||
delete this.instances[name]
|
||||
delete this.cachedBind[name]
|
||||
},
|
||||
|
||||
resetFields (ns) {
|
||||
const newFields = this.fieldsStore.resetFields(ns)
|
||||
if (Object.keys(newFields).length > 0) {
|
||||
this.setFields(newFields)
|
||||
}
|
||||
if (ns) {
|
||||
const names = Array.isArray(ns) ? ns : [ns]
|
||||
names.forEach(name => delete this.clearedFieldMetaCache[name])
|
||||
} else {
|
||||
this.clearedFieldMetaCache = {}
|
||||
}
|
||||
},
|
||||
|
||||
recoverClearedField (name) {
|
||||
if (this.clearedFieldMetaCache[name]) {
|
||||
this.fieldsStore.setFields({
|
||||
[name]: this.clearedFieldMetaCache[name].field,
|
||||
})
|
||||
this.fieldsStore.setFieldMeta(name, this.clearedFieldMetaCache[name].meta)
|
||||
delete this.clearedFieldMetaCache[name]
|
||||
}
|
||||
},
|
||||
|
||||
validateFieldsInternal (fields, {
|
||||
fieldNames,
|
||||
action,
|
||||
|
@ -65,7 +65,7 @@ const mixin = {
|
||||
const validNames = this.fieldsStore.getValidFieldsName()
|
||||
let firstNode
|
||||
let firstTop
|
||||
for (const name of validNames) {
|
||||
validNames.forEach((name) => {
|
||||
if (has(error, name)) {
|
||||
const instance = this.getFieldInstance(name)
|
||||
if (instance) {
|
||||
@ -77,7 +77,8 @@ const mixin = {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
if (firstNode) {
|
||||
const c = options.container || getScrollableContainer(firstNode)
|
||||
scrollIntoView(firstNode, c, {
|
||||
|
@ -10,22 +10,22 @@ function partOf (a, b) {
|
||||
return b.indexOf(a) === 0 && ['.', '['].indexOf(b[a.length]) !== -1
|
||||
}
|
||||
|
||||
function internalFlattenFields (fields) {
|
||||
return flattenFields(
|
||||
fields,
|
||||
(_, node) => isFormField(node),
|
||||
'You must wrap field data with `createFormField`.'
|
||||
)
|
||||
}
|
||||
|
||||
class FieldsStore {
|
||||
constructor (fields) {
|
||||
this.fields = this.flattenFields(fields)
|
||||
this.fields = internalFlattenFields(fields)
|
||||
this.fieldsMeta = {}
|
||||
}
|
||||
|
||||
updateFields (fields) {
|
||||
this.fields = this.flattenFields(fields)
|
||||
}
|
||||
|
||||
flattenFields (fields) {
|
||||
return flattenFields(
|
||||
fields,
|
||||
(_, node) => isFormField(node),
|
||||
'You must wrap field data with `createFormField`.'
|
||||
)
|
||||
this.fields = internalFlattenFields(fields)
|
||||
}
|
||||
|
||||
flattenRegisteredFields (fields) {
|
||||
@ -33,7 +33,7 @@ class FieldsStore {
|
||||
return flattenFields(
|
||||
fields,
|
||||
path => validFieldsName.indexOf(path) >= 0,
|
||||
'You cannot set field before registering it.'
|
||||
'You cannot set a form field before rendering a field associated with the value.'
|
||||
)
|
||||
}
|
||||
|
||||
@ -58,7 +58,9 @@ class FieldsStore {
|
||||
}
|
||||
const nowValues = {}
|
||||
Object.keys(fieldsMeta)
|
||||
.forEach((f) => { nowValues[f] = this.getValueFromFields(f, nowFields) })
|
||||
.forEach((f) => {
|
||||
nowValues[f] = this.getValueFromFields(f, nowFields)
|
||||
})
|
||||
Object.keys(nowValues).forEach((f) => {
|
||||
const value = nowValues[f]
|
||||
const fieldMeta = this.getFieldMeta(f)
|
||||
|
@ -6,4 +6,4 @@ import Vue from 'vue'
|
||||
import antRefDirective from '../../_util/antRefDirective'
|
||||
Vue.use(antRefDirective)
|
||||
|
||||
export { createForm, createFormField, formShape }
|
||||
export { createFormField, formShape, createForm }
|
||||
|
@ -1,3 +1,5 @@
|
||||
import warning from 'warning'
|
||||
|
||||
function getDisplayName (WrappedComponent) {
|
||||
return WrappedComponent.name || 'WrappedComponent'
|
||||
}
|
||||
@ -22,7 +24,7 @@ export function treeTraverse (path = '', tree, isLeafNode, errorMessage, callbac
|
||||
if (isLeafNode(path, tree)) {
|
||||
callback(path, tree)
|
||||
} else if (tree === undefined || tree === null) {
|
||||
return
|
||||
// Do nothing
|
||||
} else if (Array.isArray(tree)) {
|
||||
tree.forEach((subTree, index) => treeTraverse(
|
||||
`${path}[${index}]`,
|
||||
@ -33,7 +35,7 @@ export function treeTraverse (path = '', tree, isLeafNode, errorMessage, callbac
|
||||
))
|
||||
} else { // It's object and not a leaf node
|
||||
if (typeof tree !== 'object') {
|
||||
console.error(errorMessage)
|
||||
warning(false, errorMessage)
|
||||
return
|
||||
}
|
||||
Object.keys(tree).forEach(subTreeKey => {
|
||||
|
@ -15,14 +15,11 @@ const InputHandler = {
|
||||
},
|
||||
on: this.$listeners,
|
||||
}
|
||||
const spanProps = {
|
||||
attrs: this.$attrs,
|
||||
}
|
||||
return (
|
||||
<Touchable
|
||||
{...touchableProps}
|
||||
>
|
||||
<span {...spanProps}>
|
||||
<span>
|
||||
{this.$slots.default}
|
||||
</span>
|
||||
</Touchable>
|
||||
|
@ -1,7 +1,7 @@
|
||||
// based on rc-input-number 4.0.12
|
||||
// based on rc-input-number 4.3.1
|
||||
import PropTypes from '../../_util/vue-types'
|
||||
import BaseMixin from '../../_util/BaseMixin'
|
||||
import { initDefaultProps, hasProp } from '../../_util/props-util'
|
||||
import { initDefaultProps, hasProp, getOptionProps } from '../../_util/props-util'
|
||||
import classNames from 'classnames'
|
||||
import isNegativeZero from 'is-negative-zero'
|
||||
import KeyCode from '../../_util/KeyCode'
|
||||
@ -72,6 +72,7 @@ const inputNumberProps = {
|
||||
precision: PropTypes.number,
|
||||
required: PropTypes.bool,
|
||||
pattern: PropTypes.string,
|
||||
decimalSeparator: PropTypes.string,
|
||||
}
|
||||
|
||||
export default {
|
||||
@ -142,6 +143,22 @@ export default {
|
||||
inputValue: this.inputting ? value : this.toPrecisionAsStep(value),
|
||||
})
|
||||
},
|
||||
max (val) {
|
||||
const props = getOptionProps(this)
|
||||
// Trigger onChange when max or min change
|
||||
// https://github.com/ant-design/ant-design/issues/11574
|
||||
const nextValue = 'value' in props ? props.value : this.sValue
|
||||
if (nextValue > val) {
|
||||
this.__emit('change', val)
|
||||
}
|
||||
},
|
||||
min (val) {
|
||||
const props = getOptionProps(this)
|
||||
const nextValue = 'value' in props ? props.value : this.sValue
|
||||
if (nextValue < val) {
|
||||
this.__emit('change', val)
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
updatedFunc () {
|
||||
@ -158,7 +175,7 @@ export default {
|
||||
|
||||
if (
|
||||
// If not match full str, try to match part of str
|
||||
!this.partRestoreByAfter(this.cursorAfter)
|
||||
!this.partRestoreByAfter(this.cursorAfter) && this.sValue !== this.value
|
||||
) {
|
||||
// If not match any of then, let's just keep the position
|
||||
// TODO: Logic should not reach here, need check if happens
|
||||
@ -275,8 +292,14 @@ export default {
|
||||
},
|
||||
getValueFromEvent (e) {
|
||||
// optimize for chinese input expierence
|
||||
// https://github.com/ant-design/ant-design/issues/8196
|
||||
return e.target.value.trim().replace(/。/g, '.')
|
||||
// https://github.com/ant-design/ant-design/issues/8196
|
||||
let value = e.target.value.trim().replace(/。/g, '.')
|
||||
|
||||
if (this.decimalSeparator !== undefined) {
|
||||
value = value.replace(this.decimalSeparator, '.')
|
||||
}
|
||||
|
||||
return value
|
||||
},
|
||||
getValidValue (value, min = this.min, max = this.max) {
|
||||
let val = parseFloat(value, 10)
|
||||
@ -622,7 +645,12 @@ export default {
|
||||
mouseleave: this.stop,
|
||||
}
|
||||
}
|
||||
const inputDisplayValueFormat = this.formatWrapper(inputDisplayValue)
|
||||
let inputDisplayValueFormat = this.formatWrapper(inputDisplayValue)
|
||||
if (this.decimalSeparator !== undefined) {
|
||||
inputDisplayValueFormat = inputDisplayValueFormat
|
||||
.toString()
|
||||
.replace('.', this.decimalSeparator)
|
||||
}
|
||||
const isUpDisabled = !!upDisabledClass || disabled || readOnly
|
||||
const isDownDisabled = !!downDisabledClass || disabled || readOnly
|
||||
const { mouseenter = noop, mouseleave = noop, mouseover = noop, mouseout = noop } = this.$listeners
|
||||
|
@ -1,3 +1,3 @@
|
||||
|
||||
// based on 2.0.0
|
||||
import TouchFeedback from './src/TouchFeedback'
|
||||
export default TouchFeedback
|
||||
|
@ -26,10 +26,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
triggerEvent (type, isActive, ev) {
|
||||
// const eventType = `on${type}`
|
||||
// if (this.props[eventType]) {
|
||||
// this.props[eventType](ev)
|
||||
// }
|
||||
// 暂时仅有input-number用到,事件直接到挂载到Touchable上,不需要像antd那样从子组件触发
|
||||
this.$emit(type, ev)
|
||||
if (isActive !== this.active) {
|
||||
this.setState({
|
||||
@ -50,17 +47,10 @@ export default {
|
||||
this.triggerEvent('touchcancel', false, e)
|
||||
},
|
||||
onMouseDown (e) {
|
||||
// todo
|
||||
// pc simulate mobile
|
||||
// if (this.props.onTouchStart) {
|
||||
this.triggerEvent('touchstart', true, e)
|
||||
// }
|
||||
this.triggerEvent('mousedown', true, e)
|
||||
},
|
||||
onMouseUp (e) {
|
||||
// if (this.props.onTouchEnd) {
|
||||
this.triggerEvent('touchend', false, e)
|
||||
// }
|
||||
this.triggerEvent('mouseup', false, e)
|
||||
},
|
||||
onMouseLeave (e) {
|
||||
|
@ -1,41 +1,304 @@
|
||||
import PropTypes from '../_util/vue-types'
|
||||
import ResizeObserver from 'resize-observer-polyfill'
|
||||
import SubMenu from './SubMenu'
|
||||
import BaseMixin from '../_util/BaseMixin'
|
||||
import { getWidth, setStyle, menuAllProps } from './util'
|
||||
import { cloneElement } from '../_util/vnode'
|
||||
import { getClass, getPropsData, filterEmpty } from '../_util/props-util'
|
||||
|
||||
import omit from 'omit.js'
|
||||
export default {
|
||||
const canUseDOM = !!(
|
||||
typeof window !== 'undefined' &&
|
||||
window.document &&
|
||||
window.document.createElement
|
||||
)
|
||||
|
||||
const MENUITEM_OVERFLOWED_CLASSNAME = 'menuitem-overflowed'
|
||||
|
||||
// Fix ssr
|
||||
if (canUseDOM) {
|
||||
require('mutationobserver-shim')
|
||||
}
|
||||
|
||||
const DOMWrap = {
|
||||
name: 'DOMWrap',
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
tag: {
|
||||
type: String,
|
||||
default: 'div',
|
||||
},
|
||||
hiddenClassName: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
mixins: [BaseMixin],
|
||||
data () {
|
||||
this.resizeObserver = null
|
||||
this.mutationObserver = null
|
||||
|
||||
// original scroll size of the list
|
||||
this.originalTotalWidth = 0
|
||||
|
||||
// copy of overflowed items
|
||||
this.overflowedItems = []
|
||||
|
||||
// cache item of the original items (so we can track the size and order)
|
||||
this.menuItemSizes = []
|
||||
return {
|
||||
lastVisibleIndex: undefined,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
class () {
|
||||
const { visible, hiddenClassName } = this.$props
|
||||
return {
|
||||
// [hiddenClassName]: !visible,
|
||||
|
||||
mounted () {
|
||||
this.$nextTick(() => {
|
||||
this.setChildrenWidthAndResize()
|
||||
if (this.level === 1 && this.mode === 'horizontal') {
|
||||
const menuUl = this.$el
|
||||
if (!menuUl) {
|
||||
return
|
||||
}
|
||||
this.resizeObserver = new ResizeObserver(entries => {
|
||||
entries.forEach(this.setChildrenWidthAndResize)
|
||||
});
|
||||
|
||||
[].slice.call(menuUl.children).concat(menuUl).forEach(el => {
|
||||
this.resizeObserver.observe(el)
|
||||
})
|
||||
|
||||
if (typeof MutationObserver !== 'undefined') {
|
||||
this.mutationObserver = new MutationObserver(() => {
|
||||
this.resizeObserver.disconnect();
|
||||
[].slice.call(menuUl.children).concat(menuUl).forEach(el => {
|
||||
this.resizeObserver.observe(el)
|
||||
})
|
||||
this.setChildrenWidthAndResize()
|
||||
})
|
||||
this.mutationObserver.observe(
|
||||
menuUl,
|
||||
{ attributes: false, childList: true, subTree: false }
|
||||
)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
beforeDestroy () {
|
||||
if (this.resizeObserver) {
|
||||
this.resizeObserver.disconnect()
|
||||
}
|
||||
if (this.mutationObserver) {
|
||||
this.resizeObserver.disconnect()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// get all valid menuItem nodes
|
||||
getMenuItemNodes () {
|
||||
const { prefixCls } = this.$props
|
||||
const ul = this.$el
|
||||
if (!ul) {
|
||||
return []
|
||||
}
|
||||
|
||||
// filter out all overflowed indicator placeholder
|
||||
return [].slice.call(ul.children)
|
||||
.filter(node => {
|
||||
return node.className.split(' ').indexOf(`${prefixCls}-overflowed-submenu`) < 0
|
||||
})
|
||||
},
|
||||
|
||||
getOverflowedSubMenuItem (keyPrefix, overflowedItems, renderPlaceholder) {
|
||||
const { overflowedIndicator, level, mode, prefixCls, theme } = this.$props
|
||||
if (level !== 1 || mode !== 'horizontal') {
|
||||
return null
|
||||
}
|
||||
// put all the overflowed item inside a submenu
|
||||
// with a title of overflow indicator ('...')
|
||||
const copy = this.$slots.default[0]
|
||||
const { title, eventKey, ...rest } = getPropsData(copy)
|
||||
|
||||
let style = {}
|
||||
let key = `${keyPrefix}-overflowed-indicator`
|
||||
|
||||
if (overflowedItems.length === 0 && renderPlaceholder !== true) {
|
||||
style = {
|
||||
display: 'none',
|
||||
}
|
||||
} else if (renderPlaceholder) {
|
||||
style = {
|
||||
visibility: 'hidden',
|
||||
// prevent from taking normal dom space
|
||||
position: 'absolute',
|
||||
}
|
||||
key = `${key}-placeholder`
|
||||
}
|
||||
|
||||
const popupClassName = theme ? `${prefixCls}-${theme}` : ''
|
||||
const subMenuProps = {
|
||||
props: {
|
||||
title,
|
||||
overflowedIndicator,
|
||||
popupClassName,
|
||||
eventKey: `${keyPrefix}-overflowed-indicator`,
|
||||
disabled: false,
|
||||
},
|
||||
class: `${prefixCls}-overflowed-submenu`,
|
||||
key,
|
||||
style,
|
||||
on: copy.$listeners,
|
||||
}
|
||||
menuAllProps.props.forEach(k => {
|
||||
if (rest[k] !== undefined) {
|
||||
subMenuProps.props[k] = rest[k]
|
||||
}
|
||||
})
|
||||
|
||||
return (
|
||||
<SubMenu
|
||||
{...subMenuProps}
|
||||
>
|
||||
{overflowedItems}
|
||||
</SubMenu>
|
||||
)
|
||||
},
|
||||
|
||||
// memorize rendered menuSize
|
||||
setChildrenWidthAndResize () {
|
||||
if (this.mode !== 'horizontal') {
|
||||
return
|
||||
}
|
||||
const ul = this.$el
|
||||
|
||||
if (!ul) {
|
||||
return
|
||||
}
|
||||
|
||||
const ulChildrenNodes = ul.children
|
||||
|
||||
if (!ulChildrenNodes || ulChildrenNodes.length === 0) {
|
||||
return
|
||||
}
|
||||
|
||||
const lastOverflowedIndicatorPlaceholder = ul.children[ulChildrenNodes.length - 1]
|
||||
|
||||
// need last overflowed indicator for calculating length;
|
||||
setStyle(lastOverflowedIndicatorPlaceholder, 'display', 'inline-block')
|
||||
|
||||
const menuItemNodes = this.getMenuItemNodes()
|
||||
|
||||
// reset display attribute for all hidden elements caused by overflow to calculate updated width
|
||||
// and then reset to original state after width calculation
|
||||
|
||||
const overflowedItems = menuItemNodes
|
||||
.filter(c => c.className.split(' ').indexOf(MENUITEM_OVERFLOWED_CLASSNAME) >= 0)
|
||||
|
||||
overflowedItems.forEach(c => {
|
||||
setStyle(c, 'display', 'inline-block')
|
||||
})
|
||||
|
||||
this.menuItemSizes = menuItemNodes.map(c => getWidth(c))
|
||||
|
||||
overflowedItems.forEach(c => {
|
||||
setStyle(c, 'display', 'none')
|
||||
})
|
||||
this.overflowedIndicatorWidth = getWidth(ul.children[ul.children.length - 1])
|
||||
this.originalTotalWidth = this.menuItemSizes.reduce((acc, cur) => acc + cur, 0)
|
||||
this.handleResize()
|
||||
// prevent the overflowed indicator from taking space;
|
||||
setStyle(lastOverflowedIndicatorPlaceholder, 'display', 'none')
|
||||
},
|
||||
|
||||
handleResize () {
|
||||
if (this.mode !== 'horizontal') {
|
||||
return
|
||||
}
|
||||
|
||||
const ul = this.$el
|
||||
if (!ul) {
|
||||
return
|
||||
}
|
||||
const width = getWidth(ul)
|
||||
|
||||
this.overflowedItems = []
|
||||
let currentSumWidth = 0
|
||||
|
||||
// index for last visible child in horizontal mode
|
||||
let lastVisibleIndex
|
||||
|
||||
if (this.originalTotalWidth > width) {
|
||||
lastVisibleIndex = -1
|
||||
|
||||
this.menuItemSizes.forEach(liWidth => {
|
||||
currentSumWidth += liWidth
|
||||
if (currentSumWidth + this.overflowedIndicatorWidth <= width) {
|
||||
lastVisibleIndex++
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.setState({ lastVisibleIndex })
|
||||
},
|
||||
|
||||
renderChildren (children) {
|
||||
// need to take care of overflowed items in horizontal mode
|
||||
const { lastVisibleIndex } = this.$data
|
||||
const className = getClass(this)
|
||||
return (children || []).reduce((acc, childNode, index) => {
|
||||
let item = childNode
|
||||
const eventKey = getPropsData(childNode).eventKey
|
||||
if (this.mode === 'horizontal') {
|
||||
let overflowed = this.getOverflowedSubMenuItem(eventKey, [])
|
||||
if (lastVisibleIndex !== undefined &&
|
||||
className[`${this.prefixCls}-root`]
|
||||
) {
|
||||
if (index > lastVisibleIndex) {
|
||||
item = cloneElement(
|
||||
childNode,
|
||||
// 这里修改 eventKey 是为了防止隐藏状态下还会触发 openkeys 事件
|
||||
{
|
||||
style: { display: 'none' },
|
||||
props: { eventKey: `${eventKey}-hidden` },
|
||||
class: { ...getClass(childNode), [MENUITEM_OVERFLOWED_CLASSNAME]: true },
|
||||
},
|
||||
)
|
||||
}
|
||||
if (index === lastVisibleIndex + 1) {
|
||||
this.overflowedItems = children.slice(lastVisibleIndex + 1).map(c => {
|
||||
return cloneElement(
|
||||
c,
|
||||
// children[index].key will become '.$key' in clone by default,
|
||||
// we have to overwrite with the correct key explicitly
|
||||
{ key: getPropsData(c).eventKey, props: { mode: 'vertical-left' }},
|
||||
)
|
||||
})
|
||||
|
||||
overflowed = this.getOverflowedSubMenuItem(
|
||||
eventKey,
|
||||
this.overflowedItems,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const ret = [...acc, overflowed, item]
|
||||
|
||||
if (index === children.length - 1) {
|
||||
// need a placeholder for calculating overflowed indicator width
|
||||
ret.push(this.getOverflowedSubMenuItem(eventKey, [], true))
|
||||
}
|
||||
return ret
|
||||
}
|
||||
return [...acc, item]
|
||||
}, [])
|
||||
},
|
||||
},
|
||||
|
||||
render () {
|
||||
const otherProps = omit(this.$props, [
|
||||
'tag',
|
||||
'hiddenClassName',
|
||||
'visible',
|
||||
])
|
||||
const Tag = this.$props.tag
|
||||
const tagProps = {
|
||||
attr: { ...otherProps, ...this.$attrs },
|
||||
on: this.$listeners,
|
||||
}
|
||||
return <Tag {...tagProps} class={this.class}>{this.$slots.default}</Tag>
|
||||
return <Tag {...tagProps}>{this.renderChildren(this.$slots.default)}</Tag>
|
||||
},
|
||||
}
|
||||
|
||||
DOMWrap.props = {
|
||||
mode: PropTypes.oneOf(['horizontal', 'vertical', 'vertical-left', 'vertical-right', 'inline']),
|
||||
prefixCls: PropTypes.string,
|
||||
level: PropTypes.number,
|
||||
theme: PropTypes.string,
|
||||
overflowedIndicator: PropTypes.node,
|
||||
visible: PropTypes.bool,
|
||||
hiddenClassName: PropTypes.string,
|
||||
tag: PropTypes.string.def('div'),
|
||||
}
|
||||
|
||||
export default DOMWrap
|
||||
|
@ -2,7 +2,7 @@ import PropTypes from '../_util/vue-types'
|
||||
import { Provider, create } from '../_util/store'
|
||||
import { default as SubPopupMenu, getActiveKey } from './SubPopupMenu'
|
||||
import BaseMixin from '../_util/BaseMixin'
|
||||
import hasProp, { getOptionProps } from '../_util/props-util'
|
||||
import hasProp, { getOptionProps, getComponentFromProp, filterEmpty } from '../_util/props-util'
|
||||
import commonPropsType from './commonPropsType'
|
||||
|
||||
const Menu = {
|
||||
@ -33,47 +33,13 @@ const Menu = {
|
||||
// this.isRootMenu = true // 声明在props上
|
||||
return {}
|
||||
},
|
||||
watch: {
|
||||
selectedKeys (val) {
|
||||
this.store.setState({
|
||||
selectedKeys: val || [],
|
||||
})
|
||||
},
|
||||
openKeys (val) {
|
||||
this.store.setState({
|
||||
openKeys: val || [],
|
||||
})
|
||||
},
|
||||
// '$props': {
|
||||
// handler: function (nextProps) {
|
||||
// if (hasProp(this, 'selectedKeys')) {
|
||||
// this.setState({
|
||||
// sSelectedKeys: nextProps.selectedKeys || [],
|
||||
// })
|
||||
// }
|
||||
// if (hasProp(this, 'openKeys')) {
|
||||
// this.setState({
|
||||
// sOpenKeys: nextProps.openKeys || [],
|
||||
// })
|
||||
// }
|
||||
// },
|
||||
// deep: true,
|
||||
// },
|
||||
mounted () {
|
||||
this.updateMiniStore()
|
||||
},
|
||||
updated () {
|
||||
this.updateMiniStore()
|
||||
},
|
||||
methods: {
|
||||
// onDestroy (key) {
|
||||
// const state = this.$data
|
||||
// const sSelectedKeys = state.sSelectedKeys
|
||||
// const sOpenKeys = state.sOpenKeys
|
||||
// let index = sSelectedKeys.indexOf(key)
|
||||
// if (!hasProp(this, 'selectedKeys') && index !== -1) {
|
||||
// sSelectedKeys.splice(index, 1)
|
||||
// }
|
||||
// index = sOpenKeys.indexOf(key)
|
||||
// if (!hasProp(this, 'openKeys') && index !== -1) {
|
||||
// sOpenKeys.splice(index, 1)
|
||||
// }
|
||||
// },
|
||||
|
||||
onSelect (selectInfo) {
|
||||
const props = this.$props
|
||||
@ -170,35 +136,19 @@ const Menu = {
|
||||
}
|
||||
return transitionName
|
||||
},
|
||||
|
||||
// isInlineMode () {
|
||||
// return this.$props.mode === 'inline'
|
||||
// },
|
||||
|
||||
// lastOpenSubMenu () {
|
||||
// let lastOpen = []
|
||||
// const { sOpenKeys } = this.$data
|
||||
// if (sOpenKeys.length) {
|
||||
// lastOpen = this.getFlatInstanceArray().filter((c) => {
|
||||
// return c && sOpenKeys.indexOf(c.eventKey) !== -1
|
||||
// })
|
||||
// }
|
||||
// return lastOpen[0]
|
||||
// },
|
||||
|
||||
// renderMenuItem (c, i, subIndex) {
|
||||
// if (!c) {
|
||||
// return null
|
||||
// }
|
||||
// const state = this.$data
|
||||
// const extraProps = {
|
||||
// openKeys: state.sOpenKeys,
|
||||
// selectedKeys: state.sSelectedKeys,
|
||||
// triggerSubMenuAction: this.$props.triggerSubMenuAction,
|
||||
// isRootMenu: this.isRootMenu,
|
||||
// }
|
||||
// return this.renderCommonMenuItem(c, i, subIndex, extraProps)
|
||||
// },
|
||||
updateMiniStore () {
|
||||
const props = getOptionProps(this)
|
||||
if ('selectedKeys' in props) {
|
||||
this.store.setState({
|
||||
selectedKeys: props.selectedKeys || [],
|
||||
})
|
||||
}
|
||||
if ('openKeys' in props) {
|
||||
this.store.setState({
|
||||
openKeys: props.openKeys || [],
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
render () {
|
||||
@ -206,10 +156,12 @@ const Menu = {
|
||||
const subPopupMenuProps = {
|
||||
props: {
|
||||
...props,
|
||||
itemIcon: getComponentFromProp(this, 'itemIcon', props),
|
||||
expandIcon: getComponentFromProp(this, 'expandIcon', props),
|
||||
overflowedIndicator: getComponentFromProp(this, 'overflowedIndicator', props),
|
||||
openTransitionName: this.getOpenTransitionName(),
|
||||
parentMenu: this,
|
||||
children: this.$slots.default || [],
|
||||
__propsSymbol__: Symbol(),
|
||||
children: filterEmpty(this.$slots.default || []),
|
||||
},
|
||||
class: `${props.prefixCls}-root`,
|
||||
on: {
|
||||
|
@ -5,6 +5,7 @@ import BaseMixin from '../_util/BaseMixin'
|
||||
import scrollIntoView from 'dom-scroll-into-view'
|
||||
import { connect } from '../_util/store'
|
||||
import { noop, menuAllProps } from './util'
|
||||
import { getComponentFromProp } from '../_util/props-util'
|
||||
|
||||
const props = {
|
||||
attribute: PropTypes.object,
|
||||
@ -25,6 +26,7 @@ const props = {
|
||||
manualRef: PropTypes.func.def(noop),
|
||||
role: PropTypes.any,
|
||||
subMenuKey: PropTypes.string,
|
||||
itemIcon: PropTypes.any,
|
||||
// clearSubMenuTimers: PropTypes.func.def(noop),
|
||||
}
|
||||
const MenuItem = {
|
||||
@ -138,7 +140,7 @@ const MenuItem = {
|
||||
let attrs = {
|
||||
...props.attribute,
|
||||
title: props.title,
|
||||
role: 'menuitem',
|
||||
role: props.role || 'menuitem',
|
||||
'aria-disabled': props.disabled,
|
||||
}
|
||||
if (props.role === 'option') {
|
||||
@ -148,10 +150,13 @@ const MenuItem = {
|
||||
role: 'option',
|
||||
'aria-selected': props.isSelected,
|
||||
}
|
||||
} else if (props.role === null) {
|
||||
} else if (props.role === null || props.role === 'none') {
|
||||
// sometimes we want to specify role inside <li/> element
|
||||
// <li><a role='menuitem'>Link</a></li> would be a good example
|
||||
delete attrs.role
|
||||
// in this case the role on <li/> should be "none" to
|
||||
// remove the implied listitem role.
|
||||
// https://www.w3.org/TR/wai-aria-practices-1.1/examples/menubar/menubar-1/menubar-1.html
|
||||
attrs.role = 'none'
|
||||
}
|
||||
// In case that onClick/onMouseLeave/onMouseEnter is passed down from owner
|
||||
const mouseEvent = {
|
||||
@ -184,6 +189,7 @@ const MenuItem = {
|
||||
class={className}
|
||||
>
|
||||
{this.$slots.default}
|
||||
{getComponentFromProp(this, 'itemIcon', props)}
|
||||
</li>
|
||||
)
|
||||
},
|
||||
|
@ -1,12 +1,12 @@
|
||||
import omit from 'omit.js'
|
||||
import PropTypes from '../_util/vue-types'
|
||||
import Trigger from '../trigger'
|
||||
import Trigger from '../vc-trigger'
|
||||
import KeyCode from '../_util/KeyCode'
|
||||
import { connect } from '../_util/store'
|
||||
import SubPopupMenu from './SubPopupMenu'
|
||||
import placements from './placements'
|
||||
import BaseMixin from '../_util/BaseMixin'
|
||||
import { getComponentFromProp } from '../_util/props-util'
|
||||
import { getComponentFromProp, filterEmpty } from '../_util/props-util'
|
||||
import { requestAnimationTimeout, cancelAnimationTimeout } from '../_util/requestAnimationTimeout'
|
||||
import {
|
||||
noop,
|
||||
@ -66,6 +66,9 @@ const SubMenu = {
|
||||
store: PropTypes.object,
|
||||
mode: PropTypes.oneOf(['horizontal', 'vertical', 'vertical-left', 'vertical-right', 'inline']).def('vertical'),
|
||||
manualRef: PropTypes.func.def(noop),
|
||||
builtinPlacements: PropTypes.object.def({}),
|
||||
itemIcon: PropTypes.any,
|
||||
expandIcon: PropTypes.any,
|
||||
},
|
||||
mixins: [BaseMixin],
|
||||
isSubMenu: true,
|
||||
@ -350,13 +353,15 @@ const SubMenu = {
|
||||
subMenuCloseDelay: props.subMenuCloseDelay,
|
||||
forceSubMenuRender: props.forceSubMenuRender,
|
||||
triggerSubMenuAction: props.triggerSubMenuAction,
|
||||
builtinPlacements: props.builtinPlacements,
|
||||
defaultActiveFirst: props.store.getState()
|
||||
.defaultActiveFirst[getMenuIdFromSubMenuEventKey(props.eventKey)],
|
||||
multiple: props.multiple,
|
||||
prefixCls: props.rootPrefixCls,
|
||||
manualRef: this.saveMenuInstance,
|
||||
itemIcon: getComponentFromProp(this, 'itemIcon'),
|
||||
expandIcon: getComponentFromProp(this, 'expandIcon'),
|
||||
children,
|
||||
__propsSymbol__: Symbol(),
|
||||
},
|
||||
on: {
|
||||
click: this.onSubMenuClick,
|
||||
@ -475,13 +480,18 @@ const SubMenu = {
|
||||
class: `${prefixCls}-title`,
|
||||
ref: 'subMenuTitle',
|
||||
}
|
||||
// expand custom icon should NOT be displayed in menu with horizontal mode.
|
||||
let icon = null
|
||||
if (props.mode !== 'horizontal') {
|
||||
icon = getComponentFromProp(this, 'expandIcon', props)
|
||||
}
|
||||
const title = (
|
||||
<div {...titleProps}>
|
||||
{getComponentFromProp(this, 'title')}
|
||||
<i class={`${prefixCls}-arrow`} />
|
||||
{icon || <i class={`${prefixCls}-arrow`} />}
|
||||
</div>
|
||||
)
|
||||
const children = this.renderChildren(this.$slots.default)
|
||||
const children = this.renderChildren(filterEmpty(this.$slots.default))
|
||||
|
||||
const getPopupContainer = this.parentMenu.isRootMenu
|
||||
? this.parentMenu.getPopupContainer : triggerNode => triggerNode.parentNode
|
||||
@ -503,6 +513,7 @@ const SubMenu = {
|
||||
popupClassName={`${prefixCls}-popup ${rootPrefixCls}-${parentMenu.theme} ${popupClassName || ''}`}
|
||||
getPopupContainer={getPopupContainer}
|
||||
builtinPlacements={placements}
|
||||
builtinPlacements={Object.assign({}, placements, props.builtinPlacements)}
|
||||
popupPlacement={popupPlacement}
|
||||
popupVisible={isOpen}
|
||||
popupAlign={popupAlign}
|
||||
|
@ -7,7 +7,7 @@ import classNames from 'classnames'
|
||||
import { getKeyFromChildrenIndex, loopMenuItem, noop } from './util'
|
||||
import DOMWrap from './DOMWrap'
|
||||
import { cloneElement } from '../_util/vnode'
|
||||
import { initDefaultProps, getOptionProps, getEvents } from '../_util/props-util'
|
||||
import { initDefaultProps, getOptionProps, getPropsData, getEvents, getComponentFromProp } from '../_util/props-util'
|
||||
|
||||
function allDisabled (arr) {
|
||||
if (!arr.length) {
|
||||
@ -28,18 +28,15 @@ function updateActiveKey (store, menuId, activeKey) {
|
||||
})
|
||||
}
|
||||
|
||||
function getEventKey (props) {
|
||||
// when eventKey not available ,it's menu and return menu id '0-menu-'
|
||||
return props.eventKey || '0-menu-'
|
||||
}
|
||||
|
||||
export function saveRef (key, c) {
|
||||
if (c) {
|
||||
const index = this.instanceArrayKeyIndexMap[key]
|
||||
this.instanceArray[index] = c
|
||||
// const index = this.instanceArray.indexOf(c)
|
||||
// if (index !== -1) {
|
||||
// // update component if it's already inside instanceArray
|
||||
// this.instanceArray[index] = c
|
||||
// } else {
|
||||
// // add component if it's not in instanceArray yet;
|
||||
// this.instanceArray.push(c)
|
||||
// }
|
||||
}
|
||||
}
|
||||
export function getActiveKey (props, originalActiveKey) {
|
||||
@ -100,6 +97,8 @@ const SubPopupMenu = {
|
||||
triggerSubMenuAction: PropTypes.oneOf(['click', 'hover']),
|
||||
inlineIndent: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
||||
manualRef: PropTypes.func,
|
||||
itemIcon: PropTypes.any,
|
||||
expandIcon: PropTypes.any,
|
||||
children: PropTypes.any.def([]),
|
||||
__propsSymbol__: PropTypes.any, // mock componentWillReceiveProps
|
||||
}, {
|
||||
@ -129,17 +128,14 @@ const SubPopupMenu = {
|
||||
this.manualRef(this)
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
__propsSymbol__ () {
|
||||
const props = getOptionProps(this)
|
||||
const storeActiveKey = this.getStore().getState().activeKey[this.getEventKey()]
|
||||
const originalActiveKey = 'activeKey' in props ? props.activeKey
|
||||
: storeActiveKey
|
||||
const activeKey = getActiveKey(props, originalActiveKey)
|
||||
if (activeKey !== originalActiveKey || storeActiveKey !== activeKey) {
|
||||
updateActiveKey(this.getStore(), this.getEventKey(), activeKey)
|
||||
}
|
||||
},
|
||||
updated () {
|
||||
const props = getOptionProps(this)
|
||||
const originalActiveKey = 'activeKey' in props ? props.activeKey
|
||||
: props.store.getState().activeKey[getEventKey(props)]
|
||||
const activeKey = getActiveKey(props, originalActiveKey)
|
||||
if (activeKey !== originalActiveKey) {
|
||||
updateActiveKey(props.store, getEventKey(props), activeKey)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// all keyboard events callbacks run from here at first
|
||||
@ -160,7 +156,7 @@ const SubPopupMenu = {
|
||||
}
|
||||
if (activeItem) {
|
||||
e.preventDefault()
|
||||
updateActiveKey(this.getStore(), this.getEventKey(), activeItem.eventKey)
|
||||
updateActiveKey(this.$props.store, getEventKey(this.$props), activeItem.eventKey)
|
||||
|
||||
if (typeof callback === 'function') {
|
||||
callback(activeItem)
|
||||
@ -172,7 +168,7 @@ const SubPopupMenu = {
|
||||
|
||||
onItemHover (e) {
|
||||
const { key, hover } = e
|
||||
updateActiveKey(this.getStore(), this.getEventKey(), hover ? key : null)
|
||||
updateActiveKey(this.$props.store, getEventKey(this.$props), hover ? key : null)
|
||||
},
|
||||
|
||||
onDeselect (selectInfo) {
|
||||
@ -199,22 +195,13 @@ const SubPopupMenu = {
|
||||
return this.instanceArray
|
||||
},
|
||||
|
||||
getStore () {
|
||||
return this.store
|
||||
},
|
||||
|
||||
getEventKey () {
|
||||
// when eventKey not available ,it's menu and return menu id '0-menu-'
|
||||
return this.eventKey !== undefined ? this.eventKey : '0-menu-'
|
||||
},
|
||||
|
||||
getOpenTransitionName () {
|
||||
return this.$props.openTransitionName
|
||||
},
|
||||
|
||||
step (direction) {
|
||||
let children = this.getFlatInstanceArray()
|
||||
const activeKey = this.getStore().getState().activeKey[this.getEventKey()]
|
||||
const activeKey = this.$props.store.getState().activeKey[getEventKey(this.$props)]
|
||||
const len = children.length
|
||||
if (!len) {
|
||||
return null
|
||||
@ -251,14 +238,40 @@ const SubPopupMenu = {
|
||||
|
||||
return null
|
||||
},
|
||||
|
||||
getIcon (instance, name) {
|
||||
if (instance.$createElement) {
|
||||
const temp = instance[name]
|
||||
if (temp !== undefined) {
|
||||
return temp
|
||||
}
|
||||
return instance.$slots[name] || instance.$scopedSlots[name]
|
||||
} else {
|
||||
const temp = getPropsData(instance)[name]
|
||||
if (temp !== undefined) {
|
||||
return temp
|
||||
}
|
||||
const slotsProp = []
|
||||
const componentOptions = instance.componentOptions || {};
|
||||
(componentOptions.children || []).forEach((child) => {
|
||||
if (child.data && child.data.slot === name) {
|
||||
if (child.tag === 'template') {
|
||||
slotsProp.push(child.children)
|
||||
} else {
|
||||
slotsProp.push(child)
|
||||
}
|
||||
}
|
||||
})
|
||||
return slotsProp.length ? slotsProp : undefined
|
||||
}
|
||||
},
|
||||
renderCommonMenuItem (child, i, extraProps) {
|
||||
if (child.tag === undefined) { return child }
|
||||
const state = this.getStore().getState()
|
||||
const state = this.$props.store.getState()
|
||||
const props = this.$props
|
||||
const key = getKeyFromChildrenIndex(child, props.eventKey, i)
|
||||
const childProps = child.componentOptions.propsData || {}
|
||||
const isActive = key === state.activeKey[this.getEventKey()]
|
||||
|
||||
const isActive = key === state.activeKey[getEventKey(this.$props)]
|
||||
if (!childProps.disabled) {
|
||||
// manualRef的执行顺序不能保证,使用key映射ref在this.instanceArray中的位置
|
||||
this.instanceArrayKeyIndexMap[key] = Object.keys(this.instanceArrayKeyIndexMap).length
|
||||
@ -266,7 +279,7 @@ const SubPopupMenu = {
|
||||
const childListeners = getEvents(child)
|
||||
const newChildProps = {
|
||||
props: {
|
||||
mode: props.mode,
|
||||
mode: childProps.mode || props.mode,
|
||||
level: props.level,
|
||||
inlineIndent: props.inlineIndent,
|
||||
renderMenuItem: this.renderMenuItem,
|
||||
@ -283,6 +296,9 @@ const SubPopupMenu = {
|
||||
subMenuOpenDelay: props.subMenuOpenDelay,
|
||||
subMenuCloseDelay: props.subMenuCloseDelay,
|
||||
forceSubMenuRender: props.forceSubMenuRender,
|
||||
builtinPlacements: props.builtinPlacements,
|
||||
itemIcon: this.getIcon(child, 'itemIcon') || this.getIcon(this, 'itemIcon'),
|
||||
expandIcon: this.getIcon(child, 'expandIcon') || this.getIcon(this, 'expandIcon'),
|
||||
...extraProps,
|
||||
},
|
||||
on: {
|
||||
@ -307,7 +323,7 @@ const SubPopupMenu = {
|
||||
if (!c) {
|
||||
return null
|
||||
}
|
||||
const state = this.getStore().getState()
|
||||
const state = this.$props.store.getState()
|
||||
const extraProps = {
|
||||
openKeys: state.openKeys,
|
||||
selectedKeys: state.selectedKeys,
|
||||
@ -320,7 +336,7 @@ const SubPopupMenu = {
|
||||
},
|
||||
render () {
|
||||
const { ...props } = this.$props
|
||||
const { eventKey, visible } = props
|
||||
const { eventKey, prefixCls, visible, level, mode, theme } = props
|
||||
this.instanceArray = []
|
||||
this.instanceArrayKeyIndexMap = {}
|
||||
const className = classNames(
|
||||
@ -332,6 +348,11 @@ const SubPopupMenu = {
|
||||
tag: 'ul',
|
||||
// hiddenClassName: `${prefixCls}-hidden`,
|
||||
visible,
|
||||
prefixCls,
|
||||
level,
|
||||
mode,
|
||||
theme,
|
||||
overflowedIndicator: getComponentFromProp(this, 'overflowedIndicator'),
|
||||
},
|
||||
attrs: {
|
||||
role: props.role || 'menu',
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
@font-face {
|
||||
font-family: 'FontAwesome';
|
||||
src: url('https://cdn.bootcss.com/font-awesome/4.2.0/fonts/fontawesome-webfont.eot?v=4.2.0');
|
||||
src: url('https://cdn.bootcss.com/font-awesome/4.2.0/fonts/fontawesome-webfont.eot?#iefix&v=4.2.0') format('embedded-opentype'), url('https://cdn.bootcss.com/font-awesome/4.2.0/fonts/fontawesome-webfont.woff?v=4.2.0') format('woff'), url('https://cdn.bootcss.com/font-awesome/4.2.0/fonts/fontawesome-webfont.ttf?v=4.2.0') format('truetype'), url('https://cdn.bootcss.com/font-awesome/4.2.0/fonts/fontawesome-webfont.svg?v=4.2.0#fontawesomeregular') format('svg');
|
||||
src: url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/fonts/fontawesome-webfont.eot');
|
||||
src: url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/fonts/fontawesome-webfont.eot?#iefix') format('embedded-opentype'), url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/fonts/fontawesome-webfont.woff') format('woff'), url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/fonts/fontawesome-webfont.ttf') format('truetype'), url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/fonts/fontawesome-webfont.svg?#fontawesomeregular') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
@ -92,6 +92,10 @@
|
||||
&-submenu {
|
||||
&-popup {
|
||||
position: absolute;
|
||||
|
||||
.submenu-title-wrapper {
|
||||
padding-right: 20px;
|
||||
}
|
||||
}
|
||||
> .@{menuPrefixCls} {
|
||||
background-color: #fff;
|
||||
@ -110,17 +114,19 @@
|
||||
&-horizontal {
|
||||
background-color: #F3F5F7;
|
||||
border: none;
|
||||
border-bottom: 1px solid transparent;
|
||||
border-bottom: 1px solid #d9d9d9;
|
||||
box-shadow: none;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
|
||||
& > .@{menuPrefixCls}-item, & > .@{menuPrefixCls}-submenu > .@{menuPrefixCls}-submenu-title {
|
||||
padding: 15px 20px;
|
||||
}
|
||||
|
||||
& > .@{menuPrefixCls}-submenu, & > .@{menuPrefixCls}-item {
|
||||
float: left;
|
||||
border-bottom: 2px solid transparent;
|
||||
display: inline-block;
|
||||
vertical-align: bottom;
|
||||
|
||||
&-active {
|
||||
border-bottom: 2px solid #2db7f5;
|
||||
|
@ -23,4 +23,8 @@ export default {
|
||||
forceSubMenuRender: PropTypes.bool,
|
||||
selectable: PropTypes.bool,
|
||||
isRootMenu: PropTypes.bool.def(true),
|
||||
builtinPlacements: PropTypes.object.def({}),
|
||||
itemIcon: PropTypes.any,
|
||||
expandIcon: PropTypes.any,
|
||||
overflowedIndicator: PropTypes.any,
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
// based on rc-menu 7.0.5
|
||||
// based on rc-menu 7.4.19
|
||||
import Menu from './Menu'
|
||||
import SubMenu from './SubMenu'
|
||||
import MenuItem, { menuItemProps } from './MenuItem'
|
||||
|
@ -77,6 +77,7 @@ export const menuAllProps = {
|
||||
'rootPrefixCls',
|
||||
'eventKey',
|
||||
'active',
|
||||
'popupAlign',
|
||||
'popupOffset',
|
||||
'isOpen',
|
||||
'renderMenuItem',
|
||||
@ -87,6 +88,8 @@ export const menuAllProps = {
|
||||
'isSelected',
|
||||
'store',
|
||||
'activeKey',
|
||||
'builtinPlacements',
|
||||
'overflowedIndicator',
|
||||
|
||||
// the following keys found need to be removed from test regression
|
||||
'attribute',
|
||||
@ -95,6 +98,8 @@ export const menuAllProps = {
|
||||
'inlineCollapsed',
|
||||
'menu',
|
||||
'theme',
|
||||
'itemIcon',
|
||||
'expandIcon',
|
||||
],
|
||||
on: [
|
||||
'select',
|
||||
@ -107,3 +112,15 @@ export const menuAllProps = {
|
||||
'titleClick',
|
||||
],
|
||||
}
|
||||
|
||||
export const getWidth = (elem) => (
|
||||
elem &&
|
||||
typeof elem.getBoundingClientRect === 'function' &&
|
||||
elem.getBoundingClientRect().width
|
||||
) || 0
|
||||
|
||||
export const setStyle = (elem, styleProperty, value) => {
|
||||
if (elem && typeof elem.style === 'object') {
|
||||
elem.style[styleProperty] = value
|
||||
}
|
||||
}
|
||||
|
@ -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 (
|
||||
<div class={className} style={style || { right: '50%' } } onMouseenter={clearCloseTimer}
|
||||
onMouseleave={startCloseTimer}
|
||||
@ -72,7 +74,7 @@ export default {
|
||||
<div class={`${componentClass}-content`}>{$slots.default}</div>
|
||||
{closable
|
||||
? <a tabIndex='0' onClick={close} class={`${componentClass}-close`}>
|
||||
<span class={`${componentClass}-close-x`}></span>
|
||||
{closeIcon || <span class={`${componentClass}-close-x`}/>}
|
||||
</a> : null
|
||||
}
|
||||
</div>
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
|
@ -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) || <a class={`${prefixCls}-item-link`} />
|
||||
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', <a class={`${prefixCls}-item-link`} />)}
|
||||
{this.itemRender(prevPage, 'prev', this.getItemIcon('prevIcon'))}
|
||||
</li>
|
||||
<li
|
||||
title={this.showTitle ? `${stateCurrent}/${allPages}` : null}
|
||||
@ -338,7 +347,7 @@ export default {
|
||||
class={`${hasNext ? '' : `${prefixCls}-disabled`} ${prefixCls}-next`}
|
||||
aria-disabled={!this.hasNext()}
|
||||
>
|
||||
{this.itemRender(nextPage, 'next', <a class={`${prefixCls}-item-link`} />)}
|
||||
{this.itemRender(nextPage, 'next', this.getItemIcon('nextIcon'))}
|
||||
</li>
|
||||
{gotoButton}
|
||||
</ul>
|
||||
@ -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 = (
|
||||
<li
|
||||
title={this.showTitle ? prevItemTitle : null}
|
||||
@ -372,13 +385,19 @@ export default {
|
||||
onClick={this.jumpPrev}
|
||||
tabIndex='0'
|
||||
onKeypress={this.runIfEnterJumpPrev}
|
||||
class={`${prefixCls}-jump-prev`}
|
||||
class={jumpPrevClassString}
|
||||
>
|
||||
{this.itemRender(
|
||||
this.getJumpPrevPage(), 'jump-prev', <a class={`${prefixCls}-item-link`} />
|
||||
this.getJumpPrevPage(),
|
||||
'jump-prev',
|
||||
this.getItemIcon('jumpPrevIcon')
|
||||
)}
|
||||
</li>
|
||||
)
|
||||
let jumpNextClassString = `${prefixCls}-jump-next`
|
||||
if (props.jumpNextIcon) {
|
||||
jumpNextClassString += ` ${prefixCls}-jump-next-custom-icon`
|
||||
}
|
||||
jumpNext = (
|
||||
<li
|
||||
title={this.showTitle ? nextItemTitle : null}
|
||||
@ -386,10 +405,12 @@ export default {
|
||||
tabIndex='0'
|
||||
onClick={this.jumpNext}
|
||||
onKeypress={this.runIfEnterJumpNext}
|
||||
class={`${prefixCls}-jump-next`}
|
||||
class={jumpNextClassString}
|
||||
>
|
||||
{this.itemRender(
|
||||
this.getJumpNextPage(), 'jump-next', <a class={`${prefixCls}-item-link`} />
|
||||
this.getJumpNextPage(),
|
||||
'jump-next',
|
||||
this.getItemIcon('jumpNextIcon')
|
||||
)}
|
||||
</li>
|
||||
)
|
||||
@ -527,7 +548,10 @@ export default {
|
||||
class={`${!prevDisabled ? '' : `${prefixCls}-disabled`} ${prefixCls}-prev`}
|
||||
aria-disabled={prevDisabled}
|
||||
>
|
||||
{this.itemRender(prevPage, 'prev', <a class={`${prefixCls}-item-link`} />)}
|
||||
{this.itemRender(prevPage,
|
||||
'prev',
|
||||
this.getItemIcon('prevIcon')
|
||||
)}
|
||||
</li>
|
||||
{pagerList}
|
||||
<li
|
||||
@ -538,7 +562,10 @@ export default {
|
||||
class={`${!nextDisabled ? '' : `${prefixCls}-disabled`} ${prefixCls}-next`}
|
||||
aria-disabled={nextDisabled}
|
||||
>
|
||||
{this.itemRender(nextPage, 'next', <a class={`${prefixCls}-item-link`} />)}
|
||||
{this.itemRender(nextPage,
|
||||
'next',
|
||||
this.getItemIcon('nextIcon')
|
||||
)}
|
||||
</li>
|
||||
<Options
|
||||
locale={locale}
|
||||
|
@ -1,2 +1,2 @@
|
||||
// based on rc-pagination 1.16.5
|
||||
// based on rc-pagination 1.17.3
|
||||
export { default } from './Pagination'
|
||||
|
15
components/vc-pagination/locale/he_IL.js
Normal file
15
components/vc-pagination/locale/he_IL.js
Normal file
@ -0,0 +1,15 @@
|
||||
export default {
|
||||
// Options.jsx
|
||||
items_per_page: '/ עמוד',
|
||||
jump_to: 'עבור אל',
|
||||
jump_to_confirm: 'אישור',
|
||||
page: '',
|
||||
|
||||
// Pagination.jsx
|
||||
prev_page: 'העמוד הקודם',
|
||||
next_page: 'העמוד הבא',
|
||||
prev_5: '5 עמודים קודמים',
|
||||
next_5: '5 עמודים הבאים',
|
||||
prev_3: '3 עמודים קודמים',
|
||||
next_3: '3 עמודים הבאים',
|
||||
};
|
15
components/vc-pagination/locale/mm_MM.js
Normal file
15
components/vc-pagination/locale/mm_MM.js
Normal file
@ -0,0 +1,15 @@
|
||||
export default {
|
||||
// Options.jsx
|
||||
items_per_page: '/ စာမျက်နှာ',
|
||||
jump_to: 'သွားရန်',
|
||||
jump_to_confirm: 'သေချာပြီ',
|
||||
page: '',
|
||||
|
||||
// Pagination.jsx
|
||||
prev_page: 'ယခင်စာမျက်နှာ',
|
||||
next_page: 'နောက်စာမျက်နှာ',
|
||||
prev_5: 'ယခင် ၅ခုမြောက်',
|
||||
next_5: 'နောက် ၅ခုမြောက်',
|
||||
prev_3: 'ယခင် ၃ခုမြောက်',
|
||||
next_3: 'နောက် ၃ခုမြောက်',
|
||||
};
|
15
components/vc-pagination/locale/mn_MN.js
Normal file
15
components/vc-pagination/locale/mn_MN.js
Normal file
@ -0,0 +1,15 @@
|
||||
export default {
|
||||
// Options.jsx
|
||||
items_per_page: '/ хуудас',
|
||||
jump_to: 'Шилжих',
|
||||
jump_to_confirm: 'сонгох',
|
||||
page: '',
|
||||
|
||||
// Pagination.jsx
|
||||
prev_page: 'Өмнөх хуудас',
|
||||
next_page: 'Дараагийн хуудас',
|
||||
prev_5: 'Дараагийн 5 хуудас',
|
||||
next_5: 'Дараагийн 5 хуудас',
|
||||
prev_3: 'Дараагийн 3 хуудас',
|
||||
next_3: 'Дараагийн 3 хуудас',
|
||||
};
|
@ -1,6 +1,6 @@
|
||||
export default {
|
||||
// Options.jsx
|
||||
items_per_page: '/странице',
|
||||
items_per_page: '/ стр.',
|
||||
jump_to: 'Перейти',
|
||||
jump_to_confirm: 'подтвердить',
|
||||
page: '',
|
||||
|
@ -1,4 +1,4 @@
|
||||
// based on rc-progress 2.2.5
|
||||
// based on rc-progress 2.2.6
|
||||
import Progress, { Line, Circle } from './src/'
|
||||
|
||||
export {
|
||||
|
@ -18,7 +18,7 @@ const Circle = {
|
||||
props: initDefaultProps(circlePropTypes, circleDefaultProps),
|
||||
methods: {
|
||||
getPathStyles () {
|
||||
const { percent, strokeWidth, gapDegree = 0, gapPosition } = this.$props
|
||||
const { percent, strokeWidth, strokeColor, gapDegree = 0, gapPosition } = this.$props
|
||||
const radius = 50 - (strokeWidth / 2)
|
||||
let beginPositionX = 0
|
||||
let beginPositionY = -radius
|
||||
@ -48,6 +48,7 @@ const Circle = {
|
||||
a ${radius},${radius} 0 1 1 ${-endPositionX},${endPositionY}`
|
||||
const len = Math.PI * 2 * radius
|
||||
const trailPathStyle = {
|
||||
stroke: strokeColor,
|
||||
strokeDasharray: `${len - gapDegree}px ${len}px`,
|
||||
strokeDashoffset: `-${gapDegree / 2}px`,
|
||||
transition: 'stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s',
|
||||
@ -62,13 +63,14 @@ const Circle = {
|
||||
},
|
||||
render () {
|
||||
const {
|
||||
prefixCls, strokeWidth, trailWidth, strokeColor,
|
||||
prefixCls, strokeWidth, trailWidth,
|
||||
trailColor, strokeLinecap, percent, ...restProps
|
||||
} = this.$props
|
||||
const { pathString, trailPathStyle, strokePathStyle } = this.getPathStyles()
|
||||
delete restProps.percent
|
||||
delete restProps.gapDegree
|
||||
delete restProps.gapPosition
|
||||
delete restProps.strokeColor
|
||||
const pathFirst = {
|
||||
attrs: {
|
||||
'd': pathString,
|
||||
@ -83,7 +85,6 @@ const Circle = {
|
||||
attrs: {
|
||||
'd': pathString,
|
||||
'stroke-linecap': strokeLinecap,
|
||||
'stroke': strokeColor,
|
||||
'stroke-width': percent === 0 ? 0 : strokeWidth,
|
||||
'fill-opacity': '0',
|
||||
},
|
||||
|
@ -1,3 +1,3 @@
|
||||
// based on rc-rate 2.4.0
|
||||
// based on rc-rate 2.4.3
|
||||
import Rate from './src/'
|
||||
export default Rate
|
||||
|
@ -180,6 +180,7 @@ export default {
|
||||
const starProps = {
|
||||
props: {
|
||||
index,
|
||||
count,
|
||||
disabled,
|
||||
prefixCls: `${prefixCls}-star`,
|
||||
allowHalf,
|
||||
@ -213,6 +214,7 @@ export default {
|
||||
onBlur={disabled ? noop : this.onBlur}
|
||||
onKeydown={disabled ? noop : this.onKeyDown}
|
||||
ref='rateRef'
|
||||
role='radiogroup'
|
||||
>
|
||||
{stars}
|
||||
</ul>
|
||||
|
@ -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 {
|
||||
<li
|
||||
class={this.getClassName()}
|
||||
onClick={disabled ? noop : onClick}
|
||||
onKeydown={disabled ? noop : onKeyDown}
|
||||
onMousemove={disabled ? noop : onHover}
|
||||
role='radio'
|
||||
aria-checked={value > index ? 'true' : 'false'}
|
||||
aria-posinset={index + 1}
|
||||
aria-setsize={count}
|
||||
tabIndex={0}
|
||||
>
|
||||
<div class={`${prefixCls}-first`}>{character}</div>
|
||||
<div class={`${prefixCls}-second`}>{character}</div>
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
import classnames from 'classnames'
|
||||
import Trigger from '../trigger'
|
||||
import Trigger from '../vc-trigger'
|
||||
import PropTypes from '../_util/vue-types'
|
||||
import DropdownMenu from './DropdownMenu'
|
||||
import { isSingleMode, saveRef } from './util'
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
import PropTypes from '../_util/vue-types'
|
||||
import BaseMixin from '../_util/BaseMixin'
|
||||
import Trigger from '../trigger'
|
||||
import Trigger from '../vc-trigger'
|
||||
import Panel from './Panel'
|
||||
import placements from './placements'
|
||||
import moment from 'moment'
|
||||
|
@ -15,7 +15,7 @@ export default {
|
||||
render () {
|
||||
const { overlay, prefixCls } = this
|
||||
return (
|
||||
<div class={`${prefixCls}-inner`}>
|
||||
<div class={`${prefixCls}-inner`} role='tooltip'>
|
||||
{typeof overlay === 'function' ? overlay() : overlay}
|
||||
</div>
|
||||
)
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
import PropTypes from '../_util/vue-types'
|
||||
import Trigger from '../trigger'
|
||||
import Trigger from '../vc-trigger'
|
||||
import { placements } from './placements'
|
||||
import Content from './Content'
|
||||
import { hasProp, getComponentFromProp, getOptionProps } from '../_util/props-util'
|
||||
|
@ -1,4 +1,4 @@
|
||||
// based on rc-tooltip 3.7.2
|
||||
// based on rc-tooltip 3.7.3
|
||||
import Tooltip from './Tooltip'
|
||||
|
||||
export default Tooltip
|
||||
|
@ -1,7 +1,7 @@
|
||||
import PropTypes from '../../_util/vue-types'
|
||||
import classnames from 'classnames'
|
||||
import omit from 'omit.js'
|
||||
import Trigger from '../../trigger'
|
||||
import Trigger from '../../vc-trigger'
|
||||
import Tree, { TreeNode } from '../../vc-tree'
|
||||
import { SelectPropTypes } from './PropTypes'
|
||||
import BaseMixin from '../../_util/BaseMixin'
|
||||
|
@ -1,4 +1,4 @@
|
||||
// based on rc-tree 1.14.6
|
||||
// based on rc-tree 1.14.8
|
||||
'use strict'
|
||||
|
||||
module.exports = require('./src/')
|
||||
|
@ -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()
|
||||
})
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
import PropTypes from '../_util/vue-types'
|
||||
import Align from '../align'
|
||||
import Align from '../vc-align'
|
||||
import PopupInner from './PopupInner'
|
||||
import LazyRenderBox from './LazyRenderBox'
|
||||
import { noop } from './utils'
|
||||
@ -181,10 +181,7 @@ export default {
|
||||
// hiddenClassName,
|
||||
},
|
||||
class: className,
|
||||
on: {
|
||||
mouseenter: mouseenter || noop,
|
||||
mouseleave: mouseleave || noop,
|
||||
},
|
||||
on: $listeners,
|
||||
ref: 'popupInstance',
|
||||
style: { ...sizeStyle, ...popupStyle, ...this.getZIndexStyle() },
|
||||
}
|
@ -70,6 +70,14 @@ export default {
|
||||
},
|
||||
|
||||
mixins: [BaseMixin],
|
||||
provide () {
|
||||
return {
|
||||
vcTriggerContext: this,
|
||||
}
|
||||
},
|
||||
inject: {
|
||||
vcTriggerContext: { default: {}},
|
||||
},
|
||||
data () {
|
||||
const props = this.$props
|
||||
let popupVisible
|
||||
@ -122,6 +130,7 @@ export default {
|
||||
beforeDestroy () {
|
||||
this.clearDelayTimer()
|
||||
this.clearOutsideHandler()
|
||||
clearTimeout(this.mouseDownTimeout)
|
||||
},
|
||||
methods: {
|
||||
updatedCal () {
|
||||
@ -260,6 +269,19 @@ export default {
|
||||
this.setPopupVisible(!this.$data.sPopupVisible, event)
|
||||
}
|
||||
},
|
||||
onPopupMouseDown (...args) {
|
||||
const { vcTriggerContext = {}} = this
|
||||
this.hasPopupMouseDown = true
|
||||
|
||||
clearTimeout(this.mouseDownTimeout)
|
||||
this.mouseDownTimeout = setTimeout(() => {
|
||||
this.hasPopupMouseDown = false
|
||||
}, 0)
|
||||
|
||||
if (vcTriggerContext.onPopupMouseDown) {
|
||||
vcTriggerContext.onPopupMouseDown(...args)
|
||||
}
|
||||
},
|
||||
|
||||
onDocumentClick (event) {
|
||||
if (this.$props.mask && !this.$props.maskClosable) {
|
||||
@ -267,8 +289,7 @@ export default {
|
||||
}
|
||||
const target = event.target
|
||||
const root = this.$el
|
||||
const popupNode = this.getPopupDomNode()
|
||||
if (!contains(root, target) && !contains(popupNode, target)) {
|
||||
if (!contains(root, target) && !this.hasPopupMouseDown) {
|
||||
this.close()
|
||||
}
|
||||
},
|
||||
@ -318,6 +339,8 @@ export default {
|
||||
if (this.isMouseLeaveToHide()) {
|
||||
mouseProps.mouseleave = self.onPopupMouseleave
|
||||
}
|
||||
mouseProps.mousedown = this.onPopupMouseDown
|
||||
mouseProps.touchstart = this.onPopupMouseDown
|
||||
const {
|
||||
handleGetPopupClassFromAlign, getRootDomNode,
|
||||
getContainer, $listeners } = self
|
@ -1,3 +1,3 @@
|
||||
// based on rc-trigger 2.5.4
|
||||
// based on rc-trigger 2.6.2
|
||||
import Trigger from './Trigger'
|
||||
export default Trigger
|
@ -172,6 +172,7 @@
|
||||
"json2mq": "^0.2.0",
|
||||
"lodash": "^4.17.5",
|
||||
"moment": "^2.21.0",
|
||||
"mutationobserver-shim": "^0.3.2",
|
||||
"omit.js": "^1.0.0",
|
||||
"raf": "^3.4.0",
|
||||
"resize-observer-polyfill": "^1.5.0",
|
||||
|
Loading…
Reference in New Issue
Block a user