UNPKG

ngx-dropzone-next

Version:

A highly configurable dropzone component for Angular.

1 lines 43.8 kB
{"version":3,"file":"ngx-dropzone-next.mjs","sources":["../../../projects/ngx-dropzone/src/lib/ngx-dropzone-label.directive.ts","../../../projects/ngx-dropzone/src/lib/ngx-dropzone-preview/ngx-dropzone-remove-badge/ngx-dropzone-remove-badge.component.ts","../../../projects/ngx-dropzone/src/lib/ngx-dropzone-preview/ngx-dropzone-preview.component.ts","../../../projects/ngx-dropzone/src/lib/ngx-dropzone-preview/ngx-dropzone-preview.component.html","../../../projects/ngx-dropzone/src/lib/ngx-dropzone/ngx-dropzone.service.ts","../../../projects/ngx-dropzone/src/lib/ngx-dropzone/on-drop.ts","../../../projects/ngx-dropzone/src/lib/ngx-dropzone/ngx-dropzone.component.ts","../../../projects/ngx-dropzone/src/lib/ngx-dropzone/ngx-dropzone.component.html","../../../projects/ngx-dropzone/src/lib/ngx-dropzone-preview/ngx-dropzone-image-preview/ngx-dropzone-image-preview.component.ts","../../../projects/ngx-dropzone/src/lib/ngx-dropzone-preview/ngx-dropzone-image-preview/ngx-dropzone-image-preview.component.html","../../../projects/ngx-dropzone/src/lib/ngx-dropzone-preview/ngx-dropzone-video-preview/ngx-dropzone-video-preview.component.ts","../../../projects/ngx-dropzone/src/lib/ngx-dropzone-preview/ngx-dropzone-video-preview/ngx-dropzone-video-preview.component.html","../../../projects/ngx-dropzone/src/public_api.ts","../../../projects/ngx-dropzone/src/ngx-dropzone-next.ts"],"sourcesContent":["import { Directive } from '@angular/core';\n\n@Directive({ selector: 'ngx-dropzone-label' })\nexport class NgxDropzoneLabelDirective {}\n","import { ChangeDetectionStrategy, Component } from '@angular/core';\n\n@Component({\n selector: 'ngx-dropzone-remove-badge',\n template: `\n <svg>\n <line x1=\"0\" y1=\"0\" x2=\"10\" y2=\"10\" />\n <line x1=\"0\" y1=\"10\" x2=\"10\" y2=\"0\" />\n </svg>\n `,\n styleUrls: ['./ngx-dropzone-remove-badge.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgxDropzoneRemoveBadgeComponent {}\n","import {\n Component,\n HostBinding,\n HostListener,\n output,\n ChangeDetectionStrategy,\n booleanAttribute,\n input,\n inject,\n} from '@angular/core';\nimport { DomSanitizer } from '@angular/platform-browser';\n\nimport { NgxDropzoneRemoveBadgeComponent } from './ngx-dropzone-remove-badge/ngx-dropzone-remove-badge.component';\n\n@Component({\n selector: 'ngx-dropzone-preview',\n templateUrl: './ngx-dropzone-preview.component.html',\n styleUrls: ['./ngx-dropzone-preview.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgxDropzoneRemoveBadgeComponent],\n host: {\n /** We use the HostBinding to pass these common styles to child components. */\n '[style]': 'hostStyles',\n },\n})\nexport class NgxDropzonePreviewComponent {\n readonly hostStyles = inject(DomSanitizer).bypassSecurityTrustStyle(`\n display: flex;\n height: 140px;\n min-height: 140px;\n min-width: 180px;\n max-width: 180px;\n justify-content: center;\n align-items: center;\n padding: 0 20px;\n margin: 10px;\n border-radius: 5px;\n position: relative;\n `);\n\n /** The file to preview. */\n readonly file = input<File>();\n\n /** Allow the user to remove files. */\n readonly removable = input(false, { transform: booleanAttribute });\n\n /** Emitted when the element should be removed. */\n readonly removed = output<File>();\n\n @HostListener('keyup', ['$event'])\n keyEvent(event: KeyboardEvent) {\n if (\n // Backspace\n event.keyCode === 8 ||\n // Delete\n event.keyCode === 46\n ) {\n this.remove();\n }\n }\n\n /** Make the preview item focusable using the tab key. */\n @HostBinding('tabindex') tabIndex = 0;\n\n /** Remove method to be used from the template. */\n _remove(event: MouseEvent) {\n event.stopPropagation();\n this.remove();\n }\n\n /** Remove the preview item (use from component code). */\n remove() {\n if (this.removable()) {\n this.removed.emit(this.file()!);\n }\n }\n\n protected async readFile(): Promise<string | ArrayBuffer> {\n return new Promise<string | ArrayBuffer>((resolve, reject) => {\n const file = this.file();\n const reader = new FileReader();\n\n const cleanup = () => {\n reader.removeEventListener('load', onLoad);\n reader.removeEventListener('error', onError);\n };\n\n const onLoad = () => {\n cleanup();\n resolve(reader.result!);\n };\n\n const onError = (error: Event) => {\n cleanup();\n reject(error);\n };\n\n reader.addEventListener('load', onLoad);\n reader.addEventListener('error', onError);\n\n if (!file) {\n return reject(\n 'No file to read. Please provide a file using the [file] Input property.'\n );\n }\n\n reader.readAsDataURL(file);\n });\n }\n}\n","<ng-content select=\"ngx-dropzone-label\"></ng-content>\n@if (removable()) {\n <ngx-dropzone-remove-badge (click)=\"_remove($event)\" />\n}\n","import { Injectable } from '@angular/core';\n\nexport interface FileSelectResult {\n /** The added files, emitted in the filesAdded event. */\n addedFiles: File[];\n\n /** The rejected files, emitted in the filesRejected event. */\n rejectedFiles: RejectedFile[];\n}\n\nexport interface RejectedFile extends File {\n /** The reason the file was rejected. */\n reason?: RejectReason;\n}\n\nexport type RejectReason = 'type' | 'size' | 'no_multiple';\n\n/**\n * This service contains the filtering logic to be applied to\n * any dropped or selected file. If a file matches all criteria\n * like maximum size or accept type, it will be emitted in the\n * addedFiles array, otherwise in the rejectedFiles array.\n */\n@Injectable({ providedIn: 'root' })\nexport class NgxDropzoneService {\n parseFileList(\n files: FileList,\n accept: string,\n maxFileSize: number | null | undefined,\n multiple: boolean\n ): FileSelectResult {\n const addedFiles: File[] = [];\n const rejectedFiles: RejectedFile[] = [];\n\n for (let i = 0; i < files.length; i++) {\n const file = files.item(i)!;\n\n if (!this.isAccepted(file, accept)) {\n this.rejectFile(rejectedFiles, file, 'type');\n continue;\n }\n\n if (maxFileSize && file.size > maxFileSize) {\n this.rejectFile(rejectedFiles, file, 'size');\n continue;\n }\n\n if (!multiple && addedFiles.length >= 1) {\n this.rejectFile(rejectedFiles, file, 'no_multiple');\n continue;\n }\n\n addedFiles.push(file);\n }\n\n const result: FileSelectResult = {\n addedFiles,\n rejectedFiles,\n };\n\n return result;\n }\n\n private isAccepted(file: File, accept: string): boolean {\n if (accept === '*') {\n return true;\n }\n\n // Sanitize filename first\n const safeName = this.sanitizeFilename(file.name);\n const filename = safeName.toLowerCase();\n const filetype = file.type.toLowerCase();\n\n const acceptFiletypes = accept\n .split(',')\n .map((it) => it.toLowerCase().trim())\n .filter((it) => it.length > 0); // Remove empty strings\n\n return acceptFiletypes.some((acceptFiletype) => {\n // Wildcard MIME (more restrictive).\n if (acceptFiletype.endsWith('/*')) {\n const [acceptMain] = acceptFiletype.split('/');\n const [fileMain] = filetype.split('/');\n return acceptMain === fileMain && acceptMain.length > 0;\n }\n\n // Extension check - get LAST extension only.\n if (acceptFiletype.startsWith('.')) {\n const lastDot = filename.lastIndexOf('.');\n if (lastDot === -1) return false;\n const ext = filename.substring(lastDot);\n return ext === acceptFiletype;\n }\n\n // Exact MIME match\n return acceptFiletype === filetype;\n });\n }\n\n private sanitizeFilename(name: string): string {\n return name\n .replace(/[^a-zA-Z0-9._-]/g, '_') // Remove special chars\n .replace(/\\.{2,}/g, '.') // No \"..\"\n .replace(/\\0/g, '') // Remove null bytes\n .substring(0, 255); // Limit length\n }\n\n private rejectFile(\n rejectedFiles: RejectedFile[],\n file: File,\n reason: RejectReason\n ) {\n const rejectedFile = file as RejectedFile;\n rejectedFile.reason = reason;\n\n rejectedFiles.push(rejectedFile);\n }\n}\n","import type { NgxDropzoneComponent } from './ngx-dropzone.component';\nimport { NgxDropzoneService } from './ngx-dropzone.service';\n\nexport async function onDropImpl(\n ctx: NgxDropzoneComponent,\n dataTransfer: DataTransfer\n) {\n const { files, items } = dataTransfer;\n\n // if processDirectoryDrop is not enabled or webkitGetAsEntry is not supported we handle the drop as usual\n if (\n !ctx.processDirectoryDrop() ||\n !DataTransferItem.prototype.webkitGetAsEntry\n ) {\n handleFileDrop(ctx, files);\n // if processDirectoryDrop is enabled and webkitGetAsEntry is supported we can extract files from a dropped directory\n } else if (items.length > 0) {\n const droppedFiles: File[] = [];\n const droppedDirectories: FileSystemEntry[] = [];\n\n // Separate dropped files from dropped directories\n for (let index = 0; index < items.length; index++) {\n const entry = items[index].webkitGetAsEntry();\n\n if (!entry) {\n continue;\n }\n\n if (entry.isFile) {\n // Get File directly from entry instead of relying on index mapping.\n const file = items[index].getAsFile();\n if (file) {\n droppedFiles.push(file);\n }\n } else if (entry.isDirectory) {\n droppedDirectories.push(entry);\n }\n }\n\n const droppedFilesList = new DataTransfer();\n for (const file of droppedFiles) {\n // Safari requires actual File objects, not Blobs.\n if (file instanceof File) {\n droppedFilesList.items.add(file);\n }\n }\n\n // if no directory is dropped we are done and can call handleFileDrop\n if (!droppedDirectories.length && droppedFilesList.items.length) {\n handleFileDrop(ctx, droppedFilesList.files);\n }\n\n // if directories are dropped we extract the files from these directories one-by-one and add it to droppedFilesList\n if (droppedDirectories.length) {\n const extractFilesFromDirectoryCalls: Promise<File[]>[] = [];\n\n for (const droppedDirectory of droppedDirectories) {\n extractFilesFromDirectoryCalls.push(\n extractFilesFromDirectory(droppedDirectory)\n );\n }\n\n // wait for all directories to be proccessed to add the extracted files afterwards\n await Promise.all(extractFilesFromDirectoryCalls).then(\n (allExtractedFiles: File[][]) => {\n allExtractedFiles\n .reduce((a, b) => [...a, ...b])\n .forEach((extractedFile: File) => {\n droppedFilesList.items.add(extractedFile);\n });\n }\n );\n\n handleFileDrop(ctx, droppedFilesList.files);\n }\n }\n}\n\nasync function getFileFromFileEntry(entry: FileSystemEntry) {\n try {\n const fileSystemFileEntry = <FileSystemFileEntry>entry;\n\n return await new Promise<File>((resolve, reject) =>\n fileSystemFileEntry.file(resolve, reject)\n );\n } catch (error) {\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n console.log('Error converting a fileEntry to a File: ', error);\n }\n return null;\n }\n}\n\nfunction extractFilesFromDirectory(directory: FileSystemEntry) {\n return new Promise<File[]>((resolve) => {\n const files: File[] = [];\n\n const reader = (directory as FileSystemDirectoryEntry).createReader();\n\n // we need this to be a recursion because of this issue: https://bugs.chromium.org/p/chromium/issues/detail?id=514087\n const readEntries = () => {\n reader.readEntries(async (entries: FileSystemEntry[]) => {\n if (entries.length > 0) {\n for (const entry of entries.filter(({ isFile }) => isFile)) {\n const file = await getFileFromFileEntry(entry);\n file && files.push(file);\n }\n\n readEntries();\n } else {\n resolve(files);\n }\n });\n };\n\n readEntries();\n });\n}\n\nexport function handleFileDrop(ctx: NgxDropzoneComponent, files: FileList) {\n const service = ctx.injector.get(NgxDropzoneService);\n\n const result = service.parseFileList(\n files,\n ctx.accept(),\n ctx.maxFileSize(),\n ctx.multiple()\n );\n\n ctx.change.emit({\n addedFiles: result.addedFiles,\n rejectedFiles: result.rejectedFiles,\n source: ctx,\n });\n}\n","import {\n Component,\n ElementRef,\n output,\n input,\n inject,\n Injector,\n viewChild,\n contentChildren,\n computed,\n booleanAttribute,\n numberAttribute,\n signal,\n type OnChanges,\n type SimpleChanges,\n PendingTasks,\n afterNextRender,\n DestroyRef,\n} from '@angular/core';\n\nimport { NgxDropzonePreviewComponent } from '../ngx-dropzone-preview/ngx-dropzone-preview.component';\nimport type { RejectedFile } from './ngx-dropzone.service';\nimport { handleFileDrop, onDropImpl } from './on-drop';\n\nexport interface NgxDropzoneChangeEvent {\n source: NgxDropzoneComponent;\n addedFiles: File[];\n rejectedFiles: RejectedFile[];\n}\n\n@Component({\n selector: 'ngx-dropzone, [ngx-dropzone]',\n templateUrl: './ngx-dropzone.component.html',\n styleUrls: ['./ngx-dropzone.component.scss'],\n host: {\n '[class.ngx-dz-hovered]': 'isHovered()',\n '[class.unclickable]': 'disableClick()',\n '[class.expandable]': 'expandable()',\n '[class.ngx-dz-disabled]': 'disabled()',\n },\n})\nexport class NgxDropzoneComponent implements OnChanges {\n readonly injector = inject(Injector);\n\n /** A list of the content-projected preview children. */\n readonly previewChildren = contentChildren(NgxDropzonePreviewComponent, {\n descendants: true,\n });\n\n protected readonly hasPreviews = computed(\n () => !!this.previewChildren().length\n );\n\n /** A template reference to the native file input element. */\n readonly fileInput =\n viewChild.required<ElementRef<HTMLInputElement>>('fileInput');\n\n /** Emitted when any files were added or rejected. */\n readonly change = output<NgxDropzoneChangeEvent>();\n\n /** Set the accepted file types. Defaults to '*'. */\n readonly accept = input('*');\n\n /** Disable any user interaction with the component. */\n readonly disabled = input(false, { transform: booleanAttribute });\n\n /** Allow the selection of multiple files. */\n readonly multiple = input(true, { transform: booleanAttribute });\n\n /** Set the maximum size a single file may have. */\n readonly maxFileSize = input(undefined, { transform: numberAttribute });\n\n /** Allow the dropzone container to expand vertically. */\n readonly expandable = input(false, { transform: booleanAttribute });\n\n /** Open the file selector on click. */\n readonly disableClick = input(false, { transform: booleanAttribute });\n\n /** Allow dropping directories. */\n readonly processDirectoryDrop = input(false, { transform: booleanAttribute });\n\n /** Expose the id, aria-label, aria-labelledby and aria-describedby of the native file input for proper accessibility. */\n readonly id = input('');\n readonly ariaLabel = input('', { alias: 'aria-label' });\n readonly ariaLabelledby = input('', { alias: 'aria-labelledby' });\n readonly ariaDescribedBy = input('', { alias: 'aria-describedby' });\n\n protected readonly isHovered = signal(false);\n\n private readonly _destroyRef = inject(DestroyRef);\n private readonly _pendingTasks = inject(PendingTasks);\n private readonly _host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n constructor() {\n if (typeof ngServerMode === 'undefined' || ngServerMode) {\n return;\n }\n\n afterNextRender(() => this._setupEventListeners());\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['disabled'] && this.isHovered()) {\n this.isHovered.set(false);\n }\n }\n\n showFileSelector() {\n if (!this.disabled()) {\n (this.fileInput().nativeElement as HTMLInputElement).click();\n }\n }\n\n private _setupEventListeners(): void {\n const host = this._host.nativeElement;\n const fileInput = this.fileInput().nativeElement;\n\n const onClick = () => {\n if (!this.disableClick()) {\n this.showFileSelector();\n }\n };\n\n // Dragover - prevents default to allow drop & shows hover state.\n const onDragover = (event: DragEvent) => {\n if (this.disabled()) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n\n this.isHovered.set(true);\n };\n\n // Dragleave - removes hover state when drag leaves element.\n const onDragleave = (event: DragEvent) => {\n const target = event.currentTarget as HTMLElement | null;\n const related = event.relatedTarget as Node | null;\n\n if (target && (!related || !target.contains(related))) {\n this.isHovered.set(false);\n }\n };\n\n const onDrop = (event: DragEvent) => {\n if (this.disabled()) {\n return;\n }\n\n // fix(#32): Prevent the default event behaviour which caused the change event to emit twice.\n event.preventDefault();\n event.stopPropagation();\n\n this.isHovered.set(false);\n const { dataTransfer } = event;\n\n if (dataTransfer === null) {\n return;\n }\n\n this._pendingTasks.run(() => onDropImpl(this, dataTransfer));\n };\n\n // Manual event listeners to avoid Angular's change detection overhead.\n host.addEventListener('click', onClick); // Show the native OS file explorer to select files.\n host.addEventListener('dragover', onDragover);\n host.addEventListener('dragleave', onDragleave);\n host.addEventListener('drop', onDrop);\n fileInput.addEventListener('change', this._onFilesSelected);\n\n this._destroyRef.onDestroy(() => {\n host.removeEventListener('click', onClick);\n host.removeEventListener('dragover', onDragover);\n host.removeEventListener('dragleave', onDragleave);\n host.removeEventListener('drop', onDrop);\n fileInput.removeEventListener('change', this._onFilesSelected);\n });\n }\n\n // Handles files selected via <input type=\"file\">.\n private _onFilesSelected = (event: Event) => {\n const target = <HTMLInputElement>event.target;\n const files = target.files;\n\n // fix(#32): Prevent the default event behaviour which caused the change event to emit twice.\n event.preventDefault();\n event.stopPropagation();\n\n if (files === null || files.length === 0) {\n return;\n }\n\n try {\n handleFileDrop(this, files);\n } finally {\n target.value = '';\n }\n };\n}\n","<input\n #fileInput\n type=\"file\"\n [id]=\"id()\"\n [multiple]=\"multiple()\"\n [accept]=\"accept()\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n/>\n\n@if (!hasPreviews()) {\n <ng-content select=\"ngx-dropzone-label\" />\n}\n\n<ng-content select=\"ngx-dropzone-preview\" />\n<ng-content />\n","import {\n Component,\n ChangeDetectionStrategy,\n input,\n signal,\n afterNextRender,\n type OnChanges,\n type SimpleChanges,\n inject,\n} from '@angular/core';\nimport { DomSanitizer } from '@angular/platform-browser';\n\nimport { NgxDropzonePreviewComponent } from '../ngx-dropzone-preview.component';\nimport { NgxDropzoneRemoveBadgeComponent } from '../ngx-dropzone-remove-badge/ngx-dropzone-remove-badge.component';\n\n@Component({\n selector: 'ngx-dropzone-image-preview',\n templateUrl: './ngx-dropzone-image-preview.component.html',\n styleUrls: ['./ngx-dropzone-image-preview.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgxDropzoneRemoveBadgeComponent],\n providers: [\n {\n provide: NgxDropzonePreviewComponent,\n useExisting: NgxDropzoneImagePreviewComponent,\n },\n ],\n})\nexport class NgxDropzoneImagePreviewComponent\n extends NgxDropzonePreviewComponent\n implements OnChanges\n{\n /** The image data source. */\n private defaultImgLoading =\n 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBzdHlsZT0ibWFyZ2luOiBhdXRvOyBiYWNrZ3JvdW5kOiByZ2IoMjQxLCAyNDIsIDI0Mykgbm9uZSByZXBlYXQgc2Nyb2xsIDAlIDAlOyBkaXNwbGF5OiBibG9jazsgc2hhcGUtcmVuZGVyaW5nOiBhdXRvOyIgd2lkdGg9IjIyNHB4IiBoZWlnaHQ9IjIyNHB4IiB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQiPgo8Y2lyY2xlIGN4PSI1MCIgY3k9IjUwIiByPSIxNCIgc3Ryb2tlLXdpZHRoPSIzIiBzdHJva2U9IiM4NWEyYjYiIHN0cm9rZS1kYXNoYXJyYXk9IjIxLjk5MTE0ODU3NTEyODU1MiAyMS45OTExNDg1NzUxMjg1NTIiIGZpbGw9Im5vbmUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCI+CiAgPGFuaW1hdGVUcmFuc2Zvcm0gYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIiB0eXBlPSJyb3RhdGUiIGR1cj0iMS4xNjI3OTA2OTc2NzQ0MTg0cyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGtleVRpbWVzPSIwOzEiIHZhbHVlcz0iMCA1MCA1MDszNjAgNTAgNTAiPjwvYW5pbWF0ZVRyYW5zZm9ybT4KPC9jaXJjbGU+CjxjaXJjbGUgY3g9IjUwIiBjeT0iNTAiIHI9IjEwIiBzdHJva2Utd2lkdGg9IjMiIHN0cm9rZT0iI2JiY2VkZCIgc3Ryb2tlLWRhc2hhcnJheT0iMTUuNzA3OTYzMjY3OTQ4OTY2IDE1LjcwNzk2MzI2Nzk0ODk2NiIgc3Ryb2tlLWRhc2hvZmZzZXQ9IjE1LjcwNzk2MzI2Nzk0ODk2NiIgZmlsbD0ibm9uZSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIj4KICA8YW5pbWF0ZVRyYW5zZm9ybSBhdHRyaWJ1dGVOYW1lPSJ0cmFuc2Zvcm0iIHR5cGU9InJvdGF0ZSIgZHVyPSIxLjE2Mjc5MDY5NzY3NDQxODRzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIga2V5VGltZXM9IjA7MSIgdmFsdWVzPSIwIDUwIDUwOy0zNjAgNTAgNTAiPjwvYW5pbWF0ZVRyYW5zZm9ybT4KPC9jaXJjbGU+CjwhLS0gW2xkaW9dIGdlbmVyYXRlZCBieSBodHRwczovL2xvYWRpbmcuaW8vIC0tPjwvc3ZnPg==';\n protected imageSrc = signal(\n inject(DomSanitizer).bypassSecurityTrustUrl(this.defaultImgLoading)\n );\n\n /** The file to preview. */\n override readonly file = input<File>();\n\n constructor() {\n super();\n\n afterNextRender(() => {\n this.renderImage();\n });\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['file']) {\n this.renderImage();\n }\n }\n\n private renderImage() {\n this.readFile()\n .then((img) => setTimeout(() => this.imageSrc.set(img)))\n .catch((err) => console.error(err));\n }\n}\n","<img [src]=\"imageSrc()\" />\n<ng-content select=\"ngx-dropzone-label\"></ng-content>\n@if (removable()) {\n <ngx-dropzone-remove-badge (click)=\"_remove($event)\" />\n}\n","import {\n Component,\n inject,\n DestroyRef,\n afterNextRender,\n signal,\n ChangeDetectionStrategy,\n untracked,\n} from '@angular/core';\nimport { DomSanitizer, type SafeUrl } from '@angular/platform-browser';\n\nimport { NgxDropzonePreviewComponent } from '../ngx-dropzone-preview.component';\nimport { NgxDropzoneRemoveBadgeComponent } from '../ngx-dropzone-remove-badge/ngx-dropzone-remove-badge.component';\n\n@Component({\n selector: 'ngx-dropzone-video-preview',\n templateUrl: './ngx-dropzone-video-preview.component.html',\n styleUrls: ['./ngx-dropzone-video-preview.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgxDropzoneRemoveBadgeComponent],\n providers: [\n {\n provide: NgxDropzonePreviewComponent,\n useExisting: NgxDropzoneVideoPreviewComponent,\n },\n ],\n})\nexport class NgxDropzoneVideoPreviewComponent extends NgxDropzonePreviewComponent {\n /** The video data source. */\n protected readonly _sanitizedVideoSrc = signal<SafeUrl | null>(null);\n\n constructor() {\n super();\n\n const destroyRef = inject(DestroyRef);\n const sanitizer = inject(DomSanitizer);\n\n afterNextRender(() => {\n const file = untracked(this.file);\n if (!file) return;\n\n /**\n * We sanitize the URL here to enable the preview.\n * Please note that this could cause security issues!\n **/\n const videoObjectUrl = URL.createObjectURL(file);\n this._sanitizedVideoSrc.set(\n sanitizer.bypassSecurityTrustUrl(videoObjectUrl)\n );\n\n destroyRef.onDestroy(() => URL.revokeObjectURL(videoObjectUrl));\n });\n }\n}\n","@if (_sanitizedVideoSrc(); as sanitizedVideoSrc) {\n <video controls (click)=\"$event.stopPropagation()\">\n <source [src]=\"sanitizedVideoSrc\" />\n </video>\n}\n\n<ng-content select=\"ngx-dropzone-label\"></ng-content>\n\n@if (removable()) {\n <ngx-dropzone-remove-badge (click)=\"_remove($event)\" />\n}\n","/*\n * Public API Surface of ngx-dropzone-next\n */\n\nexport { NgxDropzoneLabelDirective } from './lib/ngx-dropzone-label.directive';\n\nexport {\n type NgxDropzoneChangeEvent,\n NgxDropzoneComponent,\n} from './lib/ngx-dropzone/ngx-dropzone.component';\n\nexport { NgxDropzonePreviewComponent } from './lib/ngx-dropzone-preview/ngx-dropzone-preview.component';\n\nexport { NgxDropzoneImagePreviewComponent } from './lib/ngx-dropzone-preview/ngx-dropzone-image-preview/ngx-dropzone-image-preview.component';\n\nexport { NgxDropzoneVideoPreviewComponent } from './lib/ngx-dropzone-preview/ngx-dropzone-video-preview/ngx-dropzone-video-preview.component';\n\nexport { NgxDropzoneRemoveBadgeComponent } from './lib/ngx-dropzone-preview/ngx-dropzone-remove-badge/ngx-dropzone-remove-badge.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;MAGa,yBAAyB,CAAA;kIAAzB,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;sHAAzB,yBAAyB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAzB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBADrC,SAAS;mBAAC,EAAE,QAAQ,EAAE,oBAAoB,EAAE;;;MCWhC,+BAA+B,CAAA;kIAA/B,+BAA+B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAA/B,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,+BAA+B,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