style: fix code conflict

pull/569/head
wangxueliang 2019-02-28 19:54:10 +08:00
commit 2f81ea75c5
35 changed files with 332 additions and 101 deletions

View File

@ -5,5 +5,5 @@ node_modules/
/components/test/*
es/
lib/
site-dist/
_site/
dist/

2
.gitignore vendored
View File

@ -62,7 +62,7 @@ typings/
dist
lib
es
site-dist
_site
yarn.lock
package-lock.json
/coverage

View File

@ -5,5 +5,5 @@
package.json
es/**
lib/**
site-dist/**
_site/**
dist/**

View File

@ -10,6 +10,18 @@
---
## 1.3.5
`2019-02-23`
- ๐ŸŒŸ Optimize the `Popover` `Popconfirm` component arrow style.
- ๐Ÿž Fix using autoprefixer 9.4.5 in postcss (vue-cli) will throw an error `Replace text-decoration-skip: ink to text-decoration-skip-ink: auto, because spec had been changed`. [#471](https://github.com/vueComponent/ant-design-vue/pull/471)
- Tree
- ๐Ÿž Fixed growing space of Tree nodes.[#502](https://github.com/vueComponent/ant-design-vue/issues/502)
- ๐Ÿž Fixing the `Tree` node can't drag and drop the target node problem.[#469](https://github.com/vueComponent/ant-design-vue/issues/502)
- ๐Ÿ“ Update the document: `Tree` component `dragxxx` event changed to all lowercase.[#467](https://github.com/vueComponent/ant-design-vue/issues/467)
- ๐Ÿž Fix `Modal.confirm` `class` does not work.[#475](https://github.com/vueComponent/ant-design-vue/pull/475)
- ๐Ÿž Fix some TypeScript definitions.
## 1.3.4
`2019-01-31`

View File

@ -10,6 +10,19 @@
---
## 1.3.5
`2019-02-23`
- ๐ŸŒŸ ไผ˜ๅŒ– `Popover` `Popconfirm` ็ป„ไปถ็ฎญๅคดๆ ทๅผใ€‚
- ๐Ÿž ไฟฎๅคๅœจ postcss๏ผˆvue-cli๏ผ‰ไธญไฝฟ็”จ autoprefixer 9.4.5 ไผšๆŠ›ๅ‡บ้”™่ฏฏ `Replace text-decoration-skip: ink to text-decoration-skip-ink: auto, because spec had been changed` ็š„้—ฎ้ข˜ใ€‚[#471](https://github.com/vueComponent/ant-design-vue/pull/471)
- Tree
- ๐Ÿž ไฟฎๅค Tree ่Š‚็‚นๅ†…ๅบ•้ƒจ่พน่ทๅ ๅŠ ็š„้—ฎ้ข˜ใ€‚[#502](https://github.com/vueComponent/ant-design-vue/issues/502)
- ๐Ÿž ไฟฎๅค `Tree` ็ป“็‚นๆ— ๆณ•ๆ‹–ๆ‹ฝๆ’ๅ…ฅ็›ฎๆ ‡็ป“็‚น้—ฎ้ข˜ใ€‚[#469](https://github.com/vueComponent/ant-design-vue/issues/502)
- ๐Ÿ“ ๆ›ดๆ–ฐๆ–‡ๆกฃ๏ผš`Tree` ็ป„ไปถ `dragxxx` ไบ‹ไปถๆ”นๆˆๅ…จๅฐๅ†™ใ€‚[#467](https://github.com/vueComponent/ant-design-vue/issues/467)
- ๐Ÿž ไฟฎๅค `Modal.confirm` `class` ไธ็”Ÿๆ•ˆ้—ฎ้ข˜ใ€‚[#475](https://github.com/vueComponent/ant-design-vue/pull/475)
- ๐Ÿž ไฟฎๅค TypeScript ็ฑปๅž‹ๅฎšไน‰ใ€‚
## 1.3.4
`2019-01-31`

View File

@ -14,7 +14,7 @@
@select="onSelect"
>
<template slot="dateCellRender" slot-scope="value"></template>
<template slot="monthCellRender" slot-scope="value"></template
<template slot="monthCellRender" slot-scope="value"></template>
</a-calendar>
````
customize the progress dot by setting a scoped slot

View File

@ -14,7 +14,7 @@
@select="onSelect"
>
<template slot="dateCellRender" slot-scope="value"></template>
<template slot="monthCellRender" slot-scope="value"></template
<template slot="monthCellRender" slot-scope="value"></template>
</a-calendar>
````

View File

@ -23,7 +23,7 @@
| -------- | ----------- | ---- | ------- |
| defaultValue | Default selected value | string\[] | \[] |
| disabled | Disable all checkboxes | boolean | false |
| options | Specifies options, you can customize `label` with slot = "label" slot-scope = "option" | string\[] \| Array&lt;{ label: string value: string disabled?: boolean, onChange?: function }> | \[] |
| options | Specifies options, you can customize `label` with slot = "label" slot-scope="option" | string\[] \| Array&lt;{ label: string value: string disabled?: boolean, onChange?: function }> | \[] |
| value | Used for setting the currently selected value. | string\[] | \[] |
#### events

View File

@ -54,7 +54,7 @@ The following `options` are available:
If the form has been decorated by `Form.create` then it has `this.form` property. `this.form` provides some APIs as follows:
> Note: Before using `getFieldsValue` `getFieldValue` `setFieldsValue` and so on, please make sure that corresponding field had been registered with `getFieldDecorator`.
> Note: Before using `getFieldsValue` `getFieldValue` `setFieldsValue` and so on, please make sure that corresponding field had been registered with `getFieldDecorator` or `v-decorator`.
| Method | Description | Type |
| ------ | ----------- | ---- |
@ -63,8 +63,8 @@ If the form has been decorated by `Form.create` then it has `this.form` property
| getFieldsError | Get the specified fields' error. If you don't specify a parameter, you will get all fields' error. | Function(\[names: string\[]]) |
| getFieldsValue | Get the specified fields' values. If you don't specify a parameter, you will get all fields' values. | Function(\[fieldNames: string\[]]) |
| getFieldValue | Get the value of a field. | Function(fieldName: string) |
| isFieldsTouched | Check whether any of fields is touched by `getFieldDecorator`'s `options.trigger` event | (names?: string\[]) => boolean |
| isFieldTouched | Check whether a field is touched by `getFieldDecorator`'s `options.trigger` event | (name: string) => boolean |
| isFieldsTouched | Check whether any of fields is touched by `getFieldDecorator`'s or `v-decorator`'s `options.trigger` event | (names?: string\[]) => boolean |
| isFieldTouched | Check whether a field is touched by `getFieldDecorator`'s or `v-decorator`'s `options.trigger` event | (name: string) => boolean |
| isFieldValidating | Check if the specified field is being validated. | Function(name) |
| resetFields | Reset the specified fields' value(to `initialValue`) and status. If you don't specify a parameter, all the fields will be reset. | Function(\[names: string\[]]) |
| setFields | Set value and error state of fields. | ({<br />&nbsp;&nbsp;\[fieldName\]: {value: any, errors: \[Error\] }<br />}) => void |
@ -137,7 +137,7 @@ To mark the returned fields data in `mapPropsToFields`, [demo](#components-form-
After wrapped by `getFieldDecorator` or `v-decorator`, `value`(or other property defined by `valuePropName`) `onChange`(or other property defined by `trigger`) props will be added to form controls๏ผŒthe flow of form data will be handled by Form which will cause:
1. You shouldn't use `onChange` to collect data, but you still can listen to `onChange`(and so on) events.
2. You cannot set value of form control via `value` `defaultValue` prop, and you should set default value with `initialValue` in `getFieldDecorator` instead.
2. You cannot set value of form control via `value` `defaultValue` prop, and you should set default value with `initialValue` in `getFieldDecorator` or `v-decorator` instead.
3. You shouldn't call `v-model` manually, please use `this.form.setFieldsValue` to change value programmatically.
#### Special attention

View File

@ -52,7 +52,7 @@ export default {
็ป่ฟ‡ `Form.create` ๅŒ…่ฃ…็š„็ป„ไปถๅฐ†ไผš่‡ชๅธฆ `this.form` ๅฑžๆ€ง๏ผŒ`this.form` ๆไพ›็š„ API ๅฆ‚ไธ‹๏ผš
> ๆณจๆ„๏ผšไฝฟ็”จ `getFieldsValue` `getFieldValue` `setFieldsValue` ็ญ‰ๆ—ถ๏ผŒๅบ”็กฎไฟๅฏนๅบ”็š„ field ๅทฒ็ป็”จ `getFieldDecorator` ๆณจๅ†Œ่ฟ‡ไบ†ใ€‚
> ๆณจๆ„๏ผšไฝฟ็”จ `getFieldsValue` `getFieldValue` `setFieldsValue` ็ญ‰ๆ—ถ๏ผŒๅบ”็กฎไฟๅฏนๅบ”็š„ field ๅทฒ็ป็”จ `getFieldDecorator` ๆˆ– `v-decorator` ๆณจๅ†Œ่ฟ‡ไบ†ใ€‚
| ๆ–นๆณ•ย  ย  ย  | ่ฏดๆ˜Ž ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  | ็ฑปๅž‹ ย  ย  ย  |
| ------- | -------------------------------------- | -------- |
@ -61,8 +61,8 @@ export default {
| getFieldsError | ่Žทๅ–ไธ€็ป„่พ“ๅ…ฅๆŽงไปถ็š„ Error ๏ผŒๅฆ‚ไธไผ ๅ…ฅๅ‚ๆ•ฐ๏ผŒๅˆ™่Žทๅ–ๅ…จ้ƒจ็ป„ไปถ็š„ Error | Function(\[names: string\[]]) |
| getFieldsValue | ่Žทๅ–ไธ€็ป„่พ“ๅ…ฅๆŽงไปถ็š„ๅ€ผ๏ผŒๅฆ‚ไธไผ ๅ…ฅๅ‚ๆ•ฐ๏ผŒๅˆ™่Žทๅ–ๅ…จ้ƒจ็ป„ไปถ็š„ๅ€ผ | Function(\[fieldNames: string\[]]) |
| getFieldValue | ่Žทๅ–ไธ€ไธช่พ“ๅ…ฅๆŽงไปถ็š„ๅ€ผ | Function(fieldName: string) |
| isFieldsTouched | ๅˆคๆ–ญๆ˜ฏๅฆไปปไธ€่พ“ๅ…ฅๆŽงไปถ็ปๅŽ†่ฟ‡ `getFieldDecorator` ็š„ๅ€ผๆ”ถ้›†ๆ—ถๆœบ `options.trigger` | (names?: string\[]) => boolean |
| isFieldTouched | ๅˆคๆ–ญไธ€ไธช่พ“ๅ…ฅๆŽงไปถๆ˜ฏๅฆ็ปๅŽ†่ฟ‡ `getFieldDecorator` ็š„ๅ€ผๆ”ถ้›†ๆ—ถๆœบ `options.trigger` | (name: string) => boolean |
| isFieldsTouched | ๅˆคๆ–ญๆ˜ฏๅฆไปปไธ€่พ“ๅ…ฅๆŽงไปถ็ปๅŽ†่ฟ‡ `getFieldDecorator` ๆˆ– `v-decorator` ็š„ๅ€ผๆ”ถ้›†ๆ—ถๆœบ `options.trigger` | (names?: string\[]) => boolean |
| isFieldTouched | ๅˆคๆ–ญไธ€ไธช่พ“ๅ…ฅๆŽงไปถๆ˜ฏๅฆ็ปๅŽ†่ฟ‡ `getFieldDecorator` ๆˆ– `v-decorator` ็š„ๅ€ผๆ”ถ้›†ๆ—ถๆœบ `options.trigger` | (name: string) => boolean |
| isFieldValidating | ๅˆคๆ–ญไธ€ไธช่พ“ๅ…ฅๆŽงไปถๆ˜ฏๅฆๅœจๆ ก้ชŒ็Šถๆ€ | Function(name) |
| resetFields | ้‡็ฝฎไธ€็ป„่พ“ๅ…ฅๆŽงไปถ็š„ๅ€ผ๏ผˆไธบ `initialValue`๏ผ‰ไธŽ็Šถๆ€๏ผŒๅฆ‚ไธไผ ๅ…ฅๅ‚ๆ•ฐ๏ผŒๅˆ™้‡็ฝฎๆ‰€ๆœ‰็ป„ไปถ | Function(\[names: string\[]]) |
| setFields | ่ฎพ็ฝฎไธ€็ป„่พ“ๅ…ฅๆŽงไปถ็š„ๅ€ผไธŽ้”™่ฏฏ็Šถๆ€ใ€‚ | Function({ [fieldName]&#x3A; { value: any, errors: [Error] } }) |
@ -136,13 +136,13 @@ validateFields(['field1', 'field2'], options, (errors, values) => {
็ป่ฟ‡ `getFieldDecorator`ๆˆ–`v-decorator` ๅŒ…่ฃ…็š„ๆŽงไปถ๏ผŒ่กจๅ•ๆŽงไปถไผš่‡ชๅŠจๆทปๅŠ  `value`๏ผˆๆˆ– `valuePropName` ๆŒ‡ๅฎš็š„ๅ…ถไป–ๅฑžๆ€ง๏ผ‰ `onChange`๏ผˆๆˆ– `trigger` ๆŒ‡ๅฎš็š„ๅ…ถไป–ๅฑžๆ€ง๏ผ‰๏ผŒๆ•ฐๆฎๅŒๆญฅๅฐ†่ขซ Form ๆŽฅ็ฎก๏ผŒ่ฟ™ไผšๅฏผ่‡ดไปฅไธ‹็ป“ๆžœ๏ผš
1. ไฝ **ไธๅ†้œ€่ฆไนŸไธๅบ”่ฏฅ**็”จ `onChange` ๆฅๅšๅŒๆญฅ๏ผŒไฝ†่ฟ˜ๆ˜ฏๅฏไปฅ็ปง็ปญ็›‘ๅฌ `onChange` ็ญ‰ไบ‹ไปถใ€‚
2. ไฝ ไธ่ƒฝ็”จๆŽงไปถ็š„ `value` `defaultValue` ็ญ‰ๅฑžๆ€งๆฅ่ฎพ็ฝฎ่กจๅ•ๅŸŸ็š„ๅ€ผ๏ผŒ้ป˜่ฎคๅ€ผๅฏไปฅ็”จ `getFieldDecorator` ้‡Œ็š„ `initialValue`ใ€‚
2. ไฝ ไธ่ƒฝ็”จๆŽงไปถ็š„ `value` `defaultValue` ็ญ‰ๅฑžๆ€งๆฅ่ฎพ็ฝฎ่กจๅ•ๅŸŸ็š„ๅ€ผ๏ผŒ้ป˜่ฎคๅ€ผๅฏไปฅ็”จ `getFieldDecorator` ๆˆ– `v-decorator` ้‡Œ็š„ `initialValue`ใ€‚
3. ไฝ ไธๅบ”่ฏฅ็”จ `v-model`๏ผŒๅฏไปฅไฝฟ็”จ `this.form.setFieldsValue` ๆฅๅŠจๆ€ๆ”นๅ˜่กจๅ•ๅ€ผใ€‚
#### ็‰นๅˆซๆณจๆ„
1. `getFieldDecorator`ๅ’Œ`v-decorator` ไธ่ƒฝ็”จไบŽ่ฃ…้ฅฐ็บฏๅ‡ฝๆ•ฐ็ป„ไปถใ€‚
2. `getFieldDecorator`ๅ’Œ`v-decorator` ่ฐƒ็”จไธ่ƒฝไฝไบŽ็บฏๅ‡ฝๆ•ฐ็ป„ไปถไธญ <https://cn.vuejs.org/v2/api/#functional>ใ€‚
1. `getFieldDecorator` ๅ’Œ `v-decorator` ไธ่ƒฝ็”จไบŽ่ฃ…้ฅฐ็บฏๅ‡ฝๆ•ฐ็ป„ไปถใ€‚
2. `getFieldDecorator` ๅ’Œ `v-decorator` ่ฐƒ็”จไธ่ƒฝไฝไบŽ็บฏๅ‡ฝๆ•ฐ็ป„ไปถไธญ <https://cn.vuejs.org/v2/api/#functional>ใ€‚
#### getFieldDecorator(id, options) ๅ’Œ v-decorator="[id, options]" ๅ‚ๆ•ฐ

View File

@ -14,6 +14,7 @@ Create a reusable Vue component by using `<a-icon :component="{...}" />`. The pr
<heart-icon :style="{ color: 'hotpink' }" />
<panda-icon :style="{ fontSize: '32px' }" />
</div>
</template>
<script>
const HeartSvg = {
template: `

View File

@ -1,7 +1,6 @@
<template functional>
<a-sub-menu
:key="data.key"
v-on="listeners"
:key="props.menuInfo.key"
>
<span slot="title">
<a-icon type="mail" /><span>{{ props.menuInfo.title }}</span>

View File

@ -0,0 +1,41 @@
<template>
<a-sub-menu
:key="menuInfo.key"
v-bind="$props"
v-on="$listeners"
>
<span slot="title">
<a-icon type="mail" /><span>{{ menuInfo.title }}</span>
</span>
<template v-for="item in menuInfo.children">
<a-menu-item
v-if="!item.children"
:key="item.key"
>
<a-icon type="pie-chart" />
<span>{{ item.title }}</span>
</a-menu-item>
<sub-menu
v-else
:key="item.key"
:menu-info="item"
/>
</template>
</a-sub-menu>
</template>
<script>
import { Menu } from 'ant-design-vue';
export default {
name: 'SubMenu',
// must add isSubMenu: true
isSubMenu: true,
props: {
...Menu.SubMenu.props,
// Cannot overlap with properties within Menu.SubMenu.props
menuInfo: {
type: Object,
default: ()=>({}),
},
},
};
</script>

View File

@ -1,13 +1,13 @@
<cn>
#### ๅ•ๆ–‡ไปถ้€’ๅฝ’่œๅ•
ไฝฟ็”จๅ•ๆ–‡ไปถๆ–นๅผ้€’ๅฝ’็”Ÿๆˆ่œๅ•ใ€‚
ๅ› ็ป„ไปถๅ†…้ƒจไผšๅŠจๆ€ๆ›ดๆ”น`a-sub-menu`็š„ๅฑžๆ€ง๏ผŒๅฆ‚ๆžœๆ‹†ๅˆ†ๆˆๅ•ๆ–‡ไปถ๏ผŒๆ— ๆณ•ๅฐ†ๅฑžๆ€งๆŒ‚่ฝฝๅˆฐ`a-sub-menu`ไธŠ๏ผŒไฝ ้œ€่ฆ่‡ช่กŒๅฃฐๆ˜Žๅฑžๆ€งๅนถๆŒ‚่ฝฝใ€‚ไธบไบ†ๅฎž็Žฐๆ–นไพฟ๏ผŒ้ฟๅ…ไบ†ๅฑžๆ€ง็š„ๅฃฐๆ˜Ž๏ผŒๆœฌ็คบไพ‹ๅฐ†ๅ…ถๅฃฐๆ˜Žไธบๅ‡ฝๆ•ฐๅผ็ป„ไปถ๏ผŒๅนถๅฐ†ๆ‰€ๆœ‰ๅฑžๆ€งๆŒ‚่ฝฝๅˆฐ`a-sub-menu`ไธŠใ€‚
ๅ› ็ป„ไปถๅ†…้ƒจไผšๅŠจๆ€ๆ›ดๆ”น`a-sub-menu`็š„ๅฑžๆ€ง๏ผŒๅฆ‚ๆžœๆ‹†ๅˆ†ๆˆๅ•ๆ–‡ไปถ๏ผŒๆ— ๆณ•ๅฐ†ๅฑžๆ€งๆŒ‚่ฝฝๅˆฐ`a-sub-menu`ไธŠ๏ผŒไฝ ้œ€่ฆ่‡ช่กŒๅฃฐๆ˜Žๅฑžๆ€งๅนถๆŒ‚่ฝฝใ€‚ไธบไบ†ๆ–นไพฟ๏ผŒ้ฟๅ…ๅฑžๆ€ง็š„ๅฃฐๆ˜Ž๏ผŒๆˆ‘ไปฌๆŽจ่ไฝฟ็”จๅ‡ฝๆ•ฐๅผ็ป„ไปถใ€‚
</cn>
<us>
#### Single file recursive menu
Use the single file method to recursively generate menus.
The properties of `a-sub-menu` are dynamically changed inside the component. If you split the file into a single file and you cannot mount the `props` to `a-sub-menu`, you need to declare the `props` and mount it yourself. For the sake of convenience, the declaration of the `props` is avoided. This example declares it as a functional component and mounts all properties to `a-sub-menu`.
The properties of `a-sub-menu` are dynamically changed inside the component. If you split the file into a single file and you cannot mount the `props` to `a-sub-menu`, you need to declare the `props` and mount it yourself. For convenience, to avoid the declaration of attributes, we recommend using functional components.
</us>
```html
@ -35,7 +35,10 @@ The properties of `a-sub-menu` are dynamically changed inside the component. If
</template>
<script>
/* SubMenu.vue https://github.com/vueComponent/ant-design-vue/blob/master/components/menu/demo/SubMenu.vue */
/*
* recommend SubMenu.vue https://github.com/vueComponent/ant-design-vue/blob/master/components/menu/demo/SubMenu.vue
* SubMenu1.vue https://github.com/vueComponent/ant-design-vue/blob/master/components/menu/demo/SubMenu1.vue
* */
import SubMenu from './SubMenu'
export default {
components: {

View File

@ -52,11 +52,12 @@
| Param | Description | Type | Default value |
| ----- | ----------- | ---- | ------------- |
| children | sub menus or sub menu items | Array&lt;MenuItem\|SubMenu> | |
| disabled | whether sub menu is disabled or not | boolean | false |
| key | unique id of the sub menu | string | |
| title | title of the sub menu | string\|slot | |
The children of Menu.SubMenu must be `MenuItem` or `SubMenu`.
### Menu.SubMenu Events
| Events Name | Description | Arguments |
| --- | --- | --- |
@ -69,6 +70,8 @@
| children | sub menu items | MenuItem\[] | |
| title | title of the group | string\|slot | |
The children of Menu.ItemGroup must be `MenuItem`.
### Menu.Divider
Divider line in between menu items, only used in vertical popup Menu or Dropdown Menu.

View File

@ -50,13 +50,15 @@
| ๅ‚ๆ•ฐ | ่ฏดๆ˜Ž | ็ฑปๅž‹ | ้ป˜่ฎคๅ€ผ |
| --- | --- | --- | --- |
| children | ๅญ่œๅ•็š„่œๅ•้กน | Array&lt;MenuItem\|SubMenu> | |
| disabled | ๆ˜ฏๅฆ็ฆ็”จ | boolean | false |
| key | ๅ”ฏไธ€ๆ ‡ๅฟ— | string | |
| title | ๅญ่œๅ•้กนๅ€ผ | string\|slot | |
Menu.SubMenu ็š„ๅญๅ…ƒ็ด ๅฟ…้กปๆ˜ฏ `MenuItem` ๆˆ–่€… `SubMenu`.
### SubMenuไบ‹ไปถ
| ไบ‹ไปถๅ็งฐ | ่ฏดๆ˜Ž | ๅ›ž่ฐƒๅ‚ๆ•ฐ |
| --- | --- | --- |
| titleClick | ็‚นๅ‡ปๅญ่œๅ•ๆ ‡้ข˜ | ({ key, domEvent }) |
### Menu.ItemGroup
@ -65,6 +67,8 @@
| --- | --- | --- | --- |
| title | ๅˆ†็ป„ๆ ‡้ข˜ | string\|\|function\|slot | |
Menu.ItemGroup ็š„ๅญๅ…ƒ็ด ๅฟ…้กปๆ˜ฏ `MenuItem`.
### Menu.Divider
่œๅ•้กนๅˆ†ๅ‰ฒ็บฟ๏ผŒๅช็”จๅœจๅผนๅ‡บ่œๅ•ๅ†…ใ€‚

View File

@ -9,16 +9,16 @@
top: 0;
left: 0;
z-index: @zindex-popover;
font-weight: normal;
white-space: normal;
text-align: left;
cursor: auto;
user-select: text;
white-space: normal;
font-weight: normal;
text-align: left;
&:after {
content: '';
&::after {
position: absolute;
background: rgba(255, 255, 255, 0.01);
background: fade(@white, 1%);
content: '';
}
&-hidden {
@ -55,16 +55,24 @@
background-clip: padding-box;
border-radius: @border-radius-base;
box-shadow: @box-shadow-base;
box-shadow: ~'0 0 8px @{shadow-color} \9';
}
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
/* IE10+ */
&-inner {
box-shadow: @box-shadow-base;
}
}
&-title {
min-width: @popover-min-width;
min-height: 32px;
margin: 0; // reset heading margin
padding: 5px @padding-md 4px;
min-height: 32px;
border-bottom: 1px solid @border-color-split;
color: @heading-color;
font-weight: 500;
border-bottom: 1px solid @border-color-split;
}
&-inner-content {
@ -73,10 +81,10 @@
}
&-message {
padding: 4px 0 12px;
font-size: @font-size-base;
color: @popover-color;
position: relative;
padding: 4px 0 12px;
color: @popover-color;
font-size: @font-size-base;
> .@{iconfont-css-prefix} {
position: absolute;
top: 8px; // 4px for padding-top, 4px for vertical middle;
@ -89,8 +97,8 @@
}
&-buttons {
text-align: right;
margin-bottom: 4px;
text-align: right;
button {
margin-left: 8px;
}
@ -100,22 +108,25 @@
// .popover-arrow is outer, .popover-arrow:after is inner
&-arrow {
background: @popover-bg;
background-color: inherit;
width: sqrt(@popover-arrow-width * @popover-arrow-width * 2);
height: sqrt(@popover-arrow-width * @popover-arrow-width * 2);
transform: rotate(45deg);
position: absolute;
display: block;
border-color: transparent;
width: sqrt(@popover-arrow-width * @popover-arrow-width * 2);
height: sqrt(@popover-arrow-width * @popover-arrow-width * 2);
background: transparent;
border-width: sqrt(@popover-arrow-width * @popover-arrow-width * 2) / 2;
border-style: solid;
transform: rotate(45deg);
}
&-placement-top > &-content > &-arrow,
&-placement-topLeft > &-content > &-arrow,
&-placement-topRight > &-content > &-arrow {
bottom: @popover-distance - @popover-arrow-width + 1.5px;
box-shadow: 3px 3px 7px rgba(0, 0, 0, 0.07);
bottom: @popover-distance - @popover-arrow-width + 2.2px;
border-top-color: transparent;
border-right-color: @popover-bg;
border-bottom-color: @popover-bg;
border-left-color: transparent;
box-shadow: 3px 3px 7px fade(@black, 7%);
}
&-placement-top > &-content > &-arrow {
left: 50%;
@ -132,7 +143,11 @@
&-placement-rightTop > &-content > &-arrow,
&-placement-rightBottom > &-content > &-arrow {
left: @popover-distance - @popover-arrow-width + 2px;
box-shadow: -3px 3px 7px rgba(0, 0, 0, 0.07);
border-top-color: transparent;
border-right-color: transparent;
border-bottom-color: @popover-bg;
border-left-color: @popover-bg;
box-shadow: -3px 3px 7px fade(@black, 7%);
}
&-placement-right > &-content > &-arrow {
top: 50%;
@ -149,7 +164,11 @@
&-placement-bottomLeft > &-content > &-arrow,
&-placement-bottomRight > &-content > &-arrow {
top: @popover-distance - @popover-arrow-width + 2px;
box-shadow: -2px -2px 5px rgba(0, 0, 0, 0.06);
border-top-color: @popover-bg;
border-right-color: transparent;
border-bottom-color: transparent;
border-left-color: @popover-bg;
box-shadow: -2px -2px 5px fade(@black, 6%);
}
&-placement-bottom > &-content > &-arrow {
left: 50%;
@ -166,7 +185,11 @@
&-placement-leftTop > &-content > &-arrow,
&-placement-leftBottom > &-content > &-arrow {
right: @popover-distance - @popover-arrow-width + 2px;
box-shadow: 3px -3px 7px rgba(0, 0, 0, 0.07);
border-top-color: @popover-bg;
border-right-color: @popover-bg;
border-bottom-color: transparent;
border-left-color: transparent;
box-shadow: 3px -3px 7px fade(@black, 7%);
}
&-placement-left > &-content > &-arrow {
top: 50%;

View File

@ -13,6 +13,8 @@
@highlight-color : @red-6;
@warning-color : @gold-6;
@normal-color : #d9d9d9;
@white: #fff;
@black: #000;
// Color used by default to control hover and active backgrounds and for
// alert info backgrounds.
@ -292,20 +294,20 @@
// Popover
// ---
//** Popover body background color
// Popover body background color
@popover-bg: #fff;
//** Popover text color
// Popover text color
@popover-color: @text-color;
//** Popover maximum width
// Popover maximum width
@popover-min-width: 177px;
//** Popover arrow width
// Popover arrow width
@popover-arrow-width: 6px;
//** Popover arrow color
// Popover arrow color
@popover-arrow-color: @popover-bg;
//** Popover outer arrow width
//** Popover outer arrow color
// Popover outer arrow width
// Popover outer arrow color
@popover-arrow-outer-color: @popover-bg;
//** Popover distance with trigger
// Popover distance with trigger
@popover-distance: @popover-arrow-width + 4px;
// Modal

View File

@ -12,7 +12,7 @@ Table with editable rows.
<template>
<a-table :columns="columns" :dataSource="data" bordered>
<template v-for="col in ['name', 'age', 'address']" :slot="col" slot-scope="text, record, index">
<div>
<div :key="col">
<a-input
v-if="record.editable"
style="margin: -5px 0"

View File

@ -19,7 +19,7 @@ The tree structure can be populated using `treeData` property. This is a quick a
v-model="value"
>
<span style="color: #08c" slot="title" slot-scope="{key, value}" v-if="key='0-0-1'">
<a-icon type="home"/>Child Node1 {{value}}
Child Node1 {{value}}
</span>
</a-tree-select>
</template>

View File

@ -30,11 +30,11 @@
| Events Name | Description | Arguments |
| --- | --- | --- |
| check | Callback function for when the onCheck event occurs | function(checkedKeys, e:{checked: bool, checkedNodes, node, event}) |
| dragEnd | Callback function for when the onDragEnd event occurs | function({event, node}) |
| dragEnter | Callback function for when the onDragEnter event occurs | function({event, node, expandedKeys}) |
| dragLeave | Callback function for when the onDragLeave event occurs | function({event, node}) |
| dragOver | Callback function for when the onDragOver event occurs | function({event, node}) |
| dragStart | Callback function for when the onDragStart event occurs | function({event, node}) |
| dragend | Callback function for when the onDragEnd event occurs | function({event, node}) |
| dragenter | Callback function for when the onDragEnter event occurs | function({event, node, expandedKeys}) |
| dragleave | Callback function for when the onDragLeave event occurs | function({event, node}) |
| dragover | Callback function for when the onDragOver event occurs | function({event, node}) |
| dragstart | Callback function for when the onDragStart event occurs | function({event, node}) |
| drop | Callback function for when the onDrop event occurs | function({event, node, dragNode, dragNodesKeys}) |
| expand | Callback function for when a treeNode is expanded or collapsed | function(expandedKeys, {expanded: bool, node}) |
| load | Callback function for when a treeNode is loaded | function(loadedKeys, {event, node}) |

View File

@ -32,11 +32,11 @@
| ไบ‹ไปถๅ็งฐ | ่ฏดๆ˜Ž | ๅ›ž่ฐƒๅ‚ๆ•ฐ |
| --- | --- | --- |
| check | ็‚นๅ‡ปๅค้€‰ๆก†่งฆๅ‘ | function(checkedKeys, e:{checked: bool, checkedNodes, node, event}) |
| dragEnd | dragend ่งฆๅ‘ๆ—ถ่ฐƒ็”จ | function({event, node}) |
| dragEnter | dragenter ่งฆๅ‘ๆ—ถ่ฐƒ็”จ | function({event, node, expandedKeys}) |
| dragLeave | dragleave ่งฆๅ‘ๆ—ถ่ฐƒ็”จ | function({event, node}) |
| dragOver | dragover ่งฆๅ‘ๆ—ถ่ฐƒ็”จ | function({event, node}) |
| dragStart | ๅผ€ๅง‹ๆ‹–ๆ‹ฝๆ—ถ่ฐƒ็”จ | function({event, node}) |
| dragend | dragend ่งฆๅ‘ๆ—ถ่ฐƒ็”จ | function({event, node}) |
| dragenter | dragenter ่งฆๅ‘ๆ—ถ่ฐƒ็”จ | function({event, node, expandedKeys}) |
| dragleave | dragleave ่งฆๅ‘ๆ—ถ่ฐƒ็”จ | function({event, node}) |
| dragover | dragover ่งฆๅ‘ๆ—ถ่ฐƒ็”จ | function({event, node}) |
| dragstart | ๅผ€ๅง‹ๆ‹–ๆ‹ฝๆ—ถ่ฐƒ็”จ | function({event, node}) |
| drop | drop ่งฆๅ‘ๆ—ถ่ฐƒ็”จ | function({event, node, dragNode, dragNodesKeys}) |
| expand | ๅฑ•ๅผ€/ๆ”ถ่ตท่Š‚็‚นๆ—ถ่งฆๅ‘ | function(expandedKeys, {expanded: bool, node}) |
| load | ่Š‚็‚นๅŠ ่ฝฝๅฎŒๆฏ•ๆ—ถ่งฆๅ‘ | function(loadedKeys, {event, node}) |

View File

@ -164,7 +164,11 @@
}
}
}
ul > li {
&:first-child {
padding-top: 4px;
}
}
> li {
&:first-child {
padding-top: 7px;
@ -178,6 +182,18 @@
&-open {
display: block;
}
// https://github.com/ant-design/ant-design/issues/14958
> li {
// Provide additional padding between top child node and parent node
&:first-child {
padding-top: 8px;
}
// Hide additional padding between last child node and next parent node
&:last-child {
padding-bottom: 0;
}
}
}
li&-treenode-disabled {
> span:not(.@{tree-prefix-cls}-switcher),

View File

@ -48,7 +48,6 @@ const SubMenu = {
triggerSubMenuAction: PropTypes.string,
popupClassName: PropTypes.string,
getPopupContainer: PropTypes.func,
test: PropTypes.any,
forceSubMenuRender: PropTypes.bool,
openAnimation: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
disabled: PropTypes.bool,

View File

@ -323,7 +323,7 @@ const Tree = {
if (dropPosition === _dropPosition) return;
this.setState({
_dropPosition,
_dropPosition: dropPosition,
});
}
this.__emit('dragover', { event, node });

115
netlify.toml Normal file
View File

@ -0,0 +1,115 @@
[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.3.4",
"version": "1.3.5",
"title": "Ant Design Vue",
"description": "An enterprise-class UI design language and Vue-based implementation",
"keywords": [
@ -28,7 +28,7 @@
"dev": "cross-env NODE_ENV=development ENTRY_INDEX=dev ./node_modules/.bin/webpack-dev-server --open --hot --port 3001",
"start": "cross-env NODE_ENV=development ./node_modules/.bin/webpack-dev-server --open --hot",
"test": "cross-env NODE_ENV=test jest --config .jest.js",
"site": "node scripts/run.js site-dist",
"site": "node scripts/run.js _site",
"copy": "node scripts/run.js copy-html",
"compile": "node antd-tools/cli/run.js compile",
"pub": "node antd-tools/cli/run.js pub",
@ -147,7 +147,7 @@
"selenium-server": "^3.0.1",
"semver": "^5.3.0",
"style-loader": "^0.18.2",
"stylelint": "~9.6.0",
"stylelint": "^9.10.1",
"stylelint-config-prettier": "^4.0.0",
"stylelint-config-standard": "^18.2.0",
"through2": "^2.0.3",

View File

@ -9,15 +9,15 @@ if [[ $TRAVIS_BRANCH == "master" && $TRAVIS_PULL_REQUEST == "false" ]] && [[ $TR
echo "Starting to update gh-pages\n"
rm -rf site-dist
mkdir site-dist
rm -rf _site
mkdir _site
git config --global user.email "travis@travis-ci.org"
git config --global user.name "Travis"
npm run site
cd site-dist
cd _site
git init
git add -f .
git commit -m "Travis build"

View File

@ -12,7 +12,7 @@ const mkdirp = require('mkdirp');
const cwd = process.cwd();
function dist(done) {
rimraf.sync(path.join(cwd, 'site-dist'));
rimraf.sync(path.join(cwd, '_site'));
process.env.RUN_ENV = 'PRODUCTION';
const webpackConfig = require(path.join(cwd, 'webpack.site.config.js'));
webpack(webpackConfig, (err, stats) => {
@ -53,30 +53,30 @@ function copyHtml() {
input: fs.createReadStream(path.join(cwd, 'site/demoRoutes.js')),
});
fs.writeFileSync(
path.join(cwd, 'site-dist/404.html'),
path.join(cwd, '_site/404.html'),
fs.readFileSync(path.join(cwd, 'site/404.html')),
);
fs.writeFileSync(
path.join(cwd, 'site-dist/index-cn.html'),
fs.readFileSync(path.join(cwd, 'site-dist/index.html')),
path.join(cwd, '_site/index-cn.html'),
fs.readFileSync(path.join(cwd, '_site/index.html')),
);
fs.writeFileSync(path.join(cwd, 'site-dist/CNAME'), 'vue.ant.design');
fs.writeFileSync(path.join(cwd, '_site/CNAME'), 'vue.ant.design');
rl.on('line', line => {
if (line.indexOf('path:') > -1) {
const name = line.split("'")[1].split("'")[0];
console.log('create path:', name);
const toPaths = [
`site-dist/components/${name}`,
// `site-dist/components/${name}-cn`,
`site-dist/iframe/${name}`,
// `site-dist/iframe/${name}-cn`,
`_site/components/${name}`,
// `_site/components/${name}-cn`,
`_site/iframe/${name}`,
// `_site/iframe/${name}-cn`,
];
toPaths.forEach(toPath => {
rimraf.sync(path.join(cwd, toPath));
mkdirp(path.join(cwd, toPath), function() {
fs.writeFileSync(
path.join(cwd, `${toPath}/index.html`),
fs.readFileSync(path.join(cwd, 'site-dist/index.html')),
fs.readFileSync(path.join(cwd, '_site/index.html')),
);
});
});
@ -92,16 +92,16 @@ function copyHtml() {
const paths = file.path.split('/');
const name = paths[paths.length - 1].split('.')[0].toLowerCase();
const toPaths = [
'site-dist/docs',
'site-dist/docs/vue',
`site-dist/docs/vue/${name}`,
`site-dist/docs/vue/${name}-cn`,
'_site/docs',
'_site/docs/vue',
`_site/docs/vue/${name}`,
`_site/docs/vue/${name}-cn`,
];
toPaths.forEach(toPath => {
mkdirp(path.join(cwd, toPath), function() {
fs.writeFileSync(
path.join(cwd, `${toPath}/index.html`),
fs.readFileSync(path.join(cwd, 'site-dist/index.html')),
fs.readFileSync(path.join(cwd, '_site/index.html')),
);
});
});
@ -110,9 +110,10 @@ function copyHtml() {
);
}
gulp.task('site-dist', done => {
gulp.task('_site', done => {
dist(() => {
copyHtml();
done();
});
});
gulp.task('copy-html', () => {

View File

@ -22,7 +22,6 @@ const ignoreFiles = [
'es/**',
'lib/**',
'dist/**',
'site-dist/**',
'**/**.snap',
'**/**.map',
'**/components/style/color/**',

View File

@ -6,7 +6,7 @@ const carbonUrls = {
'ant-design-vue.gitee.io':'//cdn.carbonads.com/carbon.js?serve=CK7DL2JN&placement=antdesignvuegiteeio',
'vue.ant.design': '//cdn.carbonads.com/carbon.js?serve=CK7DL2JW&placement=vueantdesign',
};
const carbonUrl = carbonUrls[location.host] || '//cdn.carbonads.com/carbon.js?serve=CK7DL2JW&placement=vuecomponentgithubio';
const carbonUrl = carbonUrls[location.host] || '//cdn.carbonads.com/carbon.js?serve=CK7DL2JW&placement=vueantdesign';
export default {
props: {
isMobile: Boolean,

View File

@ -19,12 +19,6 @@ export declare class SubMenu extends AntdComponent {
*/
disabled: boolean;
/**
* sub menus or sub menu items
* @type Array<MenuItem | SubMenu>
*/
children: Array<MenuItem | SubMenu>;
/**
* title of the sub menu
* @type string | slot

6
types/modal.d.ts vendored
View File

@ -280,6 +280,12 @@ export declare class Modal extends AntdComponent {
* @type number
*/
zIndex: number;
static info(options: ModalOptions): ModalConfirm;
static success(options: ModalOptions): ModalConfirm;
static error(options: ModalOptions): ModalConfirm;
static warning(options: ModalOptions): ModalConfirm;
static confirm(options: ModalOptions): ModalConfirm;
}
declare module 'vue/types/vue' {

2
types/slider.d.ts vendored
View File

@ -47,7 +47,7 @@ export declare class Slider extends AntdComponent {
* @type object
*/
marks: {
number: string | VNode | { style: object; label: string | VNode } | Function;
[key: number]: string | VNode | { style: object; label: string | VNode } | Function;
};
/**

View File

@ -7,7 +7,7 @@ const baseWebpackConfig = require('./webpack.base.config');
module.exports = merge(baseWebpackConfig, {
output: {
path: path.resolve(__dirname, './site-dist'),
path: path.resolve(__dirname, './_site'),
publicPath: '/',
filename: '[name].[contenthash:8].js',
chunkFilename: '[contenthash:8].async.js',