npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ngx-file-drag-drop

v9.0.0

Published

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

Downloads

4,929

Readme

ngx-file-drag-drop

Check out the Demo

Install

npm i ngx-file-drag-drop

API reference

NgxFileDragDropModule

import { NgxFileDragDropModule } from 'ngx-file-drag-drop';

@NgModule({
  imports: [
    // the module for this lib
    NgxFileDragDropDropModule
  ]
})

NgxFileDragDropComponent

selector: <ngx-file-drag-drop>

implements: ControlValueAccessor to work with angular forms

Additionnal properties

| Name | Description | | -------------------------------------------------------- | ------------------------------------------------------------------------ | | @Input() multiple: boolean | Allows multiple file inputs, false by default | | @Input() accept: string | Any value the native accept attribute can get. Doesn't validate input. | | @Input() disabled: boolean | Disable the input. | | @Input() emptyPlaceholder : string | Placeholder for empty input, default Drop file or click to select | | @Input() displayFileSize : boolean | Show file size in chip rather than in tooltip, default false | | @Input() activeBorderColor: string | A 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) => void | Update input | | removeFile():(file:File) => void | Removes the file from the input | | clear(): () => void | Removes all files from the input | | files: File[] | Getter for form value | | isEmpty: boolean | Whether 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";

| Validator | Description | | ------------------------------------- | -------------------------------------- | | uniqueFileNames | Disallow 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 | | required | At least one file required |