Skip to content

Commit

Permalink
feat(component): 新增Tabs组件
Browse files Browse the repository at this point in the history
  • Loading branch information
ShanaMaid committed Aug 17, 2018
1 parent 96640c8 commit b56ecbb
Show file tree
Hide file tree
Showing 41 changed files with 912 additions and 26 deletions.
4 changes: 2 additions & 2 deletions components/Alert/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
font-size: 12px;
line-height: @line-height-base;
margin-bottom: 10px;
font-size: @font-size-base;
font-size: @font-size-default;
transition: @transition-slow;
transform: scaleY(1.0);
transform-origin: 50% 0%;
Expand Down Expand Up @@ -99,7 +99,7 @@
}

&-description {
font-size: @font-size-base;
font-size: @font-size-default;
padding-top: 5px;

}
Expand Down
2 changes: 1 addition & 1 deletion components/AutoComplete/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
border-radius: @border-radius-large;
background-color: white;
box-shadow: @shadow-base;
font-size: @font-size-base;
font-size: @font-size-default;
transform-origin: 50% 0;
z-index: @z-index-pop;

Expand Down
4 changes: 2 additions & 2 deletions components/Button/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
&-size-large {
padding: 0 15px;
height: 32px;
font-size: @font-size-base;
font-size: @font-size-default;
height: @button-height-size-large;
}

Expand Down Expand Up @@ -116,7 +116,7 @@
width: 28px;
height: 28px;
padding: 0;
font-size: @font-size-base;
font-size: @font-size-default;
}
}

Expand Down
2 changes: 1 addition & 1 deletion components/Card/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

@card-prefix-cls: ~"@{css-prefix}-card";
.@{card-prefix-cls} {
font-size: @font-size-base;
font-size: @font-size-default;
background: white;

&-head{
Expand Down
2 changes: 1 addition & 1 deletion components/Checkbox/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

&-text {
margin: 0 10px;
font-size: @font-size-base;
font-size: @font-size-default;
}

}
Expand Down
2 changes: 1 addition & 1 deletion components/Collapse/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
cursor: pointer;

&-title {
font-size: @font-size-base;
font-size: @font-size-default;
background-color: @panel-bgColor;
padding: 12px 0 12px 40px;
}
Expand Down
2 changes: 1 addition & 1 deletion components/Input/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
> input {
height: @input-size-small;
padding: 1px 7px;
font-size: @font-size-base;
font-size: @font-size-default;
}


Expand Down
2 changes: 1 addition & 1 deletion components/InputNumber/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
.@{inputnumber-prefix-cls}-small {
height: @input-size-small;
padding: 1px 7px;
font-size: @font-size-base;
font-size: @font-size-default;
}

.@{inputnumber-prefix-cls}-large {
Expand Down
6 changes: 3 additions & 3 deletions components/Menu/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}

&-title {
font-size: @font-size-base;
font-size: @font-size-default;
height: 40px;
line-height: 40px;
cursor: pointer;
Expand Down Expand Up @@ -67,7 +67,7 @@
@menu-item-group-prefix-cls: ~"@{css-prefix}-menu-item-group";
.@{menu-item-group-prefix-cls} {
&-title {
font-size: @font-size-base;
font-size: @font-size-default;
height: 40px;
line-height: 40px;
color: @color-disabled;
Expand All @@ -80,7 +80,7 @@

@menu-item-prefix-cls: ~"@{css-prefix}-menu-item";
.@{menu-item-prefix-cls} {
font-size: @font-size-base;
font-size: @font-size-default;
height: 40px;
line-height: 40px;
cursor: pointer;
Expand Down
2 changes: 1 addition & 1 deletion components/Modal/style/var.less
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
@title-font-size: @font-size-large;
@title-font-color: black;

@content-font-size: @font-size-base;
@content-font-size: @font-size-default;
@content-font-color: rgba(0,0,0,.65);
2 changes: 1 addition & 1 deletion components/Pagination/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
border-radius: @border-radius-large;
margin-right: 8px;
text-align: center;
font-size: @font-size-base;
font-size: @font-size-default;
cursor: pointer;

span {
Expand Down
2 changes: 1 addition & 1 deletion components/Radio/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

&-text {
margin: 0 10px;
font-size: @font-size-base;
font-size: @font-size-default;
}

}
Expand Down
1 change: 1 addition & 0 deletions components/Select/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
padding: 0 11px;
transition: @transition-base;
cursor: pointer;
display: inline-block;

&-enabled {
.@{select-prefix-cls} {
Expand Down
4 changes: 2 additions & 2 deletions components/Select/style/var.less
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
@select-size-default: 32px;
@select-size-large: 40px;

@select-font-size-small: @font-size-base;
@select-font-size-default: @font-size-base;
@select-font-size-small: @font-size-default;
@select-font-size-default: @font-size-default;
@select-font-size-large: @font-size-large;

@select-border-color: @border-color;
Expand Down
2 changes: 1 addition & 1 deletion components/Steps/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
}
.@{itemPreCls}-small {
font-size: @font-size-base;
font-size: @font-size-default;
.@{itemPreCls}-icon {
width: @steps-size-small;
height: @steps-size-small;
Expand Down
57 changes: 57 additions & 0 deletions components/Tabs/Pane.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

import {Component} from 'react';
import * as React from 'react';
import * as classNames from 'classnames';
import {IBaseComponent, TKey} from '../template/component';

export interface IPaneProps extends IBaseComponent {
/**
* 选项标题
*/
name: TKey;
/**
* 禁用
*/
disabled?: boolean;
/**
* 激活key,由Tabs传入,开发者不应使用
*/
active?: boolean;
}

export interface IPaneState {

}

/**
* **组件中文名称**-组件描述。
*/
export class Pane extends Component<IPaneProps, IPaneState> {
static defaultProps = {

};

render() {
const {
className, style, name,
active, disabled,
children, onChange,
...otherProps} = this.props;
const preCls = 'yoshino-tabs-pane';
const clsName = classNames(
preCls, className,
{[`${preCls}-disabled`]: disabled},
);
return (
<div
className={clsName}
style={style}
{...otherProps}
>
{children}
</div>
);
}
}

export default Pane;
Loading

0 comments on commit b56ecbb

Please sign in to comment.