{"id":26409792,"url":"https://github.com/erikvullings/mithril-table","last_synced_at":"2025-03-17T19:36:57.655Z","repository":{"id":44979511,"uuid":"179936226","full_name":"erikvullings/mithril-table","owner":"erikvullings","description":"An editable table component for Mithril","archived":false,"fork":false,"pushed_at":"2023-01-05T02:30:37.000Z","size":1464,"stargazers_count":1,"open_issues_count":15,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-16T08:15:35.242Z","etag":null,"topics":["contenteditable","mithril","mithril-components","table"],"latest_commit_sha":null,"homepage":"https://erikvullings.github.io/mithril-table","language":"TypeScript","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/erikvullings.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":"2019-04-07T08:16:48.000Z","updated_at":"2021-09-13T10:12:45.000Z","dependencies_parsed_at":"2023-02-03T06:15:23.368Z","dependency_job_id":null,"html_url":"https://github.com/erikvullings/mithril-table","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikvullings%2Fmithril-table","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikvullings%2Fmithril-table/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikvullings%2Fmithril-table/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikvullings%2Fmithril-table/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erikvullings","download_url":"https://codeload.github.com/erikvullings/mithril-table/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244097789,"owners_count":20397677,"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":["contenteditable","mithril","mithril-components","table"],"created_at":"2025-03-17T19:36:56.997Z","updated_at":"2025-03-17T19:36:57.637Z","avatar_url":"https://github.com/erikvullings.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mithril-table\n\nA Mithril component for generating an editable table.\n\nFeatures:\n\n- Specify the header names\n- Specify the column order (using the header order)\n- Disable the table, making it an ordinary table\n- Adding, deleting, moving and sorting rows\n\n## Installation\n\nPull it from [npm](https://www.npmjs.com/package/mithril-table).\n\n```bash\nnpm i mithril mithril-table\n# Also install the typings if you use TypeScript\nnpm i --save-dev @types/mithril\n```\n\n## Usage example\n\n```ts\nimport { EditableTable, IEditableTable } from 'mithril-table';\nimport m from 'mithril';\n\n...\n  interface IPerson { id: number; first: string; last: string; }\n\n  const state = {\n    data: [{\n      id: 1,\n      first: 'John',\n      last: 'Doe',\n    }, {\n      id: 2,\n      first: 'Jane',\n      last: 'Doe',\n    }, {\n      id: 3,\n      first: 'Bob',\n      last: 'Bear',\n    }] as IPerson[],\n  };\n\n  m(EditableTable, {\n    // Optional, to specify the order of the columns and their header\n    headers: [\n      { column: 'id', title: 'ID' },\n      { column: 'first', title: 'First name' },\n      { column: 'last', title: 'Last name' },\n    ],\n    data: state.data,\n    addRows: true,\n    deleteRows: true,\n    moveRows: true,\n    // disabled: true,\n    // sortRows: false,\n    onchange: (data) =\u003e {\n      state.data = data;\n      console.table(data);\n    },\n  } as IEditableTable\u003cIPerson\u003e),\n\n```\n\n## Build instructions\n\nUsing `pnpm` (`npm i -g pnpm`), run the following commands:\n\n```bash\npnpm m i\nnpm start\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferikvullings%2Fmithril-table","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferikvullings%2Fmithril-table","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferikvullings%2Fmithril-table/lists"}