From ebd6cde2e1011e7949bd1fe97783aa5b2477a952 Mon Sep 17 00:00:00 2001
From: XY <541075770@qq.com>
Date: Wed, 10 Apr 2019 10:31:43 +0900
Subject: [PATCH 01/11] add type definition for Form
---
types/form/form.d.ts | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/types/form/form.d.ts b/types/form/form.d.ts
index 59feb60bb..62f7ab9cb 100644
--- a/types/form/form.d.ts
+++ b/types/form/form.d.ts
@@ -363,6 +363,12 @@ export declare class Form extends AntdComponent {
options: object;
createForm(context: Vue, options?: IformCreateOption): any;
+
+ /**
+ * Convert props to field value
+ * @param field
+ */
+ createFormField(field: any): any;
}
declare module 'vue/types/vue' {
From 219982e927f5bfe547bb88b61e7729acf2caf931 Mon Sep 17 00:00:00 2001
From: tangjinzhou <415800467@qq.com>
Date: Wed, 10 Apr 2019 21:58:12 +0800
Subject: [PATCH 02/11] update site
---
site/components/geektime.vue | 2 +-
site/components/sponsors.vue | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/site/components/geektime.vue b/site/components/geektime.vue
index f6bff27c7..d1c9bad74 100644
--- a/site/components/geektime.vue
+++ b/site/components/geektime.vue
@@ -7,7 +7,7 @@
diff --git a/site/components/sponsors.vue b/site/components/sponsors.vue
index 7930e8b16..b4a11ba48 100644
--- a/site/components/sponsors.vue
+++ b/site/components/sponsors.vue
@@ -22,12 +22,12 @@
class="sponsorsItem"
>
From 2d3a01cd413c6c75878be07e2382453ede92f760 Mon Sep 17 00:00:00 2001
From: maple326
Date: Wed, 10 Apr 2019 22:05:24 +0800
Subject: [PATCH 03/11] Update customize-theme.zh-CN.md (#686)
---
docs/vue/customize-theme.zh-CN.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/vue/customize-theme.zh-CN.md b/docs/vue/customize-theme.zh-CN.md
index d9d9dfafd..c5b379634 100644
--- a/docs/vue/customize-theme.zh-CN.md
+++ b/docs/vue/customize-theme.zh-CN.md
@@ -88,7 +88,7 @@ module.exports = {
### 在 vue cli 3中定制主题
-项目更目录下新建文件`vue.config.js`
+项目根目录下新建文件`vue.config.js`
```
// vue.config.js
module.exports = {
From e5020f7eb830ffbe31e18a6a4f3c377ae8c65f3f Mon Sep 17 00:00:00 2001
From: tangjinzhou <415800467@qq.com>
Date: Fri, 19 Apr 2019 21:30:58 +0800
Subject: [PATCH 04/11] fix: treeSelect not support dataRef #712
---
components/tree-select/index.jsx | 61 ++++++++++++++++++--------------
1 file changed, 35 insertions(+), 26 deletions(-)
diff --git a/components/tree-select/index.jsx b/components/tree-select/index.jsx
index 7becdb024..759e63514 100644
--- a/components/tree-select/index.jsx
+++ b/components/tree-select/index.jsx
@@ -63,25 +63,28 @@ const TreeSelect = {
onChange() {
this.$emit('change', ...arguments);
},
- updateTreeData(list = []) {
- for (let i = 0, len = list.length; i < len; i++) {
- const { label, title, scopedSlots = {}, children } = list[i];
- const { $scopedSlots } = this;
+ updateTreeData(treeData) {
+ const { $scopedSlots } = this;
+ return treeData.map(item => {
+ const { label, title, scopedSlots = {}, children } = item;
let newLabel = typeof label === 'function' ? label(this.$createElement) : label;
let newTitle = typeof title === 'function' ? title(this.$createElement) : title;
if (!newLabel && scopedSlots.label && $scopedSlots[scopedSlots.label]) {
- newLabel = $scopedSlots.label(list[i]);
+ newLabel = $scopedSlots.label(item);
}
if (!newTitle && scopedSlots.title && $scopedSlots[scopedSlots.title]) {
- newTitle = $scopedSlots.title(list[i]);
+ newTitle = $scopedSlots.title(item);
}
- const item = {
- // label: newLabel,
+ const treeNodeProps = {
+ ...item,
title: newTitle || newLabel,
+ dataRef: item,
};
- this.updateTreeData(children || []);
- Object.assign(list[i], item);
- }
+ if (children) {
+ return { ...treeNodeProps, children: this.updateTreeData(children) };
+ }
+ return treeNodeProps;
+ });
},
renderTreeSelect(locale) {
const props = getOptionProps(this);
@@ -105,7 +108,10 @@ const TreeSelect = {
]);
let suffixIcon = getComponentFromProp(this, 'suffixIcon');
suffixIcon = Array.isArray(suffixIcon) ? suffixIcon[0] : suffixIcon;
- this.updateTreeData(props.treeData || []);
+ let treeData = props.treeData;
+ if (treeData) {
+ treeData = this.updateTreeData(treeData);
+ }
const cls = {
[`${prefixCls}-lg`]: size === 'large',
[`${prefixCls}-sm`]: size === 'small',
@@ -128,20 +134,23 @@ const TreeSelect = {
);
const VcTreeSelectProps = {
- props: {
- switcherIcon: this.renderSwitcherIcon,
- inputIcon,
- removeIcon,
- clearIcon,
- ...rest,
- getPopupContainer: getPopupContainer || getContextPopupContainer,
- dropdownClassName: classNames(dropdownClassName, `${prefixCls}-tree-dropdown`),
- prefixCls,
- dropdownStyle: { maxHeight: '100vh', overflow: 'auto', ...dropdownStyle },
- treeCheckable: checkable,
- notFoundContent: notFoundContent || locale.notFoundContent,
- __propsSymbol__: Symbol(),
- },
+ props: Object.assign(
+ {
+ switcherIcon: this.renderSwitcherIcon,
+ inputIcon,
+ removeIcon,
+ clearIcon,
+ ...rest,
+ getPopupContainer: getPopupContainer || getContextPopupContainer,
+ dropdownClassName: classNames(dropdownClassName, `${prefixCls}-tree-dropdown`),
+ prefixCls,
+ dropdownStyle: { maxHeight: '100vh', overflow: 'auto', ...dropdownStyle },
+ treeCheckable: checkable,
+ notFoundContent: notFoundContent || locale.notFoundContent,
+ __propsSymbol__: Symbol(),
+ },
+ treeData ? { treeData } : {},
+ ),
class: cls,
on: { ...this.$listeners, change: this.onChange },
ref: 'vcTreeSelect',
From d970f47b35893d27caac8cd8c107d7dcb92ba691 Mon Sep 17 00:00:00 2001
From: Early
Date: Wed, 24 Apr 2019 23:52:43 +0800
Subject: [PATCH 05/11] Fix tooltip destroy tooltip on hide (#727)
* fix: add destroyTooltipOnHide prop
* doc: destroyTooltipOnHide
---
components/tooltip/abstractTooltipProps.js | 1 +
components/tooltip/index.en-US.md | 1 +
components/tooltip/index.zh-CN.md | 1 +
3 files changed, 3 insertions(+)
diff --git a/components/tooltip/abstractTooltipProps.js b/components/tooltip/abstractTooltipProps.js
index 1e6cff446..5e987c905 100644
--- a/components/tooltip/abstractTooltipProps.js
+++ b/components/tooltip/abstractTooltipProps.js
@@ -28,5 +28,6 @@ export default () => ({
getPopupContainer: PropTypes.func,
arrowPointAtCenter: PropTypes.bool.def(false),
autoAdjustOverflow: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]).def(true),
+ destroyTooltipOnHide: PropTypes.bool.def(false),
align: PropTypes.object.def({}),
});
diff --git a/components/tooltip/index.en-US.md b/components/tooltip/index.en-US.md
index 0ff307e77..eef7af1e5 100644
--- a/components/tooltip/index.en-US.md
+++ b/components/tooltip/index.en-US.md
@@ -21,6 +21,7 @@ The following APIs are shared by Tooltip, Popconfirm, Popover.
| placement | The position of the tooltip relative to the target, which can be one of `top` `left` `right` `bottom` `topLeft` `topRight` `bottomLeft` `bottomRight` `leftTop` `leftBottom` `rightTop` `rightBottom` | string | `top` |
| trigger | Tooltip trigger mode | `hover` \| `focus` \| `click` \| `contextmenu` | `hover` |
| visible(v-model) | Whether the floating tooltip card is visible or not | boolean | `false` |
+| destroyTooltipOnHide | Whether to destroy tooltip on hide | boolean | false |
| align | this value will be merged into placement's config, please refer to the settings [dom-align](https://github.com/yiminghe/dom-align) | Object | - |
### events
diff --git a/components/tooltip/index.zh-CN.md b/components/tooltip/index.zh-CN.md
index 6e2f6ca2b..9a5b06042 100644
--- a/components/tooltip/index.zh-CN.md
+++ b/components/tooltip/index.zh-CN.md
@@ -21,6 +21,7 @@
| placement | 气泡框位置,可选 `top` `left` `right` `bottom` `topLeft` `topRight` `bottomLeft` `bottomRight` `leftTop` `leftBottom` `rightTop` `rightBottom` | string | top |
| trigger | 触发行为,可选 `hover/focus/click/contextmenu` | string | hover |
| visible(v-model) | 用于手动控制浮层显隐 | boolean | false |
+| destroyTooltipOnHide | 隐藏后是否销毁tooltip | boolean | false |
| align | 该值将合并到 placement 的配置中,设置参考 [dom-align](https://github.com/yiminghe/dom-align) | Object | 无 |
### 事件
From 7d8068be5e16714c2ffea305542841cc1420600a Mon Sep 17 00:00:00 2001
From: wangxueliang
Date: Thu, 25 Apr 2019 20:39:00 +0800
Subject: [PATCH 06/11] fix: dynamically setting src error
---
components/avatar/Avatar.jsx | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/components/avatar/Avatar.jsx b/components/avatar/Avatar.jsx
index dbc971e87..7652bc73e 100644
--- a/components/avatar/Avatar.jsx
+++ b/components/avatar/Avatar.jsx
@@ -30,6 +30,12 @@ export default {
scale: 1,
};
},
+ watch: {
+ src() {
+ this.isImgExist = true;
+ this.scale = 1;
+ },
+ },
mounted() {
this.prevChildren = this.$slots.default;
this.prevState = { ...this.$data };
From fa467674720868b773e66defd93c0057ad76552d Mon Sep 17 00:00:00 2001
From: Early
Date: Mon, 6 May 2019 09:52:24 +0800
Subject: [PATCH 07/11] fix(ContainerRender): memory leak when invoke
removeContainer (#734)
---
components/_util/ContainerRender.jsx | 1 +
1 file changed, 1 insertion(+)
diff --git a/components/_util/ContainerRender.jsx b/components/_util/ContainerRender.jsx
index 5dd80381c..65845869c 100644
--- a/components/_util/ContainerRender.jsx
+++ b/components/_util/ContainerRender.jsx
@@ -36,6 +36,7 @@ export default {
this._component && this._component.$destroy();
this.container.parentNode.removeChild(this.container);
this.container = null;
+ this._component = null;
}
},
From ec0ff990d5346e73e4ed3cc41ccb2c15c4686360 Mon Sep 17 00:00:00 2001
From: nicoklaxit <49637267+nicoklaxit@users.noreply.github.com>
Date: Mon, 6 May 2019 17:02:52 +0200
Subject: [PATCH 08/11] Update dropdown-button.md (#742)
---
components/dropdown/demo/dropdown-button.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/components/dropdown/demo/dropdown-button.md b/components/dropdown/demo/dropdown-button.md
index 4df822b4f..886997519 100644
--- a/components/dropdown/demo/dropdown-button.md
+++ b/components/dropdown/demo/dropdown-button.md
@@ -11,7 +11,7 @@ A button is on the left, and a related functional menu is on the right.
```html
-
+
Dropdown
1st menu item
From 28b7a68dc48a0a994e98063d462b99380e3ee547 Mon Sep 17 00:00:00 2001
From: tangjinzhou <415800467@qq.com>
Date: Tue, 14 May 2019 22:15:24 +0800
Subject: [PATCH 09/11] fix: moment locale change
---
components/locale-provider/index.jsx | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/components/locale-provider/index.jsx b/components/locale-provider/index.jsx
index 8d989fcfd..8b62b3c87 100644
--- a/components/locale-provider/index.jsx
+++ b/components/locale-provider/index.jsx
@@ -49,9 +49,7 @@ const LocaleProvider = {
...this.locale,
exist: true,
};
- this.$nextTick(() => {
- setMomentLocale(val);
- });
+ setMomentLocale(val);
},
},
created() {
From faa4c1c5d962db2d7326d29776584d826dde411d Mon Sep 17 00:00:00 2001
From: tangjinzhou <415800467@qq.com>
Date: Tue, 14 May 2019 22:16:44 +0800
Subject: [PATCH 10/11] docs: opt doc #767 [update site]
---
site/components/layout.vue | 2 +-
site/index.less | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/site/components/layout.vue b/site/components/layout.vue
index d34c39ed3..eb4b3ef72 100644
--- a/site/components/layout.vue
+++ b/site/components/layout.vue
@@ -304,7 +304,7 @@ export default {
{ name.indexOf('back-top') === -1 ? : null }
-
+ { isCN && }
);
},
diff --git a/site/index.less b/site/index.less
index f9ccca860..70f3de8cd 100644
--- a/site/index.less
+++ b/site/index.less
@@ -36,7 +36,9 @@
font-weight: 500;
background: rgba(0, 0, 0, 0.02);
}
-.api-container pre code {
+
+pre > code[class*='lang-'],
+pre > code[class*='language-'] {
padding: 12px 20px;
overflow: auto;
}
From 00656b5ce93925f0be37187e1976af09e450dfcd Mon Sep 17 00:00:00 2001
From: Yuga Sun
Date: Thu, 23 May 2019 22:09:49 +0800
Subject: [PATCH 11/11] feat: add closable option for confirm dialog (#798)
---
components/modal/ConfirmDialog.jsx | 2 ++
components/modal/index.en-US.md | 1 +
components/modal/index.zh-CN.md | 1 +
components/modal/style/confirm.less | 4 ----
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/components/modal/ConfirmDialog.jsx b/components/modal/ConfirmDialog.jsx
index 3f4cfee23..32576cef9 100644
--- a/components/modal/ConfirmDialog.jsx
+++ b/components/modal/ConfirmDialog.jsx
@@ -21,6 +21,7 @@ export default {
maskStyle,
okButtonProps,
cancelButtonProps,
+ closable = false,
} = props;
const iconType = props.iconType || 'question-circle';
const okType = props.okType || 'primary';
@@ -62,6 +63,7 @@ export default {
wrapClassName={classNames({ [`${contentPrefixCls}-centered`]: !!centered })}
onCancel={e => close({ triggerCancel: true }, e)}
visible={visible}
+ closable={closable}
title=""
transitionName="zoom"
footer=""
diff --git a/components/modal/index.en-US.md b/components/modal/index.en-US.md
index 88b717a1b..33893ff51 100644
--- a/components/modal/index.en-US.md
+++ b/components/modal/index.en-US.md
@@ -53,6 +53,7 @@ The properties of the object are follows:
| autoFocusButton | Specify which button to autofocus | null\|string: `ok` `cancel` | `ok` |
| cancelText | Text of the Cancel button | string | `Cancel` |
| centered | Centered Modal | Boolean | `false` |
+| closable | Whether a close (x) button is visible on top right of the modal dialog or not | boolean | `false` |
| class | class of container | string | - |
| content | Content | string\|vNode | - |
| iconType | Icon `type` of the Icon component | string | `question-circle` |
diff --git a/components/modal/index.zh-CN.md b/components/modal/index.zh-CN.md
index 28b87d4be..616b755be 100644
--- a/components/modal/index.zh-CN.md
+++ b/components/modal/index.zh-CN.md
@@ -52,6 +52,7 @@
| autoFocusButton | 指定自动获得焦点的按钮 | null\|string: `ok` `cancel` | `ok` |
| cancelText | 取消按钮文字 | string | 取消 |
| centered | 垂直居中展示 Modal | Boolean | `false` |
+| closable | 是否显示右上角的关闭按钮 | boolean | `false` |
| class | 容器类名 | string | - |
| content | 内容 | string\|vNode | 无 |
| iconType | 图标 Icon 类型 | string | question-circle |
diff --git a/components/modal/style/confirm.less b/components/modal/style/confirm.less
index 87dec63df..26c1b74c2 100644
--- a/components/modal/style/confirm.less
+++ b/components/modal/style/confirm.less
@@ -7,10 +7,6 @@
display: none;
}
- .@{ant-prefix}-modal-close {
- display: none;
- }
-
.@{ant-prefix}-modal-body {
padding: 32px 32px 24px;
}