Socket
Socket
Sign inDemoInstall

@swimlane/ngx-dnd

Package Overview
Dependencies
Maintainers
2
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@swimlane/ngx-dnd - npm Package Compare versions

Comparing version 1.0.0 to 1.0.2

CHANGELOG.md

17

package.json
{
"name": "@swimlane/ngx-dnd",
"version": "1.0.0",
"version": "1.0.2",
"description": "Drag and Drop for Angular2 and beyond!",
"main": "release/index.js",
"typings": "release/index.d.ts",
"files": [
"release"
],
"scripts": {

@@ -13,3 +16,3 @@ "check": "npm-check --skip-unused",

"lint": "tslint \"./src/{,**/}*.ts\" \"./demo/{,**/}*.ts\"",
"version": "npm run release",
"version": "chg release -y && git add -A CHANGELOG.md && npm run release",
"preversion": "npm test",

@@ -28,4 +31,2 @@ "postversion": "git push && git push --tags",

"build:css": "postcss --use autoprefixer dist/*.css -d dist/",
"copy:build": "cpx src/**/* build",
"copy:styles": "cpx build/**/*.css release",
"watch": "webpack --display-error-details --watch",

@@ -35,3 +36,3 @@ "start": "webpack-dev-server",

"release": "npm-run-all build:release",
"package": "npm-run-all -s clean copy:build build:sass package:replace-scss package:aot build:package package:replace package:minify copy:styles clean:build",
"package": "npm-run-all -s clean build:package package:replace package:minify",
"package:ts": "tsc --outDir release",

@@ -92,2 +93,3 @@ "package:aot": "ngc -p tsconfig-aot.json",

"awesome-typescript-loader": "~3.0.0-beta.10",
"chg": "^0.3.2",
"clean-webpack-plugin": "^0.1.15",

@@ -98,3 +100,3 @@ "codelyzer": "0.0.28",

"cpx": "^1.5.0",
"cross-env": "^3.1.4",
"cross-env": "^3.2.3",
"css-loader": "^0.26.1",

@@ -118,2 +120,3 @@ "extract-text-webpack-plugin": "2.0.0-beta.4",

"node-sass": "^4.3.0",
"npm-check": "^5.4.0",
"npm-run-all": "^4.0.1",

@@ -135,3 +138,3 @@ "postcss": "^5.2.11",

"typescript": "~2.0.10",
"uglify-js": "^2.7.5",
"uglify-js": "^2.8.12",
"url-loader": "^0.5.7",

@@ -138,0 +141,0 @@ "webpack": "^2.2.1",

# ngx-dnd
## Status
🕶 Drag, Drop and Sorting Library for Angular2 and beyond!
**WIP**
*Note: This project is under heavy construction. As such, the API may change dramatically between major releases and documentation is lacking.*

@@ -14,3 +14,126 @@ ## Features

- Touch support
- Templating
## Quick intro and examples
### Directives
`ngx-dnd` provides a base set of directives to enable drag-and-drop. By default all children of a `ngxDroppable` element may be dragged and dropped. Add the `ngxDraggable` to restrict drag-and-drop to the parent container.
```html
<div class="ngx-dnd-container" ngxDroppable>
<div class="ngx-dnd-item" ngxDraggable>Item 1</div>
<div class="ngx-dnd-item" ngxDraggable>Item 2</div>
<div class="ngx-dnd-item" ngxDraggable>Item 3</div>
</div>
```
Give multiple containers the same `dropZone` name to allow drag-and-drop between these containers.
```html
<div class="ngx-dnd-container" ngxDroppable="example">
<div class="ngx-dnd-item" ngxDraggable>Item 1a</div>
<div class="ngx-dnd-item" ngxDraggable>Item 2a</div>
<div class="ngx-dnd-item" ngxDraggable>Item 3a</div>
</div>
<div class="ngx-dnd-container" ngxDroppable="example">
<div class="ngx-dnd-item" ngxDraggable>Item 1b</div>
<div class="ngx-dnd-item" ngxDraggable>Item 2b</div>
<div class="ngx-dnd-item" ngxDraggable>Item 3b</div>
</div>
```
`ngxDraggable` items can be restricted to specific containers:
```html
<div class="ngx-dnd-container" ngxDroppable>
<div class="ngx-dnd-item" ngxDraggable="['example-target']">Item 1a</div>
<div class="ngx-dnd-item" ngxDraggable="['example-target']">Item 2a</div>
<div class="ngx-dnd-item" ngxDraggable="['example-target']">Item 3a</div>
</div>
<div class="ngx-dnd-container" ngxDroppable="example-target">
<div class="ngx-dnd-item" ngxDraggable>Item 1b</div>
<div class="ngx-dnd-item" ngxDraggable>Item 2b</div>
<div class="ngx-dnd-item" ngxDraggable>Item 3b</div>
</div>
```
### Components
`ngx-dnd` provides a set of components that encapsulates the directives mentioned and adds capability for data driven structures.
```html
<ngx-dnd-container
[model]="orderableLists">
</ngx-dnd-container>
```
```js
orderableLists = [
[
"Item 1a",
"Item 2a",
"Item 3a"
],
[
"Item 1b",
"Item 2b",
"Item 3b"
]
]
```
Including nested containers:
```html
<ngx-dnd-container
[model]="nestedLists">
</ngx-dnd-container>
```
```js
nestedLists = [
{
"label": "Item 1",
"children": []
},
{
"label": "Item 2",
"children": [
{
"label": "Item 2a",
"children": []
},
{
"label": "Item 2b",
"children": []
},
{
"label": "Item 2c",
"children": []
}
]
},
{
"label": "Item 3",
"children": [
{
"label": "Item 3a",
"children": []
},
{
"label": "Item 3b",
"children": []
},
{
"label": "Item 3c",
"children": []
}
]
}
]
```
See [https://swimlane.github.io/ngx-dnd/](https://swimlane.github.io/ngx-dnd/) for more lives examples. Demo code is at [https://github.com/swimlane/ngx-dnd/tree/master/demo](https://github.com/swimlane/ngx-dnd/tree/master/demo).
## Install

@@ -17,0 +140,0 @@ To use ngx-dnd in your project install it via [npm](https://www.npmjs.com/package/@swimlane/ngx-dnd):

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc