Merge remote-tracking branch 'origin/master' into 2.0

# Conflicts:
#	antdv-demo
#	components/alert/__tests__/__snapshots__/demo.test.js.snap
#	components/auto-complete/__tests__/__snapshots__/demo.test.js.snap
#	components/avatar/__tests__/__snapshots__/demo.test.js.snap
#	components/badge/__tests__/__snapshots__/demo.test.js.snap
#	components/calendar/__tests__/__snapshots__/demo.test.js.snap
#	components/calendar/__tests__/__snapshots__/index.test.js.snap
#	components/card/__tests__/__snapshots__/demo.test.js.snap
#	components/cascader/__tests__/__snapshots__/demo.test.js.snap
#	components/cascader/__tests__/__snapshots__/index.test.js.snap
#	components/collapse/__tests__/__snapshots__/demo.test.js.snap
#	components/date-picker/__tests__/__snapshots__/DatePicker.test.js.snap
#	components/date-picker/__tests__/__snapshots__/demo.test.js.snap
#	components/date-picker/__tests__/__snapshots__/other.test.js.snap
#	components/dropdown/__tests__/__snapshots__/demo.test.js.snap
#	components/empty/__tests__/__snapshots__/demo.test.js.snap
#	components/form-model/__tests__/__snapshots__/demo.test.js.snap
#	components/form/__tests__/__snapshots__/demo.test.js.snap
#	components/icon/__tests__/__snapshots__/index.test.js.snap
#	components/icon/index.js
#	components/input-number/__tests__/__snapshots__/demo.test.js.snap
#	components/input/__tests__/__snapshots__/demo.test.js.snap
#	components/input/__tests__/__snapshots__/index.test.js.snap
#	components/locale-provider/__tests__/__snapshots__/demo.test.js.snap
#	components/locale-provider/__tests__/__snapshots__/index.test.js.snap
#	components/modal/__tests__/__snapshots__/Modal.test.js.snap
#	components/page-header/__tests__/__snapshots__/demo.test.js.snap
#	components/page-header/index.jsx
#	components/pagination/__tests__/__snapshots__/demo.test.js.snap
#	components/rate/__tests__/__snapshots__/demo.test.js.snap
#	components/select/__tests__/__snapshots__/demo.test.js.snap
#	components/select/__tests__/__snapshots__/index.test.js.snap
#	components/slider/__tests__/__snapshots__/demo.test.js.snap
#	components/spin/__tests__/__snapshots__/demo.test.js.snap
#	components/steps/__tests__/__snapshots__/demo.test.js.snap
#	components/switch/__tests__/__snapshots__/demo.test.js.snap
#	components/table/__tests__/__snapshots__/Table.filter.test.js.snap
#	components/table/__tests__/__snapshots__/Table.sorter.test.js.snap
#	components/table/__tests__/__snapshots__/demo.test.js.snap
#	components/tabs/__tests__/__snapshots__/demo.test.js.snap
#	components/tabs/__tests__/__snapshots__/index.test.js.snap
#	components/time-picker/__tests__/__snapshots__/demo.test.js.snap
#	components/time-picker/__tests__/__snapshots__/index.test.js.snap
#	components/timeline/__tests__/__snapshots__/demo.test.js.snap
#	components/tree-select/__tests__/__snapshots__/demo.test.js.snap
#	components/tree/__tests__/__snapshots__/demo.test.js.snap
#	components/upload/__tests__/__snapshots__/demo.test.js.snap
#	components/upload/__tests__/__snapshots__/uploadlist.test.js.snap
#	types/message.d.ts
pull/2037/head
tangjinzhou 2020-04-05 15:09:21 +08:00
commit 518cc852af
53 changed files with 730 additions and 275 deletions

14
.github/lock.yml vendored
View File

@ -1,14 +0,0 @@
# Configuration for lock-threads - https://github.com/dessant/lock-threads
# Number of days of inactivity before a closed issue or pull request is locked
daysUntilLock: 365
# Comment to post before locking. Set to `false` to disable
lockComment: >
This thread has been automatically locked because it has not had recent
activity. Please open a new issue for related bugs and link to relevant
comments in this thread.
# Issues or pull requests with these labels will not be locked
# exemptLabels:
# - no-locking
# Limit to only `issues` or `pulls`
only: issues

71
.github/workflows/codecov.yml vendored Normal file
View File

@ -0,0 +1,71 @@
name: codecov
on: [push]
jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@master
- name: cache package-lock.json
uses: actions/cache@v1
with:
path: package-temp-dir
key: lock-${{ github.sha }}
- name: create package-lock.json
run: npm i --package-lock-only
- name: hack for singe file
run: |
if [ ! -d "package-temp-dir" ]; then
mkdir package-temp-dir
fi
cp package-lock.json package-temp-dir
- name: cache node_modules
id: node_modules_cache_id
uses: actions/cache@v1
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
- name: install
if: steps.node_modules_cache_id.outputs.cache-hit != 'true'
run: npm ci
node:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@master
with:
token: ${{ secrets.ACCESS_TOKEN }}
submodules: true
- name: restore cache from package-lock.json
uses: actions/cache@v1
with:
path: package-temp-dir
key: lock-${{ github.sha }}
- name: restore cache from node_modules
uses: actions/cache@v1
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
- name: Generate coverage report
run: npm test
env:
COVERAGE: "true"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
needs: setup

23
.github/workflows/lock-issue.yml vendored Normal file
View File

@ -0,0 +1,23 @@
name: 'Lock threads'
on:
schedule:
- cron: '0 0 * * *'
jobs:
lock:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v2
with:
github-token: ${{ github.token }}
issue-lock-inactive-days: '365'
issue-lock-labels: 'outdated'
issue-lock-comment: >
This issue has been automatically locked since there
has not been any recent activity after it was closed.
Please open a new issue for related bugs.
pr-lock-comment: >
This pull request has been automatically locked since there
has not been any recent activity after it was closed.
Please open a new issue for related bugs.

125
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,125 @@
name: test
on: [push, pull_request]
jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@master
- name: cache package-lock.json
uses: actions/cache@v1
with:
path: package-temp-dir
key: lock-${{ github.sha }}
- name: create package-lock.json
run: npm i --package-lock-only
- name: hack for singe file
run: |
if [ ! -d "package-temp-dir" ]; then
mkdir package-temp-dir
fi
cp package-lock.json package-temp-dir
- name: cache node_modules
id: node_modules_cache_id
uses: actions/cache@v1
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
- name: install
if: steps.node_modules_cache_id.outputs.cache-hit != 'true'
run: npm ci
compile:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@master
- name: restore cache from package-lock.json
uses: actions/cache@v1
with:
path: package-temp-dir
key: lock-${{ github.sha }}
- name: restore cache from node_modules
uses: actions/cache@v1
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
- name: cache lib
uses: actions/cache@v1
with:
path: lib
key: lib-${{ github.sha }}
- name: cache es
uses: actions/cache@v1
with:
path: es
key: es-${{ github.sha }}
- name: compile
run: npm run compile
needs: setup
lint:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@master
- name: restore cache from package-lock.json
uses: actions/cache@v1
with:
path: package-temp-dir
key: lock-${{ github.sha }}
- name: restore cache from node_modules
uses: actions/cache@v1
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
- name: lint
run: npm run lint
needs: setup
node:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@master
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: Checkout submodules
uses: actions/checkout@master
with:
repository: tangjinzhou/antdv-demo
token: ${{ secrets.ACCESS_TOKEN }}
path: antdv-demo
- name: restore cache from package-lock.json
uses: actions/cache@v1
with:
path: package-temp-dir
key: lock-${{ github.sha }}
- name: restore cache from node_modules
uses: actions/cache@v1
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
- name: test
run: npm test
needs: setup

View File

@ -1,19 +0,0 @@
language: node_js
sudo: required
git:
submodules: false
node_js:
- 12.4.0
before_install:
- echo -e "machine github.com\n login Travis\n password $GITHUB_TOKEN" > ~/.netrc
- git submodule update --init --recursive
before_script:
- npm install vue vue-template-compiler
script:
- if [[ $TRAVIS_BRANCH == "master" && $TRAVIS_PULL_REQUEST == "false" ]]; then cp ./scripts/.npmrc.template $HOME/.npmrc; fi
- COVERAGE=true npm run test
- npm run codecov
- if [[ $TRAVIS_BRANCH == "master" && $TRAVIS_PULL_REQUEST == "false" ]]; then npm run pub-with-ci; fi
env:
matrix:
secure: PBbJaS48HA/mkj9PuGuRxs00DEJR77XfuPdSlTvCq0QxLIR6wIO+t3LLJdOQctZIX6KWBR/Zq3zSn5bRxgPIaRcoyuEU25ga4cexJMEh1ymE23uTiDcnWwWN0X1jZKGuHPvqVKjyToAv6XW24mTXNvEAqD2uL101JxBseoWJ/2VtyOjJFJwcGbw+MTLymWCZiAF10w+k0SyigawaxZLlYL9LZXv4w3oCjCwuiTD/T6rvyT3wGQzXx7/P7XQGL4el4lE7leuK5m2PhWvX2S3t2FRpoZPw0DINJu5XzuBr3DSMErQjCrP4Ep8iqW8pGGLkoXbcxK3/K+uSy0k+DdBN7jRgnnOeLpqeVUSMaM6LRnl2XyDWL3dKpVbEzZaFkRTmAwdbgYjI+7Enn3/GtseMASo/gK47m2k+kE/msoqwpTGLC5DBOBKxdNShdFnEbOxLUUiVNgoZRXbj6VhdueqK89LsMDsnxzmFtrU8Ytgv8wJsFd5IkIhCStmQ9bdTqER659hd1Qqdh6Qe36AfpZcetOLr86Z++CSwA/pZbLPeEVrfCHDh6V3DPQXG+Zlf/m60OAmhosJ+4dxZwRnR8LnaDFZ+uLYMz+vJGeOtFHvczz7TW4mznjguLE51crG+mkBGT2dx1UUg7zs41lz3GtH9WY8cSG4y5ryjDl6YkXwoiZI=

View File

@ -2,6 +2,11 @@
<br><br>
<h2 align="center">企业赞助</h2>
<p align="center">
<a href="http://www.powerproject.com.cn/" target="_blank"><img width="193" src="http://www.powerproject.com.cn/wp-content/uploads/2019/08/2019080215041192.png" title="donation by wechat"></a>
</p>
<h2 align="center">Sponsors</h2>
<p align="center">
<a href="https://opencollective.com/ant-design-vue/sponsor/0/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/sponsor/0/avatar.svg"></a>
@ -40,3 +45,4 @@
- [fastgoo](https://github.com/fastgoo)
- [sendya](https://github.com/sendya)
- [limichange](https://github.com/limichange)
- [LvHang](https://github.com/184005306)

View File

@ -10,9 +10,22 @@
---
## 1.5.1
`2020-04-02`
- 🐞 Fix `PageHeader` cannot hide backIcon [#1987](https://github.com/vueComponent/ant-design-vue/pull/1987)
- 🐞 Fix `Pagination` doesn't update when total changes [#1989](https://github.com/vueComponent/ant-design-vue/pull/1989)
- 🐞 Fix placeholder does not disappear when inputting `TreeSelect` in Chinese [#1994](https://github.com/vueComponent/ant-design-vue/pull/1994)
- 🐞 Fix `Table` customRender cannot customize class style [#2004](https://github.com/vueComponent/ant-design-vue/pull/2004)
- 🐞 Fix `Form` missing slot content when using Form.create [#1998](https://github.com/vueComponent/ant-design-vue/pull/1998)
- 🐞 Fix `Textarea` scroll bar flickering problem [#1964](https://github.com/vueComponent/ant-design-vue/pull/1964)
- 🌟 Add ts type file of `FormModel` [#1996](https://github.com/vueComponent/ant-design-vue/pull/1966)
- 🌟 Add `modal` destroyAll type declaration [#1993](https://github.com/vueComponent/ant-design-vue/pull/1963)
## 1.5.0
`2020-03-15`
`2020-03-29`
- Four new components have been added:
- 🔥🔥🔥 [Mentions](https://antdv.com/components/mentions/) Added mentioned components and discarded the original Mention components.
@ -81,7 +94,8 @@
- 🌟 Badge supports custom colors.
- 🐞 Fix the problem that the label of Steps is not centered.
- 🐞 Fix cursor style problem of DatePicker and TimePicker.
- 🐞 Fix TreeSelect custom icon is invalid [#1901](https://github.com/vueComponent/ant-design-vue/issues/1901)
- 🐞 Fix `TreeSelect` custom icon is invalid [#1901](https://github.com/vueComponent/ant-design-vue/issues/1901)
- 🐞 Fix `Tabs` keyboard left / right switching error [#1947](https://github.com/vueComponent/ant-design-vue/issues/1947)
## 1.4.12

View File

@ -10,9 +10,22 @@
---
## 1.5.1
`2020-04-02`
- 🐞 修复 `PageHeader` 不能隐藏 backIcon 问题 [#1987](https://github.com/vueComponent/ant-design-vue/pull/1987)
- 🐞 修复 `Pagination` 的 total 变化时,不更新问题 [#1989](https://github.com/vueComponent/ant-design-vue/pull/1989)
- 🐞 修复 `TreeSelect` 输入中文时 placeholder 不消失问题 [#1994](https://github.com/vueComponent/ant-design-vue/pull/1994)
- 🐞 修复 `Table` customRender 不能自定义 class style 问题 [#2004](https://github.com/vueComponent/ant-design-vue/pull/2004)
- 🐞 修复 `Form` 使用 Form.create 时,丢失插槽内容问题 [#1998](https://github.com/vueComponent/ant-design-vue/pull/1998)
- 🐞 修复 `Textarea` 滚动条闪动问题 [#1964](https://github.com/vueComponent/ant-design-vue/pull/1964)
- 🌟 添加 `FormModel` 的 ts 类型文件 [#1996](https://github.com/vueComponent/ant-design-vue/pull/1966)
- 🌟 添加 `Modal` 的 destroyAll 类型声明 [#1993](https://github.com/vueComponent/ant-design-vue/pull/1963)
## 1.5.0
`2020-03-15`
`2020-03-29`
- 新增了五个组件:
- 🔥🔥🔥 [Mentions](https://antdv.com/components/mentions-cn/) 新增提及组件并废弃原有 Mention 组件。
@ -84,6 +97,7 @@
- 🐞 修复 Steps 的 label 不居中的问题。
- 🐞 修复 DatePicker 和 TimePicker 的 cursor 样式问题。
- 🐞 修复 TreeSelect 自定义图标无效的问题 [#1901](https://github.com/vueComponent/ant-design-vue/issues/1901)
- 🐞 修复 Tabs 键盘左右切换错误问题 [#1947](https://github.com/vueComponent/ant-design-vue/issues/1947)
## 1.4.12

View File

@ -12,7 +12,7 @@
An enterprise-class UI components based on Ant Design and Vue.
[![Travis branch](https://travis-ci.org/vueComponent/ant-design-vue.svg?branch=master)](https://travis-ci.org/vueComponent/ant-design-vue) [![codecov](https://img.shields.io/codecov/c/github/vueComponent/ant-design-vue/master.svg?style=flat-square)](https://codecov.io/gh/vueComponent/ant-design-vue) [![npm package](https://img.shields.io/npm/v/ant-design-vue.svg?style=flat-square)](https://www.npmjs.org/package/ant-design-vue) [![NPM downloads](http://img.shields.io/npm/dm/ant-design-vue.svg?style=flat-square)](http://www.npmtrends.com/ant-design-vue) [![Join the chat at https://gitter.im/vueComponent/ant-design-english](https://badges.gitter.im/vueComponent/ant-design-english.svg?style=flat-square)](https://gitter.im/vueComponent/ant-design-english?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) (English) [![Join the chat at https://gitter.im/vueComponent/ant-design-vue](https://img.shields.io/gitter/room/vueComponent/ant-design-vue.svg?style=flat-square)](https://gitter.im/vueComponent/ant-design-vue?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)(中文) [![backers](https://opencollective.com/ant-design-vue/backers/badge.svg)](#backers) [![sponsors](https://opencollective.com/ant-design-vue/sponsors/badge.svg)](#sponsors) [![extension-for-VSCode](https://img.shields.io/badge/extension%20for-VSCode-blue.svg?style=flat-square)](https://marketplace.visualstudio.com/items?itemName=ant-design-vue.vscode-ant-design-vue-helper)
![test](https://github.com/vueComponent/ant-design-vue/workflows/test/badge.svg) [![codecov](https://img.shields.io/codecov/c/github/vueComponent/ant-design-vue/master.svg?style=flat-square)](https://codecov.io/gh/vueComponent/ant-design-vue) [![npm package](https://img.shields.io/npm/v/ant-design-vue.svg?style=flat-square)](https://www.npmjs.org/package/ant-design-vue) [![NPM downloads](http://img.shields.io/npm/dm/ant-design-vue.svg?style=flat-square)](http://www.npmtrends.com/ant-design-vue) [![Join the chat at https://gitter.im/vueComponent/ant-design-english](https://badges.gitter.im/vueComponent/ant-design-english.svg?style=flat-square)](https://gitter.im/vueComponent/ant-design-english?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) (English) [![Join the chat at https://gitter.im/vueComponent/ant-design-vue](https://img.shields.io/gitter/room/vueComponent/ant-design-vue.svg?style=flat-square)](https://gitter.im/vueComponent/ant-design-vue?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)(中文) [![backers](https://opencollective.com/ant-design-vue/backers/badge.svg)](#backers) [![sponsors](https://opencollective.com/ant-design-vue/sponsors/badge.svg)](#sponsors) [![extension-for-VSCode](https://img.shields.io/badge/extension%20for-VSCode-blue.svg?style=flat-square)](https://marketplace.visualstudio.com/items?itemName=ant-design-vue.vscode-ant-design-vue-helper)
</div>
@ -107,8 +107,4 @@ Support us with a monthly donation and help us continue our activities. [[Become
<a href="https://opencollective.com/ant-design-vue/backer/0/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/0/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/backer/1/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/1/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/backer/2/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/2/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/backer/3/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/3/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/backer/4/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/4/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/backer/5/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/5/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/backer/6/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/6/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/backer/7/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/7/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/backer/8/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/8/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/backer/9/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/9/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/backer/10/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/10/avatar.svg"></a>
## 其他赞助者 (通过 Patreon、支付宝、微信、paypal 等等)
如果您想将您的名字显示在这里,请发邮件到 <a href="mailto:antdv@foxmail.com">antdv@foxmail.com</a>.
<a href="https://github.com/limichange" target="_blank"><img width="64" style="border-radius: 50%;" src="https://avatars0.githubusercontent.com/u/1947344?s=400&v=4" title="donation by qq"></a> <a href="https://www.mokeyjay.com" target="_blank"><img width="64" style="border-radius: 50%;" src="https://www.mokeyjay.com/headimg.png" title="donation by Patreon"></a>
## [更多赞助者 (通过 Patreon、支付宝、微信、paypal 等等)](https://github.com/vueComponent/ant-design-vue/blob/master/BACKERS.md)

View File

@ -12,7 +12,7 @@
An enterprise-class UI components based on Ant Design and Vue.
[![Travis branch](https://travis-ci.org/vueComponent/ant-design-vue.svg?branch=master)](https://travis-ci.org/vueComponent/ant-design-vue) [![codecov](https://img.shields.io/codecov/c/github/vueComponent/ant-design-vue/master.svg?style=flat-square)](https://codecov.io/gh/vueComponent/ant-design-vue) [![npm package](https://img.shields.io/npm/v/ant-design-vue.svg?style=flat-square)](https://www.npmjs.org/package/ant-design-vue) [![NPM downloads](http://img.shields.io/npm/dm/ant-design-vue.svg?style=flat-square)](http://www.npmtrends.com/ant-design-vue) [![Join the chat at https://gitter.im/vueComponent/ant-design-english](https://badges.gitter.im/vueComponent/ant-design-english.svg?style=flat-square)](https://gitter.im/vueComponent/ant-design-english?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) (English) [![Join the chat at https://gitter.im/vueComponent/ant-design-vue](https://img.shields.io/gitter/room/vueComponent/ant-design-vue.svg?style=flat-square)](https://gitter.im/vueComponent/ant-design-vue?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)(中文) [![backers](https://opencollective.com/ant-design-vue/backers/badge.svg)](#backers) [![sponsors](https://opencollective.com/ant-design-vue/sponsors/badge.svg)](#sponsors) [![extension-for-VSCode](https://img.shields.io/badge/extension%20for-VSCode-blue.svg?style=flat-square)](https://marketplace.visualstudio.com/items?itemName=ant-design-vue.vscode-ant-design-vue-helper)
![test](https://github.com/vueComponent/ant-design-vue/workflows/test/badge.svg) [![codecov](https://img.shields.io/codecov/c/github/vueComponent/ant-design-vue/master.svg?style=flat-square)](https://codecov.io/gh/vueComponent/ant-design-vue) [![npm package](https://img.shields.io/npm/v/ant-design-vue.svg?style=flat-square)](https://www.npmjs.org/package/ant-design-vue) [![NPM downloads](http://img.shields.io/npm/dm/ant-design-vue.svg?style=flat-square)](http://www.npmtrends.com/ant-design-vue) [![Join the chat at https://gitter.im/vueComponent/ant-design-english](https://badges.gitter.im/vueComponent/ant-design-english.svg?style=flat-square)](https://gitter.im/vueComponent/ant-design-english?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) (English) [![Join the chat at https://gitter.im/vueComponent/ant-design-vue](https://img.shields.io/gitter/room/vueComponent/ant-design-vue.svg?style=flat-square)](https://gitter.im/vueComponent/ant-design-vue?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)(中文) [![backers](https://opencollective.com/ant-design-vue/backers/badge.svg)](#backers) [![sponsors](https://opencollective.com/ant-design-vue/sponsors/badge.svg)](#sponsors) [![extension-for-VSCode](https://img.shields.io/badge/extension%20for-VSCode-blue.svg?style=flat-square)](https://marketplace.visualstudio.com/items?itemName=ant-design-vue.vscode-ant-design-vue-helper)
</div>
@ -101,10 +101,6 @@ Support us with a monthly donation and help us continue our activities. [[Become
<a href="https://opencollective.com/ant-design-vue/backer/0/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/0/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/backer/1/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/1/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/backer/2/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/2/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/backer/3/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/3/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/backer/4/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/4/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/backer/5/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/5/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/backer/6/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/6/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/backer/7/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/7/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/backer/8/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/8/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/backer/9/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/9/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/backer/10/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/10/avatar.svg"></a><a href="https://opencollective.com/ant-design-vue/backer/9/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/9/avatar.svg"></a>
## Other Sponsor (From Patreon、alipay、wechat、paypal...)
If you want to show your name here, please send an email to <a href="mailto:antdv@foxmail.com">antdv@foxmail.com</a>.
<a href="https://github.com/limichange" target="_blank"><img width="64" style="border-radius: 50%;" src="https://avatars0.githubusercontent.com/u/1947344?s=400&v=4" title="donation by qq"></a> <a href="https://www.mokeyjay.com" target="_blank"><img width="64" style="border-radius: 50%;" src="https://www.mokeyjay.com/headimg.png" title="donation by Patreon"></a>
## [More Sponsor (From Patreon、alipay、wechat、paypal...)](https://github.com/vueComponent/ant-design-vue/blob/master/BACKERS.md)
[![Let's fund issues in this repository](https://issuehunt.io/static/embed/issuehunt-button-v1.svg)](https://issuehunt.io/repos/104172832)

View File

@ -1,3 +1,4 @@
/* eslint-disable no-console */
'use strict';
// const install = require('./install')
@ -336,6 +337,7 @@ gulp.task(
newVersion &&
newVersion.trim() === version
) {
// eslint-disable-next-line no-unused-vars
runCmd('npm', ['run', 'pub'], code => {
done();
});

@ -1 +1 @@
Subproject commit f5555d2ba84ebe7bede6f3dbc4e2563158b60621
Subproject commit 8002bd2bd50fe21275d67e19607e2d3ebc0835e9

View File

@ -27,13 +27,15 @@ export default {
__emit() {
// 直接调用listeners底层组件不需要vueTool记录events
const args = [].slice.call(arguments, 0);
const filterEvent = [];
const eventName = args[0];
if (args.length && this.$listeners[eventName]) {
if (filterEvent.includes(eventName)) {
this.$emit(eventName, ...args.slice(1));
const event = this.$listeners[eventName];
if (args.length && event) {
if (Array.isArray(event)) {
for (let i = 0, l = event.length; i < l; i++) {
event[i](...args.slice(1));
}
} else {
this.$listeners[eventName](...args.slice(1));
event(...args.slice(1));
}
}
},

View File

@ -62,6 +62,11 @@ export function cloneElement(n, nodeProps = {}, deep) {
return null;
}
const node = cloneVNode(ele, deep);
// // 函数式组件不支持clone https://github.com/vueComponent/ant-design-vue/pull/1947
// warning(
// !(node.fnOptions && node.fnOptions.functional),
// `can not use cloneElement for functional component (${node.fnOptions && node.fnOptions.name})`,
// );
const { props = {}, key, on = {}, children, directives = [] } = nodeProps;
const data = node.data || {};
let cls = {};
@ -127,10 +132,6 @@ export function cloneElement(n, nodeProps = {}, deep) {
node.data.on = { ...(node.data.on || {}), ...on };
}
if (node.fnOptions && node.fnOptions.functional) {
node.data.on = { ...(node.data.on || {}), ...on };
}
if (key !== undefined) {
node.key = key;
node.data.key = key;

View File

@ -219,10 +219,11 @@ export default {
openChange: this.handleOpenChange,
},
style: popupStyle,
scopedSlots: { default: input, ...$scopedSlots },
};
return (
<span class={pickerClass}>
<VcDatePicker {...vcDatePickerProps}>{input}</VcDatePicker>
<VcDatePicker {...vcDatePickerProps} />
</span>
);
},

View File

@ -41,7 +41,6 @@
font-weight: normal;
font-size: @font-size-base;
line-height: @line-height-base;
white-space: nowrap;
&::after {
position: relative;

View File

@ -29,8 +29,8 @@ exports[`renders ./antdv-demo/docs/drawer/demo/render-in-current.md correctly 1`
<div style="height: 200px; overflow: hidden; position: relative; border: 1px solid #ebedf0; border-radius: 2px; padding: 48px; text-align: center; background: rgb(250, 250, 250);">
Render in this
<div style="margin-top: 16px;"><button type="button" class="ant-btn ant-btn-primary"><span>Open</span></button></div>
<div tabindex="-1" class="" style="position: absolute;">
<div tabindex="-1" class="ant-drawer ant-drawer-right">
<div tabindex="-1" class="">
<div tabindex="-1" class="ant-drawer ant-drawer-right" style="position: absolute;">
<div class="ant-drawer-mask"></div>
<div class="ant-drawer-content-wrapper" style="transform: translateX(100%); width: 256px;">
<div class="ant-drawer-content">

View File

@ -232,14 +232,22 @@ export default {
let firstChildren = children[0];
if (this.prop && this.autoLink && isValidElement(firstChildren)) {
const originalEvents = getEvents(firstChildren);
const originalBlur = originalEvents.blur;
const originalChange = originalEvents.change;
firstChildren = cloneElement(firstChildren, {
on: {
blur: (...args) => {
originalEvents.blur && originalEvents.blur(...args);
originalBlur && originalBlur(...args);
this.onFieldBlur();
},
change: (...args) => {
originalEvents.change && originalEvents.change(...args);
if (Array.isArray(originalChange)) {
for (let i = 0, l = originalChange.length; i < l; i++) {
originalChange[i](...args);
}
} else if (originalChange) {
originalChange(...args);
}
this.onFieldChange();
},
},

View File

@ -2,7 +2,6 @@ import warning from '../_util/warning';
import Base from '../base';
const Icon = {
functional: true,
name: 'AIcon',
render() {
warning(false, 'Icon', 'Empty Icon');

View File

@ -9,6 +9,10 @@ import inputProps from './inputProps';
import PropTypes from '../_util/vue-types';
import { getOptionProps, getListeners } from '../_util/props-util';
const RESIZE_STATUS_NONE = 0;
const RESIZE_STATUS_RESIZING = 1;
const RESIZE_STATUS_RESIZED = 2;
const TextAreaProps = {
...inputProps,
autosize: PropTypes.oneOfType([Object, Boolean]),
@ -20,7 +24,7 @@ const ResizableTextArea = {
data() {
return {
textareaStyles: {},
resizing: false,
resizeStatus: RESIZE_STATUS_NONE,
};
},
mixins: [BaseMixin],
@ -39,6 +43,18 @@ const ResizableTextArea = {
},
},
methods: {
handleResize(size) {
const { resizeStatus } = this.$data;
const { autoSize } = this.$props;
if (resizeStatus !== RESIZE_STATUS_NONE) {
return;
}
this.$emit('resize', size);
if (autoSize) {
this.resizeOnNextFrame();
}
},
resizeOnNextFrame() {
raf.cancel(this.nextFrameActionId);
this.nextFrameActionId = raf(this.resizeTextarea);
@ -51,18 +67,37 @@ const ResizableTextArea = {
}
const { minRows, maxRows } = autoSize;
const textareaStyles = calculateNodeHeight(this.$refs.textArea, false, minRows, maxRows);
this.setState({ textareaStyles, resizing: true }, () => {
this.setState({ textareaStyles, resizeStatus: RESIZE_STATUS_RESIZING }, () => {
raf.cancel(this.resizeFrameId);
this.resizeFrameId = raf(() => {
this.setState({ resizing: false });
this.setState({ resizeStatus: RESIZE_STATUS_RESIZED }, () => {
this.resizeFrameId = raf(() => {
this.setState({ resizeStatus: RESIZE_STATUS_NONE });
this.fixFirefoxAutoScroll();
});
});
});
});
},
// https://github.com/ant-design/ant-design/issues/21870
fixFirefoxAutoScroll() {
try {
if (document.activeElement === this.$refs.textArea) {
const currentStart = this.$refs.textArea.selectionStart;
const currentEnd = this.$refs.textArea.selectionEnd;
this.$refs.textArea.setSelectionRange(currentStart, currentEnd);
}
} catch (e) {
// Fix error in Chrome:
// Failed to read the 'selectionStart' property from 'HTMLInputElement'
// http://stackoverflow.com/q/21177489/3040605
}
},
renderTextArea() {
const props = getOptionProps(this);
const { prefixCls, autoSize, autosize, disabled } = props;
const { textareaStyles, resizing } = this.$data;
const { textareaStyles, resizeStatus } = this.$data;
warning(
autosize === undefined,
'Input.TextArea',
@ -89,7 +124,9 @@ const ResizableTextArea = {
}
const style = {
...textareaStyles,
...(resizing ? { overflow: 'hidden' } : null),
...(resizeStatus === RESIZE_STATUS_RESIZING
? { overflowX: 'hidden', overflowY: 'hidden' }
: null),
};
const textareaProps = {
attrs: otherProps,
@ -104,7 +141,7 @@ const ResizableTextArea = {
],
};
return (
<ResizeObserver onResize={this.resizeOnNextFrame} disabled={!(autoSize || autosize)}>
<ResizeObserver onResize={this.handleResize} disabled={!(autoSize || autosize)}>
<textarea {...textareaProps} ref="textArea" />
</ResizeObserver>
);

View File

@ -6,8 +6,8 @@ import SearchOutlined from '@ant-design/icons-vue/SearchOutlined';
import inputProps from './inputProps';
import Button from '../button';
import { cloneElement } from '../_util/vnode';
import { getOptionProps, getComponentFromProp, getListeners } from '../_util/props-util';
import PropTypes from '../_util/vue-types';
import { getOptionProps, getComponentFromProp, getListeners } from '../_util/props-util';
import { ConfigConsumerProps } from '../config-provider';
export default {
@ -19,7 +19,8 @@ export default {
},
props: {
...inputProps,
enterButton: PropTypes.any.def(false),
// https://github.com/vueComponent/ant-design-vue/issues/1916
enterButton: PropTypes.any,
},
inject: {
configProvider: { default: () => ConfigConsumerProps },

View File

@ -13,9 +13,9 @@ exports[`renders ./antdv-demo/docs/input/demo/addon.md correctly 1`] = `
exports[`renders ./antdv-demo/docs/input/demo/allowClear.md correctly 1`] = `<div><span class="ant-input-affix-wrapper"><input placeholder="input with clear icon" type="text" class="ant-input"><span class="ant-input-suffix"></span></span> <br> <br> <span class="ant-input-affix-wrapper ant-input-affix-wrapper-textarea-with-clear-btn"><textarea placeholder="textarea with clear icon" class="ant-input"></textarea></span></div>`;
exports[`renders ./antdv-demo/docs/input/demo/autosize-textarea.md correctly 1`] = `
<div><textarea placeholder="Autosize height based on content lines" class="ant-input" style="height: 0px; min-height: -9007199254740991px; max-height: 9007199254740991px; overflow: hidden;"></textarea>
<div style="margin: 24px 0px;"></div> <textarea placeholder="Autosize height with minimum and maximum number of lines" class="ant-input" style="height: -24px; min-height: -8px; max-height: -24px; overflow: hidden;"></textarea>
<div style="margin: 24px 0px;"></div> <textarea placeholder="Controlled autosize" class="ant-input" style="height: -20px; min-height: -12px; max-height: -20px; overflow: hidden;"></textarea></div>
<div><textarea placeholder="Autosize height based on content lines" class="ant-input" style="height: 0px; min-height: -9007199254740991px; max-height: 9007199254740991px; overflow-y: hidden; overflow-x: hidden;"></textarea>
<div style="margin: 24px 0px;"></div> <textarea placeholder="Autosize height with minimum and maximum number of lines" class="ant-input" style="height: -24px; min-height: -8px; max-height: -24px; overflow-y: hidden; overflow-x: hidden;"></textarea>
<div style="margin: 24px 0px;"></div> <textarea placeholder="Controlled autosize" class="ant-input" style="height: -20px; min-height: -12px; max-height: -20px; overflow-y: hidden; overflow-x: hidden;"></textarea></div>
`;
exports[`renders ./antdv-demo/docs/input/demo/basic.md correctly 1`] = `<input placeholder="Basic usage" type="text" class="ant-input">`;
@ -52,7 +52,7 @@ exports[`renders ./antdv-demo/docs/input/demo/password-input.md correctly 1`] =
exports[`renders ./antdv-demo/docs/input/demo/presuffix.md correctly 1`] = `<div class="components-input-demo-presuffix"><span class="ant-input-affix-wrapper"><span class="ant-input-prefix"><span role="img" aria-label="user" type="user" class="anticon anticon-user"><svg viewBox="64 64 896 896" focusable="false" data-icon="user" width="1em" height="1em" fill="currentColor" aria-hidden="true" class=""><path d="M858.5 763.6a374 374 0 00-80.6-119.5 375.63 375.63 0 00-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 00-80.6 119.5A371.7 371.7 0 00136 901.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 008-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"></path></svg></span></span><input placeholder="Basic usage" type="text" class="ant-input"><span class="ant-input-suffix"><span role="img" aria-label="info-circle" class="anticon anticon-info-circle" style="color: rgba(0, 0, 0, 0.45);"><svg viewBox="64 64 896 896" focusable="false" data-icon="info-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true" class=""><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"></path><path d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"></path></svg></span></span></span> <br> <br> <span class="ant-input-affix-wrapper"><span class="ant-input-prefix">¥</span><input type="text" class="ant-input"><span class="ant-input-suffix">RMB</span></span></div>`;
exports[`renders ./antdv-demo/docs/input/demo/search-input.md correctly 1`] = `<div><span class="ant-input-affix-wrapper ant-input-search" style="width: 200px;"><input placeholder="input search text" type="text" class="ant-input"><span class="ant-input-suffix"><span role="img" aria-label="search" tabindex="-1" class="anticon anticon-search ant-input-search-icon"><svg viewBox="64 64 896 896" focusable="false" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" class=""><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg></span></span></span> <br><br> <span class="ant-input-group-wrapper ant-input-search ant-input-search-enter-button"><span class="ant-input-wrapper ant-input-group"><input placeholder="input search text" type="text" class="ant-input"><span class="ant-input-group-addon"><button type="button" class="ant-btn ant-btn-primary ant-input-search-button"><span role="img" aria-label="search" class="anticon anticon-search"><svg viewBox="64 64 896 896" focusable="false" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" class=""><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg></span></button></span></span></span> <br><br> <span class="ant-input-group-wrapper ant-input-group-wrapper-lg ant-input-search ant-input-search-enter-button ant-input-search-large"><span class="ant-input-wrapper ant-input-group"><input placeholder="input search text" type="text" class="ant-input ant-input-lg"><span class="ant-input-group-addon"><button type="button" class="ant-btn ant-btn-primary ant-btn-lg ant-input-search-button"><span>Search</span></button></span></span></span> <br><br> <span class="ant-input-affix-wrapper ant-input-affix-wrapper-lg ant-input-search"><input placeholder="input search text" type="text" class="ant-input ant-input-lg"><span class="ant-input-suffix"><span role="img" aria-label="search" tabindex="-1" class="anticon anticon-search ant-input-search-icon"><svg viewBox="64 64 896 896" focusable="false" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" class=""><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg></span></span></span></div>`;
exports[`renders ./antdv-demo/docs/input/demo/search-input.md correctly 1`] = `<div><span class="ant-input-affix-wrapper ant-input-search" style="width: 200px;"><input placeholder="input search text" type="text" class="ant-input"><span class="ant-input-suffix"><span role="img" aria-label="search" tabindex="-1" class="anticon anticon-search ant-input-search-icon"><svg viewBox="64 64 896 896" focusable="false" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" class=""><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg></span></span></span> <br><br> <span class="ant-input-group-wrapper ant-input-search ant-input-search-enter-button"><span class="ant-input-wrapper ant-input-group"><input placeholder="input search text" type="text" class="ant-input"><span class="ant-input-group-addon"><button type="button" class="ant-btn ant-btn-primary ant-input-search-button"><span role="img" aria-label="search" class="anticon anticon-search"><svg viewBox="64 64 896 896" focusable="false" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" class=""><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg></span></button></span></span></span> <br><br> <span class="ant-input-group-wrapper ant-input-group-wrapper-lg ant-input-search ant-input-search-enter-button ant-input-search-large"><span class="ant-input-wrapper ant-input-group"><input placeholder="input search text" type="text" class="ant-input ant-input-lg"><span class="ant-input-group-addon"><button type="button" class="ant-btn ant-btn-primary ant-btn-lg ant-input-search-button"><span>Search</span></button></span></span></span> <br><br> <span class="ant-input-group-wrapper ant-input-group-wrapper-lg ant-input-search ant-input-search-enter-button ant-input-search-large"><span class="ant-input-wrapper ant-input-group"><input placeholder="input search text" type="text" class="ant-input ant-input-lg"><span class="ant-input-group-addon"><button type="button" class="ant-btn ant-btn-lg ant-input-search-button"><span>Custom</span></button></span></span></span></div>`;
exports[`renders ./antdv-demo/docs/input/demo/search-input-loading.md correctly 1`] = `<div><span class="ant-input-affix-wrapper ant-input-search"><input placeholder="input search loading deault" type="text" class="ant-input"><span class="ant-input-suffix"><span role="img" aria-label="loading" class="anticon anticon-loading ant-input-search-icon"><svg viewBox="0 0 1024 1024" focusable="false" 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 00-94.3-139.9 437.71 437.71 0 00-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></span></span></span> <br> <br> <span class="ant-input-group-wrapper ant-input-search ant-input-search-enter-button"><span class="ant-input-wrapper ant-input-group"><input placeholder="input search loading with enterButton" type="text" class="ant-input"><span class="ant-input-group-addon"><button type="button" class="ant-btn ant-btn-primary ant-input-search-button"><span role="img" aria-label="loading" class="anticon anticon-loading"><svg viewBox="0 0 1024 1024" focusable="false" 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 00-94.3-139.9 437.71 437.71 0 00-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></span></button></span></span></span></div>`;

View File

@ -142,11 +142,6 @@ export default function calculateNodeHeight(
height = Math.min(maxHeight, height);
}
}
// // Remove scroll bar flash when autosize without maxRows
// // donot remove in vue
// if (!maxRows) {
// overflowY = 'hidden';
// }
return {
height: `${height}px`,
minHeight: `${minHeight}px`,

View File

@ -135,11 +135,11 @@ exports[`renders ./antdv-demo/docs/list/demo/infinite-virtualized-load.md correc
<div class="ant-list ant-list-split">
<div class="ant-spin-nested-loading">
<div class="ant-spin-container">
<div data-v-3eef485a="" class="virtual-scroller" infinite-scroll-distance="10" style="height: 400px;">
<div data-v-3eef485a="" class="item-container">
<div data-v-3eef485a="" class="items"></div>
</div>
<div data-v-b329ee4c="" data-v-3eef485a="" tabindex="-1" class="resize-observer"><object style="display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;" aria-hidden="true" tabindex="-1" type="text/html" data="about:blank"></object></div>
<div class="vue-recycle-scroller direction-vertical" infinite-scroll-distance="10" style="height: 400px;">
<!---->
<div class="vue-recycle-scroller__item-wrapper" style="min-height: 0px;"></div>
<!---->
<div data-v-b329ee4c="" tabindex="-1" class="resize-observer"><object aria-hidden="true" tabindex="-1" type="text/html" data="about:blank"></object></div>
</div>
</div>
</div>

View File

@ -2,6 +2,7 @@ import PropTypes from '../_util/vue-types';
import defaultLocaleData from './default';
export default {
name: 'LocaleReceiver',
props: {
componentName: PropTypes.string.def('global'),
defaultLocale: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),

View File

@ -56,7 +56,12 @@ const renderTitle = (h, prefixCls, instance) => {
const subTitle = getComponentFromProp(instance, 'subTitle');
const tags = getComponentFromProp(instance, 'tags');
const extra = getComponentFromProp(instance, 'extra');
const backIcon = getComponentFromProp(instance, 'backIcon') || <ArrowLeftOutlined />;
const backIcon =
getComponentFromProp(instance, 'backIcon') !== undefined ? (
getComponentFromProp(instance, 'backIcon')
) : (
<ArrowLeftOutlined />
);
const onBack = instance.$listeners.back;
const headingPrefixCls = `${prefixCls}-heading`;
if (title || subTitle || tags || extra) {

View File

@ -1,6 +1,5 @@
import * as moment from 'moment';
import interopDefault from '../_util/interopDefault';
import { cloneElement } from '../_util/vnode';
import { initDefaultProps, getListeners } from '../_util/props-util';
import Statistic, { StatisticProps } from './Statistic';
import { formatCountdown } from './utils';
@ -70,13 +69,7 @@ export default {
return formatCountdown(value, { ...config, format });
},
// Countdown do not need display the timestamp
valueRenderHtml: node =>
cloneElement(node, {
props: {
title: undefined,
},
}),
valueRenderHtml: node => node,
},
render() {

View File

@ -491,13 +491,15 @@ export default {
return getPopupContainer;
}
// Use undefined to let rc component use default logic.
return scroll && table ? () => table.tableNode : undefined;
return scroll && table ? () => table.getTableNode() : undefined;
},
scrollToFirstRow() {
const { scroll } = this.$props;
if (scroll && scroll.scrollToFirstRowOnChange !== false) {
scrollTo(0, {
getContainer: () => this.$refs.vcTable.bodyTable,
getContainer: () => {
return this.$refs.vcTable.getBodyTable();
},
});
}
},
@ -1204,8 +1206,8 @@ export default {
const vcTableProps = {
key: 'table',
props: {
...restProps,
expandIcon: this.renderExpandIcon(prefixCls),
...restProps,
customRow: (record, index) => this.onRow(prefixCls, record, index),
components: this.sComponents,
prefixCls,

View File

@ -220,34 +220,34 @@ exports[`renders ./antdv-demo/docs/table/demo/colspan-rowspan.md correctly 1`] =
<tbody class="ant-table-tbody">
<tr class="ant-table-row ant-table-row-level-0" data-row-key="1">
<td class=""><a href="javascript:;">John Brown</a></td>
<td class="">32</td>
<td class="">0571-22098909</td>
<td class="">18889898989</td>
<td class="">New York No. 1 Lake Park</td>
<td>32</td>
<td>0571-22098909</td>
<td>18889898989</td>
<td>New York No. 1 Lake Park</td>
</tr>
<tr class="ant-table-row ant-table-row-level-0" data-row-key="2">
<td class=""><a href="javascript:;">Jim Green</a></td>
<td class="">42</td>
<td class="">0571-22098333</td>
<td class="">18889898888</td>
<td class="">London No. 1 Lake Park</td>
<td>42</td>
<td>0571-22098333</td>
<td>18889898888</td>
<td>London No. 1 Lake Park</td>
</tr>
<tr class="ant-table-row ant-table-row-level-0" data-row-key="3">
<td class=""><a href="javascript:;">Joe Black</a></td>
<td class="">32</td>
<td rowspan="2" class="">0575-22098909</td>
<td class="">18900010002</td>
<td class="">Sidney No. 1 Lake Park</td>
<td>32</td>
<td rowspan="2">0575-22098909</td>
<td>18900010002</td>
<td>Sidney No. 1 Lake Park</td>
</tr>
<tr class="ant-table-row ant-table-row-level-0" data-row-key="4">
<td class=""><a href="javascript:;">Jim Red</a></td>
<td class="">18</td>
<td>18</td>
<!---->
<td class="">18900010002</td>
<td class="">London No. 2 Lake Park</td>
<td>18900010002</td>
<td>London No. 2 Lake Park</td>
</tr>
<tr class="ant-table-row ant-table-row-level-0" data-row-key="5">
<td colspan="5" class=""><a href="javascript:;">Jake White</a></td>
<td colspan="5"><a href="javascript:;">Jake White</a></td>
<!---->
<!---->
<!---->

View File

@ -4,9 +4,25 @@ import LeftOutlined from '@ant-design/icons-vue/LeftOutlined';
import RightOutlined from '@ant-design/icons-vue/RightOutlined';
import ScrollableInkTabBar from '../vc-tabs/src/ScrollableInkTabBar';
import { cloneElement } from '../_util/vnode';
import PropTypes from '../_util/vue-types';
import { getListeners } from '../_util/props-util';
const TabBar = {
functional: true,
render(h, context) {
name: 'TabBar',
inheritAttrs: false,
props: {
prefixCls: PropTypes.string,
tabBarStyle: PropTypes.object,
tabBarExtraContent: PropTypes.any,
type: PropTypes.oneOf(['line', 'card', 'editable-card']),
tabPosition: PropTypes.oneOf(['top', 'right', 'bottom', 'left']).def('top'),
tabBarPosition: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
size: PropTypes.oneOf(['default', 'small', 'large']),
animated: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),
renderTabBar: PropTypes.func,
panels: PropTypes.array.def([]),
activeKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
},
render() {
const {
tabBarStyle,
animated = true,
@ -16,7 +32,7 @@ const TabBar = {
prefixCls,
type = 'line',
size,
} = context.props;
} = this.$props;
const inkBarAnimated = typeof animated === 'object' ? animated.inkBar : animated;
const isVertical = tabPosition === 'left' || tabPosition === 'right';
@ -48,14 +64,15 @@ const TabBar = {
const renderProps = {
props: {
...context.props,
...this.$props,
...this.$attrs,
inkBarAnimated,
extraContent: tabBarExtraContent,
prevIcon,
nextIcon,
},
style: tabBarStyle,
on: context.listeners,
on: getListeners(this),
class: cls,
};
@ -67,7 +84,7 @@ const TabBar = {
RenderTabBar = <ScrollableInkTabBar {...renderProps} />;
}
return cloneElement(RenderTabBar, renderProps);
return cloneElement(RenderTabBar);
},
};

View File

@ -27,12 +27,7 @@ export default {
defaultActiveKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
hideAdd: PropTypes.bool.def(false),
tabBarStyle: PropTypes.object,
tabBarExtraContent: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
PropTypes.func,
PropTypes.array,
]),
tabBarExtraContent: PropTypes.any,
destroyInactiveTabPane: PropTypes.bool.def(false),
type: PropTypes.oneOf(['line', 'card', 'editable-card']),
tabPosition: PropTypes.oneOf(['top', 'right', 'bottom', 'left']).def('top'),

View File

@ -710,7 +710,7 @@ function createBaseForm(option = {}, mixins = []) {
},
render() {
const { $slots } = this;
const { $slots, $scopedSlots } = this;
const formProps = {
[formPropName]: this.getForm(),
};
@ -729,9 +729,18 @@ function createBaseForm(option = {}, mixins = []) {
},
],
};
if (Object.keys($scopedSlots).length) {
wrappedComponentProps.scopedSlots = $scopedSlots;
}
const slotsKey = Object.keys($slots);
return WrappedComponent ? (
<WrappedComponent {...wrappedComponentProps}>{$slots.default}</WrappedComponent>
<WrappedComponent {...wrappedComponentProps}>
{slotsKey.length
? slotsKey.map(name => {
return <template slot={name}>{$slots[name]}</template>;
})
: null}
</WrappedComponent>
) : null;
},
};

View File

@ -65,7 +65,8 @@ export function getActiveKey(props, originalActiveKey) {
if (defaultActiveFirst) {
loopMenuItem(children, (c, i) => {
const propsData = c.componentOptions.propsData || {};
if (!activeKey && c && !propsData.disabled) {
const noActiveKey = activeKey === null || activeKey === undefined;
if (noActiveKey && c && !propsData.disabled) {
activeKey = getKeyFromChildrenIndex(c, eventKey, i);
}
});

View File

@ -120,6 +120,24 @@ export default {
}
});
},
total() {
const newState = {};
const newCurrent = calculatePage(this.pageSize, this.$data, this.$props);
if (hasProp(this, 'current')) {
const current = Math.min(this.current, newCurrent);
newState.stateCurrent = current;
newState.stateCurrentInputValue = current;
} else {
let current = this.stateCurrent;
if (current === 0 && newCurrent > 0) {
current = 1;
} else {
current = Math.min(this.stateCurrent, newCurrent);
}
newState.stateCurrent = current;
}
this.setState(newState);
},
},
methods: {
getJumpPrevPage() {

View File

@ -20,6 +20,12 @@ const Table = {
ColumnGroup,
props: T.props,
methods: {
getTableNode() {
return this.$refs.table.tableNode;
},
getBodyTable() {
return this.$refs.table.ref_bodyTable;
},
normalize(elements = []) {
const columns = [];
elements.forEach(element => {
@ -63,6 +69,7 @@ const Table = {
columns,
},
on: getListeners(this),
ref: 'table',
};
return <T {...tProps} />;
},

View File

@ -70,6 +70,8 @@ export default {
if (isInvalidRenderCellText(text)) {
tdProps.attrs = text.attrs || {};
tdProps.props = text.props || {};
tdProps.class = text.class;
tdProps.style = text.style;
colSpan = tdProps.attrs.colSpan;
rowSpan = tdProps.attrs.rowSpan;
text = text.children;
@ -99,7 +101,7 @@ export default {
tdProps.style = { textAlign: column.align, ...tdProps.style };
}
const cellClassName = classNames(className || column.class, {
const cellClassName = classNames(className, column.class, {
[`${prefixCls}-cell-ellipsis`]: !!column.ellipsis,
//
// https://github.com/ant-design/ant-design/issues/13825#issuecomment-449889241

View File

@ -51,8 +51,10 @@ const TableHeaderRow = {
}
headerCellProps.class = classNames(
customProps.class || customProps.className,
column.class || column.className,
customProps.class,
customProps.className,
column.class,
column.className,
{
[`${prefixCls}-align-${column.align}`]: !!column.align,
[`${prefixCls}-row-cell-ellipsis`]: !!column.ellipsis,

View File

@ -151,7 +151,7 @@ const SearchInput = {
>
{mirrorSearchValue}&nbsp;
</span>
{renderPlaceholder ? renderPlaceholder() : null}
{renderPlaceholder && !mirrorSearchValue ? renderPlaceholder() : null}
</span>
);
},

26
examples/App.vue Normal file
View File

@ -0,0 +1,26 @@
<template>
<div>
<a-button type="primary">
Primary
</a-button>
<a-button>Default</a-button>
<a-button type="dashed">
Dashed
</a-button>
<a-button type="danger">
Danger
</a-button>
<a-button type="primary">
按钮
</a-button>
<a-button type="link">
Link
</a-button>
</div>
</template>
<script>
export default {
name: 'Demo',
};
</script>

30
examples/index.html Normal file
View File

@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<meta
name="description"
content="An enterprise-class UI components based on Ant Design and Vue"
/>
<title>Ant Design Vue</title>
<meta
name="keywords"
content="ant design vue,ant-design-vue,ant-design-vue admin,ant design pro,vue ant design,vue ant design pro,vue ant design admin,ant design vue官网,ant design vue中文文档,ant design vue文档"
/>
<link rel="shortcut icon" type="image/x-icon" href="https://qn.antdv.com/favicon.ico" />
<style id="nprogress-style">
#nprogress {
display: none;
}
</style>
</head>
<body>
<div id="app"></div>
</body>
</html>

12
examples/index.js Normal file
View File

@ -0,0 +1,12 @@
import 'babel-polyfill';
import Vue from 'vue';
import App from './App.vue';
import Antd from 'ant-design-vue';
import 'ant-design-vue/style.js';
Vue.use(Antd);
new Vue({
el: '#app',
render: h => h(App),
});

View File

@ -1,115 +0,0 @@
[build]
publish = "_site"
command = "npm run site"
[context.production]
command = "echo build"
publish = "."
[[redirects]]
from = "/docs/resource/download"
to = "/docs/spec/download"
status = 301
force = false
[[redirects]]
from = "/docs/resource/download-cn"
to = "/docs/spec/download-cn"
status = 301
force = false
[[redirects]]
from = "/docs/resource/reference"
to = "/docs/spec/reference"
status = 301
force = false
[[redirects]]
from = "/docs/resource/reference-cn"
to = "/docs/spec/reference-cn"
status = 301
force = false
[[redirects]]
from = "/docs/spec/feature"
to = "/docs/spec/values"
status = 301
force = false
[[redirects]]
from = "/docs/spec/feature-cn"
to = "/docs/spec/values-cn"
status = 301
force = false
[[redirects]]
from = "/docs/pattern/advanced-search"
to = "/docs/spec/overview"
status = 301
force = false
[[redirects]]
from = "/docs/pattern/advanced-search-cn"
to = "/docs/spec/overview-cn"
status = 301
force = false
[[redirects]]
from = "/docs/pattern/complex-table"
to = "/docs/spec/overview"
status = 301
force = false
[[redirects]]
from = "/docs/pattern/complex-table-cn"
to = "/docs/spec/overview-cn"
status = 301
force = false
[[redirects]]
from = "/docs/pattern/form"
to = "/docs/spec/overview"
status = 301
force = false
[[redirects]]
from = "/docs/pattern/form-cn"
to = "/docs/spec/overview-cn"
status = 301
force = false
[[redirects]]
from = "/docs/pattern/list"
to = "/docs/spec/overview"
status = 301
force = false
[[redirects]]
from = "/docs/pattern/list-cn"
to = "/docs/spec/overview-cn"
status = 301
force = false
[[redirects]]
from = "/docs/pattern/navigation"
to = "/docs/spec/overview"
status = 301
force = false
[[redirects]]
from = "/docs/pattern/navigation-cn"
to = "/docs/spec/overview-cn"
status = 301
force = false
[[redirects]]
from = "/docs/pattern/table"
to = "/docs/spec/overview"
status = 301
force = false
[[redirects]]
from = "/docs/pattern/table-cn"
to = "/docs/spec/overview-cn"
status = 301
force = false

View File

@ -1,6 +1,6 @@
{
"name": "ant-design-vue",
"version": "1.5.0-rc.5",
"version": "1.5.1",
"title": "Ant Design Vue",
"description": "An enterprise-class UI design language and Vue-based implementation",
"keywords": [
@ -26,8 +26,8 @@
"scripts"
],
"scripts": {
"dev": "node build/dev.js",
"start": "cross-env PORT=3001 NODE_ENV=development webpack-dev-server --config build/webpack.dev.conf.js",
"dev": "webpack-dev-server",
"start": "cross-env NODE_ENV=development webpack-dev-server --config webpack.config.js",
"test": "cross-env NODE_ENV=test jest --config .jest.js",
"compile": "node antd-tools/cli/run.js compile",
"pub": "node antd-tools/cli/run.js pub",
@ -109,7 +109,6 @@
"gulp": "^4.0.1",
"gulp-babel": "^7.0.0",
"gulp-strip-code": "^0.1.4",
"highlight.js": "^9.12.0",
"html-webpack-plugin": "^3.2.0",
"husky": "^4.0.0",
"istanbul-instrumenter-loader": "^3.0.0",
@ -123,8 +122,6 @@
"less-loader": "^5.0.0",
"less-plugin-npm-import": "^2.1.0",
"lint-staged": "^10.0.0",
"markdown-it": "^10.0.0",
"markdown-it-anchor": "^5.0.0",
"marked": "0.3.18",
"merge2": "^1.2.1",
"mini-css-extract-plugin": "^0.9.0",
@ -137,7 +134,6 @@
"postcss-loader": "^3.0.0",
"prettier": "^1.18.2",
"pretty-quick": "^2.0.0",
"prismjs": "^1.19.0",
"querystring": "^0.2.0",
"raw-loader": "^4.0.0",
"reqwest": "^2.0.5",
@ -164,7 +160,7 @@
"vue-router": "^3.0.1",
"vue-server-renderer": "^2.6.11",
"vue-template-compiler": "^2.6.11",
"vue-virtual-scroller": "^0.12.0",
"vue-virtual-scroller": "^1.0.0",
"vuex": "^3.1.0",
"webpack": "^4.28.4",
"webpack-cli": "^3.2.1",

View File

@ -30,6 +30,7 @@ async function syncFiles(data = []) {
if (!fs.existsSync(toPath)) {
fse.ensureDirSync(toPath);
}
// eslint-disable-next-line no-console
console.log('update style: ', path.join(toPath, itemData.name.replace('.tsx', '.js')));
const content = Base64.decode(itemData.content);
fs.writeFileSync(path.join(toPath, itemData.name.replace('.tsx', '.js')), content);

View File

@ -5,7 +5,7 @@
import { AntdComponent } from '../component';
import { Col } from '../grid/col';
export declare class NFormItem extends AntdComponent {
export declare class FormModelItem extends AntdComponent {
/**
* Used with label, whether to display : after label text.
* @default true
@ -64,6 +64,6 @@ export declare class NFormItem extends AntdComponent {
wrapperCol: Col;
labelAlign: 'left' | 'right';
prop: string;
rules: object | array;
rules: object | object[];
autoLink: boolean;
}

View File

@ -5,7 +5,7 @@
import { AntdComponent } from '../component';
import { Col } from '../grid/col';
import Vue from 'vue';
import { NFormItem } from './form-item';
import { FormModelItem } from './form-item';
declare interface ValidationRule {
trigger?: string;
@ -79,8 +79,8 @@ declare interface ValidationRule {
validator?: (rule: any, value: any, callback: Function) => any;
}
export declare class NForm extends AntdComponent {
static Item: typeof NFormItem;
export declare class FormModel extends AntdComponent {
static Item: typeof FormModelItem;
/**
* Hide required mark of all form items
@ -107,9 +107,64 @@ export declare class NForm extends AntdComponent {
* @type Col
*/
wrapperCol: Col;
/**
* change default props colon value of Form.Item (only effective when prop layout is horizontal)
* @type boolean
* @default true
*/
colon: boolean;
/**
* text align of label of all items
* @type 'left' | 'right'
* @default 'left'
*/
labelAlign: 'left' | 'right';
/**
* data of form component
* @type object
*/
model: object;
/**
* validation rules of form
* @type object
*/
rules: object;
/**
* whether to trigger validation when the rules prop is changed
* @type Boolean
* @default true
*/
validateOnRuleChange: boolean;
/**
* validate the whole form. Takes a callback as a param. After validation,
* the callback will be executed with two params: a boolean indicating if the validation has passed,
* and an object containing all fields that fail the validation. Returns a promise if callback is omitted
* @type Function
*/
validate: (callback?: (boolean: Boolean, object: Object) => void) => void | Promise<any>;
/**
* validate one or several form items
* @type Function
*/
validateField: (props: string[] | string, callback: (errorMessage: string) => void) => void;
/**
* reset all the fields and remove validation result
*/
resetFields: () => void;
/**
* clear validation message for certain fields.
* The parameter is prop name or an array of prop names of the form items whose validation messages will be removed.
* When omitted, all fields' validation messages will be cleared
* @type string[] | string
*/
clearValidate: (props: string[] | string) => void;
}

42
types/message.d.ts vendored
View File

@ -2,12 +2,26 @@
// Definitions by: akki-jat <https://github.com/akki-jat>
// Definitions: https://github.com/vueComponent/ant-design-vue/types
import { VNode, CreateElement } from 'vue';
export interface ThenableArgument {
(val: any): void;
}
export interface MessageType {
(): void;
then: (fill: ThenableArgument, reject: ThenableArgument) => Promise<void>;
promise: Promise<void>;
}
export type ConfigType = VNode | ((h: CreateElement) => VNode);
export type ConfigDuration = number | (() => void);
export type ConfigOnClose = () => void;
export interface MessageOptions {
/**
* content of the message
* @type any (string | VNode | (h) => VNode)
*/
content: any;
content: ConfigType;
/**
* time(seconds) before auto-dismiss, don't dismiss if set to 0
@ -26,13 +40,13 @@ export interface MessageOptions {
* Customized Icon
* @type any (VNode | (h) => VNode)
*/
icon?: (h) => VNode | VNode;
icon?: ConfigType;
/**
* Specify a function that will be called when the message is closed
* @type Function
*/
onClose?: () => void;
onClose?: ConfigOnClose;
key?: string | number;
}
@ -65,14 +79,20 @@ export interface MessageConfigOptions {
top?: string;
}
export declare class Message {
success(content: any, duration?: number, onClose?: () => void): Promise<any>;
warning(content: any, duration?: number, onClose?: () => void): Promise<any>;
warn(content: any, duration?: number, onClose?: () => void): Promise<any>;
info(content: any, duration?: number, onClose?: () => void): Promise<any>;
error(content: any, duration?: number, onClose?: () => void): Promise<any>;
loading(content: any, duration?: number, onClose?: () => void): Promise<any>;
open: (config: MessageOptions) => Promise<any>;
export declare interface Message {
success(content: MessageOptions): MessageType;
success(content: ConfigType, duration?: ConfigDuration, onClose?: ConfigOnClose): MessageType;
warning(content: MessageOptions): MessageType;
warning(content: ConfigType, duration?: ConfigDuration, onClose?: ConfigOnClose): MessageType;
warn(content: MessageOptions): MessageType;
warn(content: ConfigType, duration?: ConfigDuration, onClose?: ConfigOnClose): MessageType;
info(content: MessageOptions): MessageType;
info(content: ConfigType, duration?: ConfigDuration, onClose?: ConfigOnClose): MessageType;
error(content: MessageOptions): MessageType;
error(content: ConfigType, duration?: ConfigDuration, onClose?: ConfigOnClose): MessageType;
loading(content: MessageOptions): MessageType;
loading(content: ConfigType, duration?: ConfigDuration, onClose?: ConfigOnClose): MessageType;
open: (config: MessageOptions) => MessageType;
config: (options: MessageConfigOptions) => void;
destroy: () => void;
}

1
types/modal.d.ts vendored
View File

@ -287,6 +287,7 @@ export declare class Modal extends AntdComponent {
static error(options: ModalOptions): ModalConfirm;
static warning(options: ModalOptions): ModalConfirm;
static confirm(options: ModalOptions): ModalConfirm;
static destroyAll(): void;
}
declare module 'vue/types/vue' {

View File

@ -21,6 +21,15 @@ export declare class Column extends AntdComponent {
* @type string
*/
align?: 'left' | 'right' | 'center';
/**
* ellipsize cell content, not working with sorter and filters for now.
* tableLayout would be fixed when ellipsis is true.
* @default false
* @type boolean
*/
ellipsis?: boolean;
/**
* Span of this column's title
@ -33,6 +42,12 @@ export declare class Column extends AntdComponent {
* @type string
*/
dataIndex?: string;
/**
* Default filtered values
* @type string[]
*/
defaultFilteredValue?: string[];
/**
* Default order of sorted values: 'ascend' 'descend' null
@ -115,7 +130,14 @@ export declare class Column extends AntdComponent {
* @type boolean | string
*/
sortOrder?: boolean | SortOrder;
/**
* supported sort way, could be 'ascend', 'descend'
* @default ['ascend', 'descend']
* @type string[]
*/
sortDirections?: string[];
/**
* Title of this column
* @type any (string | slot)

98
webpack.config.js Normal file
View File

@ -0,0 +1,98 @@
const HtmlWebpackPlugin = require('html-webpack-plugin');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const webpack = require('webpack');
const WebpackBar = require('webpackbar');
const path = require('path');
module.exports = {
mode: 'development',
entry: {
app: './examples/index.js',
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
},
{
test: /\.(js|jsx)$/,
loader: 'babel-loader',
options: {
presets: [
[
'env',
{
targets: {
browsers: [
'last 2 versions',
'Firefox ESR',
'> 1%',
'ie >= 9',
'iOS >= 8',
'Android >= 4',
],
},
},
],
],
plugins: [
'transform-vue-jsx',
'transform-object-assign',
'transform-object-rest-spread',
'transform-class-properties',
],
},
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: 'file-loader',
options: {
name: '[name].[ext]?[hash]',
},
},
{
test: /\.less$/,
use: [
{ loader: 'vue-style-loader' },
{
loader: 'css-loader',
options: { sourceMap: true },
},
{ loader: 'less-loader', options: { sourceMap: true, javascriptEnabled: true } },
],
},
{
test: /\.css$/,
use: ['vue-style-loader', 'css-loader'],
},
],
},
resolve: {
alias: {
'ant-design-vue': path.join(__dirname, './components'),
},
extensions: ['.js', '.jsx', '.vue'],
},
devServer: {
host: 'localhost',
port: 3000,
historyApiFallback: {
rewrites: [{ from: /./, to: '/index.html' }],
},
disableHostCheck: true,
hot: true,
open: true,
},
devtool: '#source-map',
plugins: [
new webpack.HotModuleReplacementPlugin(),
new HtmlWebpackPlugin({
template: 'examples/index.html',
filename: 'index.html',
inject: true,
}),
new VueLoaderPlugin(),
new WebpackBar(),
],
};