feat: update to 3.10.9
parent
6b55bf4289
commit
0d3821910f
|
@ -0,0 +1,30 @@
|
|||
import raf from 'raf'
|
||||
|
||||
let id = 0
|
||||
const ids = {}
|
||||
|
||||
// Support call raf with delay specified frame
|
||||
export default function wrapperRaf (callback, delayFrames = 1) {
|
||||
const myId = id++
|
||||
let restFrames = delayFrames
|
||||
|
||||
function internalCallback () {
|
||||
restFrames -= 1
|
||||
|
||||
if (restFrames <= 0) {
|
||||
callback()
|
||||
delete ids[id]
|
||||
} else {
|
||||
ids[id] = raf(internalCallback)
|
||||
}
|
||||
}
|
||||
|
||||
ids[id] = raf(internalCallback)
|
||||
|
||||
return myId
|
||||
}
|
||||
|
||||
wrapperRaf.cancel = function (id) {
|
||||
raf.cancel(ids[id])
|
||||
delete ids[id]
|
||||
}
|
|
@ -1,10 +1,13 @@
|
|||
|
||||
import TransitionEvents from './css-animation/Event'
|
||||
|
||||
import raf from '../_util/raf'
|
||||
let styleForPesudo
|
||||
|
||||
// Where el is the DOM element you'd like to test for visibility
|
||||
function isHidden (element) {
|
||||
if (process.env.NODE_ENV === 'test') {
|
||||
return false
|
||||
}
|
||||
return !element || element.offsetParent === null
|
||||
}
|
||||
|
||||
|
@ -25,6 +28,10 @@ export default {
|
|||
if (this.instance) {
|
||||
this.instance.cancel()
|
||||
}
|
||||
if (this.clickWaveTimeoutId) {
|
||||
clearTimeout(this.clickWaveTimeoutId)
|
||||
}
|
||||
this.destroy = true
|
||||
},
|
||||
methods: {
|
||||
isNotGrey (color) {
|
||||
|
@ -66,6 +73,7 @@ export default {
|
|||
if (insertExtraNode) {
|
||||
node.appendChild(extraNode)
|
||||
}
|
||||
TransitionEvents.addStartEventListener(node, this.onTransitionStart)
|
||||
TransitionEvents.addEndEventListener(node, this.onTransitionEnd)
|
||||
},
|
||||
|
||||
|
@ -88,6 +96,13 @@ export default {
|
|||
getComputedStyle(node).getPropertyValue('border-color') ||
|
||||
getComputedStyle(node).getPropertyValue('background-color')
|
||||
this.clickWaveTimeoutId = window.setTimeout(() => this.onClick(node, waveColor), 0)
|
||||
raf.cancel(this.animationStartId)
|
||||
this.animationStart = true
|
||||
|
||||
// Render to trigger transition event cost 3 frames. Let's delay 10 frames to reset this.
|
||||
this.animationStartId = raf(() => {
|
||||
this.animationStart = false
|
||||
}, 10)
|
||||
}
|
||||
node.addEventListener('click', onClick, true)
|
||||
return {
|
||||
|
@ -112,9 +127,21 @@ export default {
|
|||
if (insertExtraNode && this.extraNode && node.contains(this.extraNode)) {
|
||||
node.removeChild(this.extraNode)
|
||||
}
|
||||
TransitionEvents.removeStartEventListener(node, this.onTransitionStart)
|
||||
TransitionEvents.removeEndEventListener(node, this.onTransitionEnd)
|
||||
},
|
||||
onTransitionStart (e) {
|
||||
if (this.destroy) return
|
||||
|
||||
const node = this.$el
|
||||
if (!e || e.target !== node) {
|
||||
return
|
||||
}
|
||||
|
||||
if (!this.animationStart) {
|
||||
this.resetEffect(node)
|
||||
}
|
||||
},
|
||||
onTransitionEnd (e) {
|
||||
if (!e || e.animationName !== 'fadeEffect') {
|
||||
return
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
| slot="default" (for customize input element) | customize input element | HTMLInputElement / HTMLTextAreaElement | `<Input />` |
|
||||
| dataSource | Data source for autocomplete | slot \| [DataSourceItemType](https://github.com/vueComponent/ant-design-vue/blob/724d53b907e577cf5880c1e6742d4c3f924f8f49/components/auto-complete/index.vue#L9)\[] | |
|
||||
| defaultActiveFirstOption | Whether active first option by default | boolean | true |
|
||||
| defaultValue | Initial selected option. | string\|string\[]\|{ key: string, label: string\|vNodes }\|Array<{ key: string, label: string\|vNodes }> | - |
|
||||
| defaultValue | Initial selected option. | string\|string\[]\| - |
|
||||
| disabled | Whether disabled select | boolean | false |
|
||||
| filterOption | If true, filter options by input, if function, filter options against it. The function will receive two arguments, `inputValue` and `option`, if the function returns `true`, the option will be included in the filtered set; Otherwise, it will be excluded. | boolean or function(inputValue, option) | true |
|
||||
| optionLabelProp | Which prop value of option will render as content of select. | string | `children` |
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
| slot="default" (自定义输入框) | 自定义输入框 | HTMLInputElement / HTMLTextAreaElement | `<Input />` |
|
||||
| dataSource | 自动完成的数据源 | slot \| [DataSourceItemType](https://github.com/vueComponent/ant-design-vue/blob/724d53b907e577cf5880c1e6742d4c3f924f8f49/components/auto-complete/index.vue#L9)\[] | |
|
||||
| defaultActiveFirstOption | 是否默认高亮第一个选项。 | boolean | true |
|
||||
| defaultValue | 指定默认选中的条目 | string\|string\[]\|{ key: string, label: string\|vNodes }\|Array<{ key: string, label: string\|vNodes}> | 无 |
|
||||
| defaultValue | 指定默认选中的条目 | string\|string\[]\| 无 |
|
||||
| disabled | 是否禁用 | boolean | false |
|
||||
| filterOption | 是否根据输入项进行筛选。当其为一个函数时,会接收 `inputValue` `option` 两个参数,当 `option` 符合筛选条件时,应返回 `true`,反之则返回 `false`。 | boolean or function(inputValue, option) | true |
|
||||
| optionLabelProp | 回填到选择框的 Option 的属性值,默认是 Option 的子元素。比如在子元素需要高亮效果时,此值可以设为 `value`。 | string | `children` |
|
||||
|
|
|
@ -66,6 +66,8 @@ export default {
|
|||
}
|
||||
const classString = classNames({
|
||||
[`${prefixCls}-wrapper`]: true,
|
||||
[`${prefixCls}-wrapper-checked`]: checkboxProps.props.checked,
|
||||
[`${prefixCls}-wrapper-disabled`]: checkboxProps.props.disabled,
|
||||
})
|
||||
const checkboxClass = classNames({
|
||||
[`${prefixCls}-indeterminate`]: indeterminate,
|
||||
|
@ -81,7 +83,7 @@ export default {
|
|||
class={checkboxClass}
|
||||
ref='vcCheckbox'
|
||||
/>
|
||||
{children !== undefined ? <span>{children}</span> : null}
|
||||
{children !== undefined && <span>{children}</span>}
|
||||
</label>
|
||||
)
|
||||
},
|
||||
|
|
|
@ -7,27 +7,27 @@ exports[`renders ./components/checkbox/demo/check-all.md correctly 1`] = `
|
|||
<div style="border-bottom: 1px solid #E9E9E9;"><label class="ant-checkbox-wrapper"><span class="ant-checkbox ant-checkbox-indeterminate"><input type="checkbox" class="ant-checkbox-input" value=""><span class="ant-checkbox-inner"></span></span><span>
|
||||
Check all
|
||||
</span></label></div> <br>
|
||||
<div class="ant-checkbox-group"><label class="ant-checkbox-wrapper ant-checkbox-group-item"><span class="ant-checkbox ant-checkbox-checked"><input type="checkbox" class="ant-checkbox-input" value="Apple"><span class="ant-checkbox-inner"></span></span><span>Apple</span></label><label class="ant-checkbox-wrapper ant-checkbox-group-item"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input" value="Pear"><span class="ant-checkbox-inner"></span></span><span>Pear</span></label><label class="ant-checkbox-wrapper ant-checkbox-group-item"><span class="ant-checkbox ant-checkbox-checked"><input type="checkbox" class="ant-checkbox-input" value="Orange"><span class="ant-checkbox-inner"></span></span><span>Orange</span></label></div>
|
||||
<div class="ant-checkbox-group"><label class="ant-checkbox-wrapper ant-checkbox-wrapper-checked ant-checkbox-group-item"><span class="ant-checkbox ant-checkbox-checked"><input type="checkbox" class="ant-checkbox-input" value="Apple"><span class="ant-checkbox-inner"></span></span><span>Apple</span></label><label class="ant-checkbox-wrapper ant-checkbox-group-item"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input" value="Pear"><span class="ant-checkbox-inner"></span></span><span>Pear</span></label><label class="ant-checkbox-wrapper ant-checkbox-wrapper-checked ant-checkbox-group-item"><span class="ant-checkbox ant-checkbox-checked"><input type="checkbox" class="ant-checkbox-input" value="Orange"><span class="ant-checkbox-inner"></span></span><span>Orange</span></label></div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/checkbox/demo/controller.md correctly 1`] = `
|
||||
<div>
|
||||
<p style="margin-bottom: 20px;"><label class="ant-checkbox-wrapper"><span class="ant-checkbox ant-checkbox-checked"><input type="checkbox" class="ant-checkbox-input" value=""><span class="ant-checkbox-inner"></span></span><span>
|
||||
<p style="margin-bottom: 20px;"><label class="ant-checkbox-wrapper ant-checkbox-wrapper-checked"><span class="ant-checkbox ant-checkbox-checked"><input type="checkbox" class="ant-checkbox-input" value=""><span class="ant-checkbox-inner"></span></span><span>
|
||||
Checked-Enabled
|
||||
</span></label></p>
|
||||
<p><button type="button" class="ant-btn ant-btn-primary ant-btn-sm"><span>Uncheck</span></button> <button type="button" class="ant-btn ant-btn-primary ant-btn-sm" style="margin-left: 10px;"><span>Disable</span></button></p>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/checkbox/demo/disabled.md correctly 1`] = `<div><label class="ant-checkbox-wrapper"><span class="ant-checkbox ant-checkbox-disabled"><input type="checkbox" disabled="disabled" class="ant-checkbox-input" value=""><span class="ant-checkbox-inner"></span></span></label> <br> <label class="ant-checkbox-wrapper"><span class="ant-checkbox ant-checkbox-checked ant-checkbox-disabled"><input type="checkbox" disabled="disabled" class="ant-checkbox-input" value=""><span class="ant-checkbox-inner"></span></span></label></div>`;
|
||||
exports[`renders ./components/checkbox/demo/disabled.md correctly 1`] = `<div><label class="ant-checkbox-wrapper ant-checkbox-wrapper-disabled"><span class="ant-checkbox ant-checkbox-disabled"><input type="checkbox" disabled="disabled" class="ant-checkbox-input" value=""><span class="ant-checkbox-inner"></span></span></label> <br> <label class="ant-checkbox-wrapper ant-checkbox-wrapper-disabled"><span class="ant-checkbox ant-checkbox-checked ant-checkbox-disabled"><input type="checkbox" disabled="disabled" class="ant-checkbox-input" value=""><span class="ant-checkbox-inner"></span></span></label></div>`;
|
||||
|
||||
exports[`renders ./components/checkbox/demo/group.md correctly 1`] = `
|
||||
<div>
|
||||
<div class="ant-checkbox-group"><label class="ant-checkbox-wrapper ant-checkbox-group-item"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input" value="Apple"><span class="ant-checkbox-inner"></span></span><span>Apple</span></label><label class="ant-checkbox-wrapper ant-checkbox-group-item"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input" value="Pear"><span class="ant-checkbox-inner"></span></span><span>Pear</span></label><label class="ant-checkbox-wrapper ant-checkbox-group-item"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input" value="Orange"><span class="ant-checkbox-inner"></span></span><span>Orange</span></label></div> <br>
|
||||
<div class="ant-checkbox-group"><label class="ant-checkbox-wrapper ant-checkbox-group-item"><span class="ant-checkbox ant-checkbox-checked"><input type="checkbox" class="ant-checkbox-input" value="Apple"><span class="ant-checkbox-inner"></span></span><span>Apple</span></label><label class="ant-checkbox-wrapper ant-checkbox-group-item"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input" value="Pear"><span class="ant-checkbox-inner"></span></span><span>Pear</span></label><label class="ant-checkbox-wrapper ant-checkbox-group-item"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input" value="Orange"><span class="ant-checkbox-inner"></span></span><span>Orange</span></label></div> <br>
|
||||
<div class="ant-checkbox-group"><label class="ant-checkbox-wrapper ant-checkbox-group-item"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input" value="Apple"><span class="ant-checkbox-inner"></span></span><span>Apple</span></label><label class="ant-checkbox-wrapper ant-checkbox-group-item"><span class="ant-checkbox ant-checkbox-checked"><input type="checkbox" class="ant-checkbox-input" value="Pear"><span class="ant-checkbox-inner"></span></span><span>Pear</span></label><label class="ant-checkbox-wrapper ant-checkbox-group-item"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input" value="Orange"><span class="ant-checkbox-inner"></span></span><span>Orange</span></label></div> <br>
|
||||
<div class="ant-checkbox-group"><label class="ant-checkbox-wrapper ant-checkbox-group-item"><span class="ant-checkbox ant-checkbox-checked ant-checkbox-disabled"><input type="checkbox" disabled="disabled" class="ant-checkbox-input" value="Apple"><span class="ant-checkbox-inner"></span></span><span>Apple</span></label><label class="ant-checkbox-wrapper ant-checkbox-group-item"><span class="ant-checkbox ant-checkbox-disabled"><input type="checkbox" disabled="disabled" class="ant-checkbox-input" value="Pear"><span class="ant-checkbox-inner"></span></span><span>Pear</span></label><label class="ant-checkbox-wrapper ant-checkbox-group-item"><span class="ant-checkbox ant-checkbox-disabled"><input type="checkbox" disabled="disabled" class="ant-checkbox-input" value="Orange"><span class="ant-checkbox-inner"></span></span><span>Orange</span></label></div>
|
||||
<div class="ant-checkbox-group"><label class="ant-checkbox-wrapper ant-checkbox-wrapper-checked ant-checkbox-group-item"><span class="ant-checkbox ant-checkbox-checked"><input type="checkbox" class="ant-checkbox-input" value="Apple"><span class="ant-checkbox-inner"></span></span><span>Apple</span></label><label class="ant-checkbox-wrapper ant-checkbox-group-item"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input" value="Pear"><span class="ant-checkbox-inner"></span></span><span>Pear</span></label><label class="ant-checkbox-wrapper ant-checkbox-group-item"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input" value="Orange"><span class="ant-checkbox-inner"></span></span><span>Orange</span></label></div> <br>
|
||||
<div class="ant-checkbox-group"><label class="ant-checkbox-wrapper ant-checkbox-group-item"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input" value="Apple"><span class="ant-checkbox-inner"></span></span><span>Apple</span></label><label class="ant-checkbox-wrapper ant-checkbox-wrapper-checked ant-checkbox-group-item"><span class="ant-checkbox ant-checkbox-checked"><input type="checkbox" class="ant-checkbox-input" value="Pear"><span class="ant-checkbox-inner"></span></span><span>Pear</span></label><label class="ant-checkbox-wrapper ant-checkbox-group-item"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input" value="Orange"><span class="ant-checkbox-inner"></span></span><span>Orange</span></label></div> <br>
|
||||
<div class="ant-checkbox-group"><label class="ant-checkbox-wrapper ant-checkbox-wrapper-checked ant-checkbox-wrapper-disabled ant-checkbox-group-item"><span class="ant-checkbox ant-checkbox-checked ant-checkbox-disabled"><input type="checkbox" disabled="disabled" class="ant-checkbox-input" value="Apple"><span class="ant-checkbox-inner"></span></span><span>Apple</span></label><label class="ant-checkbox-wrapper ant-checkbox-wrapper-disabled ant-checkbox-group-item"><span class="ant-checkbox ant-checkbox-disabled"><input type="checkbox" disabled="disabled" class="ant-checkbox-input" value="Pear"><span class="ant-checkbox-inner"></span></span><span>Pear</span></label><label class="ant-checkbox-wrapper ant-checkbox-wrapper-disabled ant-checkbox-group-item"><span class="ant-checkbox ant-checkbox-disabled"><input type="checkbox" disabled="disabled" class="ant-checkbox-input" value="Orange"><span class="ant-checkbox-inner"></span></span><span>Orange</span></label></div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
|
|
|
@ -218,6 +218,7 @@ export default function createPicker (TheCalendar, props) {
|
|||
value={(inputValue && inputValue.format(props.format)) || ''}
|
||||
placeholder={placeholder}
|
||||
class={props.pickerInputClass}
|
||||
tabIndex={props.tabIndex}
|
||||
/>
|
||||
{clearIcon}
|
||||
{inputIcon}
|
||||
|
|
|
@ -11,7 +11,7 @@ There are four kinds of picker:
|
|||
**Note:** Part of locale of DatePicker, MonthPicker, RangePicker, WeekPicker is read from value. So, please set the locale of moment correctly.
|
||||
|
||||
````html
|
||||
// The default locale is en-US, if you want to use other locale, just set locale in entry file globaly.
|
||||
// The default locale is en-US, if you want to use other locale, just set locale in entry file globally.
|
||||
// import moment from 'moment';
|
||||
// import 'moment/locale/zh-cn';
|
||||
// moment.locale('zh-cn');
|
||||
|
@ -58,6 +58,7 @@ The following APIs are shared by DatePicker, MonthPicker, RangePicker, WeekPicke
|
|||
| Property | Description | Type | Default |
|
||||
| -------- | ----------- | ---- | ------- |
|
||||
| defaultValue | to set default date | [moment](http://momentjs.com/) | - |
|
||||
| defaultPickerValue | to set default picker date | [moment](http://momentjs.com/) | - |
|
||||
| disabledTime | to specify the time that cannot be selected | function(date) | - |
|
||||
| format | to set the date format, refer to [moment.js](http://momentjs.com/) | string | "YYYY-MM-DD" |
|
||||
| renderExtraFooter | render extra footer in panel by setting a scoped slot | slot="renderExtraFooter" | - |
|
||||
|
@ -78,6 +79,7 @@ The following APIs are shared by DatePicker, MonthPicker, RangePicker, WeekPicke
|
|||
| Property | Description | Type | Default |
|
||||
| -------- | ----------- | ---- | ------- |
|
||||
| defaultValue | to set default date | [moment](http://momentjs.com/) | - |
|
||||
| defaultPickerValue | to set default picker date | [moment](http://momentjs.com/) | - |
|
||||
| format | to set the date format, refer to [moment.js](http://momentjs.com/) | string | "YYYY-MM" |
|
||||
| monthCellContentRender | Custom month cell content render method by setting a scoped slot | slot="monthCellContentRender" slot-scope="date, locale" | - |
|
||||
| renderExtraFooter | render extra footer in panel by setting a scoped slot | slot="renderExtraFooter" | - |
|
||||
|
@ -93,6 +95,7 @@ The following APIs are shared by DatePicker, MonthPicker, RangePicker, WeekPicke
|
|||
| Property | Description | Type | Default |
|
||||
| -------- | ----------- | ---- | ------- |
|
||||
| defaultValue | to set default date | [moment](http://momentjs.com/) | - |
|
||||
| defaultPickerValue | to set default picker date | [moment](http://momentjs.com/) | - |
|
||||
| format | to set the date format, refer to [moment.js](http://momentjs.com/) | string | "YYYY-wo" |
|
||||
| value(v-model) | to set date | [moment](http://momentjs.com/) | - |
|
||||
|
||||
|
@ -106,6 +109,7 @@ The following APIs are shared by DatePicker, MonthPicker, RangePicker, WeekPicke
|
|||
| Property | Description | Type | Default |
|
||||
| -------- | ----------- | ---- | ------- |
|
||||
| defaultValue | to set default date | \[[moment](http://momentjs.com/), [moment](http://momentjs.com/)] | - |
|
||||
| defaultPickerValue | to set default picker date | [moment](http://momentjs.com/) | - |
|
||||
| disabledTime | to specify the time that cannot be selected | function(dates: [moment, moment], partial: `'start'|'end'`) | - |
|
||||
| format | to set the date format | string | "YYYY-MM-DD HH:mm:ss" |
|
||||
| ranges | preseted ranges for quick selection | { \[range: string]: [moment](http://momentjs.com/)\[] } \| { \[range: string]: () => [moment](http://momentjs.com/)\[] } | - |
|
||||
|
|
|
@ -58,6 +58,7 @@ moment.locale('zh-cn');
|
|||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
| --- | --- | --- | --- |
|
||||
| defaultValue | 默认日期 | [moment](http://momentjs.com/) | 无 |
|
||||
| defaultPickerValue | 默认面板日期 | [moment](http://momentjs.com/) | 无 |
|
||||
| disabledTime | 不可选择的时间 | function(date) | 无 |
|
||||
| format | 展示的日期格式,配置参考 [moment.js](http://momentjs.com/) | string | "YYYY-MM-DD" |
|
||||
| renderExtraFooter | 在面板中添加额外的页脚 | slot="renderExtraFooter" | - |
|
||||
|
@ -78,6 +79,7 @@ moment.locale('zh-cn');
|
|||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
| --- | --- | --- | --- |
|
||||
| defaultValue | 默认日期 | [moment](http://momentjs.com/) | 无 |
|
||||
| defaultPickerValue | 默认面板日期 | [moment](http://momentjs.com/) | 无 |
|
||||
| format | 展示的日期格式,配置参考 [moment.js](http://momentjs.com/) | string | "YYYY-MM" |
|
||||
| monthCellContentRender | 自定义的月份内容渲染方法 | slot="monthCellContentRender" slot-scope="date, locale" | - |
|
||||
| renderExtraFooter | 在面板中添加额外的页脚 | slot="renderExtraFooter" | - |
|
||||
|
@ -94,6 +96,7 @@ moment.locale('zh-cn');
|
|||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
| --- | --- | --- | --- |
|
||||
| defaultValue | 默认日期 | [moment](http://momentjs.com/) | - |
|
||||
| defaultPickerValue | 默认面板日期 | [moment](http://momentjs.com/) | 无 |
|
||||
| format | 展示的日期格式,配置参考 [moment.js](http://momentjs.com/) | string | "YYYY-wo" |
|
||||
| value(v-model) | 日期 | [moment](http://momentjs.com/) | - |
|
||||
|
||||
|
@ -108,6 +111,7 @@ moment.locale('zh-cn');
|
|||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
| --- | --- | --- | --- |
|
||||
| defaultValue | 默认日期 | [moment](http://momentjs.com/)\[] | 无 |
|
||||
| defaultPickerValue | 默认面板日期 | [moment](http://momentjs.com/) | 无 |
|
||||
| disabledTime | 不可选择的时间 | function(dates: [moment, moment], partial: `'start'|'end'`) | 无 |
|
||||
| format | 展示的日期格式 | string | "YYYY-MM-DD HH:mm:ss" |
|
||||
| ranges | 预设时间范围快捷选择 | { \[range: string]: [moment](http://momentjs.com/)\[] } \| { \[range: string]: () => [moment](http://momentjs.com/)\[] } | 无 |
|
||||
|
|
|
@ -34,6 +34,7 @@ export const PickerProps = () => ({
|
|||
timePicker: PropTypes.any,
|
||||
autoFocus: PropTypes.bool,
|
||||
tagPrefixCls: PropTypes.string,
|
||||
tabIndex: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||
})
|
||||
|
||||
export const SinglePickerProps = () => ({
|
||||
|
|
|
@ -321,7 +321,7 @@ exports[`renders ./components/form/demo/normal-login.vue correctly 1`] = `
|
|||
</div>
|
||||
<div class="ant-row ant-form-item">
|
||||
<div class="ant-form-item-control-wrapper">
|
||||
<div class="ant-form-item-control has-success"><span class="ant-form-item-children"><label class="ant-checkbox-wrapper"><span class="ant-checkbox ant-checkbox-checked"><input id="remember" type="checkbox" class="ant-checkbox-input" value=""><span class="ant-checkbox-inner"></span></span><span>
|
||||
<div class="ant-form-item-control has-success"><span class="ant-form-item-children"><label class="ant-checkbox-wrapper ant-checkbox-wrapper-checked"><span class="ant-checkbox ant-checkbox-checked"><input id="remember" type="checkbox" class="ant-checkbox-input" value=""><span class="ant-checkbox-inner"></span></span><span>
|
||||
Remember me
|
||||
</span></label><a href="" class="login-form-forgot">Forgot password</a><button type="submit" class="login-form-button ant-btn ant-btn-primary"><span>Log in</span></button>
|
||||
Or <a href="">register now!</a></span>
|
||||
|
|
|
@ -53,6 +53,7 @@ Add or remove form items dynamically.
|
|||
</template>
|
||||
|
||||
<script>
|
||||
let id = 0
|
||||
export default {
|
||||
beforeCreate () {
|
||||
this.form = this.$form.createForm(this)
|
||||
|
@ -98,7 +99,7 @@ export default {
|
|||
const { form } = this
|
||||
// can use data-binding to get
|
||||
const keys = form.getFieldValue('keys')
|
||||
const nextKeys = keys.concat(keys.length)
|
||||
const nextKeys = keys.concat(++id)
|
||||
// can use data-binding to set
|
||||
// important! notify form to detect changes
|
||||
form.setFieldsValue({
|
||||
|
|
|
@ -69,7 +69,7 @@ If the form has been decorated by `Form.create` then it has `this.form` property
|
|||
| resetFields | Reset the specified fields' value(to `initialValue`) and status. If you don't specify a parameter, all the fields will be reset. | Function(\[names: string\[]]) |
|
||||
| setFields | Set value and error state of fields | ({<br /> \[fieldName\]: {value: any, errors: \[Error\] }<br />}) => void |
|
||||
| setFieldsValue | Set the value of a field. | Function({ [fieldName]: value } |
|
||||
| validateFields | Validate the specified fields and get theirs values and errors. If you don't specify the parameter of fieldNames, you will vaildate all fields. | (<br /> \[fieldNames: string\[]],<br /> \[options: object\],<br /> callback(errors, values)<br />) => void |
|
||||
| validateFields | Validate the specified fields and get theirs values and errors. If you don't specify the parameter of fieldNames, you will validate all fields. | (<br /> \[fieldNames: string\[]],<br /> \[options: object\],<br /> callback(errors, values)<br />) => void |
|
||||
| validateFieldsAndScroll | This function is similar to `validateFields`, but after validation, if the target field is not in visible area of form, form will be automatically scrolled to the target field area. | same as `validateFields` |
|
||||
|
||||
### validateFields/validateFieldsAndScroll
|
||||
|
@ -152,7 +152,7 @@ After wrapped by `getFieldDecorator` or `v-decorator`, `value`(or other property
|
|||
| id | The unique identifier is required. support [nested fields format](https://github.com/react-component/form/pull/48). | string | |
|
||||
| options.getValueFromEvent | Specify how to get value from event or other onChange arguments | function(..args) | [reference](https://github.com/react-component/form#option-object) |
|
||||
| options.getValueProps | Get the component props according to field value. | function(value): any | [reference](https://github.com/react-component/form#option-object)
|
||||
| options.initialValue | You can specify initial value, type, optional value of children node. (Note: Because `Form` will test equality with `===` internaly, we recommend to use variable as `initialValue`, instead of literal) | | n/a |
|
||||
| options.initialValue | You can specify initial value, type, optional value of children node. (Note: Because `Form` will test equality with `===` internally, we recommend to use variable as `initialValue`, instead of literal) | | n/a |
|
||||
| options.normalize | Normalize value to form component, [a select-all example](https://codesandbox.io/s/kw4l2vqqmv) | function(value, prevValue, allValues): any | - |
|
||||
| options.rules | Includes validation rules. Please refer to "Validation Rules" part for details. | object\[] | n/a |
|
||||
| options.trigger | When to collect the value of children node | string | 'change' |
|
||||
|
|
|
@ -5,7 +5,7 @@ import Icon from '../icon'
|
|||
import inputProps from './inputProps'
|
||||
import Button from '../button'
|
||||
import { cloneElement } from '../_util/vnode'
|
||||
import { getOptionProps, getComponentFromProp } from '../_util/props-util'
|
||||
import { getOptionProps, getComponentFromProp, isValidElement } from '../_util/props-util'
|
||||
import PropTypes from '../_util/vue-types'
|
||||
|
||||
export default {
|
||||
|
@ -72,11 +72,20 @@ export default {
|
|||
},
|
||||
render () {
|
||||
const { prefixCls, inputPrefixCls, size,
|
||||
suffix, ...others
|
||||
...others
|
||||
} = getOptionProps(this)
|
||||
const suffix = getComponentFromProp(this, 'suffix')
|
||||
const enterButton = getComponentFromProp(this, 'enterButton')
|
||||
const buttonOrIcon = this.getButtonOrIcon()
|
||||
const searchSuffix = suffix ? [suffix, buttonOrIcon] : buttonOrIcon
|
||||
let searchSuffix = suffix ? [suffix, buttonOrIcon] : buttonOrIcon
|
||||
if (Array.isArray(searchSuffix)) {
|
||||
searchSuffix = searchSuffix.map((item, index) => {
|
||||
if (!isValidElement(item) || item.key) {
|
||||
return item
|
||||
}
|
||||
return cloneElement(item, { key: index })
|
||||
})
|
||||
}
|
||||
const inputClassName = classNames(prefixCls, {
|
||||
[`${prefixCls}-enter-button`]: !!enterButton,
|
||||
[`${prefixCls}-${size}`]: !!size,
|
||||
|
|
|
@ -29,7 +29,16 @@ describe('Input.Search', () => {
|
|||
expect(wrapper.html()).toMatchSnapshot()
|
||||
})
|
||||
})
|
||||
|
||||
it('should support ReactNode suffix without error', () => {
|
||||
const fn = () => {
|
||||
mount({
|
||||
render () {
|
||||
return <Search suffix={<div>ok</div>} />
|
||||
},
|
||||
})
|
||||
}
|
||||
expect(fn).not.toThrow()
|
||||
})
|
||||
it('should disable enter button when disabled prop is true', () => {
|
||||
const wrapper = mount({
|
||||
render () {
|
||||
|
|
|
@ -50,7 +50,9 @@ const LocaleProvider = {
|
|||
...this.locale,
|
||||
exist: true,
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
setMomentLocale(val)
|
||||
})
|
||||
},
|
||||
},
|
||||
created () {
|
||||
|
|
|
@ -144,6 +144,13 @@ const Menu = {
|
|||
this.$forceUpdate()
|
||||
}
|
||||
},
|
||||
// Restore vertical mode when menu is collapsed responsively when mounted
|
||||
// https://github.com/ant-design/ant-design/issues/13104
|
||||
// TODO: not a perfect solution, looking a new way to avoid setting switchingModeFromInline in this situation
|
||||
handleMouseEnter (e) {
|
||||
this.restoreModeVerticalFromInline()
|
||||
this.$emit('mouseenter', e)
|
||||
},
|
||||
handleTransitionEnd (e) {
|
||||
// console.log(111)
|
||||
// when inlineCollapsed menu width animation finished
|
||||
|
@ -245,6 +252,7 @@ const Menu = {
|
|||
select: this.handleSelect,
|
||||
deselect: this.handleDeselect,
|
||||
openChange: this.handleOpenChange,
|
||||
onMouseenter: this.handleMouseEnter,
|
||||
},
|
||||
nativeOn: {
|
||||
transitionend: this.handleTransitionEnd,
|
||||
|
|
|
@ -5,9 +5,9 @@ exports[`renders ./components/switch/demo/basic.md correctly 1`] = `<div><button
|
|||
exports[`renders ./components/switch/demo/disabled.md correctly 1`] = `<div><button type="button" role="switch" aria-checked="true" disabled="disabled" class="ant-switch ant-switch-checked ant-switch-disabled" style="margin-bottom: 5px;"><span class="ant-switch-inner"></span></button> <br> <button type="button" class="ant-btn ant-btn-primary"><span>Toggle disabled</span></button></div>`;
|
||||
|
||||
exports[`renders ./components/switch/demo/loading.md correctly 1`] = `
|
||||
<div><button type="button" role="switch" aria-checked="true" class="ant-switch ant-switch-checked ant-switch-loading"><i class="ant-switch-loading-icon anticon anticon-loading"><svg viewBox="0 0 1024 1024" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true" class="anticon-spin">
|
||||
<div><button type="button" role="switch" aria-checked="true" disabled="disabled" class="ant-switch ant-switch-checked ant-switch-disabled ant-switch-loading"><i class="ant-switch-loading-icon anticon anticon-loading"><svg viewBox="0 0 1024 1024" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true" class="anticon-spin">
|
||||
<path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 0 0-94.3-139.9 437.71 437.71 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"></path>
|
||||
</svg></i><span class="ant-switch-inner"></span></button> <br> <button type="button" role="switch" class="ant-switch ant-switch-small ant-switch-loading"><i class="ant-switch-loading-icon anticon anticon-loading"><svg viewBox="0 0 1024 1024" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true" class="anticon-spin">
|
||||
</svg></i><span class="ant-switch-inner"></span></button> <br> <button type="button" role="switch" disabled="disabled" class="ant-switch ant-switch-disabled ant-switch-small ant-switch-loading"><i class="ant-switch-loading-icon anticon anticon-loading"><svg viewBox="0 0 1024 1024" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true" class="anticon-spin">
|
||||
<path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 0 0-94.3-139.9 437.71 437.71 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"></path>
|
||||
</svg></i><span class="ant-switch-inner"></span></button></div>
|
||||
`;
|
||||
|
|
|
@ -34,7 +34,7 @@ const Switch = {
|
|||
},
|
||||
|
||||
render () {
|
||||
const { prefixCls, size, loading, ...restProps } = getOptionProps(this)
|
||||
const { prefixCls, size, loading, disabled, ...restProps } = getOptionProps(this)
|
||||
const classes = {
|
||||
[`${prefixCls}-small`]: size === 'small',
|
||||
[`${prefixCls}-loading`]: loading,
|
||||
|
@ -52,6 +52,7 @@ const Switch = {
|
|||
loadingIcon,
|
||||
checkedChildren: getComponentFromProp(this, 'checkedChildren'),
|
||||
unCheckedChildren: getComponentFromProp(this, 'unCheckedChildren'),
|
||||
disabled: disabled || loading,
|
||||
},
|
||||
on: this.$listeners,
|
||||
class: classes,
|
||||
|
|
|
@ -346,9 +346,9 @@ export default {
|
|||
const oldSortOrder = this.isSameColumn(sortColumn, column) ? sortOrder : undefined
|
||||
// 切换排序状态,按照降序/升序/不排序的顺序
|
||||
if (!oldSortOrder) {
|
||||
newSortOrder = 'descend'
|
||||
} else if (oldSortOrder === 'descend') {
|
||||
newSortOrder = 'ascend'
|
||||
} else if (oldSortOrder === 'ascend') {
|
||||
newSortOrder = 'descend'
|
||||
} else {
|
||||
newSortOrder = undefined
|
||||
}
|
||||
|
@ -736,14 +736,14 @@ export default {
|
|||
|
||||
renderColumnsDropdown (columns, locale) {
|
||||
const { prefixCls, dropdownPrefixCls } = this
|
||||
const { sSortOrder: sortOrder } = this
|
||||
const { sSortOrder: sortOrder, sFilters: filters } = this
|
||||
return treeMap(columns, (column, i) => {
|
||||
const key = this.getColumnKey(column, i)
|
||||
let filterDropdown
|
||||
let sortButton
|
||||
const isSortColumn = this.isSortColumn(column)
|
||||
if ((column.filters && column.filters.length > 0) || column.filterDropdown) {
|
||||
const colFilters = this.sFilters[key] || []
|
||||
const colFilters = key in filters ? filters[key] : []
|
||||
filterDropdown = (
|
||||
<FilterDropdown
|
||||
_propsSymbol={Symbol()}
|
||||
|
|
|
@ -79,14 +79,13 @@ describe('Table.sorter', () => {
|
|||
wrapper.find('.ant-table-column-sorters').trigger('click')
|
||||
})
|
||||
await asyncExpect(() => {
|
||||
expect(wrapper.find('.ant-table-tbody').text()).toEqual(['Tom', 'Lucy', 'Jack', 'Jerry'].join(''))
|
||||
expect(wrapper.find('.ant-table-tbody').text()).toEqual(['Jack', 'Jerry', 'Lucy', 'Tom'].join(''))
|
||||
|
||||
// ascent
|
||||
wrapper.find('.ant-table-column-sorters').trigger('click')
|
||||
})
|
||||
await asyncExpect(() => {
|
||||
// expect(renderedNames(wrapper)).toEqual(['Jack', 'Jerry', 'Lucy', 'Tom'])
|
||||
expect(wrapper.find('.ant-table-tbody').text()).toEqual(['Jack', 'Jerry', 'Lucy', 'Tom'].join(''))
|
||||
expect(wrapper.find('.ant-table-tbody').text()).toEqual(['Tom', 'Lucy', 'Jack', 'Jerry'].join(''))
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -108,7 +107,7 @@ describe('Table.sorter', () => {
|
|||
await asyncExpect(() => {
|
||||
const sorter1 = handleChange.mock.calls[0][2]
|
||||
expect(sorter1.column.dataIndex).toBe('name')
|
||||
expect(sorter1.order).toBe('descend')
|
||||
expect(sorter1.order).toBe('ascend')
|
||||
expect(sorter1.field).toBe('name')
|
||||
expect(sorter1.columnKey).toBe('name')
|
||||
})
|
||||
|
@ -116,7 +115,7 @@ describe('Table.sorter', () => {
|
|||
await asyncExpect(() => {
|
||||
const sorter2 = handleChange.mock.calls[1][2]
|
||||
expect(sorter2.column.dataIndex).toBe('name')
|
||||
expect(sorter2.order).toBe('ascend')
|
||||
expect(sorter2.order).toBe('descend')
|
||||
expect(sorter2.field).toBe('name')
|
||||
expect(sorter2.columnKey).toBe('name')
|
||||
})
|
||||
|
|
|
@ -2428,7 +2428,7 @@ exports[`renders ./components/table/demo/row-selection.md correctly 1`] = `
|
|||
<td>Sidney No. 1 Lake Park</td>
|
||||
</tr>
|
||||
<tr class="ant-table-row ant-table-row-level-0" data-row-key="4">
|
||||
<td class="ant-table-selection-column"><span><label class="ant-checkbox-wrapper"><span class="ant-checkbox ant-checkbox-disabled"><input name="Disabled User" type="checkbox" disabled="disabled" class="ant-checkbox-input" value=""><span class="ant-checkbox-inner"></span></span></label></span></td>
|
||||
<td class="ant-table-selection-column"><span><label class="ant-checkbox-wrapper ant-checkbox-wrapper-disabled"><span class="ant-checkbox ant-checkbox-disabled"><input name="Disabled User" type="checkbox" disabled="disabled" class="ant-checkbox-input" value=""><span class="ant-checkbox-inner"></span></span></label></span></td>
|
||||
<td><span class="ant-table-row-indent indent-level-0" style="padding-left: 0px;"></span>
|
||||
<!----><a href="javascript:;">Disabled User</a></td>
|
||||
<td>99</td>
|
||||
|
|
|
@ -141,11 +141,12 @@ export default {
|
|||
|
||||
renderMenuItem (item) {
|
||||
const { column } = this
|
||||
const { sSelectedKeys: selectedKeys } = this.$data
|
||||
const multiple = ('filterMultiple' in column) ? column.filterMultiple : true
|
||||
const input = multiple ? (
|
||||
<Checkbox checked={this.sSelectedKeys.indexOf(item.value.toString()) >= 0} />
|
||||
<Checkbox checked={selectedKeys && selectedKeys.indexOf(item.value.toString()) >= 0} />
|
||||
) : (
|
||||
<Radio checked={this.sSelectedKeys.indexOf(item.value.toString()) >= 0} />
|
||||
<Radio checked={selectedKeys && selectedKeys.indexOf(item.value.toString()) >= 0} />
|
||||
)
|
||||
|
||||
return (
|
||||
|
@ -180,11 +181,12 @@ export default {
|
|||
},
|
||||
|
||||
handleMenuItemClick (info) {
|
||||
const { sSelectedKeys: selectedKeys } = this.$data
|
||||
if (!info.keyPath || info.keyPath.length <= 1) {
|
||||
return
|
||||
}
|
||||
const keyPathOfSelectedItem = this.sKeyPathOfSelectedItem
|
||||
if (this.sSelectedKeys.indexOf(info.key) >= 0) {
|
||||
if (selectedKeys && selectedKeys.indexOf(info.key) >= 0) {
|
||||
// deselect SubMenu child
|
||||
delete keyPathOfSelectedItem[info.key]
|
||||
} else {
|
||||
|
@ -196,13 +198,13 @@ export default {
|
|||
|
||||
renderFilterIcon () {
|
||||
const { column, locale, prefixCls, selectedKeys } = this
|
||||
const filterd = selectedKeys.length > 0
|
||||
const filtered = selectedKeys && selectedKeys.length > 0
|
||||
let filterIcon = column.filterIcon
|
||||
if (typeof filterIcon === 'function') {
|
||||
filterIcon = filterIcon(filterd)
|
||||
filterIcon = filterIcon(filtered)
|
||||
}
|
||||
const dropdownIconClass = classNames({
|
||||
[`${prefixCls}-selected`]: filterd,
|
||||
[`${prefixCls}-selected`]: filtered,
|
||||
[`${prefixCls}-open`]: this.getDropdownVisible(),
|
||||
})
|
||||
|
||||
|
|
|
@ -78,6 +78,7 @@ export default {
|
|||
display: 'inline-block', // default inline-block is important
|
||||
...picked,
|
||||
cursor: 'not-allowed',
|
||||
width: isAntBtn && ele.componentOptions.propsData.disabled ? '100%' : null,
|
||||
}
|
||||
const buttonStyle = {
|
||||
...omitted,
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
exports[`Transfer should render correctly 1`] = `
|
||||
<div class="ant-transfer">
|
||||
<div class="ant-transfer-list">
|
||||
<div class="ant-transfer-list-header"><label class="ant-checkbox-wrapper"><span class="ant-checkbox ant-checkbox-checked"><input type="checkbox" checked="checked" class="ant-checkbox-input"><span class="ant-checkbox-inner"></span></span></label><span class="ant-transfer-list-header-selected"><span>1/2 items</span><span class="ant-transfer-list-header-title"></span></span></div>
|
||||
<div class="ant-transfer-list-body"><span tag="ul" class="ant-transfer-list-content"><li class="ant-transfer-list-content-item"><label class="ant-checkbox-wrapper"><span class="ant-checkbox ant-checkbox-checked"><input type="checkbox" checked="checked" class="ant-checkbox-input"><span class="ant-checkbox-inner"></span></span></label><span></span></li>
|
||||
<li class="ant-transfer-list-content-item ant-transfer-list-content-item-disabled"><label class="ant-checkbox-wrapper"><span class="ant-checkbox ant-checkbox-disabled"><input type="checkbox" disabled="disabled" class="ant-checkbox-input"><span class="ant-checkbox-inner"></span></span></label><span></span></li>
|
||||
<div class="ant-transfer-list-header"><label class="ant-checkbox-wrapper ant-checkbox-wrapper-checked"><span class="ant-checkbox ant-checkbox-checked"><input type="checkbox" checked="checked" class="ant-checkbox-input"><span class="ant-checkbox-inner"></span></span></label><span class="ant-transfer-list-header-selected"><span>1/2 items</span><span class="ant-transfer-list-header-title"></span></span></div>
|
||||
<div class="ant-transfer-list-body"><span tag="ul" class="ant-transfer-list-content"><li class="ant-transfer-list-content-item"><label class="ant-checkbox-wrapper ant-checkbox-wrapper-checked"><span class="ant-checkbox ant-checkbox-checked"><input type="checkbox" checked="checked" class="ant-checkbox-input"><span class="ant-checkbox-inner"></span></span></label><span></span></li>
|
||||
<li class="ant-transfer-list-content-item ant-transfer-list-content-item-disabled"><label class="ant-checkbox-wrapper ant-checkbox-wrapper-disabled"><span class="ant-checkbox ant-checkbox-disabled"><input type="checkbox" disabled="disabled" class="ant-checkbox-input"><span class="ant-checkbox-inner"></span></span></label><span></span></li>
|
||||
</span>
|
||||
<div class="ant-transfer-list-body-not-found">Not Found</div>
|
||||
</div>
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
exports[`List should render correctly 1`] = `
|
||||
<div class="ant-transfer-list">
|
||||
<div class="ant-transfer-list-header"><label class="ant-checkbox-wrapper"><span class="ant-checkbox ant-checkbox-indeterminate"><input type="checkbox" class="ant-checkbox-input"><span class="ant-checkbox-inner"></span></span></label><span class="ant-transfer-list-header-selected"><span>1/3 </span><span class="ant-transfer-list-header-title"></span></span></div>
|
||||
<div class="ant-transfer-list-body"><span tag="ul" class="ant-transfer-list-content"><li class="ant-transfer-list-content-item"><label class="ant-checkbox-wrapper"><span class="ant-checkbox ant-checkbox-checked"><input type="checkbox" checked="checked" class="ant-checkbox-input"><span class="ant-checkbox-inner"></span></span></label><span></span></li>
|
||||
<div class="ant-transfer-list-body"><span tag="ul" class="ant-transfer-list-content"><li class="ant-transfer-list-content-item"><label class="ant-checkbox-wrapper ant-checkbox-wrapper-checked"><span class="ant-checkbox ant-checkbox-checked"><input type="checkbox" checked="checked" class="ant-checkbox-input"><span class="ant-checkbox-inner"></span></span></label><span></span></li>
|
||||
<li class="ant-transfer-list-content-item"><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input"><span class="ant-checkbox-inner"></span></span></label><span></span></li>
|
||||
<li class="ant-transfer-list-content-item ant-transfer-list-content-item-disabled"><label class="ant-checkbox-wrapper"><span class="ant-checkbox ant-checkbox-disabled"><input type="checkbox" disabled="disabled" class="ant-checkbox-input"><span class="ant-checkbox-inner"></span></span></label><span></span></li>
|
||||
<li class="ant-transfer-list-content-item ant-transfer-list-content-item-disabled"><label class="ant-checkbox-wrapper ant-checkbox-wrapper-disabled"><span class="ant-checkbox ant-checkbox-disabled"><input type="checkbox" disabled="disabled" class="ant-checkbox-input"><span class="ant-checkbox-inner"></span></span></label><span></span></li>
|
||||
</span>
|
||||
<div class="ant-transfer-list-body-not-found">Not Found</div>
|
||||
</div>
|
||||
|
|
|
@ -60,11 +60,12 @@ const Transfer = {
|
|||
showSearch: false,
|
||||
}),
|
||||
data () {
|
||||
warning(
|
||||
!(getComponentFromProp(this, 'notFoundContent') || hasProp(this, 'searchPlaceholder')),
|
||||
'Transfer[notFoundContent] and Transfer[searchPlaceholder] will be removed, ' +
|
||||
'please use Transfer[locale] instead.',
|
||||
)
|
||||
// vue 中 通过slot,不方便传递,保留notFoundContent及searchPlaceholder
|
||||
// warning(
|
||||
// !(getComponentFromProp(this, 'notFoundContent') || hasProp(this, 'searchPlaceholder')),
|
||||
// 'Transfer[notFoundContent] and Transfer[searchPlaceholder] will be removed, ' +
|
||||
// 'please use Transfer[locale] instead.',
|
||||
// )
|
||||
|
||||
this.separatedDataSource = {
|
||||
leftDataSource: [],
|
||||
|
|
|
@ -79,4 +79,4 @@ exports[`renders ./components/upload/demo/picture-style.md correctly 1`] = `
|
|||
</span></div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/upload/demo/upload-manually.md correctly 1`] = `<div class="clearfix"><span><div class="ant-upload ant-upload-select ant-upload-select-text"><!----></div><div class="ant-upload-list ant-upload-list-text"></div></span> <button type="button" disabled="disabled" class="upload-demo-start ant-btn ant-btn-primary"><span>Start Upload</span></button></div>`;
|
||||
exports[`renders ./components/upload/demo/upload-manually.md correctly 1`] = `<div class="clearfix"><span><div class="ant-upload ant-upload-select ant-upload-select-text"><!----></div><div class="ant-upload-list ant-upload-list-text"></div></span> <button type="button" disabled="disabled" class="ant-btn ant-btn-primary" style="margin-top: 16px;"><span>Start Upload</span></button></div>`;
|
||||
|
|
|
@ -12,7 +12,6 @@ Upload files manually after `beforeUpload` returns `false`.
|
|||
<template>
|
||||
<div class="clearfix">
|
||||
<a-upload
|
||||
action="//jsonplaceholder.typicode.com/posts/"
|
||||
:fileList="fileList"
|
||||
:remove="handleRemove"
|
||||
:beforeUpload="beforeUpload"
|
||||
|
@ -22,11 +21,11 @@ Upload files manually after `beforeUpload` returns `false`.
|
|||
</a-button>
|
||||
</a-upload>
|
||||
<a-button
|
||||
class="upload-demo-start"
|
||||
type="primary"
|
||||
@click="handleUpload"
|
||||
:disabled="fileList.length === 0"
|
||||
:loading="uploading"
|
||||
style="margin-top: 16px"
|
||||
>
|
||||
{{uploading ? 'Uploading' : 'Start Upload' }}
|
||||
</a-button>
|
||||
|
@ -80,11 +79,6 @@ export default {
|
|||
},
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.upload-demo-start {
|
||||
margin-top: 16px;
|
||||
}
|
||||
</style>
|
||||
```
|
||||
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
| Property | Description | Type | Default |
|
||||
| -------- | ----------- | ---- | ------- |
|
||||
| accept | File types that can be accepted. See [input accept Attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept) | string | - |
|
||||
| action | Required. Uploading URL | string\|(file) => `Promise` | - |
|
||||
| action | Uploading URL | string\|(file) => `Promise` | - |
|
||||
| directory | support upload whole directory ([caniuse](https://caniuse.com/#feat=input-file-directory)) | boolean | false |
|
||||
| beforeUpload | Hook function which will be executed before uploading. Uploading will be stopped with `false` or a rejected Promise returned. **Warning:this function is not supported in IE9**。 | (file, fileList) => `boolean | Promise` | - |
|
||||
| customRequest | override for the default xhr behavior allowing for additional customization and ability to implement your own XMLHttpRequest | Function | - |
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
| --- | --- | --- | --- |
|
||||
| accept | 接受上传的文件类型, 详见 [input accept Attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept) | string | 无 |
|
||||
| action | 必选参数, 上传的地址 | string\|(file) => `Promise` | 无 |
|
||||
| action | 上传的地址 | string\|(file) => `Promise` | 无 |
|
||||
| directory | 支持上传文件夹([caniuse](https://caniuse.com/#feat=input-file-directory))| boolean | false |
|
||||
| beforeUpload | 上传文件之前的钩子,参数为上传的文件,若返回 `false` 则停止上传。支持返回一个 Promise 对象,Promise 对象 reject 时则停止上传,resolve 时开始上传。**注意:IE9 不支持该方法**。 | (file, fileList) => `boolean | Promise` | 无 |
|
||||
| customRequest | 通过覆盖默认的上传行为,可以自定义自己的上传实现 | Function | 无 |
|
||||
|
|
|
@ -34,21 +34,21 @@
|
|||
<router-view></router-view>
|
||||
</div>
|
||||
<script>
|
||||
var SeedAndDewConfig = {};
|
||||
(function() {
|
||||
SeedAndDewConfig['adClass'] = "snd-ad";
|
||||
/* * * DON'T EDIT BELOW THIS LINE * * */
|
||||
SeedAndDewConfig['projectId'] = '31734ee0-6439-448d-8848-ed99e514f266';
|
||||
SeedAndDewConfig['loadStartTime'] = performance.now();
|
||||
SeedAndDewConfig['apiVersion'] = '2018-05-28'
|
||||
SeedAndDewConfig['sessionId'] = Math.random().toString(36).substring(2, 15);
|
||||
var snd = document.createElement('script');
|
||||
snd.type = 'text/javascript';
|
||||
snd.async = true;
|
||||
snd.src = 'https://www.seedanddew.com/static/embed.min.js';
|
||||
(document.getElementsByTagName('head')[0] ||
|
||||
document.getElementsByTagName('body')[0]).appendChild(snd);
|
||||
})();
|
||||
// var SeedAndDewConfig = {};
|
||||
// (function() {
|
||||
// SeedAndDewConfig['adClass'] = "snd-ad";
|
||||
// /* * * DON'T EDIT BELOW THIS LINE * * */
|
||||
// SeedAndDewConfig['projectId'] = '31734ee0-6439-448d-8848-ed99e514f266';
|
||||
// SeedAndDewConfig['loadStartTime'] = performance.now();
|
||||
// SeedAndDewConfig['apiVersion'] = '2018-05-28'
|
||||
// SeedAndDewConfig['sessionId'] = Math.random().toString(36).substring(2, 15);
|
||||
// var snd = document.createElement('script');
|
||||
// snd.type = 'text/javascript';
|
||||
// snd.async = true;
|
||||
// snd.src = 'https://www.seedanddew.com/static/embed.min.js';
|
||||
// (document.getElementsByTagName('head')[0] ||
|
||||
// document.getElementsByTagName('body')[0]).appendChild(snd);
|
||||
// })();
|
||||
</script>
|
||||
</body>
|
||||
|
||||
|
|
Loading…
Reference in New Issue