From fe59d8a7f3bcb1eea5727621824d8ef0dd742cd9 Mon Sep 17 00:00:00 2001 From: kvetoslavnovak Date: Fri, 30 Sep 2016 03:48:54 +0200 Subject: [PATCH 1/7] docs: translation correction (#3232) --- components/steps/demo/simple.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/steps/demo/simple.md b/components/steps/demo/simple.md index 94b16ab46d..eddab28929 100644 --- a/components/steps/demo/simple.md +++ b/components/steps/demo/simple.md @@ -19,9 +19,9 @@ const Step = Steps.Step; ReactDOM.render( - - - + + + , mountNode); ```` From b98b2d92bf2b2cef16d29d1096204c100084d415 Mon Sep 17 00:00:00 2001 From: kvetoslavnovak Date: Fri, 30 Sep 2016 03:49:05 +0200 Subject: [PATCH 2/7] docs: Step Vertical - Translation Correction (#3233) --- components/steps/demo/vertical.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/steps/demo/vertical.md b/components/steps/demo/vertical.md index 8a27dc8b30..36f85f7354 100644 --- a/components/steps/demo/vertical.md +++ b/components/steps/demo/vertical.md @@ -19,9 +19,9 @@ const Step = Steps.Step; ReactDOM.render( - - - + + + , mountNode); ```` From 2ecb039e097522c945a89a7f3a6ff74613e2cfc0 Mon Sep 17 00:00:00 2001 From: kvetoslavnovak Date: Fri, 30 Sep 2016 03:49:17 +0200 Subject: [PATCH 3/7] docs: Step Vertical MiniVersion - Translation Correction (#3234) --- components/steps/demo/vertical-small.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/steps/demo/vertical-small.md b/components/steps/demo/vertical-small.md index c794845993..8446d52dd7 100644 --- a/components/steps/demo/vertical-small.md +++ b/components/steps/demo/vertical-small.md @@ -19,9 +19,9 @@ const Step = Steps.Step; ReactDOM.render( - - - + + + , mountNode); ```` From c8b741283e6c1be378803145a436f4e526aa896e Mon Sep 17 00:00:00 2001 From: kvetoslavnovak Date: Fri, 30 Sep 2016 03:49:28 +0200 Subject: [PATCH 4/7] docs: Step Error status - Translation Correction (#3235) --- components/steps/demo/error.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/steps/demo/error.md b/components/steps/demo/error.md index 9e1d2adf5a..eb75d968a1 100644 --- a/components/steps/demo/error.md +++ b/components/steps/demo/error.md @@ -19,9 +19,9 @@ const Step = Steps.Step; ReactDOM.render( - - - + + + , mountNode); ```` From b501a79d91b40d75069cc9fd78393518b9c26dbd Mon Sep 17 00:00:00 2001 From: feng zhi hao Date: Fri, 30 Sep 2016 09:51:55 +0800 Subject: [PATCH 5/7] docs: update README (#3238) --- README-zh_CN.md | 13 ++++++++++--- README.md | 3 ++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/README-zh_CN.md b/README-zh_CN.md index 0bd1510c06..440b6883fb 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -45,9 +45,16 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less' ## TypeScript -```js -/// -... +tsconfig.json + +``` +{ + "compilerOptions": { + "moduleResolution": "node", + "jsx": "preserve", + "allowSyntheticDefaultImports": true + } +} ``` ## 链接 diff --git a/README.md b/README.md index a45b63ae2f..e4647a4ba0 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,8 @@ tsconfig.json { "compilerOptions": { "moduleResolution": "node", - "jsx": "preserve" + "jsx": "preserve", + "allowSyntheticDefaultImports": true } } ``` From 0265cf0cb13bc5cd390931296a20056453443364 Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Fri, 30 Sep 2016 10:34:11 +0800 Subject: [PATCH 6/7] docs: update links --- components/select/demo/combobox.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/select/demo/combobox.md b/components/select/demo/combobox.md index 9570fc1f08..9573faf4e4 100644 --- a/components/select/demo/combobox.md +++ b/components/select/demo/combobox.md @@ -1,6 +1,6 @@ --- order: 4 -title: +title: zh-CN: 智能提示 en-US: Automatic completion --- @@ -9,13 +9,13 @@ title: 输入框自动完成功能,下面是一个账号注册表单的例子。 -推荐使用 [AutoComplete](/components/auto-complete) 组件。 +推荐使用 [AutoComplete](/components/auto-complete/) 组件。 ## en-US -Automatic completion of select input. +Automatic completion of select input. -Using the [AutoComplete](/components/auto-complete) component is strongly recommended instead as it is more flexible and capable. +Using the [AutoComplete](/components/auto-complete/) component is strongly recommended instead as it is more flexible and capable. ````jsx From 3513cf7a1f232a24bce1259d277e5f181580a4d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=86=E7=A6=BB?= Date: Fri, 30 Sep 2016 11:26:27 +0800 Subject: [PATCH 7/7] Mention fix (#3240) * placeholder style fix * add onSelect callback --- components/mention/demo/basic.md | 5 +++++ components/mention/demo/custom-tag.md | 5 +++++ components/mention/index.en-US.md | 2 ++ components/mention/index.tsx | 1 + components/mention/index.zh-CN.md | 2 ++ components/mention/style/index.less | 13 ++++++++++++- 6 files changed, 27 insertions(+), 1 deletion(-) diff --git a/components/mention/demo/basic.md b/components/mention/demo/basic.md index 898255811f..eb674db09a 100644 --- a/components/mention/demo/basic.md +++ b/components/mention/demo/basic.md @@ -21,12 +21,17 @@ function onChange(editorState) { console.log(toString(editorState)); } +function onSelect(suggestion) { + console.log('onSelect', suggestion); +} + ReactDOM.render( , mountNode); ```` diff --git a/components/mention/demo/custom-tag.md b/components/mention/demo/custom-tag.md index 16af74ed72..548f5e654b 100644 --- a/components/mention/demo/custom-tag.md +++ b/components/mention/demo/custom-tag.md @@ -27,6 +27,9 @@ const webFrameworks = [ { name: 'Django', type: 'Python' }, ]; +function onSelect(suggestion) { + console.log('onSelect', suggestion); +} const CustomNavMention = React.createClass({ getInitialState() { return { @@ -48,9 +51,11 @@ const CustomNavMention = React.createClass({ const { suggestions } = this.state; return ( ); }, diff --git a/components/mention/index.en-US.md b/components/mention/index.en-US.md index 632776b84c..311d5a6daa 100644 --- a/components/mention/index.en-US.md +++ b/components/mention/index.en-US.md @@ -37,12 +37,14 @@ When need to mention someone or something. | suggestionStyle | style of suggestion container | Object | {} | | onSearchChange | Callback function called when search content changes | function(value:String) | [] | | onChange | Callback function called when content of input changes | function(editorState: EditorState) | null | +| onSelect | Callback function called when select from suggestions | function(suggestion: String) | null | | notFoundContent| suggestion when suggestions empty | string | '无匹配结果,轻敲空格完成输入' | | loading | loading mode | boolean | false | | multiLines | multilines mode | boolean | false | | prefix | character which will trigger Mention to show mention list | string | '@' | | defaultValue | default value | EditorState, you can use `Mention.toEditorState` to convert text to `EditorState` | null | | value | core state of mention | EditorState | null | +| placeHolder | placeholder of input | string | null | ### Nav props diff --git a/components/mention/index.tsx b/components/mention/index.tsx index dde509af07..9a11dcc104 100644 --- a/components/mention/index.tsx +++ b/components/mention/index.tsx @@ -16,6 +16,7 @@ export interface MentionProps { className?: string; multiLines?: Boolean; prefix?: string; + placeholder?: string; } export interface MentionState { diff --git a/components/mention/index.zh-CN.md b/components/mention/index.zh-CN.md index 502c4495fa..a878d26328 100644 --- a/components/mention/index.zh-CN.md +++ b/components/mention/index.zh-CN.md @@ -37,10 +37,12 @@ title: Mention | suggestionStyle | 弹出下拉框样式 | Object | {} | | onSearchChange | 输入框中 @ 变化时回调 | function(value:String) | [] | | onChange | 输入框内容变化时回调 | function(editorState: EditorState) | null | +| onSelect | 下拉框选择建议时回调 | function(suggestion: String) | null | | notFoundContent| 未找到时的内容 | string | '无匹配结果,轻敲空格完成输入' | | loading | 加载中 | boolean | false | | multiLines | 多行模式 | boolean | false | | prefix | 触发弹出下拉框的字符 | string | '@' | +| placeHolder | 输入框默认文字 | string | null | | defaultValue | 默认值 | EditorState, 可以用 Mention.toEditorState(text) 把文字转换成 EditorState | null | | value | 值 | EditorState | null | diff --git a/components/mention/style/index.less b/components/mention/style/index.less index b59a7012be..6f16025f1a 100644 --- a/components/mention/style/index.less +++ b/components/mention/style/index.less @@ -19,7 +19,18 @@ overflow-y: auto; height: auto; } - + .public-DraftEditorPlaceholder-root { + position: absolute; + .public-DraftEditorPlaceholder-inner { + color: #ccc; + opacity: 1; + outline: none; + white-space: pre-wrap; + word-wrap: break-word; + height: auto; + padding: 4px 7px; + } + } .DraftEditor-editorContainer .public-DraftEditor-content { height: auto; padding: 4px 7px;