@elderbyte/ngx-starter 15.7.1 → 15.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/components/files/elder-file-drop-zone.directive.mjs +2 -2
- package/esm2020/lib/components/files/elder-file-select.directive.mjs +6 -5
- package/esm2020/lib/components/files/elder-file.module.mjs +1 -2
- package/esm2020/lib/components/files/file-select/file-select.component.mjs +1 -1
- package/esm2020/lib/components/files/file-upload/file-upload.component.mjs +7 -6
- package/esm2020/lib/components/files/listing/file-entry.mjs +58 -12
- package/esm2020/lib/components/files/listing/file-listing-rx.mjs +10 -2
- package/fesm2015/elderbyte-ngx-starter.mjs +96 -82
- package/fesm2015/elderbyte-ngx-starter.mjs.map +1 -1
- package/fesm2020/elderbyte-ngx-starter.mjs +96 -82
- package/fesm2020/elderbyte-ngx-starter.mjs.map +1 -1
- package/lib/components/files/elder-file-select.directive.d.ts +3 -2
- package/lib/components/files/elder-file.module.d.ts +0 -1
- package/lib/components/files/file-select/file-select.component.d.ts +5 -3
- package/lib/components/files/file-upload/file-upload.component.d.ts +2 -1
- package/lib/components/files/listing/file-entry.d.ts +37 -8
- package/lib/components/files/listing/file-listing-rx.d.ts +1 -0
- package/package.json +1 -1
- package/esm2020/lib/components/files/file-proxy.mjs +0 -41
- package/lib/components/files/file-proxy.d.ts +0 -21
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ElementRef, EventEmitter, OnDestroy, OnInit, Renderer2 } from '@angular/core';
|
|
2
2
|
import { BooleanInput } from '@angular/cdk/coercion';
|
|
3
|
+
import { FileEntry } from './listing/file-entry';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
export declare class ElderFileSelectDirective implements OnInit, OnDestroy {
|
|
5
6
|
private el;
|
|
@@ -12,7 +13,7 @@ export declare class ElderFileSelectDirective implements OnInit, OnDestroy {
|
|
|
12
13
|
private readonly logger;
|
|
13
14
|
private _fileInput;
|
|
14
15
|
private _unlisten;
|
|
15
|
-
readonly elderFileSelectChange: EventEmitter<
|
|
16
|
+
readonly elderFileSelectChange: EventEmitter<FileEntry[]>;
|
|
16
17
|
readonly elderSingleFileSelectChange: EventEmitter<File>;
|
|
17
18
|
private _multiple;
|
|
18
19
|
private _directory;
|
|
@@ -68,7 +69,7 @@ export declare class ElderFileSelectDirective implements OnInit, OnDestroy {
|
|
|
68
69
|
private fileInputChanged;
|
|
69
70
|
private clearFileList;
|
|
70
71
|
private emitFileList;
|
|
71
|
-
private
|
|
72
|
+
private toFileEntries;
|
|
72
73
|
static ɵfac: i0.ɵɵFactoryDeclaration<ElderFileSelectDirective, never>;
|
|
73
74
|
static ɵdir: i0.ɵɵDirectiveDeclaration<ElderFileSelectDirective, "[elderFileSelect]", never, { "elderFileSelect": "elderFileSelect"; "elderFileSelectMultiple": "elderFileSelectMultiple"; "elderFileSelectDirectory": "elderFileSelectDirectory"; }, { "elderFileSelectChange": "elderFileSelectChange"; "elderSingleFileSelectChange": "elderSingleFileSelectChange"; }, never, never, false, never>;
|
|
74
75
|
}
|
|
@@ -16,7 +16,6 @@ export { ElderFileSelectDirective } from './elder-file-select.directive';
|
|
|
16
16
|
export { ElderFileDropZoneDirective } from './elder-file-drop-zone.directive';
|
|
17
17
|
export { ElderBlobViewerComponent } from './blob-viewer/elder-blob-viewer.component';
|
|
18
18
|
export * from './blob-url';
|
|
19
|
-
export * from './file-proxy';
|
|
20
19
|
export * from './listing/file-entry';
|
|
21
20
|
export * from './listing/file-listing-rx';
|
|
22
21
|
export declare class ElderFileModule {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
|
+
import { FileEntry } from '../listing/file-entry';
|
|
3
|
+
import { ThemePalette } from '@angular/material/core';
|
|
2
4
|
import * as i0 from "@angular/core";
|
|
3
5
|
export declare class ElderFileSelectComponent implements OnInit {
|
|
4
6
|
/***************************************************************************
|
|
@@ -9,8 +11,8 @@ export declare class ElderFileSelectComponent implements OnInit {
|
|
|
9
11
|
multiple: boolean;
|
|
10
12
|
accept: string;
|
|
11
13
|
icon: string;
|
|
12
|
-
color:
|
|
13
|
-
readonly filesChange: EventEmitter<
|
|
14
|
+
color: ThemePalette;
|
|
15
|
+
readonly filesChange: EventEmitter<FileEntry[]>;
|
|
14
16
|
/***************************************************************************
|
|
15
17
|
* *
|
|
16
18
|
* Constructor *
|
|
@@ -28,7 +30,7 @@ export declare class ElderFileSelectComponent implements OnInit {
|
|
|
28
30
|
* Public API *
|
|
29
31
|
* *
|
|
30
32
|
**************************************************************************/
|
|
31
|
-
fileInputChanged(files:
|
|
33
|
+
fileInputChanged(files: FileEntry[]): void;
|
|
32
34
|
static ɵfac: i0.ɵɵFactoryDeclaration<ElderFileSelectComponent, never>;
|
|
33
35
|
static ɵcmp: i0.ɵɵComponentDeclaration<ElderFileSelectComponent, "elder-file-select", never, { "multiple": "multiple"; "accept": "accept"; "icon": "icon"; "color": "color"; }, { "filesChange": "filesChange"; }, never, never, false, never>;
|
|
34
36
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { IFileUploadClient } from '../../../common/http/upload/file-upload-client';
|
|
3
3
|
import { HttpDataTransfer } from '../../../common/http/transfer/http-data-transfer';
|
|
4
|
+
import { FileEntry } from '../listing/file-entry';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
5
6
|
export declare class ElderFileUploadComponent {
|
|
6
7
|
/***************************************************************************
|
|
@@ -8,7 +9,7 @@ export declare class ElderFileUploadComponent {
|
|
|
8
9
|
* Fields *
|
|
9
10
|
* *
|
|
10
11
|
**************************************************************************/
|
|
11
|
-
files:
|
|
12
|
+
files: FileEntry[];
|
|
12
13
|
uploadProgress: Map<File, HttpDataTransfer>;
|
|
13
14
|
totalProgress: Observable<any>;
|
|
14
15
|
multiple: boolean;
|
|
@@ -1,22 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Represents a file and the relative path where the user has selected it.
|
|
3
|
+
* This is useful if the user has selected a folder and files
|
|
4
|
+
* are listed recursively.
|
|
5
|
+
*/
|
|
6
|
+
export declare class FileEntry {
|
|
7
|
+
readonly file: File;
|
|
3
8
|
/**
|
|
4
9
|
* Contains the relative path from the selected folder
|
|
5
10
|
* to this file. Only relevant if the user has selected a folder.
|
|
6
11
|
*/
|
|
7
12
|
readonly relativeParent: string | null;
|
|
8
|
-
constructor(file: File,
|
|
9
13
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
14
|
+
* Creates a file Entry without an explicit relative parent.
|
|
15
|
+
*
|
|
16
|
+
* However, depending how the file was selected, some browsers
|
|
17
|
+
* encode the relative parent path in the property 'webkitRelativePath'
|
|
18
|
+
* which is also supported by this method.
|
|
19
|
+
*/
|
|
20
|
+
static ofFile(file: File): FileEntry;
|
|
21
|
+
/**
|
|
22
|
+
* Creates a file Entry with a relative parent path
|
|
12
23
|
*/
|
|
13
|
-
relativeParent: string | null);
|
|
24
|
+
static relativeFile(file: File, relativeParent: string | null): FileEntry;
|
|
25
|
+
static toFileMap(entries: FileEntry[]): Map<File, FileEntry>;
|
|
26
|
+
static toFileArray(entries: FileEntry[]): File[];
|
|
27
|
+
/***************************************************************************
|
|
28
|
+
* *
|
|
29
|
+
* Fields *
|
|
30
|
+
* *
|
|
31
|
+
**************************************************************************/
|
|
14
32
|
/**
|
|
15
33
|
* Returns a string which specifies the file's path relative to the directory selected by the user.
|
|
16
34
|
*/
|
|
17
|
-
|
|
35
|
+
readonly relativePath: string;
|
|
36
|
+
/***************************************************************************
|
|
37
|
+
* *
|
|
38
|
+
* Constructor *
|
|
39
|
+
* *
|
|
40
|
+
**************************************************************************/
|
|
41
|
+
private constructor();
|
|
42
|
+
/***************************************************************************
|
|
43
|
+
* *
|
|
44
|
+
* Private methods *
|
|
45
|
+
* *
|
|
46
|
+
**************************************************************************/
|
|
18
47
|
/**
|
|
19
48
|
* Returns a string which specifies the file's path relative to the directory selected by the user.
|
|
20
49
|
*/
|
|
21
|
-
|
|
50
|
+
private static buildRelativePath;
|
|
22
51
|
}
|
|
@@ -15,6 +15,7 @@ export declare class FileListingRx {
|
|
|
15
15
|
**************************************************************************/
|
|
16
16
|
private listFilesRecursiveAsync;
|
|
17
17
|
private observableFile;
|
|
18
|
+
private trimStaringSlash;
|
|
18
19
|
private readEntries;
|
|
19
20
|
private consumeReaderToCompletion;
|
|
20
21
|
}
|
package/package.json
CHANGED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Proxy the File API to an inner file instance,
|
|
3
|
-
* allowing subclasses of the file proxy
|
|
4
|
-
* to easily override selected behaviour.
|
|
5
|
-
*/
|
|
6
|
-
export class FileProxy {
|
|
7
|
-
constructor(inner) {
|
|
8
|
-
this.inner = inner;
|
|
9
|
-
}
|
|
10
|
-
get lastModified() {
|
|
11
|
-
return this.inner.lastModified;
|
|
12
|
-
}
|
|
13
|
-
get name() {
|
|
14
|
-
return this.inner.name;
|
|
15
|
-
}
|
|
16
|
-
get size() {
|
|
17
|
-
return this.inner.size;
|
|
18
|
-
}
|
|
19
|
-
get type() {
|
|
20
|
-
return this.inner.type;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Returns a string which specifies the file's path relative to the directory selected by the user
|
|
24
|
-
*/
|
|
25
|
-
get webkitRelativePath() {
|
|
26
|
-
return this.inner.webkitRelativePath;
|
|
27
|
-
}
|
|
28
|
-
arrayBuffer() {
|
|
29
|
-
return this.inner.arrayBuffer();
|
|
30
|
-
}
|
|
31
|
-
slice(start, end, contentType) {
|
|
32
|
-
return this.inner.slice(start, end, contentType);
|
|
33
|
-
}
|
|
34
|
-
stream() {
|
|
35
|
-
return this.inner.stream();
|
|
36
|
-
}
|
|
37
|
-
text() {
|
|
38
|
-
return this.inner.text();
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJ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uICAgKi9cbiAgZ2V0IHdlYmtpdFJlbGF0aXZlUGF0aCgpOiBzdHJpbmcge1xuICAgIHJldHVybiB0aGlzLmlubmVyLndlYmtpdFJlbGF0aXZlUGF0aDtcbiAgfVxuXG4gIGFycmF5QnVmZmVyKCk6IFByb21pc2U8QXJyYXlCdWZmZXI+IHtcbiAgICByZXR1cm4gdGhpcy5pbm5lci5hcnJheUJ1ZmZlcigpO1xuICB9XG5cbiAgc2xpY2Uoc3RhcnQ/OiBudW1iZXIsIGVuZD86IG51bWJlciwgY29udGVudFR5cGU/OiBzdHJpbmcpOiBCbG9iIHtcbiAgICByZXR1cm4gdGhpcy5pbm5lci5zbGljZShzdGFydCwgZW5kLCBjb250ZW50VHlwZSk7XG4gIH1cblxuICBzdHJlYW0oKTogUmVhZGFibGVTdHJlYW08VWludDhBcnJheT4ge1xuICAgIHJldHVybiB0aGlzLmlubmVyLnN0cmVhbSgpO1xuICB9XG5cbiAgdGV4dCgpOiBQcm9taXNlPHN0cmluZz4ge1xuICAgIHJldHVybiB0aGlzLmlubmVyLnRleHQoKTtcbiAgfVxufVxuIl19
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Proxy the File API to an inner file instance,
|
|
3
|
-
* allowing subclasses of the file proxy
|
|
4
|
-
* to easily override selected behaviour.
|
|
5
|
-
*/
|
|
6
|
-
export declare abstract class FileProxy implements File {
|
|
7
|
-
private readonly inner;
|
|
8
|
-
protected constructor(inner: File);
|
|
9
|
-
get lastModified(): number;
|
|
10
|
-
get name(): string;
|
|
11
|
-
get size(): number;
|
|
12
|
-
get type(): string;
|
|
13
|
-
/**
|
|
14
|
-
* Returns a string which specifies the file's path relative to the directory selected by the user
|
|
15
|
-
*/
|
|
16
|
-
get webkitRelativePath(): string;
|
|
17
|
-
arrayBuffer(): Promise<ArrayBuffer>;
|
|
18
|
-
slice(start?: number, end?: number, contentType?: string): Blob;
|
|
19
|
-
stream(): ReadableStream<Uint8Array>;
|
|
20
|
-
text(): Promise<string>;
|
|
21
|
-
}
|