New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ngx-file-drag-drop

Package Overview
Dependencies
Maintainers
0
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-file-drag-drop

angular material file input component supports file drag and drop, and selection with native file picker

  • 11.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.7K
decreased by-0.3%
Maintainers
0
Weekly downloads
 
Created
Source

ngx-file-drag-drop

Check out the Demo

Install

npm i ngx-file-drag-drop

NgxFileDragDropComponent

selector: <ngx-file-drag-drop>

implements: ControlValueAccessor to work with angular forms

Additionnal properties

NameDescription
@Input() multiple: booleanAllows multiple file inputs, false by default
@Input() accept: stringAny value the native accept attribute can get. Doesn't validate input.
@Input() disabled: booleanDisable the input.
@Input() emptyPlaceholder : stringPlaceholder for empty input, default Drop file or click to select
@Input() displayFileSize : booleanShow file size in chip rather than in tooltip, default false
@Input() activeBorderColor: stringA css color for when file is dragged into drop area, default purple
@Output() valueChanged:EventEmitter<File[]>Event emitted when input value changes
addFiles():(files: File[] | FileList | File) => voidUpdate input
removeFile():(file:File) => voidRemoves the file from the input
clear(): () => voidRemoves all files from the input
files: File[]Getter for form value
isEmpty: booleanWhether the input is empty (no files) or not

BytePipe

Usage:

<span>{{ 104857600 | byteFormat }}</span>

Output: 100 MB

Validators

import { FileValidators } from "ngx-file-drag-drop";
ValidatorDescription
uniqueFileNamesDisallow two files with same file name
fileExtension(ext: string[])Required file extensions
fileType(types: string[] | RegExp)Required Mime Types
maxFileCount(count: number)Max number of files
maxFileSize(bytes: number)Max bytes allowed per file
maxTotalSize(bytes: number)Max total input size
requiredAt least one file required

Keywords

FAQs

Package last updated on 23 Dec 2024

Did you know?

Socket

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.

Install

Related posts

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