diff --git a/components/_util/BaseMixin.js b/components/_util/BaseMixin.js
index 01a701e44..52d853735 100644
--- a/components/_util/BaseMixin.js
+++ b/components/_util/BaseMixin.js
@@ -16,9 +16,7 @@ export default {
} else {
this.$listeners[eventName](...args.slice(1))
}
- return true
}
- return false
},
},
}
diff --git a/components/_util/props-util.js b/components/_util/props-util.js
index a453b943d..956dea91a 100644
--- a/components/_util/props-util.js
+++ b/components/_util/props-util.js
@@ -52,7 +52,7 @@ const getOptionProps = (instance) => {
const res = {}
for (const [k, v] of Object.entries(props)) {
if (v.default !== undefined) {
- res[k] = v
+ res[k] = typeof v.default === 'function' ? v.default() : v.default
}
}
return { ...res, ...propsData }
@@ -179,6 +179,18 @@ const initDefaultProps = (propTypes, defaultProps) => {
Object.keys(defaultProps).forEach(k => { propTypes[k] = propTypes[k].def(defaultProps[k]) })
return propTypes
}
+
+export function mergeProps () {
+ const args = [].slice.call(arguments, 0)
+ const props = {}
+ args.forEach((p, i) => {
+ for (const [k, v] of Object.entries(p)) {
+ props[k] = props[k] || {}
+ Object.assign(props[k], v)
+ }
+ })
+ return props
+}
export {
hasProp,
filterProps,
diff --git a/components/_util/vnode.js b/components/_util/vnode.js
index 59eb2b221..4f7e91e0c 100644
--- a/components/_util/vnode.js
+++ b/components/_util/vnode.js
@@ -70,6 +70,7 @@ export function cloneElement (n, nodeProps, deep) {
domProps = {},
style: tempStyle = {},
class: tempCls = {},
+ scopedSlots = {},
} = nodeProps
if (typeof data.style === 'string') {
@@ -99,6 +100,7 @@ export function cloneElement (n, nodeProps, deep) {
attrs: { ...data.attrs, ...attrs },
class: cls,
domProps: { ...data.domProps, ...domProps },
+ scopedSlots: { ...data.scopedSlots, ...scopedSlots },
})
if (node.componentOptions) {
diff --git a/components/pagination/index.en-US.md b/components/pagination/index.en-US.md
index fba0a3e38..948bffec5 100644
--- a/components/pagination/index.en-US.md
+++ b/components/pagination/index.en-US.md
@@ -1,7 +1,7 @@
## API
```html
-
+
```
| Property | Description | Type | Default |
@@ -11,7 +11,7 @@
| defaultPageSize | default number of data items per page | number | 10 |
| hideOnSinglePage | Whether to hide pager on single page | boolean | false |
| itemRender | to customize item innerHTML | (page, type: 'page' \| 'prev' \| 'next', originalElement) => vNode | - |
-| pageSize | number of data items per page | number | - |
+| pageSize(.sync) | number of data items per page | number | - |
| pageSizeOptions | specify the sizeChanger options | string\[] | ['10', '20', '30', '40'] |
| showQuickJumper | determine whether you can jump to pages directly | boolean | false |
| showSizeChanger | determine whether `pageSize` can be changed | boolean | false |
diff --git a/components/pagination/index.zh-CN.md b/components/pagination/index.zh-CN.md
index fa0dbf77a..b24d34b04 100644
--- a/components/pagination/index.zh-CN.md
+++ b/components/pagination/index.zh-CN.md
@@ -1,7 +1,7 @@
## API
```html
-
+
```
| 参数 | 说明 | 类型 | 默认值 |
@@ -11,7 +11,7 @@
| defaultPageSize | 默认的每页条数 | number | 10 |
| hideOnSinglePage | 只有一页时是否隐藏分页器 | boolean | false |
| itemRender | 用于自定义页码的结构,可用于优化 SEO | (page, type: 'page' \| 'prev' \| 'next', originalElement) => vNode | - |
-| pageSize | 每页条数 | number | - |
+| pageSize(.sync) | 每页条数 | number | - |
| pageSizeOptions | 指定每页可以显示多少条 | string\[] | ['10', '20', '30', '40'] |
| showQuickJumper | 是否可以快速跳转至某页 | boolean | false |
| showSizeChanger | 是否可以改变 pageSize | boolean | false |
diff --git a/components/steps/demo/customized-progress-dot.md b/components/steps/demo/customized-progress-dot.md
index 57466d2a1..ee535b3c0 100644
--- a/components/steps/demo/customized-progress-dot.md
+++ b/components/steps/demo/customized-progress-dot.md
@@ -10,30 +10,19 @@ You can customize the display for Steps with progress dot style.
```html
-
+
+
+
+
+ step {{index}} status: {{status}}
+
+
+
+
-
```
diff --git a/components/steps/index.en-US.md b/components/steps/index.en-US.md
index 0448b8afe..2209b5f3c 100644
--- a/components/steps/index.en-US.md
+++ b/components/steps/index.en-US.md
@@ -6,7 +6,7 @@ The whole of the step bar.
| -------- | ----------- | ---- | ------- |
| current | to set the current step, counting from 0. You can overwrite this state by using `status` of `Step` | number | 0 |
| direction | to specify the direction of the step bar, `horizontal` and `vertical` are currently supported | string | `horizontal` |
-| progressDot | Steps with progress dot style, customize the progress dot by setting it to a function | Boolean or (iconDot, {index, status, title, description}) => vNode | false |
+| progressDot | Steps with progress dot style, customize the progress dot by setting a scoped slot | Boolean or slot="progressDot" slot-scope="{index, status, title, description, prefixCls})" | false |
| size | to specify the size of the step bar, `default` and `small` are currently supported | string | `default` |
| status | to specify the status of current step, can be set to one of the following values: `wait` `process` `finish` `error` | string | `process` |
diff --git a/components/steps/index.vue b/components/steps/index.vue
index 34a9ea2ce..acf8a2d15 100644
--- a/components/steps/index.vue
+++ b/components/steps/index.vue
@@ -32,6 +32,7 @@ export default {
const stepsProps = {
props,
on: this.$listeners,
+ scopedSlots: this.$scopedSlots,
}
return (
vNode | false |
+| progressDot | 点状步骤条,可以设置为一个 作用域插槽 | Boolean or slot="progressDot" slot-scope="{index, status, title, description, prefixCls})" | false |
| size | 指定大小,目前支持普通(`default`)和迷你(`small`) | string | default |
| status | 指定当前步骤的状态,可选 `wait` `process` `finish` `error` | string | process |
diff --git a/components/tabs/src/Tabs.vue b/components/tabs/src/Tabs.vue
index 93605e62b..b7a30e7e3 100644
--- a/components/tabs/src/Tabs.vue
+++ b/components/tabs/src/Tabs.vue
@@ -1,4 +1,5 @@
diff --git a/components/vc-calendar/demo/antd-month-calendar.vue b/components/vc-calendar/demo/antd-month-calendar.vue
new file mode 100644
index 000000000..9a3f3f6d6
--- /dev/null
+++ b/components/vc-calendar/demo/antd-month-calendar.vue
@@ -0,0 +1,160 @@
+
diff --git a/components/vc-calendar/demo/antd-range-calendar.vue b/components/vc-calendar/demo/antd-range-calendar.vue
new file mode 100644
index 000000000..1f120fd19
--- /dev/null
+++ b/components/vc-calendar/demo/antd-range-calendar.vue
@@ -0,0 +1,204 @@
+
diff --git a/components/vc-calendar/demo/full-calendar.vue b/components/vc-calendar/demo/full-calendar.vue
new file mode 100644
index 000000000..a1aca551f
--- /dev/null
+++ b/components/vc-calendar/demo/full-calendar.vue
@@ -0,0 +1,76 @@
+
\ No newline at end of file
diff --git a/components/vc-calendar/src/Calendar.vue b/components/vc-calendar/src/Calendar.vue
index 78a32eaba..7490282da 100644
--- a/components/vc-calendar/src/Calendar.vue
+++ b/components/vc-calendar/src/Calendar.vue
@@ -10,8 +10,8 @@ import CalendarFooter from './calendar/CalendarFooter'
import CalendarMixin from './mixin/CalendarMixin'
import CommonMixin from './mixin/CommonMixin'
import DateInput from './date/DateInput'
+import enUs from './locale/en_US'
import { getTimeConfig, getTodayTime, syncTime } from './util'
-
function goStartMonth () {
const next = this.sValue.clone()
next.startOf('month')
@@ -48,12 +48,15 @@ function goDay (direction) {
const Calendar = {
props: {
- prefixCls: PropTypes.string,
+ locale: PropTypes.object.def(enUs),
+ visible: PropTypes.bool.def(true),
+ prefixCls: PropTypes.string.def('rc-calendar'),
+ // prefixCls: PropTypes.string,
defaultValue: PropTypes.object,
value: PropTypes.object,
selectedValue: PropTypes.object,
mode: PropTypes.oneOf(['time', 'date', 'month', 'year', 'decade']),
- locale: PropTypes.object,
+ // locale: PropTypes.object,
showDateInput: PropTypes.bool.def(true),
showWeekNumber: PropTypes.bool,
showToday: PropTypes.bool.def(true),
@@ -68,8 +71,8 @@ const Calendar = {
// onPanelChange: PropTypes.func,
disabledDate: PropTypes.func,
disabledTime: PropTypes.any,
- renderFooter: PropTypes.func,
- renderSidebar: PropTypes.func,
+ renderFooter: PropTypes.func.def(() => null),
+ renderSidebar: PropTypes.func.def(() => null),
},
mixins: [BaseMixin, CommonMixin, CalendarMixin],
@@ -168,7 +171,8 @@ const Calendar = {
onDateTableSelect (value) {
const { timePicker, sSelectedValue } = this
if (!sSelectedValue && timePicker) {
- const timePickerDefaultValue = timePicker.props.defaultValue
+ const timePickerProps = getOptionProps(timePicker)
+ const timePickerDefaultValue = timePickerProps.defaultValue
if (timePickerDefaultValue) {
syncTime(timePickerDefaultValue, value)
}
@@ -215,6 +219,7 @@ const Calendar = {
let timePickerEle = null
if (timePicker && showTimePicker) {
+ console.log(timePicker)
const timePickerOriginProps = getOptionProps(timePicker)
const timePickerProps = {
props: {
@@ -234,7 +239,7 @@ const Calendar = {
if (timePickerOriginProps.defaultValue !== undefined) {
timePickerProps.props.defaultOpenValue = timePickerOriginProps.defaultValue
}
-
+ console.log(timePickerProps)
timePickerEle = cloneElement(timePicker, timePickerProps)
}
@@ -320,4 +325,4 @@ const Calendar = {
}
export default Calendar
-
\ No newline at end of file
+
diff --git a/components/vc-calendar/src/FullCalendar.vue b/components/vc-calendar/src/FullCalendar.vue
index 5fea18842..8215cf28e 100644
--- a/components/vc-calendar/src/FullCalendar.vue
+++ b/components/vc-calendar/src/FullCalendar.vue
@@ -7,24 +7,28 @@ import MonthTable from './month/MonthTable'
import CalendarMixin from './mixin/CalendarMixin'
import CommonMixin from './mixin/CommonMixin'
import CalendarHeader from './full-calendar/CalendarHeader'
-
+import enUs from './locale/en_US'
const FullCalendar = {
props: {
+ locale: PropTypes.object.def(enUs),
+ visible: PropTypes.bool.def(true),
+ prefixCls: PropTypes.string.def('rc-calendar'),
defaultType: PropTypes.string.def('date'),
type: PropTypes.string,
- prefixCls: PropTypes.string,
- locale: PropTypes.object,
+ // locale: PropTypes.object,
// onTypeChange: PropTypes.func,
fullscreen: PropTypes.bool.def(false),
monthCellRender: PropTypes.func,
dateCellRender: PropTypes.func,
showTypeSwitch: PropTypes.bool.def(true),
- Select: PropTypes.func.isRequired,
+ Select: PropTypes.object.isRequired,
headerComponents: PropTypes.array,
headerComponent: PropTypes.object, // The whole header component
headerRender: PropTypes.func,
showHeader: PropTypes.bool.def(true),
disabledDate: PropTypes.func,
+ renderFooter: PropTypes.func.def(() => null),
+ renderSidebar: PropTypes.func.def(() => null),
},
mixins: [BaseMixin, CommonMixin, CalendarMixin],
data () {
@@ -72,7 +76,7 @@ const FullCalendar = {
headerRender,
disabledDate,
} = props
- const { sValue: value, sType: type } = this
+ const { sValue: value, sType: type, $listeners } = this
let header = null
if (showHeader) {
@@ -88,6 +92,7 @@ const FullCalendar = {
value,
},
on: {
+ ...$listeners,
typeChange: this.setType,
valueChange: this.setValue,
},
diff --git a/components/vc-calendar/src/MonthCalendar.vue b/components/vc-calendar/src/MonthCalendar.vue
index 59fea5c6a..6d6c12894 100644
--- a/components/vc-calendar/src/MonthCalendar.vue
+++ b/components/vc-calendar/src/MonthCalendar.vue
@@ -6,11 +6,18 @@ import CalendarHeader from './calendar/CalendarHeader'
import CalendarFooter from './calendar/CalendarFooter'
import CalendarMixin from './mixin/CalendarMixin'
import CommonMixin from './mixin/CommonMixin'
-
+import enUs from './locale/en_US'
const MonthCalendar = {
props: {
+ locale: PropTypes.object.def(enUs),
+ visible: PropTypes.bool.def(true),
+ prefixCls: PropTypes.string.def('rc-calendar'),
monthCellRender: PropTypes.func,
dateCellRender: PropTypes.func,
+ disabledDate: PropTypes.func,
+ monthCellContentRender: PropTypes.func,
+ renderFooter: PropTypes.func.def(() => null),
+ renderSidebar: PropTypes.func.def(() => null),
},
mixins: [BaseMixin, CommonMixin, CalendarMixin],
@@ -74,25 +81,26 @@ const MonthCalendar = {
render () {
const { mode, sValue: value, $props: props } = this
+ const { prefixCls, locale, disabledDate, monthCellRender, monthCellContentRender, renderFooter } = props
const children = (
-
-