Coder Social home page Coder Social logo

zestia / ember-dragula Goto Github PK

View Code? Open in Web Editor NEW
16.0 17.0 8.0 8.16 MB

๐Ÿ–ฑ๏ธ An ember addon for drag and drop via dragula

License: MIT License

JavaScript 78.30% HTML 8.01% CSS 0.87% Handlebars 12.82%
ember dragula sortable drag-and-drop

ember-dragula's Introduction

@zestia/ember-dragula

Ember Observer

This Ember addon provides support for drag and drop using dragula

Installation

ember install @zestia/ember-dragula

Add the following to ~/.npmrc to pull @zestia scoped packages from Github instead of NPM.

@zestia:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=<YOUR_GH_TOKEN>

Demo

https://zestia.github.io/ember-dragula

Example

<Dragula as |Container|>
  <Container>
    {{#each this.listOne as |item|}}
      {{item}}
    {{/each}}
  </Container>

  <Container>
    {{#each this.listTwo as |item|}}
      {{item}}
    {{/each}}
  </Container>
</Dragula>

Dragula

Arguments

@options

Optional. The full range of options that dragula accepts are supported, see the docs.

@onReady

Optional. The dragula instance is emitted via this action, allowing access to the drake API.

@on<Event>

Optional. The full range of events that dragula emits are supported, see the docs. These can be accessed by prefixing the event name with "on", e.g. @onDrag

Test helpers

To simulate dragging and dropping, test helpers are provided.

Example
import { simulateDragDrop } from '@zestia/ember-dragula/test-support/helpers/simulate-drag-drop';

Within a test:

const dragMe = find('.drag-me');
const dropHere = find('.drop-here');

await simulateDrag(dragMe);
await simulateDrop(dragMe, dropHere);
await simulateDragDrop(dragMe, dropHere);

ember-dragula's People

Contributors

amk221 avatar dependabot[bot] avatar ember-tomster avatar karl-sjogren avatar lvegerano avatar mikerhyssm avatar philliphaines avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ember-dragula's Issues

How work with lists updates?

Hi,

I saw you uses did-insert and will-destroy modifiers, but not did-update.
Maybe i can help with this? How you see realization?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.