From bd657ac147378d0dba4716393c20303ba4cd7dd8 Mon Sep 17 00:00:00 2001 From: "Sharma, Amit" Date: Fri, 9 Feb 2018 22:54:42 +0100 Subject: [PATCH 01/32] Changing the default language to English --- src/locale/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/locale/index.js b/src/locale/index.js index d7d536c36..5d71aea7b 100644 --- a/src/locale/index.js +++ b/src/locale/index.js @@ -1,5 +1,5 @@ import format from './format'; -import defaultLang from './lang/zh-CN'; +import defaultLang from './lang/en'; let _lang = defaultLang From 5419d7896e0c8c0b32205fad8f45fe6c477025dc Mon Sep 17 00:00:00 2001 From: "Sharma, Amit" Date: Sat, 10 Feb 2018 21:35:44 +0100 Subject: [PATCH 02/32] Fix the package.json --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index e773d31e7..16e718481 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "element-react", - "version": "1.4.5", + "name": "element-react-ui-components", + "version": "0.0.1", "description": "Element UI for React", "private": false, "main": "dist/npm/es5/index.js", From eea5bd65b9311ca2c2ea8e50915a59dec70a63e5 Mon Sep 17 00:00:00 2001 From: "Sharma, Amit" Date: Fri, 23 Feb 2018 09:26:01 +0100 Subject: [PATCH 03/32] Update the package.json --- package.json | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 16e718481..cec211ee3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "element-react-ui-components", - "version": "0.0.1", - "description": "Element UI for React", + "version": "0.0.2", + "description": "Element UI components for React", "private": false, "main": "dist/npm/es5/index.js", "jsnext:main": "next.js", @@ -18,19 +18,16 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/eleme/element-react.git" + "url": "https://github.com/amittkSharma/element-react" }, "keywords": [ "Element", "UI", "React" ], - "author": "ELEME Inc", + "author": "Amitt K Sharma", "license": "MIT", - "bugs": { - "url": "https://github.com/eleme/element-react/issues" - }, - "homepage": "https://github.com/eleme/element-react", + "homepage": "https://github.com/amittkSharma/element-react", "devDependencies": { "@types/react": "^15.6.7", "babel-cli": "^6.26.0", @@ -71,7 +68,7 @@ "sass-loader": "^6.0.5", "sinon": "^4.0.2", "style-loader": "^0.19.0", - "typescript": "^2.6.1", + "typescript": "2.7.2", "url-loader": "^0.6.2", "webpack": "^3.8.1", "webpack-dev-server": "^2.9.4" From 3613705990267d4a187d45cc421b9aac36b301ba Mon Sep 17 00:00:00 2001 From: "Sharma, Amit" Date: Mon, 12 Mar 2018 11:04:39 +0100 Subject: [PATCH 04/32] Fix layout typings --- typings/index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/typings/index.d.ts b/typings/index.d.ts index 3e67bbe85..7edeb9ecc 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -151,6 +151,7 @@ declare namespace ElementReact { type?: 'flex' justify?: 'start' | 'end' | 'center' | 'space-around' | 'space-between' align?: 'top' | 'middle' | 'bottom' + tag?: string } class Row extends ElementReactLibs.Component { } interface ColProps extends ElementReactLibs.ComponentProps<{}> { @@ -163,6 +164,7 @@ declare namespace ElementReact { sm?: number | string | Object md?: number | string | Object lg?: number | string | Object + tag?: string } class Col extends ElementReactLibs.Component { } export const Layout: { @@ -963,7 +965,7 @@ declare namespace ElementReact { } declare namespace ElementReactLibs { - type dateType = Date | string | null + type dateType = Date | string | null type SelectionMode = 'year' | 'month' | 'week' | 'day' interface ComponentProps { className?: string From 21155f349068bd1f8bcf5d292c31ea5eeaf5e1b0 Mon Sep 17 00:00:00 2001 From: "Sharma, Amit" Date: Mon, 12 Mar 2018 11:16:17 +0100 Subject: [PATCH 05/32] fix: Message typing --- typings/index.d.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/typings/index.d.ts b/typings/index.d.ts index 7edeb9ecc..e7a9eb610 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -183,7 +183,7 @@ declare namespace ElementReact { // Message type Message = any interface MessageOptions { - message: string + message: string | React.ReactElement type?: typeColor | 'error' iconClass?: string customClass?: string @@ -206,7 +206,7 @@ declare namespace ElementReact { modal?: 'alert' | 'confirm' | 'prompt' type?: typeColor | 'error' title?: string - message?: string + message?: string | React.ReactElement showInput?: boolean showClose?: boolean showCancelButton?: boolean @@ -219,6 +219,10 @@ declare namespace ElementReact { inputPattern?: RegExp inputValidator?(): string | boolean inputErrorMessage?: string + inputValue?: string + inputType?: string + promise?: Object + onClose?: void } export const MessageBox: { alert(message: string, props?: NextOptions): Promise From 38a357bde844917ec16583f30b8e8dab3401e38c Mon Sep 17 00:00:00 2001 From: "Sharma, Amit" Date: Mon, 12 Mar 2018 11:37:39 +0100 Subject: [PATCH 06/32] fix: radio typings --- README.md | 2 +- site/docs/en-US/radio.md | 11 +++++++++-- src/radio/Radio.jsx | 7 +++++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5ebe2cfe6..5c60ea1f7 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ module.exports = { src: 'path/to/src' }, output: { - path: 'path/to/output' + path: 'path/to/output', publicPath: '/public', chunkFilename: '[chunkhash:12].js', filename: '[chunkhash:12].js' diff --git a/site/docs/en-US/radio.md b/site/docs/en-US/radio.md index fdbf4c855..d63d1198d 100644 --- a/site/docs/en-US/radio.md +++ b/site/docs/en-US/radio.md @@ -133,9 +133,16 @@ render() { Attribute | Description | Type | Accepted Values | Default ---- | ---- | ---- | ---- | ---- checked | checked state of radio | boolean | — | false -label | the value of radio | string/number/boolean | — | — +value | the value of radio | string/number/boolean | — | — disabled | whether radio is disabled | boolean | — | false -name | native 'name' attribute | string | — | — +name | native 'name' attribute | string | — | — + +### Radio Events + +| Event Name | Description | Parameters | +--- | --- | --- +onChange | triggers when the bound value changes | the label value of the chosen radio | value + ### Radio-group Attributes diff --git a/src/radio/Radio.jsx b/src/radio/Radio.jsx index fc14fc7f3..7636df6bb 100644 --- a/src/radio/Radio.jsx +++ b/src/radio/Radio.jsx @@ -59,7 +59,7 @@ export default class Radio extends Component { render(): React.Element { const { checked, focus } = this.state; - const { disabled, value, children } = this.props; + const { disabled, value, children, name } = this.props; return (