diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index fc095d189..9491b0bfb 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -2,6 +2,40 @@ --- +## 1.2.0 +`2018-12-16` +### Synchronize with antd 3.10.x + +- πŸ”₯πŸ”₯πŸ”₯ replaced font icons with svg icons which bring benefits below:: + - Complete offline usage of icon, no dependency of alipay cdn font icon file and no more empty square during downloading than no need to deploy icon font files locally either. + - Much more display accuracy in lower-level screens. + - Support multiple colors for icon. + - No need to change built-in icons with overriding styles by providing more props in component. + - 🌟 Add the `theme` attribute to set the theme style of the icon. + - 🌟 Added `component` attribute, you can externally pass a component to customize the control rendering result. + - 🌟 The `twoToneColor` property is added to control the theme color of the two-color icon. + - 🌟 Added static methods `Icon.getTowToneColor()` and `Icon.setTwoToneColor(...)` to globally get and set the theme color of all two-color icons. + - 🌟 The new static method `Icon.createFromIconfontCN({...})` is added to make it easier to use icons hosted on [`iconfont.cn`](http://iconfont.cn/). +- πŸ”₯ Added a new component `Skeleton`. +- πŸ”₯ Menu will automatically close up to fit width in `horizontal` mode. +- πŸ”₯ The `placement` of the drawer supports `top` and `bottom` to accommodate more scenes. +- 🌟 The following components add a `suffixIcon` prop, which is used to set the icon behind the input box. For details, please refer to the documentation. + - Cascader + - DatePicker + - Select + - TreeSelect + - TimePicker +- 🌟 Added Modal.open for optional icon dialog. +- 🌟 Modal.info adds the configuration of `getContainer`. +- 🌟 Improve RangePicker footer UI by merging them. +- 🌟 The Anchor component adds `onClick` property. +- 🌟 The Tab component adds the `renderTabBar` property. +- 🌟 The Input component adds the `select` method. +- 🌟 Steps adds the `initial` attribute. +- 🌟 Upload adds `openFileDialogOnClick` prop to allow setting whether to open the upload dialog when the component is clicked. +- 🌟 InputNumber adds `decimalSeparator` prop to allow setting a custom decimal. +- 🐞 Fix a lot of hidden bugs that have not yet been issued, and then not list them one by one. + ## 1.1.10 `2018-12-7` diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index b1536be86..e1639ced3 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -1,6 +1,7 @@ # ζ›΄ζ–°ζ—₯εΏ— --- + ## 1.2.0 `2018-12-16` ### 与antd 3.10.x同ζ­₯ diff --git a/components/_util/FormDecoratorDirective.js b/components/_util/FormDecoratorDirective.js index 1fc7ecf23..746f9dc4c 100644 --- a/components/_util/FormDecoratorDirective.js +++ b/components/_util/FormDecoratorDirective.js @@ -1,7 +1,11 @@ +export function antDecorator (Vue) { + return Vue.directive('decorator', { + }) +} + export default { // just for tag install: (Vue, options) => { - Vue.directive('decorator', { - }) + antDecorator(Vue) }, } diff --git a/components/_util/antDirective.js b/components/_util/antDirective.js new file mode 100644 index 000000000..ebfcbdcab --- /dev/null +++ b/components/_util/antDirective.js @@ -0,0 +1,11 @@ +import { antInput } from './antInputDirective' +import { antRef } from './antRefDirective' +import { antDecorator } from './FormDecoratorDirective' + +export default { + install: (Vue, options) => { + antInput(Vue) + antRef(Vue) + antDecorator(Vue) + }, +} diff --git a/components/_util/antInputDirective.js b/components/_util/antInputDirective.js index c6812322e..aeba9f943 100644 --- a/components/_util/antInputDirective.js +++ b/components/_util/antInputDirective.js @@ -49,26 +49,30 @@ if (isIE9) { }) } -export default { - install: (Vue, options) => { - Vue.directive('ant-input', { - inserted (el, binding, vnode, oldVnode) { - if (vnode.tag === 'textarea' || isTextInputType(el.type)) { - if (!binding.modifiers || !binding.modifiers.lazy) { - el.addEventListener('compositionstart', onCompositionStart) - el.addEventListener('compositionend', onCompositionEnd) - // Safari < 10.2 & UIWebView doesn't fire compositionend when - // switching focus before confirming composition choice - // this also fixes the issue where some browsers e.g. iOS Chrome - // fires "change" instead of "input" on autocomplete. - el.addEventListener('change', onCompositionEnd) - /* istanbul ignore if */ - if (isIE9) { - el.vmodel = true - } +export function antInput (Vue) { + return Vue.directive('ant-input', { + inserted (el, binding, vnode, oldVnode) { + if (vnode.tag === 'textarea' || isTextInputType(el.type)) { + if (!binding.modifiers || !binding.modifiers.lazy) { + el.addEventListener('compositionstart', onCompositionStart) + el.addEventListener('compositionend', onCompositionEnd) + // Safari < 10.2 & UIWebView doesn't fire compositionend when + // switching focus before confirming composition choice + // this also fixes the issue where some browsers e.g. iOS Chrome + // fires "change" instead of "input" on autocomplete. + el.addEventListener('change', onCompositionEnd) + /* istanbul ignore if */ + if (isIE9) { + el.vmodel = true } } - }, - }) + } + }, + }) +} + +export default { + install: (Vue, options) => { + antInput(Vue) }, } diff --git a/components/_util/antRefDirective.js b/components/_util/antRefDirective.js index c7e3b7425..318e9655f 100644 --- a/components/_util/antRefDirective.js +++ b/components/_util/antRefDirective.js @@ -1,15 +1,18 @@ +export function antRef (Vue) { + return Vue.directive('ant-ref', { + bind: function (el, binding, vnode) { + binding.value(vnode.componentInstance ? vnode.componentInstance : vnode.elm) + }, + update: function (el, binding, vnode) { + binding.value(vnode.componentInstance ? vnode.componentInstance : vnode.elm) + }, + unbind: function (el, binding, vnode) { + binding.value(null) + }, + }) +} export default { install: (Vue, options) => { - Vue.directive('ant-ref', { - bind: function (el, binding, vnode) { - binding.value(vnode.componentInstance ? vnode.componentInstance : vnode.elm) - }, - update: function (el, binding, vnode) { - binding.value(vnode.componentInstance ? vnode.componentInstance : vnode.elm) - }, - unbind: function (el, binding, vnode) { - binding.value(null) - }, - }) + antRef(Vue) }, } diff --git a/components/form/index.jsx b/components/form/index.jsx index b054ae72b..1146d963b 100644 --- a/components/form/index.jsx +++ b/components/form/index.jsx @@ -5,6 +5,7 @@ import FormDecoratorDirective from '../_util/FormDecoratorDirective' Vue.use(ref, { name: 'ant-ref' }) Vue.use(FormDecoratorDirective) +Vue.prototype.$form = Form export { FormProps, FormCreateOption, ValidationRule } from './Form' export { FormItemProps } from './FormItem' diff --git a/site/components/demoBox.vue b/site/components/demoBox.vue index cdafe1084..82398a6f3 100644 --- a/site/components/demoBox.vue +++ b/site/components/demoBox.vue @@ -13,7 +13,9 @@
- + + +