pull/3128/head
tanjinzhou 2020-11-04 10:53:06 +08:00
commit 36b2d47f84
11 changed files with 13 additions and 14 deletions

View File

@ -4,6 +4,7 @@ import { Group, Button } from '../radio';
import PropTypes from '../_util/vue-types'; import PropTypes from '../_util/vue-types';
import { defaultConfigProvider } from '../config-provider'; import { defaultConfigProvider } from '../config-provider';
import { VueNode } from '../_util/type'; import { VueNode } from '../_util/type';
import moment from 'moment';
function getMonthsLocale(value: moment.Moment): string[] { function getMonthsLocale(value: moment.Moment): string[] {
const current = value.clone(); const current = value.clone();

View File

@ -28,7 +28,6 @@ export default defineComponent({
mixins: [BaseMixin], mixins: [BaseMixin],
inheritAttrs: false, inheritAttrs: false,
props: initDefaultProps(WeekPickerProps, { props: initDefaultProps(WeekPickerProps, {
format: 'gggg-wo',
allowClear: true, allowClear: true,
}), }),
setup() { setup() {

View File

@ -56,9 +56,4 @@ DatePicker.install = function(app: App) {
return app; return app;
}; };
export default DatePicker as typeof DatePicker & export default DatePicker as typeof DatePicker & Plugin;
Plugin & {
readonly RangePicker: typeof RangePicker;
readonly MonthPicker: typeof MonthPicker;
readonly WeekPicker: typeof WeekPicker;
};

View File

@ -1,4 +1,5 @@
import { PropType } from 'vue'; import { PropType } from 'vue';
import moment from 'moment';
import PropTypes, { withUndefined } from '../_util/vue-types'; import PropTypes, { withUndefined } from '../_util/vue-types';
import { tuple } from '../_util/type'; import { tuple } from '../_util/type';

View File

@ -1,3 +1,5 @@
import moment from 'moment';
type Value = moment.Moment | undefined | null; type Value = moment.Moment | undefined | null;
type Format = string | string[] | undefined | ((val?: Value) => string | string[] | undefined); type Format = string | string[] | undefined | ((val?: Value) => string | string[] | undefined);
export function formatDate(value: Value, format: Format) { export function formatDate(value: Value, format: Format) {

View File

@ -215,6 +215,7 @@ const Select = defineComponent({
getPopupContainer={getPopupContainer || getContextPopupContainer} getPopupContainer={getPopupContainer || getContextPopupContainer}
dropdownClassName={rcSelectRtlDropDownClassName} dropdownClassName={rcSelectRtlDropDownClassName}
onChange={triggerChange} onChange={triggerChange}
dropdownRender={selectProps.dropdownRender || this.$slots.dropdownRender}
> >
{slots.default?.()} {slots.default?.()}
</RcSelect> </RcSelect>

View File

@ -24,7 +24,7 @@ const collapseProps = () => ({
const panelProps = () => ({ const panelProps = () => ({
openAnimation: PropTypes.object, openAnimation: PropTypes.object,
prefixCls: PropTypes.string, prefixCls: PropTypes.string,
header: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.node]), header: PropTypes.any,
headerClass: PropTypes.string, headerClass: PropTypes.string,
showArrow: PropTypes.looseBool, showArrow: PropTypes.looseBool,
isActive: PropTypes.looseBool, isActive: PropTypes.looseBool,

View File

@ -286,7 +286,7 @@ DOMWrap.props = {
prefixCls: PropTypes.string, prefixCls: PropTypes.string,
level: PropTypes.number, level: PropTypes.number,
theme: PropTypes.string, theme: PropTypes.string,
overflowedIndicator: PropTypes.node, overflowedIndicator: PropTypes.any,
visible: PropTypes.looseBool, visible: PropTypes.looseBool,
hiddenClassName: PropTypes.string, hiddenClassName: PropTypes.string,
tag: PropTypes.string.def('div'), tag: PropTypes.string.def('div'),

View File

@ -882,12 +882,12 @@ export default function generateSelector<
if (props.disabled) { if (props.disabled) {
return; return;
} }
const serachVal = mergedSearchValue.value;
if (mergedSearchValue.value) { if (serachVal) {
// `tags` mode should move `searchValue` into values // `tags` mode should move `searchValue` into values
if (props.mode === 'tags') { if (props.mode === 'tags') {
triggerSearch('', false, false); 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') { } else if (props.mode === 'multiple') {
// `multiple` mode only clean the search value but not trigger event // `multiple` mode only clean the search value but not trigger event
setInnerSearchValue(''); setInnerSearchValue('');

View File

@ -46,7 +46,7 @@ const SelectTrigger = {
isMultiple: PropTypes.looseBool, isMultiple: PropTypes.looseBool,
dropdownPrefixCls: PropTypes.string, dropdownPrefixCls: PropTypes.string,
dropdownVisibleChange: PropTypes.func, dropdownVisibleChange: PropTypes.func,
popupElement: PropTypes.node, popupElement: PropTypes.any,
open: PropTypes.looseBool, open: PropTypes.looseBool,
}, },
created() { created() {

View File

@ -18,7 +18,7 @@ export function valueProp(...args) {
if (isLabelInValue(props)) { if (isLabelInValue(props)) {
const err = genArrProps( const err = genArrProps(
PropTypes.shape({ PropTypes.shape({
label: PropTypes.node, label: PropTypes.any,
value: internalValProp, value: internalValProp,
}).loose, }).loose,
)(...args); )(...args);