mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-21 16:33:27 +08:00
Merge branch 'antd-3.0' of github.com:ant-design/ant-design into antd-3.0
This commit is contained in:
commit
73000a226b
@ -1,5 +1,8 @@
|
||||
import Anchor from './Anchor';
|
||||
import AnchorLink from './AnchorLink';
|
||||
|
||||
export { AnchorProps } from './Anchor';
|
||||
export { AnchorLinkProps } from './AnchorLink';
|
||||
|
||||
Anchor.Link = AnchorLink;
|
||||
export default Anchor;
|
||||
|
@ -5,6 +5,8 @@ import ScrollNumber from './ScrollNumber';
|
||||
import classNames from 'classnames';
|
||||
import warning from '../_util/warning';
|
||||
|
||||
export { ScrollNumberProps } from './ScrollNumber';
|
||||
|
||||
export interface BadgeProps {
|
||||
/** Number to show in badge */
|
||||
count?: number | string;
|
||||
|
@ -1,5 +1,8 @@
|
||||
import Breadcrumb from './Breadcrumb';
|
||||
import BreadcrumbItem from './BreadcrumbItem';
|
||||
|
||||
export { BreadcrumbProps } from './Breadcrumb';
|
||||
export { BreadcrumbItemProps } from './BreadcrumbItem';
|
||||
|
||||
Breadcrumb.Item = BreadcrumbItem;
|
||||
export default Breadcrumb;
|
||||
|
@ -1,7 +1,6 @@
|
||||
import React from 'react';
|
||||
import classNames from 'classnames';
|
||||
|
||||
export type ButtonSize = 'small' | 'large';
|
||||
import { ButtonSize } from './button';
|
||||
|
||||
export interface ButtonGroupProps {
|
||||
size?: ButtonSize;
|
||||
|
@ -1,5 +1,8 @@
|
||||
import Button from './button';
|
||||
import ButtonGroup from './button-group';
|
||||
|
||||
export { ButtonProps, ButtonShape, ButtonSize, ButtonType } from './button';
|
||||
export { ButtonGroupProps } from './button-group';
|
||||
|
||||
Button.Group = ButtonGroup;
|
||||
export default Button;
|
||||
|
@ -7,6 +7,8 @@ import Header from './Header';
|
||||
import { getComponentLocale, getLocaleCode } from '../_util/getLocale';
|
||||
declare const require: Function;
|
||||
|
||||
export { HeaderProps } from './Header';
|
||||
|
||||
function noop() { return null; }
|
||||
|
||||
function zerofixed(v) {
|
||||
|
@ -7,6 +7,9 @@ import Meta from './Meta';
|
||||
import Tabs from '../tabs';
|
||||
import { throttleByAnimationFrameDecorator } from '../_util/throttleByAnimationFrame';
|
||||
|
||||
export { CardGridProps } from './Grid';
|
||||
export { CardMetaProps } from './Meta';
|
||||
|
||||
export type CardType = 'inner';
|
||||
|
||||
export interface CardTabListType {
|
||||
|
@ -1,5 +1,8 @@
|
||||
import Checkbox from './Checkbox';
|
||||
import Group from './Group';
|
||||
|
||||
export { CheckboxProps } from './Checkbox';
|
||||
export { CheckboxGroupProps, CheckboxOptionType } from './Group';
|
||||
|
||||
Checkbox.Group = Group;
|
||||
export default Checkbox;
|
||||
|
@ -1,2 +1,5 @@
|
||||
import { Col } from '../grid';
|
||||
import { Col, ColProps, ColSize } from '../grid';
|
||||
|
||||
export { ColProps, ColSize };
|
||||
|
||||
export default Col;
|
||||
|
@ -1,3 +1,5 @@
|
||||
import Collapse from './Collapse';
|
||||
|
||||
export { CollapsePanelProps, CollapseProps } from './Collapse';
|
||||
|
||||
export default Collapse;
|
||||
|
@ -179,6 +179,7 @@ export default class RangePicker extends React.Component<any, any> {
|
||||
disabledDate, disabledTime,
|
||||
showTime, showToday,
|
||||
ranges, onOk, locale, format,
|
||||
dateRender,
|
||||
} = props;
|
||||
warning(!('onOK' in props), 'It should be `RangePicker[onOk]`, instead of `onOK`!');
|
||||
|
||||
@ -221,6 +222,7 @@ export default class RangePicker extends React.Component<any, any> {
|
||||
dateInputPlaceholder={[startPlaceholder, endPlaceholder]}
|
||||
locale={locale.lang}
|
||||
onOk={onOk}
|
||||
dateRender={dateRender}
|
||||
value={showDate}
|
||||
onValueChange={this.handleShowDateChange}
|
||||
hoverValue={hoverValue}
|
||||
|
@ -81,6 +81,54 @@ exports[`renders ./components/date-picker/demo/basic.md correctly 1`] = `
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/date-picker/demo/date-render.md correctly 1`] = `
|
||||
<div>
|
||||
<span
|
||||
class="ant-calendar-picker"
|
||||
>
|
||||
<div>
|
||||
<input
|
||||
class="ant-calendar-picker-input ant-input"
|
||||
placeholder="请选择日期"
|
||||
readonly=""
|
||||
value=""
|
||||
/>
|
||||
<span
|
||||
class="ant-calendar-picker-icon"
|
||||
/>
|
||||
</div>
|
||||
</span>
|
||||
<span
|
||||
class="ant-calendar-picker"
|
||||
>
|
||||
<span
|
||||
class="ant-calendar-picker-input ant-input"
|
||||
>
|
||||
<input
|
||||
class="ant-calendar-range-picker-input"
|
||||
placeholder="开始日期"
|
||||
readonly=""
|
||||
value=""
|
||||
/>
|
||||
<span
|
||||
class="ant-calendar-range-picker-separator"
|
||||
>
|
||||
~
|
||||
</span>
|
||||
<input
|
||||
class="ant-calendar-range-picker-input"
|
||||
placeholder="结束日期"
|
||||
readonly=""
|
||||
value=""
|
||||
/>
|
||||
<span
|
||||
class="ant-calendar-picker-icon"
|
||||
/>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/date-picker/demo/disabled.md correctly 1`] = `
|
||||
<div>
|
||||
<span
|
||||
|
@ -115,6 +115,7 @@ export default function createPicker(TheCalendar): any {
|
||||
prefixCls={prefixCls}
|
||||
className={calendarClassName}
|
||||
onOk={props.onOk}
|
||||
dateRender={props.dateRender}
|
||||
format={props.format}
|
||||
showToday={props.showToday}
|
||||
monthCellContentRender={props.monthCellContentRender}
|
||||
|
52
components/date-picker/demo/date-render.md
Normal file
52
components/date-picker/demo/date-render.md
Normal file
@ -0,0 +1,52 @@
|
||||
---
|
||||
order: 12
|
||||
title:
|
||||
zh-CN: 定制日期单元格
|
||||
en-US: Customized Date Rendering
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
||||
使用 `dateRender` 可以自定义日期单元格的内容和样式。
|
||||
|
||||
## en-US
|
||||
|
||||
We can customize the rendering of date cells in the calendar by providing a `dateRender` function to `DatePicker`.
|
||||
|
||||
````jsx
|
||||
import { DatePicker } from 'antd';
|
||||
const { RangePicker } = DatePicker;
|
||||
|
||||
ReactDOM.render(
|
||||
<div>
|
||||
<DatePicker
|
||||
dateRender={(current) => {
|
||||
const style = {};
|
||||
if (current.date() === 1) {
|
||||
style.border = '1px solid #08c';
|
||||
style.borderRadius = '50%';
|
||||
}
|
||||
return (
|
||||
<div className="ant-calendar-date" style={style}>
|
||||
{current.date()}
|
||||
</div>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
<RangePicker
|
||||
dateRender={(current) => {
|
||||
const style = {};
|
||||
if (current.date() === 1) {
|
||||
style.border = '1px solid #08c';
|
||||
style.borderRadius = '50%';
|
||||
}
|
||||
return (
|
||||
<div className="ant-calendar-date" style={style}>
|
||||
{current.date()}
|
||||
</div>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
, mountNode);
|
||||
````
|
@ -49,6 +49,7 @@ The following APIs are shared by DatePicker, MonthPicker, RangePicker, WeekPicke
|
||||
| open | open state of picker | boolean | - |
|
||||
| onOpenChange | a callback function, can be executed whether the popup calendar is popped up or closed | function(status) | - |
|
||||
| placeholder | placeholder of date input | string\|RangePicker[] | - |
|
||||
| dateRender | custom rendering function for date cells | function(currentDate: moment, today: moment) => React.ReactNode | - |
|
||||
|
||||
### DatePicker
|
||||
|
||||
|
@ -25,6 +25,7 @@ export interface PickerProps {
|
||||
onOpenChange?: (status: boolean) => void;
|
||||
disabledDate?: (current: moment.Moment) => boolean;
|
||||
renderExtraFooter?: () => React.ReactNode;
|
||||
dateRender?: (current: moment.Moment, today: moment.Moment) => React.ReactNode;
|
||||
}
|
||||
|
||||
export interface SinglePickerProps {
|
||||
|
@ -50,6 +50,7 @@ moment.locale('zh-cn');
|
||||
| open | 控制弹层是否展开 | boolean | - |
|
||||
| onOpenChange | 弹出日历和关闭日历的回调 | function(status) | 无 |
|
||||
| placeholder | 输入框提示文字 | string\|RangePicker[] | - |
|
||||
| dateRender | 自定义日期单元格的内容 | function(currentDate: moment, today: moment) => React.ReactNode | - |
|
||||
|
||||
### DatePicker
|
||||
|
||||
|
@ -1,5 +1,8 @@
|
||||
import Dropdown from './dropdown';
|
||||
import DropdownButton from './dropdown-button';
|
||||
|
||||
export { DropDownProps } from './dropdown';
|
||||
export { DropdownButtonProps } from './dropdown-button';
|
||||
|
||||
Dropdown.Button = DropdownButton;
|
||||
export default Dropdown;
|
||||
|
@ -46,6 +46,12 @@
|
||||
box-shadow: @box-shadow-base;
|
||||
background-clip: padding-box;
|
||||
|
||||
&-item-group-title {
|
||||
color: @text-color-secondary;
|
||||
padding: 6px 8px;
|
||||
transition: all .3s;
|
||||
}
|
||||
|
||||
&-item,
|
||||
&-submenu-title {
|
||||
padding: 7px 8px;
|
||||
|
@ -1,3 +1,6 @@
|
||||
import Form from './Form';
|
||||
|
||||
export { FormProps, FormComponentProps, FormCreateOption, ValidateCallback, ValidationRule } from './Form';
|
||||
export { FormItemProps } from './FormItem';
|
||||
|
||||
export default Form;
|
||||
|
@ -519,7 +519,7 @@ form {
|
||||
border-color: @error-color;
|
||||
}
|
||||
}
|
||||
&.@{ant-prefix}-mention-active .@{ant-prefix}-mention-editor,
|
||||
&.@{ant-prefix}-mention-active:not([disabled]) .@{ant-prefix}-mention-editor,
|
||||
.@{ant-prefix}-mention-editor:not([disabled]):focus {
|
||||
.active(@error-color);
|
||||
}
|
||||
|
@ -1,6 +1,9 @@
|
||||
import Row from './row';
|
||||
import Col from './col';
|
||||
|
||||
export { RowProps } from './row';
|
||||
export { ColProps, ColSize } from './col';
|
||||
|
||||
export {
|
||||
Row,
|
||||
Col,
|
||||
|
@ -3,6 +3,11 @@ import Group from './Group';
|
||||
import Search from './Search';
|
||||
import TextArea from './TextArea';
|
||||
|
||||
export { InputProps } from './Input';
|
||||
export { GroupProps } from './Group';
|
||||
export { SearchProps } from './Search';
|
||||
export { TextAreaProps } from './TextArea';
|
||||
|
||||
Input.Group = Group;
|
||||
Input.Search = Search;
|
||||
Input.TextArea = TextArea;
|
||||
|
@ -1,5 +1,8 @@
|
||||
import Layout from './layout';
|
||||
import Sider from './Sider';
|
||||
|
||||
export { BasicProps as LayoutProps } from './layout';
|
||||
export { SiderProps } from './Sider';
|
||||
|
||||
Layout.Sider = Sider;
|
||||
export default Layout;
|
||||
|
@ -8,6 +8,8 @@ import { Row } from '../grid';
|
||||
|
||||
import Item from './Item';
|
||||
|
||||
export { ListItemProps, ListItemMetaProps } from './Item';
|
||||
|
||||
export interface ListGridType {
|
||||
gutter?: number;
|
||||
column?: 1 | 2 | 3 | 4 | 6 | 8 | 12 | 24;
|
||||
|
@ -43,7 +43,7 @@ class AsyncMention extends React.Component {
|
||||
const { suggestions, loading } = this.state;
|
||||
return (
|
||||
<Mention
|
||||
style={{ width: '100%', height: 100 }}
|
||||
style={{ width: '100%' }}
|
||||
loading={loading}
|
||||
suggestions={suggestions}
|
||||
onSearchChange={this.onSearchChange}
|
||||
|
@ -53,7 +53,7 @@ class CustomNavMention extends React.Component {
|
||||
const { suggestions } = this.state;
|
||||
return (
|
||||
<Mention
|
||||
style={{ width: '100%', height: 100 }}
|
||||
style={{ width: '100%' }}
|
||||
suggestions={suggestions}
|
||||
onSearchChange={this.onSearchChange}
|
||||
/>
|
||||
|
@ -27,7 +27,7 @@ function onSelect(suggestion) {
|
||||
|
||||
ReactDOM.render(
|
||||
<Mention
|
||||
style={{ width: '100%', height: 100 }}
|
||||
style={{ width: '100%' }}
|
||||
onChange={onChange}
|
||||
defaultValue={toContentState('@afc163')}
|
||||
suggestions={['afc163', 'benjycui', 'yiminghe', 'RaoHai', '中文', 'にほんご']}
|
||||
|
@ -65,7 +65,6 @@ class App extends React.Component {
|
||||
})(
|
||||
<Mention
|
||||
suggestions={['afc163', 'benjycui', 'yiminghe', 'RaoHai', '中文', 'にほんご']}
|
||||
style={{ height: 60 }}
|
||||
/>
|
||||
)}
|
||||
</FormItem>
|
||||
|
@ -55,7 +55,7 @@ class CustomNavMention extends React.Component {
|
||||
return (
|
||||
<Mention
|
||||
placeholder="@someone"
|
||||
style={{ width: '100%', height: 100 }}
|
||||
style={{ width: '100%' }}
|
||||
suggestions={suggestions}
|
||||
onSearchChange={this.onSearchChange}
|
||||
onSelect={onSelect}
|
||||
|
@ -45,7 +45,7 @@ class App extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<Mention
|
||||
style={{ width: '100%', height: 100 }}
|
||||
style={{ width: '100%' }}
|
||||
onChange={onChange}
|
||||
placeholder="input @ to mention people, # to mention tag"
|
||||
prefix={['@', '#']}
|
||||
|
@ -32,7 +32,7 @@ class PopoverContainer extends React.Component {
|
||||
render() {
|
||||
const mention = (
|
||||
<Mention
|
||||
style={{ width: '100%', height: 100 }}
|
||||
style={{ width: '100%' }}
|
||||
onChange={onChange}
|
||||
defaultValue={toContentState('@afc163')}
|
||||
suggestions={['afc163', 'benjycui', 'yiminghe', 'RaoHai', '中文', 'にほんご']}
|
||||
|
@ -1,7 +1,8 @@
|
||||
import Modal, { ModalFuncProps } from './Modal';
|
||||
import confirm from './confirm';
|
||||
|
||||
export { ModalFuncProps };
|
||||
export { ActionButtonProps } from './ActionButton';
|
||||
export { ModalProps, ModalFuncProps } from './Modal';
|
||||
|
||||
Modal.info = function (props: ModalFuncProps) {
|
||||
const config = {
|
||||
|
@ -1,3 +1,5 @@
|
||||
import Progress from './progress';
|
||||
|
||||
export { ProgressProps } from './progress';
|
||||
|
||||
export default Progress;
|
||||
|
@ -2,6 +2,10 @@ import Radio from './radio';
|
||||
import Group from './group';
|
||||
import Button from './radioButton';
|
||||
|
||||
export { RadioProps } from './radio';
|
||||
export { RadioGroupProps } from './group';
|
||||
export { RadioButtonProps } from './radioButton';
|
||||
|
||||
Radio.Button = Button;
|
||||
Radio.Group = Group;
|
||||
export { Button, Group };
|
||||
|
@ -1,2 +1,4 @@
|
||||
import { Row } from '../grid';
|
||||
import { Row, RowProps } from '../grid';
|
||||
|
||||
export { RowProps };
|
||||
export default Row;
|
||||
|
@ -1,3 +1,11 @@
|
||||
import Table from './Table';
|
||||
|
||||
export { ColumnProps } from './Column';
|
||||
export { ColumnGroupProps } from './ColumnGroup';
|
||||
export { FilterMenuProps } from './filterDropdown';
|
||||
export { FilterDropdownMenuWrapperProps } from './FilterDropdownMenuWrapper';
|
||||
export { SelectionBoxProps } from './SelectionBox';
|
||||
export { SelectionCheckboxAllProps } from './SelectionCheckboxAll';
|
||||
export { TableProps, TableRowSelection, TableColumnConfig } from './Table';
|
||||
|
||||
export default Table;
|
||||
|
@ -297,7 +297,6 @@
|
||||
margin-left: 4px;
|
||||
display: inline-block;
|
||||
width: 14px;
|
||||
height: 1em;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
|
||||
@ -306,6 +305,7 @@
|
||||
line-height: 4px;
|
||||
display: block;
|
||||
width: 14px;
|
||||
height: 6px;
|
||||
cursor: pointer;
|
||||
&:hover .@{iconfont-css-prefix} {
|
||||
color: @text-color;
|
||||
|
@ -6,6 +6,8 @@ import omit from 'omit.js';
|
||||
import Icon from '../icon';
|
||||
import CheckableTag from './CheckableTag';
|
||||
|
||||
export { CheckableTagProps } from './CheckableTag';
|
||||
|
||||
export interface TagProps {
|
||||
prefixCls?: string;
|
||||
className?: string;
|
||||
|
@ -1,3 +1,6 @@
|
||||
import Timeline from './Timeline';
|
||||
|
||||
export { TimelineProps } from './Timeline';
|
||||
export { TimeLineItemProps } from './TimelineItem';
|
||||
|
||||
export default Timeline;
|
||||
|
@ -2,7 +2,9 @@ import React from 'react';
|
||||
import { cloneElement } from 'react';
|
||||
import RcTooltip from 'rc-tooltip';
|
||||
import classNames from 'classnames';
|
||||
import getPlacements, { AdjustOverflow } from './placements';
|
||||
import getPlacements, { AdjustOverflow, PlacementsConfig } from './placements';
|
||||
|
||||
export { AdjustOverflow, PlacementsConfig };
|
||||
|
||||
export type TooltipPlacement =
|
||||
'top' | 'left' | 'right' | 'bottom' |
|
||||
|
@ -6,6 +6,10 @@ import Operation from './operation';
|
||||
import Search from './search';
|
||||
import injectLocale from '../locale-provider/injectLocale';
|
||||
|
||||
export { TransferListProps } from './list';
|
||||
export { TransferOperationProps } from './operation';
|
||||
export { SearchProps } from './search';
|
||||
|
||||
function noop() {
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,7 @@ import { TreeSelectProps } from './interface';
|
||||
import injectLocale from '../locale-provider/injectLocale';
|
||||
import warning from '../_util/warning';
|
||||
|
||||
export { TreeSelectProps };
|
||||
export { TreeData, TreeSelectProps } from './interface';
|
||||
|
||||
abstract class TreeSelect extends React.Component<TreeSelectProps, any> {
|
||||
static TreeNode = TreeNode;
|
||||
|
@ -1,5 +1,8 @@
|
||||
import Upload from './Upload';
|
||||
import Dragger from './Dragger';
|
||||
|
||||
export { UploadProps, UploadListProps, UploadChangeParam } from './interface';
|
||||
export { DraggerProps } from './Dragger';
|
||||
|
||||
Upload.Dragger = Dragger;
|
||||
export default Upload;
|
||||
|
Loading…
Reference in New Issue
Block a user