{"id":14990196,"url":"https://github.com/emiliorizzo/vue-dialog-drag","last_synced_at":"2025-04-07T05:15:01.068Z","repository":{"id":22749416,"uuid":"97216275","full_name":"emiliorizzo/vue-dialog-drag","owner":"emiliorizzo","description":"Simple vue draggable dialog","archived":false,"fork":false,"pushed_at":"2023-01-06T01:36:00.000Z","size":4927,"stargazers_count":175,"open_issues_count":33,"forks_count":33,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-04-15T08:04:57.395Z","etag":null,"topics":["dialog","draggable","touch","ui-components","vue","vue2","webcomponent"],"latest_commit_sha":null,"homepage":"https://emiliorizzo.github.io/vue-dialog-drag/","language":"Vue","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/emiliorizzo.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":"2017-07-14T09:18:23.000Z","updated_at":"2023-04-20T15:42:41.000Z","dependencies_parsed_at":"2023-01-11T21:45:14.194Z","dependency_job_id":null,"html_url":"https://github.com/emiliorizzo/vue-dialog-drag","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emiliorizzo%2Fvue-dialog-drag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emiliorizzo%2Fvue-dialog-drag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emiliorizzo%2Fvue-dialog-drag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emiliorizzo%2Fvue-dialog-drag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emiliorizzo","download_url":"https://codeload.github.com/emiliorizzo/vue-dialog-drag/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247595335,"owners_count":20963943,"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":["dialog","draggable","touch","ui-components","vue","vue2","webcomponent"],"created_at":"2024-09-24T14:19:41.515Z","updated_at":"2025-04-07T05:15:01.040Z","avatar_url":"https://github.com/emiliorizzo.png","language":"Vue","funding_links":[],"categories":["UI Components [🔝](#readme)","UI组件","Components \u0026 Libraries","UI Components"],"sub_categories":["覆盖","UI Components","Overlay"],"readme":"\n[![GitHub issues](https://img.shields.io/github/issues/emiliorizzo/vue-dialog-drag.svg)](https://github.com/emiliorizzo/vue-dialog-drag/issues) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/emiliorizzo/vue-dialog-drag/master/LICENSE) [![npm](https://img.shields.io/npm/v/vue-dialog-drag.svg)](https://www.npmjs.com/package/vue-dialog-drag)\n\n## vue-dialog-drag\n\n\u003e Simple draggable dialog\n\n[Demo](https://emiliorizzo.github.io/vue-dialog-drag/)\n\nFeatures:\n\n- Drag \u0026 Drop\n- Touch support *(only for drag, not for drop)*\n- Drop area component\n- 'Pin mode', to lock drag.\n\n## Installation\n\n``` bash\nnpm install vue-dialog-drag --save\n\n```\n## Usage\n \nImport and register component\n\n``` javascript\nimport DialogDrag from 'vue-dialog-drag'\n\nexport default{\n  ...\n  components:{\n    DialogDrag\n  }\n}\n```\n\ninclude css \n``` html\n\u003cstyle src='vue-dialog-drag/dist/vue-dialog-drag.css'\u003e\u003c/style\u003e\n\n```\nOr import source component from: 'vue-dialog-drag/src/vue-dialog-drag.vue'\nAnd install devDependencies. (stylus and pug) \nsee [package.json](https://github.com/emiliorizzo/vue-dialog-drag/blob/master/package.json))\n\n## Examples \n\n#### Single file component\n```html\n\u003ctemplate\u003e\n  \u003cdiv id=\"app\"\u003e\n    \u003cdialog-drag id=\"dialog-1\"\u003e\n      \u003cp\u003e Test dialog\u003c/p\u003e\n    \u003c/dialog-drag\u003e\n    \u003cdrop-area @drop='drop'\u003e\n      \u003cp\u003eDrop Here\u003c/p\u003e\n    \u003c/drop-area\u003e\n  \u003c/div\u003e\n\u003c/template\u003e\n\n\u003cscript\u003e  \nimport DialogDrag from 'vue-dialog-drag'\nimport DropArea from 'vue-dialog-drag/dist/drop-area'\nexport default {\n  name: 'app',\n  components: {\n    DialogDrag,\n    DropArea\n  },\n  methods: {\n    drop (id) {\n      console.log('drop id:', id)\n    }\n  }\n}\n\u003c/script\u003e\n\n\u003cstyle src=\"vue-dialog-drag/dist/vue-dialog-drag.css\"\u003e\u003c/style\u003e\n\u003cstyle src=\"vue-dialog-drag/dist/drop-area.css\"\u003e\u003c/style\u003e\n\n\u003c!-- optional dialog styles, see example --\u003e\n\u003cstyle src=\"vue-dialog-drag/dist/dialog-styles.css\"\u003e\u003c/style\u003e\n\n```\n#### html\n \n  [See this fiddle](https://jsfiddle.net/emii/g7hojq7m/)\n\n## Dialog Component\n### Slots\n\n  - title: dialog title. If you don't need formatted title, use 'title' prop.  \n  - button-pin: content for pin button\n  - button-pinned: content for pin button when dialog is pinned\n  - button-close: content for close button\n\n### Props\n\n- id: *Unique id for dialog*\n- title: *Dialog title*\n- eventCb: Function(props Object)\n- options: **Object**\n  - left: **Number**\n  - top: **Number**\n  - zIndex: **Number**\n  - x: *alias of left*\n  - y: *alias of top*\n  - z: *alias of zIndex*\n  - width: **Number** *(0 or null to auto)*\n  - height: **Number** *(0 or null to auto)*\n  - buttonPin: **Boolean**\n  - buttonClose:**Boolean**\n  - dragCursor: css cursor to show when drag is enabled\n  - centered: \"viewport\" | \"parent\" , center dialog to viewport or parent element\n  - pinned: **Boolean**, disable/enable drag\n  - dropEnabled: **Boolean**, handle drag with mouse events, instead of drag events \n\n\n### Events\n  \n  All event emits an object: { id, left, top, x, y, z, width, height, pinned }\n  You can format it, whith 'eventCb' prop.\n\n- **load**: fired on mounted\n- **focus**: fired on click and touch\n- **pin**: fired on pin / unpin dialog\n- **drag-start**: fired on dragstart\n- **move**: fired when move dialog\n- **drag-end**: fired on dragend\n- **close**: fired when close dialogs\n\n### Css\n  \n  The main container has class **.dialog-drag**, and .**dialog-drag** **.fixed** when dialog is pinned\n\n  You can import extra dialog styles from dist/dialog-styles.css.\n\n  view: [example styles](https://github.com/emiliorizzo/vue-dialog-drag/blob/master/src/dialog-styles.styl) \n\n## Drop area component\n\n## Slots\n  \n  **Over**: content rendered when the dialog is dragged over drop area.\n\n## Events\n  \n  **drop**: fired when drop the dialog, emits dialog id.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femiliorizzo%2Fvue-dialog-drag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femiliorizzo%2Fvue-dialog-drag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femiliorizzo%2Fvue-dialog-drag/lists"}