@swimlane/ngx-dnd
Advanced tools
Comparing version 1.0.0 to 1.0.2
{ | ||
"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", |
127
README.md
# 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): |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 2 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
2266
147
5
170242
66
8
1
7