From bc8e43d86f98b52428bc1902b000a4125c26e7b8 Mon Sep 17 00:00:00 2001 From: KNUTSSON Tor Date: Mon, 30 Sep 2019 10:20:41 +0200 Subject: [PATCH 1/5] Additive option for drag and drop + Demo --- src/Blazor.FileReader/FileReaderJsInterop.cs | 4 +- src/Blazor.FileReader/FileReaderRef.cs | 5 +- .../script/FileReaderComponent.ts | 60 +++++++++++++++++-- .../wwwroot/FileReaderComponent.js | 43 ++++++++++++- .../wwwroot/FileReaderComponent.js.map | 2 +- .../DragnDropCommon.razor | 42 +++++++++---- .../IndexCommon.razor | 4 +- .../wwwroot/index.html | 2 +- 8 files changed, 135 insertions(+), 27 deletions(-) diff --git a/src/Blazor.FileReader/FileReaderJsInterop.cs b/src/Blazor.FileReader/FileReaderJsInterop.cs index 1c7ea0b..470b31d 100644 --- a/src/Blazor.FileReader/FileReaderJsInterop.cs +++ b/src/Blazor.FileReader/FileReaderJsInterop.cs @@ -29,10 +29,10 @@ public FileReaderJsInterop(IJSRuntime jsRuntime, IFileReaderServiceOptions optio _needsInitialization = options.InitializeOnFirstCall; } - public async Task RegisterDropEvents(ElementReference elementReference) + public async Task RegisterDropEvents(ElementReference elementReference, bool additive) { await EnsureInitializedAsync(); - return await CurrentJSRuntime.InvokeAsync($"FileReaderComponent.RegisterDropEvents", elementReference); + return await CurrentJSRuntime.InvokeAsync($"FileReaderComponent.RegisterDropEvents", elementReference, additive); } public async Task UnregisterDropEvents(ElementReference elementReference) diff --git a/src/Blazor.FileReader/FileReaderRef.cs b/src/Blazor.FileReader/FileReaderRef.cs index 7d27dd2..6d96705 100644 --- a/src/Blazor.FileReader/FileReaderRef.cs +++ b/src/Blazor.FileReader/FileReaderRef.cs @@ -16,8 +16,9 @@ public interface IFileReaderRef /// /// Register for drop events on the source element /// + /// If set to true, drop target file list becomes additive. Defaults to false. /// - Task RegisterDropEventsAsync(); + Task RegisterDropEventsAsync(bool additive = false); /// /// Unregister drop events on the source element @@ -141,7 +142,7 @@ public async Task> EnumerateFilesAsync() => Enumerable.Range(0, Math.Max(0, await this.FileReaderJsInterop.GetFileCount(this.ElementRef))) .Select(index => (IFileReference)new FileReference(this, index)); - public async Task RegisterDropEventsAsync() => await this.FileReaderJsInterop.RegisterDropEvents(this.ElementRef); + public async Task RegisterDropEventsAsync(bool additive) => await this.FileReaderJsInterop.RegisterDropEvents(this.ElementRef, additive); public async Task UnregisterDropEventsAsync() => await this.FileReaderJsInterop.UnregisterDropEvents(this.ElementRef); public async Task ClearValue() diff --git a/src/Blazor.FileReader/script/FileReaderComponent.ts b/src/Blazor.FileReader/script/FileReaderComponent.ts index 92f09b2..e807dae 100644 --- a/src/Blazor.FileReader/script/FileReaderComponent.ts +++ b/src/Blazor.FileReader/script/FileReaderComponent.ts @@ -38,26 +38,76 @@ interface IDotNet { invokeMethodAsync(assemblyName: string, methodIdentifier: string, ...args: any[]): Promise } +class ConcatFileList implements FileList { + [index: number]: File; + + length: number; + + item(index: number): File { + return this[index]; + } + + constructor(existing: FileList, additions: FileList) { + console.debug(`ConcatFileList constructor`); + for (var i = 0; i < existing.length; i++) { + console.debug(`Added one item from existing to index ${i}`); + this[i] = existing[i]; + } + + var eligebleAdditions = []; + + // Check for doubles + for (var i = 0; i < additions.length; i++) { + var exists = false; + var addition = additions[i]; + for (var j = 0; j < existing.length; j++) { + + if (existing[j] == addition) { + exists = true; + break; + } + } + + if (!exists) { + eligebleAdditions[eligebleAdditions.length] = addition; + } + } + + for (var i = 0; i < eligebleAdditions.length; i++) { + console.debug(`Added one item from additions to index ${i + existing.length}`); + this[i + existing.length] = eligebleAdditions[i]; + } + + this.length = existing.length + eligebleAdditions.length; + } +} + class FileReaderComponent { private readonly assembly = "Blazor.FileReader"; private readonly namespace = "Blazor.FileReader"; private readonly className = "FileReaderJsInterop"; - private newFileStreamReference: number = 0; private readonly fileStreams: { [reference: number]: File } = {}; private readonly dragElements: Map = new Map(); private readonly elementDataTransfers: Map = new Map(); private static getStreamBuffer: MethodHandle; - private static readFileUnmarshalledAsyncCallback: MethodHandle; - public RegisterDropEvents = (element: HTMLElement): boolean => { + public RegisterDropEvents = (element: HTMLElement, additive : boolean): boolean => { const handler = (ev: DragEvent) => { - this.PreventDefaultHandler(ev); if (ev.target instanceof HTMLElement) { - this.elementDataTransfers.set(ev.target, ev.dataTransfer.files); + var list = ev.dataTransfer.files; + + if (additive) { + var existing = this.elementDataTransfers.get(ev.target); + if (existing != null && existing.length > 0) { + list = new ConcatFileList(existing, list); + } + } + + this.elementDataTransfers.set(ev.target, list); } }; diff --git a/src/Blazor.FileReader/wwwroot/FileReaderComponent.js b/src/Blazor.FileReader/wwwroot/FileReaderComponent.js index 94b3600..4e6dc9e 100755 --- a/src/Blazor.FileReader/wwwroot/FileReaderComponent.js +++ b/src/Blazor.FileReader/wwwroot/FileReaderComponent.js @@ -1,5 +1,37 @@ ; ; +var ConcatFileList = (function () { + function ConcatFileList(existing, additions) { + console.debug("ConcatFileList constructor"); + for (var i = 0; i < existing.length; i++) { + console.debug("Added one item from existing to index " + i); + this[i] = existing[i]; + } + var eligebleAdditions = []; + for (var i = 0; i < additions.length; i++) { + var exists = false; + var addition = additions[i]; + for (var j = 0; j < existing.length; j++) { + if (existing[j] == addition) { + exists = true; + break; + } + } + if (!exists) { + eligebleAdditions[eligebleAdditions.length] = addition; + } + } + for (var i = 0; i < eligebleAdditions.length; i++) { + console.debug("Added one item from additions to index " + (i + existing.length)); + this[i + existing.length] = eligebleAdditions[i]; + } + this.length = existing.length + eligebleAdditions.length; + } + ConcatFileList.prototype.item = function (index) { + return this[index]; + }; + return ConcatFileList; +}()); var FileReaderComponent = (function () { function FileReaderComponent() { var _this = this; @@ -10,11 +42,18 @@ var FileReaderComponent = (function () { this.fileStreams = {}; this.dragElements = new Map(); this.elementDataTransfers = new Map(); - this.RegisterDropEvents = function (element) { + this.RegisterDropEvents = function (element, additive) { var handler = function (ev) { _this.PreventDefaultHandler(ev); if (ev.target instanceof HTMLElement) { - _this.elementDataTransfers.set(ev.target, ev.dataTransfer.files); + var list = ev.dataTransfer.files; + if (additive) { + var existing = _this.elementDataTransfers.get(ev.target); + if (existing != null && existing.length > 0) { + list = new ConcatFileList(existing, list); + } + } + _this.elementDataTransfers.set(ev.target, list); } }; _this.dragElements.set(element, handler); diff --git a/src/Blazor.FileReader/wwwroot/FileReaderComponent.js.map b/src/Blazor.FileReader/wwwroot/FileReaderComponent.js.map index 6efb755..4ddd83e 100755 --- a/src/Blazor.FileReader/wwwroot/FileReaderComponent.js.map +++ b/src/Blazor.FileReader/wwwroot/FileReaderComponent.js.map @@ -1 +1 @@ -{"version":3,"file":"FileReaderComponent.js","sourceRoot":"","sources":["../script/FileReaderComponent.ts"],"names":[],"mappings":"AAuBC,CAAC;AAOD,CAAC;AAUF;IAAA;QAAA,iBA8MC;QA7MoB,aAAQ,GAAG,mBAAmB,CAAC;QAC/B,cAAS,GAAG,mBAAmB,CAAC;QAChC,cAAS,GAAG,qBAAqB,CAAC;QAG3C,2BAAsB,GAAW,CAAC,CAAC;QAC1B,gBAAW,GAAkC,EAAE,CAAC;QAChD,iBAAY,GAAyD,IAAI,GAAG,EAAE,CAAC;QAC/E,yBAAoB,GAA+B,IAAI,GAAG,EAAE,CAAC;QAIvE,uBAAkB,GAAG,UAAC,OAAoB;YAE7C,IAAM,OAAO,GAAG,UAAC,EAAa;gBAE1B,KAAI,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAAC;gBAC/B,IAAI,EAAE,CAAC,MAAM,YAAY,WAAW,EAAE;oBAClC,KAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;iBACnE;YACL,CAAC,CAAC;YAEF,KAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YACxC,OAAO,CAAC,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAC1C,OAAO,CAAC,gBAAgB,CAAC,UAA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C,oBAAoB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAC5D,IAAI,YAAY,EAAE;gBACd,KAAK,GAAG,YAAY,CAAC;aACxB;SACJ;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;IAuCM,iDAAmB,GAA1B,UAA2B,IAAU;QACjC,IAAM,MAAM,GAAG;YACX,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,IAAI;SAClB,CAAC;QAEF,OAAO,MAAM,CAAC;IAClB,CAAC;IA2GL,0BAAC;AAAD,CAAC,AApND,IAoNC;AAEA,MAAc,CAAC,mBAAmB,GAAG,IAAI,mBAAmB,EAAE,CAAC"} \ No newline at end of file diff --git a/src/Demo/Blazor.FileReader.Demo.Common/DragnDropCommon.razor b/src/Demo/Blazor.FileReader.Demo.Common/DragnDropCommon.razor index f131ee9..4689600 100644 --- a/src/Demo/Blazor.FileReader.Demo.Common/DragnDropCommon.razor +++ b/src/Demo/Blazor.FileReader.Demo.Common/DragnDropCommon.razor @@ -2,9 +2,11 @@ @inject IFileReaderService fileReaderService;

Hello, dropped files!

-Welcome to your new filestreaming app.
+Welcome to your new filestreaming app. +
This demo reads files that was dropped in without doing anything particular with it. -

+
+
-
Drop Files here. - @foreach (var fileInfo in FileList) { -
@fileInfo.Name + @foreach (var fileInfo in FileList) + { +
@fileInfo.Name }
+ + +
-

+
+
@code { ElementReference dropTargetElement; IFileReaderRef dropReference; + bool Additive { get; set; } const string dropTargetDragClass = "droptarget-drag"; const string dropTargetClass = "droptarget"; @@ -51,8 +58,18 @@ This demo reads files that was dropped in without doing anything particular with protected override async Task OnAfterRenderAsync(bool isFirstRender) { - dropReference = fileReaderService.CreateReference(dropTargetElement); - await dropReference.RegisterDropEventsAsync(); + if (isFirstRender) + { + dropReference = fileReaderService.CreateReference(dropTargetElement); + await dropReference.RegisterDropEventsAsync(); + } + } + + public async Task OnAdditiveChange(ChangeEventArgs e) + { + Additive = (bool)e.Value; + await dropReference.UnregisterDropEventsAsync(); + await dropReference.RegisterDropEventsAsync(Additive); } public async Task ClearFile() @@ -79,7 +96,8 @@ This demo reads files that was dropped in without doing anything particular with await this.RefreshFileList(); } - private async Task RefreshFileList() { + private async Task RefreshFileList() + { this.FileList.Clear(); foreach (var file in await dropReference.EnumerateFilesAsync()) { diff --git a/src/Demo/Blazor.FileReader.Demo.Common/IndexCommon.razor b/src/Demo/Blazor.FileReader.Demo.Common/IndexCommon.razor index b12f869..b9ba59e 100644 --- a/src/Demo/Blazor.FileReader.Demo.Common/IndexCommon.razor +++ b/src/Demo/Blazor.FileReader.Demo.Common/IndexCommon.razor @@ -42,12 +42,12 @@ There are other demos in the menu.

Console.WriteLine(Output); using (var fs = await file.OpenReadAsync()) { - var bufferSize = 4096; + var bufferSize = 81920; var buffer = new byte[bufferSize]; int count; while ((count = await fs.ReadAsync(buffer, 0, buffer.Length)) != 0) { - Output += $"Read {count} bytes. {fs.Position} / {fs.Length}{nl}"; + //Output += $"Read {count} bytes. {fs.Position} / {fs.Length}{nl}"; this.StateHasChanged(); } Output += $"Done reading file {fileInfo.Name}{nl}."; diff --git a/src/Demo/Blazor.FileReader.Wasm.Demo/wwwroot/index.html b/src/Demo/Blazor.FileReader.Wasm.Demo/wwwroot/index.html index f5e2730..01c92bf 100644 --- a/src/Demo/Blazor.FileReader.Wasm.Demo/wwwroot/index.html +++ b/src/Demo/Blazor.FileReader.Wasm.Demo/wwwroot/index.html @@ -57,7 +57,7 @@ if (loaded == total) { // Reset override. window.XMLHttpRequest.prototype.open = proxied; - $("loadingText").innerHTML = "Loading 100%, opening application..."; + document.getElementById("loadingText").innerHTML = "Loading 100%, opening application..."; } }); return proxied.apply(this, [].slice.call(arguments)); From aff5b2452dffdc79f15ecc665562d7b9e5528052 Mon Sep 17 00:00:00 2001 From: KNUTSSON Tor Date: Mon, 30 Sep 2019 10:21:49 +0200 Subject: [PATCH 2/5] Rollback of index demo change --- src/Demo/Blazor.FileReader.Demo.Common/IndexCommon.razor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Demo/Blazor.FileReader.Demo.Common/IndexCommon.razor b/src/Demo/Blazor.FileReader.Demo.Common/IndexCommon.razor index b9ba59e..b12f869 100644 --- a/src/Demo/Blazor.FileReader.Demo.Common/IndexCommon.razor +++ b/src/Demo/Blazor.FileReader.Demo.Common/IndexCommon.razor @@ -42,12 +42,12 @@ There are other demos in the menu.

Console.WriteLine(Output); using (var fs = await file.OpenReadAsync()) { - var bufferSize = 81920; + var bufferSize = 4096; var buffer = new byte[bufferSize]; int count; while ((count = await fs.ReadAsync(buffer, 0, buffer.Length)) != 0) { - //Output += $"Read {count} bytes. {fs.Position} / {fs.Length}{nl}"; + Output += $"Read {count} bytes. {fs.Position} / {fs.Length}{nl}"; this.StateHasChanged(); } Output += $"Done reading file {fileInfo.Name}{nl}."; From f4c9ee5728d6243c8243bf2437e2444504fc95c0 Mon Sep 17 00:00:00 2001 From: KNUTSSON Tor Date: Mon, 30 Sep 2019 12:26:36 +0200 Subject: [PATCH 3/5] Remove comments, morden declarations --- .../script/FileReaderComponent.ts | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/Blazor.FileReader/script/FileReaderComponent.ts b/src/Blazor.FileReader/script/FileReaderComponent.ts index e807dae..72ffa8b 100644 --- a/src/Blazor.FileReader/script/FileReaderComponent.ts +++ b/src/Blazor.FileReader/script/FileReaderComponent.ts @@ -48,20 +48,17 @@ class ConcatFileList implements FileList { } constructor(existing: FileList, additions: FileList) { - console.debug(`ConcatFileList constructor`); - for (var i = 0; i < existing.length; i++) { - console.debug(`Added one item from existing to index ${i}`); + for (let i = 0; i < existing.length; i++) { this[i] = existing[i]; } var eligebleAdditions = []; // Check for doubles - for (var i = 0; i < additions.length; i++) { - var exists = false; - var addition = additions[i]; - for (var j = 0; j < existing.length; j++) { - + for (let i = 0; i < additions.length; i++) { + let exists = false; + let addition = additions[i]; + for (let j = 0; j < existing.length; j++) { if (existing[j] == addition) { exists = true; break; @@ -73,8 +70,7 @@ class ConcatFileList implements FileList { } } - for (var i = 0; i < eligebleAdditions.length; i++) { - console.debug(`Added one item from additions to index ${i + existing.length}`); + for (let i = 0; i < eligebleAdditions.length; i++) { this[i + existing.length] = eligebleAdditions[i]; } From c82ce31aef3234aedbc844ea872182349723bfa8 Mon Sep 17 00:00:00 2001 From: KNUTSSON Tor Date: Mon, 30 Sep 2019 12:27:24 +0200 Subject: [PATCH 4/5] More modren declarations --- src/Blazor.FileReader/script/FileReaderComponent.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Blazor.FileReader/script/FileReaderComponent.ts b/src/Blazor.FileReader/script/FileReaderComponent.ts index 72ffa8b..30dfdac 100644 --- a/src/Blazor.FileReader/script/FileReaderComponent.ts +++ b/src/Blazor.FileReader/script/FileReaderComponent.ts @@ -94,10 +94,10 @@ class FileReaderComponent { const handler = (ev: DragEvent) => { this.PreventDefaultHandler(ev); if (ev.target instanceof HTMLElement) { - var list = ev.dataTransfer.files; + let list = ev.dataTransfer.files; if (additive) { - var existing = this.elementDataTransfers.get(ev.target); + const existing = this.elementDataTransfers.get(ev.target); if (existing != null && existing.length > 0) { list = new ConcatFileList(existing, list); } From 666a376718918692280213ed8b991dd0663e5069 Mon Sep 17 00:00:00 2001 From: KNUTSSON Tor Date: Mon, 30 Sep 2019 12:35:16 +0200 Subject: [PATCH 5/5] Made ConcatFilelist a Private class, + full equality --- .../script/FileReaderComponent.ts | 82 +++++++++---------- .../wwwroot/FileReaderComponent.js | 63 +++++++------- .../wwwroot/FileReaderComponent.js.map | 2 +- 3 files changed, 72 insertions(+), 75 deletions(-) diff --git a/src/Blazor.FileReader/script/FileReaderComponent.ts b/src/Blazor.FileReader/script/FileReaderComponent.ts index 30dfdac..c79af7e 100644 --- a/src/Blazor.FileReader/script/FileReaderComponent.ts +++ b/src/Blazor.FileReader/script/FileReaderComponent.ts @@ -38,46 +38,6 @@ interface IDotNet { invokeMethodAsync(assemblyName: string, methodIdentifier: string, ...args: any[]): Promise } -class ConcatFileList implements FileList { - [index: number]: File; - - length: number; - - item(index: number): File { - return this[index]; - } - - constructor(existing: FileList, additions: FileList) { - for (let i = 0; i < existing.length; i++) { - this[i] = existing[i]; - } - - var eligebleAdditions = []; - - // Check for doubles - for (let i = 0; i < additions.length; i++) { - let exists = false; - let addition = additions[i]; - for (let j = 0; j < existing.length; j++) { - if (existing[j] == addition) { - exists = true; - break; - } - } - - if (!exists) { - eligebleAdditions[eligebleAdditions.length] = addition; - } - } - - for (let i = 0; i < eligebleAdditions.length; i++) { - this[i + existing.length] = eligebleAdditions[i]; - } - - this.length = existing.length + eligebleAdditions.length; - } -} - class FileReaderComponent { private readonly assembly = "Blazor.FileReader"; private readonly namespace = "Blazor.FileReader"; @@ -99,7 +59,7 @@ class FileReaderComponent { if (additive) { const existing = this.elementDataTransfers.get(ev.target); if (existing != null && existing.length > 0) { - list = new ConcatFileList(existing, list); + list = new FileReaderComponent.ConcatFileList(existing, list); } } @@ -290,6 +250,46 @@ class FileReaderComponent { private PreventDefaultHandler = (ev: DragEvent) => { ev.preventDefault(); } + + static ConcatFileList = class implements FileList { + [index: number]: File; + + length: number; + + item(index: number): File { + return this[index]; + } + + constructor(existing: FileList, additions: FileList) { + for (let i = 0; i < existing.length; i++) { + this[i] = existing[i]; + } + + var eligebleAdditions = []; + + // Check for doubles + for (let i = 0; i < additions.length; i++) { + let exists = false; + let addition = additions[i]; + for (let j = 0; j < existing.length; j++) { + if (existing[j] === addition) { + exists = true; + break; + } + } + + if (!exists) { + eligebleAdditions[eligebleAdditions.length] = addition; + } + } + + for (let i = 0; i < eligebleAdditions.length; i++) { + this[i + existing.length] = eligebleAdditions[i]; + } + + this.length = existing.length + eligebleAdditions.length; + } + } } (window as any).FileReaderComponent = new FileReaderComponent(); diff --git a/src/Blazor.FileReader/wwwroot/FileReaderComponent.js b/src/Blazor.FileReader/wwwroot/FileReaderComponent.js index 4e6dc9e..a27c96d 100755 --- a/src/Blazor.FileReader/wwwroot/FileReaderComponent.js +++ b/src/Blazor.FileReader/wwwroot/FileReaderComponent.js @@ -1,37 +1,5 @@ ; ; -var ConcatFileList = (function () { - function ConcatFileList(existing, additions) { - console.debug("ConcatFileList constructor"); - for (var i = 0; i < existing.length; i++) { - console.debug("Added one item from existing to index " + i); - this[i] = existing[i]; - } - var eligebleAdditions = []; - for (var i = 0; i < additions.length; i++) { - var exists = false; - var addition = additions[i]; - for (var j = 0; j < existing.length; j++) { - if (existing[j] == addition) { - exists = true; - break; - } - } - if (!exists) { - eligebleAdditions[eligebleAdditions.length] = addition; - } - } - for (var i = 0; i < eligebleAdditions.length; i++) { - console.debug("Added one item from additions to index " + (i + existing.length)); - this[i + existing.length] = eligebleAdditions[i]; - } - this.length = existing.length + eligebleAdditions.length; - } - ConcatFileList.prototype.item = function (index) { - return this[index]; - }; - return ConcatFileList; -}()); var FileReaderComponent = (function () { function FileReaderComponent() { var _this = this; @@ -50,7 +18,7 @@ var FileReaderComponent = (function () { if (additive) { var existing = _this.elementDataTransfers.get(ev.target); if (existing != null && existing.length > 0) { - list = new ConcatFileList(existing, list); + list = new FileReaderComponent.ConcatFileList(existing, list); } } _this.elementDataTransfers.set(ev.target, list); @@ -195,6 +163,35 @@ var FileReaderComponent = (function () { }; return result; }; + FileReaderComponent.ConcatFileList = (function () { + function class_1(existing, additions) { + for (var i = 0; i < existing.length; i++) { + this[i] = existing[i]; + } + var eligebleAdditions = []; + for (var i = 0; i < additions.length; i++) { + var exists = false; + var addition = additions[i]; + for (var j = 0; j < existing.length; j++) { + if (existing[j] === addition) { + exists = true; + break; + } + } + if (!exists) { + eligebleAdditions[eligebleAdditions.length] = addition; + } + } + for (var i = 0; i < eligebleAdditions.length; i++) { + this[i + existing.length] = eligebleAdditions[i]; + } + this.length = existing.length + eligebleAdditions.length; + } + class_1.prototype.item = function (index) { + return this[index]; + }; + return class_1; + }()); return FileReaderComponent; }()); window.FileReaderComponent = new FileReaderComponent(); diff --git a/src/Blazor.FileReader/wwwroot/FileReaderComponent.js.map b/src/Blazor.FileReader/wwwroot/FileReaderComponent.js.map index 4ddd83e..9cf6975 100755 --- a/src/Blazor.FileReader/wwwroot/FileReaderComponent.js.map +++ b/src/Blazor.FileReader/wwwroot/FileReaderComponent.js.map @@ -1 +1 @@ -{"version":3,"file":"FileReaderComponent.js","sourceRoot":"","sources":["../script/FileReaderComponent.ts"],"names":[],"mappings":"AAuBC,CAAC;AAOD,CAAC;AAUF;IASI,wBAAY,QAAkB,EAAE,SAAmB;QAC/C,OAAO,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;QAC5C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACtC,OAAO,CAAC,KAAK,CAAC,2CAAyC,CAAG,CAAC,CAAC;YAC5D,IAAI,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;SACzB;QAED,IAAI,iBAAiB,GAAG,EAAE,CAAC;QAG3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACvC,IAAI,MAAM,GAAG,KAAK,CAAC;YACnB,IAAI,QAAQ,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;YAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAEtC,IAAI,QAAQ,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE;oBACzB,MAAM,GAAG,IAAI,CAAC;oBACd,MAAM;iBACT;aACJ;YAED,IAAI,CAAC,MAAM,EAAE;gBACT,iBAAiB,CAAC,iBAAiB,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC;aAC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AI,OAA4B,CAAC,KAAK,CAAC;SAC/C;aAAM;YACH,IAAM,YAAY,GAAG,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAC5D,IAAI,YAAY,EAAE;gBACd,KAAK,GAAG,YAAY,CAAC;aACxB;SACJ;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;IAuCM,iDAAmB,GAA1B,UAA2B,IAAU;QACjC,IAAM,MAAM,GAAG;YACX,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,IAAI;SAClB,CAAC;QAEF,OAAO,MAAM,CAAC;IAClB,CAAC;IA2GL,0BAAC;AAAD,CAAC,AApND,IAoNC;AAEA,MAAc,CAAC,mBAAmB,GAAG,IAAI,mBAAmB,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"FileReaderComponent.js","sourceRoot":"","sources":["../script/FileReaderComponent.ts"],"names":[],"mappings":"AAuBC,CAAC;AAOD,CAAC;AAUF;IAAA;QAAA,iBA4PC;QA3PoB,aAAQ,GAAG,mBAAmB,CAAC;QAC/B,cAAS,GAAG,mBAAmB,CAAC;QAChC,cAAS,GAAG,qBAAqB,CAAC;QAE3C,2BAAsB,GAAW,CAAC,CAAC;QAC1B,gBAAW,GAAkC,EAAE,CAAC;QAChD,iBAAY,GAAyD,IAAI,GAAG,EAAE,CAAC;QAC/E,yBAAoB,GAA+B,IAAI,GAAG,EAAE,CAAC;QAGvE,uBAAkB,GAAG,UAAC,OAAoB,EAAE,QAAkB;YAEjE,IAAM,OAAO,GAAG,UAAC,EAAa;gBAC1B,KAAI,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAAC;gBAC/B,IAAI,EAAE,CAAC,MAAM,YAAY,WAAW,EAAE;oBAClC,IAAI,IAAI,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC;oBAEjC,IA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