@acorex/core 18.1.5 → 18.1.7
Sign up to get free protection for your applications and to get access to all the features.
@@ -9,14 +9,19 @@ export class AXFileService {
|
|
9
9
|
constructor(_httpClient) {
|
10
10
|
this._httpClient = _httpClient;
|
11
11
|
this.blobToBase64 = (blob) => {
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
12
|
+
if (blob instanceof Blob) {
|
13
|
+
return new Promise((resolve, reject) => {
|
14
|
+
const reader = new FileReader();
|
15
|
+
reader.onerror = reject;
|
16
|
+
reader.onload = () => {
|
17
|
+
resolve(reader.result);
|
18
|
+
};
|
19
|
+
reader.readAsDataURL(blob);
|
20
|
+
});
|
21
|
+
}
|
22
|
+
else {
|
23
|
+
return Promise.reject('input is not blob');
|
24
|
+
}
|
20
25
|
};
|
21
26
|
}
|
22
27
|
download(request) {
|
@@ -134,4 +139,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImpor
|
|
134
139
|
providedIn: 'root',
|
135
140
|
}]
|
136
141
|
}], ctorParameters: () => [{ type: i1.HttpClient }] });
|
137
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmlsZS5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb3JlL2ZpbGUvc3JjL2xpYi9maWxlLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxXQUFXLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUMvRCxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRTNDLE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBQzlELE9BQU8sRUFBRSxvQkFBb0IsRUFBRS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ICB9XG5cbiAgcHVibGljIGdldEJhc2U2NFNpemUoYmFzZTY0OiBzdHJpbmcpIHtcbiAgICByZXR1cm4gYXRvYihiYXNlNjQuc3Vic3RyaW5nKGJhc2U2NC5pbmRleE9mKCcsJykgKyAxKSkubGVuZ3RoO1xuICB9XG59XG4iXX0=
|
@@ -100,14 +100,19 @@ class AXFileService {
|
|
100
100
|
constructor(_httpClient) {
|
101
101
|
this._httpClient = _httpClient;
|
102
102
|
this.blobToBase64 = (blob) => {
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
103
|
+
if (blob instanceof Blob) {
|
104
|
+
return new Promise((resolve, reject) => {
|
105
|
+
const reader = new FileReader();
|
106
|
+
reader.onerror = reject;
|
107
|
+
reader.onload = () => {
|
108
|
+
resolve(reader.result);
|
109
|
+
};
|
110
|
+
reader.readAsDataURL(blob);
|
111
|
+
});
|
112
|
+
}
|
113
|
+
else {
|
114
|
+
return Promise.reject('input is not blob');
|
115
|
+
}
|
111
116
|
};
|
112
117
|
}
|
113
118
|
download(request) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"acorex-core-file.mjs","sources":["../../../../libs/core/file/src/lib/file-size-formatter.ts","../../../../libs/core/file/src/lib/file-download-ref.class.ts","../../../../libs/core/file/src/lib/file-download-result.class.ts","../../../../libs/core/file/src/lib/file-upload-ref.class.ts","../../../../libs/core/file/src/lib/file.service.ts","../../../../libs/core/file/src/lib/file.module.ts","../../../../libs/core/file/src/acorex-core-file.ts"],"sourcesContent":["import { AXFormatOptions, AXFormatter } from '@acorex/core/format';\nimport { Injectable } from '@angular/core';\n\nexport interface AXFileSizeFormatterOptions extends AXFormatOptions {\n format: string;\n}\n\ndeclare module '@acorex/core/format' {\n interface AXFormatOptionsMap {\n filesize: AXFileSizeFormatterOptions;\n }\n}\n\n@Injectable()\nexport class AXFileSizeFormatter implements AXFormatter {\n get name(): string {\n return 'filesize';\n }\n\n format(value: number): string {\n const size = Number(value);\n\n if (size === 0) return '0 Bytes';\n if (Number.isNaN(size)) return 'Unknown';\n\n const k = 1024;\n const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\n const i = Math.floor(Math.log(size) / Math.log(k));\n\n return parseFloat((size / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];\n }\n}\n","import { AXFileDownloadResult } from './file-download-result.class';\n\nexport class AXFileDownloadRef extends Promise<AXFileDownloadResult> {\n public abortMethod: () => void;\n constructor(\n executor: (\n resolve: (value?: PromiseLike<AXFileDownloadResult>) => void,\n reject: (reason?: any) => void\n ) => void\n ) {\n super(executor as any);\n }\n //abort the operation\n public abort() {\n if (this.abortMethod) {\n this.abortMethod();\n }\n }\n}\n","export class AXFileDownloadResult {\n _response: Blob;\n\n constructor(response: Blob) {\n this._response = response;\n }\n\n save(filename?: string): Promise<void> {\n this._defaultBrowserDownload(filename);\n return Promise.resolve();\n // else {\n // return new Promise((resolve, reject) => {\n // const button = document.createElement(\"button\");\n // button.addEventListener('click', async () => {\n // button.remove();\n // const opts = {\n // types: [{\n // description: 'Save File',\n // suggestedName: filename\n // // accept: {'text/plain': ['.txt']},\n // }],\n // };\n // const result = await window['showSaveFilePicker'](opts);\n\n // resolve();\n // });\n // button.click();\n // });\n\n // }\n }\n\n blob() {\n return this._response;\n }\n\n base64(): Promise<string> {\n return new Promise((resolve, reject) => {\n const reader = new window.FileReader();\n reader.onloadend = () => resolve(reader.result as string);\n reader.onerror = (e) => reject(e);\n reader.readAsDataURL(this._response);\n });\n }\n\n private _defaultBrowserDownload(filename = 'download') {\n const link = document.createElement('a');\n link.href = URL.createObjectURL(this._response);\n link.download = filename;\n link.click();\n }\n}\n","export class AXFileUploadRef<T = any> extends Promise<T> {\n public abortMethod: () => void;\n constructor(\n executor: (\n resolve: (value?: PromiseLike<T>) => void,\n reject: (reason?: any) => void\n ) => void\n ) {\n super(executor as any);\n }\n //abort the operation\n public abort() {\n if (this.abortMethod) {\n this.abortMethod();\n }\n }\n}\n","import { HttpClient, HttpRequest } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { Observable, Subscription } from 'rxjs';\nimport { AXFileDownloadRef } from './file-download-ref.class';\nimport { AXFileDownloadResult } from './file-download-result.class';\nimport { AXFileUploadRef } from './file-upload-ref.class';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AXFileService {\n constructor(private _httpClient: HttpClient) {}\n\n public download(request: string | Blob | HttpRequest<any>) {\n let s: Subscription;\n\n const promiseFunc = (resolve, reject) => {\n if (typeof request == 'string') {\n //\n }\n if (request instanceof Blob) {\n //\n }\n if (request instanceof HttpRequest) {\n const b = this._httpClient.request(request);\n b.subscribe({\n next: (v: any) => resolve(new AXFileDownloadResult(v)),\n error: (e) => reject(e),\n });\n }\n };\n\n const a = new AXFileDownloadRef(promiseFunc);\n a.abort = () => {\n s?.unsubscribe();\n };\n\n return a;\n\n // let s: Subscription;\n // const promiseFunc = (resolve, reject) => {\n // //TODO: add custome http request\n // //const headers = new HttpHeaders().set('authorization','Bearer '+token);\n // let b!: Observable<Blob>;\n // if (typeof request === 'string') {\n // b = this._httpClient.get(request, { responseType: 'blob' });\n // } else if (isObservable(b)) {\n // b = request;\n // }\n // s = b?.subscribe({\n // next: (v) => resolve(new AXFileDownloadResult(v)),\n // error: (e) => reject(e),\n // });\n // };\n\n // const a = new AXFileDownloadRef(promiseFunc);\n // a.abort = () => {\n // s?.unsubscribe();\n // };\n\n // return a;\n }\n\n public upload<T = any>(url: string, files: File[]): AXFileUploadRef<T> {\n let s: Subscription;\n const formData = new FormData();\n files.forEach((f) => {\n formData.append('files', f);\n });\n const promiseFunc = (resolve, reject) => {\n const b: Observable<T> = this._httpClient.post<T>(url, formData);\n s = b?.subscribe({\n next: (v) => resolve(v),\n error: (e) => reject(e),\n });\n };\n\n const a = new AXFileUploadRef(promiseFunc);\n a.abort = () => {\n s?.unsubscribe();\n };\n return a;\n }\n\n public choose(options?: { accept?: string; multiple?: boolean }): Promise<File[]> {\n return new Promise<File[]>((resolve, reject) => {\n options = Object.assign({ multiple: false }, options);\n const input: HTMLInputElement = document.createElement('input');\n input.style.display = 'none';\n document.body.appendChild(input);\n input.type = 'file';\n input.accept = options.accept || '';\n input.multiple = options.multiple || false;\n //\n const onError = (e) => {\n reject(e);\n document.body.removeChild(input);\n input.remove();\n input.removeEventListener('change', onChange);\n input.removeEventListener('error', onError);\n };\n //\n const onChange = () => {\n resolve(Array.from(input.files || []));\n document.body.removeChild(input);\n input.remove();\n input.removeEventListener('change', onChange);\n input.removeEventListener('error', onError);\n };\n //\n input.addEventListener('change', onChange);\n input.addEventListener('error', onError);\n input.click();\n });\n }\n\n public blobToBase64 = (blob: Blob) => {\n return new Promise<string>((resolve, reject) => {\n const reader = new FileReader();\n reader.onerror = reject;\n reader.onload = () => {\n resolve(reader.result as string);\n };\n reader.readAsDataURL(blob);\n });\n };\n public getSize(file: File | Blob | string) {\n if (this.isBase64(file as string)) {\n return this.getBase64Size(file as string);\n }\n return false;\n }\n\n public isBase64(base64: string) {\n const regx = /[^:]\\w+\\/[\\w-+\\d.]+(?=;|,)/;\n return regx.test(base64);\n }\n\n public getBase64Size(base64: string) {\n return atob(base64.substring(base64.indexOf(',') + 1)).length;\n }\n}\n","import { AXFormatModule } from '@acorex/core/format';\nimport { NgModule } from '@angular/core';\nimport { AXFileSizeFormatter } from './file-size-formatter';\n\n@NgModule({\n imports: [AXFormatModule.forChild({ formatters: [AXFileSizeFormatter] })],\n exports: [],\n declarations: [],\n providers: [AXFileSizeFormatter],\n})\nexport class AXFileModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;MAca,mBAAmB,CAAA;AAC9B,IAAA,IAAI,IAAI,GAAA;AACN,QAAA,OAAO,UAAU,CAAC;KACnB;AAED,IAAA,MAAM,CAAC,KAAa,EAAA;AAClB,QAAA,MAAM,IAAI,GAAG,MAAM,CA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A,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,aAFZ,CAAC,mBAAmB,CAAC,EAAA,OAAA,EAAA,CAHtB,cAAc,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAK7D,YAAY,EAAA,UAAA,EAAA,CAAA;kBANxB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC;AACzE,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,YAAY,EAAE,EAAE;oBAChB,SAAS,EAAE,CAAC,mBAAmB,CAAC;AACjC,iBAAA,CAAA;;;ACTD;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"acorex-core-file.mjs","sources":["../../../../libs/core/file/src/lib/file-size-formatter.ts","../../../../libs/core/file/src/lib/file-download-ref.class.ts","../../../../libs/core/file/src/lib/file-download-result.class.ts","../../../../libs/core/file/src/lib/file-upload-ref.class.ts","../../../../libs/core/file/src/lib/file.service.ts","../../../../libs/core/file/src/lib/file.module.ts","../../../../libs/core/file/src/acorex-core-file.ts"],"sourcesContent":["import { AXFormatOptions, AXFormatter } from '@acorex/core/format';\nimport { Injectable } from '@angular/core';\n\nexport interface AXFileSizeFormatterOptions extends AXFormatOptions {\n format: string;\n}\n\ndeclare module '@acorex/core/format' {\n interface AXFormatOptionsMap {\n filesize: AXFileSizeFormatterOptions;\n }\n}\n\n@Injectable()\nexport class AXFileSizeFormatter implements AXFormatter {\n get name(): string {\n return 'filesize';\n }\n\n format(value: number): string {\n const size = Number(value);\n\n if (size === 0) return '0 Bytes';\n if (Number.isNaN(size)) return 'Unknown';\n\n const k = 1024;\n const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\n const i = Math.floor(Math.log(size) / Math.log(k));\n\n return parseFloat((size / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];\n }\n}\n","import { AXFileDownloadResult } from './file-download-result.class';\n\nexport class AXFileDownloadRef extends Promise<AXFileDownloadResult> {\n public abortMethod: () => void;\n constructor(\n executor: (\n resolve: (value?: PromiseLike<AXFileDownloadResult>) => void,\n reject: (reason?: any) => void\n ) => void\n ) {\n super(executor as any);\n }\n //abort the operation\n public abort() {\n if (this.abortMethod) {\n this.abortMethod();\n }\n }\n}\n","export class AXFileDownloadResult {\n _response: Blob;\n\n constructor(response: Blob) {\n this._response = response;\n }\n\n save(filename?: string): Promise<void> {\n this._defaultBrowserDownload(filename);\n return Promise.resolve();\n // else {\n // return new Promise((resolve, reject) => {\n // const button = document.createElement(\"button\");\n // button.addEventListener('click', async () => {\n // button.remove();\n // const opts = {\n // types: [{\n // description: 'Save File',\n // suggestedName: filename\n // // accept: {'text/plain': ['.txt']},\n // }],\n // };\n // const result = await window['showSaveFilePicker'](opts);\n\n // resolve();\n // });\n // button.click();\n // });\n\n // }\n }\n\n blob() {\n return this._response;\n }\n\n base64(): Promise<string> {\n return new Promise((resolve, reject) => {\n const reader = new window.FileReader();\n reader.onloadend = () => resolve(reader.result as string);\n reader.onerror = (e) => reject(e);\n reader.readAsDataURL(this._response);\n });\n }\n\n private _defaultBrowserDownload(filename = 'download') {\n const link = document.createElement('a');\n link.href = URL.createObjectURL(this._response);\n link.download = filename;\n link.click();\n }\n}\n","export class AXFileUploadRef<T = any> extends Promise<T> {\n public abortMethod: () => void;\n constructor(\n executor: (\n resolve: (value?: PromiseLike<T>) => void,\n reject: (reason?: any) => void\n ) => void\n ) {\n super(executor as any);\n }\n //abort the operation\n public abort() {\n if (this.abortMethod) {\n this.abortMethod();\n }\n }\n}\n","import { HttpClient, HttpRequest } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { Observable, Subscription } from 'rxjs';\nimport { AXFileDownloadRef } from './file-download-ref.class';\nimport { AXFileDownloadResult } from './file-download-result.class';\nimport { AXFileUploadRef } from './file-upload-ref.class';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AXFileService {\n constructor(private _httpClient: HttpClient) {}\n\n public download(request: string | Blob | HttpRequest<any>) {\n let s: Subscription;\n\n const promiseFunc = (resolve, reject) => {\n if (typeof request == 'string') {\n //\n }\n if (request instanceof Blob) {\n //\n }\n if (request instanceof HttpRequest) {\n const b = this._httpClient.request(request);\n b.subscribe({\n next: (v: any) => resolve(new AXFileDownloadResult(v)),\n error: (e) => reject(e),\n });\n }\n };\n\n const a = new AXFileDownloadRef(promiseFunc);\n a.abort = () => {\n s?.unsubscribe();\n };\n\n return a;\n\n // let s: Subscription;\n // const promiseFunc = (resolve, reject) => {\n // //TODO: add custome http request\n // //const headers = new HttpHeaders().set('authorization','Bearer '+token);\n // let b!: Observable<Blob>;\n // if (typeof request === 'string') {\n // b = this._httpClient.get(request, { responseType: 'blob' });\n // } else if (isObservable(b)) {\n // b = request;\n // }\n // s = b?.subscribe({\n // next: (v) => resolve(new AXFileDownloadResult(v)),\n // error: (e) => reject(e),\n // });\n // };\n\n // const a = new AXFileDownloadRef(promiseFunc);\n // a.abort = () => {\n // s?.unsubscribe();\n // };\n\n // return a;\n }\n\n public upload<T = any>(url: string, files: File[]): AXFileUploadRef<T> {\n let s: Subscription;\n const formData = new FormData();\n files.forEach((f) => {\n formData.append('files', f);\n });\n const promiseFunc = (resolve, reject) => {\n const b: Observable<T> = this._httpClient.post<T>(url, formData);\n s = b?.subscribe({\n next: (v) => resolve(v),\n error: (e) => reject(e),\n });\n };\n\n const a = new AXFileUploadRef(promiseFunc);\n a.abort = () => {\n s?.unsubscribe();\n };\n return a;\n }\n\n public choose(options?: { accept?: string; multiple?: boolean }): Promise<File[]> {\n return new Promise<File[]>((resolve, reject) => {\n options = Object.assign({ multiple: false }, options);\n const input: HTMLInputElement = document.createElement('input');\n input.style.display = 'none';\n document.body.appendChild(input);\n input.type = 'file';\n input.accept = options.accept || '';\n input.multiple = options.multiple || false;\n //\n const onError = (e) => {\n reject(e);\n document.body.removeChild(input);\n input.remove();\n input.removeEventListener('change', onChange);\n input.removeEventListener('error', onError);\n };\n //\n const onChange = () => {\n resolve(Array.from(input.files || []));\n document.body.removeChild(input);\n input.remove();\n input.removeEventListener('change', onChange);\n input.removeEventListener('error', onError);\n };\n //\n input.addEventListener('change', onChange);\n input.addEventListener('error', onError);\n input.click();\n });\n }\n\n public blobToBase64 = (blob: Blob) => {\n if (blob instanceof Blob) {\n return new Promise<string>((resolve, reject) => {\n const reader = new FileReader();\n reader.onerror = reject;\n reader.onload = () => {\n resolve(reader.result as string);\n };\n reader.readAsDataURL(blob);\n });\n } else {\n return Promise.reject('input is not blob');\n }\n };\n public getSize(file: File | Blob | string) {\n if (this.isBase64(file as string)) {\n return this.getBase64Size(file as string);\n }\n return false;\n }\n\n public isBase64(base64: string) {\n const regx = /[^:]\\w+\\/[\\w-+\\d.]+(?=;|,)/;\n return regx.test(base64);\n }\n\n public getBase64Size(base64: string) {\n return atob(base64.substring(base64.indexOf(',') + 1)).length;\n }\n}\n","import { AXFormatModule } from '@acorex/core/format';\nimport { NgModule } from '@angular/core';\nimport { AXFileSizeFormatter } from './file-size-formatter';\n\n@NgModule({\n imports: [AXFormatModule.forChild({ formatters: [AXFileSizeFormatter] })],\n exports: [],\n declarations: [],\n providers: [AXFileSizeFormatter],\n})\nexport class AXFileModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;MAca,mBAAmB,CAAA;AAC9B,IAAA,IAAI,IAAI,GAAA;AACN,QAAA,OAAO,UAAU,CAAC;KACnB;AAED,IAAA,MAAM,CAAC,KAAa,EAAA;AAClB,QAAA,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAA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