{"action":"created","comment":{"url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/pulls/comments/34488023","id":34488023,"diff_hunk":"@@ -0,0 +1,75 @@\n+<!--\n+@license\n+Copyright (c) 2015 The Polymer Project Authors. All rights reserved.\n+This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n+The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n+The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n+Code distributed by Google as part of the polymer project is also\n+subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n+-->\n+\n+<link rel=\"import\" href=\"../polymer/polymer.html\">\n+<link rel=\"import\" href=\"../iron-validatable-behavior/iron-validatable-behavior.html\">\n+\n+\n+<script>\n+\n+  /**\n+   * Use `Polymer.IronCheckedElementBehavior` to implement a custom element\n+   * that has a `checked` property, which can be used for validation if the\n+   * element is also `required`. Element instances implementing this behavior\n+   * will also be registered for use in an `iron-form` element.\n+   *\n+   * @demo demo/index.html\n+   * @polymerBehavior Polymer.IronCheckedElementBehavior\n+   */\n+  Polymer.IronCheckedElementBehaviorImpl = {\n+\n+    properties: {\n+\n+      /**\n+       * Gets or sets the state, `true` is checked and `false` is unchecked.\n+       */\n+      checked: {\n+        type: Boolean,\n+        value: false,\n+        reflectToAttribute: true,\n+        notify: true,\n+      },\n+\n+      /**\n+       * If true, the button toggles the active state with each tap or press\n+       * of the spacebar.\n+       */\n+      toggles: {\n+        type: Boolean,\n+        value: true,\n+        reflectToAttribute: true\n+      },\n+\n+      /**\n+       * Set to true to mark the input as required.\n+       */\n+      required: {\n+        type: Boolean,\n+        value: false\n+      }\n+    },\n+\n+    /**\n+     * Returns false if the element is required and not checked, and true otherwise.\n+     * @return {Boolean} true if `required` is false, or if `required` and `checked` are both true.\n+     */\n+    validate: function() {\n+      var valid = !this.required || (this.required && this.checked);\n+      this.invalid = !valid;","path":"iron-checked-element-behavior.html","position":69,"original_position":65,"commit_id":"d5673f1865f72554a6a51e081551c73b40df562f","original_commit_id":"bf998268bd36e399ad8bbe6e12d56ced7a9ed02a","user":{"login":"notwaldorf","id":1369170,"avatar_url":"https://avatars.githubusercontent.com/u/1369170?v=3","gravatar_id":"","url":"https://api.github.com/users/notwaldorf","html_url":"https://github.com/notwaldorf","followers_url":"https://api.github.com/users/notwaldorf/followers","following_url":"https://api.github.com/users/notwaldorf/following{/other_user}","gists_url":"https://api.github.com/users/notwaldorf/gists{/gist_id}","starred_url":"https://api.github.com/users/notwaldorf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/notwaldorf/subscriptions","organizations_url":"https://api.github.com/users/notwaldorf/orgs","repos_url":"https://api.github.com/users/notwaldorf/repos","events_url":"https://api.github.com/users/notwaldorf/events{/privacy}","received_events_url":"https://api.github.com/users/notwaldorf/received_events","type":"User","site_admin":false},"body":"@morethanreal Do you think there's a use case where users would want to manually set `invalid` without calling `validate()`? That would be the only argument I see against making `invalid` a computed property...","created_at":"2015-07-13T17:28:28Z","updated_at":"2015-07-13T17:28:28Z","html_url":"https://github.com/PolymerElements/iron-checked-element-behavior/pull/1#discussion_r34488023","pull_request_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/pulls/comments/34488023"},"html":{"href":"https://github.com/PolymerElements/iron-checked-element-behavior/pull/1#discussion_r34488023"},"pull_request":{"href":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/pulls/1","id":38288460,"html_url":"https://github.com/PolymerElements/iron-checked-element-behavior/pull/1","diff_url":"https://github.com/PolymerElements/iron-checked-element-behavior/pull/1.diff","patch_url":"https://github.com/PolymerElements/iron-checked-element-behavior/pull/1.patch","issue_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/issues/1","number":1,"state":"open","locked":false,"title":"initial implementation","user":{"login":"notwaldorf","id":1369170,"avatar_url":"https://avatars.githubusercontent.com/u/1369170?v=3","gravatar_id":"","url":"https://api.github.com/users/notwaldorf","html_url":"https://github.com/notwaldorf","followers_url":"https://api.github.com/users/notwaldorf/followers","following_url":"https://api.github.com/users/notwaldorf/following{/other_user}","gists_url":"https://api.github.com/users/notwaldorf/gists{/gist_id}","starred_url":"https://api.github.com/users/notwaldorf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/notwaldorf/subscriptions","organizations_url":"https://api.github.com/users/notwaldorf/orgs","repos_url":"https://api.github.com/users/notwaldorf/repos","events_url":"https://api.github.com/users/notwaldorf/events{/privacy}","received_events_url":"https://api.github.com/users/notwaldorf/received_events","type":"User","site_admin":false},"body":"This behaviour pulls out the common `checked`-related things between `paper-checkbox`/`paper-radio-button`/`paper-toggle-button` (last bit of https://github.com/PolymerElements/paper-behaviors/issues/22). The idea is that it should:\r\n- add the `checked` property\r\n- handle the `required` and `validate` methods needed *if* it were to be added to a form. \r\n\r\nThis would make `paper-checkbox` look something like this: https://github.com/PolymerElements/paper-checkbox/pull/40/files\r\n\r\n/cc @morethanreal for extra halp","created_at":"2015-06-22T23:43:15Z","updated_at":"2015-07-13T17:28:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b528018e337cb3cdc5ebab660af51787ca48f353","assignee":{"login":"cdata","id":240083,"avatar_url":"https://avatars.githubusercontent.com/u/240083?v=3","gravatar_id":"","url":"https://api.github.com/users/cdata","html_url":"https://github.com/cdata","followers_url":"https://api.github.com/users/cdata/followers","following_url":"https://api.github.com/users/cdata/following{/other_user}","gists_url":"https://api.github.com/users/cdata/gists{/gist_id}","starred_url":"https://api.github.com/users/cdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdata/subscriptions","organizations_url":"https://api.github.com/users/cdata/orgs","repos_url":"https://api.github.com/users/cdata/repos","events_url":"https://api.github.com/users/cdata/events{/privacy}","received_events_url":"https://api.github.com/users/cdata/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/pulls/1/commits","review_comments_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/pulls/1/comments","review_comment_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/issues/1/comments","statuses_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/statuses/d5673f1865f72554a6a51e081551c73b40df562f","head":{"label":"PolymerElements:implementation","ref":"implementation","sha":"d5673f1865f72554a6a51e081551c73b40df562f","user":{"login":"PolymerElements","id":11639138,"avatar_url":"https://avatars.githubusercontent.com/u/11639138?v=3","gravatar_id":"","url":"https://api.github.com/users/PolymerElements","html_url":"https://github.com/PolymerElements","followers_url":"https://api.github.com/users/PolymerElements/followers","following_url":"https://api.github.com/users/PolymerElements/following{/other_user}","gists_url":"https://api.github.com/users/PolymerElements/gists{/gist_id}","starred_url":"https://api.github.com/users/PolymerElements/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PolymerElements/subscriptions","organizations_url":"https://api.github.com/users/PolymerElements/orgs","repos_url":"https://api.github.com/users/PolymerElements/repos","events_url":"https://api.github.com/users/PolymerElements/events{/privacy}","received_events_url":"https://api.github.com/users/PolymerElements/received_events","type":"Organization","site_admin":false},"repo":{"id":37874605,"name":"iron-checked-element-behavior","full_name":"PolymerElements/iron-checked-element-behavior","owner":{"login":"PolymerElements","id":11639138,"avatar_url":"https://avatars.githubusercontent.com/u/11639138?v=3","gravatar_id":"","url":"https://api.github.com/users/PolymerElements","html_url":"https://github.com/PolymerElements","followers_url":"https://api.github.com/users/PolymerElements/followers","following_url":"https://api.github.com/users/PolymerElements/following{/other_user}","gists_url":"https://api.github.com/users/PolymerElements/gists{/gist_id}","starred_url":"https://api.github.com/users/PolymerElements/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PolymerElements/subscriptions","organizations_url":"https://api.github.com/users/PolymerElements/orgs","repos_url":"https://api.github.com/users/PolymerElements/repos","events_url":"https://api.github.com/users/PolymerElements/events{/privacy}","received_events_url":"https://api.github.com/users/PolymerElements/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PolymerElements/iron-checked-element-behavior","description":"Implements an element that has a checked attribute and can be added to a form","fork":false,"url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior","forks_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/forks","keys_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/teams","hooks_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/hooks","issue_events_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/issues/events{/number}","events_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/events","assignees_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/assignees{/user}","branches_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/branches{/branch}","tags_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/tags","blobs_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/git/refs{/sha}","trees_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/statuses/{sha}","languages_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/languages","stargazers_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/stargazers","contributors_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/contributors","subscribers_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/subscribers","subscription_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/subscription","commits_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/commits{/sha}","git_commits_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/git/commits{/sha}","comments_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/comments{/number}","issue_comment_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/issues/comments{/number}","contents_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/contents/{+path}","compare_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/merges","archive_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/downloads","issues_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/issues{/number}","pulls_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/pulls{/number}","milestones_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/milestones{/number}","notifications_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/labels{/name}","releases_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/releases{/id}","created_at":"2015-06-22T18:57:30Z","updated_at":"2015-06-22T18:57:30Z","pushed_at":"2015-06-25T22:41:59Z","git_url":"git://github.com/PolymerElements/iron-checked-element-behavior.git","ssh_url":"git@github.com:PolymerElements/iron-checked-element-behavior.git","clone_url":"https://github.com/PolymerElements/iron-checked-element-behavior.git","svn_url":"https://github.com/PolymerElements/iron-checked-element-behavior","homepage":null,"size":148,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"PolymerElements:master","ref":"master","sha":"85384dbdb1e76757b68440a3a070296b556ed968","user":{"login":"PolymerElements","id":11639138,"avatar_url":"https://avatars.githubusercontent.com/u/11639138?v=3","gravatar_id":"","url":"https://api.github.com/users/PolymerElements","html_url":"https://github.com/PolymerElements","followers_url":"https://api.github.com/users/PolymerElements/followers","following_url":"https://api.github.com/users/PolymerElements/following{/other_user}","gists_url":"https://api.github.com/users/PolymerElements/gists{/gist_id}","starred_url":"https://api.github.com/users/PolymerElements/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PolymerElements/subscriptions","organizations_url":"https://api.github.com/users/PolymerElements/orgs","repos_url":"https://api.github.com/users/PolymerElements/repos","events_url":"https://api.github.com/users/PolymerElements/events{/privacy}","received_events_url":"https://api.github.com/users/PolymerElements/received_events","type":"Organization","site_admin":false},"repo":{"id":37874605,"name":"iron-checked-element-behavior","full_name":"PolymerElements/iron-checked-element-behavior","owner":{"login":"PolymerElements","id":11639138,"avatar_url":"https://avatars.githubusercontent.com/u/11639138?v=3","gravatar_id":"","url":"https://api.github.com/users/PolymerElements","html_url":"https://github.com/PolymerElements","followers_url":"https://api.github.com/users/PolymerElements/followers","following_url":"https://api.github.com/users/PolymerElements/following{/other_user}","gists_url":"https://api.github.com/users/PolymerElements/gists{/gist_id}","starred_url":"https://api.github.com/users/PolymerElements/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PolymerElements/subscriptions","organizations_url":"https://api.github.com/users/PolymerElements/orgs","repos_url":"https://api.github.com/users/PolymerElements/repos","events_url":"https://api.github.com/users/PolymerElements/events{/privacy}","received_events_url":"https://api.github.com/users/PolymerElements/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PolymerElements/iron-checked-element-behavior","description":"Implements an element that has a checked attribute and can be added to a form","fork":false,"url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior","forks_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/forks","keys_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/teams","hooks_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/hooks","issue_events_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/issues/events{/number}","events_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/events","assignees_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/assignees{/user}","branches_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/branches{/branch}","tags_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/tags","blobs_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/git/refs{/sha}","trees_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/statuses/{sha}","languages_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/languages","stargazers_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/stargazers","contributors_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/contributors","subscribers_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/subscribers","subscription_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/subscription","commits_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/commits{/sha}","git_commits_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/git/commits{/sha}","comments_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/comments{/number}","issue_comment_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/issues/comments{/number}","contents_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/contents/{+path}","compare_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/merges","archive_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/downloads","issues_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/issues{/number}","pulls_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/pulls{/number}","milestones_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/milestones{/number}","notifications_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/labels{/name}","releases_url":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/releases{/id}","created_at":"2015-06-22T18:57:30Z","updated_at":"2015-06-22T18:57:30Z","pushed_at":"2015-06-25T22:41:59Z","git_url":"git://github.com/PolymerElements/iron-checked-element-behavior.git","ssh_url":"git@github.com:PolymerElements/iron-checked-element-behavior.git","clone_url":"https://github.com/PolymerElements/iron-checked-element-behavior.git","svn_url":"https://github.com/PolymerElements/iron-checked-element-behavior","homepage":null,"size":148,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/pulls/1"},"html":{"href":"https://github.com/PolymerElements/iron-checked-element-behavior/pull/1"},"issue":{"href":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/issues/1"},"comments":{"href":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/PolymerElements/iron-checked-element-behavior/statuses/d5673f1865f72554a6a51e081551c73b40df562f"}}}}