{"action":"created","comment":{"url":"https://api.github.com/repos/material-components/material-components-web-components/pulls/comments/219353368","pull_request_review_id":157508917,"id":219353368,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxOTM1MzM2OA==","diff_hunk":"@@ -0,0 +1,90 @@\n+/**\n+@license\n+Copyright 2018 Google Inc. All Rights Reserved.\n+\n+Licensed under the Apache License, Version 2.0 (the \"License\");\n+you may not use this file except in compliance with the License.\n+You may obtain a copy of the License at\n+\n+    http://www.apache.org/licenses/LICENSE-2.0\n+\n+Unless required by applicable law or agreed to in writing, software\n+distributed under the License is distributed on an \"AS IS\" BASIS,\n+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+See the License for the specific language governing permissions and\n+limitations under the License.\n+*/\n+import {FormElement, html, property, observer, query, customElement, BaseAdapter} from '@material/mwc-base/form-element';\n+import {style} from './mwc-switch-css';\n+import MDCSwitchFoundation from '@material/switch/foundation';\n+\n+export class SwitchAdapter extends BaseAdapter {\n+  constructor(readonly element: Switch) {\n+    super(element);\n+  }\n+  setNativeControlChecked(checked: boolean) {\n+    this.element.formElement.checked = checked;\n+  }\n+  setNativeControlDisabled(disabled: boolean) {\n+    this.element.formElement.disabled = disabled;\n+  }\n+}\n+\n+@customElement('mwc-switch' as any)\n+export class Switch extends FormElement {\n+  @property({type: Boolean})\n+  @observer(function(this: Switch, value: boolean) {\n+    this.mdcFoundation.setChecked(value);\n+  })\n+  checked = false;\n+\n+  @property({type: Boolean})\n+  @observer(function(this: Switch, value: boolean) {\n+    this.mdcFoundation.setDisabled(value);\n+  })\n+  disabled = false;\n+\n+  renderStyle() {\n+    return style;\n+  }\n+\n+  @query('.mdc-switch')\n+  mdcRoot!: HTMLElement;\n+\n+  @query('input')\n+  formElement!: HTMLInputElement;\n+\n+  protected mdcFoundation!: MDCSwitchFoundation;\n+\n+  private _changeHandler(e: Event) {\n+    this.mdcFoundation.handleChange(e);\n+    // catch \"click\" event and sync properties\n+    this.checked = this.formElement.checked;\n+  }\n+\n+  protected get mdcFoundationClass() {\n+    return MDCSwitchFoundation;","path":"packages/switch/src/mwc-switch.ts","position":66,"original_position":66,"commit_id":"30de182f5ea99e823e01d130737f43d2c1d3a4c3","original_commit_id":"30de182f5ea99e823e01d130737f43d2c1d3a4c3","user":{"login":"justinfagnani","id":522948,"node_id":"MDQ6VXNlcjUyMjk0OA==","avatar_url":"https://avatars0.githubusercontent.com/u/522948?v=4","gravatar_id":"","url":"https://api.github.com/users/justinfagnani","html_url":"https://github.com/justinfagnani","followers_url":"https://api.github.com/users/justinfagnani/followers","following_url":"https://api.github.com/users/justinfagnani/following{/other_user}","gists_url":"https://api.github.com/users/justinfagnani/gists{/gist_id}","starred_url":"https://api.github.com/users/justinfagnani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinfagnani/subscriptions","organizations_url":"https://api.github.com/users/justinfagnani/orgs","repos_url":"https://api.github.com/users/justinfagnani/repos","events_url":"https://api.github.com/users/justinfagnani/events{/privacy}","received_events_url":"https://api.github.com/users/justinfagnani/received_events","type":"User","site_admin":false},"body":"why is AdapterClass a static property and this an instance getter?","created_at":"2018-09-21T00:08:39Z","updated_at":"2018-09-21T00:09:33Z","html_url":"https://github.com/material-components/material-components-web-components/pull/109#discussion_r219353368","pull_request_url":"https://api.github.com/repos/material-components/material-components-web-components/pulls/109","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/material-components/material-components-web-components/pulls/comments/219353368"},"html":{"href":"https://github.com/material-components/material-components-web-components/pull/109#discussion_r219353368"},"pull_request":{"href":"https://api.github.com/repos/material-components/material-components-web-components/pulls/109"}}},"pull_request":{"url":"https://api.github.com/repos/material-components/material-components-web-components/pulls/109","id":216813856,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE2ODEzODU2","html_url":"https://github.com/material-components/material-components-web-components/pull/109","diff_url":"https://github.com/material-components/material-components-web-components/pull/109.diff","patch_url":"https://github.com/material-components/material-components-web-components/pull/109.patch","issue_url":"https://api.github.com/repos/material-components/material-components-web-components/issues/109","number":109,"state":"open","locked":false,"title":"First crazy attempt at typescript conversion","user":{"login":"azakus","id":46725,"node_id":"MDQ6VXNlcjQ2NzI1","avatar_url":"https://avatars0.githubusercontent.com/u/46725?v=4","gravatar_id":"","url":"https://api.github.com/users/azakus","html_url":"https://github.com/azakus","followers_url":"https://api.github.com/users/azakus/followers","following_url":"https://api.github.com/users/azakus/following{/other_user}","gists_url":"https://api.github.com/users/azakus/gists{/gist_id}","starred_url":"https://api.github.com/users/azakus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azakus/subscriptions","organizations_url":"https://api.github.com/users/azakus/orgs","repos_url":"https://api.github.com/users/azakus/repos","events_url":"https://api.github.com/users/azakus/events{/privacy}","received_events_url":"https://api.github.com/users/azakus/received_events","type":"User","site_admin":false},"body":"Look at switch and base packages\n\nMove sass building into scripts\n\n**DO NOT MERGE**","created_at":"2018-09-20T00:36:34Z","updated_at":"2018-09-21T00:09:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"35f5126b5e0f0da327fa2564fd8f9eafe85c27ff","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/material-components/material-components-web-components/pulls/109/commits","review_comments_url":"https://api.github.com/repos/material-components/material-components-web-components/pulls/109/comments","review_comment_url":"https://api.github.com/repos/material-components/material-components-web-components/pulls/comments{/number}","comments_url":"https://api.github.com/repos/material-components/material-components-web-components/issues/109/comments","statuses_url":"https://api.github.com/repos/material-components/material-components-web-components/statuses/30de182f5ea99e823e01d130737f43d2c1d3a4c3","head":{"label":"material-components:typescript","ref":"typescript","sha":"30de182f5ea99e823e01d130737f43d2c1d3a4c3","user":{"login":"material-components","id":19478152,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NDc4MTUy","avatar_url":"https://avatars3.githubusercontent.com/u/19478152?v=4","gravatar_id":"","url":"https://api.github.com/users/material-components","html_url":"https://github.com/material-components","followers_url":"https://api.github.com/users/material-components/followers","following_url":"https://api.github.com/users/material-components/following{/other_user}","gists_url":"https://api.github.com/users/material-components/gists{/gist_id}","starred_url":"https://api.github.com/users/material-components/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/material-components/subscriptions","organizations_url":"https://api.github.com/users/material-components/orgs","repos_url":"https://api.github.com/users/material-components/repos","events_url":"https://api.github.com/users/material-components/events{/privacy}","received_events_url":"https://api.github.com/users/material-components/received_events","type":"Organization","site_admin":false},"repo":{"id":127049550,"node_id":"MDEwOlJlcG9zaXRvcnkxMjcwNDk1NTA=","name":"material-components-web-components","full_name":"material-components/material-components-web-components","private":false,"owner":{"login":"material-components","id":19478152,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NDc4MTUy","avatar_url":"https://avatars3.githubusercontent.com/u/19478152?v=4","gravatar_id":"","url":"https://api.github.com/users/material-components","html_url":"https://github.com/material-components","followers_url":"https://api.github.com/users/material-components/followers","following_url":"https://api.github.com/users/material-components/following{/other_user}","gists_url":"https://api.github.com/users/material-components/gists{/gist_id}","starred_url":"https://api.github.com/users/material-components/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/material-components/subscriptions","organizations_url":"https://api.github.com/users/material-components/orgs","repos_url":"https://api.github.com/users/material-components/repos","events_url":"https://api.github.com/users/material-components/events{/privacy}","received_events_url":"https://api.github.com/users/material-components/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/material-components/material-components-web-components","description":"Material Web Components - Material Design implemented as Web Components","fork":false,"url":"https://api.github.com/repos/material-components/material-components-web-components","forks_url":"https://api.github.com/repos/material-components/material-components-web-components/forks","keys_url":"https://api.github.com/repos/material-components/material-components-web-components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/material-components/material-components-web-components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/material-components/material-components-web-components/teams","hooks_url":"https://api.github.com/repos/material-components/material-components-web-components/hooks","issue_events_url":"https://api.github.com/repos/material-components/material-components-web-components/issues/events{/number}","events_url":"https://api.github.com/repos/material-components/material-components-web-components/events","assignees_url":"https://api.github.com/repos/material-components/material-components-web-components/assignees{/user}","branches_url":"https://api.github.com/repos/material-components/material-components-web-components/branches{/branch}","tags_url":"https://api.github.com/repos/material-components/material-components-web-components/tags","blobs_url":"https://api.github.com/repos/material-components/material-components-web-components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/material-components/material-components-web-components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/material-components/material-components-web-components/git/refs{/sha}","trees_url":"https://api.github.com/repos/material-components/material-components-web-components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/material-components/material-components-web-components/statuses/{sha}","languages_url":"https://api.github.com/repos/material-components/material-components-web-components/languages","stargazers_url":"https://api.github.com/repos/material-components/material-components-web-components/stargazers","contributors_url":"https://api.github.com/repos/material-components/material-components-web-components/contributors","subscribers_url":"https://api.github.com/repos/material-components/material-components-web-components/subscribers","subscription_url":"https://api.github.com/repos/material-components/material-components-web-components/subscription","commits_url":"https://api.github.com/repos/material-components/material-components-web-components/commits{/sha}","git_commits_url":"https://api.github.com/repos/material-components/material-components-web-components/git/commits{/sha}","comments_url":"https://api.github.com/repos/material-components/material-components-web-components/comments{/number}","issue_comment_url":"https://api.github.com/repos/material-components/material-components-web-components/issues/comments{/number}","contents_url":"https://api.github.com/repos/material-components/material-components-web-components/contents/{+path}","compare_url":"https://api.github.com/repos/material-components/material-components-web-components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/material-components/material-components-web-components/merges","archive_url":"https://api.github.com/repos/material-components/material-components-web-components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/material-components/material-components-web-components/downloads","issues_url":"https://api.github.com/repos/material-components/material-components-web-components/issues{/number}","pulls_url":"https://api.github.com/repos/material-components/material-components-web-components/pulls{/number}","milestones_url":"https://api.github.com/repos/material-components/material-components-web-components/milestones{/number}","notifications_url":"https://api.github.com/repos/material-components/material-components-web-components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/material-components/material-components-web-components/labels{/name}","releases_url":"https://api.github.com/repos/material-components/material-components-web-components/releases{/id}","deployments_url":"https://api.github.com/repos/material-components/material-components-web-components/deployments","created_at":"2018-03-27T21:46:51Z","updated_at":"2018-09-20T18:52:27Z","pushed_at":"2018-09-20T23:55:41Z","git_url":"git://github.com/material-components/material-components-web-components.git","ssh_url":"git@github.com:material-components/material-components-web-components.git","clone_url":"https://github.com/material-components/material-components-web-components.git","svn_url":"https://github.com/material-components/material-components-web-components","homepage":"https://material-components.github.io/material-components-web-components/demos/index.html","size":1287,"stargazers_count":438,"watchers_count":438,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":69,"mirror_url":null,"archived":false,"open_issues_count":65,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":69,"open_issues":65,"watchers":438,"default_branch":"master"}},"base":{"label":"material-components:master","ref":"master","sha":"5d97bd02c85d8937f2c209c6aa99f727cbc966ca","user":{"login":"material-components","id":19478152,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NDc4MTUy","avatar_url":"https://avatars3.githubusercontent.com/u/19478152?v=4","gravatar_id":"","url":"https://api.github.com/users/material-components","html_url":"https://github.com/material-components","followers_url":"https://api.github.com/users/material-components/followers","following_url":"https://api.github.com/users/material-components/following{/other_user}","gists_url":"https://api.github.com/users/material-components/gists{/gist_id}","starred_url":"https://api.github.com/users/material-components/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/material-components/subscriptions","organizations_url":"https://api.github.com/users/material-components/orgs","repos_url":"https://api.github.com/users/material-components/repos","events_url":"https://api.github.com/users/material-components/events{/privacy}","received_events_url":"https://api.github.com/users/material-components/received_events","type":"Organization","site_admin":false},"repo":{"id":127049550,"node_id":"MDEwOlJlcG9zaXRvcnkxMjcwNDk1NTA=","name":"material-components-web-components","full_name":"material-components/material-components-web-components","private":false,"owner":{"login":"material-components","id":19478152,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NDc4MTUy","avatar_url":"https://avatars3.githubusercontent.com/u/19478152?v=4","gravatar_id":"","url":"https://api.github.com/users/material-components","html_url":"https://github.com/material-components","followers_url":"https://api.github.com/users/material-components/followers","following_url":"https://api.github.com/users/material-components/following{/other_user}","gists_url":"https://api.github.com/users/material-components/gists{/gist_id}","starred_url":"https://api.github.com/users/material-components/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/material-components/subscriptions","organizations_url":"https://api.github.com/users/material-components/orgs","repos_url":"https://api.github.com/users/material-components/repos","events_url":"https://api.github.com/users/material-components/events{/privacy}","received_events_url":"https://api.github.com/users/material-components/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/material-components/material-components-web-components","description":"Material Web Components - Material Design implemented as Web Components","fork":false,"url":"https://api.github.com/repos/material-components/material-components-web-components","forks_url":"https://api.github.com/repos/material-components/material-components-web-components/forks","keys_url":"https://api.github.com/repos/material-components/material-components-web-components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/material-components/material-components-web-components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/material-components/material-components-web-components/teams","hooks_url":"https://api.github.com/repos/material-components/material-components-web-components/hooks","issue_events_url":"https://api.github.com/repos/material-components/material-components-web-components/issues/events{/number}","events_url":"https://api.github.com/repos/material-components/material-components-web-components/events","assignees_url":"https://api.github.com/repos/material-components/material-components-web-components/assignees{/user}","branches_url":"https://api.github.com/repos/material-components/material-components-web-components/branches{/branch}","tags_url":"https://api.github.com/repos/material-components/material-components-web-components/tags","blobs_url":"https://api.github.com/repos/material-components/material-components-web-components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/material-components/material-components-web-components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/material-components/material-components-web-components/git/refs{/sha}","trees_url":"https://api.github.com/repos/material-components/material-components-web-components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/material-components/material-components-web-components/statuses/{sha}","languages_url":"https://api.github.com/repos/material-components/material-components-web-components/languages","stargazers_url":"https://api.github.com/repos/material-components/material-components-web-components/stargazers","contributors_url":"https://api.github.com/repos/material-components/material-components-web-components/contributors","subscribers_url":"https://api.github.com/repos/material-components/material-components-web-components/subscribers","subscription_url":"https://api.github.com/repos/material-components/material-components-web-components/subscription","commits_url":"https://api.github.com/repos/material-components/material-components-web-components/commits{/sha}","git_commits_url":"https://api.github.com/repos/material-components/material-components-web-components/git/commits{/sha}","comments_url":"https://api.github.com/repos/material-components/material-components-web-components/comments{/number}","issue_comment_url":"https://api.github.com/repos/material-components/material-components-web-components/issues/comments{/number}","contents_url":"https://api.github.com/repos/material-components/material-components-web-components/contents/{+path}","compare_url":"https://api.github.com/repos/material-components/material-components-web-components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/material-components/material-components-web-components/merges","archive_url":"https://api.github.com/repos/material-components/material-components-web-components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/material-components/material-components-web-components/downloads","issues_url":"https://api.github.com/repos/material-components/material-components-web-components/issues{/number}","pulls_url":"https://api.github.com/repos/material-components/material-components-web-components/pulls{/number}","milestones_url":"https://api.github.com/repos/material-components/material-components-web-components/milestones{/number}","notifications_url":"https://api.github.com/repos/material-components/material-components-web-components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/material-components/material-components-web-components/labels{/name}","releases_url":"https://api.github.com/repos/material-components/material-components-web-components/releases{/id}","deployments_url":"https://api.github.com/repos/material-components/material-components-web-components/deployments","created_at":"2018-03-27T21:46:51Z","updated_at":"2018-09-20T18:52:27Z","pushed_at":"2018-09-20T23:55:41Z","git_url":"git://github.com/material-components/material-components-web-components.git","ssh_url":"git@github.com:material-components/material-components-web-components.git","clone_url":"https://github.com/material-components/material-components-web-components.git","svn_url":"https://github.com/material-components/material-components-web-components","homepage":"https://material-components.github.io/material-components-web-components/demos/index.html","size":1287,"stargazers_count":438,"watchers_count":438,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":69,"mirror_url":null,"archived":false,"open_issues_count":65,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":69,"open_issues":65,"watchers":438,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/material-components/material-components-web-components/pulls/109"},"html":{"href":"https://github.com/material-components/material-components-web-components/pull/109"},"issue":{"href":"https://api.github.com/repos/material-components/material-components-web-components/issues/109"},"comments":{"href":"https://api.github.com/repos/material-components/material-components-web-components/issues/109/comments"},"review_comments":{"href":"https://api.github.com/repos/material-components/material-components-web-components/pulls/109/comments"},"review_comment":{"href":"https://api.github.com/repos/material-components/material-components-web-components/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/material-components/material-components-web-components/pulls/109/commits"},"statuses":{"href":"https://api.github.com/repos/material-components/material-components-web-components/statuses/30de182f5ea99e823e01d130737f43d2c1d3a4c3"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"justinfagnani"}}