mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 20:49:53 +08:00
Merge branch 'master' of github.com:ant-design/ant-design
This commit is contained in:
commit
3b08a6479c
@ -12,7 +12,7 @@
|
||||
"newlineAfterBlock": false,
|
||||
"maxCharPerLine": false,
|
||||
"excludedFiles": [
|
||||
"components/layout/style/mixin.less",
|
||||
"components/grid/style/mixin.less",
|
||||
"components/style/core/base.less",
|
||||
"components/style/core/iconfont.less",
|
||||
"components/style/core/normalize.less",
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Other
|
||||
type: Navigation
|
||||
title: Affix
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 固钉
|
||||
type: Other
|
||||
type: Navigation
|
||||
title: Affix
|
||||
---
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Views
|
||||
type: Feedback
|
||||
title: Alert
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 警告提示
|
||||
type: Views
|
||||
type: Feedback
|
||||
title: Alert
|
||||
---
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Form Controls
|
||||
type: Data Entry
|
||||
cols: 1
|
||||
title: AutoComplete
|
||||
---
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 自动完成
|
||||
type: Form Controls
|
||||
type: Data Entry
|
||||
cols: 1
|
||||
title: AutoComplete
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Other
|
||||
type: Navigation
|
||||
title: BackTop
|
||||
---
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Other
|
||||
type: Navigation
|
||||
subtitle: 回到顶部
|
||||
title: BackTop
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Views
|
||||
type: Data Display
|
||||
title: Badge
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 徽标数
|
||||
type: Views
|
||||
type: Data Display
|
||||
title: Badge
|
||||
---
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Basic
|
||||
type: General
|
||||
title: Button
|
||||
---
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Basic
|
||||
type: General
|
||||
title: Button
|
||||
subtitle: 按钮
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Views
|
||||
type: Data Display
|
||||
cols: 1
|
||||
title: Calendar
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Views
|
||||
type: Data Display
|
||||
subtitle: 日历
|
||||
cols: 1
|
||||
title: Calendar
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Views
|
||||
type: Data Display
|
||||
title: Card
|
||||
cols: 1
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Views
|
||||
type: Data Display
|
||||
title: Card
|
||||
subtitle: 卡片
|
||||
cols: 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Views
|
||||
type: Data Display
|
||||
title: Carousel
|
||||
---
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Views
|
||||
type: Data Display
|
||||
title: Carousel
|
||||
subtitle: 走马灯
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Form Controls
|
||||
type: Data Entry
|
||||
title: Cascader
|
||||
---
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Form Controls
|
||||
type: Data Entry
|
||||
title: Cascader
|
||||
subtitle: 级联选择
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Form Controls
|
||||
type: Data Entry
|
||||
title: Checkbox
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 多选框
|
||||
type: Form Controls
|
||||
type: Data Entry
|
||||
title: Checkbox
|
||||
---
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
import { Col } from '../layout';
|
||||
import { Col } from '../grid';
|
||||
export default Col;
|
||||
|
@ -1,2 +1,2 @@
|
||||
import '../../style/index.less';
|
||||
import '../../layout/style/index.less';
|
||||
import '../../grid/style/index.less';
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Views
|
||||
type: Data Display
|
||||
title: Collapse
|
||||
cols: 1
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Views
|
||||
type: Data Display
|
||||
title: Collapse
|
||||
subtitle: 折叠面板
|
||||
cols: 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Form Controls
|
||||
type: Data Entry
|
||||
title: DatePicker
|
||||
---
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Form Controls
|
||||
type: Data Entry
|
||||
title: DatePicker
|
||||
subtitle: 日期选择框
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Views
|
||||
type: Navigation
|
||||
title: Dropdown
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 下拉菜单
|
||||
type: Views
|
||||
type: Navigation
|
||||
title: Dropdown
|
||||
---
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Form Controls
|
||||
type: Data Entry
|
||||
cols: 1
|
||||
title: Form
|
||||
---
|
||||
@ -75,11 +75,10 @@ If the form has been decorated by `Form.create` then it has `this.props.form` pr
|
||||
|
||||
### this.props.form.getFieldDecorator(id, options)
|
||||
|
||||
After wrapped by `getFieldDecorator`, `value` `onChange` props will be added to form controls,the flow of form data will be handled by Form which will cause:
|
||||
After wrapped by `getFieldDecorator`, `value`(or other property defined by `valuePropName`) `onChange`(or other property defined by `trigger`) props will be added to form controls,the flow of form data will be handled by Form which will cause:
|
||||
|
||||
|
||||
1. You don't need to use `onChange` and should not add `value` `onChange` to controls. (There are warnings after `antd@2.0`)
|
||||
2. You can not set default value via `defaultValue` prop, you should use `initialValue` in `getFieldDecorator` instead.
|
||||
1. You don't need to use `onChange` to collect data, but you still can listen to `onChange`(and so on) events.
|
||||
2. You can not set value of form control via `value` `defaultValue` prop, and you should set default value with `initialValue` in `getFieldDecorator` instead.
|
||||
3. You don't need to call `setState` manully, please use `this.props.form.setFieldsValue` to change value programmatically.
|
||||
|
||||
#### Special attention
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 表单
|
||||
type: Form Controls
|
||||
type: Data Entry
|
||||
cols: 1
|
||||
title: Form
|
||||
---
|
||||
@ -77,10 +77,10 @@ CustomizedForm = Form.create({})(CustomizedForm);
|
||||
|
||||
### this.props.form.getFieldDecorator(id, options)
|
||||
|
||||
经过 `getFieldDecorator` 包装的控件,表单控件会自动添加 `value` `onChange` 等属性,数据同步将被 Form 接管,这会导致以下结果:
|
||||
经过 `getFieldDecorator` 包装的控件,表单控件会自动添加 `value`(或 `valuePropName` 指定的其他属性) `onChange`(或 `trigger` 指定的其他属性),数据同步将被 Form 接管,这会导致以下结果:
|
||||
|
||||
1. 你不再需要用 `onChange` 来做同步,也不应该给控件单独添加 `value` `onChange` 等属性。(2.0 后会在控制台进行警告)
|
||||
2. 你不能用控件的 `defaultValue` 属性来设置默认值,请用 `getFieldDecorator` 里的 `initialValue`。
|
||||
1. 你不再需要用 `onChange` 来做同步,但还是可以继续监听 `onChange` 等事件。
|
||||
2. 你不能用控件的 `value` `defaultValue` 等属性来设置表单域的值,默认值可以用 `getFieldDecorator` 里的 `initialValue`。
|
||||
3. 你不需要用 `setState`,可以使用 `this.props.form.setFieldsValue` 来动态改变表单值。
|
||||
|
||||
#### 特别注意
|
||||
|
@ -2,7 +2,7 @@
|
||||
@import "../../style/mixins/index";
|
||||
@import "../../input/style/mixin";
|
||||
@import "../../button/style/mixin";
|
||||
@import "../../layout/style/mixin";
|
||||
@import "../../grid/style/mixin";
|
||||
@import "./mixin";
|
||||
|
||||
@form-prefix-cls: ~"@{ant-prefix}-form";
|
||||
|
@ -2,4 +2,4 @@ import '../../style/index.less';
|
||||
import './index.less';
|
||||
|
||||
// style dependencies
|
||||
import '../../layout/style';
|
||||
import '../../grid/style';
|
||||
|
@ -1,15 +1,15 @@
|
||||
---
|
||||
category: Components
|
||||
type: Basic
|
||||
type: Layout
|
||||
cols: 1
|
||||
title: Layout
|
||||
title: Grid
|
||||
---
|
||||
|
||||
24 Grids System。
|
||||
|
||||
## Design concept
|
||||
|
||||
<div class="layout-demo">
|
||||
<div class="grid-demo">
|
||||
<div class="ant-row demo-row">
|
||||
<div class="ant-col-24 demo-col demo-col-1">
|
||||
100%
|
@ -1,16 +1,16 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 栅格
|
||||
type: Basic
|
||||
type: Layout
|
||||
cols: 1
|
||||
title: Layout
|
||||
title: Grid
|
||||
---
|
||||
|
||||
24 栅格系统。
|
||||
|
||||
## 设计理念
|
||||
|
||||
<div class="layout-demo">
|
||||
<div class="grid-demo">
|
||||
<div class="ant-row demo-row">
|
||||
<div class="ant-col-24 demo-col demo-col-1">
|
||||
100%
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Basic
|
||||
type: General
|
||||
title: Icon
|
||||
toc: false
|
||||
---
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 图标
|
||||
type: Basic
|
||||
type: General
|
||||
title: Icon
|
||||
toc: false
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Form Controls
|
||||
type: Data Entry
|
||||
title: InputNumber
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 数字输入框
|
||||
type: Form Controls
|
||||
type: Data Entry
|
||||
title: InputNumber
|
||||
---
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Form Controls
|
||||
type: Data Entry
|
||||
title: Input
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 输入框
|
||||
type: Form Controls
|
||||
type: Data Entry
|
||||
title: Input
|
||||
---
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Other
|
||||
type: Localization
|
||||
cols: 1
|
||||
title: LocaleProvider
|
||||
---
|
||||
|
@ -2,7 +2,7 @@
|
||||
category: Components
|
||||
subtitle: 国际化
|
||||
cols: 1
|
||||
type: Other
|
||||
type: Localization
|
||||
title: LocaleProvider
|
||||
---
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Views
|
||||
type: Data Entry
|
||||
title: Mention
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 提及
|
||||
type: Views
|
||||
type: Data Entry
|
||||
title: Mention
|
||||
---
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Views
|
||||
type: Feedback
|
||||
noinstant: true
|
||||
title: Message
|
||||
---
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 全局提示
|
||||
type: Views
|
||||
type: Feedback
|
||||
noinstant: true
|
||||
title: Message
|
||||
---
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
type: Views
|
||||
type: Feedback
|
||||
category: Components
|
||||
title: Modal
|
||||
---
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
type: Views
|
||||
type: Feedback
|
||||
category: Components
|
||||
subtitle: 对话框
|
||||
title: Modal
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Views
|
||||
type: Feedback
|
||||
noinstant: true
|
||||
title: Notification
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Views
|
||||
type: Feedback
|
||||
noinstant: true
|
||||
title: Notification
|
||||
subtitle: 通知提醒框
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Views
|
||||
type: Feedback
|
||||
title: Popconfirm
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 气泡确认框
|
||||
type: Views
|
||||
type: Feedback
|
||||
title: Popconfirm
|
||||
---
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Views
|
||||
type: Data Display
|
||||
title: Popover
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 气泡卡片
|
||||
type: Views
|
||||
type: Data Display
|
||||
title: Popover
|
||||
---
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Views
|
||||
type: Feedback
|
||||
title: Progress
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 进度条
|
||||
type: Views
|
||||
type: Feedback
|
||||
title: Progress
|
||||
---
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Form Controls
|
||||
type: Data Entry
|
||||
title: Radio
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 单选框
|
||||
type: Form Controls
|
||||
type: Data Entry
|
||||
title: Radio
|
||||
---
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Form Controls
|
||||
type: Data Entry
|
||||
title: Rate
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 评分
|
||||
type: Form Controls
|
||||
type: Data Entry
|
||||
title: Rate
|
||||
---
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
import { Row } from '../layout';
|
||||
import { Row } from '../grid';
|
||||
export default Row;
|
||||
|
@ -1,2 +1,2 @@
|
||||
import '../../style/index.less';
|
||||
import '../../layout/style/index.less';
|
||||
import '../../grid/style/index.less';
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Form Controls
|
||||
type: Data Entry
|
||||
title: Select
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 选择器
|
||||
type: Form Controls
|
||||
type: Data Entry
|
||||
title: Select
|
||||
---
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Form Controls
|
||||
type: Data Entry
|
||||
title: Slider
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 滑动输入条
|
||||
type: Form Controls
|
||||
type: Data Entry
|
||||
title: Slider
|
||||
---
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Other
|
||||
type: Feedback
|
||||
title: Spin
|
||||
---
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Other
|
||||
type: Feedback
|
||||
title: Spin
|
||||
subtitle: 加载中
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Form Controls
|
||||
type: Data Entry
|
||||
title: Switch
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 开关
|
||||
type: Form Controls
|
||||
type: Data Entry
|
||||
title: Switch
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
cols: 1
|
||||
type: Views
|
||||
type: Data Display
|
||||
title: Table
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
cols: 1
|
||||
type: Views
|
||||
type: Data Display
|
||||
title: Table
|
||||
subtitle: 表格
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Views
|
||||
type: Data Display
|
||||
title: Tag
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 标签
|
||||
type: Views
|
||||
type: Data Display
|
||||
title: Tag
|
||||
---
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Form Controls
|
||||
type: Data Entry
|
||||
title: TimePicker
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 时间选择框
|
||||
type: Form Controls
|
||||
type: Data Entry
|
||||
title: TimePicker
|
||||
---
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Views
|
||||
type: Data Display
|
||||
title: Timeline
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 时间轴
|
||||
type: Views
|
||||
type: Data Display
|
||||
title: Timeline
|
||||
---
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Views
|
||||
type: Data Display
|
||||
title: Tooltip
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 文字提示
|
||||
type: Views
|
||||
type: Data Display
|
||||
title: Tooltip
|
||||
---
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Form Controls
|
||||
type: Data Entry
|
||||
cols: 1
|
||||
title: Transfer
|
||||
---
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 穿梭框
|
||||
type: Form Controls
|
||||
type: Data Entry
|
||||
cols: 1
|
||||
title: Transfer
|
||||
---
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user