{"action":"created","comment":{"url":"https://api.github.com/repos/KleeGroup/focus-components/pulls/comments/38879891","id":38879891,"diff_hunk":"@@ -0,0 +1,80 @@\n+const React = require('react');\n+const {builder, types} = require('focus').component;\n+const i18nBehaviour = require('../../i18n/mixin');\n+const fieldGridBehaviourMixin = require('../../mixin/field-grid-behaviour');\n+const mdlBehaviour = require('../../mixin/mdl-behaviour');\n+const {isUndefined} = require('lodash/lang');\n+\n+const radioMixin = {\n+    mixins: [i18nBehaviour, fieldGridBehaviourMixin, mdlBehaviour],\n+    /**\n+    * Tag name.\n+    */\n+    displayName: 'input-radio',\n+\n+    /** @inheritdoc */\n+    getDefaultProps() {\n+        return {\n+            value: false\n+        };\n+    },\n+    /**\n+    * Properties validation.\n+    * @type {Object}\n+    */\n+    propTypes: {\n+        label: types('string').isRequired,\n+        name: types('string'),\n+        value: types('bool'),\n+        onChange: types('func')\n+    },\n+    /** @inheritdoc */\n+    componentWillReceiveProps(newProps) {\n+        this.setState({isChecked: newProps.value});\n+    },\n+    /** @inheritDoc */\n+    getInitialState() {\n+        const {value} = this.props;\n+        return {\n+            isChecked: isUndefined(value) ? false : value\n+        };\n+    },\n+    /**\n+    * Executed actions on change event.\n+    * @param  {event} event\n+    */\n+    _onChange() {\n+        this.setState({\n+            isChecked: !this.state.isChecked\n+        }, () => {\n+            if(this.props.onChange) {\n+                this.props.onChange(this.state.isChecked);\n+            }\n+        });\n+    },\n+    /**\n+    * Get the value from the input in  the DOM.\n+    * @returns The DOM node value.\n+    */\n+    getValue() {\n+        return this.state.isChecked;\n+    },\n+    /**\n+    * Render the Checkbox HTML.\n+    * @return {VirtualDOM} - The virtual DOM of the checkbox.\n+    */\n+    render() {\n+        const {isChecked} = this.state;\n+        const {label, name} = this.props;\n+        const checkedProps = isChecked ? {checked: 'checked'} : {};\n+        const inputProps = {...{className: 'mdl-radio__button', name: name, onChange: this._onChange, type: 'radio'}, ...checkedProps};","path":"src/common/input/radio/index.js","position":70,"original_position":70,"commit_id":"4943180cddf05d031bc45ba999de60a0e32c1c70","original_commit_id":"4943180cddf05d031bc45ba999de60a0e32c1c70","user":{"login":"pierr","id":286966,"avatar_url":"https://avatars.githubusercontent.com/u/286966?v=3","gravatar_id":"","url":"https://api.github.com/users/pierr","html_url":"https://github.com/pierr","followers_url":"https://api.github.com/users/pierr/followers","following_url":"https://api.github.com/users/pierr/following{/other_user}","gists_url":"https://api.github.com/users/pierr/gists{/gist_id}","starred_url":"https://api.github.com/users/pierr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pierr/subscriptions","organizations_url":"https://api.github.com/users/pierr/orgs","repos_url":"https://api.github.com/users/pierr/repos","events_url":"https://api.github.com/users/pierr/events{/privacy}","received_events_url":"https://api.github.com/users/pierr/received_events","type":"User","site_admin":false},"body":"Add a comment to explain why you did it.\r\n","created_at":"2015-09-07T21:11:09Z","updated_at":"2015-09-07T21:11:09Z","html_url":"https://github.com/KleeGroup/focus-components/pull/268#discussion_r38879891","pull_request_url":"https://api.github.com/repos/KleeGroup/focus-components/pulls/268","_links":{"self":{"href":"https://api.github.com/repos/KleeGroup/focus-components/pulls/comments/38879891"},"html":{"href":"https://github.com/KleeGroup/focus-components/pull/268#discussion_r38879891"},"pull_request":{"href":"https://api.github.com/repos/KleeGroup/focus-components/pulls/268"}}},"pull_request":{"url":"https://api.github.com/repos/KleeGroup/focus-components/pulls/268","id":44379075,"html_url":"https://github.com/KleeGroup/focus-components/pull/268","diff_url":"https://github.com/KleeGroup/focus-components/pull/268.diff","patch_url":"https://github.com/KleeGroup/focus-components/pull/268.patch","issue_url":"https://api.github.com/repos/KleeGroup/focus-components/issues/268","number":268,"state":"open","locked":false,"title":"[select-radio] refactor component for MDL","user":{"login":"Tommass","id":5349745,"avatar_url":"https://avatars.githubusercontent.com/u/5349745?v=3","gravatar_id":"","url":"https://api.github.com/users/Tommass","html_url":"https://github.com/Tommass","followers_url":"https://api.github.com/users/Tommass/followers","following_url":"https://api.github.com/users/Tommass/following{/other_user}","gists_url":"https://api.github.com/users/Tommass/gists{/gist_id}","starred_url":"https://api.github.com/users/Tommass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tommass/subscriptions","organizations_url":"https://api.github.com/users/Tommass/orgs","repos_url":"https://api.github.com/users/Tommass/repos","events_url":"https://api.github.com/users/Tommass/events{/privacy}","received_events_url":"https://api.github.com/users/Tommass/received_events","type":"User","site_admin":false},"body":"![giphy](https://cloud.githubusercontent.com/assets/5349745/9722782/5328906c-55b4-11e5-8402-0a821b500910.gif)\r\n","created_at":"2015-09-07T21:01:20Z","updated_at":"2015-09-07T21:11:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0d2b2493f102e4083207cce02bd3fb715fd9642b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/KleeGroup/focus-components/pulls/268/commits","review_comments_url":"https://api.github.com/repos/KleeGroup/focus-components/pulls/268/comments","review_comment_url":"https://api.github.com/repos/KleeGroup/focus-components/pulls/comments{/number}","comments_url":"https://api.github.com/repos/KleeGroup/focus-components/issues/268/comments","statuses_url":"https://api.github.com/repos/KleeGroup/focus-components/statuses/4943180cddf05d031bc45ba999de60a0e32c1c70","head":{"label":"KleeGroup:feature-material-radio","ref":"feature-material-radio","sha":"4943180cddf05d031bc45ba999de60a0e32c1c70","user":{"login":"KleeGroup","id":6595223,"avatar_url":"https://avatars.githubusercontent.com/u/6595223?v=3","gravatar_id":"","url":"https://api.github.com/users/KleeGroup","html_url":"https://github.com/KleeGroup","followers_url":"https://api.github.com/users/KleeGroup/followers","following_url":"https://api.github.com/users/KleeGroup/following{/other_user}","gists_url":"https://api.github.com/users/KleeGroup/gists{/gist_id}","starred_url":"https://api.github.com/users/KleeGroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KleeGroup/subscriptions","organizations_url":"https://api.github.com/users/KleeGroup/orgs","repos_url":"https://api.github.com/users/KleeGroup/repos","events_url":"https://api.github.com/users/KleeGroup/events{/privacy}","received_events_url":"https://api.github.com/users/KleeGroup/received_events","type":"Organization","site_admin":false},"repo":{"id":31018716,"name":"focus-components","full_name":"KleeGroup/focus-components","owner":{"login":"KleeGroup","id":6595223,"avatar_url":"https://avatars.githubusercontent.com/u/6595223?v=3","gravatar_id":"","url":"https://api.github.com/users/KleeGroup","html_url":"https://github.com/KleeGroup","followers_url":"https://api.github.com/users/KleeGroup/followers","following_url":"https://api.github.com/users/KleeGroup/following{/other_user}","gists_url":"https://api.github.com/users/KleeGroup/gists{/gist_id}","starred_url":"https://api.github.com/users/KleeGroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KleeGroup/subscriptions","organizations_url":"https://api.github.com/users/KleeGroup/orgs","repos_url":"https://api.github.com/users/KleeGroup/repos","events_url":"https://api.github.com/users/KleeGroup/events{/privacy}","received_events_url":"https://api.github.com/users/KleeGroup/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/KleeGroup/focus-components","description":"Components for focus application.","fork":false,"url":"https://api.github.com/repos/KleeGroup/focus-components","forks_url":"https://api.github.com/repos/KleeGroup/focus-components/forks","keys_url":"https://api.github.com/repos/KleeGroup/focus-components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KleeGroup/focus-components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KleeGroup/focus-components/teams","hooks_url":"https://api.github.com/repos/KleeGroup/focus-components/hooks","issue_events_url":"https://api.github.com/repos/KleeGroup/focus-components/issues/events{/number}","events_url":"https://api.github.com/repos/KleeGroup/focus-components/events","assignees_url":"https://api.github.com/repos/KleeGroup/focus-components/assignees{/user}","branches_url":"https://api.github.com/repos/KleeGroup/focus-components/branches{/branch}","tags_url":"https://api.github.com/repos/KleeGroup/focus-components/tags","blobs_url":"https://api.github.com/repos/KleeGroup/focus-components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KleeGroup/focus-components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KleeGroup/focus-components/git/refs{/sha}","trees_url":"https://api.github.com/repos/KleeGroup/focus-components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KleeGroup/focus-components/statuses/{sha}","languages_url":"https://api.github.com/repos/KleeGroup/focus-components/languages","stargazers_url":"https://api.github.com/repos/KleeGroup/focus-components/stargazers","contributors_url":"https://api.github.com/repos/KleeGroup/focus-components/contributors","subscribers_url":"https://api.github.com/repos/KleeGroup/focus-components/subscribers","subscription_url":"https://api.github.com/repos/KleeGroup/focus-components/subscription","commits_url":"https://api.github.com/repos/KleeGroup/focus-components/commits{/sha}","git_commits_url":"https://api.github.com/repos/KleeGroup/focus-components/git/commits{/sha}","comments_url":"https://api.github.com/repos/KleeGroup/focus-components/comments{/number}","issue_comment_url":"https://api.github.com/repos/KleeGroup/focus-components/issues/comments{/number}","contents_url":"https://api.github.com/repos/KleeGroup/focus-components/contents/{+path}","compare_url":"https://api.github.com/repos/KleeGroup/focus-components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KleeGroup/focus-components/merges","archive_url":"https://api.github.com/repos/KleeGroup/focus-components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KleeGroup/focus-components/downloads","issues_url":"https://api.github.com/repos/KleeGroup/focus-components/issues{/number}","pulls_url":"https://api.github.com/repos/KleeGroup/focus-components/pulls{/number}","milestones_url":"https://api.github.com/repos/KleeGroup/focus-components/milestones{/number}","notifications_url":"https://api.github.com/repos/KleeGroup/focus-components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KleeGroup/focus-components/labels{/name}","releases_url":"https://api.github.com/repos/KleeGroup/focus-components/releases{/id}","created_at":"2015-02-19T14:26:04Z","updated_at":"2015-08-20T22:11:08Z","pushed_at":"2015-09-07T21:06:04Z","git_url":"git://github.com/KleeGroup/focus-components.git","ssh_url":"git@github.com:KleeGroup/focus-components.git","clone_url":"https://github.com/KleeGroup/focus-components.git","svn_url":"https://github.com/KleeGroup/focus-components","homepage":"http://kleegroup.github.io/focus-components/components.html","size":6653,"stargazers_count":8,"watchers_count":8,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":8,"mirror_url":null,"open_issues_count":10,"forks":8,"open_issues":10,"watchers":8,"default_branch":"develop"}},"base":{"label":"KleeGroup:feature-material","ref":"feature-material","sha":"011862d96605c07dd03a2ba59cbcad8053f16242","user":{"login":"KleeGroup","id":6595223,"avatar_url":"https://avatars.githubusercontent.com/u/6595223?v=3","gravatar_id":"","url":"https://api.github.com/users/KleeGroup","html_url":"https://github.com/KleeGroup","followers_url":"https://api.github.com/users/KleeGroup/followers","following_url":"https://api.github.com/users/KleeGroup/following{/other_user}","gists_url":"https://api.github.com/users/KleeGroup/gists{/gist_id}","starred_url":"https://api.github.com/users/KleeGroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KleeGroup/subscriptions","organizations_url":"https://api.github.com/users/KleeGroup/orgs","repos_url":"https://api.github.com/users/KleeGroup/repos","events_url":"https://api.github.com/users/KleeGroup/events{/privacy}","received_events_url":"https://api.github.com/users/KleeGroup/received_events","type":"Organization","site_admin":false},"repo":{"id":31018716,"name":"focus-components","full_name":"KleeGroup/focus-components","owner":{"login":"KleeGroup","id":6595223,"avatar_url":"https://avatars.githubusercontent.com/u/6595223?v=3","gravatar_id":"","url":"https://api.github.com/users/KleeGroup","html_url":"https://github.com/KleeGroup","followers_url":"https://api.github.com/users/KleeGroup/followers","following_url":"https://api.github.com/users/KleeGroup/following{/other_user}","gists_url":"https://api.github.com/users/KleeGroup/gists{/gist_id}","starred_url":"https://api.github.com/users/KleeGroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KleeGroup/subscriptions","organizations_url":"https://api.github.com/users/KleeGroup/orgs","repos_url":"https://api.github.com/users/KleeGroup/repos","events_url":"https://api.github.com/users/KleeGroup/events{/privacy}","received_events_url":"https://api.github.com/users/KleeGroup/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/KleeGroup/focus-components","description":"Components for focus application.","fork":false,"url":"https://api.github.com/repos/KleeGroup/focus-components","forks_url":"https://api.github.com/repos/KleeGroup/focus-components/forks","keys_url":"https://api.github.com/repos/KleeGroup/focus-components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KleeGroup/focus-components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KleeGroup/focus-components/teams","hooks_url":"https://api.github.com/repos/KleeGroup/focus-components/hooks","issue_events_url":"https://api.github.com/repos/KleeGroup/focus-components/issues/events{/number}","events_url":"https://api.github.com/repos/KleeGroup/focus-components/events","assignees_url":"https://api.github.com/repos/KleeGroup/focus-components/assignees{/user}","branches_url":"https://api.github.com/repos/KleeGroup/focus-components/branches{/branch}","tags_url":"https://api.github.com/repos/KleeGroup/focus-components/tags","blobs_url":"https://api.github.com/repos/KleeGroup/focus-components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KleeGroup/focus-components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KleeGroup/focus-components/git/refs{/sha}","trees_url":"https://api.github.com/repos/KleeGroup/focus-components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KleeGroup/focus-components/statuses/{sha}","languages_url":"https://api.github.com/repos/KleeGroup/focus-components/languages","stargazers_url":"https://api.github.com/repos/KleeGroup/focus-components/stargazers","contributors_url":"https://api.github.com/repos/KleeGroup/focus-components/contributors","subscribers_url":"https://api.github.com/repos/KleeGroup/focus-components/subscribers","subscription_url":"https://api.github.com/repos/KleeGroup/focus-components/subscription","commits_url":"https://api.github.com/repos/KleeGroup/focus-components/commits{/sha}","git_commits_url":"https://api.github.com/repos/KleeGroup/focus-components/git/commits{/sha}","comments_url":"https://api.github.com/repos/KleeGroup/focus-components/comments{/number}","issue_comment_url":"https://api.github.com/repos/KleeGroup/focus-components/issues/comments{/number}","contents_url":"https://api.github.com/repos/KleeGroup/focus-components/contents/{+path}","compare_url":"https://api.github.com/repos/KleeGroup/focus-components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KleeGroup/focus-components/merges","archive_url":"https://api.github.com/repos/KleeGroup/focus-components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KleeGroup/focus-components/downloads","issues_url":"https://api.github.com/repos/KleeGroup/focus-components/issues{/number}","pulls_url":"https://api.github.com/repos/KleeGroup/focus-components/pulls{/number}","milestones_url":"https://api.github.com/repos/KleeGroup/focus-components/milestones{/number}","notifications_url":"https://api.github.com/repos/KleeGroup/focus-components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KleeGroup/focus-components/labels{/name}","releases_url":"https://api.github.com/repos/KleeGroup/focus-components/releases{/id}","created_at":"2015-02-19T14:26:04Z","updated_at":"2015-08-20T22:11:08Z","pushed_at":"2015-09-07T21:06:04Z","git_url":"git://github.com/KleeGroup/focus-components.git","ssh_url":"git@github.com:KleeGroup/focus-components.git","clone_url":"https://github.com/KleeGroup/focus-components.git","svn_url":"https://github.com/KleeGroup/focus-components","homepage":"http://kleegroup.github.io/focus-components/components.html","size":6653,"stargazers_count":8,"watchers_count":8,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":8,"mirror_url":null,"open_issues_count":10,"forks":8,"open_issues":10,"watchers":8,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/KleeGroup/focus-components/pulls/268"},"html":{"href":"https://github.com/KleeGroup/focus-components/pull/268"},"issue":{"href":"https://api.github.com/repos/KleeGroup/focus-components/issues/268"},"comments":{"href":"https://api.github.com/repos/KleeGroup/focus-components/issues/268/comments"},"review_comments":{"href":"https://api.github.com/repos/KleeGroup/focus-components/pulls/268/comments"},"review_comment":{"href":"https://api.github.com/repos/KleeGroup/focus-components/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/KleeGroup/focus-components/pulls/268/commits"},"statuses":{"href":"https://api.github.com/repos/KleeGroup/focus-components/statuses/4943180cddf05d031bc45ba999de60a0e32c1c70"}}}}