From c98e13d803f153e6536bc519de5a097a342f84fe Mon Sep 17 00:00:00 2001 From: Amour1688 Date: Tue, 3 Nov 2020 11:53:59 +0800 Subject: [PATCH 1/6] style: optimize date-picker code --- components/date-picker/index.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/components/date-picker/index.ts b/components/date-picker/index.ts index 82121bdd3..a67372aa8 100755 --- a/components/date-picker/index.ts +++ b/components/date-picker/index.ts @@ -56,9 +56,4 @@ DatePicker.install = function(app: App) { return app; }; -export default DatePicker as typeof DatePicker & - Plugin & { - readonly RangePicker: typeof RangePicker; - readonly MonthPicker: typeof MonthPicker; - readonly WeekPicker: typeof WeekPicker; - }; +export default DatePicker as typeof DatePicker & Plugin; From 1165b42dc263abc0a337af2c4575836744622c1a Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Tue, 3 Nov 2020 22:36:23 +0800 Subject: [PATCH 2/6] fix: select dropdownRender not support slot #3098 --- components/select/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/components/select/index.tsx b/components/select/index.tsx index ab493ecd4..69981659e 100644 --- a/components/select/index.tsx +++ b/components/select/index.tsx @@ -215,6 +215,7 @@ const Select = defineComponent({ getPopupContainer={getPopupContainer || getContextPopupContainer} dropdownClassName={rcSelectRtlDropDownClassName} onChange={triggerChange} + dropdownRender={selectProps.dropdownRender || this.$slots.dropdownRender} > {slots.default?.()} From 6a16e19b37efee46b8379274a7bd67d126b1bc47 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Tue, 3 Nov 2020 22:57:14 +0800 Subject: [PATCH 3/6] fix: moment ts error --- components/calendar/Header.tsx | 1 + components/date-picker/props.ts | 1 + components/date-picker/utils.ts | 2 ++ 3 files changed, 4 insertions(+) diff --git a/components/calendar/Header.tsx b/components/calendar/Header.tsx index 8f5290fd9..4f1440640 100644 --- a/components/calendar/Header.tsx +++ b/components/calendar/Header.tsx @@ -4,6 +4,7 @@ import { Group, Button } from '../radio'; import PropTypes from '../_util/vue-types'; import { defaultConfigProvider } from '../config-provider'; import { VueNode } from '../_util/type'; +import moment from 'moment'; function getMonthsLocale(value: moment.Moment): string[] { const current = value.clone(); diff --git a/components/date-picker/props.ts b/components/date-picker/props.ts index 73efeb50a..621d033af 100644 --- a/components/date-picker/props.ts +++ b/components/date-picker/props.ts @@ -1,4 +1,5 @@ import { PropType } from 'vue'; +import moment from 'moment'; import PropTypes, { withUndefined } from '../_util/vue-types'; import { tuple } from '../_util/type'; diff --git a/components/date-picker/utils.ts b/components/date-picker/utils.ts index 61d96d7d7..149c7be42 100644 --- a/components/date-picker/utils.ts +++ b/components/date-picker/utils.ts @@ -1,3 +1,5 @@ +import moment from 'moment'; + type Value = moment.Moment | undefined | null; type Format = string | string[] | undefined | ((val?: Value) => string | string[] | undefined); export function formatDate(value: Value, format: Format) { From df1428e33db969fcb0f7bc377f72bd1d508a3656 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Tue, 3 Nov 2020 23:08:43 +0800 Subject: [PATCH 4/6] fix: select tag value not correct #3100 --- components/vc-select/generate.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/vc-select/generate.tsx b/components/vc-select/generate.tsx index 5499329d5..05939cf43 100644 --- a/components/vc-select/generate.tsx +++ b/components/vc-select/generate.tsx @@ -882,12 +882,12 @@ export default function generateSelector< if (props.disabled) { return; } - - if (mergedSearchValue.value) { + const serachVal = mergedSearchValue.value; + if (serachVal) { // `tags` mode should move `searchValue` into values if (props.mode === 'tags') { triggerSearch('', false, false); - triggerChange(Array.from(new Set([...mergedRawValue.value, mergedSearchValue.value]))); + triggerChange(Array.from(new Set([...mergedRawValue.value, serachVal]))); } else if (props.mode === 'multiple') { // `multiple` mode only clean the search value but not trigger event setInnerSearchValue(''); From a4854084bc18840aa94778a78aee0949c84d3e17 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Tue, 3 Nov 2020 23:15:57 +0800 Subject: [PATCH 5/6] fix: types error --- components/vc-collapse/src/commonProps.js | 2 +- components/vc-menu/DOMWrap.jsx | 2 +- components/vc-tree-select/src/SelectTrigger.jsx | 2 +- components/vc-tree-select/src/propTypes.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/vc-collapse/src/commonProps.js b/components/vc-collapse/src/commonProps.js index 13d816de2..94b0037f2 100644 --- a/components/vc-collapse/src/commonProps.js +++ b/components/vc-collapse/src/commonProps.js @@ -24,7 +24,7 @@ const collapseProps = () => ({ const panelProps = () => ({ openAnimation: PropTypes.object, prefixCls: PropTypes.string, - header: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.node]), + header: PropTypes.any, headerClass: PropTypes.string, showArrow: PropTypes.looseBool, isActive: PropTypes.looseBool, diff --git a/components/vc-menu/DOMWrap.jsx b/components/vc-menu/DOMWrap.jsx index 1aedcac3e..f5ad7b730 100644 --- a/components/vc-menu/DOMWrap.jsx +++ b/components/vc-menu/DOMWrap.jsx @@ -286,7 +286,7 @@ DOMWrap.props = { prefixCls: PropTypes.string, level: PropTypes.number, theme: PropTypes.string, - overflowedIndicator: PropTypes.node, + overflowedIndicator: PropTypes.any, visible: PropTypes.looseBool, hiddenClassName: PropTypes.string, tag: PropTypes.string.def('div'), diff --git a/components/vc-tree-select/src/SelectTrigger.jsx b/components/vc-tree-select/src/SelectTrigger.jsx index 837fb6824..4c177f3b0 100644 --- a/components/vc-tree-select/src/SelectTrigger.jsx +++ b/components/vc-tree-select/src/SelectTrigger.jsx @@ -46,7 +46,7 @@ const SelectTrigger = { isMultiple: PropTypes.looseBool, dropdownPrefixCls: PropTypes.string, dropdownVisibleChange: PropTypes.func, - popupElement: PropTypes.node, + popupElement: PropTypes.any, open: PropTypes.looseBool, }, created() { diff --git a/components/vc-tree-select/src/propTypes.js b/components/vc-tree-select/src/propTypes.js index 3a75575d2..c3fcefea0 100644 --- a/components/vc-tree-select/src/propTypes.js +++ b/components/vc-tree-select/src/propTypes.js @@ -18,7 +18,7 @@ export function valueProp(...args) { if (isLabelInValue(props)) { const err = genArrProps( PropTypes.shape({ - label: PropTypes.node, + label: PropTypes.any, value: internalValProp, }).loose, )(...args); From e39b43bbc2329ed78d2f8283c19c93d20da0c76f Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Tue, 3 Nov 2020 23:28:08 +0800 Subject: [PATCH 6/6] fix: date-picker default format not correct #3091 --- components/date-picker/WeekPicker.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/components/date-picker/WeekPicker.tsx b/components/date-picker/WeekPicker.tsx index 2306d38aa..fd031dcc7 100644 --- a/components/date-picker/WeekPicker.tsx +++ b/components/date-picker/WeekPicker.tsx @@ -28,7 +28,6 @@ export default defineComponent({ mixins: [BaseMixin], inheritAttrs: false, props: initDefaultProps(WeekPickerProps, { - format: 'gggg-wo', allowClear: true, }), setup() {