Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
silentcloud committed Jan 19, 2017
2 parents b45d1ea + 1f97922 commit 62f75f8
Show file tree
Hide file tree
Showing 23 changed files with 68 additions and 167 deletions.
8 changes: 7 additions & 1 deletion components/accordion/demo/accordion.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const AccordionExmple = React.createClass({
<div style={{ marginTop: 10, marginBottom: 10 }}>
<Accordion accordion openAnimation={{}} className="my-accordion">
<Accordion.Panel header="标题一">
<List>
<List className="my-list">
<List.Item>子内容一</List.Item>
<List.Item>子内容二</List.Item>
<List.Item>子内容三</List.Item>
Expand All @@ -39,4 +39,10 @@ ReactDOM.render(<AccordionExmple />, mountNode);
.my-accordion .pad .am-accordion-content-box {
padding: 0.2rem;
}
.my-accordion .my-list .am-list-body {
border-top: 0;
}
.my-accordion .my-list .am-list-body:after {
border-bottom: 0;
}
````
8 changes: 7 additions & 1 deletion components/accordion/demo/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const AccordionExmple = React.createClass({
<div style={{ marginTop: 10, marginBottom: 10 }}>
<Accordion defaultActiveKey="0" className="my-accordion">
<Accordion.Panel header="标题一">
<List>
<List className="my-list">
<List.Item>子内容一</List.Item>
<List.Item>子内容二</List.Item>
<List.Item>子内容三</List.Item>
Expand All @@ -39,4 +39,10 @@ ReactDOM.render(<AccordionExmple />, mountNode);
.my-accordion .pad .am-accordion-content-box {
padding: 0.2rem;
}
.my-accordion .my-list .am-list-body {
border-top: 0;
}
.my-accordion .my-list .am-list-body:after {
border-bottom: 0;
}
````
1 change: 1 addition & 0 deletions components/accordion/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
.@{accordionPrefixCls}-content-box {
font-size: @font-size-subhead;
color: @color-text-paragraph;
position: relative;
.hairline-bottom(@border-color-base);
}
&.@{accordionPrefixCls}-content-inactive {
Expand Down
2 changes: 1 addition & 1 deletion components/button/demo/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const ButtonExample = React.createClass({
<Button className="btn" icon={require('!svg-sprite!./reload.svg')}>本地图标</Button>

<div style={{ height: '0.16rem' }} />
<Button className="btn" activeStyle={false}>无点击反馈</Button>
{/* <Button className="btn" activeStyle={false}>无点击反馈</Button> */}
<Button className="btn" activeStyle={{ backgroundColor: 'red' }}>自定义点击反馈 style</Button>

<p style={{ margin: 10, color: '#999' }}>inline / small</p>
Expand Down
6 changes: 6 additions & 0 deletions components/date-picker/demo/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ let Test = React.createClass({
const { getFieldProps } = this.props.form;
return (<div>
<List
className="date-picker-list"
renderHeader={() => '选择时间'}
style={{ backgroundColor: 'white' }}
>
Expand Down Expand Up @@ -129,3 +130,8 @@ Test = createForm()(Test);

ReactDOM.render(<Test />, mountNode);
````
````css
.date-picker-list .am-list-item .am-list-line .am-list-extra {
flex-basis: initial;
}
````
5 changes: 3 additions & 2 deletions components/list-view/Indexed.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ export default class MIndexedList extends React.Component<tsPropsType, any> {
listViewPrefixCls: 'am-list-view',
};
render() {
const { prefixCls, listPrefixCls } = this.props;
const { restProps, extraProps } = handleProps(this.props, true);
return (
<IndexedList
ref="indexedList"
sectionHeaderClassName="am-indexed-list-section-header am-list-body"
sectionBodyClassName="am-indexed-list-section-body am-list-body"
sectionHeaderClassName={`${prefixCls}-section-header ${listPrefixCls}-body`}
sectionBodyClassName={`${prefixCls}-section-body ${listPrefixCls}-body`}
{...restProps}
{...extraProps}
>{this.props.children}</IndexedList>
Expand Down
3 changes: 3 additions & 0 deletions components/list-view/PropsType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ interface Props {
children?: any;
refreshControl?: any;
/** web only */
className?: string;
prefixCls?: string;
listPrefixCls?: string;
listViewPrefixCls?: string;
useZscroller?: boolean;
}

Expand Down
3 changes: 3 additions & 0 deletions components/list-view/demo/basic-sticky.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ const Demo = React.createClass({
// topOffset: -43,
// isActive: false, // 关闭 sticky 效果
}}
stickyContainerProps={{
className: 'for-stickyContainer-demo',
}}
/>
);
},
Expand Down
10 changes: 10 additions & 0 deletions components/list-view/demo/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ const NUM_SECTIONS = 5;
const NUM_ROWS_PER_SECTION = 5;
let pageIndex = 0;

function MyBody(props) {
return (
<div className="am-list-body my-body">
<span style={{ display: 'none' }}>you can custom body wrap element</span>
{props.children}
</div>
);
}

const Demo = React.createClass({
getInitialState() {
const getSectionData = (dataBlob, sectionID) => dataBlob[sectionID];
Expand Down Expand Up @@ -137,6 +146,7 @@ const Demo = React.createClass({
renderSectionHeader={(sectionData) => (
<div>{`任务 ${sectionData.split(' ')[1]}`}</div>
)}
renderBodyComponent={() => <MyBody />}
renderRow={row}
renderSeparator={separator}
className="fortest"
Expand Down
2 changes: 1 addition & 1 deletion components/list-view/demo/idxed-sticky.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const Demo = React.createClass({
dataSource={this.state.dataSource}
renderHeader={() => <span>头部内容请自定义</span>}
renderFooter={() => <span>尾部内容请自定义</span>}
renderSectionHeader={(sectionData) => (<div>{sectionData}</div>)}
renderSectionHeader={(sectionData) => (<div className="ih">{sectionData}</div>)}
renderRow={(rowData) => (<Item>{rowData}</Item>)}
className="am-list"
stickyHeader
Expand Down
2 changes: 1 addition & 1 deletion components/list-view/demo/idxed.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const Demo = React.createClass({
dataSource={this.state.dataSource}
renderHeader={() => <span>头部内容请自定义</span>}
renderFooter={() => <span>尾部内容请自定义</span>}
renderSectionHeader={(sectionData) => (<div>{sectionData}</div>)}
renderSectionHeader={(sectionData) => (<div className="ih">{sectionData}</div>)}
renderRow={(rowData) => (<Item>{rowData}</Item>)}
className="fortest"
style={{
Expand Down
11 changes: 5 additions & 6 deletions components/list-view/handleProps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ import List from '../list';
const { Item } = List;

export default function handleProps(props, isIndexed) {
let [{ renderHeader, renderFooter, renderSectionHeader, renderRow }, restProps] =
splitObject(props, ['renderHeader', 'renderFooter', 'renderSectionHeader', 'renderRow']);
let [{ renderHeader, renderFooter, renderSectionHeader, renderBodyComponent }, restProps] =
splitObject(props, ['renderHeader', 'renderFooter', 'renderSectionHeader', 'renderBodyComponent']);
const listPrefixCls = props.listPrefixCls;

const extraProps = {
renderHeader: null as any,
renderFooter: null as any,
renderSectionHeader: null as any,
renderBodyComponent: () => <div className={`${listPrefixCls}-body`} />,
renderRow,
renderBodyComponent: renderBodyComponent || (() => <div className={`${listPrefixCls}-body`} />),
};
if (renderHeader) {
extraProps.renderHeader =
Expand All @@ -28,9 +27,9 @@ export default function handleProps(props, isIndexed) {
if (renderSectionHeader) {
extraProps.renderSectionHeader = isIndexed ?
(sectionData, sectionID) => (<div>
<Item>{renderSectionHeader(sectionData, sectionID) }</Item>
<Item prefixCls={listPrefixCls}>{renderSectionHeader(sectionData, sectionID) }</Item>
</div>) :
(sectionData, sectionID) => <Item>{renderSectionHeader(sectionData, sectionID)}</Item>;
(sectionData, sectionID) => <Item prefixCls={listPrefixCls}>{renderSectionHeader(sectionData, sectionID)}</Item>;
}
return { restProps, extraProps };
}
2 changes: 1 addition & 1 deletion components/list-view/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ english: ListView
- useBodyScroll (boolean, false) - 使用 html 的 `body` 作为滚动容器
- stickyHeader (boolean, false) - 固定区块标题到页面顶部 (注意: 设置后会自动使用 html 的 `body` 作为滚动容器)
- 开启 sticky 后还可以设置 stickyProps / stickyContainerProps (详见 [react-sticky](https://github.com/captivationsoftware/react-sticky))
- renderBodyComponent (function, () => React.Element) - 渲染自定义的 body 组件
- renderBodyComponent (function, () => React.Element) - 自定义 body 的包裹组件
- renderSectionBodyWrapper (function, (sectionID: any) => React.Element) - 渲染自定义的区块包裹组件
- useZscroller (boolean, false) - 使用 zscroller 来模拟实现滚动容器 (可用于一些低端 Android 机上)
- 注意:开启后`useBodyScroll``stickyHeader`设置会自动被忽略
Expand Down
8 changes: 4 additions & 4 deletions components/popover/style/base.less
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
position: absolute;
width: @popover-arrow-width;
height: @popover-arrow-width;
border-top: @border-width-sm solid @border-color-base;
border-left: @border-width-sm solid @border-color-base;
border-bottom: 0;
border-right: 0;
// border-top: @border-width-sm solid @border-color-base;
// border-left: @border-width-sm solid @border-color-base;
// border-bottom: 0;
// border-right: 0;
background-color: @fill-base;
transform: rotate(45deg);
z-index: 0;
Expand Down
1 change: 1 addition & 0 deletions components/popover/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// border: @border-width-sm solid @border-color-base;
border-radius: @radius-sm;
box-shadow: 0 0 4px @color-shadow;
overflow: hidden; // for popover item active background color not overflow
}

.@{popoverPrefixCls} .@{popoverPrefixCls}-item {
Expand Down
21 changes: 0 additions & 21 deletions docs/pattern/container.md

This file was deleted.

33 changes: 0 additions & 33 deletions docs/pattern/corner.md

This file was deleted.

27 changes: 0 additions & 27 deletions docs/pattern/grid.md

This file was deleted.

52 changes: 0 additions & 52 deletions docs/pattern/icon.md

This file was deleted.

Loading

1 comment on commit 62f75f8

@warmhug
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以 reset 下,把这种 Merge branch 'master' of ... 的 commit 记录清理掉,不然回头查看 commit 记录不方便。 用git pull --rebase,避免这种 commit 。发版本时能 方便 查看 commit 历史记录、编写 changelog 方便,不会被这种 commit 干扰。

Please sign in to comment.