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

@unihanlin/abp-uppy-upload-service

v3.0.0

Published

A upload service for Angular UI of ABP framework, base on UPPY.

Downloads

4

Readme

AbpUppyUploadService

A upload service for Angular UI of ABP framework, base on UPPY.

Install

npm install @unihanlin/abp-uppy-upload-service

Setup

The AbpUppyUploadService use front-end localizations for UI display. You need import the AbpUppyUploadServiceModule to use the AbpUppyUploadService.

import { AbpUppyUploadServiceModule } from '@unihanlin/abp-uppy-upload-service';

@NgModule({
  imports: [
    // other imports
    AbpUppyUploadServiceModule,
  ],
  // rest of the module metadata
})
export class YourModule {}

Import uppy styles for UI plugins.

@import '~@uppy/core/dist/style.css';
@import '~@uppy/dashboard/dist/style.css';

Now you can use the AbpUppyUploadService.

<button type="button" class="btn btn-primary me-3" id="uppy-upload">Uppy Upload</button>
import { AbpUppyUploadService } from '@unihanlin/abp-uppy-upload-service';

constructor(private uppyUploadService: AbpUppyUploadService) {}

  ngAfterViewInit(): void {
    this.uppyUploadService.initUppy(
      '#uppy-upload',
      {
        url: '/api/AbpUppyUploadService/sample/upload',
        apiName: 'AbpUppyUploadService',
      },
      {
        fieldName: 'file',
      },
      {
        maxNumberOfFiles: 1,
        maxFileSize: 5242880,
        allowedFileTypes: ['.xlsx', '.doc', 'docx'],
      },
      { text: 'Some additional text.' }
    );
  }

initUppy

  initUppy(
    trigger: UppyRest.Trigger,
    config: UppyRest.Config,
    xhr?: UppyRest.Xhr,
    restrictions?: UppyRest.Restrictions,
    params?: UppyRest.Params,
    uploadSuccessCallBack?: (file: UppyFile<{}, {}>, result: any) => void
  ) => void;
  • trigger: String with a CSS selector for a button that will trigger opening the Dashboard modal. Several buttons or links can be used, as long as they are selected using a class selector (.select-file-button, for example).
  • config: { url: string; apiName: string; }.
  • xhr: . Partial<{ fieldName: string; timeout: number; formData: boolean; bundle: boolean; }>.
    • fieldName: 'file', when formData is set to true, this is used as the form field name for the file to be uploaded. It defaults to 'files' if bundle option is set to true, otherwise it defaults to 'file'.
    • timeout: 30 * 1000, when no upload progress events have been received for this amount of milliseconds, assume the connection has an issue and abort the upload. Note that unlike the XMLHttpRequest.timeout property, this is a timer between progress events: the total upload can take longer than this value. Set to 0 to disable this check. The default for the timeout is 30 seconds.
    • formData: true, configures whether to use a multipart form upload, using FormData. This works similarly to using a element with an <input type="file"> for uploads. When set to true, file metadata is also sent to the endpoint as separate form fields. When set to false, only the file contents are sent.
    • bundle: false, send all files in a single multipart request. When bundle is set to true, formData must also be set to true.
  • restrictions: Partial<{ maxFileSize: number; minFileSize: number; maxTotalFileSize: number; maxNumberOfFiles: number; minNumberOfFiles: number; allowedFileTypes: string[]; }>.
    • maxFileSize: null | number — maximum file size in bytes for each individual file
    • minFileSize: null | number — minimum file size in bytes for each individual file
    • maxTotalFileSize: null | number — maximum file size in bytes for all the files that can be selected for upload
    • maxNumberOfFiles: null | number — total number of files that can be selected
    • minNumberOfFiles: null | number — minimum number of files that must be selected before the upload
    • allowedFileTypes: null | array of wildcards image/*, exact mime types image/jpeg, or file extensions .jpg: ['image/_', '.jpg', '.jpeg', '.png', '.gif']
  • params: Used for passing things like public keys, usenames, tags and so on.
  • uploadSuccessCallBack: Fired each time a single upload is completed.