5.0.0 • Published 4 years ago

@reachalpha/movable v5.0.0

Weekly downloads
89
License
MIT
Repository
github
Last release
4 years ago

@reachalpha/movable npm version

This is an angular directive that helps you move HTMLElements in Angular.

How to use

Installing and Usage

npm install --save @reachalpha/movable

Add the libary to a module's imports' array (i.e. app.module.ts)

import {MovableModule} from '@reachalpha/movable';

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

Add it to your HTML Element (i.e. app.component.html)

<div style="position: relative; width: 100%; height: 100%" #container>

  <div libMovable [relativeTo]="container" direction="left"
    style="position: absolute; left: 0; top: 0; width: 50px; height: 50px">
  </div>

</div>

Available configuration properties:

PropertyDescriptionRequired / DefaultType
relativeToparent elementrequiredHTMLElement
directiondirection the element is suposed to moverequired'left', 'right', 'top'
minSizeminimum size of the element after moving it0 or handlerSizenumber (px)
otherElementelement next to the one moving that adapts to itvoidHTMLElement
handlerSizesize of the element that allows the moving10number (px)
handlerInsideput the handler inside the elementfalseboolean
clickToggleif clicking the handler opens or closes the elementtrueboolean
toggleElement that opens / closes the element on clicknullHTMLElement
classOpenclass that is added to the toggle when the element is openednullstring
classCloseclass that is added to the toggle when the element is closednullstring

Available events:

EventDescriptionType
positionChangedSends an event every time the element changes its positionnumber
openedsends an event if the element is considered openvoid
minSizesends an event if the element is considered openvoid
5.0.0

4 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.1

5 years ago