Security News
Research
Supply Chain Attack on Rspack npm Packages Injects Cryptojacking Malware
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
@angular-skyhook/sortable
Advanced tools
@angular-skyhook/core
@angular-skyhook/sortable
Make sure you have @angular-skyhook/core
and a backend installed, ideally @angular-skyhook/multi-backend
. Read the core docs first, and make sure you have a firm grasp on it.
yarn add @angular-skyhook/sortable
Then add SkyhookSortableModule
where required.
import { SkyhookSortableModule } from '@angular-skyhook/sortable';
@NgModule({
imports: [
// ...
// SkyhookDndModule.forRoot( ... ),
SkyhookSortableModule,
]
})
export class AppModule {}
This is different from the hundreds of other sortable libraries, because it is extremely pared back, and makes almost no limiting choices. This is NOT opinionated software.
SortableSpec
to define behaviour, much like a DragSourceSpec or DropTargetSpec but abstracted over a whole sortable and all elements in it.@angular-skyhook/core
to alter visuals as you see fit.So yes, it's a bit harder to use than, say, ng2-dragula
. Does the extra implementation effort pay off? There are so many cool uses, this section needs headings.
DragSource.listen()
, so apply your own classes based on isDragging
and friends.[dragPreview]
or <skyhook-preview>
) like any other Skyhook item. Useful for making multi-select. Or axis snapping. Or showing warning messages ('you can't drop that here') alongside your mouse. Go for your life.[dragSource]
on something else.mat-table
s, or any other list component.[ssExternal]
).FormArray
or Immutable.js
, because the library doesn't care. (Although you can do native but immutable updates with immer
instead).@ngrx/store
(some helpers make this even easier).@angular-skyhook/core
item, returned from beginDrag
. In sortables, all these items are DraggedItem
objects.<skyhook-preview>
from the multi-backend.*ngFor
data and index.Hint: The best way to get started is by reading the example code.
Here's a rough guide:
SortableSpec
is the data backing interface for your sortable. It defines
the Skyhoook type, what happens when you hover on a new spot, drop an item,
etc. Maybe you want to overwrite a list on a single component, maybe you are
firing @ngrx/store
actions. You must implement it according to the
requirements and lifecycle.
For simpler list displays, make a container with <skyhook-sortable-list>
and provide it an <ng-template ssTemplate let-context>
for each element.
For more complicated rendering situations, use ssSortable
directive
directly, and render an *ngFor
inside it, pulling out let i = index
as
well.
In both options, for each draggable element, you need an
[ssRender]="context"
directive, which you need to get a reference to, and to
finally attach [dragSource]="render.source"
somewhere.
FAQs
[![Build Status](https://travis-ci.org/cormacrelf/angular-skyhook.svg?branch=master)](https://travis-ci.org/cormacrelf/angular-skyhook) [![npm](https://img.shields.io/npm/v/@angular-skyhook/core.svg)](https://www.npmjs.com/package/@angular-skyhook/core)
The npm package @angular-skyhook/sortable receives a total of 68 weekly downloads. As such, @angular-skyhook/sortable popularity was classified as not popular.
We found that @angular-skyhook/sortable demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.
Security News
Sonar’s acquisition of Tidelift highlights a growing industry shift toward sustainable open source funding, addressing maintainer burnout and critical software dependencies.