GithubHelp home page GithubHelp logo

oosor / d-d-material-style Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 140 KB

drag and drop with material style

License: MIT License

TypeScript 93.18% CSS 6.82%
drag-drop material-style angular2 angular4 angular5

d-d-material-style's Introduction

d-d-material-style

drag and drop with material style

Demo

https://angular-jd6bgy.stackblitz.io or stackblitz editor

Install

npm i d-d-material-style --save

Setup

import { DDMaterialStyleModule } from 'd-d-material-style';

@NgModule({
  ...
  imports:      [ ..., DDMaterialStyleModule ],
  ...
})

Use Directive

<div ddMatStyle>Dragable div</div>
<div class="limit-box" #container>
  <div ddMatStyle config="{container: container}">Dragable div inner div.limit-box</div>
</div>

Directive config

@Input() config: {container: any, direction?: 'x' | 'y' | 'grid', matClick?: boolean, shadow?: boolean, elem?: any, swipe?: string, autoWidth?: boolean, autoHeight?: boolean}
@Input() draggable: boolean;
@Input() laterInit: boolean;
@Output() dChange: EventEmitter<IEvent>
@Output() dDrop: EventEmitter<IEvent>
IEvent = {
  type: 'change' | 'drop';
  point: {...};
  elem: {...} | any;
  collection: {...}[] | any;
}

See at example.

Use Component with Directive

<div class="vertical-box" #container>
  <d-d-material-style [config]="{container: container, direction: 'y', shadow: true}">
    <div class='item {{ el.style }}' *ngFor="let el of miniCollect" ddMatStyle>
      <span>{{ el.data }}</span>
    </div>
  </d-d-material-style>
</div>

Component config

@Input() config: {container: any, direction?: 'x' | 'y' | 'grid', matClick?: boolean, shadow?: boolean, collection?: any[], swipe?: string, autoWidth?: boolean, autoHeight?: boolean}
@Input() draggable: boolean;
@Input() laterInit: boolean;
@Output() dChange: EventEmitter<IEvent>
@Output() dDrop: EventEmitter<IEvent>

See at example.

d-d-material-style's People

Contributors

oosor avatar

Watchers

 avatar  avatar

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.