{"version":3,"file":"bugsplat-ngx-file-drop.mjs","sources":["../../../projects/ngx-file-drop/src/lib/ngx-file-drop-entry.ts","../../../projects/ngx-file-drop/src/lib/ngx-templates.directive.ts","../../../projects/ngx-file-drop/src/lib/ngx-file-drop.component.ts","../../../projects/ngx-file-drop/src/lib/ngx-file-drop.component.html","../../../projects/ngx-file-drop/src/lib/ngx-file-drop.module.ts","../../../projects/ngx-file-drop/src/bugsplat-ngx-file-drop.ts"],"sourcesContent":["import { FileSystemEntry, FileSystemFileEntry, FileSystemDirectoryEntry } from './dom.types';\n\n/**\n * fileEntry is an instance of {@link FileSystemFileEntry} or {@link FileSystemDirectoryEntry}.\n * Which one is it can be checked using {@link FileSystemEntry.isFile} or {@link FileSystemEntry.isDirectory}\n * properties of the given {@link FileSystemEntry}.\n */\nexport class NgxFileDropEntry {\n    constructor(\n        public relativePath: string,\n        public fileEntry: FileSystemEntry\n    ) {\n    }\n}\n","import { Directive, TemplateRef } from '@angular/core';\n\n@Directive({ selector: '[ngx-file-drop-content-tmp]' })\nexport class NgxFileDropContentTemplateDirective {\n  constructor(public template: TemplateRef<any>) { }\n}\n","import {\n  Component,\n  ContentChild,\n  ElementRef,\n  EventEmitter,\n  Input, OnDestroy,\n  Output,\n  Renderer2,\n  TemplateRef,\n  ViewChild\n} from '@angular/core';\nimport { Subscription, timer } from 'rxjs';\nimport { FileSystemFileEntry } from './dom.types';\nimport { NgxFileDropEntry } from './ngx-file-drop-entry';\nimport { NgxFileDropContentTemplateDirective } from './ngx-templates.directive';\n\n@Component({\n  selector: 'ngx-file-drop',\n  templateUrl: './ngx-file-drop.component.html',\n  styleUrls: ['./ngx-file-drop.component.scss'],\n})\nexport class NgxFileDropComponent implements OnDestroy {\n\n  @Input()\n  public accept: string = '*';\n\n  @Input()\n  public directory: boolean = false;\n\n  @Input()\n  public multiple: boolean = true;\n\n  @Input()\n  public dropZoneLabel: string = '';\n\n  @Input()\n  public dropZoneClassName: string = 'ngx-file-drop__drop-zone';\n\n  @Input()\n  public useDragEnter: boolean = false;\n\n  @Input()\n  public contentClassName: string = 'ngx-file-drop__content';\n\n  @Input()\n  public showBrowseBtn: boolean = false;\n\n  @Input()\n  public browseBtnClassName: string = 'btn btn-primary btn-xs ngx-file-drop__browse-btn';\n\n  @Input()\n  public browseBtnLabel: string = 'Browse files';\n\n  @Output()\n  public onFileDrop: EventEmitter<NgxFileDropEntry[]> = new EventEmitter();\n\n  @Output()\n  public onFileOver: EventEmitter<any> = new EventEmitter();\n\n  @Output()\n  public onFileLeave: EventEmitter<any> = new EventEmitter();\n\n  // custom templates\n  @ContentChild(NgxFileDropContentTemplateDirective, { read: TemplateRef }) contentTemplate?: TemplateRef<any>;\n\n  @ViewChild('fileSelector', { static: true })\n  public fileSelector?: ElementRef;\n\n  public isDraggingOverDropZone: boolean = false;\n\n  private globalDraggingInProgress: boolean = false;\n  private readonly globalDragStartListener: () => void;\n  private readonly globalDragEndListener: () => void;\n\n  private files: NgxFileDropEntry[] = [];\n  private numOfActiveReadEntries: number = 0;\n\n  private helperFormEl: HTMLFormElement | null = null;\n  private fileInputPlaceholderEl: HTMLDivElement | null = null;\n\n  private dropEventTimerSubscription: Subscription | null = null;\n\n  private _disabled: boolean = false;\n\n  public get disabled(): boolean { return this._disabled; }\n\n  @Input()\n  public set disabled(value: boolean) {\n    this._disabled = (value != null && `${value}` !== 'false');\n  }\n\n  constructor(\n    private renderer: Renderer2\n  ) {\n    this.globalDragStartListener = this.renderer.listen('document', 'dragstart', (evt: Event) => {\n      this.globalDraggingInProgress = true;\n    });\n    this.globalDragEndListener = this.renderer.listen('document', 'dragend', (evt: Event) => {\n      this.globalDraggingInProgress = false;\n    });\n  }\n\n  public ngOnDestroy(): void {\n    if (this.dropEventTimerSubscription) {\n      this.dropEventTimerSubscription.unsubscribe();\n      this.dropEventTimerSubscription = null;\n    }\n    this.globalDragStartListener();\n    this.globalDragEndListener();\n    this.files = [];\n    this.helperFormEl = null;\n    this.fileInputPlaceholderEl = null;\n  }\n\n  public onDragOver(event: DragEvent): void {\n    if (this.useDragEnter) {\n      this.preventAndStop(event);\n      if (event.dataTransfer) {\n        event.dataTransfer.dropEffect = 'copy';\n      }\n    } else if (!this.isDropzoneDisabled() && !this.useDragEnter && event.dataTransfer) {\n      if (!this.isDraggingOverDropZone) {\n        this.isDraggingOverDropZone = true;\n        this.onFileOver.emit(event);\n      }\n      this.preventAndStop(event);\n      event.dataTransfer.dropEffect = 'copy';\n    }\n  }\n\n  public onDragEnter(event: Event): void {\n    if (!this.isDropzoneDisabled() && this.useDragEnter) {\n      if (!this.isDraggingOverDropZone) {\n        this.isDraggingOverDropZone = true;\n        this.onFileOver.emit(event);\n      }\n      this.preventAndStop(event);\n    }\n  }\n\n  public onDragLeave(event: Event): void {\n    if (!this.isDropzoneDisabled()) {\n      if (this.isDraggingOverDropZone) {\n        this.isDraggingOverDropZone = false;\n        this.onFileLeave.emit(event);\n      }\n      this.preventAndStop(event);\n    }\n  }\n\n  public async dropFiles(event: DragEvent): Promise<void> {\n    if (!this.isDropzoneDisabled()) {\n      this.isDraggingOverDropZone = false;\n      if (event.dataTransfer) {\n        const items = event.dataTransfer.files;\n        this.preventAndStop(event);\n        await this.checkFiles(items);\n      }\n    }\n  }\n\n  public openFileSelector = (event?: MouseEvent): void => {\n    if (this.fileSelector && this.fileSelector.nativeElement) {\n      (this.fileSelector.nativeElement as HTMLInputElement).click();\n    }\n  };\n\n  /**\n   * Processes the change event of the file input and adds the given files.\n   * @param Event event\n   */\n  public async uploadFiles(event: Event): Promise<void> {\n    if (!this.isDropzoneDisabled()) {\n      if (event.target) {\n        const items = (event.target as HTMLInputElement).files || ([] as any);\n        await this.checkFiles(items);\n        this.resetFileInput();\n      }\n    }\n  }\n\n  private async checkFiles(items: FileList): Promise<void> {\n    for (let i = 0; i < items.length; i++) {\n      const item = items[i];\n      const name = (item as File).name;\n      let isDirectory = false;\n      let isFile = false;\n      try {\n        await item.slice(0, 1).arrayBuffer();\n        isFile = true;\n      } catch {\n        isDirectory = true;\n      }\n\n      const fakeFileEntry: FileSystemFileEntry = {\n        name,\n        isDirectory,\n        isFile,\n        file: <T>(callback: (filea: File) => T) => callback(item as File),\n      };\n      const toUpload: NgxFileDropEntry = new NgxFileDropEntry(fakeFileEntry.name, fakeFileEntry);\n      this.addToQueue(toUpload);\n    }\n\n    if (this.dropEventTimerSubscription) {\n      this.dropEventTimerSubscription.unsubscribe();\n    }\n    this.dropEventTimerSubscription = timer(200, 200)\n      .subscribe(() => {\n        if (this.files.length > 0 && this.numOfActiveReadEntries === 0) {\n          const files = this.files;\n          this.files = [];\n          this.onFileDrop.emit(files);\n        }\n      });\n  }\n\n  /**\n   * Clears any added files from the file input element so the same file can subsequently be added multiple times.\n   */\n  private resetFileInput(): void {\n    if (this.fileSelector && this.fileSelector.nativeElement) {\n      const fileInputEl = this.fileSelector.nativeElement as HTMLInputElement;\n      const fileInputContainerEl = fileInputEl.parentElement;\n      const helperFormEl = this.getHelperFormElement();\n      const fileInputPlaceholderEl = this.getFileInputPlaceholderElement();\n\n      // Just a quick check so we do not mess up the DOM (will never happen though).\n      if (fileInputContainerEl !== helperFormEl) {\n        // Insert the form input placeholder in the DOM before the form input element.\n        this.renderer.insertBefore(fileInputContainerEl, fileInputPlaceholderEl, fileInputEl);\n        // Add the form input as child of the temporary form element, removing the form input from the DOM.\n        this.renderer.appendChild(helperFormEl, fileInputEl);\n        // Reset the form, thus clearing the input element of any files.\n        helperFormEl.reset();\n        // Add the file input back to the DOM in place of the file input placeholder element.\n        this.renderer.insertBefore(fileInputContainerEl, fileInputEl, fileInputPlaceholderEl);\n        // Remove the input placeholder from the DOM\n        this.renderer.removeChild(fileInputContainerEl, fileInputPlaceholderEl);\n      }\n    }\n  }\n\n  /**\n   * Get a cached HTML form element as a helper element to clear the file input element.\n   */\n  private getHelperFormElement(): HTMLFormElement {\n    if (!this.helperFormEl) {\n      this.helperFormEl = this.renderer.createElement('form') as HTMLFormElement;\n    }\n\n    return this.helperFormEl;\n  }\n\n  /**\n   * Get a cached HTML div element to be used as placeholder for the file input element when clearing said element.\n   */\n  private getFileInputPlaceholderElement(): HTMLDivElement {\n    if (!this.fileInputPlaceholderEl) {\n      this.fileInputPlaceholderEl = this.renderer.createElement('div') as HTMLDivElement;\n    }\n\n    return this.fileInputPlaceholderEl;\n  }\n\n  private isDropzoneDisabled(): boolean {\n    return (this.globalDraggingInProgress || this.disabled);\n  }\n\n  private addToQueue(item: NgxFileDropEntry): void {\n    this.files.push(item);\n  }\n\n  private preventAndStop(event: Event): void {\n    event.stopPropagation();\n    event.preventDefault();\n  }\n}\n","<div [className]=\"dropZoneClassName\"\n     [class.ngx-file-drop__drop-zone--over]=\"isDraggingOverDropZone\"\n     (drop)=\"dropFiles($event)\"\n     (dragover)=\"onDragOver($event)\"\n     (dragenter)=\"onDragEnter($event)\"\n     (dragleave)=\"onDragLeave($event)\">\n  <div [className]=\"contentClassName\">\n    <input \n      type=\"file\" \n      #fileSelector \n      [accept]=\"accept\" \n      [attr.directory]=\"directory || undefined\" \n      [attr.webkitdirectory]=\"directory || undefined\"\n      [attr.mozdirectory]=\"directory || undefined\"\n      [attr.msdirectory]=\"directory || undefined\"\n      [attr.odirectory]=\"directory || undefined\"\n      [multiple]=\"multiple\"\n      (change)=\"uploadFiles($event)\" \n      class=\"ngx-file-drop__file-input\" \n    />\n\n    <ng-template #defaultContentTemplate>\n      <div *ngIf=\"dropZoneLabel\" class=\"ngx-file-drop__drop-zone-label\">{{dropZoneLabel}}</div>\n      <div *ngIf=\"showBrowseBtn\">\n        <input type=\"button\" [className]=\"browseBtnClassName\" value=\"{{browseBtnLabel}}\" (click)=\"openFileSelector($event)\" />\n      </div>\n    </ng-template>\n\n    <ng-template\n      [ngTemplateOutlet]=\"contentTemplate || defaultContentTemplate\"\n      [ngTemplateOutletContext]=\"{ openFileSelector: openFileSelector }\">\n    </ng-template>\n  </div>\n</div>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { NgxFileDropComponent } from './ngx-file-drop.component';\nimport { NgxFileDropContentTemplateDirective } from './ngx-templates.directive';\n\n@NgModule({\n  declarations: [\n    NgxFileDropComponent,\n    NgxFileDropContentTemplateDirective,\n  ],\n  imports: [\n    CommonModule\n  ],\n  exports: [\n    NgxFileDropComponent,\n    NgxFileDropContentTemplateDirective,\n  ],\n  providers: [],\n  bootstrap: [\n    NgxFileDropComponent\n  ],\n})\nexport class NgxFileDropModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAEA;;;;AAIG;MACU,gBAAgB,CAAA;IACzB,WACW,CAAA,YAAoB,EACpB,SAA0B,EAAA;QAD1B,IAAY,CAAA,YAAA,GAAZ,YAAY,CAAQ;QACpB,IAAS,CAAA,SAAA,GAAT,SAAS,CAAiB;KAEpC;AACJ;;MCVY,mCAAmC,CAAA;AAC9C,IAAA,WAAA,CAAmB,QAA0B,EAAA;QAA1B,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAkB;KAAK;8GADvC,mCAAmC,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,WAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;kGAAnC,mCAAmC,EAAA,QAAA,EAAA,6BAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;2FAAnC,mCAAmC,EAAA,UAAA,EAAA,CAAA;kBAD/C,SAAS;mBAAC,EAAE,QAAQ,EAAE,6BAA6B,EAAE,CAAA;;;MCmBzC,oBAAoB,CAAA;IA+D/B,IAAW,QAAQ,KAAc,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE;IAEzD,IACW,QAAQ,CAAC,KAAc,EAAA;AAChC,QAAA,IAAI,CAAC,SAAS,IAAI,KAAK,IAAI,IAAI,IAAI,CAAA,EAAG,KAAK,CAAA,CAAE,KAAK,OAAO,CAAC,C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