Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@elemental-concept/drag-and-drop
Advanced tools
Readme
Use this library if you need a simple drag and drop
solution. The library will return a list of files File[]
.
npm i --save @elemental-concept/drag-and-drop
Add DragAndDropModule
to your Module
imports section.
import { DragAndDropModule } from '@elemental-concept/drag-and-drop';
@NgModule({
imports: [
DragAndDropModule
]
})
export class TestModule {
}
<drag-and-drop>
into your template.multiple
as flag (by default true
) to allow multiple files upload or single file upload.When files are dropped into the dropZone
the @Output fileDropped
will send a File[]
object as event.
<drag-and-drop (fileDropped)="onFileUpload($event)">
<mat-icon>cloud_upload</mat-icon>
<h4>
Drag and drop your files
<br>or<br>
Click to browse your files
</h4>
</drag-and-drop>
<div class="files-list" *ngIf="files.length > 0">
<h4>List of file names</h4>
<div class="file" *ngFor="let fileName of files">{{ fileName }}</div>
</div>
@Component({
selector: 'app-drag-and-drop-page',
template: './drag-and-drop-page.component.html',
styleUrls: ['./drag-and-drop-page.component.scss']
})
export class DragAndDropPageComponent {
files: string[] = [];
onFileUpload = (files: File[]) => {
this.files = files.map(file => file.name);
};
}
The component contain a hidden input and uses the dropZone
directive in the main container.
Inside the main container there's a <ng-content></ng-content>
to allow any kind of info presentation.
To change the css style just use css variables into your main style.scss
file.
Here you can find the default values:
:root {
--drag-and-drop-height: auto;
--drag-and-drop-width: 400px;
--drag-and-drop-padding: 12px 16px;
--drag-and-drop-border: dashed 1px #6091dc;
--drag-and-drop-margin: 0 auto;
--drag-and-drop-background: #a0cee0;
}
FAQs
Use this library if you need a simple `drag and drop` solution. The library will return a list of files `File[]`.
The npm package @elemental-concept/drag-and-drop receives a total of 143 weekly downloads. As such, @elemental-concept/drag-and-drop popularity was classified as not popular.
We found that @elemental-concept/drag-and-drop demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.