Merge branch 'master' of github.com:ant-design/ant-design

This commit is contained in:
afc163 2016-07-07 15:13:46 +08:00
commit 9ed2a5e803
5 changed files with 49 additions and 7 deletions

View File

@ -1,4 +1,4 @@
export default function splitObject(obj, parts) {
export default function splitObject(obj, parts) : Array<any>{
let left = {};
let right = {};
Object.keys(obj).forEach((k)=> {

View File

@ -1,8 +1,34 @@
import React from 'react';
import * as React from 'react';
import Checkbox from './index';
import PureRenderMixin from 'react-addons-pure-render-mixin';
import assign from 'object-assign';
export default class CheckboxGroup extends React.Component {
export interface CheckboxOptionType {
label:string,
value:string,
disabled?:boolean
}
interface CheckboxGroupProps {
/** 默认选中的选项*/
defaultValue?:Array<string>,
/** 指定选中的选项*/
value?:Array<string>,
/** 指定可选项*/
options?:Array<CheckboxOptionType> | Array<string>,
/** 变化时回调函数*/
onChange?:(checkedValue:Array<string>) => void,
disabled?:boolean,
style?:React.CSSProperties
}
interface CheckboxGroupState {
value: any;
}
export default class CheckboxGroup extends React.Component<CheckboxGroupProps, CheckboxGroupState> {
static defaultProps = {
options: [],
defaultValue: [],

View File

@ -1,10 +1,26 @@
import RcCheckbox from 'rc-checkbox';
import React from 'react';
import * as React from 'react';
import CheckboxGroup from './Group';
import classNames from 'classnames';
import PureRenderMixin from 'react-addons-pure-render-mixin';
import splitObject from '../_util/splitObject';
export default class Checkbox extends React.Component {
interface CheckboxProps {
/** 指定当前是否选中*/
checked?:boolean,
/** 初始是否选中*/
defaultChecked?:boolean,
/** 变化时回调函数*/
onChange?:React.FormEventHandler,
style?:React.CSSProperties,
disabled?: boolean,
className?: string,
}
export default class Checkbox extends React.Component<CheckboxProps, any> {
static Group = CheckboxGroup;
static defaultProps = {
prefixCls: 'ant-checkbox',

View File

@ -1,5 +1,5 @@
import RcCollapse from 'rc-collapse';
import React from 'react';
import * as React from 'react';
export interface CollapseProps {
activeKey?:Array<string> | string,

View File

@ -46,7 +46,7 @@ ReactDOM.render(
</div>
<div style={{ marginLeft: 60, clear: 'both' }}>
<Tooltip placement="bottomLeft" title={text}>
<a href="#">上右</a>
<a href="#">下左</a>
</Tooltip>
<Tooltip placement="bottom" title={text}>
<a href="#">下边</a>