Compare commits

..

1 Commits

Author SHA1 Message Date
Koen van der Linden
385c322d3d feat(fileUploader): Added queueMaxSizeLimit, to limit the file size of all items in the uploadqueue. 2018-04-03 10:43:14 +02:00
24 changed files with 203 additions and 18791 deletions

57
.angular-cli.json Normal file
View File

@@ -0,0 +1,57 @@
{
"project": {
"name": "ng2-file-upload"
},
"apps": [
{
"root": "demo/src",
"outDir": "demo/dist",
"assets": [
"assets"
],
"index": "index.html",
"main": "main.ts",
"test": "../../scripts/test.ts",
"tsconfig": "tsconfig.json",
"prefix": "",
"mobile": false,
"styles": [
],
"scripts": [
],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"addons": [],
"packages": [],
"e2e": {
"protractor": {
"config": "protractor.conf.js"
}
},
"test": {
"karma": {
"config": "karma.conf.js"
}
},
"defaults": {
"styleExt": "css",
"prefixInterfaces": false,
"inline": {
"style": false,
"template": false
},
"spec": {
"class": false,
"component": true,
"directive": true,
"module": false,
"pipe": true,
"service": true
}
}
}

View File

@@ -1,13 +1,11 @@
language: node_js language: node_js
node_js: node_js:
- "10" - "6"
services:
- xvfb
before_install: before_install:
- export CHROME_BIN=chromium-browser - export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0 - export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
script: script:
- npm run pretest - npm run pretest

View File

@@ -63,10 +63,11 @@ Easy to use Angular2 directives for files upload ([demo](http://valor-software.g
1. `url` - URL of File Uploader's route 1. `url` - URL of File Uploader's route
2. `authToken` - Auth token that will be applied as 'Authorization' header during file send. 2. `authToken` - Auth token that will be applied as 'Authorization' header during file send.
3. `disableMultipart` - If 'true', disable using a multipart form for file upload and instead stream the file. Some APIs (e.g. Amazon S3) may expect the file to be streamed rather than sent via a form. Defaults to false. 3. `disableMultipart` - If 'true', disable using a multipart form for file upload and instead stream the file. Some APIs (e.g. Amazon S3) may expect the file to be streamed rather than sent via a form. Defaults to false.
4. `itemAlias` - item alias (form name redefinition) 4. `itemAlias` - item alias (form name redefenition)
5. `formatDataFunction` - Function to modify the request body. 'DisableMultipart' must be 'true' for this function to be called. 5. `formatDataFunction` - Function to modify the request body. 'DisableMultipart' must be 'true' for this function to be called.
6. `formatDataFunctionIsAsync` - Informs if the function sent in 'formatDataFunction' is asynchronous. Defaults to false. 6. `formatDataFunctionIsAsync` - Informs if the function sent in 'formatDataFunction' is asynchronous. Defaults to false.
7. `parametersBeforeFiles` - States if additional parameters should be appended before or after the file. Defaults to false. 7. `parametersBeforeFiles` - States if additional parameters should be appended before or after the file. Defaults to false.
8. `queueMaxSizeLimit` - States the maximum allowed size (in bytes) of all files in the queue that are going to be uploaded.
### Events ### Events
@@ -77,7 +78,7 @@ Easy to use Angular2 directives for files upload ([demo](http://valor-software.g
# Troubleshooting # Troubleshooting
Please follow these guidelines when reporting bugs and feature requests: Please follow this guidelines when reporting bugs and feature requests:
1. Use [GitHub Issues](https://github.com/valor-software/ng2-file-upload/issues) board to report bugs and feature requests (not our email address) 1. Use [GitHub Issues](https://github.com/valor-software/ng2-file-upload/issues) board to report bugs and feature requests (not our email address)
2. Please **always** write steps to reproduce the error. That way we can focus on fixing the bug, not scratching our heads trying to reproduce it. 2. Please **always** write steps to reproduce the error. That way we can focus on fixing the bug, not scratching our heads trying to reproduce it.

View File

@@ -1,112 +0,0 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"ng2-file-upload": {
"root": ".",
"sourceRoot": "src",
"projectType": "library",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "src/tsconfig.json",
"project": "src/ng-package.json"
}
}
}
},
"ng2-file-upload-demo": {
"root": "demo",
"sourceRoot": "demo/src",
"projectType": "application",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "demo/dist",
"index": "demo/src/index.html",
"main": "demo/src/main.ts",
"tsConfig": "demo/src/tsconfig.json",
"assets": [
"demo/src/assets"
],
"styles": [],
"scripts": []
},
"configurations": {
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "demo/src/environments/environment.ts",
"with": "demo/src/environments/environment.prod.ts"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "ng2-file-upload-demo:build"
},
"configurations": {
"production": {
"browserTarget": "ng2-file-upload-demo:build:production"
}
}
}
}
},
"ng2-file-upload-test": {
"root": ".",
"sourceRoot": "test",
"projectType": "library",
"architect": {
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "test/test.ts",
"karmaConfig": "test/karma.conf.js",
"scripts": [],
"styles": [],
"tsConfig": "test/tsconfig.json"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.json",
"demo/src/tsconfig.json",
"test/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "ng2-file-upload-demo",
"schematics": {
"@schematics/angular:component": {
"prefix": "",
"styleext": "css"
},
"@schematics/angular:directive": {
"prefix": ""
}
}
}

View File

@@ -1,12 +0,0 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
# You can see what browsers were selected by your queries by running:
# npx browserslist
> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.

View File

@@ -5,9 +5,9 @@ let doc = require('html-loader!markdown-loader!../../doc.md');
let tabDesc:Array<any> = [ let tabDesc:Array<any> = [
{ {
heading: 'Simple', heading: 'Simple',
ts: require('!!raw-loader!./file-upload/simple-demo.ts').default, ts: require('!!raw-loader?lang=typescript!./file-upload/simple-demo.ts'),
html: require('!!raw-loader!./file-upload/simple-demo.html').default, html: require('!!raw-loader?lang=markup!./file-upload/simple-demo.html'),
js: require('!!raw-loader!./file-upload/file-catcher.js').default js: require('!!raw-loader?lang=javascript!./file-upload/file-catcher.js')
} }
]; ];

View File

@@ -1,4 +1,4 @@
import '../../scripts/polyfills.ts'; import './polyfills.ts';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core'; import { enableProdMode } from '@angular/core';

View File

@@ -1,25 +1,22 @@
{ {
"compilerOptions": { "compilerOptions": {
"baseUrl": ".",
"declaration": false, "declaration": false,
"downlevelIteration": true,
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"noEmitHelpers": false, "noEmitHelpers": false,
"lib": ["es6", "dom"], "lib": ["es6", "dom"],
"types": [
"jasmine",
"webpack"
],
"mapRoot": "./", "mapRoot": "./",
"module": "esnext", "module": "es6",
"moduleResolution": "node", "moduleResolution": "node",
"outDir": "../temp/out-tsc", "outDir": "../temp/out-tsc",
"sourceMap": true, "sourceMap": true,
"target": "es2015" "target": "es5",
}, "typeRoots": [
"files": [ "../node_modules/@types"
"../../scripts/typings.d.ts",
"main.ts",
"../../scripts/polyfills.ts"
],
"exclude": [
"**/*.spec.ts"
] ]
}
} }

16
demo/src/typings.d.ts vendored Normal file
View File

@@ -0,0 +1,16 @@
// Typings reference file, you can add your own global typings here
// https://www.typescriptlang.org/docs/handbook/writing-declaration-files.html
// tslint:disable
declare const System: any;
declare const ENV:string;
// google code-prettify
declare const PR:any;
// declare const require:any;
// declare const global:any;
declare module jasmine {
interface Matchers {
toHaveCssClass(expected: any): boolean;
}
}

View File

@@ -1,42 +1,45 @@
// Karma configuration file, see link for more information // Karma configuration file, see link for more information
// https://karma-runner.github.io/0.13/config/configuration-file.html // https://karma-runner.github.io/0.13/config/configuration-file.html
const customLaunchers = require('./sauce-browsers').customLaunchers; const customLaunchers = require('./scripts/sauce-browsers').customLaunchers;
module.exports = function (config) { module.exports = function (config) {
const configuration = { const configuration = {
basePath: '', basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'], frameworks: ['jasmine', '@angular/cli'],
plugins: [ plugins: [
require('karma-jasmine'), require('karma-jasmine'),
require('karma-chrome-launcher'), require('karma-chrome-launcher'),
require('karma-coverage-istanbul-reporter'), require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma') require('@angular/cli/plugins/karma')
], ],
files: [
{pattern: './scripts/test.ts', watched: false}
],
preprocessors: {
'./scripts/test.ts': ['@angular/cli']
},
coverageIstanbulReporter: { coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../coverage'), reports: [ 'html', 'lcovonly' ], reports: [ 'html', 'lcovonly' ],
fixWebpackSourcePaths: false fixWebpackSourcePaths: false
}, },
angularCli: {
reporters: ['dots', 'coverage-istanbul'], config: './angular-cli.json',
environment: 'dev'
},
reporters: config.angularCli && config.angularCli.codeCoverage
? ['dots', 'coverage-istanbul']
: ['dots'],
port: 9876, port: 9876,
colors: true, colors: true,
logLevel: config.LOG_INFO, logLevel: config.LOG_INFO,
autoWatch: true, autoWatch: true,
browsers: ['ChromeHeadless'], browsers: ['Chrome'],
browserNoActivityTimeout: 20000, singleRun: false,
browserDisconnectTolerance: 2,
browserDisconnectTimeout: 5000,
singleRun: true,
customLaunchers: { customLaunchers: {
Chrome_travis_ci: { Chrome_travis_ci: {
base: 'ChromeHeadless', base: 'Chrome',
flags: [ flags: ['--no-sandbox']
'--headless',
'--disable-gpu',
'--no-sandbox',
'--remote-debugging-port=9222'
]
} }
}, },
mime: { 'text/x-typescript': ['ts','tsx'] }, mime: { 'text/x-typescript': ['ts','tsx'] },
@@ -67,10 +70,10 @@ module.exports = function (config) {
}, },
public: 'public' public: 'public'
}; };
configuration.captureTimeout = 60000; configuration.captureTimeout = 0;
configuration.customLaunchers = customLaunchers(); configuration.customLaunchers = customLaunchers();
configuration.browsers = Object.keys(configuration.customLaunchers); configuration.browsers = Object.keys(configuration.customLaunchers);
configuration.concurrency = 4; configuration.concurrency = 3;
configuration.browserDisconnectTolerance = 2; configuration.browserDisconnectTolerance = 2;
configuration.browserNoActivityTimeout = 20000; configuration.browserNoActivityTimeout = 20000;
configuration.browserDisconnectTimeout = 5000; configuration.browserDisconnectTimeout = 5000;

18533
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -7,21 +7,24 @@
"lite-server": "lite-server -c demo/bs-config.json", "lite-server": "lite-server -c demo/bs-config.json",
"demo.serve": "run-s build link demo.build lite-server", "demo.serve": "run-s build link demo.build lite-server",
"demo.gh-pages": "run-s build demo.build demo.deploy", "demo.gh-pages": "run-s build demo.build demo.deploy",
"demo.build": "ng build ng2-file-upload-demo --prod", "demo.build": "ng build -prod --aot",
"demo.deploy": "gh-pages -d demo/dist", "demo.deploy": "gh-pages -d demo/dist",
"link": "cd dist/ng2-file-upload/ && npm link && cd ../../ && npm link ng2-file-upload", "link": "ngm link -p src --here",
"lint": "exit 0", "lint": "exit 0",
"disable-lint": "tslint \"**/*.ts\" -c tslint.json --fix --type-check -t prose -e \"node_modules/**\" -e \"dist/**\" -e \"temp/**\" -e \"scripts/docs/**\"", "disable-lint": "tslint \"**/*.ts\" -c tslint.json --fix --type-check -t prose -e \"node_modules/**\" -e \"dist/**\" -e \"temp/**\" -e \"scripts/docs/**\"",
"flow.changelog": "conventional-changelog -i CHANGELOG.md -s -p angular", "flow.changelog": "conventional-changelog -i CHANGELOG.md -s -p angular",
"flow.github-release": "conventional-github-releaser -p angular", "flow.github-release": "conventional-github-releaser -p angular",
"build": "ng build ng2-file-upload", "build": "ngm build -p src --clean",
"build.watch": "ng build ng2-file-upload --watch", "build.watch": "ngm build -p src --watch --skip-bundles",
"start": "ng serve ng2-file-upload-demo --aot", "start": "ng serve --aot",
"pretest": "run-s lint build link", "pretest": "run-s lint build link",
"test": "ng test ng2-file-upload-test", "test": "ng test -sr",
"test-coverage": "ng test ng2-file-upload-test --code-coverage", "test-coverage": "ng test -sr -cc",
"version": "npm run flow.changelog && git add -A" "version": "npm run flow.changelog && git add -A"
}, },
"main": "bundles/ng2-file-upload.umd.js",
"module": "index.js",
"typings": "index.d.ts",
"keywords": [ "keywords": [
"angular2", "angular2",
"bootstrap", "bootstrap",
@@ -40,29 +43,33 @@
"url": "https://github.com/valor-software/ng2-file-upload/issues" "url": "https://github.com/valor-software/ng2-file-upload/issues"
}, },
"homepage": "https://github.com/valor-software/ng2-file-upload#readme", "homepage": "https://github.com/valor-software/ng2-file-upload#readme",
"peerDependencies": {}, "dependencies": {},
"peerDependencies": {
"@angular/common": "^2.3.1 || >=4.0.0",
"@angular/core": "^2.3.1 || >=4.0.0"
},
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "~0.803.0", "@angular/cli": "1.0.0",
"@angular-devkit/build-ng-packagr": "^0.803.0", "@angular/common": "2.4.3",
"@angular/cli": "^8.3.0", "@angular/compiler": "2.4.3",
"@angular/common": "^8.2.3", "@angular/compiler-cli": "2.4.3",
"@angular/compiler": "^8.2.3", "@angular/core": "2.4.3",
"@angular/compiler-cli": "^8.2.3", "@angular/forms": "2.4.3",
"@angular/core": "^8.2.3", "@angular/http": "2.4.3",
"@angular/forms": "^8.2.3", "@angular/language-service": "2.4.3",
"@angular/language-service": "8.2.3", "@angular/platform-browser": "2.4.3",
"@angular/platform-browser": "^8.2.3", "@angular/platform-browser-dynamic": "2.4.3",
"@angular/platform-browser-dynamic": "^8.2.3", "@angular/router": "3.4.3",
"@angular/router": "^8.2.3", "@angular/tsc-wrapped": "0.5.1",
"@types/jasmine": "2.5.40", "@types/jasmine": "2.5.40",
"@types/marked": "0.0.28", "@types/marked": "0.0.28",
"@types/node": "7.0.0", "@types/node": "7.0.0",
"@types/webpack": "^3.8.18", "@types/webpack": "^2.2.1",
"bootstrap": "3.3.7", "bootstrap": "3.3.7",
"chokidar-cli": "1.2.0", "chokidar-cli": "1.2.0",
"classlist-polyfill": "1.0.3", "classlist-polyfill": "1.0.3",
"codecov": "1.0.1", "codecov": "1.0.1",
"codelyzer": "^5.0.1", "codelyzer": "~2.0.0-beta.4",
"conventional-changelog-cli": "1.2.0", "conventional-changelog-cli": "1.2.0",
"conventional-github-releaser": "1.1.3", "conventional-github-releaser": "1.1.3",
"core-js": "^2.4.1", "core-js": "^2.4.1",
@@ -72,41 +79,41 @@
"gh-pages": "0.12.0", "gh-pages": "0.12.0",
"gitignore-to-glob": "0.3.0", "gitignore-to-glob": "0.3.0",
"google-code-prettify": "1.0.5", "google-code-prettify": "1.0.5",
"html-loader": "^0.5.5", "html-loader": "0.4.4",
"jasmine-core": "3.1.0", "jasmine": "2.5.3",
"jasmine-core": "2.5.2",
"jasmine-data-provider": "2.2.0", "jasmine-data-provider": "2.2.0",
"jasmine-spec-reporter": "4.2.1", "jasmine-spec-reporter": "3.2.0",
"karma": "4.1.0", "karma": "1.4.0",
"karma-chrome-launcher": "2.2.0", "karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1", "karma-cli": "^1.0.1",
"karma-coverage-istanbul-reporter": "1.4.3", "karma-coverage-istanbul-reporter": "^1.3.0",
"karma-jasmine": "1.1.2", "karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "0.6.0", "karma-remap-istanbul": "0.4.0",
"karma-sauce-launcher": "1.2.0", "karma-sauce-launcher": "1.1.0",
"lite-server": "2.2.2", "lite-server": "2.2.2",
"lodash": "4.17.4", "lodash": "4.17.4",
"markdown-loader": "^5.1.0", "markdown-loader": "^0.1.7",
"marked": "0.3.6", "marked": "0.3.6",
"ng-packagr": "^5.5.0", "ng2-page-scroll": "4.0.0-beta.2",
"ngm-cli": "0.4.0",
"ngx-bootstrap": "1.6.6", "ngx-bootstrap": "1.6.6",
"npm-run-all": "^4.0.1", "npm-run-all": "^4.0.1",
"pre-commit": "1.2.2", "pre-commit": "1.2.2",
"protractor": "5.0.0", "protractor": "5.0.0",
"raw-loader": "^3.1.0",
"reflect-metadata": "0.1.9", "reflect-metadata": "0.1.9",
"require-dir": "0.3.1", "require-dir": "0.3.1",
"rxjs": "^6.5.2", "rxjs": "5.0.3",
"systemjs-builder": "0.15.34", "systemjs-builder": "0.15.34",
"ts-helpers": "^1.1.1", "ts-helpers": "^1.1.1",
"ts-node": "2.0.0", "ts-node": "2.0.0",
"tsickle": "^0.37.0", "tslint": "4.3.1",
"tslint": "^5.19.0", "tslint-config-valorsoft": "1.2.0",
"tslint-config-valorsoft": "^2.2.1",
"typedoc": "0.5.5", "typedoc": "0.5.5",
"typescript": "3.5.3", "typescript": "2.1.5",
"wallaby-webpack": "0.0.30", "wallaby-webpack": "0.0.30",
"webdriver-manager": "11.1.1", "webdriver-manager": "11.1.1",
"zone.js": "~0.9.1" "zone.js": "0.7.5"
}, },
"contributors": [ "contributors": [
{ {
@@ -129,8 +136,5 @@
"email": "otelnov@gmail.com", "email": "otelnov@gmail.com",
"url": "https://github.com/otelnov" "url": "https://github.com/otelnov"
} }
], ]
"dependencies": {
"tslib": "^1.10.0"
}
} }

1
scripts/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
!**/*.js

View File

@@ -1,4 +1,4 @@
import '../scripts/polyfills.ts'; import '../demo/src/polyfills.ts';
import 'zone.js/dist/long-stack-trace-zone'; import 'zone.js/dist/long-stack-trace-zone';
import 'zone.js/dist/proxy.js'; import 'zone.js/dist/proxy.js';

View File

@@ -1,4 +1,4 @@
import { FileLikeObject } from "../index"; import { FileLikeObject } from "../ng2-file-upload";
export class FileType { export class FileType {
/* MS office */ /* MS office */
@@ -125,7 +125,6 @@ export class FileType {
'xls': 'xls', 'xls': 'xls',
'xlsx': 'xls', 'xlsx': 'xls',
'ods': 'xls', 'ods': 'xls',
'csv': 'xls',
'mp4': 'video', 'mp4': 'video',
'avi': 'video', 'avi': 'video',
'wmv': 'video', 'wmv': 'video',

View File

@@ -30,6 +30,7 @@ export interface FileUploaderOptions {
authToken?: string; authToken?: string;
maxFileSize?: number; maxFileSize?: number;
queueLimit?: number; queueLimit?: number;
queueMaxSizeLimit? : number;
removeAfterUpload?: boolean; removeAfterUpload?: boolean;
url?: string; url?: string;
disableMultipart?: boolean; disableMultipart?: boolean;
@@ -77,6 +78,10 @@ export class FileUploader {
this.autoUpload = this.options.autoUpload; this.autoUpload = this.options.autoUpload;
this.options.filters.unshift({ name: 'queueLimit', fn: this._queueLimitFilter }); this.options.filters.unshift({ name: 'queueLimit', fn: this._queueLimitFilter });
if (this.options.queueMaxSizeLimit) {
this.options.filters.unshift({ name: 'queueMaxSizeLimit', fn: this._queueMaxSizeLimitFilter });
}
if (this.options.maxFileSize) { if (this.options.maxFileSize) {
this.options.filters.unshift({ name: 'fileSize', fn: this._fileSizeFilter }); this.options.filters.unshift({ name: 'fileSize', fn: this._fileSizeFilter });
} }
@@ -420,6 +425,17 @@ export class FileUploader {
return this.options.queueLimit === undefined || this.queue.length < this.options.queueLimit; return this.options.queueLimit === undefined || this.queue.length < this.options.queueLimit;
} }
protected _queueMaxSizeLimitFilter(item: FileLikeObject): boolean {
let queueFileSize = 0;
let queueNotProcessedItems = this.queue.filter(queuedItem => !(queuedItem.isSuccess || queuedItem.isCancel || queuedItem.isError));
if(queueNotProcessedItems.length>0)
{
// total size of all queued items that are going to be uploaded
queueFileSize = queueNotProcessedItems.map(queuedItem => queuedItem.file.size).reduce((fileSizeA,fileSizeB)=> fileSizeA + fileSizeB);
}
return this.options.queueMaxSizeLimit === undefined || (queueFileSize + item.size) < this.options.queueMaxSizeLimit;
}
protected _isValidFile(file: FileLikeObject, filters: FilterFunction[], options: FileUploaderOptions): boolean { protected _isValidFile(file: FileLikeObject, filters: FilterFunction[], options: FileUploaderOptions): boolean {
this._failFilterIndex = -1; this._failFilterIndex = -1;
return !filters.length ? true : filters.every((filter: FilterFunction) => { return !filters.length ? true : filters.every((filter: FilterFunction) => {

View File

@@ -1,7 +0,0 @@
{
"$schema": "../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../dist/ng2-file-upload",
"lib": {
"entryFile": "index.ts"
}
}

1
src/ng2-file-upload.ts Normal file
View File

@@ -0,0 +1 @@
export * from './index';

View File

@@ -63,6 +63,7 @@ describe('Directive: FileSelectDirective', () => {
expect(options.isHTML5).toBeTruthy(); expect(options.isHTML5).toBeTruthy();
expect(options.removeAfterUpload).toBeFalsy(); expect(options.removeAfterUpload).toBeFalsy();
expect(options.disableMultipart).toBeFalsy(); expect(options.disableMultipart).toBeFalsy();
expect(options.queueMaxSizeLimit).toBeUndefined();
}); });
it('can get filters', () => { it('can get filters', () => {

View File

@@ -1,9 +1,8 @@
{ {
"compilerOptions": { "compilerOptions": {
"baseUrl": ".",
"outDir": "../dist", "outDir": "../dist",
"target": "es5", "target": "es5",
"module": "esnext", "module": "commonjs",
"moduleResolution": "node", "moduleResolution": "node",
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": true, "experimentalDecorators": true,
@@ -15,19 +14,24 @@
"stripInternal": true, "stripInternal": true,
"noUnusedLocals": false, "noUnusedLocals": false,
"noUnusedParameters": false, "noUnusedParameters": false,
"lib": ["dom", "es6"] "lib": ["dom", "es6"],
}, "types": [
"angularCompilerOptions": { "jasmine",
"annotateForClosureCompiler": true, "webpack"
"strictMetadataEmit": true,
"skipTemplateCodegen": true,
"flatModuleOutFile": "ng2-file-upload.js",
"flatModuleId": "ng2-file-upload"
},
"include": [
"../scripts/typings.d.ts"
], ],
"exclude": [ "typeRoots": [
"**/*.spec.ts" "../node_modules/@types"
] ]
},
"exclude": [
"node_modules"
],
"files": [
"../scripts/typings.d.ts",
"./ng2-file-upload.ts",
"./index.ts"
],
"angularCompilerOptions": {
"genDir": "../temp/factories"
}
} }

View File

@@ -1,22 +0,0 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"module": "esnext",
"moduleResolution": "node",
"target": "es2015",
"outDir": "./out-tsc/spec",
"types": [
"jasmine",
"node"
]
},
"files": [
"../scripts/typings.d.ts",
"test.ts",
"../scripts/polyfills.ts",
],
"include": [
"../src/**/*.spec.ts",
"../demo/src/**/*.spec.ts"
]
}