Merge branch 'master' into feat-1.4.0

pull/1256/head
tangjinzhou 2019-09-29 20:47:05 +08:00
commit 6f05a983c4
8 changed files with 72 additions and 14 deletions

View File

@ -65,6 +65,7 @@ export const CarouselProps = {
variableWidth: PropTypes.bool, variableWidth: PropTypes.bool,
useCSS: PropTypes.bool, useCSS: PropTypes.bool,
slickGoTo: PropTypes.number, slickGoTo: PropTypes.number,
responsive: PropTypes.array.def(null),
}; };
const Carousel = { const Carousel = {

View File

@ -39,7 +39,7 @@ export default {
}, },
data() { data() {
return { return {
sVisible: !!this.$props.visible, sVisible: !!this.$props.visible || !!this.$props.defaultVisible,
}; };
}, },
watch: { watch: {

View File

@ -31,7 +31,7 @@ const defaultProps = {
pauseOnFocus: PropTypes.bool.def(false), pauseOnFocus: PropTypes.bool.def(false),
// hover是否暂停 // hover是否暂停
pauseOnHover: PropTypes.bool.def(true), pauseOnHover: PropTypes.bool.def(true),
responsive: PropTypes.any.def(null), responsive: PropTypes.array.def(null),
rows: PropTypes.number.def(1), rows: PropTypes.number.def(1),
rtl: PropTypes.bool.def(false), rtl: PropTypes.bool.def(false),
slide: PropTypes.string.def('div'), slide: PropTypes.string.def('div'),

View File

@ -28,7 +28,6 @@ const Header = {
currentSelectPanel: PropTypes.string, currentSelectPanel: PropTypes.string,
focusOnOpen: PropTypes.bool, focusOnOpen: PropTypes.bool,
// onKeyDown: PropTypes.func, // onKeyDown: PropTypes.func,
showStr: PropTypes.bool.def(true),
clearIcon: PropTypes.any, clearIcon: PropTypes.any,
}, },
data() { data() {
@ -70,7 +69,6 @@ const Header = {
return; return;
} }
this.showStr = true;
this.setState({ this.setState({
str, str,
}); });
@ -169,14 +167,14 @@ const Header = {
}, },
getInput() { getInput() {
const { prefixCls, placeholder, inputReadOnly, invalid, str, showStr } = this; const { prefixCls, placeholder, inputReadOnly, invalid, str } = this;
const invalidClass = invalid ? `${prefixCls}-input-invalid` : ''; const invalidClass = invalid ? `${prefixCls}-input-invalid` : '';
return ( return (
<input <input
class={`${prefixCls}-input ${invalidClass}`} class={`${prefixCls}-input ${invalidClass}`}
ref="input" ref="input"
onKeydown={this.onKeyDown} onKeydown={this.onKeyDown}
value={showStr ? str : ''} value={str}
placeholder={placeholder} placeholder={placeholder}
onInput={this.onInputChange} onInput={this.onInputChange}
readOnly={!!inputReadOnly} readOnly={!!inputReadOnly}

View File

@ -71,7 +71,6 @@ const Panel = {
sValue: this.value, sValue: this.value,
selectionRange: [], selectionRange: [],
currentSelectPanel: '', currentSelectPanel: '',
showStr: true,
}; };
}, },
watch: { watch: {
@ -79,11 +78,6 @@ const Panel = {
if (val) { if (val) {
this.setState({ this.setState({
sValue: val, sValue: val,
showStr: true,
});
} else {
this.setState({
showStr: false,
}); });
} }
}, },
@ -150,7 +144,6 @@ const Panel = {
inputReadOnly, inputReadOnly,
sValue, sValue,
currentSelectPanel, currentSelectPanel,
showStr,
$listeners = {}, $listeners = {},
} = this; } = this;
const clearIcon = getComponentFromProp(this, 'clearIcon'); const clearIcon = getComponentFromProp(this, 'clearIcon');
@ -203,7 +196,6 @@ const Panel = {
focusOnOpen={focusOnOpen} focusOnOpen={focusOnOpen}
onKeydown={keydown} onKeydown={keydown}
inputReadOnly={inputReadOnly} inputReadOnly={inputReadOnly}
showStr={showStr}
clearIcon={clearIcon} clearIcon={clearIcon}
/> />
<Combobox <Combobox

View File

@ -16,6 +16,7 @@ import { Button } from './button/button';
import { Calendar } from './calendar'; import { Calendar } from './calendar';
import { Card } from './card'; import { Card } from './card';
import { Collapse } from './collapse/collapse'; import { Collapse } from './collapse/collapse';
import { Comment } from './comment';
import { Carousel } from './carousel'; import { Carousel } from './carousel';
import { Cascader } from './cascader'; import { Cascader } from './cascader';
import { Checkbox } from './checkbox/checkbox'; import { Checkbox } from './checkbox/checkbox';

47
types/carousel.d.ts vendored
View File

@ -4,6 +4,51 @@
import { AntdComponent } from './component'; import { AntdComponent } from './component';
export interface Settings {
accessibility?: boolean;
adaptiveHeight?: boolean;
arrows?: boolean;
autoplaySpeed?: number;
autoplay?: boolean;
centerMode?: boolean;
centerPadding?: string;
className?: string;
cssEase?: string;
dotsClass?: string;
dots?: boolean;
draggable?: boolean;
easing?: string;
edgeFriction?: number;
fade?: boolean;
focusOnSelect?: boolean;
infinite?: boolean;
initialSlide?: number;
pauseOnDotsHover?: boolean;
pauseOnFocus?: boolean;
pauseOnHover?: boolean;
responsive?: ResponsiveObject[];
rows?: number;
rtl?: boolean;
slide?: string;
slidesPerRow?: number;
slidesToScroll?: number;
slidesToShow?: number;
speed?: number;
swipeToSlide?: boolean;
swipe?: boolean;
touchMove?: boolean;
touchThreshold?: number;
useCSS?: boolean;
useTransform?: boolean;
variableWidth?: boolean;
vertical?: boolean;
verticalSwiping?: boolean;
waitForAnimate?: boolean;
}
export interface ResponsiveObject {
breakpoint: number;
settings: 'unslick' | Settings;
}
export declare class Carousel extends AntdComponent { export declare class Carousel extends AntdComponent {
/** /**
* Callback function called after the current index changes * Callback function called after the current index changes
@ -52,6 +97,8 @@ export declare class Carousel extends AntdComponent {
*/ */
vertical: boolean; vertical: boolean;
responsive: ResponsiveObject[];
/** /**
* Go to slide index, if dontAnimate=true, it happens without animation * Go to slide index, if dontAnimate=true, it happens without animation
* @param slideNumber slide number to go * @param slideNumber slide number to go

19
types/comment.d.ts vendored Normal file
View File

@ -0,0 +1,19 @@
// Project: https://github.com/vueComponent/ant-design-vue
// Definitions: https://github.com/vueComponent/ant-design-vue/types
import { AntdComponent } from './component';
export declare class Comment extends AntdComponent {
/** List of action items rendered below the comment content */
actions?: Array<any>;
/** The element to display as the comment author. */
author?: any;
/** The element to display as the comment avatar - generally an antd Avatar */
avatar?: any;
/** The main content of the comment */
content: any;
/** Comment prefix defaults to '.ant-comment' */
prefixCls?: string;
/** A datetime element containing the time to be displayed */
datetime?: any;
}