{"id":23100102,"url":"https://github.com/dashpilot/lazy-list","last_synced_at":"2025-04-03T20:42:59.037Z","repository":{"id":266864471,"uuid":"899588539","full_name":"dashpilot/lazy-list","owner":"dashpilot","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-06T15:55:21.000Z","size":280,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-09T08:45:13.186Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://lazy-list.vercel.app","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dashpilot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-06T15:22:24.000Z","updated_at":"2025-01-16T23:23:28.000Z","dependencies_parsed_at":"2024-12-06T16:38:01.815Z","dependency_job_id":"ccd13ef7-a11d-405f-8683-09a3472fc316","html_url":"https://github.com/dashpilot/lazy-list","commit_stats":null,"previous_names":["dashpilot/lazy-list"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dashpilot%2Flazy-list","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dashpilot%2Flazy-list/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dashpilot%2Flazy-list/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dashpilot%2Flazy-list/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dashpilot","download_url":"https://codeload.github.com/dashpilot/lazy-list/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247078783,"owners_count":20879950,"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-12-16T23:29:45.386Z","updated_at":"2025-04-03T20:42:59.010Z","avatar_url":"https://github.com/dashpilot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LazyList\n\nLazyList is a vanilla js list editor that allows you to:\n\n-   define input fields for the list items\n-   add new list items\n-   delete list items (with optional confim)\n-   serialize the list\n-   post to an enpoint to save the serialized list (optional)\n\nLazyList works with your existing html, so you have a lot of freedom in the design and fields. The example uses simple Bootstrap styling.\n\n## How to:\n\nFirst define the layout for your list\n\n```html\n\u003cdiv id=\"my-component\" class=\"container mt-5\"\u003e\n    \u003c!-- use a template tag to define the template for the list-items --\u003e\n    \u003ctemplate\u003e\n        \u003cli class=\"list-group-item d-flex gap-3\"\u003e\n            \u003c!-- fields can be anything you like, type: input, textarea or select --\u003e\n            \u003cinput type=\"text\" class=\"form-control\" name=\"title\" placeholder=\"title\" value=\"\" /\u003e\n            \u003cinput type=\"text\" class=\"form-control\" name=\"subtitle\" placeholder=\"subtitle\" value=\"\" /\u003e\n            \u003c!-- the delete button has an attribute of data-action=\"delete\" --\u003e\n            \u003cbutton class=\"btn btn-outline-secondary\" data-action=\"delete\"\u003e-\u003c/button\u003e\n        \u003c/li\u003e\n    \u003c/template\u003e\n\n    \u003c!-- the add button has an attribute of data-action=\"add\" --\u003e\n    \u003cbutton class=\"btn btn-outline-secondary mb-3\" data-action=\"add\"\u003e+\u003c/button\u003e\n\n    \u003cul class=\"list-group\"\u003e\n        \u003c!-- This is where the list items will appear, the element should be a 'ul' --\u003e\n    \u003c/ul\u003e\n\n    \u003c!-- the save button has an attribute of data-action=\"add\" --\u003e\n    \u003cbutton class=\"btn btn-outline-secondary mt-3\" data-action=\"serialize\"\u003eSave\u003c/button\u003e\n\u003c/div\u003e\n```\n\nThen include the js and initialize LazyList:\n\n```html\n\u003cscript src=\"lazy-list.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n    // first parameter is the id of the wrapper\n    // second parameter is an optional url to POST the serialized list to\n    // set the third parameter to true, if you want a confirmation before deleting\n    const myLazyList = new LazyList('#my-component', false, true);\n\u003c/script\u003e\n```\n\n## How to build\n\nTo build a minified version of the script, run:\n\n```bash\nnpm run build\n```\n\nThis will output a minified version in the `public` folder\n\n## Live demo\n\nhttps://lazy-list.vercel.app/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdashpilot%2Flazy-list","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdashpilot%2Flazy-list","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdashpilot%2Flazy-list/lists"}