{"action":"created","comment":{"url":"https://api.github.com/repos/qgrid/ng2/pulls/comments/137446751","pull_request_review_id":61113636,"id":137446751,"diff_hunk":"@@ -0,0 +1,215 @@\n+import {\n+\tComponent,\n+\tInput,\n+\tOutput,\n+\tViewChild,\n+\tEventEmitter,\n+\tRenderer2,\n+\tElementRef\n+} from '@angular/core';\n+\n+import {AppError} from 'ng2-qgrid/core/infrastructure';\n+import {Command, CommandManager} from 'ng2-qgrid/core/command';\n+import {Shortcut, ShortcutManager} from 'ng2-qgrid/core/shortcut';\n+import {DomBase} from 'ng2-qgrid/common/dom-helpers/dom-base';\n+\n+export const ChipState = {\n+\tedited: 'edited',\n+\tnew: 'new'\n+};\n+\n+enum NextAction {\n+\tadd,\n+\tbeginEdit,\n+\tendEdit,\n+\tnothing\n+}\n+\n+@Component({\n+\tselector: 'edit-chip',\n+\ttemplateUrl: './edit-chip.tpl.html',\n+\tstyleUrls: ['./edit-chip.scss']\n+})\n+export class EditChipComponent extends DomBase {\n+\t@Input() index: number;\n+\t@Input() value: string | any;\n+\t@Input() state: string;\n+\t@Input('state') chipState: string;\n+\n+\t@Input('q-grid-focus-disabled')\n+\tqGridFocusDisabled: boolean = true;\n+\n+\t@Output() delete = new EventEmitter<number>();\n+\t@Output() add = new EventEmitter<string|any>();\n+\t@Output() save = new EventEmitter<string|any>();\n+\n+\t@Output('focus-previous') focusPrevious = new EventEmitter<number>();\n+\t@Output('focus-next') focusNext = new EventEmitter<number>();\n+\n+\tprivate shortcut = new Shortcut(new ShortcutManager());\n+\tprivate nextAction = NextAction.beginEdit;\n+\n+\tprivate newValue: string;\n+\tprivate editValue: string;\n+\n+\tisSelected: boolean = false;\n+\n+\tget isEdited() {\n+\t\treturn this.chipState === ChipState.edited;\n+\t}\n+\n+\tprivate get isNew() {\n+\t\treturn this.chipState === ChipState.new;\n+\t}\n+\n+\tprivate get isReadOnly() {\n+\t\treturn !(this.isEdited || this.isNew);\n+\t}\n+\n+\tprivate get canMoveFocus() {\n+\t\treturn this.isReadOnly && this.isSelected || this.isNew && !this.newValue;\n+\t}\n+\n+\tprivate resetChipState() {\n+\t\tthis.chipState = '';\n+\t}\n+\n+\tprivate beginEditCommand = new Command({\n+\t\tcanExecute: () => this.nextAction === NextAction.beginEdit && this.isSelected,\n+\t\texecute: () => {\n+\t\t\tthis.editValue = this.value;\n+\t\t\tthis.chipState = ChipState.edited;\n+\t\t\tthis.nextAction = NextAction.endEdit;\n+\t\t},\n+\t\tshortcut: 'enter'\n+\t});\n+\n+\tprivate endEditCommand = new Command({\n+\t\tcanExecute: () => this.nextAction === NextAction.endEdit && this.editValue,\n+\t\texecute: () => {\n+\t\t\tthis.save.emit(this.editValue);\n+\t\t\tthis.endEdit();\n+\t\t\tthis.editValue = '';\n+\t\t},\n+\t\tshortcut: 'enter'\n+\t});\n+\n+\tprivate addItemCommand = new Command({","path":"src/themes/material/components/edit-chip-list/edit-chip/edit-chip.component.ts","position":null,"original_position":97,"commit_id":"da05f15a228a611a5059e3049c9f18402446fa8f","original_commit_id":"b03ef2d2029bc8b055924d67a11f7435e5df9697","user":{"login":"azkurban","id":10787220,"avatar_url":"https://avatars1.githubusercontent.com/u/10787220?v=4","gravatar_id":"","url":"https://api.github.com/users/azkurban","html_url":"https://github.com/azkurban","followers_url":"https://api.github.com/users/azkurban/followers","following_url":"https://api.github.com/users/azkurban/following{/other_user}","gists_url":"https://api.github.com/users/azkurban/gists{/gist_id}","starred_url":"https://api.github.com/users/azkurban/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azkurban/subscriptions","organizations_url":"https://api.github.com/users/azkurban/orgs","repos_url":"https://api.github.com/users/azkurban/repos","events_url":"https://api.github.com/users/azkurban/events{/privacy}","received_events_url":"https://api.github.com/users/azkurban/received_events","type":"User","site_admin":false},"body":"Refactored this in the commit: [Merge from Dev: conflicts resolving](https://github.com/qgrid/ng2/pull/39/commits/da05f15a228a611a5059e3049c9f18402446fa8f).","created_at":"2017-09-07T05:02:40Z","updated_at":"2017-09-07T05:02:40Z","html_url":"https://github.com/qgrid/ng2/pull/39#discussion_r137446751","pull_request_url":"https://api.github.com/repos/qgrid/ng2/pulls/39","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/qgrid/ng2/pulls/comments/137446751"},"html":{"href":"https://github.com/qgrid/ng2/pull/39#discussion_r137446751"},"pull_request":{"href":"https://api.github.com/repos/qgrid/ng2/pulls/39"}},"in_reply_to_id":136976349},"pull_request":{"url":"https://api.github.com/repos/qgrid/ng2/pulls/39","id":137728282,"html_url":"https://github.com/qgrid/ng2/pull/39","diff_url":"https://github.com/qgrid/ng2/pull/39.diff","patch_url":"https://github.com/qgrid/ng2/pull/39.patch","issue_url":"https://api.github.com/repos/qgrid/ng2/issues/39","number":39,"state":"open","locked":false,"title":"Cell editor for Array type implemented","user":{"login":"azkurban","id":10787220,"avatar_url":"https://avatars1.githubusercontent.com/u/10787220?v=4","gravatar_id":"","url":"https://api.github.com/users/azkurban","html_url":"https://github.com/azkurban","followers_url":"https://api.github.com/users/azkurban/followers","following_url":"https://api.github.com/users/azkurban/following{/other_user}","gists_url":"https://api.github.com/users/azkurban/gists{/gist_id}","starred_url":"https://api.github.com/users/azkurban/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azkurban/subscriptions","organizations_url":"https://api.github.com/users/azkurban/orgs","repos_url":"https://api.github.com/users/azkurban/repos","events_url":"https://api.github.com/users/azkurban/events{/privacy}","received_events_url":"https://api.github.com/users/azkurban/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-08-25T18:11:30Z","updated_at":"2017-09-07T05:02:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"23f1d216d433e4f8b7870d5e741944e6ae78ea41","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/qgrid/ng2/pulls/39/commits","review_comments_url":"https://api.github.com/repos/qgrid/ng2/pulls/39/comments","review_comment_url":"https://api.github.com/repos/qgrid/ng2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/qgrid/ng2/issues/39/comments","statuses_url":"https://api.github.com/repos/qgrid/ng2/statuses/da05f15a228a611a5059e3049c9f18402446fa8f","head":{"label":"azkurban:master","ref":"master","sha":"da05f15a228a611a5059e3049c9f18402446fa8f","user":{"login":"azkurban","id":10787220,"avatar_url":"https://avatars1.githubusercontent.com/u/10787220?v=4","gravatar_id":"","url":"https://api.github.com/users/azkurban","html_url":"https://github.com/azkurban","followers_url":"https://api.github.com/users/azkurban/followers","following_url":"https://api.github.com/users/azkurban/following{/other_user}","gists_url":"https://api.github.com/users/azkurban/gists{/gist_id}","starred_url":"https://api.github.com/users/azkurban/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azkurban/subscriptions","organizations_url":"https://api.github.com/users/azkurban/orgs","repos_url":"https://api.github.com/users/azkurban/repos","events_url":"https://api.github.com/users/azkurban/events{/privacy}","received_events_url":"https://api.github.com/users/azkurban/received_events","type":"User","site_admin":false},"repo":{"id":100498095,"name":"ng2","full_name":"azkurban/ng2","owner":{"login":"azkurban","id":10787220,"avatar_url":"https://avatars1.githubusercontent.com/u/10787220?v=4","gravatar_id":"","url":"https://api.github.com/users/azkurban","html_url":"https://github.com/azkurban","followers_url":"https://api.github.com/users/azkurban/followers","following_url":"https://api.github.com/users/azkurban/following{/other_user}","gists_url":"https://api.github.com/users/azkurban/gists{/gist_id}","starred_url":"https://api.github.com/users/azkurban/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azkurban/subscriptions","organizations_url":"https://api.github.com/users/azkurban/orgs","repos_url":"https://api.github.com/users/azkurban/repos","events_url":"https://api.github.com/users/azkurban/events{/privacy}","received_events_url":"https://api.github.com/users/azkurban/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/azkurban/ng2","description":"angular2 data grid","fork":true,"url":"https://api.github.com/repos/azkurban/ng2","forks_url":"https://api.github.com/repos/azkurban/ng2/forks","keys_url":"https://api.github.com/repos/azkurban/ng2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/azkurban/ng2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/azkurban/ng2/teams","hooks_url":"https://api.github.com/repos/azkurban/ng2/hooks","issue_events_url":"https://api.github.com/repos/azkurban/ng2/issues/events{/number}","events_url":"https://api.github.com/repos/azkurban/ng2/events","assignees_url":"https://api.github.com/repos/azkurban/ng2/assignees{/user}","branches_url":"https://api.github.com/repos/azkurban/ng2/branches{/branch}","tags_url":"https://api.github.com/repos/azkurban/ng2/tags","blobs_url":"https://api.github.com/repos/azkurban/ng2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/azkurban/ng2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/azkurban/ng2/git/refs{/sha}","trees_url":"https://api.github.com/repos/azkurban/ng2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/azkurban/ng2/statuses/{sha}","languages_url":"https://api.github.com/repos/azkurban/ng2/languages","stargazers_url":"https://api.github.com/repos/azkurban/ng2/stargazers","contributors_url":"https://api.github.com/repos/azkurban/ng2/contributors","subscribers_url":"https://api.github.com/repos/azkurban/ng2/subscribers","subscription_url":"https://api.github.com/repos/azkurban/ng2/subscription","commits_url":"https://api.github.com/repos/azkurban/ng2/commits{/sha}","git_commits_url":"https://api.github.com/repos/azkurban/ng2/git/commits{/sha}","comments_url":"https://api.github.com/repos/azkurban/ng2/comments{/number}","issue_comment_url":"https://api.github.com/repos/azkurban/ng2/issues/comments{/number}","contents_url":"https://api.github.com/repos/azkurban/ng2/contents/{+path}","compare_url":"https://api.github.com/repos/azkurban/ng2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/azkurban/ng2/merges","archive_url":"https://api.github.com/repos/azkurban/ng2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/azkurban/ng2/downloads","issues_url":"https://api.github.com/repos/azkurban/ng2/issues{/number}","pulls_url":"https://api.github.com/repos/azkurban/ng2/pulls{/number}","milestones_url":"https://api.github.com/repos/azkurban/ng2/milestones{/number}","notifications_url":"https://api.github.com/repos/azkurban/ng2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/azkurban/ng2/labels{/name}","releases_url":"https://api.github.com/repos/azkurban/ng2/releases{/id}","deployments_url":"https://api.github.com/repos/azkurban/ng2/deployments","created_at":"2017-08-16T14:26:34Z","updated_at":"2017-08-16T14:26:35Z","pushed_at":"2017-09-07T04:03:02Z","git_url":"git://github.com/azkurban/ng2.git","ssh_url":"git@github.com:azkurban/ng2.git","clone_url":"https://github.com/azkurban/ng2.git","svn_url":"https://github.com/azkurban/ng2","homepage":null,"size":11048,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"qgrid:master","ref":"master","sha":"c8b68140713a6d891b30fb7bf44f22dbe6a8809e","user":{"login":"qgrid","id":25244882,"avatar_url":"https://avatars0.githubusercontent.com/u/25244882?v=4","gravatar_id":"","url":"https://api.github.com/users/qgrid","html_url":"https://github.com/qgrid","followers_url":"https://api.github.com/users/qgrid/followers","following_url":"https://api.github.com/users/qgrid/following{/other_user}","gists_url":"https://api.github.com/users/qgrid/gists{/gist_id}","starred_url":"https://api.github.com/users/qgrid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qgrid/subscriptions","organizations_url":"https://api.github.com/users/qgrid/orgs","repos_url":"https://api.github.com/users/qgrid/repos","events_url":"https://api.github.com/users/qgrid/events{/privacy}","received_events_url":"https://api.github.com/users/qgrid/received_events","type":"User","site_admin":false},"repo":{"id":89697902,"name":"ng2","full_name":"qgrid/ng2","owner":{"login":"qgrid","id":25244882,"avatar_url":"https://avatars0.githubusercontent.com/u/25244882?v=4","gravatar_id":"","url":"https://api.github.com/users/qgrid","html_url":"https://github.com/qgrid","followers_url":"https://api.github.com/users/qgrid/followers","following_url":"https://api.github.com/users/qgrid/following{/other_user}","gists_url":"https://api.github.com/users/qgrid/gists{/gist_id}","starred_url":"https://api.github.com/users/qgrid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qgrid/subscriptions","organizations_url":"https://api.github.com/users/qgrid/orgs","repos_url":"https://api.github.com/users/qgrid/repos","events_url":"https://api.github.com/users/qgrid/events{/privacy}","received_events_url":"https://api.github.com/users/qgrid/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/qgrid/ng2","description":"angular2 data grid","fork":false,"url":"https://api.github.com/repos/qgrid/ng2","forks_url":"https://api.github.com/repos/qgrid/ng2/forks","keys_url":"https://api.github.com/repos/qgrid/ng2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qgrid/ng2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qgrid/ng2/teams","hooks_url":"https://api.github.com/repos/qgrid/ng2/hooks","issue_events_url":"https://api.github.com/repos/qgrid/ng2/issues/events{/number}","events_url":"https://api.github.com/repos/qgrid/ng2/events","assignees_url":"https://api.github.com/repos/qgrid/ng2/assignees{/user}","branches_url":"https://api.github.com/repos/qgrid/ng2/branches{/branch}","tags_url":"https://api.github.com/repos/qgrid/ng2/tags","blobs_url":"https://api.github.com/repos/qgrid/ng2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qgrid/ng2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qgrid/ng2/git/refs{/sha}","trees_url":"https://api.github.com/repos/qgrid/ng2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qgrid/ng2/statuses/{sha}","languages_url":"https://api.github.com/repos/qgrid/ng2/languages","stargazers_url":"https://api.github.com/repos/qgrid/ng2/stargazers","contributors_url":"https://api.github.com/repos/qgrid/ng2/contributors","subscribers_url":"https://api.github.com/repos/qgrid/ng2/subscribers","subscription_url":"https://api.github.com/repos/qgrid/ng2/subscription","commits_url":"https://api.github.com/repos/qgrid/ng2/commits{/sha}","git_commits_url":"https://api.github.com/repos/qgrid/ng2/git/commits{/sha}","comments_url":"https://api.github.com/repos/qgrid/ng2/comments{/number}","issue_comment_url":"https://api.github.com/repos/qgrid/ng2/issues/comments{/number}","contents_url":"https://api.github.com/repos/qgrid/ng2/contents/{+path}","compare_url":"https://api.github.com/repos/qgrid/ng2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qgrid/ng2/merges","archive_url":"https://api.github.com/repos/qgrid/ng2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qgrid/ng2/downloads","issues_url":"https://api.github.com/repos/qgrid/ng2/issues{/number}","pulls_url":"https://api.github.com/repos/qgrid/ng2/pulls{/number}","milestones_url":"https://api.github.com/repos/qgrid/ng2/milestones{/number}","notifications_url":"https://api.github.com/repos/qgrid/ng2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qgrid/ng2/labels{/name}","releases_url":"https://api.github.com/repos/qgrid/ng2/releases{/id}","deployments_url":"https://api.github.com/repos/qgrid/ng2/deployments","created_at":"2017-04-28T10:59:19Z","updated_at":"2017-09-06T21:41:12Z","pushed_at":"2017-09-07T04:03:04Z","git_url":"git://github.com/qgrid/ng2.git","ssh_url":"git@github.com:qgrid/ng2.git","clone_url":"https://github.com/qgrid/ng2.git","svn_url":"https://github.com/qgrid/ng2","homepage":null,"size":12648,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/qgrid/ng2/pulls/39"},"html":{"href":"https://github.com/qgrid/ng2/pull/39"},"issue":{"href":"https://api.github.com/repos/qgrid/ng2/issues/39"},"comments":{"href":"https://api.github.com/repos/qgrid/ng2/issues/39/comments"},"review_comments":{"href":"https://api.github.com/repos/qgrid/ng2/pulls/39/comments"},"review_comment":{"href":"https://api.github.com/repos/qgrid/ng2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/qgrid/ng2/pulls/39/commits"},"statuses":{"href":"https://api.github.com/repos/qgrid/ng2/statuses/da05f15a228a611a5059e3049c9f18402446fa8f"}},"author_association":"NONE"}}
{"actor":{"display_login":"azkurban"}}