ngx-filesaver
Advanced tools
Comparing version 10.0.0 to 10.0.1
@@ -83,3 +83,3 @@ (function (global, factory) { | ||
for (var item in query) { | ||
params.set(item, query[item]); | ||
params = params.set(item, query[item]); | ||
} | ||
@@ -86,0 +86,0 @@ req = this.httpClient.request(this.method, this.url, { |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("file-saver"),require("@angular/common/http")):"function"==typeof define&&define.amd?define("ngxFileSaver",["exports","@angular/core","file-saver","@angular/common/http"],t):t((e=e||self).ngxFileSaver={},e.ng.core,e.saveAs,e.ng.common.http)}(this,(function(e,t,r,n){"use strict";var s=function(){function e(){}return Object.defineProperty(e.prototype,"isFileSaverSupported",{get:function(){try{return!!new Blob}catch(e){return!1}},enumerable:!1,configurable:!0}),e.prototype.genType=function(e){if(!e||-1===e.lastIndexOf("."))return"text/plain";var t=e.substr(e.lastIndexOf(".")+1);switch(t){case"txt":return"text/plain";case"xml":case"html":return"text/"+t;case"json":return"octet/stream";default:return"application/"+t}},e.prototype.save=function(e,t,n,s){if(!e)throw new Error("Data argument should be a blob instance");var i=new Blob([e],{type:n||e.type||this.genType(t)});r.saveAs(i,decodeURI(t||"download"),s)},e.prototype.saveText=function(e,t,r){var n=new Blob([e]);this.save(n,t,null,r)},e}();s.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new s},token:s,providedIn:"root"}),s.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}];var i=function(){function e(e,r,n){this.el=e,this.fss=r,this.httpClient=n,this.method="GET",this.success=new t.EventEmitter,this.error=new t.EventEmitter,r.isFileSaverSupported||e.nativeElement.classList.add("filesaver__not-support")}return e.prototype.getName=function(e){return decodeURI(this.fileName||e.headers.get("filename")||e.headers.get("x-filename"))},e.prototype._click=function(){var e=this;if(this.fss.isFileSaverSupported){var t=this.http;if(!t){var r=new n.HttpParams,s=this.query||{};for(var i in s)r.set(i,s[i]);t=this.httpClient.request(this.method,this.url,{observe:"response",responseType:"blob",headers:this.header,params:r})}this.setDisabled(!0),t.subscribe((function(t){200!==t.status||t.body.size<=0?e.error.emit(t):(e.fss.save(t.body,e.getName(t),null,e.fsOptions),e.success.emit(t))}),(function(t){return e.error.emit(t)}),(function(){return e.setDisabled(!1)}))}},e.prototype.setDisabled=function(e){var t=this.el.nativeElement;t.disabled=e,t.classList[e?"add":"remove"]("filesaver__disabled")},e}();i.decorators=[{type:t.Directive,args:[{selector:"[fileSaver]",exportAs:"fileSaver"}]}],i.ctorParameters=function(){return[{type:t.ElementRef},{type:s},{type:n.HttpClient}]},i.propDecorators={method:[{type:t.Input}],http:[{type:t.Input}],query:[{type:t.Input}],header:[{type:t.Input}],url:[{type:t.Input}],fileName:[{type:t.Input}],fsOptions:[{type:t.Input}],success:[{type:t.Output}],error:[{type:t.Output}],_click:[{type:t.HostListener,args:["click"]}]};var o=function(){};o.decorators=[{type:t.NgModule,args:[{declarations:[i],exports:[i]}]}],e.FileSaverDirective=i,e.FileSaverModule=o,e.FileSaverService=s,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("file-saver"),require("@angular/common/http")):"function"==typeof define&&define.amd?define("ngxFileSaver",["exports","@angular/core","file-saver","@angular/common/http"],t):t((e=e||self).ngxFileSaver={},e.ng.core,e.saveAs,e.ng.common.http)}(this,(function(e,t,r,n){"use strict";var s=function(){function e(){}return Object.defineProperty(e.prototype,"isFileSaverSupported",{get:function(){try{return!!new Blob}catch(e){return!1}},enumerable:!1,configurable:!0}),e.prototype.genType=function(e){if(!e||-1===e.lastIndexOf("."))return"text/plain";var t=e.substr(e.lastIndexOf(".")+1);switch(t){case"txt":return"text/plain";case"xml":case"html":return"text/"+t;case"json":return"octet/stream";default:return"application/"+t}},e.prototype.save=function(e,t,n,s){if(!e)throw new Error("Data argument should be a blob instance");var i=new Blob([e],{type:n||e.type||this.genType(t)});r.saveAs(i,decodeURI(t||"download"),s)},e.prototype.saveText=function(e,t,r){var n=new Blob([e]);this.save(n,t,null,r)},e}();s.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new s},token:s,providedIn:"root"}),s.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}];var i=function(){function e(e,r,n){this.el=e,this.fss=r,this.httpClient=n,this.method="GET",this.success=new t.EventEmitter,this.error=new t.EventEmitter,r.isFileSaverSupported||e.nativeElement.classList.add("filesaver__not-support")}return e.prototype.getName=function(e){return decodeURI(this.fileName||e.headers.get("filename")||e.headers.get("x-filename"))},e.prototype._click=function(){var e=this;if(this.fss.isFileSaverSupported){var t=this.http;if(!t){var r=new n.HttpParams,s=this.query||{};for(var i in s)r=r.set(i,s[i]);t=this.httpClient.request(this.method,this.url,{observe:"response",responseType:"blob",headers:this.header,params:r})}this.setDisabled(!0),t.subscribe((function(t){200!==t.status||t.body.size<=0?e.error.emit(t):(e.fss.save(t.body,e.getName(t),null,e.fsOptions),e.success.emit(t))}),(function(t){return e.error.emit(t)}),(function(){return e.setDisabled(!1)}))}},e.prototype.setDisabled=function(e){var t=this.el.nativeElement;t.disabled=e,t.classList[e?"add":"remove"]("filesaver__disabled")},e}();i.decorators=[{type:t.Directive,args:[{selector:"[fileSaver]",exportAs:"fileSaver"}]}],i.ctorParameters=function(){return[{type:t.ElementRef},{type:s},{type:n.HttpClient}]},i.propDecorators={method:[{type:t.Input}],http:[{type:t.Input}],query:[{type:t.Input}],header:[{type:t.Input}],url:[{type:t.Input}],fileName:[{type:t.Input}],fsOptions:[{type:t.Input}],success:[{type:t.Output}],error:[{type:t.Output}],_click:[{type:t.HostListener,args:["click"]}]};var o=function(){};o.decorators=[{type:t.NgModule,args:[{declarations:[i],exports:[i]}]}],e.FileSaverDirective=i,e.FileSaverModule=o,e.FileSaverService=s,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=ngx-filesaver.umd.min.js.map |
@@ -26,7 +26,7 @@ import { Directive, ElementRef, Input, HostListener, EventEmitter, Output } from '@angular/core'; | ||
if (!req) { | ||
const params = new HttpParams(); | ||
let params = new HttpParams(); | ||
const query = this.query || {}; | ||
// tslint:disable-next-line:forin | ||
for (const item in query) { | ||
params.set(item, query[item]); | ||
params = params.set(item, query[item]); | ||
} | ||
@@ -79,2 +79,2 @@ req = this.httpClient.request(this.method, this.url, { | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmlsZXNhdmVyLmRpcmVjdGl2ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9zcmMvZmlsZXNhdmVyLmRpcmVjdGl2ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLFVBQVUsRUFBRSxLQUFLLEVBQUUsWUFBWSxFQUFFLFlBQVksRUFBRSxNQUFNLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDakcsT0FBTyxFQUFFLFVBQVUsRUFBRSxVQUFVLEVBQWdCLE1BQU0sc0JBQXNCLENBQUM7QUFDNUUsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLE1BQU0sQ0FBQztBQUVsQyxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQU12RCxNQUFNLE9BQU8sa0JBQWtCO0lBVzdCLFlBQW9CLEVBQWlDLEVBQVUsR0FBcUIsRUFBVSxVQUFzQjtRQUFoRyxPQUFFLEdBQUYsRUFBRSxDQUErQjtRQUFVLFFBQUcsR0FBSCxHQUFHLENBQWtCO1FBQVUsZUFBVSxHQUFWLFVBQVUsQ0FBWTtRQVYzRyxXQUFNLEdBQUcsS0FBSyxDQUFDO1FBT0wsWUFBTyxHQUFHLElBQUksWUFBWSxFQUFzQixDQUFDO1FBQ2pELFVBQUssR0FBRyxJQUFJLFlBQVksRUFBTyxDQUFDO1FBR2pELElBQUksQ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lYW4pIHtcbiAgICBjb25zdCBlbCA9IHRoaXMuZWwubmF0aXZlRWxlbWVudDtcbiAgICBlbC5kaXNhYmxlZCA9IHN0YXR1cztcbiAgICBlbC5jbGFzc0xpc3Rbc3RhdHVzID8gJ2FkZCcgOiAncmVtb3ZlJ10oYGZpbGVzYXZlcl9fZGlzYWJsZWRgKTtcbiAgfVxufVxuIl19 |
@@ -70,7 +70,7 @@ import { ɵɵdefineInjectable, Injectable, EventEmitter, Directive, ElementRef, Input, Output, HostListener, NgModule } from '@angular/core'; | ||
if (!req) { | ||
const params = new HttpParams(); | ||
let params = new HttpParams(); | ||
const query = this.query || {}; | ||
// tslint:disable-next-line:forin | ||
for (const item in query) { | ||
params.set(item, query[item]); | ||
params = params.set(item, query[item]); | ||
} | ||
@@ -77,0 +77,0 @@ req = this.httpClient.request(this.method, this.url, { |
{ | ||
"name": "ngx-filesaver", | ||
"version": "10.0.0", | ||
"version": "10.0.1", | ||
"description": "Simple file save with FileSaver.js", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -6,3 +6,3 @@ # ngx-filesaver | ||
[![NPM version](https://img.shields.io/npm/v/ngx-filesaver.svg)](https://www.npmjs.com/package/ngx-filesaver) | ||
[![Build Status](https://travis-ci.org/cipchk/ngx-filesaver.svg?branch=master)](https://travis-ci.org/cipchk/ngx-filesaver) | ||
![Ci](https://github.com/cipchk/ngx-filesaver/workflows/Ci/badge.svg) | ||
@@ -9,0 +9,0 @@ [中文版](README.zh-CN.md) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
68545
0