{"id":15894566,"url":"https://github.com/rusty1s/table-select","last_synced_at":"2025-07-08T14:05:32.476Z","repository":{"id":65513869,"uuid":"52640943","full_name":"rusty1s/table-select","owner":"rusty1s","description":"Allows you to select table row elements like in your standard finder environment","archived":false,"fork":false,"pushed_at":"2017-08-18T07:15:32.000Z","size":138,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-16T01:41:51.612Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://rusty1s.github.io/table-select/demo","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rusty1s.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-27T00:04:55.000Z","updated_at":"2022-02-10T17:49:59.000Z","dependencies_parsed_at":"2023-01-26T20:55:14.292Z","dependency_job_id":null,"html_url":"https://github.com/rusty1s/table-select","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/rusty1s/table-select","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rusty1s%2Ftable-select","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rusty1s%2Ftable-select/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rusty1s%2Ftable-select/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rusty1s%2Ftable-select/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rusty1s","download_url":"https://codeload.github.com/rusty1s/table-select/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rusty1s%2Ftable-select/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260176690,"owners_count":22970226,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-06T08:40:36.349Z","updated_at":"2025-07-08T14:05:32.459Z","avatar_url":"https://github.com/rusty1s.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# table-select\n\nAllows you to select table row elements like in your standard finder environment.\nBuilt in support `control`, `shift`, `enter` and the arrow keys.\n\n[Demo](http://rusty1s.github.io/table-select/demo)\n\n## Quick Start\n\n```html\n\u003cscript src=\"table-select.min.js\"\u003e\u003c/script\u003e\n\n\u003cscript\u003e\n  new TableSelect(document.getElementById('table-id'));\n\u003c/script\u003e\n```\n\n## Browser Support\n\n`table-select` expects `classList` to be supported. For this to work on older versions of\nIE, use [a shim](https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills#classlist).\n\n## Additional options\n\nYou can pass in options as a second parameter. The currently supported options are:\n\n* `className`: The class name of the table. Default: `'selectable'`.\n* `tabIndex`: The tab index of the table. Default: `1`.\n* `selectedClassName`: The class name of a selected row. Default: `'selected'`.\n* `shouldSelectRow(row)`: Function that determines whether `row` is selectable.\nDefault: All rows can be selected.\n* `shouldDeselectRow(row)`: Function that determines whether `row` is deselectable.\nDefault: All rows can be deselected.\n\n```js\nnew TableSelect(document.getElementById('table-id'), {\n  selectedClassName: 'highlighted',\n  shouldSelectRow(row) { return !row.classList.contains('unselectable'); },\n});\n```\n\nYou can configure the default options by setting them via:\n\n```js\nimport { setDefaultOptions } from 'table-select';\n\nsetDefaultOptions({\n  ...\n});\n```\n\n### Events\n\n`table-select` supports five custom events:\n\n* `beforeSelect`\n* `afterSelect`\n* `beforeDeselect`\n* `afterDeselect`\n* `action`\n\nSpecifc information of the event can be found in `event.detail`, e.g.:\n\n```js\nvar table = document.getElementById('table-id');\nvar tableSelect = new TableSelect(table);\n\ntable.addEventListener('beforeSelect', function(event) {\n  console.log('About to select ' + event.detail.row);\n});\n\ntable.addEventListener('action', function(event) {\n  console.log('Perform action for ' + event.detail.rows.length + ' selected row(s)');\n});\n```\n\n## Node\n\n```js\n// npm install table-select\nimport TableSelect from 'table-select';\n\nconst tableSelect = new TableSelect(element, options);\n```\n\n## Contributing\n\nIf you would like to [submit a pull request](https://github.com/rusty1s/table-select/pulls)\nwith any changes you make, please feel free!\nSimply run `npm test` to test and `npm start` to compile before submitting pull requests.\n\n## Issues\n\nPlease use the [GitHub issue tracker](https://github.com/rusty1s/table-select/issues)\nto raise any problems or feature requests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frusty1s%2Ftable-select","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frusty1s%2Ftable-select","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frusty1s%2Ftable-select/lists"}