mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-23 01:45:05 +08:00
Merge branch 'master' of https://github.com/ant-design/ant-design
This commit is contained in:
commit
28db7dc37f
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 固钉
|
||||
type: Navigation
|
||||
type: 导航
|
||||
title: Affix
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 警告提示
|
||||
type: Feedback
|
||||
type: 反馈
|
||||
title: Alert
|
||||
---
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
category: Components
|
||||
subtitle: 锚点
|
||||
cols: 2
|
||||
type: Other
|
||||
type: 其他
|
||||
title: Anchor
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 自动完成
|
||||
type: Data Entry
|
||||
type: 数据录入
|
||||
cols: 2
|
||||
title: AutoComplete
|
||||
---
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 头像
|
||||
type: Data Display
|
||||
type: 数据展示
|
||||
title: Avatar
|
||||
---
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Other
|
||||
type: 其他
|
||||
subtitle: 回到顶部
|
||||
title: BackTop
|
||||
---
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 徽标数
|
||||
type: Data Display
|
||||
type: 数据展示
|
||||
title: Badge
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 面包屑
|
||||
type: Navigation
|
||||
type: 导航
|
||||
title: Breadcrumb
|
||||
---
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: General
|
||||
type: 通用
|
||||
title: Button
|
||||
subtitle: 按钮
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Data Display
|
||||
type: 数据展示
|
||||
subtitle: 日历
|
||||
cols: 1
|
||||
title: Calendar
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Data Display
|
||||
type: 数据展示
|
||||
title: Card
|
||||
subtitle: 卡片
|
||||
cols: 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Data Display
|
||||
type: 数据展示
|
||||
title: Carousel
|
||||
subtitle: 走马灯
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Data Entry
|
||||
type: 数据录入
|
||||
title: Cascader
|
||||
subtitle: 级联选择
|
||||
---
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 多选框
|
||||
type: Data Entry
|
||||
type: 数据录入
|
||||
title: Checkbox
|
||||
---
|
||||
|
||||
|
@ -11,6 +11,7 @@ export interface CollapsePanelProps {
|
||||
showArrow?: boolean;
|
||||
prefixCls?: string;
|
||||
forceRender?: boolean;
|
||||
id?: string;
|
||||
}
|
||||
|
||||
export default class CollapsePanel extends React.Component<CollapsePanelProps, {}> {
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Data Display
|
||||
type: 数据展示
|
||||
title: Collapse
|
||||
subtitle: 折叠面板
|
||||
cols: 1
|
||||
|
@ -12,28 +12,40 @@ import getDataOrAriaProps from '../_util/getDataOrAriaProps';
|
||||
|
||||
export interface PickerProps {
|
||||
value?: moment.Moment;
|
||||
open?: boolean;
|
||||
prefixCls: string;
|
||||
}
|
||||
|
||||
export interface PickerState {
|
||||
open: boolean;
|
||||
value: moment.Moment | null;
|
||||
showDate: moment.Moment | null;
|
||||
}
|
||||
|
||||
export default function createPicker(TheCalendar: React.ComponentClass): any {
|
||||
class CalenderWrapper extends React.Component<any, any> {
|
||||
class CalenderWrapper extends React.Component<any, PickerState> {
|
||||
static defaultProps = {
|
||||
prefixCls: 'ant-calendar',
|
||||
allowClear: true,
|
||||
showToday: true,
|
||||
};
|
||||
|
||||
static getDerivedStateFromProps(nextProps: PickerProps, prevState: any) {
|
||||
let state = null;
|
||||
static getDerivedStateFromProps(nextProps: PickerProps, prevState: PickerState) {
|
||||
const state: Partial<PickerState> = {};
|
||||
let open: boolean = prevState.open;
|
||||
|
||||
if ('open' in nextProps) {
|
||||
state.open = nextProps.open;
|
||||
open = nextProps.open || false;
|
||||
}
|
||||
if ('value' in nextProps) {
|
||||
state = {
|
||||
value: nextProps.value,
|
||||
};
|
||||
if (nextProps.value !== prevState.value) {
|
||||
state = {
|
||||
...state,
|
||||
showDate: nextProps.value,
|
||||
};
|
||||
state.value = nextProps.value;
|
||||
|
||||
if (
|
||||
nextProps.value !== prevState.value ||
|
||||
(!open && nextProps.value !== prevState.showDate)
|
||||
) {
|
||||
state.showDate = nextProps.value;
|
||||
}
|
||||
}
|
||||
return state;
|
||||
@ -53,6 +65,7 @@ export default function createPicker(TheCalendar: React.ComponentClass): any {
|
||||
this.state = {
|
||||
value,
|
||||
showDate: value,
|
||||
open: false,
|
||||
};
|
||||
}
|
||||
|
||||
@ -87,6 +100,17 @@ export default function createPicker(TheCalendar: React.ComponentClass): any {
|
||||
this.setState({ showDate: value });
|
||||
}
|
||||
|
||||
handleOpenChange = (open: boolean) => {
|
||||
const { onOpenChange } = this.props;
|
||||
if (!('open' in this.props)) {
|
||||
this.setState({ open });
|
||||
}
|
||||
|
||||
if (onOpenChange) {
|
||||
onOpenChange(open);
|
||||
}
|
||||
};
|
||||
|
||||
focus() {
|
||||
this.input.focus();
|
||||
}
|
||||
@ -100,7 +124,7 @@ export default function createPicker(TheCalendar: React.ComponentClass): any {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { value, showDate } = this.state;
|
||||
const { value, showDate, open } = this.state;
|
||||
const props = omit(this.props, ['onChange']);
|
||||
const { prefixCls, locale, localeCode, suffixIcon } = props;
|
||||
|
||||
@ -217,6 +241,8 @@ export default function createPicker(TheCalendar: React.ComponentClass): any {
|
||||
value={value}
|
||||
prefixCls={`${prefixCls}-picker-container`}
|
||||
style={props.popupStyle}
|
||||
open={open}
|
||||
onOpenChange={this.handleOpenChange}
|
||||
>
|
||||
{input}
|
||||
</RcDatePicker>
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Data Entry
|
||||
type: 数据录入
|
||||
title: DatePicker
|
||||
subtitle: 日期选择框
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Other
|
||||
type: 其他
|
||||
title: Divider
|
||||
subtitle: 分割线
|
||||
---
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
type: Feedback
|
||||
type: 反馈
|
||||
category: Components
|
||||
subtitle: 抽屉
|
||||
title: Drawer
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 下拉菜单
|
||||
type: Navigation
|
||||
type: 导航
|
||||
title: Dropdown
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 表单
|
||||
type: Data Entry
|
||||
type: 数据录入
|
||||
cols: 1
|
||||
title: Form
|
||||
---
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 栅格
|
||||
type: Layout
|
||||
type: 布局
|
||||
cols: 1
|
||||
title: Grid
|
||||
---
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 图标
|
||||
type: General
|
||||
type: 通用
|
||||
title: Icon
|
||||
toc: false
|
||||
---
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 数字输入框
|
||||
type: Data Entry
|
||||
type: 数据录入
|
||||
title: InputNumber
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 输入框
|
||||
type: Data Entry
|
||||
type: 数据录入
|
||||
title: Input
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 布局
|
||||
type: Layout
|
||||
type: 布局
|
||||
cols: 1
|
||||
title: Layout
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Data Display
|
||||
type: 数据展示
|
||||
title: List
|
||||
subtitle: 列表
|
||||
cols: 1
|
||||
|
@ -2,7 +2,7 @@
|
||||
category: Components
|
||||
subtitle: 国际化
|
||||
cols: 1
|
||||
type: Other
|
||||
type: 其他
|
||||
title: LocaleProvider
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 提及
|
||||
type: Data Entry
|
||||
type: 数据录入
|
||||
title: Mention
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
cols: 1
|
||||
type: Navigation
|
||||
type: 导航
|
||||
title: Menu
|
||||
subtitle: 导航菜单
|
||||
---
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 全局提示
|
||||
type: Feedback
|
||||
type: 反馈
|
||||
noinstant: true
|
||||
title: Message
|
||||
---
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
type: Feedback
|
||||
type: 反馈
|
||||
category: Components
|
||||
subtitle: 对话框
|
||||
title: Modal
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Feedback
|
||||
type: 反馈
|
||||
noinstant: true
|
||||
title: Notification
|
||||
subtitle: 通知提醒框
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 分页
|
||||
type: Navigation
|
||||
type: 导航
|
||||
title: Pagination
|
||||
cols: 1
|
||||
---
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 气泡确认框
|
||||
type: Feedback
|
||||
type: 反馈
|
||||
title: Popconfirm
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 气泡卡片
|
||||
type: Data Display
|
||||
type: 数据展示
|
||||
title: Popover
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 进度条
|
||||
type: Feedback
|
||||
type: 反馈
|
||||
title: Progress
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 单选框
|
||||
type: Data Entry
|
||||
type: 数据录入
|
||||
title: Radio
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 评分
|
||||
type: Data Entry
|
||||
type: 数据录入
|
||||
title: Rate
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 选择器
|
||||
type: Data Entry
|
||||
type: 数据录入
|
||||
title: Select
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 骨架屏
|
||||
type: Feedback
|
||||
type: 反馈
|
||||
title: Skeleton
|
||||
cols: 1
|
||||
---
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 滑动输入条
|
||||
type: Data Entry
|
||||
type: 数据录入
|
||||
title: Slider
|
||||
---
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Feedback
|
||||
type: 反馈
|
||||
title: Spin
|
||||
subtitle: 加载中
|
||||
---
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 步骤条
|
||||
type: Navigation
|
||||
type: 导航
|
||||
cols: 1
|
||||
title: Steps
|
||||
---
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 开关
|
||||
type: Data Entry
|
||||
type: 数据录入
|
||||
title: Switch
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
cols: 1
|
||||
type: Data Display
|
||||
type: 数据展示
|
||||
title: Table
|
||||
subtitle: 表格
|
||||
---
|
||||
|
@ -140,17 +140,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Repeat the class selector for prority
|
||||
// https://github.com/ant-design/ant-design/commit/55a13a11fcea23fc4b5694cad7e2c32edc9128ee#r30842052
|
||||
&.@{table-prefix-cls}-align-right.@{table-prefix-cls}-align-right {
|
||||
// https://github.com/ant-design/ant-design/issues/12650
|
||||
&.@{table-prefix-cls}-column-has-sorters,
|
||||
&.@{table-prefix-cls}-column-has-filters {
|
||||
padding-right: 30px;
|
||||
padding-right: 30px !important;
|
||||
}
|
||||
|
||||
&.@{table-prefix-cls}-column-has-sorters.@{table-prefix-cls}-column-has-filters {
|
||||
padding-right: 54px;
|
||||
}
|
||||
padding-right: 54px !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 标签页
|
||||
type: Data Display
|
||||
type: 数据展示
|
||||
title: Tabs
|
||||
cols: 1
|
||||
---
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 标签
|
||||
type: Data Display
|
||||
type: 数据展示
|
||||
title: Tag
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 时间选择框
|
||||
type: Data Entry
|
||||
type: 数据录入
|
||||
title: TimePicker
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 时间轴
|
||||
type: Data Display
|
||||
type: 数据展示
|
||||
title: Timeline
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 文字提示
|
||||
type: Data Display
|
||||
type: 数据展示
|
||||
title: Tooltip
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 穿梭框
|
||||
type: Data Entry
|
||||
type: 数据录入
|
||||
cols: 1
|
||||
title: Transfer
|
||||
---
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 树选择
|
||||
type: Data Entry
|
||||
type: 数据录入
|
||||
title: TreeSelect
|
||||
---
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Data Display
|
||||
type: 数据展示
|
||||
title: Tree
|
||||
subtitle: 树形控件
|
||||
---
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 上传
|
||||
type: Data Entry
|
||||
type: 数据录入
|
||||
title: Upload
|
||||
---
|
||||
|
||||
|
@ -31,6 +31,8 @@ Emoji | [emoji-mart](https://github.com/missive/emoji-mart)
|
||||
Split View | [react-split-pane](https://github.com/tomkp/react-split-pane)
|
||||
Image Crop | [react-image-crop](https://github.com/DominicTobias/react-image-crop)
|
||||
Trend Lines | [react-sparklines](https://github.com/borisyankov/react-sparklines)
|
||||
Formatted Input | [text-mask](https://github.com/text-mask/text-mask)
|
||||
Animation | [react-move](https://github.com/react-tools/react-move) [Ant Motion](https://motion.ant.design/components/tween-one)
|
||||
|
||||
<style>
|
||||
.markdown table td:first-child {
|
||||
|
@ -31,6 +31,8 @@ Emoji | [emoji-mart](https://github.com/missive/emoji-mart)
|
||||
分割面板 | [react-split-pane](https://github.com/tomkp/react-split-pane)
|
||||
图片裁切 | [react-image-crop](https://github.com/DominicTobias/react-image-crop)
|
||||
趋势线 | [react-sparklines](https://github.com/borisyankov/react-sparklines)
|
||||
格式化输入 | [text-mask](https://github.com/text-mask/text-mask)
|
||||
动画 | [react-move](https://github.com/react-tools/react-move) [Ant Motion](https://motion.ant.design/components/tween-one)
|
||||
|
||||
<style>
|
||||
.markdown table td:first-child {
|
||||
|
@ -71,8 +71,14 @@ module.exports = {
|
||||
'Data Entry': 3,
|
||||
'Data Display': 4,
|
||||
Feedback: 5,
|
||||
Localization: 6,
|
||||
Other: 7,
|
||||
Other: 6,
|
||||
通用: 0,
|
||||
布局: 1,
|
||||
导航: 2,
|
||||
数据录入: 3,
|
||||
数据展示: 4,
|
||||
反馈: 5,
|
||||
其他: 6,
|
||||
},
|
||||
docVersions: {
|
||||
'0.9.x': 'http://09x.ant.design',
|
||||
|
Loading…
Reference in New Issue
Block a user