{"id":15379307,"url":"https://github.com/yaireo/dragsort","last_synced_at":"2025-04-15T06:09:34.329Z","repository":{"id":33788360,"uuid":"161476163","full_name":"yairEO/dragsort","owner":"yairEO","description":"Animated drag sorting for horizontal list items ","archived":false,"fork":false,"pushed_at":"2024-04-16T13:02:07.000Z","size":1495,"stargazers_count":32,"open_issues_count":2,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-15T06:09:26.339Z","etag":null,"topics":["drag-and-drop","javascript","sort","sorting"],"latest_commit_sha":null,"homepage":null,"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/yairEO.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-12T11:06:46.000Z","updated_at":"2025-02-23T16:21:57.000Z","dependencies_parsed_at":"2024-06-20T23:27:57.679Z","dependency_job_id":"680009e1-4c84-48ff-b518-1df6b7f7c197","html_url":"https://github.com/yairEO/dragsort","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yairEO%2Fdragsort","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yairEO%2Fdragsort/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yairEO%2Fdragsort/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yairEO%2Fdragsort/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yairEO","download_url":"https://codeload.github.com/yairEO/dragsort/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249016627,"owners_count":21198833,"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":["drag-and-drop","javascript","sort","sorting"],"created_at":"2024-10-01T14:18:45.980Z","updated_at":"2025-04-15T06:09:34.303Z","avatar_url":"https://github.com/yairEO.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca align=\"center\" title=\"See live demo\" href=\"https://codepen.io/vsync/pen/3f6b998fa1bb1b7c7f74ec89152f39f9/?editors=0100\"\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cbr\u003e\n  \u003ca href='https://codepen.io/vsync/pen/KKMwyRO'\u003e\n      \u003cimg src=\"./demo.apng?sanitize=true\" alt=\"Knobs\"/\u003e\n  \u003c/a\u003e\n\u003cbr\u003e\n\u003cp\u003e\n\n\u003c/a\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href='https://www.npmjs.com/package/@yaireo/dragsort'\u003e\n      \u003cimg src=\"https://img.shields.io/npm/v/@yaireo/dragsort.svg\" /\u003e\n  \u003c/a\u003e\n  \u003ca href='https://simple.wikipedia.org/wiki/MIT_License'\u003e\n      \u003cimg src=\"https://img.shields.io/badge/license-MIT-lightgrey\" /\u003e\n  \u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/bundlephobia/minzip/@yaireo/dragsort\" /\u003e\n  \u003cimg src=\"https://img.shields.io/npm/dw/@yaireo/dragsort\" /\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003e\u003ca href=\"https://codepen.io/vsync/pen/3f6b998fa1bb1b7c7f74ec89152f39f9/?editors=0100\"\u003eDragSort\u003c/a\u003e \u003cbr\u003e\u003csmall\u003elightweight HTML5 drag-\u0026-drop sorting\u003c/small\u003e\u003c/h1\u003e\n\n\n## Installation\n```sh\nnpm i @yaireo/dragsort --save\n```\n\n## Pre-setup suggestions:\n\n* Set `box-sizing: border-box` on the list or its children is a good idea\n* Use the provided stylesheet in this package - `dist/dragsort.css`\n\n## Usage\n\n#### HTML\n```html\n\u003cul class=\"list\"\u003e\n    \u003cli\u003edrag \u0026 drop\u003c/li\u003e\n    \u003cli\u003eitems\u003c/li\u003e\n    \u003cli\u003eeasily\u003c/li\u003e\n    \u003cli\u003ewith this\u003c/li\u003e\n    \u003cli\u003esuper lightweight script\u003c/li\u003e\n\u003c/ul\u003e\n```\n\n#### javascript\n```js\nimport DragSort from '@yaireo/dragsort'\nimport '@yaireo/dragsort/dist/dragsort.css'\n\nconst listElm = document.querySelector('.list')\nconst dragSort = new DragSort(listElm)\n```\n\n\u003e Note - useful *class* names are set on elements being dragged.\n\n## Settings\n\nName                    | Type        | Default                                    | Info\n----------------------- | ----------- | ------------------------------------------ | --------------------\nselector                | `String`    | all child nodes of first parameter         | which elements should be draggable\nmode                    | `String`    |                                            | Use `\"vertical\"` for vertical-lists re-ordering\ncallbacks.dragStart     | `Function`  |                                            | callback function when dragging started. Arguments are `(element, event)`\ncallbacks.dragEnd       | `Function`  |                                            | callback function when dragging finished. Arguments are `(element, event)`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaireo%2Fdragsort","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyaireo%2Fdragsort","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaireo%2Fdragsort/lists"}