From 749d74e21f64bd73764cc158f9d35aea372a436f Mon Sep 17 00:00:00 2001
From: tanjinzhou <415800467@qq.com>
Date: Fri, 20 Mar 2020 18:38:47 +0800
Subject: [PATCH 01/41] fix: table error when use template #1914
---
components/table/Table.jsx | 6 ++++--
components/vc-table/index.js | 7 +++++++
components/vc-table/src/TableHeaderRow.jsx | 6 ++++--
3 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/components/table/Table.jsx b/components/table/Table.jsx
index 4fa86790d..5b13508f1 100755
--- a/components/table/Table.jsx
+++ b/components/table/Table.jsx
@@ -490,13 +490,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();
+ },
});
}
},
diff --git a/components/vc-table/index.js b/components/vc-table/index.js
index 614c47784..57a299952 100644
--- a/components/vc-table/index.js
+++ b/components/vc-table/index.js
@@ -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 ;
},
diff --git a/components/vc-table/src/TableHeaderRow.jsx b/components/vc-table/src/TableHeaderRow.jsx
index 107691b05..38c93f839 100644
--- a/components/vc-table/src/TableHeaderRow.jsx
+++ b/components/vc-table/src/TableHeaderRow.jsx
@@ -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,
From a87f5564ccbf3130461127f2ff38de4a85346bcc Mon Sep 17 00:00:00 2001
From: tangjinzhou <415800467@qq.com>
Date: Sat, 21 Mar 2020 16:14:33 +0800
Subject: [PATCH 02/41] fix: weekpicker can not custom trigger picker #1915
---
components/date-picker/WeekPicker.jsx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/components/date-picker/WeekPicker.jsx b/components/date-picker/WeekPicker.jsx
index e1f1e7d5d..550f4e8cf 100644
--- a/components/date-picker/WeekPicker.jsx
+++ b/components/date-picker/WeekPicker.jsx
@@ -224,10 +224,11 @@ export default {
openChange: this.handleOpenChange,
},
style: popupStyle,
+ scopedSlots: { default: input, ...$scopedSlots },
};
return (
- {input}
+
);
},
From 36d95b18fddbfeb0c0716fce12a7117b39c6886b Mon Sep 17 00:00:00 2001
From: tangjinzhou <415800467@qq.com>
Date: Sat, 21 Mar 2020 17:29:53 +0800
Subject: [PATCH 03/41] fix: input-search custom button not work #1916
---
components/input/Search.jsx | 5 +++--
components/input/__tests__/__snapshots__/demo.test.js.snap | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/components/input/Search.jsx b/components/input/Search.jsx
index 62b72fe1a..34d4ac6dd 100644
--- a/components/input/Search.jsx
+++ b/components/input/Search.jsx
@@ -5,8 +5,8 @@ import Icon from '../icon';
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 {
@@ -18,7 +18,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 },
diff --git a/components/input/__tests__/__snapshots__/demo.test.js.snap b/components/input/__tests__/__snapshots__/demo.test.js.snap
index 6de4a46b2..958ab7a6f 100644
--- a/components/input/__tests__/__snapshots__/demo.test.js.snap
+++ b/components/input/__tests__/__snapshots__/demo.test.js.snap
@@ -56,7 +56,7 @@ exports[`renders ./antdv-demo/docs/input/demo/password-input.md correctly 1`] =
exports[`renders ./antdv-demo/docs/input/demo/presuffix.md correctly 1`] = `
`;
-exports[`renders ./antdv-demo/docs/input/demo/search-input.md correctly 1`] = ``;
+exports[`renders ./antdv-demo/docs/input/demo/search-input.md correctly 1`] = ``;
exports[`renders ./antdv-demo/docs/input/demo/search-input-loading.md correctly 1`] = ``;
From 60bb3ae50c06255a3d150afa7a13d84121c0d500 Mon Sep 17 00:00:00 2001
From: Amour1688 <31695475+Amour1688@users.noreply.github.com>
Date: Mon, 23 Mar 2020 11:00:24 +0800
Subject: [PATCH 04/41] chore: simple demo (#1918)
---
examples/App.vue | 26 ++++++++++++
examples/index.html | 81 +++++++++++++++++++++++++++++++++++
examples/index.js | 11 +++++
package.json | 8 +---
webpack.config.js | 100 ++++++++++++++++++++++++++++++++++++++++++++
5 files changed, 220 insertions(+), 6 deletions(-)
create mode 100644 examples/App.vue
create mode 100644 examples/index.html
create mode 100644 examples/index.js
create mode 100644 webpack.config.js
diff --git a/examples/App.vue b/examples/App.vue
new file mode 100644
index 000000000..b65964f0e
--- /dev/null
+++ b/examples/App.vue
@@ -0,0 +1,26 @@
+
+
+
+ Primary
+
+
Default
+
+ Dashed
+
+
+ Danger
+
+
+ 按钮
+
+
+ Link
+
+
+
+
+
diff --git a/examples/index.html b/examples/index.html
new file mode 100644
index 000000000..926b1c727
--- /dev/null
+++ b/examples/index.html
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+ Ant Design Vue
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/index.js b/examples/index.js
new file mode 100644
index 000000000..2b0f85e96
--- /dev/null
+++ b/examples/index.js
@@ -0,0 +1,11 @@
+import 'babel-polyfill';
+import Vue from 'vue';
+import App from './App.vue';
+import { Button } from 'ant-design-vue';
+
+Vue.use(Button);
+
+new Vue({
+ el: '#app',
+ render: h => h(App),
+});
diff --git a/package.json b/package.json
index 51612cbfb..49f98e5b5 100644
--- a/package.json
+++ b/package.json
@@ -26,7 +26,7 @@
"scripts"
],
"scripts": {
- "dev": "node build/dev.js",
+ "dev": "webpack-dev-server",
"start": "cross-env PORT=3001 NODE_ENV=development webpack-dev-server --config build/webpack.dev.conf.js",
"test": "cross-env NODE_ENV=test jest --config .jest.js",
"compile": "node antd-tools/cli/run.js compile",
@@ -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",
@@ -215,4 +211,4 @@
"lib/**/style/*",
"*.less"
]
-}
+}
\ No newline at end of file
diff --git a/webpack.config.js b/webpack.config.js
new file mode 100644
index 000000000..a7cf884b6
--- /dev/null
+++ b/webpack.config.js
@@ -0,0 +1,100 @@
+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: [
+ // libraryDirectory is "", because webpack alias doesn't seem to allow '/'
+ ['import', { libraryName: 'ant-design-vue', style: true, libraryDirectory: '' }],
+ '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(),
+ ],
+};
From 4f4f2a62dbc35ef37e6a78c8428570bf2e2799c1 Mon Sep 17 00:00:00 2001
From: tanjinzhou <415800467@qq.com>
Date: Tue, 24 Mar 2020 17:48:04 +0800
Subject: [PATCH 05/41] fix: table expandIcon not work #1937
---
components/table/Table.jsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/components/table/Table.jsx b/components/table/Table.jsx
index 5b13508f1..5fed3809a 100755
--- a/components/table/Table.jsx
+++ b/components/table/Table.jsx
@@ -1209,8 +1209,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,
From ff812128e5276707727645dfaa1a40fa0473d540 Mon Sep 17 00:00:00 2001
From: tanjinzhou <415800467@qq.com>
Date: Tue, 24 Mar 2020 17:48:41 +0800
Subject: [PATCH 06/41] style: scripts eslint
---
scripts/syncStyleFromAntd.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/syncStyleFromAntd.js b/scripts/syncStyleFromAntd.js
index d5def3630..6ec1019b4 100644
--- a/scripts/syncStyleFromAntd.js
+++ b/scripts/syncStyleFromAntd.js
@@ -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);
From 185241472aefdbd38433847eb5e17edd965907a8 Mon Sep 17 00:00:00 2001
From: tanjinzhou <415800467@qq.com>
Date: Tue, 24 Mar 2020 18:33:19 +0800
Subject: [PATCH 07/41] chore: update dev config
---
examples/index.html | 51 ---------------------------------------------
examples/index.js | 5 +++--
webpack.config.js | 2 --
3 files changed, 3 insertions(+), 55 deletions(-)
diff --git a/examples/index.html b/examples/index.html
index 926b1c727..4f11be55b 100644
--- a/examples/index.html
+++ b/examples/index.html
@@ -22,60 +22,9 @@
display: none;
}
-
-
-
-
-
-